@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,17 +0,0 @@
|
|
|
1
|
-
import { extractComponents } from '../services/extraction/extract-components.js';
|
|
2
|
-
import { preClassifyComponent } from '../services/classification/classify-component-props.js';
|
|
3
|
-
import { evaluateExtractionQuality } from '../services/quality/evaluate-extraction-quality.js';
|
|
4
|
-
/**
|
|
5
|
-
* Executes the extraction use case after the controller has validated the
|
|
6
|
-
* public request. Owns extraction-time classification, inspection,
|
|
7
|
-
* quality signals, scoring, and validation, but not transport or persistence.
|
|
8
|
-
*/
|
|
9
|
-
export async function executeExtractionOrchestrator(request) {
|
|
10
|
-
const filePaths = [...request.filePaths];
|
|
11
|
-
const extraction = await extractComponents(filePaths, request.onProgress, {
|
|
12
|
-
...(request.resolveUnreachable !== undefined ? { resolveUnreachable: request.resolveUnreachable } : {}),
|
|
13
|
-
...(request.projectRoot !== undefined ? { projectRoot: request.projectRoot } : {}),
|
|
14
|
-
});
|
|
15
|
-
const classifiedComponents = extraction.components.map(preClassifyComponent);
|
|
16
|
-
return evaluateExtractionQuality(classifiedComponents, extraction.warnings);
|
|
17
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** Primitive-type predicates used by the classification rule engine. */
|
|
2
|
-
export declare function isStringLiteralUnion(type: string): boolean;
|
|
3
|
-
export declare function isSimpleType(type: string): boolean;
|
|
4
|
-
export declare function isBooleanType(type: string): boolean;
|
|
5
|
-
export declare function isStringType(type: string): boolean;
|
|
6
|
-
export declare function isNumberType(type: string): boolean;
|
|
7
|
-
export declare function isComplexType(type: string): boolean;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** Primitive-type predicates used by the classification rule engine. */
|
|
2
|
-
export function isStringLiteralUnion(type) {
|
|
3
|
-
return type.includes('|') && type.includes("'");
|
|
4
|
-
}
|
|
5
|
-
export function isSimpleType(type) {
|
|
6
|
-
const t = type.trim();
|
|
7
|
-
if (t === 'string' || t === 'boolean' || t === 'number')
|
|
8
|
-
return true;
|
|
9
|
-
return isStringLiteralUnion(t);
|
|
10
|
-
}
|
|
11
|
-
export function isBooleanType(type) {
|
|
12
|
-
return type.trim() === 'boolean';
|
|
13
|
-
}
|
|
14
|
-
export function isStringType(type) {
|
|
15
|
-
return type.trim() === 'string';
|
|
16
|
-
}
|
|
17
|
-
export function isNumberType(type) {
|
|
18
|
-
return type.trim() === 'number';
|
|
19
|
-
}
|
|
20
|
-
export function isComplexType(type) {
|
|
21
|
-
return !isSimpleType(type);
|
|
22
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const DOM_PASS_THROUGH_PROPS = new Set([
|
|
2
|
-
// Bare HTML / framework styling pass-through
|
|
3
|
-
'className',
|
|
4
|
-
'class',
|
|
5
|
-
'classes',
|
|
6
|
-
'classNames',
|
|
7
|
-
'rootClassName',
|
|
8
|
-
'prefixCls',
|
|
9
|
-
'style',
|
|
10
|
-
'styles',
|
|
11
|
-
// Bare HTML attributes
|
|
12
|
-
'id',
|
|
13
|
-
'role',
|
|
14
|
-
'tabIndex',
|
|
15
|
-
'tabindex',
|
|
16
|
-
'htmlFor',
|
|
17
|
-
'for',
|
|
18
|
-
'slot',
|
|
19
|
-
'is',
|
|
20
|
-
'lang',
|
|
21
|
-
'dir',
|
|
22
|
-
'hidden',
|
|
23
|
-
'draggable',
|
|
24
|
-
'spellCheck',
|
|
25
|
-
'spellcheck',
|
|
26
|
-
'contentEditable',
|
|
27
|
-
'contenteditable',
|
|
28
|
-
'inputMode',
|
|
29
|
-
'inputmode',
|
|
30
|
-
'autoComplete',
|
|
31
|
-
'autocomplete',
|
|
32
|
-
'autoFocus',
|
|
33
|
-
'autofocus',
|
|
34
|
-
'translate',
|
|
35
|
-
'part',
|
|
36
|
-
'exportparts',
|
|
37
|
-
'aria',
|
|
38
|
-
// Framework theming / pass-through escape hatches — dev-facing, never marketer-configurable
|
|
39
|
-
'dt',
|
|
40
|
-
'pt',
|
|
41
|
-
'ptOptions',
|
|
42
|
-
'unstyled',
|
|
43
|
-
'sx',
|
|
44
|
-
// Polymorphic component props — change rendered HTML/component, not marketer-visible behavior
|
|
45
|
-
'as',
|
|
46
|
-
'element',
|
|
47
|
-
'component',
|
|
48
|
-
// QA / vendor test attributes
|
|
49
|
-
'dataQa',
|
|
50
|
-
'data-qa',
|
|
51
|
-
// Vue v-model internals — framework wiring, never marketer-configurable
|
|
52
|
-
'modelValue',
|
|
53
|
-
'modelModifiers',
|
|
54
|
-
]);
|
|
55
|
-
/** Returns true when the prop name is a DOM attribute, a11y attribute, or framework pass-through escape hatch. */
|
|
56
|
-
export function isDomPassThroughProp(name) {
|
|
57
|
-
if (DOM_PASS_THROUGH_PROPS.has(name))
|
|
58
|
-
return true;
|
|
59
|
-
// aria-label, aria-hidden, ariaLabel, ariaHidden — both kebab and camel forms
|
|
60
|
-
if (/^aria[-A-Z]/.test(name))
|
|
61
|
-
return true;
|
|
62
|
-
return name.startsWith('data-');
|
|
63
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { resolveComponentScopeInfo, resolveTopLevelFamilyName, resolveDeduplicationScopeKey, selectPreferredComponentSource, } from './helpers/component-path-scoring.js';
|
|
2
|
-
export function deduplicateComponents(results) {
|
|
3
|
-
const allWarnings = [];
|
|
4
|
-
const exclusions = [];
|
|
5
|
-
const componentsByKey = new Map();
|
|
6
|
-
const keysByName = new Map();
|
|
7
|
-
const topLevelFamiliesByRoot = new Map();
|
|
8
|
-
for (const result of results) {
|
|
9
|
-
for (const component of result.components) {
|
|
10
|
-
const scopeInfo = resolveComponentScopeInfo(component.source);
|
|
11
|
-
if (!scopeInfo)
|
|
12
|
-
continue;
|
|
13
|
-
const familyName = resolveTopLevelFamilyName(scopeInfo.relativeSegments);
|
|
14
|
-
if (!familyName)
|
|
15
|
-
continue;
|
|
16
|
-
const existingFamilies = topLevelFamiliesByRoot.get(scopeInfo.rootKey) ?? new Set();
|
|
17
|
-
existingFamilies.add(familyName);
|
|
18
|
-
topLevelFamiliesByRoot.set(scopeInfo.rootKey, existingFamilies);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
for (const result of results) {
|
|
22
|
-
allWarnings.push(...result.warnings);
|
|
23
|
-
exclusions.push(...(result.exclusions ?? []));
|
|
24
|
-
for (const component of result.components) {
|
|
25
|
-
const scopeKey = resolveDeduplicationScopeKey(component.source, component.name, topLevelFamiliesByRoot);
|
|
26
|
-
const identityKey = `${component.name}::${scopeKey}`;
|
|
27
|
-
const existing = componentsByKey.get(identityKey);
|
|
28
|
-
if (existing) {
|
|
29
|
-
const selected = selectPreferredComponentSource(existing, component);
|
|
30
|
-
allWarnings.push(`Duplicate component "${component.name}" found in ${component.source} (already seen in ${existing.source}); ${selected.reason}`);
|
|
31
|
-
exclusions.push({
|
|
32
|
-
itemType: 'component',
|
|
33
|
-
name: selected.loser.name,
|
|
34
|
-
source: selected.loser.source,
|
|
35
|
-
reason: `duplicate identity; ${selected.reason}`,
|
|
36
|
-
stage: 'duplicate-filter',
|
|
37
|
-
});
|
|
38
|
-
componentsByKey.set(identityKey, selected.winner);
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
const existingKeys = keysByName.get(component.name) ?? [];
|
|
42
|
-
const crossPackageKey = existingKeys.find((key) => key !== identityKey);
|
|
43
|
-
if (crossPackageKey) {
|
|
44
|
-
const crossPackageComponent = componentsByKey.get(crossPackageKey);
|
|
45
|
-
if (crossPackageComponent) {
|
|
46
|
-
allWarnings.push(`Component name collision "${component.name}" found in ${component.source} (also seen in ${crossPackageComponent.source})`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
componentsByKey.set(identityKey, component);
|
|
50
|
-
keysByName.set(component.name, [...existingKeys, identityKey]);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
components: [...componentsByKey.values()].sort((a, b) => a.name.localeCompare(b.name)),
|
|
55
|
-
warnings: allWarnings,
|
|
56
|
-
exclusions,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function scoreComponentSourcePath(filePath: string): number;
|
|
2
|
-
export declare function resolvePackageRootInfo(segments: string[]): {
|
|
3
|
-
rootSegments: string[];
|
|
4
|
-
relativeSegments: string[];
|
|
5
|
-
} | null;
|
|
6
|
-
export declare function resolveComponentScopeInfo(filePath: string): {
|
|
7
|
-
rootKey: string;
|
|
8
|
-
relativeSegments: string[];
|
|
9
|
-
} | null;
|
|
10
|
-
export declare function resolveTopLevelFamilyName(relativeSegments: string[]): string | null;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
export function scoreComponentSourcePath(filePath) {
|
|
2
|
-
const normalized = filePath.replace(/\\/g, '/');
|
|
3
|
-
const segments = normalized.split('/').filter(Boolean);
|
|
4
|
-
const filename = segments.at(-1) ?? '';
|
|
5
|
-
const basename = filename.replace(/\.[^.]+$/, '');
|
|
6
|
-
let score = 0;
|
|
7
|
-
if (/^index\.[jt]sx?$/.test(filename))
|
|
8
|
-
score += 100;
|
|
9
|
-
if (basename && segments.at(-2) === basename)
|
|
10
|
-
score -= 10;
|
|
11
|
-
score -= segments.filter((segment) => segment === 'components').length * 8;
|
|
12
|
-
score -= segments.length;
|
|
13
|
-
return score;
|
|
14
|
-
}
|
|
15
|
-
export function resolvePackageRootInfo(segments) {
|
|
16
|
-
for (let index = 0; index < segments.length; index += 1) {
|
|
17
|
-
const segment = segments[index];
|
|
18
|
-
if ((segment === '.packages' || segment === 'packages') && segments[index + 1]) {
|
|
19
|
-
return {
|
|
20
|
-
rootSegments: segments.slice(0, index + 2),
|
|
21
|
-
relativeSegments: segments.slice(index + 2),
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const srcIndex = segments.lastIndexOf('src');
|
|
26
|
-
if (srcIndex >= 0) {
|
|
27
|
-
return {
|
|
28
|
-
rootSegments: segments.slice(0, srcIndex),
|
|
29
|
-
relativeSegments: segments.slice(srcIndex),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
export function resolveComponentScopeInfo(filePath) {
|
|
35
|
-
const normalized = filePath.replace(/\\/g, '/');
|
|
36
|
-
const segments = normalized.split('/').filter(Boolean);
|
|
37
|
-
const rootInfo = resolvePackageRootInfo(segments);
|
|
38
|
-
if (!rootInfo)
|
|
39
|
-
return null;
|
|
40
|
-
return {
|
|
41
|
-
rootKey: rootInfo.rootSegments.join('/'),
|
|
42
|
-
relativeSegments: rootInfo.relativeSegments,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export function resolveTopLevelFamilyName(relativeSegments) {
|
|
46
|
-
const [first, second, third] = relativeSegments;
|
|
47
|
-
if (relativeSegments.length === 1 && first)
|
|
48
|
-
return first.replace(/\.[^.]+$/, '');
|
|
49
|
-
if (first === 'src' && second === 'components' && third) {
|
|
50
|
-
const fileSegment = relativeSegments[3];
|
|
51
|
-
if (fileSegment &&
|
|
52
|
-
(fileSegment === `${third}.tsx` ||
|
|
53
|
-
fileSegment === `${third}.ts` ||
|
|
54
|
-
fileSegment === 'index.tsx' ||
|
|
55
|
-
fileSegment === 'index.ts')) {
|
|
56
|
-
return third;
|
|
57
|
-
}
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
if (first === 'src' && second) {
|
|
61
|
-
const fileSegment = relativeSegments[2];
|
|
62
|
-
if (fileSegment &&
|
|
63
|
-
(fileSegment === `${second}.vue` ||
|
|
64
|
-
fileSegment === `${second}.tsx` ||
|
|
65
|
-
fileSegment === `${second}.ts` ||
|
|
66
|
-
fileSegment === 'index.tsx' ||
|
|
67
|
-
fileSegment === 'index.ts' ||
|
|
68
|
-
fileSegment === 'index.vue')) {
|
|
69
|
-
return second;
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
if (first) {
|
|
74
|
-
const fileSegment = relativeSegments[1];
|
|
75
|
-
if (fileSegment === `${first}.tsx` ||
|
|
76
|
-
fileSegment === `${first}.ts` ||
|
|
77
|
-
fileSegment === `${first}.vue` ||
|
|
78
|
-
fileSegment === 'index.tsx' ||
|
|
79
|
-
fileSegment === 'index.ts' ||
|
|
80
|
-
fileSegment === 'index.vue') {
|
|
81
|
-
return first;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { RawComponentDefinition } from '../../../types/component.js';
|
|
2
|
-
import { scoreComponentSourcePath, resolvePackageRootInfo, resolveComponentScopeInfo, resolveTopLevelFamilyName } from './component-path-analysis.js';
|
|
3
|
-
export { scoreComponentSourcePath, resolvePackageRootInfo, resolveComponentScopeInfo, resolveTopLevelFamilyName };
|
|
4
|
-
export declare function isWithinComponentFamily(relativeSegments: string[], componentName: string): boolean;
|
|
5
|
-
export declare function resolveDeduplicationScopeKey(filePath: string, componentName: string, topLevelFamiliesByRoot: Map<string, Set<string>>): string;
|
|
6
|
-
export declare function selectPreferredComponentSource(existing: RawComponentDefinition, candidate: RawComponentDefinition): {
|
|
7
|
-
winner: RawComponentDefinition;
|
|
8
|
-
loser: RawComponentDefinition;
|
|
9
|
-
reason: string;
|
|
10
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { scoreComponentSourcePath, resolvePackageRootInfo, resolveComponentScopeInfo, resolveTopLevelFamilyName, } from './component-path-analysis.js';
|
|
2
|
-
export { scoreComponentSourcePath, resolvePackageRootInfo, resolveComponentScopeInfo, resolveTopLevelFamilyName };
|
|
3
|
-
export function isWithinComponentFamily(relativeSegments, componentName) {
|
|
4
|
-
const [first, second, third] = relativeSegments;
|
|
5
|
-
const componentFilenames = new Set([
|
|
6
|
-
`${componentName}.tsx`,
|
|
7
|
-
`${componentName}.ts`,
|
|
8
|
-
`${componentName}.vue`,
|
|
9
|
-
'index.tsx',
|
|
10
|
-
'index.ts',
|
|
11
|
-
'index.vue',
|
|
12
|
-
]);
|
|
13
|
-
if (relativeSegments.length === 1) {
|
|
14
|
-
return new Set([`${componentName}.tsx`, `${componentName}.ts`, `${componentName}.vue`]).has(first);
|
|
15
|
-
}
|
|
16
|
-
if (first === 'src' && second === 'components' && third === componentName)
|
|
17
|
-
return true;
|
|
18
|
-
if (first === 'components' && second === componentName)
|
|
19
|
-
return true;
|
|
20
|
-
if (first === 'src' && second === componentName)
|
|
21
|
-
return true;
|
|
22
|
-
if (first === componentName)
|
|
23
|
-
return componentFilenames.has(second) || relativeSegments.length > 2;
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
export function resolveDeduplicationScopeKey(filePath, componentName, topLevelFamiliesByRoot) {
|
|
27
|
-
const normalized = filePath.replace(/\\/g, '/');
|
|
28
|
-
const scopeInfo = resolveComponentScopeInfo(filePath);
|
|
29
|
-
if (!scopeInfo)
|
|
30
|
-
return normalized;
|
|
31
|
-
const { rootKey, relativeSegments } = scopeInfo;
|
|
32
|
-
const topLevelFamilies = topLevelFamiliesByRoot.get(rootKey);
|
|
33
|
-
if (topLevelFamilies?.has(componentName) && isWithinComponentFamily(relativeSegments, componentName)) {
|
|
34
|
-
return `${rootKey}::${componentName}`;
|
|
35
|
-
}
|
|
36
|
-
const [first, second, third] = relativeSegments;
|
|
37
|
-
if (first === 'src' && second === 'components' && third)
|
|
38
|
-
return `${rootKey}/src/components/${third}`;
|
|
39
|
-
if (first === 'components' && second)
|
|
40
|
-
return `${rootKey}/components/${second}`;
|
|
41
|
-
if (first === 'src' && second && relativeSegments.length > 2)
|
|
42
|
-
return `${rootKey}/src/${second}`;
|
|
43
|
-
if (first && relativeSegments.length > 1)
|
|
44
|
-
return `${rootKey}/${first}`;
|
|
45
|
-
return rootKey;
|
|
46
|
-
}
|
|
47
|
-
export function selectPreferredComponentSource(existing, candidate) {
|
|
48
|
-
const existingScore = scoreComponentSourcePath(existing.source);
|
|
49
|
-
const candidateScore = scoreComponentSourcePath(candidate.source);
|
|
50
|
-
if (candidateScore > existingScore)
|
|
51
|
-
return {
|
|
52
|
-
winner: candidate,
|
|
53
|
-
loser: existing,
|
|
54
|
-
reason: `preferred ${candidate.source} over ${existing.source} based on path heuristics`,
|
|
55
|
-
};
|
|
56
|
-
if (candidateScore < existingScore)
|
|
57
|
-
return {
|
|
58
|
-
winner: existing,
|
|
59
|
-
loser: candidate,
|
|
60
|
-
reason: `kept ${existing.source} over ${candidate.source} based on path heuristics`,
|
|
61
|
-
};
|
|
62
|
-
if (candidate.source.length < existing.source.length)
|
|
63
|
-
return {
|
|
64
|
-
winner: candidate,
|
|
65
|
-
loser: existing,
|
|
66
|
-
reason: `preferred shorter path ${candidate.source} over ${existing.source}`,
|
|
67
|
-
};
|
|
68
|
-
return {
|
|
69
|
-
winner: existing,
|
|
70
|
-
loser: candidate,
|
|
71
|
-
reason: `kept ${existing.source} over ${candidate.source} by stable first-seen order`,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ComponentExtractionResult, ExtractorProgress } from '../../types/component.js';
|
|
2
|
-
import type { ExtractorOptions } from '../../types/options.js';
|
|
3
|
-
export declare function extractComponents(filePaths: string[], onProgress?: (progress: ExtractorProgress) => void, opts?: ExtractorOptions): Promise<ComponentExtractionResult>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { deduplicateComponents } from '../deduplication/deduplicate-components.js';
|
|
2
|
-
import { extractorRegistry, routeFilesToExtractors } from './helpers/register-extractors.js';
|
|
3
|
-
import { runExtractorBatches } from './helpers/run-extractor-batches.js';
|
|
4
|
-
import { collectSvelteKitRouteExclusions } from './helpers/collect-sveltekit-route-exclusions.js';
|
|
5
|
-
import { filterHookComponents } from './helpers/filter-hook-components.js';
|
|
6
|
-
export async function extractComponents(filePaths, onProgress, opts) {
|
|
7
|
-
const routeExclusions = collectSvelteKitRouteExclusions(filePaths);
|
|
8
|
-
const routedFiles = routeFilesToExtractors(filePaths, extractorRegistry);
|
|
9
|
-
const results = await runExtractorBatches(routedFiles, onProgress, opts);
|
|
10
|
-
const deduplicated = deduplicateComponents(results);
|
|
11
|
-
const { components, exclusions: hookExclusions, warnings: hookWarnings, } = filterHookComponents(deduplicated.components);
|
|
12
|
-
deduplicated.warnings.push(...hookWarnings);
|
|
13
|
-
const allExclusions = [...routeExclusions, ...hookExclusions, ...(deduplicated.exclusions ?? [])];
|
|
14
|
-
return {
|
|
15
|
-
components,
|
|
16
|
-
warnings: deduplicated.warnings,
|
|
17
|
-
...(allExclusions.length > 0 ? { exclusions: allExclusions } : {}),
|
|
18
|
-
};
|
|
19
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function collectSvelteKitRouteExclusions(filePaths) {
|
|
2
|
-
return filePaths.flatMap((filePath) => {
|
|
3
|
-
if (!filePath.endsWith('.svelte'))
|
|
4
|
-
return [];
|
|
5
|
-
const name = filePath.replace(/\\/g, '/').split('/').pop() ?? '';
|
|
6
|
-
if (!/^\+(page|layout|error)\.svelte$/.test(name))
|
|
7
|
-
return [];
|
|
8
|
-
return [
|
|
9
|
-
{
|
|
10
|
-
itemType: 'file',
|
|
11
|
-
name,
|
|
12
|
-
source: filePath,
|
|
13
|
-
reason: 'SvelteKit route entrypoints are framework-managed, not authorable components',
|
|
14
|
-
stage: 'file-filter',
|
|
15
|
-
},
|
|
16
|
-
];
|
|
17
|
-
});
|
|
18
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ExtractionExclusion, RawComponentDefinition } from '../../../types/component.js';
|
|
2
|
-
export declare function filterHookComponents(components: RawComponentDefinition[]): {
|
|
3
|
-
components: RawComponentDefinition[];
|
|
4
|
-
exclusions: ExtractionExclusion[];
|
|
5
|
-
warnings: string[];
|
|
6
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function filterHookComponents(components) {
|
|
2
|
-
const exclusions = [];
|
|
3
|
-
const warnings = [];
|
|
4
|
-
const kept = components.filter((component) => {
|
|
5
|
-
if (!/^use[A-Z]/.test(component.name))
|
|
6
|
-
return true;
|
|
7
|
-
warnings.push(`Skipped hook: ${component.name} (hooks are not renderable components)`);
|
|
8
|
-
exclusions.push({
|
|
9
|
-
itemType: 'component',
|
|
10
|
-
name: component.name,
|
|
11
|
-
source: component.source,
|
|
12
|
-
reason: 'Hook names are not renderable components',
|
|
13
|
-
stage: 'component-filter',
|
|
14
|
-
});
|
|
15
|
-
return false;
|
|
16
|
-
});
|
|
17
|
-
return { components: kept, exclusions, warnings };
|
|
18
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ComponentExtractor } from '../../../types/component-extractor.js';
|
|
2
|
-
export interface ExtractorFileGroup {
|
|
3
|
-
extractor: ComponentExtractor;
|
|
4
|
-
filePaths: string[];
|
|
5
|
-
}
|
|
6
|
-
/** Ordered adapter registration; overlapping filters intentionally allow a file to be inspected by multiple adapters. */
|
|
7
|
-
export declare const extractorRegistry: readonly ComponentExtractor[];
|
|
8
|
-
export declare function routeFilesToExtractors(filePaths: readonly string[], extractors?: readonly ComponentExtractor[]): ExtractorFileGroup[];
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { extractAstroComponents } from '../../../framework-adapters/astro/extractor.js';
|
|
2
|
-
import { extractReactComponents } from '../../../framework-adapters/react/extractor.js';
|
|
3
|
-
import { extractStencilComponents } from '../../../framework-adapters/stencil/extractor.js';
|
|
4
|
-
import { extractSvelteComponents } from '../../../framework-adapters/svelte/extractor.js';
|
|
5
|
-
import { extractVueTsxComponents } from '../../../framework-adapters/vue-tsx/extractor.js';
|
|
6
|
-
import { extractVueComponents } from '../../../framework-adapters/vue/extractor.js';
|
|
7
|
-
import { extractWebComponentDefinitions } from '../../../framework-adapters/web-components/extractor.js';
|
|
8
|
-
/** Ordered adapter registration; overlapping filters intentionally allow a file to be inspected by multiple adapters. */
|
|
9
|
-
export const extractorRegistry = [
|
|
10
|
-
{
|
|
11
|
-
name: 'stencil',
|
|
12
|
-
fileFilter: (filePath) => /\.[jt]sx$/.test(filePath),
|
|
13
|
-
extract: extractStencilComponents,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'react',
|
|
17
|
-
fileFilter: (filePath) => /\.[jt]sx?$/.test(filePath) && !filePath.endsWith('.d.ts'),
|
|
18
|
-
extract: extractReactComponents,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'vue-tsx',
|
|
22
|
-
fileFilter: (filePath) => /\.[jt]sx?$/.test(filePath) && !filePath.endsWith('.d.ts'),
|
|
23
|
-
extract: extractVueTsxComponents,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'vue',
|
|
27
|
-
fileFilter: (filePath) => filePath.endsWith('.vue'),
|
|
28
|
-
extract: extractVueComponents,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'astro',
|
|
32
|
-
fileFilter: (filePath) => filePath.endsWith('.astro'),
|
|
33
|
-
extract: extractAstroComponents,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'web-components',
|
|
37
|
-
fileFilter: (filePath) => /\.[jt]s$/.test(filePath) && !/\.[jt]sx$/.test(filePath) && !filePath.endsWith('.d.ts'),
|
|
38
|
-
extract: extractWebComponentDefinitions,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'svelte',
|
|
42
|
-
fileFilter: (filePath) => {
|
|
43
|
-
if (!filePath.endsWith('.svelte'))
|
|
44
|
-
return false;
|
|
45
|
-
const filename = filePath.replace(/\\/g, '/').split('/').pop() ?? '';
|
|
46
|
-
if (/^\+(page|layout|error)\.svelte$/.test(filename))
|
|
47
|
-
return false;
|
|
48
|
-
return true;
|
|
49
|
-
},
|
|
50
|
-
extract: extractSvelteComponents,
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
export function routeFilesToExtractors(filePaths, extractors = extractorRegistry) {
|
|
54
|
-
const filesByExtractor = new Map();
|
|
55
|
-
for (const extractor of extractors) {
|
|
56
|
-
filesByExtractor.set(extractor, []);
|
|
57
|
-
}
|
|
58
|
-
for (const filePath of filePaths) {
|
|
59
|
-
for (const extractor of extractors) {
|
|
60
|
-
if (extractor.fileFilter(filePath)) {
|
|
61
|
-
filesByExtractor.get(extractor)?.push(filePath);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return extractors
|
|
66
|
-
.map((extractor) => ({
|
|
67
|
-
extractor,
|
|
68
|
-
filePaths: filesByExtractor.get(extractor) ?? [],
|
|
69
|
-
}))
|
|
70
|
-
.filter(({ filePaths: groupedFilePaths }) => groupedFilePaths.length > 0);
|
|
71
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ComponentExtractionResult, ExtractorProgress } from '../../../types/component.js';
|
|
2
|
-
import type { ExtractorOptions } from '../../../types/options.js';
|
|
3
|
-
import type { ExtractorFileGroup } from './register-extractors.js';
|
|
4
|
-
export declare function runExtractorBatches(batches: readonly ExtractorFileGroup[], onProgress?: (progress: ExtractorProgress) => void, options?: ExtractorOptions): Promise<ComponentExtractionResult[]>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export async function runExtractorBatches(batches, onProgress, options) {
|
|
2
|
-
const perExtractorFiles = new Map();
|
|
3
|
-
const perExtractorComponents = new Map();
|
|
4
|
-
let totalFilesProcessed = 0;
|
|
5
|
-
let totalComponentsFound = 0;
|
|
6
|
-
return Promise.all(batches.map(async ({ extractor, filePaths }) => {
|
|
7
|
-
if (filePaths.length === 0)
|
|
8
|
-
return { components: [], warnings: [] };
|
|
9
|
-
perExtractorFiles.set(extractor, 0);
|
|
10
|
-
perExtractorComponents.set(extractor, 0);
|
|
11
|
-
return extractor.extract(filePaths, (progress) => {
|
|
12
|
-
const previousFiles = perExtractorFiles.get(extractor) ?? 0;
|
|
13
|
-
const previousComponents = perExtractorComponents.get(extractor) ?? 0;
|
|
14
|
-
totalFilesProcessed += progress.filesProcessed - previousFiles;
|
|
15
|
-
totalComponentsFound += progress.componentsFound - previousComponents;
|
|
16
|
-
perExtractorFiles.set(extractor, progress.filesProcessed);
|
|
17
|
-
perExtractorComponents.set(extractor, progress.componentsFound);
|
|
18
|
-
onProgress?.({
|
|
19
|
-
filesProcessed: totalFilesProcessed,
|
|
20
|
-
componentsFound: totalComponentsFound,
|
|
21
|
-
});
|
|
22
|
-
}, options);
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { RawComponentDefinition } from '../../types/component.js';
|
|
2
|
-
import type { ExtractionEndpointResponse } from '../../types/contract.js';
|
|
3
|
-
/** Applies inspection, authorability, scoring, review, and validation policies to extracted models. */
|
|
4
|
-
export declare function evaluateExtractionQuality(components: readonly RawComponentDefinition[], initialWarnings?: readonly string[]): Promise<ExtractionEndpointResponse>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { hasNoAuthoringSurface } from './helpers/authorability/evaluate-authorability.js';
|
|
2
|
-
import { computeExtractionScore, deriveNeedsReview } from './helpers/scoring/compute-extraction-score.js';
|
|
3
|
-
import { inspectComponentSource, describeReviewReasons } from './helpers/inspection/inspect-component-source.js';
|
|
4
|
-
import { validateExtractedComponents } from './helpers/inspection/validate-extracted-components.js';
|
|
5
|
-
function wrapperConfidenceToIssueCount(confidence) {
|
|
6
|
-
if (confidence >= 4)
|
|
7
|
-
return 2;
|
|
8
|
-
if (confidence === 3)
|
|
9
|
-
return 1;
|
|
10
|
-
return 0;
|
|
11
|
-
}
|
|
12
|
-
/** Applies inspection, authorability, scoring, review, and validation policies to extracted models. */
|
|
13
|
-
export async function evaluateExtractionQuality(components, initialWarnings = []) {
|
|
14
|
-
const inspectedComponents = await Promise.all(components.map(async (component) => ({
|
|
15
|
-
component,
|
|
16
|
-
inspection: await inspectComponentSource(component),
|
|
17
|
-
})));
|
|
18
|
-
const scoredComponents = [];
|
|
19
|
-
const warnings = [...initialWarnings];
|
|
20
|
-
for (const { component, inspection } of inspectedComponents) {
|
|
21
|
-
const verdict = hasNoAuthoringSurface(component);
|
|
22
|
-
const keepDespiteZeroSurface = verdict.skip && verdict.reason === 'component has no props and no slots' && inspection.keepDespiteZeroSurface;
|
|
23
|
-
const retainedForReview = verdict.skip && !keepDespiteZeroSurface;
|
|
24
|
-
if (retainedForReview) {
|
|
25
|
-
warnings.push(`${component.name}: requires operator review (${verdict.reason})`);
|
|
26
|
-
}
|
|
27
|
-
if (keepDespiteZeroSurface) {
|
|
28
|
-
warnings.push(`${component.name}: retained despite 0 props/slots because the source renders visible or compositional UI`);
|
|
29
|
-
}
|
|
30
|
-
if (inspection.reviewReasons.length > 0) {
|
|
31
|
-
const reviewNotes = describeReviewReasons(inspection.reviewReasons)
|
|
32
|
-
.filter((note) => note !== 'high-confidence data-fetch wrapper')
|
|
33
|
-
.join('; ');
|
|
34
|
-
if (reviewNotes)
|
|
35
|
-
warnings.push(`${component.name}: ${reviewNotes}`);
|
|
36
|
-
}
|
|
37
|
-
const extractorReasons = component.reviewReasons ?? [];
|
|
38
|
-
const nonAuthorableReason = retainedForReview ? [`non-authorable:${verdict.reason}`] : [];
|
|
39
|
-
const { confidence, reasons } = computeExtractionScore(component, {
|
|
40
|
-
additionalIssueCount: wrapperConfidenceToIssueCount(inspection.wrapperConfidence) +
|
|
41
|
-
extractorReasons.length +
|
|
42
|
-
nonAuthorableReason.length,
|
|
43
|
-
additionalReasons: [...extractorReasons, ...inspection.reviewReasons, ...nonAuthorableReason],
|
|
44
|
-
});
|
|
45
|
-
scoredComponents.push({
|
|
46
|
-
...component,
|
|
47
|
-
extractionConfidence: confidence,
|
|
48
|
-
reviewReasons: reasons,
|
|
49
|
-
needsReview: deriveNeedsReview(confidence) ||
|
|
50
|
-
inspection.wrapperConfidence >= 4 ||
|
|
51
|
-
inspection.keepDespiteZeroSurface ||
|
|
52
|
-
retainedForReview ||
|
|
53
|
-
extractorReasons.includes('props-type-unresolved') ||
|
|
54
|
-
(component.needsReview ?? false),
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
components: validateExtractedComponents(scoredComponents),
|
|
59
|
-
warnings,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { RawComponentDefinition, RawPropDefinition, RawSlotDefinition } from '../../../../types/component.js';
|
|
2
|
-
export interface AuthoringSurfaceCheck {
|
|
3
|
-
skip: boolean;
|
|
4
|
-
reason?: string;
|
|
5
|
-
}
|
|
6
|
-
/** Returns true when the prop is an event-handler function or a React ref — not something a content editor configures. */
|
|
7
|
-
export declare function isHandlerOrRefProp(prop: RawPropDefinition): boolean;
|
|
8
|
-
/** Rule 1: no props AND no slots — analytics scripts, GTM tags, layout fixers, security tokens, etc. */
|
|
9
|
-
export declare function hasNoPropsAndNoSlots(props: RawPropDefinition[], slots: RawSlotDefinition[]): boolean;
|
|
10
|
-
/** Rule 2: createContext source with a prop literally named `value` — the canonical `<Context.Provider value={...}>` call site. */
|
|
11
|
-
export declare function isContextProviderWithValueProp(props: RawPropDefinition[], usesCreateContext: boolean | undefined): boolean;
|
|
12
|
-
/** Rule 3: createContext source with zero props — a Provider that hard-codes its context value internally (e.g. FontProvider). */
|
|
13
|
-
export declare function isHardwiredContextProvider(props: RawPropDefinition[], usesCreateContext: boolean | undefined): boolean;
|
|
14
|
-
/** Rule 4: createContext source with exactly one non-handler prop — a Provider that takes its context value as a single data prop (e.g. LocaleProvider, NavigationProvider). */
|
|
15
|
-
export declare function isSingleDataPropContextWrapper(props: RawPropDefinition[], usesCreateContext: boolean | undefined): boolean;
|
|
16
|
-
/** Rule 5: every prop is an event handler or ref — pure plumbing with no authoring surface (e.g. OsanoCookiePlaceholder({ onBannerLoaded })). */
|
|
17
|
-
export declare function hasOnlyEventHandlers(props: RawPropDefinition[]): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Checks whether a component has no surface for a content editor to configure.
|
|
20
|
-
* Returns { skip: true, reason } for infrastructure components that should be
|
|
21
|
-
* flagged for operator review before authoring-token generation.
|
|
22
|
-
*
|
|
23
|
-
* Uses prop-shape signals only — no component-name or source-path patterns.
|
|
24
|
-
* A design system can live anywhere under any naming convention; relying on
|
|
25
|
-
* suffixes like `*Provider` or paths like `src/lib/` would silently fail in
|
|
26
|
-
* other repos.
|
|
27
|
-
*/
|
|
28
|
-
export declare function hasNoAuthoringSurface(component: RawComponentDefinition): AuthoringSurfaceCheck;
|