@astryxdesign/cli 0.1.8-canary.08a0957 → 0.1.8-canary.0db5dfd
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/{src/api → api/blog}/blog.mjs +42 -6
- package/{src/api → api/blog}/blog.test.mjs +2 -2
- package/api/build/build.mjs +92 -0
- package/api/build/build.test.mjs +92 -0
- package/{src/api → api/component}/component.mjs +49 -26
- package/{src/api → api/discover}/discover.mjs +55 -18
- package/{src/api → api/docs}/docs.mjs +47 -21
- package/{src/api → api/doctor}/doctor.mjs +11 -8
- package/{src/api → api}/error.mjs +2 -2
- package/{src/api → api/hook}/hook.mjs +11 -11
- package/{src/api → api}/index.mjs +16 -9
- package/{src/api → api/integration}/validate-integration.mjs +48 -15
- package/{src/api → api/integration}/validate-integration.test.mjs +1 -1
- package/{src/api → api/layout}/layout.mjs +66 -17
- package/{src/api → api/layout}/layout.test.mjs +1 -1
- package/{src/api → api/search}/search.mjs +71 -12
- package/api/swizzle/swizzle.mjs +283 -0
- package/{src/commands → api/swizzle}/swizzle.test.mjs +26 -1
- package/{src/api → api/template}/template-integration.test.mjs +2 -2
- package/{src/api → api/template}/template-suffix.test.mjs +3 -3
- package/{src/api → api/template}/template.mjs +96 -19
- package/{src/api → api/theme}/theme-add.mjs +35 -7
- package/{src → authoring}/codemod.mjs +6 -6
- package/{src → authoring}/config.test.mjs +1 -1
- package/{src → authoring}/doc.mjs +1 -1
- package/{src → authoring}/doc.test.mjs +1 -1
- package/{src → authoring}/template.mjs +1 -1
- package/bin/astryx.mjs +12 -10
- package/{src → cli}/commands/blog.mjs +48 -7
- package/{src → cli}/commands/build-theme.mjs +125 -46
- package/{src → cli}/commands/build.mjs +33 -57
- package/{src → cli}/commands/component/index.mjs +49 -22
- package/{src → cli}/commands/component-ownership.test.mjs +3 -3
- package/{src → cli}/commands/component-package.test.mjs +1 -1
- package/{src → cli}/commands/component-resolution.test.mjs +2 -2
- package/{src → cli}/commands/discover.mjs +17 -8
- package/{src → cli}/commands/docs.mjs +39 -7
- package/{src → cli}/commands/docs.test.mjs +1 -1
- package/{src → cli}/commands/doctor.mjs +3 -3
- package/{src → cli}/commands/doctor.test.mjs +2 -2
- package/{src → cli}/commands/ensure-core-built.mjs +3 -2
- package/{src → cli}/commands/external-showcase.test.mjs +1 -1
- package/{src → cli}/commands/hook/index.mjs +37 -14
- package/{src → cli}/commands/import-hint-correctness.test.mjs +1 -1
- package/{src → cli}/commands/init.mjs +20 -9
- package/{src → cli}/commands/layout.mjs +58 -18
- package/{src → cli}/commands/search.mjs +19 -12
- package/{src → cli}/commands/search.test.mjs +1 -1
- package/{src → cli}/commands/setup-nudge.test.mjs +1 -1
- package/cli/commands/swizzle.mjs +103 -0
- package/{src → cli}/commands/template.mjs +73 -22
- package/{src → cli}/commands/template.path-safety.test.mjs +2 -2
- package/{src → cli}/commands/upgrade.integration-policy.test.mjs +1 -1
- package/{src → cli}/commands/upgrade.mjs +160 -52
- package/{src → cli}/commands/upgrade.test.mjs +1 -1
- package/{src → cli}/commands/validate-integration.mjs +17 -37
- package/{src → cli}/index.mjs +17 -15
- package/{src/codemods → codemods}/ensure-jscodeshift.mjs +1 -1
- package/{src/codemods → codemods}/integration-discovery.mjs +6 -3
- package/{src/codemods → codemods}/integration-discovery.test.mjs +1 -1
- package/{src/codemods → codemods}/integration-runner.mjs +8 -3
- package/{src/codemods → codemods}/registry.mjs +3 -1
- package/{src/codemods → codemods}/run-codemod.mjs +17 -10
- package/{src/codemods → codemods}/runner.mjs +22 -12
- package/{src/codemods → codemods}/transforms/v0.0.10/remove-size-props.mjs +9 -4
- package/{src/codemods → codemods}/transforms/v0.0.12/add-is-icon-only.mjs +27 -22
- package/{src/codemods → codemods}/transforms/v0.0.13/icon-name-deprecations.mjs +12 -5
- package/{src/codemods → codemods}/transforms/v0.0.13/rename-attachments-to-drawer.mjs +15 -8
- package/{src/codemods → codemods}/transforms/v0.0.13/toolbar-density-to-size.mjs +10 -4
- package/{src/codemods → codemods}/transforms/v0.0.14/rename-action-props.mjs +11 -5
- package/{src/codemods → codemods}/transforms/v0.0.14/rename-section-wash-to-muted.mjs +11 -6
- package/{src/codemods → codemods}/transforms/v0.0.14/rename-status-variants.mjs +15 -10
- package/{src/codemods → codemods}/transforms/v0.0.15/migrate-item-children-to-endcontent.mjs +13 -8
- package/{src/codemods → codemods}/transforms/v0.0.15/migrate-selector-children-to-render-option.mjs +18 -13
- package/{src/codemods → codemods}/transforms/v0.0.15/migrate-theme-selectors-to-data-attrs.mjs +8 -4
- package/{src/codemods → codemods}/transforms/v0.0.15/rename-date-picker-to-input.mjs +11 -6
- package/{src/codemods → codemods}/transforms/v0.0.15/rename-imperative-ref-to-handleRef.mjs +6 -1
- package/{src/codemods → codemods}/transforms/v0.0.15/rename-isStreaming-to-isStopShown.mjs +6 -1
- package/{src/codemods → codemods}/transforms/v0.0.15/rename-stack-element-to-as.mjs +8 -3
- package/{src/codemods → codemods}/transforms/v0.0.2/migrate-badge-dot-to-statusdot.mjs +17 -10
- package/{src/codemods → codemods}/transforms/v0.0.2/migrate-gap-to-numeric.mjs +7 -1
- package/{src/codemods → codemods}/transforms/v0.0.2/migrate-isFullBleed-to-padding.mjs +9 -4
- package/{src/codemods → codemods}/transforms/v0.0.2/migrate-useXDSIcon-to-getIcon.mjs +12 -7
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-banner-endButton-to-endContent.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-form-tooltip-startIcon.mjs +8 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-isShown-to-isOpen.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-selector-items-to-options.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-sidenav-header-to-heading.mjs +11 -4
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-topnav-title-to-heading.mjs +10 -4
- package/{src/codemods → codemods}/transforms/v0.0.2/unify-uncontrolled-to-defaultX.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/unify-visibility-to-onOpenChange.mjs +10 -5
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-badge-children-to-label.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-collapse-to-collapsible.mjs +9 -3
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-radius-tokens.mjs +11 -5
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-shadow-tokens.mjs +13 -6
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-skeleton-radius.mjs +7 -1
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-token-names.mjs +11 -5
- package/{src/codemods → codemods}/transforms/v0.0.7/rename-banner-variant-to-container.mjs +8 -3
- package/{src/codemods → codemods}/transforms/v0.0.8/migrate-token-renames.mjs +15 -8
- package/{src/codemods → codemods}/transforms/v0.0.8/rename-endslot-to-endcontent.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.1.0/drop-xds-prefix-imports.mjs +19 -14
- package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-css-surfaces.mjs +21 -17
- package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-declare-module.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +16 -11
- package/{src/codemods → codemods}/transforms/v0.1.2/rename-text-color-active-to-accent.mjs +15 -9
- package/{src/codemods → codemods}/transforms/v0.1.3/migrate-layout-components-to-experimental.mjs +17 -12
- package/{src/codemods → codemods}/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +15 -9
- package/{src/codemods → codemods}/transforms/v0.1.7/migrate-table-tableprops-to-direct-props.mjs +17 -10
- package/{src/codemods → codemods}/transforms/v0.1.7/rename-table-renderprops-styles-to-xstyle.mjs +18 -13
- package/{src/codemods → codemods}/transforms/v0.1.8/rename-avatar-size-scale.mjs +15 -10
- package/docs/elevation.doc.mjs +79 -1
- package/docs/internationalization.doc.mjs +92 -46
- package/{src/commands → lib/agent-docs}/agent-docs.mjs +30 -11
- package/{src/commands → lib/agent-docs}/agent-docs.path-safety.test.mjs +1 -1
- package/{src/lib → lib}/cli-error.mjs +2 -2
- package/{src/lib → lib}/component-discovery.mjs +44 -2
- package/{src/lib → lib}/component-format.mjs +65 -24
- package/{src/lib → lib}/component-loader.mjs +27 -13
- package/{src/lib → lib}/componentDocOverlay.test.mjs +0 -1
- package/{src/lib → lib}/error-codes.test.mjs +1 -1
- package/{src/lib → lib}/hook-discovery.mjs +14 -1
- package/{src/lib → lib}/hook-format.mjs +29 -5
- package/{src/lib → lib}/integration-warnings.mjs +2 -2
- package/{src/lib → lib}/integrations.mjs +20 -0
- package/{src/lib → lib}/integrations.test.mjs +1 -1
- package/{src/lib → lib}/json-contract.test.mjs +1 -1
- package/{src/lib → lib}/json-shim.mjs +11 -6
- package/{src/lib → lib}/json-shim.test.mjs +1 -1
- package/{src/lib → lib}/json.mjs +3 -3
- package/{src/lib → lib}/levenshtein.mjs +6 -0
- package/{src/lib → lib}/manifest.mjs +7 -5
- package/{src/lib → lib}/manifest.test.mjs +2 -2
- package/{src/lib → lib}/module-loader.mjs +1 -0
- package/{src/lib → lib}/package-scanner.mjs +47 -0
- package/{src/lib → lib}/project.mjs +48 -18
- package/{src/lib → lib}/project.test.mjs +1 -1
- package/{src/lib → lib}/resolve-theme.mjs +5 -0
- package/{src/lib → lib}/string-utils.mjs +15 -0
- package/{src/lib → lib}/term-log.mjs +12 -3
- package/{src/lib → lib}/xle/browser.mjs +18 -8
- package/{src/lib → lib}/xle/expand.mjs +155 -22
- package/{src/lib → lib}/xle/parse.mjs +119 -13
- package/{src/lib → lib}/xle/print.mjs +54 -14
- package/{src/lib → lib}/xle/registry-core.mjs +28 -3
- package/{src/lib → lib}/xle/registry.mjs +9 -4
- package/{src/lib → lib}/xle/splice.mjs +13 -2
- package/{src/lib → lib}/xle/validate.mjs +95 -14
- package/lib/xle/xle-ast.d.ts +214 -0
- package/package.json +35 -27
- package/scripts/postinstall.mjs +4 -4
- package/templates/blocks/components/Avatar/AvatarShowcase.tsx +1 -1
- package/templates/blocks/components/Banner/BannerFloating.doc.mjs +14 -0
- package/templates/blocks/components/Banner/BannerFloating.tsx +16 -0
- package/templates/blocks/components/Button/ButtonFloating.doc.mjs +14 -0
- package/templates/blocks/components/Button/ButtonFloating.tsx +37 -0
- package/templates/blocks/components/ButtonGroup/ButtonGroupFloating.doc.mjs +14 -0
- package/templates/blocks/components/ButtonGroup/ButtonGroupFloating.tsx +23 -0
- package/templates/blocks/components/Card/CardElevations.doc.mjs +14 -0
- package/templates/blocks/components/Card/CardElevations.tsx +32 -0
- package/templates/blocks/components/Card/ClickableCardElevated.doc.mjs +14 -0
- package/templates/blocks/components/Card/ClickableCardElevated.tsx +21 -0
- package/templates/blocks/components/Card/SelectableCardElevated.doc.mjs +14 -0
- package/templates/blocks/components/Card/SelectableCardElevated.tsx +37 -0
- package/templates/blocks/components/ChatComposer/ChatComposerFlat.doc.mjs +14 -0
- package/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx +75 -0
- package/templates/blocks/components/IconButton/IconButtonFloating.doc.mjs +14 -0
- package/templates/blocks/components/IconButton/IconButtonFloating.tsx +37 -0
- package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +19 -0
- package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +46 -0
- package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +14 -0
- package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +33 -0
- package/templates/blocks/components/OverflowList/OverflowListCappedToolbar.doc.mjs +14 -0
- package/templates/blocks/components/OverflowList/OverflowListCappedToolbar.tsx +39 -0
- package/templates/blocks/components/OverflowList/OverflowListMultiRowTags.doc.mjs +14 -0
- package/templates/blocks/components/OverflowList/OverflowListMultiRowTags.tsx +44 -0
- package/templates/blocks/components/Thumbnail/ThumbnailElevated.doc.mjs +14 -0
- package/templates/blocks/components/Thumbnail/ThumbnailElevated.tsx +31 -0
- package/{src/types → types}/api.contract.assert.ts +17 -8
- package/{src/types → types}/api.d.ts +110 -9
- package/{src/types → types}/base.d.ts +40 -4
- package/types/build.d.ts +53 -0
- package/types/codemod.d.ts +166 -0
- package/{src/types → types}/component.d.ts +1 -1
- package/{src/types → types}/discover.d.ts +1 -1
- package/{src/types → types}/docs.d.ts +1 -4
- package/{src/types → types}/hook.d.ts +1 -1
- package/{src/types → types}/index.d.ts +1 -0
- package/types/jscodeshift.d.ts +19 -0
- package/types/layout.d.ts +74 -0
- package/{src/types → types}/swizzle.d.ts +4 -0
- package/types/theme.d.ts +53 -0
- package/{src/types → types}/upgrade.d.ts +8 -1
- package/{src/utils → utils}/package-manager.mjs +30 -4
- package/{src/utils → utils}/paths.mjs +4 -1
- package/{src/utils → utils}/update-check.mjs +3 -3
- package/{src/utils → utils}/update-check.test.mjs +3 -3
- package/src/commands/swizzle.mjs +0 -417
- package/src/types/codemod.d.ts +0 -81
- package/src/types/theme.d.ts +0 -23
- /package/{src/api → api/docs}/docOverlays.test.mjs +0 -0
- /package/{src/api → api/integration}/integration-block-exports.test.mjs +0 -0
- /package/{src/api → api/template}/template.test.mjs +0 -0
- /package/{src → authoring}/codemod.test.mjs +0 -0
- /package/{src → authoring}/config.mjs +0 -0
- /package/{src → authoring}/integration.mjs +0 -0
- /package/{src → authoring}/template.test.mjs +0 -0
- /package/{src → cli}/cli-exit-codes.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.color-scheme.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.import-path.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.path-safety.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.prose.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.variants.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.watch.test.mjs +0 -0
- /package/{src → cli}/commands/cli-postinstall.test.mjs +0 -0
- /package/{src → cli}/commands/component.test.mjs +0 -0
- /package/{src → cli}/commands/detail-levels.test.mjs +0 -0
- /package/{src → cli}/commands/init.next-steps.test.mjs +0 -0
- /package/{src → cli}/commands/interactive-guard.test.mjs +0 -0
- /package/{src → cli}/commands/json-contract.test.mjs +0 -0
- /package/{src → cli}/commands/swizzle.path-safety.test.mjs +0 -0
- /package/{src → cli}/commands/swizzle.routing.test.mjs +0 -0
- /package/{src → cli}/commands/template.test.mjs +0 -0
- /package/{src → cli}/commands/upgrade.config-ordering.test.mjs +0 -0
- /package/{src → cli}/commands/validate-integration.test.mjs +0 -0
- /package/{src → cli}/update-hint-commands.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/registry.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/rename-imperative-ref-to-handleRef.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/rename-isStreaming-to-isStopShown.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/rename-section-wash-to-muted.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/runner.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/toolbar-density-to-size.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/validation.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.10/__tests__/remove-size-props.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.10/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.12/__tests__/add-is-icon-only.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.12/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.13/__tests__/icon-name-deprecations.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.13/__tests__/rename-attachments-to-drawer.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.13/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.14/__tests__/rename-action-props.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.14/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-item-children-to-endcontent.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-selector-children-to-render-option.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-theme-selectors-to-data-attrs.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/rename-date-picker-to-input.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/rename-stack-element-to-as.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-badge-dot-to-statusdot.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-gap-to-numeric.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-isFullBleed-to-padding.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-useXDSIcon-to-getIcon.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-banner-endButton-to-endContent.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-form-tooltip-startIcon.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-isShown-to-isOpen.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-selector-items-to-options.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-sidenav-header-to-heading.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-topnav-title-to-heading.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/unify-uncontrolled-to-defaultX.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/unify-visibility-to-onOpenChange.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-collapse-to-collapsible.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-radius-tokens.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-shadow-tokens.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-skeleton-radius.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-token-names.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.7/__tests__/rename-banner-variant-to-container.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.7/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.8/__tests__/migrate-token-renames.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.8/__tests__/rename-endslot-to-endcontent.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.8/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/drop-xds-prefix-imports.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-css-surfaces.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-declare-module.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/v0.1.0-ordering.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.2/__tests__/rename-text-color-active-to-accent.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.2/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.3/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.5/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.7/__tests__/migrate-table-tableprops-to-direct-props.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.7/__tests__/rename-table-renderprops-styles-to-xstyle.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.7/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.8/index.mjs +0 -0
- /package/{src/commands → lib/agent-docs}/agent-docs.test.mjs +0 -0
- /package/{src/lib → lib}/cli-error.test.mjs +0 -0
- /package/{src/lib → lib}/component-discovery.importpath.test.mjs +0 -0
- /package/{src/lib → lib}/component-format.test.mjs +0 -0
- /package/{src/lib → lib}/component-loader.test.mjs +0 -0
- /package/{src/lib → lib}/config-cache.mjs +0 -0
- /package/{src/lib → lib}/config-cache.test.mjs +0 -0
- /package/{src/lib → lib}/config-schema.mjs +0 -0
- /package/{src/lib → lib}/error-codes.mjs +0 -0
- /package/{src/lib → lib}/integration-warnings.test.mjs +0 -0
- /package/{src/lib → lib}/module-loader.test.mjs +0 -0
- /package/{src/lib → lib}/node-version.mjs +0 -0
- /package/{src/lib → lib}/node-version.test.mjs +0 -0
- /package/{src/lib → lib}/parse.mjs +0 -0
- /package/{src/lib → lib}/site.mjs +0 -0
- /package/{src/lib → lib}/xle/browser.d.ts +0 -0
- /package/{src/lib → lib}/xle/xle.test.mjs +0 -0
- /package/{src/schemas → schemas}/doc-schema.mjs +0 -0
- /package/{src/schemas → schemas}/template-schema.mjs +0 -0
- /package/{src/types → types}/config.d.ts +0 -0
- /package/{src/types → types}/doc.d.ts +0 -0
- /package/{src/types → types}/doctor.d.ts +0 -0
- /package/{src/types → types}/error-codes.d.ts +0 -0
- /package/{src/types → types}/integration.d.ts +0 -0
- /package/{src/types → types}/manifest.d.ts +0 -0
- /package/{src/types → types}/search.d.ts +0 -0
- /package/{src/types → types}/template-api.d.ts +0 -0
- /package/{src/types → types}/template.d.ts +0 -0
- /package/{src/types → types}/validate-integration.d.ts +0 -0
- /package/{src/utils → utils}/github.mjs +0 -0
- /package/{src/utils → utils}/package-manager.test.mjs +0 -0
- /package/{src/utils → utils}/path-safety.mjs +0 -0
- /package/{src/utils → utils}/path-safety.test.mjs +0 -0
- /package/{src/utils → utils}/paths.test.mjs +0 -0
- /package/{src/utils → utils}/semver.mjs +0 -0
- /package/{src/utils → utils}/semver.test.mjs +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Thumbnail} from '@astryxdesign/core/Thumbnail';
|
|
6
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
7
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
8
|
+
|
|
9
|
+
// Demo imagery is inlined as same-origin data URIs so the example is
|
|
10
|
+
// self-contained. Thumbnail's remove-button overlay uses useImageMode, which
|
|
11
|
+
// FETCHES the image to sample pixels (APCA) for contrast — a cross-origin CDN
|
|
12
|
+
// URL without CORS headers cannot be sampled, so contrast detection fails
|
|
13
|
+
// silently in hosted previews.
|
|
14
|
+
const NIGHT_FOREST =
|
|
15
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAwFBMVEX18+H08uDy8d/y8N/v7t/m5NXl49Tk4tPc3NDX1cnW1cnW1cjW1MjV1MjV1MfR0cXIyLzEw7m8vLC3t68wM0QvM0MvM0IvMkIuMkEtMEErLz8iJjkhJTggJTcgJDcfJDYfIzYeIjUcITMbHzIWHiwYGzIXGjEWGjAWGTAVGS8VGC8UGC4UGC0UFy4TFy0TFywTFi0SFiwRFSsQFSkNFR4QFCoPFCkPFCgPEykOEygOEigNEicNEScMESYIDw8ECgr+gzZIAAABqElEQVR42uWQ61aCQBRGD5GylNBMKS9FZgNdNE0cyUvB+79VM8MoF9Fgplau2j/8nO8c9hqAD0ngDwjeJYH1lrfBWoCtYDboNu/Zv7qQYNap1bpCN1gxFh1dNe5WAsCScWqoWttbChAKvHZZ0W6XQoIFpW8ooFmLCG2Rl1BgaZAU5Ac8yg0RlC9nngCRQDFuhQRzinWmkCuYk3lxQoFrlskVqlcTMcEFvYIKoFbNfmEFuIypWaGGkt66tqZuEbjAHZl6SQVF1WqNvpDAHVktXTvR9JbgDZii1+tZI7cYMJXkCASvksB4L5VxHmAsibzgRRIYbjgfCgFDSeBZkh8W1HMIniSBR0mOQPCQA3RgBk4M5DhNZwdEcbKgLXy5iDiZg5gApRYbqTql2FZgMxAKeEWSNUFYx3s2SfU28HPWItrpySSwE2cEdqrYtxgmxgHGScFmHrAGk8SxczIxZnNC1McFOGshShyb4yxB9sI3CXDGnH0MLsD7F5LvvptEgH12Zg1Pn2WuHsjvrwt8308t+nwxT38sgiAE8/RTeagH+vx/F8SeF0Ja8Ak14ia/LgmpZQAAAABJRU5ErkJggg==';
|
|
16
|
+
const GOLDEN_SUNSET =
|
|
17
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAkFBMVEX/+uv/7sj6tFr3sVn1r1nzrVjxq1jvqVftp1frpVbpo1bnoVXln1XjnVThm1TfmVPdl1PblVLZk1LXkVLVj1HTjVHRi1DPiVDNh0/LhU/Jg07HgU7Ff03DfU3Be0y/eUy9d0u7dUu5c0u2cEq0bkqybEmwakmuaEisZkiqZEeoYkemYEakXkaiXEVgLjQ8HCjaJlMkAAABI0lEQVR42u3Mx3qDMBSE0Z/03nsvdhxjcnn/twsYjISR5MUkO5+V9N2ZYUPEpogtEdsidkTsitgTsS/iQMShiCMRxyJORJyKOBNxLuJCxKWIKxHXIm5E3Iq4E3Ev4kHEo4gnEc8iXkS8inhLymrJBO8J2UIiw0dc5sRDfEbVRWr1o/pbMMWox9yz6zcLIzMbBTD2VaHu7fr1gjXGA3w5baj5+H0w6x09TDpdaP7rDZhn0sd3y89Y9fcHbPnoYdroZ2w6dQNmg6OHfG4QyrsBC8gdZpVQxtqF4M1mjepFURThTLNgMYsePxaX2WqY6D8GSm2grK2slbGBciHZ9hOE2smNpTuxenhieCdeH06E7qTqvYnImWTbbUSPlKL1wHrgTwZ+AWq+3H5MpRkwAAAAAElFTkSuQmCC';
|
|
18
|
+
|
|
19
|
+
export default function ThumbnailElevated() {
|
|
20
|
+
return (
|
|
21
|
+
<Stack direction="vertical" gap={3}>
|
|
22
|
+
<Text type="supporting" color="secondary">
|
|
23
|
+
Raised tiles — `elevation` lifts an image off the page at rest
|
|
24
|
+
</Text>
|
|
25
|
+
<Stack direction="horizontal" gap={3} vAlign="center">
|
|
26
|
+
<Thumbnail src={NIGHT_FOREST} alt="Forest at night" elevation="low" />
|
|
27
|
+
<Thumbnail src={GOLDEN_SUNSET} alt="Golden sunset" elevation="high" />
|
|
28
|
+
</Stack>
|
|
29
|
+
</Stack>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
import type * as Api from './api';
|
|
34
|
-
import type {component} from '../api/component.mjs';
|
|
35
|
-
import type {docs} from '../api/docs.mjs';
|
|
36
|
-
import type {discover} from '../api/discover.mjs';
|
|
37
|
-
import type {template} from '../api/template.mjs';
|
|
34
|
+
import type {component} from '../api/component/component.mjs';
|
|
35
|
+
import type {docs} from '../api/docs/docs.mjs';
|
|
36
|
+
import type {discover} from '../api/discover/discover.mjs';
|
|
37
|
+
import type {template} from '../api/template/template.mjs';
|
|
38
38
|
|
|
39
39
|
/** Resolve to `true` only when `A` and `B` are mutually assignable. */
|
|
40
40
|
type Equal<A, B> =
|
|
41
|
-
(<T>() => T extends A ? 1 : 2) extends
|
|
41
|
+
(<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2
|
|
42
42
|
? true
|
|
43
43
|
: false;
|
|
44
44
|
|
|
@@ -52,16 +52,25 @@ type Opt<T> = NonNullable<T>;
|
|
|
52
52
|
// must describe the same set of keys/types, in both directions. ──────────────
|
|
53
53
|
|
|
54
54
|
type _ComponentOptions = Expect<
|
|
55
|
-
Equal<
|
|
55
|
+
Equal<
|
|
56
|
+
Opt<Parameters<typeof Api.component>[1]>,
|
|
57
|
+
Opt<Parameters<typeof component>[1]>
|
|
58
|
+
>
|
|
56
59
|
>;
|
|
57
60
|
type _DocsOptions = Expect<
|
|
58
61
|
Equal<Opt<Parameters<typeof Api.docs>[2]>, Opt<Parameters<typeof docs>[2]>>
|
|
59
62
|
>;
|
|
60
63
|
type _DiscoverOptions = Expect<
|
|
61
|
-
Equal<
|
|
64
|
+
Equal<
|
|
65
|
+
Opt<Parameters<typeof Api.discover>[1]>,
|
|
66
|
+
Opt<Parameters<typeof discover>[1]>
|
|
67
|
+
>
|
|
62
68
|
>;
|
|
63
69
|
type _TemplateOptions = Expect<
|
|
64
|
-
Equal<
|
|
70
|
+
Equal<
|
|
71
|
+
Opt<Parameters<typeof Api.template>[1]>,
|
|
72
|
+
Opt<Parameters<typeof template>[1]>
|
|
73
|
+
>
|
|
65
74
|
>;
|
|
66
75
|
|
|
67
76
|
// ── Positional-argument parity: arity and positional types must match. ───────
|
|
@@ -44,17 +44,24 @@ import type {
|
|
|
44
44
|
import type {SearchResponse, SearchDomain} from './search';
|
|
45
45
|
import type {ErrorCode} from './error-codes';
|
|
46
46
|
import type {DoctorResponse} from './doctor';
|
|
47
|
+
import type {
|
|
48
|
+
LayoutForm,
|
|
49
|
+
LayoutExpandResponse,
|
|
50
|
+
LayoutCheckResponse,
|
|
51
|
+
LayoutGrammarResponse,
|
|
52
|
+
} from './layout';
|
|
53
|
+
import type {ValidateIntegrationResponse} from './validate-integration';
|
|
54
|
+
import type {AstryxIntegrationIssue} from './integration';
|
|
55
|
+
import type {BuildHelpResponse, BuildKitResponse} from './build';
|
|
56
|
+
import type {SwizzleListResponse, SwizzleCopyResponse} from './swizzle';
|
|
57
|
+
import type {Suggestion} from './base';
|
|
47
58
|
|
|
48
59
|
/** Structured API error with a stable machine-readable code. */
|
|
49
60
|
export declare class AstryxError extends Error {
|
|
50
61
|
/** Stable error code; consumers branch on this, never the message. */
|
|
51
62
|
code: ErrorCode;
|
|
52
|
-
suggestions?:
|
|
53
|
-
constructor(
|
|
54
|
-
message: string,
|
|
55
|
-
suggestions?: Array<{name: string; reason: string}>,
|
|
56
|
-
code?: ErrorCode,
|
|
57
|
-
);
|
|
63
|
+
suggestions?: Suggestion[];
|
|
64
|
+
constructor(message: string, suggestions?: Suggestion[], code?: ErrorCode);
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
// ── Component ────────────────────────────────────────────────────────
|
|
@@ -100,9 +107,7 @@ export interface DocsOptions {
|
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
type DocsResult =
|
|
103
|
-
|
|
|
104
|
-
| DocsDetailResponse
|
|
105
|
-
| DocsDetailSectionResponse;
|
|
110
|
+
DocsListResponse | DocsDetailResponse | DocsDetailSectionResponse;
|
|
106
111
|
|
|
107
112
|
export declare function docs(
|
|
108
113
|
topic?: string,
|
|
@@ -191,6 +196,47 @@ export declare function search(
|
|
|
191
196
|
options?: SearchOptions,
|
|
192
197
|
): Promise<SearchResponse>;
|
|
193
198
|
|
|
199
|
+
// ── Build ────────────────────────────────────────────────────────────
|
|
200
|
+
|
|
201
|
+
export interface BuildOptions {
|
|
202
|
+
cwd?: string;
|
|
203
|
+
type?: SearchDomain;
|
|
204
|
+
limit?: number;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Page-building assistant. No query → `build.help` (playbook signal); a query →
|
|
209
|
+
* `build.kit` (grouped composition kit of raw search entries + frame/foundation).
|
|
210
|
+
*/
|
|
211
|
+
export declare function build(
|
|
212
|
+
query?: string,
|
|
213
|
+
options?: BuildOptions,
|
|
214
|
+
): Promise<BuildHelpResponse | BuildKitResponse>;
|
|
215
|
+
|
|
216
|
+
// ── Swizzle ──────────────────────────────────────────────────────────
|
|
217
|
+
|
|
218
|
+
export interface SwizzleOptions {
|
|
219
|
+
cwd?: string;
|
|
220
|
+
/** Output directory (must resolve inside cwd). Defaults to ./components/astryx. */
|
|
221
|
+
output?: string;
|
|
222
|
+
/** Scope to a specific owning package when a name is ambiguous. */
|
|
223
|
+
package?: string;
|
|
224
|
+
/** Force the list response even with a component argument. */
|
|
225
|
+
list?: boolean;
|
|
226
|
+
/** Overwrite existing files instead of erroring. */
|
|
227
|
+
overwrite?: boolean;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* List swizzlable components (no name / `list`) or copy one component's source
|
|
232
|
+
* into the project (side effect) and return a `swizzle.copy` receipt. Errors
|
|
233
|
+
* throw AstryxError (ERR_UNKNOWN_COMPONENT, ERR_AMBIGUOUS_COMPONENT, …).
|
|
234
|
+
*/
|
|
235
|
+
export declare function swizzle(
|
|
236
|
+
component?: string,
|
|
237
|
+
options?: SwizzleOptions,
|
|
238
|
+
): Promise<SwizzleListResponse | SwizzleCopyResponse>;
|
|
239
|
+
|
|
194
240
|
// ── Doctor ──────────────────────────────────
|
|
195
241
|
|
|
196
242
|
export interface DoctorOptions {
|
|
@@ -200,3 +246,58 @@ export interface DoctorOptions {
|
|
|
200
246
|
export declare function doctor(
|
|
201
247
|
options?: DoctorOptions,
|
|
202
248
|
): Promise<DoctorResponse>;
|
|
249
|
+
|
|
250
|
+
// ── Layout ───────────────────────────────────────────────────────────
|
|
251
|
+
|
|
252
|
+
export interface LayoutExpandOptions {
|
|
253
|
+
targetPath?: string;
|
|
254
|
+
form?: LayoutForm;
|
|
255
|
+
loose?: boolean;
|
|
256
|
+
name?: string;
|
|
257
|
+
cwd?: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export declare function layoutExpand(
|
|
261
|
+
expression: string,
|
|
262
|
+
options?: LayoutExpandOptions,
|
|
263
|
+
): Promise<LayoutExpandResponse>;
|
|
264
|
+
|
|
265
|
+
export interface LayoutCheckOptions {
|
|
266
|
+
form?: LayoutForm;
|
|
267
|
+
loose?: boolean;
|
|
268
|
+
cwd?: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export declare function layoutCheck(
|
|
272
|
+
expression: string,
|
|
273
|
+
options?: LayoutCheckOptions,
|
|
274
|
+
): Promise<LayoutCheckResponse>;
|
|
275
|
+
|
|
276
|
+
export interface LayoutGrammarOptions {
|
|
277
|
+
cwd?: string;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export declare function layoutGrammar(
|
|
281
|
+
options?: LayoutGrammarOptions,
|
|
282
|
+
): Promise<LayoutGrammarResponse>;
|
|
283
|
+
|
|
284
|
+
// ── Validate integration ─────────────────────────────────────────────
|
|
285
|
+
|
|
286
|
+
export interface ValidateIntegrationOptions {
|
|
287
|
+
cwd?: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Validate the local integration (no `pkg`) or an installed one (`pkg` given).
|
|
292
|
+
* The no-manifest local case returns `{ name: null, version: null, issues: [] }`.
|
|
293
|
+
*/
|
|
294
|
+
export declare function validateIntegration(
|
|
295
|
+
pkg?: string,
|
|
296
|
+
options?: ValidateIntegrationOptions,
|
|
297
|
+
): Promise<ValidateIntegrationResponse>;
|
|
298
|
+
|
|
299
|
+
/** Count issues by severity. */
|
|
300
|
+
export declare function summarizeIssues(issues: AstryxIntegrationIssue[]): {
|
|
301
|
+
errors: number;
|
|
302
|
+
warnings: number;
|
|
303
|
+
};
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
ComponentListResponse,
|
|
13
13
|
ComponentBriefResponse,
|
|
14
|
+
ComponentFullResponse,
|
|
14
15
|
ComponentDetailResponse,
|
|
15
16
|
ComponentDetailPropsResponse,
|
|
16
17
|
ComponentDetailSourceResponse,
|
|
17
18
|
ComponentDetailShowcaseResponse,
|
|
19
|
+
ComponentDetailBlocksResponse,
|
|
18
20
|
} from './component';
|
|
19
21
|
import type {
|
|
20
22
|
DiscoverListResponse,
|
|
@@ -41,14 +43,38 @@ import type {
|
|
|
41
43
|
HookDetailParamsResponse,
|
|
42
44
|
} from './hook';
|
|
43
45
|
import type {SwizzleListResponse, SwizzleCopyResponse} from './swizzle';
|
|
44
|
-
import type {
|
|
45
|
-
|
|
46
|
+
import type {
|
|
47
|
+
ThemeBuildResponse,
|
|
48
|
+
ThemeListResponse,
|
|
49
|
+
ThemeAddResponse,
|
|
50
|
+
} from './theme';
|
|
51
|
+
import type {
|
|
52
|
+
UpgradeListResponse,
|
|
53
|
+
UpgradeRunResponse,
|
|
54
|
+
UpgradeStatusResponse,
|
|
55
|
+
} from './upgrade';
|
|
46
56
|
import type {SearchResponse} from './search';
|
|
57
|
+
import type {
|
|
58
|
+
LayoutExpandResponse,
|
|
59
|
+
LayoutCheckResponse,
|
|
60
|
+
LayoutGrammarResponse,
|
|
61
|
+
} from './layout';
|
|
62
|
+
import type {BuildHelpResponse, BuildKitResponse} from './build';
|
|
47
63
|
import type {ErrorCode} from './error-codes';
|
|
48
64
|
import type {ManifestResponse} from './manifest';
|
|
49
65
|
import type {DoctorResponse} from './doctor';
|
|
50
66
|
import type {ValidateIntegrationResponse} from './validate-integration';
|
|
51
67
|
|
|
68
|
+
/**
|
|
69
|
+
* A "did you mean…" suggestion attached to an error. `reason` is optional:
|
|
70
|
+
* some call sites emit bare `{name}` (e.g. a list of candidate component names)
|
|
71
|
+
* with no per-item explanation.
|
|
72
|
+
*/
|
|
73
|
+
export interface Suggestion {
|
|
74
|
+
name: string;
|
|
75
|
+
reason?: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
52
78
|
/**
|
|
53
79
|
* Structured error. Check `'error' in result` to discriminate.
|
|
54
80
|
*
|
|
@@ -58,7 +84,7 @@ import type {ValidateIntegrationResponse} from './validate-integration';
|
|
|
58
84
|
export interface CLIError {
|
|
59
85
|
error: string;
|
|
60
86
|
code: ErrorCode;
|
|
61
|
-
suggestions?:
|
|
87
|
+
suggestions?: Suggestion[];
|
|
62
88
|
}
|
|
63
89
|
|
|
64
90
|
/** Returned by the fallback hook for commands without --json support. */
|
|
@@ -74,10 +100,12 @@ export type CLIResult<T> = T | CLIError | CLIUnsupportedError;
|
|
|
74
100
|
export type CLIAnyResponse =
|
|
75
101
|
| ComponentListResponse
|
|
76
102
|
| ComponentBriefResponse
|
|
103
|
+
| ComponentFullResponse
|
|
77
104
|
| ComponentDetailResponse
|
|
78
105
|
| ComponentDetailPropsResponse
|
|
79
106
|
| ComponentDetailSourceResponse
|
|
80
107
|
| ComponentDetailShowcaseResponse
|
|
108
|
+
| ComponentDetailBlocksResponse
|
|
81
109
|
| DiscoverListResponse
|
|
82
110
|
| DiscoverDetailResponse
|
|
83
111
|
| DiscoverDetailDocResponse
|
|
@@ -97,9 +125,17 @@ export type CLIAnyResponse =
|
|
|
97
125
|
| SwizzleListResponse
|
|
98
126
|
| SwizzleCopyResponse
|
|
99
127
|
| ThemeBuildResponse
|
|
128
|
+
| ThemeListResponse
|
|
129
|
+
| ThemeAddResponse
|
|
100
130
|
| UpgradeListResponse
|
|
101
131
|
| UpgradeRunResponse
|
|
132
|
+
| UpgradeStatusResponse
|
|
102
133
|
| SearchResponse
|
|
134
|
+
| LayoutExpandResponse
|
|
135
|
+
| LayoutCheckResponse
|
|
136
|
+
| LayoutGrammarResponse
|
|
137
|
+
| BuildHelpResponse
|
|
138
|
+
| BuildKitResponse
|
|
103
139
|
| ManifestResponse
|
|
104
140
|
| DoctorResponse
|
|
105
141
|
| ValidateIntegrationResponse;
|
|
@@ -129,7 +165,7 @@ export function jsonOut<T extends CLIResponseType>(
|
|
|
129
165
|
*/
|
|
130
166
|
export function jsonError(
|
|
131
167
|
message: string,
|
|
132
|
-
suggestions?:
|
|
168
|
+
suggestions?: Suggestion[],
|
|
133
169
|
code?: ErrorCode,
|
|
134
170
|
): never;
|
|
135
171
|
|
package/types/build.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build command JSON responses.
|
|
5
|
+
*
|
|
6
|
+
* `astryx build` is the "assemble a page" verb. With no query it emits the
|
|
7
|
+
* workflow playbook; with a query it delegates to the search pipeline and
|
|
8
|
+
* emits a `search` response (see search.d.ts).
|
|
9
|
+
*
|
|
10
|
+
* Invocation -> type discriminator
|
|
11
|
+
* ---------------------------------------------------
|
|
12
|
+
* xds --json build -> build.help
|
|
13
|
+
* xds --json build "<idea>" -> build.kit
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type {SearchResultEntry} from './search';
|
|
17
|
+
|
|
18
|
+
/** xds --json build (no query) — the "how to build a page" playbook signal. */
|
|
19
|
+
export interface BuildHelpResponse {
|
|
20
|
+
type: 'build.help';
|
|
21
|
+
data: {
|
|
22
|
+
/** Always true; marks this envelope as the playbook rather than a result set. */
|
|
23
|
+
playbook: true;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* xds --json build "<idea>" — the composition kit for what you're building.
|
|
29
|
+
*
|
|
30
|
+
* Entries are raw `SearchResultEntry` objects (no package-manager-prefixed
|
|
31
|
+
* command strings — the CLI adds those); `frame`/`foundation` are static
|
|
32
|
+
* component-name arrays surfaced on every kit.
|
|
33
|
+
*/
|
|
34
|
+
export interface BuildKitResponse {
|
|
35
|
+
type: 'build.kit';
|
|
36
|
+
data: {
|
|
37
|
+
query: string;
|
|
38
|
+
/** False when search returned nothing (renderer shows "No matches"). */
|
|
39
|
+
hasResults: boolean;
|
|
40
|
+
/** True when the top page template is a confident direct match. */
|
|
41
|
+
directMatch: boolean;
|
|
42
|
+
/** Closest page templates (≤3). */
|
|
43
|
+
pages: SearchResultEntry[];
|
|
44
|
+
/** Drop-in block patterns covering parts of the idea (≤5). */
|
|
45
|
+
blocks: SearchResultEntry[];
|
|
46
|
+
/** Idea-specific components/hooks (≤6), excluding frame/foundation. */
|
|
47
|
+
domain: SearchResultEntry[];
|
|
48
|
+
/** Always-on page-shell component names. */
|
|
49
|
+
frame: string[];
|
|
50
|
+
/** Always-on layout/typography/action component names. */
|
|
51
|
+
foundation: string[];
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public type surface for the file-based codemod-authoring API exported from
|
|
5
|
+
* `@astryxdesign/cli/codemod`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** A single source file presented to a codemod's transform. */
|
|
9
|
+
export interface AstryxCodemodFile {
|
|
10
|
+
/** Absolute path to the file being transformed. */
|
|
11
|
+
path: string;
|
|
12
|
+
/** The current source contents of the file. */
|
|
13
|
+
source: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Helpers and context passed to a codemod's transform as the second argument. */
|
|
17
|
+
export interface AstryxCodemodApi {
|
|
18
|
+
/** A jscodeshift instance configured with a parser for the file. */
|
|
19
|
+
jscodeshift: unknown;
|
|
20
|
+
/** Report a statistic (no-op-friendly; provided for jscodeshift parity). */
|
|
21
|
+
stats: (...args: unknown[]) => void;
|
|
22
|
+
/** Report progress (no-op-friendly; provided for jscodeshift parity). */
|
|
23
|
+
report: (...args: unknown[]) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A codemod's transform. Return the new source to rewrite the file, or
|
|
28
|
+
* `null`/`undefined` to leave the file unchanged.
|
|
29
|
+
*/
|
|
30
|
+
export type AstryxCodemodTransform = (
|
|
31
|
+
file: AstryxCodemodFile,
|
|
32
|
+
api: AstryxCodemodApi,
|
|
33
|
+
) => string | null | undefined;
|
|
34
|
+
|
|
35
|
+
/** Definition accepted by {@link createCodemod}. */
|
|
36
|
+
export interface AstryxCodemodDef {
|
|
37
|
+
/** Short, human-readable title shown in upgrade output. */
|
|
38
|
+
title: string;
|
|
39
|
+
/** Optional longer description. */
|
|
40
|
+
description?: string;
|
|
41
|
+
/** When true, the codemod runs only when explicitly requested. */
|
|
42
|
+
isOptional?: boolean;
|
|
43
|
+
/** File extensions this codemod applies to (e.g. ['.tsx', '.ts']). */
|
|
44
|
+
fileExtensions?: string[];
|
|
45
|
+
/** The transform function. */
|
|
46
|
+
transform: AstryxCodemodTransform;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Result of {@link createCodemod}. */
|
|
50
|
+
export interface AstryxCodemod extends AstryxCodemodDef {
|
|
51
|
+
isOptional: boolean;
|
|
52
|
+
type: 'code';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Definition accepted by {@link createConfigCodemod}. */
|
|
56
|
+
export interface AstryxConfigCodemodDef {
|
|
57
|
+
/** Short, human-readable title shown in upgrade output. */
|
|
58
|
+
title: string;
|
|
59
|
+
/** Optional longer description. */
|
|
60
|
+
description?: string;
|
|
61
|
+
/** When true, the codemod runs only when explicitly requested. */
|
|
62
|
+
isOptional?: boolean;
|
|
63
|
+
/** The transform function applied to the astryx.config.* file. */
|
|
64
|
+
transform: AstryxCodemodTransform;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Result of {@link createConfigCodemod}. */
|
|
68
|
+
export interface AstryxConfigCodemod extends AstryxConfigCodemodDef {
|
|
69
|
+
isOptional: boolean;
|
|
70
|
+
type: 'config';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Define a file-transforming codemod. */
|
|
74
|
+
export declare function createCodemod<T extends AstryxCodemodDef>(
|
|
75
|
+
def: T,
|
|
76
|
+
): AstryxCodemod;
|
|
77
|
+
|
|
78
|
+
/** Define a codemod that targets the consumer's astryx.config.* file. */
|
|
79
|
+
export declare function createConfigCodemod<T extends AstryxConfigCodemodDef>(
|
|
80
|
+
def: T,
|
|
81
|
+
): AstryxConfigCodemod;
|
|
82
|
+
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
// Internal types (used by the CLI codemod runner infrastructure & transforms).
|
|
85
|
+
// These are not part of the public authoring surface but are shared across the
|
|
86
|
+
// .mjs files under src/codemods/ so JSDoc annotations stay consistent.
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* jscodeshift transform signature. jscodeshift ships no type declarations, so
|
|
91
|
+
* the AST surface (`api.jscodeshift`, paths, node attributes) is untyped by
|
|
92
|
+
* design; transforms operate on it dynamically.
|
|
93
|
+
*/
|
|
94
|
+
export type CodemodTransform = (
|
|
95
|
+
file: AstryxCodemodFile,
|
|
96
|
+
api: CodemodTransformApi,
|
|
97
|
+
) => string | null | undefined;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The `api` argument as seen INSIDE a transform implementation. Identical to
|
|
101
|
+
* {@link AstryxCodemodApi} except `jscodeshift` is typed as the callable
|
|
102
|
+
* factory (jscodeshift ships no types, so the AST it returns is untyped). Used
|
|
103
|
+
* by the .mjs transforms so `const j = api.jscodeshift; j(file.source)` type-checks.
|
|
104
|
+
*/
|
|
105
|
+
export interface CodemodTransformApi {
|
|
106
|
+
jscodeshift: JscodeshiftFactory;
|
|
107
|
+
stats: (...args: unknown[]) => void;
|
|
108
|
+
report: (...args: unknown[]) => void;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* A normalized codemod entry as produced by both the core registry runner and
|
|
113
|
+
* integration discovery. See the header of `run-codemod.mjs` for the contract.
|
|
114
|
+
*/
|
|
115
|
+
export interface CodemodEntry {
|
|
116
|
+
/** Unique id within its package/version (e.g. the transform module name). */
|
|
117
|
+
id: string;
|
|
118
|
+
/** Whether this is a source-file codemod or a config-file codemod. */
|
|
119
|
+
type: 'code' | 'config';
|
|
120
|
+
/** The codemod itself. */
|
|
121
|
+
codemod: {
|
|
122
|
+
title: string;
|
|
123
|
+
description?: string;
|
|
124
|
+
isOptional?: boolean;
|
|
125
|
+
fileExtensions?: string[];
|
|
126
|
+
transform: CodemodTransform;
|
|
127
|
+
};
|
|
128
|
+
/** Owning package name. */
|
|
129
|
+
package: string;
|
|
130
|
+
/** Owning package version. */
|
|
131
|
+
version?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** The result of running a single codemod over one or more files. */
|
|
135
|
+
export interface CodemodRunResult {
|
|
136
|
+
filesChanged: number;
|
|
137
|
+
writtenFiles: string[];
|
|
138
|
+
errors: Array<{file: string; codemod: string; error: string}>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The console-like log surface used across the codemod runners. */
|
|
142
|
+
export interface CliLog {
|
|
143
|
+
step: (...args: unknown[]) => void;
|
|
144
|
+
info: (...args: unknown[]) => void;
|
|
145
|
+
success: (...args: unknown[]) => void;
|
|
146
|
+
warn: (...args: unknown[]) => void;
|
|
147
|
+
error: (...args: unknown[]) => void;
|
|
148
|
+
message?: (...args: unknown[]) => void;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The jscodeshift factory (the module's default export / `withParser` root).
|
|
153
|
+
* Callable and carries `withParser`; both return an untyped jscodeshift API.
|
|
154
|
+
*
|
|
155
|
+
* `any` is unavoidable here: jscodeshift ships no types and its AST/builder
|
|
156
|
+
* surface is fully dynamic (`j(src)`, `j.JSXElement`, `path.node`, …). `unknown`
|
|
157
|
+
* would break the callable + index access the transforms rely on.
|
|
158
|
+
*/
|
|
159
|
+
export interface JscodeshiftFactory {
|
|
160
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
161
|
+
(...args: any[]): any;
|
|
162
|
+
withParser: (parser: string) => any;
|
|
163
|
+
/** AST node types and builders (j.JSXElement, j.jsxAttribute, ...) are untyped. */
|
|
164
|
+
[key: string]: any;
|
|
165
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
166
|
+
}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* (not found) -> CLIError
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import type {ComponentDoc, PropDoc} from '
|
|
26
|
+
import type {ComponentDoc, PropDoc} from '../../core/src/docs-types';
|
|
27
27
|
|
|
28
28
|
/** xds --json component [--list] [--category X] [--detail brief] */
|
|
29
29
|
export interface ComponentListResponse {
|
|
@@ -11,10 +11,7 @@
|
|
|
11
11
|
* (unknown topic/section) -> CLIError
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import type {
|
|
15
|
-
ReferenceDoc,
|
|
16
|
-
ReferenceSection,
|
|
17
|
-
} from '../../../core/src/docs-types';
|
|
14
|
+
import type {ReferenceDoc, ReferenceSection} from '../../core/src/docs-types';
|
|
18
15
|
|
|
19
16
|
/** xds --json docs */
|
|
20
17
|
export interface DocsListResponse {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* (not found) -> CLIError
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import type {HookDoc, HookParamDoc} from '
|
|
23
|
+
import type {HookDoc, HookParamDoc} from '../../core/src/docs-types';
|
|
24
24
|
|
|
25
25
|
/** xds --json hook [--list] [--category X] [--detail brief] */
|
|
26
26
|
export interface HookListResponse {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Ambient declaration for `jscodeshift`, which ships no type declarations.
|
|
5
|
+
* The AST surface is intentionally untyped; codemod transforms operate on it
|
|
6
|
+
* dynamically. This keeps dynamic `import('jscodeshift')` from tripping TS7016
|
|
7
|
+
* under strict checkJs.
|
|
8
|
+
*/
|
|
9
|
+
declare module 'jscodeshift' {
|
|
10
|
+
interface JscodeshiftFactory {
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
|
+
(...args: any[]): any;
|
|
13
|
+
withParser: (parser: string) => any;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
16
|
+
}
|
|
17
|
+
const jscodeshift: JscodeshiftFactory;
|
|
18
|
+
export default jscodeshift;
|
|
19
|
+
}
|