@contentful/experience-design-system-extraction 2.36.2-dev-build-c4497102.0 → 2.36.2-dev-build-a6f80ae6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +1 -1
- package/dist/src/extract/{framework-adapters/astro/extractor.d.ts → astro.d.ts} +1 -1
- package/dist/src/extract/astro.js +226 -0
- package/dist/src/extract/{framework-adapters/shared/helpers/file-processing/file-workers.d.ts → file-extraction-workers.d.ts} +13 -1
- package/dist/src/extract/{framework-adapters/shared/helpers/file-processing/file-workers.js → file-extraction-workers.js} +19 -0
- package/dist/src/extract/non-authorable-filter.d.ts +17 -0
- package/dist/src/extract/non-authorable-filter.js +60 -0
- package/dist/src/extract/pipeline.d.ts +7 -0
- package/dist/src/extract/pipeline.js +343 -0
- package/dist/src/extract/{framework-adapters/react/extractor.d.ts → react.d.ts} +1 -1
- package/dist/src/extract/react.js +2069 -0
- package/dist/src/extract/scoring.d.ts +12 -0
- package/dist/src/extract/{services/quality/helpers/scoring/collect-scoring-inputs.js → scoring.js} +24 -10
- package/dist/src/extract/slot-detection.d.ts +35 -0
- package/dist/src/extract/slot-detection.js +98 -0
- package/dist/src/extract/{services/quality/helpers/inspection/inspect-component-source.d.ts → source-inspection.d.ts} +6 -3
- package/dist/src/extract/{services/quality/helpers/inspection/inspect-component-source.js → source-inspection.js} +65 -5
- package/dist/src/extract/{framework-adapters/shared/helpers/get-node-source-lines.d.ts → source-line-metadata.d.ts} +1 -1
- package/dist/src/extract/{framework-adapters/stencil/extractor.d.ts → stencil.d.ts} +1 -1
- package/dist/src/extract/stencil.js +312 -0
- package/dist/src/extract/structural-slot-evidence.d.ts +63 -0
- package/dist/src/extract/structural-slot-evidence.js +278 -0
- package/dist/src/extract/{framework-adapters/svelte/extractor.d.ts → svelte.d.ts} +1 -2
- package/dist/src/extract/svelte.js +1309 -0
- package/dist/src/extract/tsx-shared.d.ts +37 -0
- package/dist/src/extract/tsx-shared.js +368 -0
- package/dist/src/extract/{services/quality/helpers/inspection/validate-extracted-components.d.ts → validate.d.ts} +1 -1
- package/dist/src/extract/{framework-adapters/vue-tsx/extractor.d.ts → vue-tsx.d.ts} +1 -1
- package/dist/src/extract/vue-tsx.js +449 -0
- package/dist/src/extract/{framework-adapters/vue/extractor.d.ts → vue.d.ts} +1 -1
- package/dist/src/extract/vue.js +605 -0
- package/dist/src/extract/{framework-adapters/web-components/extractor.d.ts → web-components.d.ts} +1 -1
- package/dist/src/extract/web-components.js +863 -0
- package/dist/src/index.d.ts +21 -27
- package/dist/src/index.js +17 -21
- package/dist/src/{extract/services/classification/classify-component-props.d.ts → pre-classify.d.ts} +5 -3
- package/dist/src/{extract/services/classification/classify-component-props.js → pre-classify.js} +100 -8
- package/dist/src/{extract/types/component.d.ts → types.d.ts} +22 -0
- package/dist/src/{extract/types/display.js → types.js} +1 -1
- package/package.json +1 -1
- package/dist/src/extract/controller/extract-controller.d.ts +0 -10
- package/dist/src/extract/controller/extract-controller.js +0 -33
- package/dist/src/extract/controller/helpers/validate-endpoint-request.d.ts +0 -2
- package/dist/src/extract/controller/helpers/validate-endpoint-request.js +0 -24
- package/dist/src/extract/framework-adapters/astro/extractor.js +0 -45
- package/dist/src/extract/framework-adapters/astro/frontmatter.d.ts +0 -11
- package/dist/src/extract/framework-adapters/astro/frontmatter.js +0 -96
- package/dist/src/extract/framework-adapters/astro/helpers/collect-astro-props-bindings.d.ts +0 -4
- package/dist/src/extract/framework-adapters/astro/helpers/collect-astro-props-bindings.js +0 -47
- package/dist/src/extract/framework-adapters/astro/slots.d.ts +0 -7
- package/dist/src/extract/framework-adapters/astro/slots.js +0 -44
- package/dist/src/extract/framework-adapters/react/extractor.js +0 -31
- package/dist/src/extract/framework-adapters/react/helpers/collect-dom-wrapper-contexts.d.ts +0 -4
- package/dist/src/extract/framework-adapters/react/helpers/collect-dom-wrapper-contexts.js +0 -73
- package/dist/src/extract/framework-adapters/react/helpers/collect-prop-dataflow.d.ts +0 -14
- package/dist/src/extract/framework-adapters/react/helpers/collect-prop-dataflow.js +0 -220
- package/dist/src/extract/framework-adapters/react/helpers/collect-react-impl-hints.d.ts +0 -5
- package/dist/src/extract/framework-adapters/react/helpers/collect-react-impl-hints.js +0 -32
- package/dist/src/extract/framework-adapters/react/helpers/detect-dom-is-pure-wrapper.d.ts +0 -2
- package/dist/src/extract/framework-adapters/react/helpers/detect-dom-is-pure-wrapper.js +0 -59
- package/dist/src/extract/framework-adapters/react/helpers/detect-dom-type-patterns.d.ts +0 -8
- package/dist/src/extract/framework-adapters/react/helpers/detect-dom-type-patterns.js +0 -29
- package/dist/src/extract/framework-adapters/react/helpers/detect-omit-wrapped-custom-props.d.ts +0 -2
- package/dist/src/extract/framework-adapters/react/helpers/detect-omit-wrapped-custom-props.js +0 -64
- package/dist/src/extract/framework-adapters/react/helpers/detect-pick-type-patterns.d.ts +0 -4
- package/dist/src/extract/framework-adapters/react/helpers/detect-pick-type-patterns.js +0 -64
- package/dist/src/extract/framework-adapters/react/helpers/detect-react-polymorphic.d.ts +0 -5
- package/dist/src/extract/framework-adapters/react/helpers/detect-react-polymorphic.js +0 -170
- package/dist/src/extract/framework-adapters/react/helpers/dom-attribute-surfaces.d.ts +0 -15
- package/dist/src/extract/framework-adapters/react/helpers/dom-attribute-surfaces.js +0 -231
- package/dist/src/extract/framework-adapters/react/helpers/extract-binding-fallback-props.d.ts +0 -4
- package/dist/src/extract/framework-adapters/react/helpers/extract-binding-fallback-props.js +0 -50
- package/dist/src/extract/framework-adapters/react/helpers/extract-from-react-source-file.d.ts +0 -5
- package/dist/src/extract/framework-adapters/react/helpers/extract-from-react-source-file.js +0 -23
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-allowed-components.d.ts +0 -2
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-allowed-components.js +0 -25
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-binding-defaults.d.ts +0 -6
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-binding-defaults.js +0 -48
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-component-from-export.d.ts +0 -15
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-component-from-export.js +0 -106
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-prop-types.d.ts +0 -3
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-prop-types.js +0 -64
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-props-from-type.d.ts +0 -15
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-props-from-type.js +0 -318
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-slots.d.ts +0 -6
- package/dist/src/extract/framework-adapters/react/helpers/extract-react-slots.js +0 -44
- package/dist/src/extract/framework-adapters/react/helpers/filter-impl-alias-props.d.ts +0 -4
- package/dist/src/extract/framework-adapters/react/helpers/filter-impl-alias-props.js +0 -52
- package/dist/src/extract/framework-adapters/react/helpers/infer-primitive-dom-props.d.ts +0 -6
- package/dist/src/extract/framework-adapters/react/helpers/infer-primitive-dom-props.js +0 -69
- package/dist/src/extract/framework-adapters/react/helpers/resolve-component-function.d.ts +0 -4
- package/dist/src/extract/framework-adapters/react/helpers/resolve-component-function.js +0 -131
- package/dist/src/extract/framework-adapters/react/helpers/resolve-react-prop-forwarding.d.ts +0 -8
- package/dist/src/extract/framework-adapters/react/helpers/resolve-react-prop-forwarding.js +0 -22
- package/dist/src/extract/framework-adapters/react/helpers/resolve-react-props-type.d.ts +0 -14
- package/dist/src/extract/framework-adapters/react/helpers/resolve-react-props-type.js +0 -86
- package/dist/src/extract/framework-adapters/react/helpers/synthesize-react-structural-slots.d.ts +0 -8
- package/dist/src/extract/framework-adapters/react/helpers/synthesize-react-structural-slots.js +0 -44
- package/dist/src/extract/framework-adapters/shared/helpers/build-component-lookup-maps.d.ts +0 -5
- package/dist/src/extract/framework-adapters/shared/helpers/build-component-lookup-maps.js +0 -10
- package/dist/src/extract/framework-adapters/shared/helpers/collect-jsdoc-slot-comments.d.ts +0 -2
- package/dist/src/extract/framework-adapters/shared/helpers/collect-jsdoc-slot-comments.js +0 -13
- package/dist/src/extract/framework-adapters/shared/helpers/file-processing/project-source-files.d.ts +0 -5
- package/dist/src/extract/framework-adapters/shared/helpers/file-processing/project-source-files.js +0 -13
- package/dist/src/extract/framework-adapters/shared/helpers/file-processing/result-normalizer.d.ts +0 -6
- package/dist/src/extract/framework-adapters/shared/helpers/file-processing/result-normalizer.js +0 -6
- package/dist/src/extract/framework-adapters/shared/helpers/find-tsx-workspace-package.d.ts +0 -2
- package/dist/src/extract/framework-adapters/shared/helpers/find-tsx-workspace-package.js +0 -62
- package/dist/src/extract/framework-adapters/shared/helpers/resolve-tsx-tsconfig-path.d.ts +0 -7
- package/dist/src/extract/framework-adapters/shared/helpers/resolve-tsx-tsconfig-path.js +0 -93
- package/dist/src/extract/framework-adapters/shared/helpers/resolve-tsx-workspace-imports.d.ts +0 -6
- package/dist/src/extract/framework-adapters/shared/helpers/resolve-tsx-workspace-imports.js +0 -58
- package/dist/src/extract/framework-adapters/shared/helpers/tsx-node-utils.d.ts +0 -13
- package/dist/src/extract/framework-adapters/shared/helpers/tsx-node-utils.js +0 -76
- package/dist/src/extract/framework-adapters/shared/helpers/tsx-renderable-exports.d.ts +0 -12
- package/dist/src/extract/framework-adapters/shared/helpers/tsx-renderable-exports.js +0 -35
- package/dist/src/extract/framework-adapters/shared/helpers/tsx-shared.d.ts +0 -14
- package/dist/src/extract/framework-adapters/shared/helpers/tsx-shared.js +0 -54
- package/dist/src/extract/framework-adapters/stencil/extractor.js +0 -82
- package/dist/src/extract/framework-adapters/stencil/helpers/detect-stencil-class.d.ts +0 -7
- package/dist/src/extract/framework-adapters/stencil/helpers/detect-stencil-class.js +0 -32
- package/dist/src/extract/framework-adapters/stencil/helpers/extract-stencil-props.d.ts +0 -5
- package/dist/src/extract/framework-adapters/stencil/helpers/extract-stencil-props.js +0 -62
- package/dist/src/extract/framework-adapters/stencil/helpers/extract-stencil-slots.d.ts +0 -6
- package/dist/src/extract/framework-adapters/stencil/helpers/extract-stencil-slots.js +0 -87
- package/dist/src/extract/framework-adapters/stencil/helpers/stencil-prop-helpers.d.ts +0 -5
- package/dist/src/extract/framework-adapters/stencil/helpers/stencil-prop-helpers.js +0 -39
- package/dist/src/extract/framework-adapters/svelte/extractor.js +0 -27
- package/dist/src/extract/framework-adapters/svelte/helpers/classify-svelte-props-annotation.d.ts +0 -6
- package/dist/src/extract/framework-adapters/svelte/helpers/classify-svelte-props-annotation.js +0 -51
- package/dist/src/extract/framework-adapters/svelte/helpers/collect-svelte-type-references.d.ts +0 -3
- package/dist/src/extract/framework-adapters/svelte/helpers/collect-svelte-type-references.js +0 -52
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-from-svelte-file.d.ts +0 -7
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-from-svelte-file.js +0 -90
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-ast-type-members.d.ts +0 -15
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-ast-type-members.js +0 -46
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-declaration-data.d.ts +0 -7
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-declaration-data.js +0 -64
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-external-type-members.d.ts +0 -4
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-external-type-members.js +0 -58
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-from-destructure.d.ts +0 -4
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-from-destructure.js +0 -85
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-props.d.ts +0 -22
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-props.js +0 -55
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-template-slots.d.ts +0 -7
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-template-slots.js +0 -63
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-type-member-props.d.ts +0 -3
- package/dist/src/extract/framework-adapters/svelte/helpers/extract-svelte-type-member-props.js +0 -31
- package/dist/src/extract/framework-adapters/svelte/helpers/find-svelte-script-declarations.d.ts +0 -8
- package/dist/src/extract/framework-adapters/svelte/helpers/find-svelte-script-declarations.js +0 -91
- package/dist/src/extract/framework-adapters/svelte/helpers/get-svelte-component-name.d.ts +0 -1
- package/dist/src/extract/framework-adapters/svelte/helpers/get-svelte-component-name.js +0 -26
- package/dist/src/extract/framework-adapters/svelte/helpers/render-svelte-type-strings.d.ts +0 -3
- package/dist/src/extract/framework-adapters/svelte/helpers/render-svelte-type-strings.js +0 -91
- package/dist/src/extract/framework-adapters/svelte/helpers/render-svelte-type.d.ts +0 -11
- package/dist/src/extract/framework-adapters/svelte/helpers/render-svelte-type.js +0 -68
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-dts-location.d.ts +0 -1
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-dts-location.js +0 -90
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-allowed-components.d.ts +0 -2
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-allowed-components.js +0 -20
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-external-type-readers.d.ts +0 -3
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-external-type-readers.js +0 -68
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-type-checker.d.ts +0 -4
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-type-checker.js +0 -68
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-type-members.d.ts +0 -6
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-type-members.js +0 -30
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-unresolved-retry.d.ts +0 -13
- package/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-unresolved-retry.js +0 -192
- package/dist/src/extract/framework-adapters/svelte/types/svelte-ast-node.d.ts +0 -12
- package/dist/src/extract/framework-adapters/svelte/types/svelte-ast-node.js +0 -1
- package/dist/src/extract/framework-adapters/vue/extractor.js +0 -61
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-object-props.d.ts +0 -3
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-object-props.js +0 -67
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-options-props.d.ts +0 -4
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-options-props.js +0 -72
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-setup-object-props.d.ts +0 -8
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-setup-object-props.js +0 -64
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-setup-props.d.ts +0 -2
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-setup-props.js +0 -66
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-slots.d.ts +0 -24
- package/dist/src/extract/framework-adapters/vue/helpers/extract-vue-slots.js +0 -56
- package/dist/src/extract/framework-adapters/vue/helpers/resolve-vue-component-name.d.ts +0 -2
- package/dist/src/extract/framework-adapters/vue/helpers/resolve-vue-component-name.js +0 -9
- package/dist/src/extract/framework-adapters/vue/helpers/resolve-workspace-module.d.ts +0 -1
- package/dist/src/extract/framework-adapters/vue/helpers/resolve-workspace-module.js +0 -76
- package/dist/src/extract/framework-adapters/vue/helpers/workspace-package-dirs.d.ts +0 -2
- package/dist/src/extract/framework-adapters/vue/helpers/workspace-package-dirs.js +0 -77
- package/dist/src/extract/framework-adapters/vue-tsx/extractor.js +0 -82
- package/dist/src/extract/framework-adapters/vue-tsx/helpers/extract-vue-tsx-props.d.ts +0 -5
- package/dist/src/extract/framework-adapters/vue-tsx/helpers/extract-vue-tsx-props.js +0 -189
- package/dist/src/extract/framework-adapters/vue-tsx/helpers/extract-vue-tsx-slots.d.ts +0 -4
- package/dist/src/extract/framework-adapters/vue-tsx/helpers/extract-vue-tsx-slots.js +0 -91
- package/dist/src/extract/framework-adapters/vue-tsx/helpers/resolve-ast-object.d.ts +0 -11
- package/dist/src/extract/framework-adapters/vue-tsx/helpers/resolve-ast-object.js +0 -95
- package/dist/src/extract/framework-adapters/web-components/extractor.js +0 -55
- package/dist/src/extract/framework-adapters/web-components/helpers/collect-wc-html-templates.d.ts +0 -4
- package/dist/src/extract/framework-adapters/web-components/helpers/collect-wc-html-templates.js +0 -67
- package/dist/src/extract/framework-adapters/web-components/helpers/detect-wc-non-public-members.d.ts +0 -9
- package/dist/src/extract/framework-adapters/web-components/helpers/detect-wc-non-public-members.js +0 -11
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-accessor-props.d.ts +0 -3
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-accessor-props.js +0 -65
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-class-properties.d.ts +0 -3
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-class-properties.js +0 -60
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-inheritance.d.ts +0 -4
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-inheritance.js +0 -16
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-jsdoc-attr-props.d.ts +0 -3
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-jsdoc-attr-props.js +0 -24
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-observed-attrs.d.ts +0 -3
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-observed-attrs.js +0 -27
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-slots.d.ts +0 -6
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-slots.js +0 -56
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-template-content.d.ts +0 -4
- package/dist/src/extract/framework-adapters/web-components/helpers/extract-wc-template-content.js +0 -49
- package/dist/src/extract/framework-adapters/web-components/helpers/merge-wc-prop-lists.d.ts +0 -9
- package/dist/src/extract/framework-adapters/web-components/helpers/merge-wc-prop-lists.js +0 -19
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-base-class.d.ts +0 -2
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-base-class.js +0 -59
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-decorator-tag.d.ts +0 -2
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-decorator-tag.js +0 -54
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-import-source.d.ts +0 -7
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-import-source.js +0 -47
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-import.d.ts +0 -4
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-import.js +0 -93
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-sibling-definition.d.ts +0 -4
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-sibling-definition.js +0 -79
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-tag-name.d.ts +0 -7
- package/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-tag-name.js +0 -62
- package/dist/src/extract/helpers/evidence/ast/collect-structural-jsx-evidence.d.ts +0 -5
- package/dist/src/extract/helpers/evidence/ast/collect-structural-jsx-evidence.js +0 -63
- package/dist/src/extract/helpers/evidence/ast/detect-react-node-types.d.ts +0 -2
- package/dist/src/extract/helpers/evidence/ast/detect-react-node-types.js +0 -24
- package/dist/src/extract/helpers/evidence/ast/get-jsx-ast-data.d.ts +0 -14
- package/dist/src/extract/helpers/evidence/ast/get-jsx-ast-data.js +0 -85
- package/dist/src/extract/helpers/evidence/collect-jsx-component-references.d.ts +0 -5
- package/dist/src/extract/helpers/evidence/collect-jsx-component-references.js +0 -52
- package/dist/src/extract/helpers/evidence/detect-slot-from-prop.d.ts +0 -16
- package/dist/src/extract/helpers/evidence/detect-slot-from-prop.js +0 -39
- package/dist/src/extract/orchestrator/execute-extraction-orchestrator.d.ts +0 -13
- package/dist/src/extract/orchestrator/execute-extraction-orchestrator.js +0 -17
- package/dist/src/extract/services/classification/helpers/check-prop-types.d.ts +0 -7
- package/dist/src/extract/services/classification/helpers/check-prop-types.js +0 -22
- package/dist/src/extract/services/classification/helpers/detect-dom-props.d.ts +0 -2
- package/dist/src/extract/services/classification/helpers/detect-dom-props.js +0 -63
- package/dist/src/extract/services/deduplication/deduplicate-components.d.ts +0 -2
- package/dist/src/extract/services/deduplication/deduplicate-components.js +0 -58
- package/dist/src/extract/services/deduplication/helpers/component-path-analysis.d.ts +0 -10
- package/dist/src/extract/services/deduplication/helpers/component-path-analysis.js +0 -85
- package/dist/src/extract/services/deduplication/helpers/component-path-scoring.d.ts +0 -10
- package/dist/src/extract/services/deduplication/helpers/component-path-scoring.js +0 -73
- package/dist/src/extract/services/extraction/extract-components.d.ts +0 -3
- package/dist/src/extract/services/extraction/extract-components.js +0 -19
- package/dist/src/extract/services/extraction/helpers/collect-sveltekit-route-exclusions.d.ts +0 -2
- package/dist/src/extract/services/extraction/helpers/collect-sveltekit-route-exclusions.js +0 -18
- package/dist/src/extract/services/extraction/helpers/filter-hook-components.d.ts +0 -6
- package/dist/src/extract/services/extraction/helpers/filter-hook-components.js +0 -18
- package/dist/src/extract/services/extraction/helpers/register-extractors.d.ts +0 -8
- package/dist/src/extract/services/extraction/helpers/register-extractors.js +0 -71
- package/dist/src/extract/services/extraction/helpers/run-extractor-batches.d.ts +0 -4
- package/dist/src/extract/services/extraction/helpers/run-extractor-batches.js +0 -24
- package/dist/src/extract/services/quality/evaluate-extraction-quality.d.ts +0 -4
- package/dist/src/extract/services/quality/evaluate-extraction-quality.js +0 -61
- package/dist/src/extract/services/quality/helpers/authorability/evaluate-authorability.d.ts +0 -28
- package/dist/src/extract/services/quality/helpers/authorability/evaluate-authorability.js +0 -67
- package/dist/src/extract/services/quality/helpers/inspection/detect-data-wrapper-patterns.d.ts +0 -16
- package/dist/src/extract/services/quality/helpers/inspection/detect-data-wrapper-patterns.js +0 -63
- package/dist/src/extract/services/quality/helpers/scoring/collect-scoring-inputs.d.ts +0 -14
- package/dist/src/extract/services/quality/helpers/scoring/compute-extraction-score.d.ts +0 -6
- package/dist/src/extract/services/quality/helpers/scoring/compute-extraction-score.js +0 -12
- package/dist/src/extract/types/classification.d.ts +0 -4
- package/dist/src/extract/types/classification.js +0 -1
- package/dist/src/extract/types/component-extractor.d.ts +0 -7
- package/dist/src/extract/types/component-extractor.js +0 -1
- package/dist/src/extract/types/component.js +0 -1
- package/dist/src/extract/types/contract.d.ts +0 -16
- package/dist/src/extract/types/contract.js +0 -1
- package/dist/src/extract/types/display.d.ts +0 -3
- package/dist/src/extract/types/options.d.ts +0 -15
- package/dist/src/extract/types/options.js +0 -1
- package/dist/src/extract/types/scoring.d.ts +0 -9
- package/dist/src/extract/types/scoring.js +0 -1
- package/dist/src/extract/types/source-inspection.d.ts +0 -5
- package/dist/src/extract/types/source-inspection.js +0 -1
- /package/dist/src/extract/{helpers/evidence/parse-source-imports.d.ts → parse-imported-names.d.ts} +0 -0
- /package/dist/src/extract/{helpers/evidence/parse-source-imports.js → parse-imported-names.js} +0 -0
- /package/dist/src/extract/{framework-adapters/shared/helpers/resolve-import-file-path.d.ts → resolve-local-module.d.ts} +0 -0
- /package/dist/src/extract/{framework-adapters/shared/helpers/resolve-import-file-path.js → resolve-local-module.js} +0 -0
- /package/dist/src/extract/{framework-adapters/shared/helpers/resolve-type-symbol.d.ts → resolve-type-property.d.ts} +0 -0
- /package/dist/src/extract/{framework-adapters/shared/helpers/resolve-type-symbol.js → resolve-type-property.js} +0 -0
- /package/dist/src/extract/{helpers/evidence/collect-allowed-component-names.d.ts → slot-allowed-components.d.ts} +0 -0
- /package/dist/src/extract/{helpers/evidence/collect-allowed-component-names.js → slot-allowed-components.js} +0 -0
- /package/dist/src/extract/{framework-adapters/shared/helpers/get-node-source-lines.js → source-line-metadata.js} +0 -0
- /package/dist/src/extract/{services/quality/helpers/inspection/validate-extracted-components.js → validate.js} +0 -0
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
2
|
-
import { Node } from 'ts-morph';
|
|
3
|
-
import { matchTsConfigPathPattern, substituteTsConfigPathTarget, resolveImportSourcePath, resolveRepoLocalAliasImportPath, } from './resolve-tsx-tsconfig-path.js';
|
|
4
|
-
import { findWorkspacePackageEntrySourceFile } from './find-tsx-workspace-package.js';
|
|
5
|
-
export { matchTsConfigPathPattern, substituteTsConfigPathTarget };
|
|
6
|
-
export function isBareModuleSpecifier(moduleSpecifier) {
|
|
7
|
-
return !moduleSpecifier.startsWith('.') && !moduleSpecifier.startsWith('/');
|
|
8
|
-
}
|
|
9
|
-
function findProjectSourceFileByImportPath(project, resolvedPath) {
|
|
10
|
-
const candidatePaths = [
|
|
11
|
-
resolvedPath,
|
|
12
|
-
`${resolvedPath}.ts`,
|
|
13
|
-
`${resolvedPath}.tsx`,
|
|
14
|
-
`${resolvedPath}.js`,
|
|
15
|
-
`${resolvedPath}.jsx`,
|
|
16
|
-
join(resolvedPath, 'index.ts'),
|
|
17
|
-
join(resolvedPath, 'index.tsx'),
|
|
18
|
-
join(resolvedPath, 'index.js'),
|
|
19
|
-
join(resolvedPath, 'index.jsx'),
|
|
20
|
-
];
|
|
21
|
-
for (const candidatePath of candidatePaths) {
|
|
22
|
-
const sourceFile = project.getSourceFile(candidatePath);
|
|
23
|
-
if (sourceFile)
|
|
24
|
-
return sourceFile;
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
function findRepoLocalAliasSourceFile(originSourceFile, moduleSpecifier) {
|
|
29
|
-
const resolvedPath = resolveRepoLocalAliasImportPath(originSourceFile.getFilePath(), moduleSpecifier);
|
|
30
|
-
if (!resolvedPath)
|
|
31
|
-
return undefined;
|
|
32
|
-
return findProjectSourceFileByImportPath(originSourceFile.getProject(), resolvedPath);
|
|
33
|
-
}
|
|
34
|
-
function getExportedDeclarationsForImportSpecifier(importSpecifier, sourceFile) {
|
|
35
|
-
if (!Node.isImportSpecifier(importSpecifier))
|
|
36
|
-
return [];
|
|
37
|
-
const exportedName = importSpecifier.getNameNode().getText();
|
|
38
|
-
return sourceFile.getExportedDeclarations().get(exportedName) ?? [];
|
|
39
|
-
}
|
|
40
|
-
export function resolveWorkspaceImportSpecifierDeclarations(importSpecifier, referenceNode) {
|
|
41
|
-
if (!Node.isImportSpecifier(importSpecifier))
|
|
42
|
-
return [];
|
|
43
|
-
const importDeclaration = importSpecifier.getImportDeclaration();
|
|
44
|
-
const moduleSpecifierSourceFile = importDeclaration.getModuleSpecifierSourceFile();
|
|
45
|
-
if (moduleSpecifierSourceFile)
|
|
46
|
-
return getExportedDeclarationsForImportSpecifier(importSpecifier, moduleSpecifierSourceFile);
|
|
47
|
-
const moduleSpecifier = importDeclaration.getModuleSpecifierValue();
|
|
48
|
-
if (!isBareModuleSpecifier(moduleSpecifier))
|
|
49
|
-
return [];
|
|
50
|
-
const workspaceEntrySourceFile = findWorkspacePackageEntrySourceFile(referenceNode.getSourceFile(), moduleSpecifier);
|
|
51
|
-
if (workspaceEntrySourceFile)
|
|
52
|
-
return getExportedDeclarationsForImportSpecifier(importSpecifier, workspaceEntrySourceFile);
|
|
53
|
-
const aliasedSourceFile = findRepoLocalAliasSourceFile(referenceNode.getSourceFile(), moduleSpecifier);
|
|
54
|
-
if (!aliasedSourceFile)
|
|
55
|
-
return [];
|
|
56
|
-
return getExportedDeclarationsForImportSpecifier(importSpecifier, aliasedSourceFile);
|
|
57
|
-
}
|
|
58
|
-
export { resolveImportSourcePath };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Node, type Type } from 'ts-morph';
|
|
2
|
-
export declare function kebabToPascal(input: string): string;
|
|
3
|
-
export declare function extractAllowedValues(type: Type): string[] | undefined;
|
|
4
|
-
export declare function isIntrinsicJsxElement(tagName: string): boolean;
|
|
5
|
-
export declare function getJsxTagNameNode(node: Node): Node | undefined;
|
|
6
|
-
export declare function getNodeDefinitions(node: Node): {
|
|
7
|
-
getDeclarationNode(): Node | undefined;
|
|
8
|
-
}[];
|
|
9
|
-
export declare function getTypeTargetDeclarations(targetNode: Node, allowWorkspaceImportFallback?: boolean): Node[];
|
|
10
|
-
export declare function getValueTargetDeclarations(targetNode: Node): Node[];
|
|
11
|
-
export declare function getTypeReferenceTargetNode(typeNode: Node): Node | undefined;
|
|
12
|
-
export declare function getTypeReferenceArguments(typeNode: Node): Node[];
|
|
13
|
-
export declare function getTypeReferenceName(typeNode: Node): string | undefined;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Node, SyntaxKind } from 'ts-morph';
|
|
2
|
-
import { resolveWorkspaceImportSpecifierDeclarations } from './resolve-tsx-workspace-imports.js';
|
|
3
|
-
export function kebabToPascal(input) {
|
|
4
|
-
return input
|
|
5
|
-
.split('-')
|
|
6
|
-
.filter(Boolean)
|
|
7
|
-
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
8
|
-
.join('');
|
|
9
|
-
}
|
|
10
|
-
export function extractAllowedValues(type) {
|
|
11
|
-
if (!type.isUnion())
|
|
12
|
-
return undefined;
|
|
13
|
-
const literals = type
|
|
14
|
-
.getUnionTypes()
|
|
15
|
-
.filter((t) => t.isStringLiteral())
|
|
16
|
-
.map((t) => t.getLiteralValueOrThrow());
|
|
17
|
-
return literals.length >= 2 ? literals.sort() : undefined;
|
|
18
|
-
}
|
|
19
|
-
export function isIntrinsicJsxElement(tagName) {
|
|
20
|
-
return /^[a-z][A-Za-z0-9]*$/.test(tagName);
|
|
21
|
-
}
|
|
22
|
-
export function getJsxTagNameNode(node) {
|
|
23
|
-
const openingElement = node.getFirstAncestorByKind(SyntaxKind.JsxOpeningElement);
|
|
24
|
-
const selfClosingElement = node.getFirstAncestorByKind(SyntaxKind.JsxSelfClosingElement);
|
|
25
|
-
return openingElement?.getTagNameNode() ?? selfClosingElement?.getTagNameNode();
|
|
26
|
-
}
|
|
27
|
-
export function getNodeDefinitions(node) {
|
|
28
|
-
const anyNode = node;
|
|
29
|
-
return anyNode.getDefinitions?.() ?? [];
|
|
30
|
-
}
|
|
31
|
-
export function getTypeTargetDeclarations(targetNode, allowWorkspaceImportFallback = false) {
|
|
32
|
-
return getNodeDefinitions(targetNode).flatMap((definition) => {
|
|
33
|
-
const declaration = definition.getDeclarationNode();
|
|
34
|
-
if (!declaration)
|
|
35
|
-
return [];
|
|
36
|
-
if (!allowWorkspaceImportFallback || !Node.isImportSpecifier(declaration)) {
|
|
37
|
-
return [declaration];
|
|
38
|
-
}
|
|
39
|
-
const resolvedDeclarations = resolveWorkspaceImportSpecifierDeclarations(declaration, targetNode);
|
|
40
|
-
return resolvedDeclarations.length > 0 ? resolvedDeclarations : [declaration];
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
export function getValueTargetDeclarations(targetNode) {
|
|
44
|
-
return getNodeDefinitions(targetNode).flatMap((definition) => {
|
|
45
|
-
const declaration = definition.getDeclarationNode();
|
|
46
|
-
if (!declaration)
|
|
47
|
-
return [];
|
|
48
|
-
if (!Node.isImportSpecifier(declaration)) {
|
|
49
|
-
return [declaration];
|
|
50
|
-
}
|
|
51
|
-
const resolvedDeclarations = resolveWorkspaceImportSpecifierDeclarations(declaration, targetNode);
|
|
52
|
-
return resolvedDeclarations.length > 0 ? resolvedDeclarations : [declaration];
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
export function getTypeReferenceTargetNode(typeNode) {
|
|
56
|
-
if (Node.isTypeReference(typeNode))
|
|
57
|
-
return typeNode.getTypeName();
|
|
58
|
-
if (Node.isExpressionWithTypeArguments(typeNode))
|
|
59
|
-
return typeNode.getExpression();
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
export function getTypeReferenceArguments(typeNode) {
|
|
63
|
-
if (Node.isTypeReference(typeNode) || Node.isExpressionWithTypeArguments(typeNode)) {
|
|
64
|
-
return typeNode.getTypeArguments();
|
|
65
|
-
}
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
export function getTypeReferenceName(typeNode) {
|
|
69
|
-
if (Node.isTypeReference(typeNode)) {
|
|
70
|
-
return typeNode.getTypeName().getText().split('.').pop();
|
|
71
|
-
}
|
|
72
|
-
if (Node.isExpressionWithTypeArguments(typeNode)) {
|
|
73
|
-
return typeNode.getExpression().getText().split('.').pop();
|
|
74
|
-
}
|
|
75
|
-
return undefined;
|
|
76
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Node, type SourceFile } from 'ts-morph';
|
|
2
|
-
import type { ExtractionExclusion } from '../../../types/component.js';
|
|
3
|
-
export declare function resolveDefaultExportName(declarations: Node[], exported: {
|
|
4
|
-
has(name: string): boolean;
|
|
5
|
-
}, allowVariableDeclaration?: boolean): string | undefined;
|
|
6
|
-
export declare function getRenderableExports(sourceFile: SourceFile, exclusions: ExtractionExclusion[], options: {
|
|
7
|
-
allowVariableDeclaration?: boolean;
|
|
8
|
-
hookReason: string;
|
|
9
|
-
}): Array<{
|
|
10
|
-
name: string;
|
|
11
|
-
declarations: Node[];
|
|
12
|
-
}>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Node } from 'ts-morph';
|
|
2
|
-
export function resolveDefaultExportName(declarations, exported, allowVariableDeclaration = false) {
|
|
3
|
-
const declaration = declarations[0];
|
|
4
|
-
const name = Node.isFunctionDeclaration(declaration)
|
|
5
|
-
? declaration.getName()
|
|
6
|
-
: allowVariableDeclaration && Node.isVariableDeclaration(declaration)
|
|
7
|
-
? declaration.getName()
|
|
8
|
-
: undefined;
|
|
9
|
-
if (!name || !/^[A-Z]/.test(name) || exported.has(name))
|
|
10
|
-
return undefined;
|
|
11
|
-
return name;
|
|
12
|
-
}
|
|
13
|
-
export function getRenderableExports(sourceFile, exclusions, options) {
|
|
14
|
-
const renderable = [];
|
|
15
|
-
const exported = sourceFile.getExportedDeclarations();
|
|
16
|
-
for (const [exportKey, declarations] of exported) {
|
|
17
|
-
const name = exportKey === 'default'
|
|
18
|
-
? resolveDefaultExportName(declarations, exported, options.allowVariableDeclaration)
|
|
19
|
-
: exportKey;
|
|
20
|
-
if (!name || !/^[A-Z]/.test(name))
|
|
21
|
-
continue;
|
|
22
|
-
if (name.startsWith('use')) {
|
|
23
|
-
exclusions.push({
|
|
24
|
-
itemType: 'component',
|
|
25
|
-
name,
|
|
26
|
-
source: sourceFile.getFilePath(),
|
|
27
|
-
reason: options.hookReason,
|
|
28
|
-
stage: 'component-filter',
|
|
29
|
-
});
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
renderable.push({ name, declarations });
|
|
33
|
-
}
|
|
34
|
-
return renderable;
|
|
35
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Project, type SourceFile } from 'ts-morph';
|
|
2
|
-
import type { ExtractionExclusion } from '../../../types/component.js';
|
|
3
|
-
export { kebabToPascal, extractAllowedValues, isIntrinsicJsxElement, getJsxTagNameNode, getNodeDefinitions, getTypeTargetDeclarations, getValueTargetDeclarations, getTypeReferenceName, } from './tsx-node-utils.js';
|
|
4
|
-
export { resolveDefaultExportName, getRenderableExports } from './tsx-renderable-exports.js';
|
|
5
|
-
export declare function getTsxExtractionContext(filePaths: string[], componentFilePattern: RegExp): {
|
|
6
|
-
componentFiles: string[];
|
|
7
|
-
project: Project;
|
|
8
|
-
} | undefined;
|
|
9
|
-
export declare function extractTsxComponents<T>(filePaths: string[], componentFilePattern: RegExp, extract: (sourceFile: SourceFile, exclusions: ExtractionExclusion[]) => T[]): {
|
|
10
|
-
components: T[];
|
|
11
|
-
warnings: string[];
|
|
12
|
-
exclusions: ExtractionExclusion[];
|
|
13
|
-
project?: Project;
|
|
14
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Project } from 'ts-morph';
|
|
2
|
-
export { kebabToPascal, extractAllowedValues, isIntrinsicJsxElement, getJsxTagNameNode, getNodeDefinitions, getTypeTargetDeclarations, getValueTargetDeclarations, getTypeReferenceName, } from './tsx-node-utils.js';
|
|
3
|
-
export { resolveDefaultExportName, getRenderableExports } from './tsx-renderable-exports.js';
|
|
4
|
-
function createTsxProject(filePaths) {
|
|
5
|
-
const project = new Project({
|
|
6
|
-
compilerOptions: {
|
|
7
|
-
jsx: 1,
|
|
8
|
-
target: 99,
|
|
9
|
-
module: 99,
|
|
10
|
-
moduleResolution: 100,
|
|
11
|
-
skipLibCheck: true,
|
|
12
|
-
allowJs: true,
|
|
13
|
-
},
|
|
14
|
-
skipAddingFilesFromTsConfig: true,
|
|
15
|
-
});
|
|
16
|
-
for (const filePath of filePaths) {
|
|
17
|
-
project.addSourceFileAtPath(filePath);
|
|
18
|
-
}
|
|
19
|
-
return project;
|
|
20
|
-
}
|
|
21
|
-
function getTsxProjectFiles(filePaths) {
|
|
22
|
-
return filePaths.filter((filePath) => /\.[jt]sx?$/.test(filePath) && !filePath.endsWith('.d.ts'));
|
|
23
|
-
}
|
|
24
|
-
export function getTsxExtractionContext(filePaths, componentFilePattern) {
|
|
25
|
-
const componentFiles = filePaths.filter((filePath) => componentFilePattern.test(filePath));
|
|
26
|
-
if (componentFiles.length === 0)
|
|
27
|
-
return undefined;
|
|
28
|
-
return {
|
|
29
|
-
componentFiles,
|
|
30
|
-
project: createTsxProject(getTsxProjectFiles(filePaths)),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export function extractTsxComponents(filePaths, componentFilePattern, extract) {
|
|
34
|
-
const extractionContext = getTsxExtractionContext(filePaths, componentFilePattern);
|
|
35
|
-
if (!extractionContext) {
|
|
36
|
-
return { components: [], warnings: [], exclusions: [] };
|
|
37
|
-
}
|
|
38
|
-
const { componentFiles, project } = extractionContext;
|
|
39
|
-
const components = [];
|
|
40
|
-
const warnings = [];
|
|
41
|
-
const exclusions = [];
|
|
42
|
-
for (const filePath of componentFiles) {
|
|
43
|
-
try {
|
|
44
|
-
const sourceFile = project.getSourceFile(filePath);
|
|
45
|
-
if (!sourceFile)
|
|
46
|
-
continue;
|
|
47
|
-
components.push(...extract(sourceFile, exclusions));
|
|
48
|
-
}
|
|
49
|
-
catch (e) {
|
|
50
|
-
warnings.push(`Failed to extract from ${filePath}: ${e instanceof Error ? e.message : String(e)}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return { components, warnings, exclusions, project };
|
|
54
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Project, Node } from 'ts-morph';
|
|
2
|
-
import { kebabToPascal } from '../shared/helpers/tsx-shared.js';
|
|
3
|
-
import { createSortedExtractionResult } from '../shared/helpers/file-processing/result-normalizer.js';
|
|
4
|
-
import { extractProjectSourceFiles } from '../shared/helpers/file-processing/project-source-files.js';
|
|
5
|
-
import { isStencilFile, readComponentTag, hasPropertyDecorator } from './helpers/detect-stencil-class.js';
|
|
6
|
-
import { extractStencilProps } from './helpers/extract-stencil-props.js';
|
|
7
|
-
import { extractStencilSlots } from './helpers/extract-stencil-slots.js';
|
|
8
|
-
function collectEventNames(classDecl) {
|
|
9
|
-
const eventNames = [];
|
|
10
|
-
for (const property of classDecl.getProperties()) {
|
|
11
|
-
if (!hasPropertyDecorator(property, 'Event'))
|
|
12
|
-
continue;
|
|
13
|
-
eventNames.push(property.getName());
|
|
14
|
-
}
|
|
15
|
-
return eventNames.sort();
|
|
16
|
-
}
|
|
17
|
-
function detectFunctionalComponents(sourceFile, warnings) {
|
|
18
|
-
for (const [exportName, declarations] of sourceFile.getExportedDeclarations()) {
|
|
19
|
-
for (const decl of declarations) {
|
|
20
|
-
if (!Node.isVariableDeclaration(decl))
|
|
21
|
-
continue;
|
|
22
|
-
const typeNode = decl.getTypeNode();
|
|
23
|
-
if (!typeNode)
|
|
24
|
-
continue;
|
|
25
|
-
if (!typeNode.getText().startsWith('FunctionalComponent'))
|
|
26
|
-
continue;
|
|
27
|
-
warnings.push(`Stencil FunctionalComponent detected but not extracted: ${exportName} in ${sourceFile.getFilePath()}`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function extractFromStencilSourceFile(sourceFile, warnings) {
|
|
32
|
-
const components = [];
|
|
33
|
-
for (const classDecl of sourceFile.getClasses()) {
|
|
34
|
-
const tag = readComponentTag(classDecl);
|
|
35
|
-
if (!tag)
|
|
36
|
-
continue;
|
|
37
|
-
const name = kebabToPascal(tag);
|
|
38
|
-
const props = extractStencilProps(classDecl);
|
|
39
|
-
const slots = extractStencilSlots(classDecl, warnings, name);
|
|
40
|
-
const eventNames = collectEventNames(classDecl);
|
|
41
|
-
if (eventNames.length > 0) {
|
|
42
|
-
warnings.push(`Component ${name} has ${eventNames.length} events not captured: ${eventNames.join(', ')}`);
|
|
43
|
-
}
|
|
44
|
-
components.push({
|
|
45
|
-
name,
|
|
46
|
-
source: sourceFile.getFilePath(),
|
|
47
|
-
sourcePath: sourceFile.getFilePath(),
|
|
48
|
-
framework: 'stencil',
|
|
49
|
-
props,
|
|
50
|
-
slots,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return components;
|
|
54
|
-
}
|
|
55
|
-
export async function extractStencilComponents(filePaths) {
|
|
56
|
-
const tsxFiles = filePaths.filter((f) => /\.[jt]sx$/.test(f));
|
|
57
|
-
if (tsxFiles.length === 0) {
|
|
58
|
-
return { components: [], warnings: [] };
|
|
59
|
-
}
|
|
60
|
-
const project = new Project({
|
|
61
|
-
compilerOptions: {
|
|
62
|
-
jsx: 1, // JsxEmit.Preserve
|
|
63
|
-
target: 99, // ScriptTarget.ESNext
|
|
64
|
-
module: 99, // ModuleKind.ESNext
|
|
65
|
-
moduleResolution: 100, // ModuleResolutionKind.Bundler
|
|
66
|
-
skipLibCheck: true,
|
|
67
|
-
allowJs: true,
|
|
68
|
-
},
|
|
69
|
-
skipAddingFilesFromTsConfig: true,
|
|
70
|
-
});
|
|
71
|
-
for (const filePath of tsxFiles) {
|
|
72
|
-
project.addSourceFileAtPath(filePath);
|
|
73
|
-
}
|
|
74
|
-
const { items: components, warnings } = extractProjectSourceFiles(project, (sourceFile, sourceWarnings) => {
|
|
75
|
-
if (!isStencilFile(sourceFile))
|
|
76
|
-
return [];
|
|
77
|
-
const extracted = extractFromStencilSourceFile(sourceFile, sourceWarnings);
|
|
78
|
-
detectFunctionalComponents(sourceFile, sourceWarnings);
|
|
79
|
-
return extracted;
|
|
80
|
-
});
|
|
81
|
-
return createSortedExtractionResult(components, warnings);
|
|
82
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Node, type SourceFile, type ClassDeclaration } from 'ts-morph';
|
|
2
|
-
/** Returns true when the file imports from @stencil/core — used to skip non-Stencil files. */
|
|
3
|
-
export declare function isStencilFile(sourceFile: SourceFile): boolean;
|
|
4
|
-
/** Reads the `tag` value from the @Component({ tag: '...' }) decorator on a class. */
|
|
5
|
-
export declare function readComponentTag(classDecl: ClassDeclaration): string | undefined;
|
|
6
|
-
/** Returns true when the node is a property declaration with a given decorator name. */
|
|
7
|
-
export declare function hasPropertyDecorator(node: Node, decoratorName: string): boolean;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Node } from 'ts-morph';
|
|
2
|
-
/** Returns true when the file imports from @stencil/core — used to skip non-Stencil files. */
|
|
3
|
-
export function isStencilFile(sourceFile) {
|
|
4
|
-
return sourceFile.getImportDeclarations().some((imp) => imp.getModuleSpecifierValue() === '@stencil/core');
|
|
5
|
-
}
|
|
6
|
-
/** Reads the `tag` value from the @Component({ tag: '...' }) decorator on a class. */
|
|
7
|
-
export function readComponentTag(classDecl) {
|
|
8
|
-
for (const decorator of classDecl.getDecorators()) {
|
|
9
|
-
if (decorator.getName() !== 'Component')
|
|
10
|
-
continue;
|
|
11
|
-
const args = decorator.getArguments();
|
|
12
|
-
if (args.length === 0)
|
|
13
|
-
continue;
|
|
14
|
-
const arg = args[0];
|
|
15
|
-
if (!Node.isObjectLiteralExpression(arg))
|
|
16
|
-
continue;
|
|
17
|
-
const tagProp = arg.getProperty('tag');
|
|
18
|
-
if (!tagProp || !Node.isPropertyAssignment(tagProp))
|
|
19
|
-
continue;
|
|
20
|
-
const initializer = tagProp.getInitializer();
|
|
21
|
-
if (!initializer || !Node.isStringLiteral(initializer))
|
|
22
|
-
continue;
|
|
23
|
-
return initializer.getLiteralValue();
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
/** Returns true when the node is a property declaration with a given decorator name. */
|
|
28
|
-
export function hasPropertyDecorator(node, decoratorName) {
|
|
29
|
-
if (!Node.isPropertyDeclaration(node))
|
|
30
|
-
return false;
|
|
31
|
-
return node.getDecorators().some((d) => d.getName() === decoratorName);
|
|
32
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type ClassDeclaration } from 'ts-morph';
|
|
2
|
-
import type { RawPropDefinition } from '../../../types/component.js';
|
|
3
|
-
export { parseAllowedValues, collectDomAttributePropNames } from './stencil-prop-helpers.js';
|
|
4
|
-
/** Extracts all @Prop-decorated properties from a Stencil class as RawPropDefinitions. */
|
|
5
|
-
export declare function extractStencilProps(classDecl: ClassDeclaration): RawPropDefinition[];
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Node } from 'ts-morph';
|
|
2
|
-
import { hasPropertyDecorator } from './detect-stencil-class.js';
|
|
3
|
-
import { parseAllowedValues, collectDomAttributePropNames } from './stencil-prop-helpers.js';
|
|
4
|
-
export { parseAllowedValues, collectDomAttributePropNames } from './stencil-prop-helpers.js';
|
|
5
|
-
/** Extracts all @Prop-decorated properties from a Stencil class as RawPropDefinitions. */
|
|
6
|
-
export function extractStencilProps(classDecl) {
|
|
7
|
-
const props = [];
|
|
8
|
-
const propNames = new Set(classDecl
|
|
9
|
-
.getProperties()
|
|
10
|
-
.filter((property) => hasPropertyDecorator(property, 'Prop'))
|
|
11
|
-
.map((property) => property.getName()));
|
|
12
|
-
const domAttributePropNames = collectDomAttributePropNames(classDecl, propNames);
|
|
13
|
-
for (const property of classDecl.getProperties()) {
|
|
14
|
-
if (!hasPropertyDecorator(property, 'Prop'))
|
|
15
|
-
continue;
|
|
16
|
-
const name = property.getName();
|
|
17
|
-
const typeNode = property.getTypeNode();
|
|
18
|
-
const typeText = typeNode ? typeNode.getText() : 'unknown';
|
|
19
|
-
const hasQuestionToken = property.hasQuestionToken();
|
|
20
|
-
const hasExclamation = property.hasExclamationToken();
|
|
21
|
-
const initializer = property.getInitializer();
|
|
22
|
-
let defaultValue;
|
|
23
|
-
if (initializer) {
|
|
24
|
-
defaultValue = Node.isStringLiteral(initializer) ? initializer.getLiteralValue() : initializer.getText();
|
|
25
|
-
}
|
|
26
|
-
const isRequired = hasExclamation || (!hasQuestionToken && !initializer);
|
|
27
|
-
const jsDocs = property.getJsDocs();
|
|
28
|
-
let description;
|
|
29
|
-
let isDeprecated = false;
|
|
30
|
-
if (jsDocs.length > 0) {
|
|
31
|
-
const jsDoc = jsDocs[0];
|
|
32
|
-
description = jsDoc.getDescription().trim() || undefined;
|
|
33
|
-
for (const tag of jsDoc.getTags()) {
|
|
34
|
-
if (tag.getTagName() === 'deprecated') {
|
|
35
|
-
isDeprecated = true;
|
|
36
|
-
const tagComment = tag.getCommentText()?.trim();
|
|
37
|
-
if (tagComment && !description)
|
|
38
|
-
description = tagComment;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (isDeprecated && description) {
|
|
43
|
-
description = `[DEPRECATED] ${description}`;
|
|
44
|
-
}
|
|
45
|
-
else if (isDeprecated) {
|
|
46
|
-
description = '[DEPRECATED]';
|
|
47
|
-
}
|
|
48
|
-
const allowedValues = parseAllowedValues(typeText);
|
|
49
|
-
props.push({
|
|
50
|
-
name,
|
|
51
|
-
type: typeText,
|
|
52
|
-
required: isRequired,
|
|
53
|
-
...(defaultValue !== undefined && { defaultValue }),
|
|
54
|
-
...(description && { description }),
|
|
55
|
-
...(allowedValues && { allowedValues }),
|
|
56
|
-
...(domAttributePropNames.has(name) && { domAttribute: true }),
|
|
57
|
-
sourceStartLine: property.getStartLineNumber(),
|
|
58
|
-
sourceEndLine: property.getEndLineNumber(),
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return props.sort((a, b) => a.name.localeCompare(b.name));
|
|
62
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type ClassDeclaration } from 'ts-morph';
|
|
2
|
-
import type { RawSlotDefinition } from '../../../types/component.js';
|
|
3
|
-
/** Normalises a raw slot name string to a RawSlotDefinition, treating blank/undefined as "default". */
|
|
4
|
-
export declare function parseStencilSlot(name: string | undefined): RawSlotDefinition;
|
|
5
|
-
/** Extracts all slots from a Stencil class — via @slot JSDoc tags and template <slot> elements. */
|
|
6
|
-
export declare function extractStencilSlots(classDecl: ClassDeclaration, warnings: string[], componentName: string): RawSlotDefinition[];
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { Node } from 'ts-morph';
|
|
2
|
-
import { collectJsDocSlotComments } from '../../shared/helpers/collect-jsdoc-slot-comments.js';
|
|
3
|
-
/** Normalises a raw slot name string to a RawSlotDefinition, treating blank/undefined as "default". */
|
|
4
|
-
export function parseStencilSlot(name) {
|
|
5
|
-
const normalizedName = name && name.length > 0 ? name : 'default';
|
|
6
|
-
return { name: normalizedName, isDefault: normalizedName === 'default' };
|
|
7
|
-
}
|
|
8
|
-
/** Extracts all slots from a Stencil class — via @slot JSDoc tags and template <slot> elements. */
|
|
9
|
-
export function extractStencilSlots(classDecl, warnings, componentName) {
|
|
10
|
-
const slots = new Map();
|
|
11
|
-
const upsertSlot = (slot) => {
|
|
12
|
-
const existing = slots.get(slot.name);
|
|
13
|
-
if (!existing) {
|
|
14
|
-
slots.set(slot.name, slot);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
slots.set(slot.name, {
|
|
18
|
-
...existing,
|
|
19
|
-
...slot,
|
|
20
|
-
description: existing.description ?? slot.description,
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
// JSDoc @slot tags
|
|
24
|
-
for (const comment of collectJsDocSlotComments(classDecl)) {
|
|
25
|
-
if (comment.startsWith('{')) {
|
|
26
|
-
try {
|
|
27
|
-
const parsed = JSON.parse(comment);
|
|
28
|
-
const slot = parseStencilSlot(parsed.name);
|
|
29
|
-
let description = parsed.description || undefined;
|
|
30
|
-
if (parsed.isDeprecated && description) {
|
|
31
|
-
description = `[DEPRECATED] ${description}`;
|
|
32
|
-
}
|
|
33
|
-
else if (parsed.isDeprecated) {
|
|
34
|
-
description = '[DEPRECATED]';
|
|
35
|
-
}
|
|
36
|
-
upsertSlot({ ...slot, ...(description && { description }) });
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
warnings.push(`Failed to parse @slot JSDoc in ${componentName}: invalid JSON "${comment}"`);
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const match = comment.match(/^(?:(\S+)\s*-\s*)?(.*)$/s);
|
|
45
|
-
if (!match)
|
|
46
|
-
continue;
|
|
47
|
-
const [, rawName, rawDescription] = match;
|
|
48
|
-
const slot = parseStencilSlot(rawName);
|
|
49
|
-
const description = rawDescription.trim() || undefined;
|
|
50
|
-
upsertSlot({ ...slot, ...(description && { description }) });
|
|
51
|
-
}
|
|
52
|
-
// Template <slot> elements
|
|
53
|
-
for (const method of classDecl.getMethods()) {
|
|
54
|
-
method.forEachDescendant((node) => {
|
|
55
|
-
if (!Node.isJsxSelfClosingElement(node) && !Node.isJsxElement(node))
|
|
56
|
-
return;
|
|
57
|
-
const openingElement = Node.isJsxElement(node) ? node.getOpeningElement() : node;
|
|
58
|
-
const tagName = openingElement.getTagNameNode().getText();
|
|
59
|
-
const slotAttribute = openingElement
|
|
60
|
-
.getAttributes()
|
|
61
|
-
.find((attribute) => Node.isJsxAttribute(attribute) && attribute.getNameNode().getText() === 'slot');
|
|
62
|
-
if (tagName === 'slot') {
|
|
63
|
-
const nameAttribute = openingElement
|
|
64
|
-
.getAttributes()
|
|
65
|
-
.find((attribute) => Node.isJsxAttribute(attribute) && attribute.getNameNode().getText() === 'name');
|
|
66
|
-
const initializer = Node.isJsxAttribute(nameAttribute) ? nameAttribute.getInitializer() : undefined;
|
|
67
|
-
const name = initializer && Node.isStringLiteral(initializer)
|
|
68
|
-
? initializer.getLiteralValue()
|
|
69
|
-
: initializer && Node.isJsxExpression(initializer)
|
|
70
|
-
? (initializer.getExpression()?.getText() ?? '')
|
|
71
|
-
: '';
|
|
72
|
-
upsertSlot({ ...parseStencilSlot(name) });
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (!Node.isJsxAttribute(slotAttribute))
|
|
76
|
-
return;
|
|
77
|
-
const initializer = slotAttribute.getInitializer();
|
|
78
|
-
if (!initializer || !Node.isStringLiteral(initializer))
|
|
79
|
-
return;
|
|
80
|
-
const name = initializer.getLiteralValue();
|
|
81
|
-
if (!name)
|
|
82
|
-
return;
|
|
83
|
-
upsertSlot({ name, isDefault: false });
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
return [...slots.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
87
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type ClassDeclaration } from 'ts-morph';
|
|
2
|
-
/** Parses string literal union type text and returns the sorted values, or undefined if not a literal union. */
|
|
3
|
-
export declare function parseAllowedValues(typeText: string): string[] | undefined;
|
|
4
|
-
/** Finds @Prop-decorated properties that are forwarded directly to intrinsic DOM attributes. */
|
|
5
|
-
export declare function collectDomAttributePropNames(classDecl: ClassDeclaration, propNames: Set<string>): Set<string>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Node, SyntaxKind } from 'ts-morph';
|
|
2
|
-
import { getJsxTagNameNode, isIntrinsicJsxElement } from '../../shared/helpers/tsx-shared.js';
|
|
3
|
-
/** Parses string literal union type text and returns the sorted values, or undefined if not a literal union. */
|
|
4
|
-
export function parseAllowedValues(typeText) {
|
|
5
|
-
const literalPattern = /^'[^']*'(?:\s*\|\s*'[^']*')+$/;
|
|
6
|
-
if (!literalPattern.test(typeText.trim()))
|
|
7
|
-
return undefined;
|
|
8
|
-
const values = typeText
|
|
9
|
-
.split('|')
|
|
10
|
-
.map((v) => v.trim().replace(/^'|'$/g, ''))
|
|
11
|
-
.filter(Boolean)
|
|
12
|
-
.sort();
|
|
13
|
-
return values.length >= 2 ? values : undefined;
|
|
14
|
-
}
|
|
15
|
-
/** Finds @Prop-decorated properties that are forwarded directly to intrinsic DOM attributes. */
|
|
16
|
-
export function collectDomAttributePropNames(classDecl, propNames) {
|
|
17
|
-
const domAttributeProps = new Set();
|
|
18
|
-
const renderMethod = classDecl.getMethod('render');
|
|
19
|
-
if (!renderMethod)
|
|
20
|
-
return domAttributeProps;
|
|
21
|
-
for (const attribute of renderMethod.getDescendantsOfKind(SyntaxKind.JsxAttribute)) {
|
|
22
|
-
const tagName = getJsxTagNameNode(attribute)?.getText();
|
|
23
|
-
const attributeName = attribute.getNameNode().getText();
|
|
24
|
-
if (!tagName || !propNames.has(attributeName) || !isIntrinsicJsxElement(tagName))
|
|
25
|
-
continue;
|
|
26
|
-
const initializer = attribute.getInitializer();
|
|
27
|
-
if (!initializer || !Node.isJsxExpression(initializer))
|
|
28
|
-
continue;
|
|
29
|
-
const expression = initializer.getExpression();
|
|
30
|
-
if (!expression || !Node.isPropertyAccessExpression(expression))
|
|
31
|
-
continue;
|
|
32
|
-
if (!Node.isThisExpression(expression.getExpression()))
|
|
33
|
-
continue;
|
|
34
|
-
if (expression.getName() !== attributeName)
|
|
35
|
-
continue;
|
|
36
|
-
domAttributeProps.add(attributeName);
|
|
37
|
-
}
|
|
38
|
-
return domAttributeProps;
|
|
39
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import os from 'node:os';
|
|
2
|
-
import { runFileExtractionWorkers } from '../shared/helpers/file-processing/file-workers.js';
|
|
3
|
-
import { getSvelteComponentName } from './helpers/get-svelte-component-name.js';
|
|
4
|
-
import { maybeRunResolveUnreachableRetry, collapseUnresolvedTypeWarnings, } from './helpers/resolve-svelte-unresolved-retry.js';
|
|
5
|
-
import { resolveAllowedComponents } from './helpers/resolve-svelte-allowed-components.js';
|
|
6
|
-
import { extractFromSvelteFile } from './helpers/extract-from-svelte-file.js';
|
|
7
|
-
export async function extractSvelteComponents(filePaths, onProgress, opts) {
|
|
8
|
-
const svelteFiles = filePaths.filter((f) => f.endsWith('.svelte'));
|
|
9
|
-
const retryContexts = new Map();
|
|
10
|
-
const { items: components, warnings } = await runFileExtractionWorkers(svelteFiles, os.cpus().length, async (filePath, source) => {
|
|
11
|
-
const { component, warnings: fileWarnings, retryContext } = await extractFromSvelteFile(filePath, source);
|
|
12
|
-
return {
|
|
13
|
-
item: component,
|
|
14
|
-
warnings: fileWarnings,
|
|
15
|
-
metadata: retryContext,
|
|
16
|
-
};
|
|
17
|
-
}, (filePath, error) => `${getSvelteComponentName(filePath)}: failed to extract from ${filePath} — ${error instanceof Error ? error.message : String(error)}`, onProgress, (filePath, outcome) => {
|
|
18
|
-
if (outcome.metadata)
|
|
19
|
-
retryContexts.set(filePath, outcome.metadata);
|
|
20
|
-
});
|
|
21
|
-
const finalWarnings = await maybeRunResolveUnreachableRetry(components, warnings, retryContexts, opts);
|
|
22
|
-
resolveAllowedComponents(components);
|
|
23
|
-
return {
|
|
24
|
-
components: components.sort((a, b) => a.name.localeCompare(b.name)),
|
|
25
|
-
warnings: collapseUnresolvedTypeWarnings(finalWarnings),
|
|
26
|
-
};
|
|
27
|
-
}
|
package/dist/src/extract/framework-adapters/svelte/helpers/classify-svelte-props-annotation.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AstNode } from '../types/svelte-ast-node.js';
|
|
2
|
-
import type { ResolvedTypeMember } from './resolve-svelte-type-members.js';
|
|
3
|
-
export declare function formatAnnotation(annotation: AstNode | undefined): string;
|
|
4
|
-
export declare function classifyUnresolved(annotation: AstNode | undefined, members: ResolvedTypeMember[] | null, instance: AstNode, moduleScript: AstNode | undefined): 'empty' | 'partial-heritage' | null;
|
|
5
|
-
export declare function getPropsTypeName(propsCall: AstNode): string | undefined;
|
|
6
|
-
export declare function getRetryAnnotation(propsCall: AstNode): AstNode | undefined;
|