Skip to content

Commit

Permalink
Include source module and symbol in web-types
Browse files Browse the repository at this point in the history
  • Loading branch information
Kouzukii committed Feb 27, 2024
1 parent 25aaf97 commit e35eb0b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/jet-brains-integration/src/types.d.ts
Expand Up @@ -20,6 +20,8 @@ export interface Options extends BaseOptions {
packageJson?: boolean;
/** Used to create a link within the component info bubble */
referenceTemplate?: (name: string, tag?: string) => Reference;
/** Don't generate source module and symbol reference */
excludeSource?: boolean;
}

export interface Params {
Expand Down
4 changes: 4 additions & 0 deletions packages/jet-brains-integration/src/web-types-generator.ts
Expand Up @@ -47,6 +47,10 @@ export function getTagList(
component.tagName || toKebabCase(component.name)
}${options.suffix}`,
description: getComponentDetailsTemplate(component, options),
source: options.excludeSource ? undefined : {
symbol: component.name,
module: component.module.path
},
["doc-url"]: reference?.url || "",
attributes: getComponentAttributes(component, options.typesSrc),
slots: component.slots?.map((slot) => {
Expand Down
2 changes: 1 addition & 1 deletion tools/cem-utils/src/cem-utilities.ts
Expand Up @@ -59,7 +59,7 @@ export function getComponents(
(dec) =>
!exclude?.includes(dec.name) &&
((dec as Component).customElement || (dec as Component).tagName)
) || []
).map(dec => ({...dec, module: mod})) || []
) || []
).flat() as Component[];
}
Expand Down

0 comments on commit e35eb0b

Please sign in to comment.