@astryxdesign/cli 0.6.6 → 0.6.7-canary.796bcc2
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/CHANGELOG.md +129 -0
- package/README.md +84 -82
- package/api/build/_adapter.d.mts +20 -0
- package/api/build/_adapter.mjs +24 -0
- package/api/build/build.doc.mjs +1 -1
- package/api/build/build.test.mjs +1 -1
- package/api/build/build.type.d.mts +12 -0
- package/api/build/build.type.mjs +3 -0
- package/api/build/help/help.mjs +1 -1
- package/api/build/kit/kit.mjs +13 -1
- package/api/component/_adapter.d.mts +19 -0
- package/api/component/_adapter.mjs +33 -0
- package/api/component/component-replacement.test.mjs +615 -0
- package/api/component/component.doc.mjs +5 -2
- package/api/component/component.mjs +49 -15
- package/api/component/component.test.mjs +32 -0
- package/api/component/component.type.d.mts +33 -3
- package/api/component/component.type.mjs +10 -3
- package/api/component/detail/blocks/blocks.d.mts +2 -1
- package/api/component/detail/blocks/blocks.mjs +5 -2
- package/api/component/detail/detail.mjs +5 -1
- package/api/component/detail/props/props.d.mts +2 -1
- package/api/component/detail/props/props.mjs +3 -2
- package/api/component/detail/showcase/showcase.d.mts +3 -1
- package/api/component/detail/showcase/showcase.mjs +3 -1
- package/api/component/detail/source/source.d.mts +3 -2
- package/api/component/detail/source/source.mjs +7 -3
- package/api/component/list/list.mjs +128 -10
- package/api/docs/_adapter.d.mts +11 -0
- package/api/docs/_adapter.mjs +73 -1
- package/api/docs/compiled-topics.test.mjs +1 -1
- package/api/docs/detail/detail.mjs +19 -3
- package/api/docs/detail/section/section.d.mts +44 -0
- package/api/docs/detail/section/section.mjs +171 -14
- package/api/docs/detail/section/section.test.mjs +4 -4
- package/api/docs/docOverlays.test.mjs +38 -23
- package/api/docs/docs.depth.test.mjs +2 -0
- package/api/docs/docs.doc.mjs +3 -3
- package/api/docs/docs.mjs +13 -16
- package/api/docs/docs.test.mjs +9 -10
- package/api/docs/docs.type.d.mts +43 -3
- package/api/docs/docs.type.mjs +23 -3
- package/api/docs/index/index.mjs +11 -2
- package/api/docs/index/index.test.mjs +7 -2
- package/api/docs/integration-tree.test.mjs +26 -26
- package/api/docs/integrationDocs.test.mjs +8 -7
- package/api/docs/namespace-section.test.mjs +260 -0
- package/api/docs/node/node.mjs +3 -0
- package/api/docs/token-tables.test.mjs +93 -0
- package/api/doctor/_adapter.d.mts +50 -0
- package/api/doctor/_adapter.mjs +190 -0
- package/api/doctor/doctor.d.mts +6 -10
- package/api/doctor/doctor.doc.mjs +1 -3
- package/api/doctor/doctor.mjs +144 -150
- package/api/doctor/doctor.test.mjs +104 -0
- package/api/doctor/theme-checks.d.mts +24 -0
- package/api/doctor/theme-checks.mjs +1231 -0
- package/api/doctor/theme-checks.test.mjs +667 -0
- package/api/gap-report/gap-report.doc.mjs +2 -1
- package/api/gap-report/gap-report.mjs +15 -1
- package/api/hook/_adapter.d.mts +1 -0
- package/api/hook/_adapter.mjs +3 -0
- package/api/hook/detail/detail.mjs +2 -2
- package/api/hook/detail/params/params.mjs +2 -2
- package/api/hook/hook.type.d.mts +12 -0
- package/api/hook/hook.type.mjs +3 -0
- package/api/hook/list/list.mjs +8 -8
- package/api/index.d.mts +1 -1
- package/api/index.mjs +4 -0
- package/api/init/run/run.d.mts +3 -5
- package/api/init/run/run.mjs +11 -11
- package/api/integration/__fixtures__/released-0.6.5-ocean.d.mts +14 -0
- package/api/integration/__fixtures__/released-0.6.5-ocean.mjs +15 -0
- package/api/integration/add-helpers.d.mts +26 -5
- package/api/integration/add-helpers.mjs +50 -5
- package/api/integration/add-theme.mjs +16 -2
- package/api/integration/add-theme.test.mjs +66 -15
- package/api/integration/authoring-checks.mjs +21 -1
- package/api/integration/integrationComponentConflicts.doc.mjs +6 -3
- package/api/integration/pack-check.component-replaces.test.mjs +126 -0
- package/api/integration/pack-check.d.mts +10 -0
- package/api/integration/pack-check.lifecycle-output.test.mjs +21 -2
- package/api/integration/pack-check.mjs +485 -3
- package/api/integration/pack-check.test.mjs +578 -10
- package/api/integration/validate-integration.mjs +20 -4
- package/api/integration/validate-integration.test.mjs +73 -0
- package/api/layout/check/check.d.mts +1 -0
- package/api/layout/check/check.mjs +1 -0
- package/api/layout/expand/expand.d.mts +1 -0
- package/api/layout/expand/expand.mjs +1 -0
- package/api/layout/grammar/grammar.d.mts +1 -0
- package/api/layout/grammar/grammar.mjs +1 -0
- package/api/layout/layoutCheck.doc.mjs +1 -1
- package/api/layout/layoutExpand.doc.mjs +1 -1
- package/api/layout/layoutGrammar.doc.mjs +1 -1
- package/api/search/search.d.mts +47 -3
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.domain-priority.test.mjs +261 -0
- package/api/search/search.mjs +247 -43
- package/api/search/search.test.mjs +5 -1
- package/api/search/search.type.d.mts +3 -3
- package/api/search/search.type.mjs +2 -2
- package/api/swizzle/_adapter.d.mts +10 -0
- package/api/swizzle/_adapter.mjs +23 -0
- package/api/swizzle/copy/copy.d.mts +5 -6
- package/api/swizzle/copy/copy.mjs +29 -10
- package/api/swizzle/list/list.mjs +2 -2
- package/api/swizzle/swizzle.doc.mjs +5 -2
- package/api/swizzle/swizzle.test.mjs +55 -5
- package/api/swizzle/swizzle.type.d.mts +8 -0
- package/api/swizzle/swizzle.type.mjs +2 -0
- package/api/template/copy/copy.mjs +14 -1
- package/api/template/show/show.mjs +2 -0
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.d.mts +1 -1
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.mjs +1 -0
- package/api/template/template.type.d.mts +15 -0
- package/api/template/template.type.mjs +6 -0
- package/api/theme/_adapter.d.mts +106 -6
- package/api/theme/_adapter.mjs +687 -18
- package/api/theme/add/add.binary.test.mjs +76 -3
- package/api/theme/add/add.d.mts +5 -9
- package/api/theme/add/add.mjs +87 -64
- package/api/theme/add/add.rollback.test.mjs +9 -9
- package/api/theme/add/add.staging.test.mjs +9 -9
- package/api/theme/add/add.test.mjs +461 -55
- package/api/theme/add/add.types.test.mjs +151 -0
- package/api/theme/build/build.d.mts +96 -2
- package/api/theme/build/build.family.test.mjs +13 -4
- package/api/theme/build/build.mjs +286 -118
- package/api/theme/build/build.test.mjs +30 -0
- package/api/theme/build/font-warning.d.mts +11 -0
- package/api/theme/build/font-warning.mjs +28 -3
- package/api/theme/eject/eject.binary.test.mjs +90 -0
- package/api/theme/eject/eject.d.mts +17 -0
- package/api/theme/eject/eject.mjs +65 -0
- package/api/theme/eject/eject.rollback.test.mjs +158 -0
- package/api/theme/eject/eject.staging.test.mjs +83 -0
- package/api/theme/eject/eject.test.mjs +160 -0
- package/api/theme/integration-themes.test.mjs +30 -6
- package/api/theme/list/list.d.mts +10 -0
- package/api/theme/list/list.mjs +75 -7
- package/api/theme/list/list.test.mjs +155 -4
- package/api/theme/remove/remove.d.mts +12 -0
- package/api/theme/remove/remove.mjs +15 -0
- package/api/theme/remove/remove.test.mjs +94 -0
- package/api/theme/template/template.mjs +3 -4
- package/api/theme/theme.d.mts +5 -2
- package/api/theme/theme.mjs +13 -8
- package/api/theme/theme.type.d.mts +106 -2
- package/api/theme/theme.type.mjs +54 -5
- package/api/theme/themeAdd.doc.d.mts +1 -3
- package/api/theme/themeAdd.doc.mjs +35 -22
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeEject.doc.d.mts +8 -0
- package/api/theme/themeEject.doc.mjs +89 -0
- package/api/theme/themeListAvailable.doc.mjs +4 -4
- package/api/theme/themeListCopySources.doc.d.mts +8 -0
- package/api/theme/themeListCopySources.doc.mjs +60 -0
- package/api/theme/themeRemove.doc.d.mts +6 -0
- package/api/theme/themeRemove.doc.mjs +50 -0
- package/api/theme/themeTemplate.doc.mjs +4 -3
- package/api/theme/themeUse.doc.d.mts +6 -0
- package/api/theme/themeUse.doc.mjs +47 -0
- package/api/theme/use/use.d.mts +12 -0
- package/api/theme/use/use.mjs +15 -0
- package/api/theme/use/use.test.mjs +98 -0
- package/api/upgrade/_adapter.d.mts +1 -0
- package/api/upgrade/_adapter.mjs +3 -0
- package/api/upgrade/list/list.mjs +9 -3
- package/api/upgrade/upgrade.type.d.mts +4 -0
- package/api/upgrade/upgrade.type.mjs +1 -0
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- package/assets/codemods/integration-discovery.mjs +1 -1
- package/assets/codemods/integration-discovery.test.mjs +64 -0
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/transforms/v0.6.7/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
- package/assets/codemods/transforms/v0.6.7/index.mjs +23 -0
- package/assets/codemods/transforms/v0.6.7/migrate-copied-themes-to-descriptors.mjs +54 -0
- package/assets/docs/author-a-theme.doc.mjs +166 -0
- package/assets/docs/getting-started.doc.mjs +61 -17
- package/assets/docs/principles.doc.dense.mjs +4 -4
- package/assets/docs/principles.doc.mjs +6 -6
- package/assets/docs/principles.doc.zh.mjs +4 -4
- package/assets/docs/styling-overview.doc.mjs +211 -0
- package/assets/docs/theme.doc.dense.mjs +10 -198
- package/assets/docs/theme.doc.mjs +13 -771
- package/assets/docs/theme.doc.zh.mjs +31 -12
- package/assets/docs/tree/add-a-theme.doc.mjs +2 -2
- package/assets/docs/tree/checks.doc.mjs +6 -5
- package/assets/docs/tree/component-migration.doc.mjs +107 -0
- package/assets/docs/tree/css-and-stylex.doc.mjs +150 -0
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
- package/assets/docs/tree/font-setup.doc.mjs +122 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
- package/assets/docs/tree/headers-and-footers.doc.mjs +67 -0
- package/assets/docs/tree/i18n-library-integration.doc.mjs +167 -0
- package/assets/docs/tree/i18n-quick-start.doc.mjs +101 -0
- package/assets/docs/{internationalization.doc.mjs → tree/i18n-rtl-and-testing.doc.mjs} +17 -223
- package/assets/docs/tree/internationalization.doc.mjs +29 -0
- package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
- package/assets/docs/tree/layout.doc.mjs +55 -0
- package/assets/docs/{migration.doc.mjs → tree/migration-setup.doc.mjs} +24 -129
- package/assets/docs/tree/migration-verification.doc.mjs +67 -0
- package/assets/docs/tree/migration.doc.mjs +28 -0
- package/assets/docs/tree/non-css-processing.doc.mjs +112 -0
- package/assets/docs/tree/other-libraries.doc.mjs +218 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
- package/assets/docs/tree/replace-a-core-template.doc.mjs +1 -1
- package/assets/docs/tree/responsive.doc.mjs +98 -0
- package/assets/docs/tree/scaffold.doc.mjs +140 -0
- package/assets/docs/tree/side-panels.doc.mjs +81 -0
- package/assets/docs/tree/structure.doc.mjs +140 -0
- package/assets/docs/tree/styling-advanced.doc.mjs +159 -0
- package/assets/docs/tree/styling-basics.doc.mjs +181 -0
- package/assets/docs/tree/styling-libraries.doc.mjs +30 -0
- package/assets/docs/tree/styling.doc.mjs +29 -0
- package/assets/docs/tree/tailwind.doc.mjs +65 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/themes.doc.mjs +2 -2
- package/assets/docs/tree/tokens-and-setup.doc.mjs +128 -0
- package/assets/docs/tree/tokens-border.doc.mjs +46 -0
- package/assets/docs/tree/tokens-color.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-color.doc.mjs +438 -0
- package/assets/docs/tree/tokens-color.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-data.doc.mjs +323 -0
- package/assets/docs/tree/tokens-duration.doc.mjs +78 -0
- package/assets/docs/tree/tokens-ease.doc.mjs +46 -0
- package/assets/docs/tree/tokens-focus.doc.mjs +57 -0
- package/assets/docs/tree/tokens-font-weight.doc.mjs +58 -0
- package/assets/docs/tree/tokens-radius.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-radius.doc.mjs +70 -0
- package/assets/docs/tree/tokens-radius.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-shadow.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-shadow.doc.mjs +74 -0
- package/assets/docs/tree/tokens-shadow.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-size.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-size.doc.mjs +54 -0
- package/assets/docs/tree/tokens-size.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-spacing.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-spacing.doc.mjs +102 -0
- package/assets/docs/tree/tokens-spacing.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-syntax.doc.mjs +98 -0
- package/assets/docs/tree/tokens-text-size.doc.mjs +90 -0
- package/assets/docs/tree/tokens-type-scale.doc.mjs +210 -0
- package/assets/docs/tree/tokens-typography.doc.mjs +54 -0
- package/assets/docs/tree/tokens-usage.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-usage.doc.mjs +36 -0
- package/assets/docs/tree/tokens-usage.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens.doc.mjs +28 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +7 -3
- package/assets/docs/tree/type-scale.doc.mjs +147 -0
- package/assets/docs/tree/typography-best-practices.doc.mjs +55 -0
- package/assets/docs/tree/typography.doc.mjs +29 -0
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
- package/assets/docs/tree/versioning.doc.mjs +6 -3
- package/assets/docs/use-a-theme.doc.mjs +212 -0
- package/assets/templates/pages/incident-console/page.tsx +1 -1
- package/assets/templates/pages/table-collapsible/page.tsx +1474 -0
- package/assets/templates/pages/table-collapsible/template.doc.mjs +12 -0
- package/assets/templates/pages/table-comparison/page.tsx +1449 -0
- package/assets/templates/pages/table-comparison/template.doc.mjs +12 -0
- package/assets/theme.template.ts +4 -3
- package/authoring/doctypes/command/command.doc.mjs +5 -0
- package/authoring/doctypes/command/type.ts +2 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/component/type.ts +8 -4
- package/authoring/doctypes/template/template.doc.mjs +2 -2
- package/authoring/doctypes/template/type.ts +5 -3
- package/authoring/integration/integration.doc.mjs +1 -1
- package/clients/cli/commands/blog.mjs +3 -3
- package/clients/cli/commands/build-theme.adaptations.test.mjs +1 -1
- package/clients/cli/commands/build-theme.ascii-output.test.mjs +11 -1
- package/clients/cli/commands/build-theme.batch-report.test.mjs +335 -0
- package/clients/cli/commands/build-theme.font-warning.test.mjs +36 -7
- package/clients/cli/commands/build-theme.import-path.test.mjs +3 -3
- package/clients/cli/commands/build-theme.mjs +338 -45
- package/clients/cli/commands/build-theme.watch.test.mjs +33 -0
- package/clients/cli/commands/build.mjs +8 -6
- package/clients/cli/commands/build.text-fields.test.mjs +1 -1
- package/clients/cli/commands/component/index.mjs +91 -12
- package/clients/cli/commands/component-replacement.text.test.mjs +316 -0
- package/clients/cli/commands/component.doc.mjs +9 -2
- package/clients/cli/commands/docs.doc.mjs +2 -1
- package/clients/cli/commands/docs.mjs +63 -23
- package/clients/cli/commands/docs.test.mjs +17 -15
- package/clients/cli/commands/doctor-integration-components.doc.mjs +15 -4
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.test.mjs +59 -52
- package/clients/cli/commands/gap-report.doc.mjs +2 -2
- package/clients/cli/commands/hook/index.mjs +7 -2
- package/clients/cli/commands/import-hint-correctness.test.mjs +28 -5
- package/clients/cli/commands/init.next-steps.test.mjs +18 -23
- package/clients/cli/commands/integration-real-world.test.mjs +61 -12
- package/clients/cli/commands/layout-check.doc.mjs +2 -0
- package/clients/cli/commands/layout-expand.doc.mjs +2 -0
- package/clients/cli/commands/layout-grammar.doc.mjs +2 -0
- package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +140 -0
- package/clients/cli/commands/layout.doc.mjs +2 -0
- package/clients/cli/commands/layout.mjs +40 -4
- package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
- package/clients/cli/commands/search.test.mjs +10 -4
- package/clients/cli/commands/swizzle.doc.mjs +12 -3
- package/clients/cli/commands/swizzle.mjs +2 -1
- package/clients/cli/commands/swizzle.routing.test.mjs +2 -1
- package/clients/cli/commands/template.mjs +56 -5
- package/clients/cli/commands/text-json-parity.test.mjs +40 -0
- package/clients/cli/commands/theme-add-lifecycle.test.mjs +135 -0
- package/clients/cli/commands/theme-add.doc.mjs +19 -19
- package/clients/cli/commands/theme-build.doc.mjs +3 -1
- package/clients/cli/commands/theme-eject.doc.mjs +47 -0
- package/clients/cli/commands/theme-list.behavior.test.mjs +5 -2
- package/clients/cli/commands/theme-list.doc.mjs +2 -2
- package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -2
- package/clients/cli/commands/theme-remove.doc.mjs +22 -0
- package/clients/cli/commands/theme-template.doc.mjs +4 -3
- package/clients/cli/commands/theme-use.doc.mjs +22 -0
- package/clients/cli/commands/theme.doc.mjs +21 -16
- package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
- package/clients/cli/commands/upgrade.mjs +1 -1
- package/clients/cli/index.mjs +5 -2
- package/clients/cli/lib/component-format.mjs +29 -2
- package/clients/cli/lib/component-format.test.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +4 -0
- package/clients/cli/lib/resolve-theme.mjs +80 -78
- package/clients/cli/lib/resolve-theme.test.mjs +523 -27
- package/foundation/agent-docs/agent-docs.mjs +48 -30
- package/foundation/agent-docs/agent-docs.test.mjs +47 -34
- package/foundation/agent-docs/app-theme-workflow.test.mjs +13 -0
- package/foundation/config/project.d.mts +20 -5
- package/foundation/config/project.mjs +43 -6
- package/foundation/config/project.test.mjs +1 -1
- package/foundation/config/theme-private-vars.d.mts +12 -0
- package/foundation/config/theme-private-vars.mjs +107 -0
- package/foundation/config/theme-private-vars.test.mjs +55 -0
- package/foundation/config/theme-state.d.mts +145 -0
- package/foundation/config/theme-state.mjs +417 -0
- package/foundation/config/theme-state.test.mjs +182 -0
- package/foundation/discovery/component-discovery.d.mts +5 -2
- package/foundation/discovery/component-discovery.mjs +12 -6
- package/foundation/discovery/component-replacement.d.mts +91 -0
- package/foundation/discovery/component-replacement.mjs +417 -0
- package/foundation/discovery/component-replacement.test.mjs +480 -0
- package/foundation/discovery/docs-discovery.test.mjs +1 -1
- package/foundation/discovery/docs-output-budget.d.mts +6 -2
- package/foundation/discovery/docs-output-budget.mjs +2 -1
- package/foundation/discovery/docs-section-key.d.mts +4 -2
- package/foundation/discovery/docs-section-key.mjs +1 -1
- package/foundation/discovery/module-exports.d.mts +10 -0
- package/foundation/discovery/module-exports.mjs +146 -0
- package/foundation/discovery/package-exports.d.mts +29 -0
- package/foundation/discovery/package-exports.mjs +200 -0
- package/foundation/discovery/template-needs.d.mts +31 -0
- package/foundation/discovery/template-needs.mjs +156 -0
- package/foundation/discovery/template-needs.test.mjs +203 -0
- package/foundation/discovery/theme-discovery.d.mts +72 -5
- package/foundation/discovery/theme-discovery.mjs +134 -18
- package/foundation/discovery/theme-discovery.test.mjs +9 -3
- package/foundation/discovery/theme-imports.d.mts +15 -0
- package/foundation/discovery/theme-imports.mjs +217 -0
- package/foundation/discovery/theme-imports.test.mjs +173 -0
- package/foundation/doc-compiler/bundle.mjs +52 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +15 -5
- package/foundation/doc-compiler/inputs.mjs +2 -1
- package/foundation/doc-compiler/lenses.d.mts +4 -2
- package/foundation/doc-compiler/lenses.mjs +1 -1
- package/foundation/doc-compiler/split-topic-keywords.test.mjs +73 -0
- package/foundation/doc-compiler/tree.d.mts +10 -0
- package/foundation/doc-compiler/tree.mjs +22 -0
- package/foundation/doc-compiler/tree.test.mjs +3 -2
- package/foundation/env/package-manager.d.mts +31 -8
- package/foundation/env/package-manager.mjs +120 -13
- package/foundation/env/package-manager.test.mjs +174 -1
- package/foundation/fs/module-loader.d.mts +9 -0
- package/foundation/fs/module-loader.mjs +71 -2
- package/foundation/integrations/cli-requirement.d.mts +43 -10
- package/foundation/integrations/cli-requirement.mjs +56 -13
- package/foundation/integrations/cli-requirement.test.mjs +160 -23
- package/foundation/integrations/contribution-inventory.mjs +3 -3
- package/foundation/integrations/validate-contributions.d.mts +16 -0
- package/foundation/integrations/validate-contributions.mjs +56 -8
- package/foundation/response/base.d.ts +9 -3
- package/foundation/response/json.d.mts +7 -4
- package/foundation/response/json.mjs +10 -6
- package/foundation/response/response-types.doc.mjs +41 -26
- package/foundation/response/response.doc.mjs +18 -4
- package/foundation/text/copyright-header.mjs +1 -1
- package/foundation/text/copyright-header.test.mjs +1 -1
- package/package.json +9 -9
- package/assets/docs/layout.doc.dense.mjs +0 -388
- package/assets/docs/layout.doc.mjs +0 -550
- package/assets/docs/styling-libraries.doc.mjs +0 -469
- package/assets/docs/styling.doc.mjs +0 -412
- package/assets/docs/tokens.doc.dense.mjs +0 -15
- package/assets/docs/tokens.doc.mjs +0 -1491
- package/assets/docs/tokens.doc.zh.mjs +0 -15
- package/assets/docs/typography.doc.mjs +0 -286
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file Real package-boundary coverage for integration authoring. Authors a
|
|
5
5
|
* provider through the CLI, packs it, installs the tarball into a separate
|
|
6
|
-
* no-config consumer, then exercises packed docs, codemods,
|
|
6
|
+
* no-config consumer, then exercises packed docs, codemods, built themes, and
|
|
7
|
+
* explicit source ejection.
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
import {afterEach, describe, expect, it} from 'vitest';
|
|
@@ -201,6 +202,15 @@ export const oceanTheme = defineTheme({
|
|
|
201
202
|
});
|
|
202
203
|
`,
|
|
203
204
|
);
|
|
205
|
+
const providerBuild = await runCli(
|
|
206
|
+
['theme', 'build', 'themes/ocean/oceanTheme.ts', '--json'],
|
|
207
|
+
providerDir,
|
|
208
|
+
);
|
|
209
|
+
expect(providerBuild.status, providerBuild.stderr).toBe(0);
|
|
210
|
+
expect(parseEnvelope(providerBuild.stdout)).toMatchObject({
|
|
211
|
+
type: 'theme.build',
|
|
212
|
+
data: {name: 'ocean'},
|
|
213
|
+
});
|
|
204
214
|
|
|
205
215
|
const providerPackage = JSON.parse(
|
|
206
216
|
fs.readFileSync(path.join(providerDir, 'package.json'), 'utf-8'),
|
|
@@ -313,8 +323,8 @@ export const oceanTheme = defineTheme({
|
|
|
313
323
|
expect(fs.lstatSync(alternateInstalledDir).isSymbolicLink()).toBe(false);
|
|
314
324
|
|
|
315
325
|
// The consumer installs both providers from tarballs. Link this checkout's
|
|
316
|
-
// Core package as the consumer's normal app dependency so
|
|
317
|
-
// can
|
|
326
|
+
// Core package as the consumer's normal app dependency so an ejected source
|
|
327
|
+
// can build against the same peer it would get from `npm install @astryxdesign/core`.
|
|
318
328
|
const coreScope = path.join(consumerDir, 'node_modules', '@astryxdesign');
|
|
319
329
|
const coreLink = path.join(coreScope, 'core');
|
|
320
330
|
fs.mkdirSync(coreScope, {recursive: true});
|
|
@@ -427,7 +437,7 @@ export const oceanTheme = defineTheme({
|
|
|
427
437
|
}
|
|
428
438
|
|
|
429
439
|
const ambiguous = await runCli(
|
|
430
|
-
['theme', 'add', 'ocean', '
|
|
440
|
+
['theme', 'add', 'ocean', '--json'],
|
|
431
441
|
consumerDir,
|
|
432
442
|
);
|
|
433
443
|
expect(ambiguous.status).not.toBe(0);
|
|
@@ -435,11 +445,50 @@ export const oceanTheme = defineTheme({
|
|
|
435
445
|
code: 'ERR_AMBIGUOUS_THEME',
|
|
436
446
|
});
|
|
437
447
|
|
|
448
|
+
const addedTheme = await runCli(
|
|
449
|
+
[
|
|
450
|
+
'theme',
|
|
451
|
+
'add',
|
|
452
|
+
'ocean',
|
|
453
|
+
'--import',
|
|
454
|
+
'--package',
|
|
455
|
+
'@acme/brand-integration',
|
|
456
|
+
'--json',
|
|
457
|
+
],
|
|
458
|
+
consumerDir,
|
|
459
|
+
);
|
|
460
|
+
expect(addedTheme.status, addedTheme.stderr).toBe(0);
|
|
461
|
+
expect(parseEnvelope(addedTheme.stdout)).toMatchObject({
|
|
462
|
+
type: 'theme.app',
|
|
463
|
+
data: {
|
|
464
|
+
default: 'ocean',
|
|
465
|
+
change: {action: 'add', slug: 'ocean', changed: true},
|
|
466
|
+
themes: [
|
|
467
|
+
{
|
|
468
|
+
slug: 'ocean',
|
|
469
|
+
owner: '@acme/brand-integration',
|
|
470
|
+
module: '@acme/brand-integration/themes/ocean',
|
|
471
|
+
stylesheet: '@acme/brand-integration/themes/ocean.css',
|
|
472
|
+
},
|
|
473
|
+
],
|
|
474
|
+
},
|
|
475
|
+
});
|
|
476
|
+
const generatedModule = fs.readFileSync(
|
|
477
|
+
path.join(consumerDir, 'src', 'astryx-themes.js'),
|
|
478
|
+
'utf-8',
|
|
479
|
+
);
|
|
480
|
+
expect(generatedModule).toContain(
|
|
481
|
+
'from "@acme/brand-integration/themes/ocean"',
|
|
482
|
+
);
|
|
483
|
+
expect(generatedModule).toContain(
|
|
484
|
+
'import "@acme/brand-integration/themes/ocean.css"',
|
|
485
|
+
);
|
|
486
|
+
|
|
438
487
|
const target = path.join('src', 'themes', 'acme-ocean');
|
|
439
488
|
const copied = await runCli(
|
|
440
489
|
[
|
|
441
490
|
'theme',
|
|
442
|
-
'
|
|
491
|
+
'eject',
|
|
443
492
|
'ocean',
|
|
444
493
|
target,
|
|
445
494
|
'--package',
|
|
@@ -450,17 +499,17 @@ export const oceanTheme = defineTheme({
|
|
|
450
499
|
);
|
|
451
500
|
expect(copied.status, copied.stderr).toBe(0);
|
|
452
501
|
expect(parseEnvelope(copied.stdout)).toMatchObject({
|
|
453
|
-
type: 'theme.
|
|
502
|
+
type: 'theme.eject',
|
|
454
503
|
data: {
|
|
455
504
|
slug: 'ocean',
|
|
456
505
|
package: '@acme/brand-integration',
|
|
457
506
|
outputDir: target,
|
|
458
|
-
files: [
|
|
507
|
+
files: expect.arrayContaining([
|
|
459
508
|
'oceanTheme.ts',
|
|
460
509
|
'oceanTheme.doc.mjs',
|
|
461
510
|
'tokens/ocean.palette.receipt.json',
|
|
462
511
|
'tokens/ocean.palette.ts',
|
|
463
|
-
],
|
|
512
|
+
]),
|
|
464
513
|
},
|
|
465
514
|
});
|
|
466
515
|
expect(
|
|
@@ -501,7 +550,7 @@ export const oceanTheme = defineTheme({
|
|
|
501
550
|
const duplicate = await runCli(
|
|
502
551
|
[
|
|
503
552
|
'theme',
|
|
504
|
-
'
|
|
553
|
+
'eject',
|
|
505
554
|
'ocean',
|
|
506
555
|
target,
|
|
507
556
|
'--package',
|
|
@@ -517,7 +566,7 @@ export const oceanTheme = defineTheme({
|
|
|
517
566
|
const overwritten = await runCli(
|
|
518
567
|
[
|
|
519
568
|
'theme',
|
|
520
|
-
'
|
|
569
|
+
'eject',
|
|
521
570
|
'ocean',
|
|
522
571
|
target,
|
|
523
572
|
'--package',
|
|
@@ -528,7 +577,7 @@ export const oceanTheme = defineTheme({
|
|
|
528
577
|
consumerDir,
|
|
529
578
|
);
|
|
530
579
|
expect(overwritten.status, overwritten.stderr).toBe(0);
|
|
531
|
-
expect(parseEnvelope(overwritten.stdout).type).toBe('theme.
|
|
580
|
+
expect(parseEnvelope(overwritten.stdout).type).toBe('theme.eject');
|
|
532
581
|
|
|
533
582
|
const installedCodemod = path.join(
|
|
534
583
|
installedDir,
|
|
@@ -594,7 +643,7 @@ export const oceanTheme = defineTheme({
|
|
|
594
643
|
const corruptedInstall = await runCli(
|
|
595
644
|
[
|
|
596
645
|
'theme',
|
|
597
|
-
'
|
|
646
|
+
'eject',
|
|
598
647
|
'ocean',
|
|
599
648
|
'src/themes/corrupted',
|
|
600
649
|
'--package',
|
|
@@ -61,5 +61,7 @@ export const doc = {
|
|
|
61
61
|
when: 'the expression is invalid, empty or over 5 MB (from stdin or --file), has a syntax error, or a bad --form',
|
|
62
62
|
},
|
|
63
63
|
],
|
|
64
|
+
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
|
|
65
|
+
notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
|
|
64
66
|
related: ['layout expand', 'layout grammar'],
|
|
65
67
|
};
|
|
@@ -81,5 +81,7 @@ export const doc = {
|
|
|
81
81
|
when: 'a missing, empty or over-5 MB expression (from stdin or --file), a bad --name or --form, a parse/validation error, or a path escape',
|
|
82
82
|
},
|
|
83
83
|
],
|
|
84
|
+
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
|
|
85
|
+
notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
|
|
84
86
|
related: ['layout check', 'layout grammar'],
|
|
85
87
|
};
|
|
@@ -26,5 +26,7 @@ export const doc = {
|
|
|
26
26
|
{code: 0, when: 'success'},
|
|
27
27
|
{code: 1, when: 'the component registry cannot be read'},
|
|
28
28
|
],
|
|
29
|
+
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
|
|
30
|
+
notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
|
|
29
31
|
related: ['layout expand', 'layout check'],
|
|
30
32
|
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Deprecation lifecycle coverage for the layout command group (DEP-0006).
|
|
5
|
+
*
|
|
6
|
+
* Mirrors the DEP-0005 theme-add-lifecycle tests: pins the JSON
|
|
7
|
+
* `meta.deprecations` entry, the human-mode stderr warning, the help label,
|
|
8
|
+
* and the docs reference pages.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {describe, it, expect} from 'vitest';
|
|
12
|
+
import {runCli} from '../../../test-utils/run-cli.mjs';
|
|
13
|
+
|
|
14
|
+
const SLOW = 30_000;
|
|
15
|
+
|
|
16
|
+
describe('layout DEP-0006 lifecycle', () => {
|
|
17
|
+
it('JSON mode carries meta.deprecations with DEP-0006 and its replacements', async () => {
|
|
18
|
+
const result = await runCli(['layout', 'grammar', '--json']);
|
|
19
|
+
expect(result.status).toBe(0);
|
|
20
|
+
const envelope = JSON.parse(result.stdout);
|
|
21
|
+
expect(envelope.meta).toBeDefined();
|
|
22
|
+
expect(envelope.meta.deprecations).toEqual([
|
|
23
|
+
{
|
|
24
|
+
id: 'DEP-0006',
|
|
25
|
+
replacements: ['build', 'template', 'docs layout'],
|
|
26
|
+
},
|
|
27
|
+
]);
|
|
28
|
+
// Canonical data is unchanged
|
|
29
|
+
expect(envelope.type).toBe('layout.grammar');
|
|
30
|
+
expect(envelope.data.text).toBeDefined();
|
|
31
|
+
expect(envelope.data.aliases).toBeDefined();
|
|
32
|
+
}, SLOW);
|
|
33
|
+
|
|
34
|
+
it('human mode emits one stderr deprecation warning', async () => {
|
|
35
|
+
const result = await runCli(['layout', 'grammar']);
|
|
36
|
+
expect(result.status).toBe(0);
|
|
37
|
+
expect(result.stderr).toContain('[DEP-0006]');
|
|
38
|
+
expect(result.stderr).toContain('astryx layout is deprecated');
|
|
39
|
+
expect(result.stderr).toContain('astryx build');
|
|
40
|
+
expect(result.stderr).toContain('astryx template');
|
|
41
|
+
expect(result.stderr).toContain('astryx docs layout');
|
|
42
|
+
}, SLOW);
|
|
43
|
+
|
|
44
|
+
it('JSON mode does NOT emit the stderr warning', async () => {
|
|
45
|
+
const result = await runCli(['layout', 'grammar', '--json']);
|
|
46
|
+
expect(result.stderr).not.toContain('[DEP-0006]');
|
|
47
|
+
}, SLOW);
|
|
48
|
+
|
|
49
|
+
it('layout --help labels the command as deprecated', async () => {
|
|
50
|
+
const result = await runCli(['layout', '--help']);
|
|
51
|
+
expect(result.stdout).toContain('DEPRECATED');
|
|
52
|
+
expect(result.stdout).toContain('DEP-0006');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('layout expand --json carries the same meta.deprecations', async () => {
|
|
56
|
+
const result = await runCli([
|
|
57
|
+
'layout', 'expand', 'V[g6] > C*2', '--json',
|
|
58
|
+
]);
|
|
59
|
+
expect(result.status).toBe(0);
|
|
60
|
+
const envelope = JSON.parse(result.stdout);
|
|
61
|
+
expect(envelope.meta.deprecations).toEqual([
|
|
62
|
+
{
|
|
63
|
+
id: 'DEP-0006',
|
|
64
|
+
replacements: ['build', 'template', 'docs layout'],
|
|
65
|
+
},
|
|
66
|
+
]);
|
|
67
|
+
expect(envelope.type).toBe('layout.expand');
|
|
68
|
+
}, SLOW);
|
|
69
|
+
|
|
70
|
+
it('layout check --json carries the same meta.deprecations', async () => {
|
|
71
|
+
const result = await runCli([
|
|
72
|
+
'layout', 'check', 'V[g6] > C*2', '--json',
|
|
73
|
+
]);
|
|
74
|
+
expect(result.status).toBe(0);
|
|
75
|
+
const envelope = JSON.parse(result.stdout);
|
|
76
|
+
expect(envelope.meta.deprecations).toEqual([
|
|
77
|
+
{
|
|
78
|
+
id: 'DEP-0006',
|
|
79
|
+
replacements: ['build', 'template', 'docs layout'],
|
|
80
|
+
},
|
|
81
|
+
]);
|
|
82
|
+
expect(envelope.type).toBe('layout.check');
|
|
83
|
+
}, SLOW);
|
|
84
|
+
|
|
85
|
+
// FR29d: every reference page names DEP-0006 and the replacements.
|
|
86
|
+
// Removing the label from any single page must fail this test.
|
|
87
|
+
describe('docs reference pages name DEP-0006', () => {
|
|
88
|
+
const COMMAND_PAGES = [
|
|
89
|
+
'cli/commands/layout',
|
|
90
|
+
'cli/commands/layout-expand',
|
|
91
|
+
'cli/commands/layout-check',
|
|
92
|
+
'cli/commands/layout-grammar',
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
const FUNCTION_PAGES = [
|
|
96
|
+
'cli/api/functions/layout-expand',
|
|
97
|
+
'cli/api/functions/layout-check',
|
|
98
|
+
'cli/api/functions/layout-grammar',
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
for (const page of COMMAND_PAGES) {
|
|
102
|
+
it(`${page} names DEP-0006 and replacements`, async () => {
|
|
103
|
+
const result = await runCli(['docs', page, '--json']);
|
|
104
|
+
expect(result.status, result.stderr).toBe(0);
|
|
105
|
+
const body = result.stdout;
|
|
106
|
+
expect(body).toContain('DEP-0006');
|
|
107
|
+
expect(body).toContain('build');
|
|
108
|
+
expect(body).toContain('template');
|
|
109
|
+
expect(body).toContain('docs layout');
|
|
110
|
+
}, SLOW);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
for (const page of FUNCTION_PAGES) {
|
|
114
|
+
it(`${page} names DEP-0006 and replacements`, async () => {
|
|
115
|
+
const result = await runCli(['docs', page, '--json']);
|
|
116
|
+
expect(result.status, result.stderr).toBe(0);
|
|
117
|
+
const body = result.stdout;
|
|
118
|
+
expect(body).toContain('DEP-0006');
|
|
119
|
+
expect(body).toContain('build');
|
|
120
|
+
expect(body).toContain('template');
|
|
121
|
+
expect(body).toContain('docs layout');
|
|
122
|
+
}, SLOW);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('response-types reference names DEP-0006 in each layout entry description', async () => {
|
|
127
|
+
const result = await runCli(['docs', 'cli/api/enums/response-types', '--json']);
|
|
128
|
+
expect(result.status, result.stderr).toBe(0);
|
|
129
|
+
const envelope = JSON.parse(result.stdout);
|
|
130
|
+
// The enum page has a table in its content; each row is [value, description].
|
|
131
|
+
const tables = envelope.data.content.filter(b => b.type === 'table');
|
|
132
|
+
const rows = tables.flatMap(t => t.rows || []);
|
|
133
|
+
for (const type of ['layout.expand', 'layout.check', 'layout.grammar']) {
|
|
134
|
+
const row = rows.find(r => r[0] && r[0].includes(type));
|
|
135
|
+
expect(row, `${type} not found in response-types table`).toBeDefined();
|
|
136
|
+
expect(row[1], `${type} description missing DEP-0006`).toContain('DEP-0006');
|
|
137
|
+
expect(row[1], `${type} description missing replacements`).toContain('replacement');
|
|
138
|
+
}
|
|
139
|
+
}, SLOW);
|
|
140
|
+
});
|
|
@@ -30,5 +30,7 @@ export const doc = {
|
|
|
30
30
|
{code: 0, when: 'a subcommand succeeded, or --help'},
|
|
31
31
|
{code: 1, when: 'no subcommand (help is printed) or an unknown subcommand'},
|
|
32
32
|
],
|
|
33
|
+
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
|
|
34
|
+
notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
|
|
33
35
|
related: ['template', 'build'],
|
|
34
36
|
};
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import * as fs from 'node:fs';
|
|
20
20
|
import * as path from 'node:path';
|
|
21
|
-
import {jsonOut} from '../../../foundation/response/json.mjs';
|
|
21
|
+
import {jsonOut, isJsonMode} from '../../../foundation/response/json.mjs';
|
|
22
22
|
import {emit, section, text, list, record, code, WARN} from '../formatters/index.mjs';
|
|
23
23
|
import {cliError} from '../lib/cli-error.mjs';
|
|
24
24
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
@@ -59,6 +59,39 @@ import {NO_RESULT_SET, resultSet} from '../../../foundation/debug/index.mjs';
|
|
|
59
59
|
* @property {boolean} [loose]
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* DEP-0006: the `astryx layout` command group is deprecated.
|
|
64
|
+
*
|
|
65
|
+
* Human mode: one stderr warning per invocation.
|
|
66
|
+
* JSON mode: `meta.deprecations` array in the response envelope.
|
|
67
|
+
*/
|
|
68
|
+
const LAYOUT_DEPRECATION = Object.freeze({
|
|
69
|
+
id: 'DEP-0006',
|
|
70
|
+
replacements: ['build', 'template', 'docs layout'],
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
function warnDeprecated() {
|
|
74
|
+
if (!isJsonMode()) {
|
|
75
|
+
console.error(
|
|
76
|
+
'[DEP-0006] astryx layout is deprecated and will be removed in a future minor release.\n' +
|
|
77
|
+
' Use instead:\n' +
|
|
78
|
+
' astryx build "<idea>" choose the template to start from\n' +
|
|
79
|
+
' astryx template <name> scaffold it\n' +
|
|
80
|
+
' astryx docs layout layout guidance\n',
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Add deprecation metadata to a JSON response before output.
|
|
87
|
+
* Canonical stdout (type, data) is unchanged; the metadata sits in `meta`.
|
|
88
|
+
* @param {{type: string, data: unknown}} result
|
|
89
|
+
* @returns {{type: string, data: unknown, meta: {deprecations: [typeof LAYOUT_DEPRECATION]}}}
|
|
90
|
+
*/
|
|
91
|
+
function withDeprecation(result) {
|
|
92
|
+
return {...result, meta: {deprecations: [LAYOUT_DEPRECATION]}};
|
|
93
|
+
}
|
|
94
|
+
|
|
62
95
|
/** The largest layout expression read from --file or stdin. */
|
|
63
96
|
const MAX_EXPRESSION_BYTES = 5 * 1024 * 1024; // 5 MB
|
|
64
97
|
|
|
@@ -143,6 +176,7 @@ export function registerLayout(program) {
|
|
|
143
176
|
defineCommand(layoutCmd, layoutExpandCommand, {
|
|
144
177
|
fn: layoutExpandFn,
|
|
145
178
|
action: async (/** @type {string} */ expression, /** @type {string} */ targetPath, /** @type {LayoutExpandOptions} */ options) => {
|
|
179
|
+
warnDeprecated();
|
|
146
180
|
const json = program.opts().json || false;
|
|
147
181
|
const source = await readExpression(expression, options);
|
|
148
182
|
if (!source || source.trim() === '') {
|
|
@@ -168,7 +202,7 @@ export function registerLayout(program) {
|
|
|
168
202
|
// Expanding turns an expression into TSX — a transformation, not a
|
|
169
203
|
// lookup. What it produced is in the output; there is no set to count.
|
|
170
204
|
if (json) {
|
|
171
|
-
jsonOut(result);
|
|
205
|
+
jsonOut(withDeprecation(result));
|
|
172
206
|
return NO_RESULT_SET;
|
|
173
207
|
}
|
|
174
208
|
|
|
@@ -205,6 +239,7 @@ export function registerLayout(program) {
|
|
|
205
239
|
defineCommand(layoutCmd, layoutCheckCommand, {
|
|
206
240
|
fn: layoutCheckFn,
|
|
207
241
|
action: async (/** @type {string} */ expression, /** @type {LayoutCheckOptions} */ options) => {
|
|
242
|
+
warnDeprecated();
|
|
208
243
|
const json = program.opts().json || false;
|
|
209
244
|
const source = await readExpression(expression, options);
|
|
210
245
|
if (!source || source.trim() === '') {
|
|
@@ -234,7 +269,7 @@ export function registerLayout(program) {
|
|
|
234
269
|
// A verdict on one expression: valid or not, with the errors that made
|
|
235
270
|
// it so. Nothing was looked up.
|
|
236
271
|
if (json) {
|
|
237
|
-
jsonOut(result);
|
|
272
|
+
jsonOut(withDeprecation(result));
|
|
238
273
|
return NO_RESULT_SET;
|
|
239
274
|
}
|
|
240
275
|
|
|
@@ -268,6 +303,7 @@ export function registerLayout(program) {
|
|
|
268
303
|
defineCommand(layoutCmd, layoutGrammarCommand, {
|
|
269
304
|
fn: layoutGrammarFn,
|
|
270
305
|
action: async () => {
|
|
306
|
+
warnDeprecated();
|
|
271
307
|
const json = program.opts().json || false;
|
|
272
308
|
/** @type {LayoutGrammarResponse} */
|
|
273
309
|
let result;
|
|
@@ -280,7 +316,7 @@ export function registerLayout(program) {
|
|
|
280
316
|
// One document, the same one every time: the grammar cheatsheet.
|
|
281
317
|
const answered = resultSet({count: 1, resultKind: 'doc'});
|
|
282
318
|
if (json) {
|
|
283
|
-
jsonOut(result);
|
|
319
|
+
jsonOut(withDeprecation(result));
|
|
284
320
|
return answered;
|
|
285
321
|
}
|
|
286
322
|
// The cheatsheet is a preformatted document — emit verbatim.
|
|
@@ -50,13 +50,13 @@ async function optionText(command, flag) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
describe('no help text describes a prompt', () => {
|
|
53
|
-
it('theme
|
|
54
|
-
const help = await optionText('theme
|
|
53
|
+
it('theme eject --overwrite states the refusal, and a refused run writes nothing', async () => {
|
|
54
|
+
const help = await optionText('theme eject', '--overwrite');
|
|
55
55
|
expect(help).not.toMatch(/prompt/i);
|
|
56
56
|
expect(help).toContain('ERR_FILE_EXISTS');
|
|
57
57
|
expect(help).toMatch(/nothing is written/);
|
|
58
58
|
|
|
59
|
-
const first = await runCli(['--json', 'theme', '
|
|
59
|
+
const first = await runCli(['--json', 'theme', 'eject', 'matcha'], tmpDir);
|
|
60
60
|
expect(first.status).toBe(0);
|
|
61
61
|
const {outputDir, files} = JSON.parse(first.stdout).data;
|
|
62
62
|
expect(files.length).toBeGreaterThan(1);
|
|
@@ -64,7 +64,7 @@ describe('no help text describes a prompt', () => {
|
|
|
64
64
|
fs.writeFileSync(path.join(dir, files[0]), '// edited\n');
|
|
65
65
|
fs.rmSync(path.join(dir, files[1]));
|
|
66
66
|
|
|
67
|
-
const refused = await runCli(['--json', 'theme', '
|
|
67
|
+
const refused = await runCli(['--json', 'theme', 'eject', 'matcha'], tmpDir);
|
|
68
68
|
expect(refused.status).toBe(1);
|
|
69
69
|
expect(JSON.parse(refused.stdout).code).toBe('ERR_FILE_EXISTS');
|
|
70
70
|
expect(fs.readFileSync(path.join(dir, files[0]), 'utf8')).toBe('// edited\n');
|
|
@@ -53,7 +53,11 @@ function asText(value) {
|
|
|
53
53
|
* @param {unknown} value
|
|
54
54
|
*/
|
|
55
55
|
function printsField(lines, key, value) {
|
|
56
|
-
|
|
56
|
+
// The text prefixes a command (`command`, `parent`) with the project's
|
|
57
|
+
// invocation (`pnpm exec astryx`, or `pnpm dlx @astryxdesign/cli` where no
|
|
58
|
+
// `astryx` bin is installed), so compare the part after `astryx`.
|
|
59
|
+
const text = asText(value).split('\n')[0].trimEnd();
|
|
60
|
+
const shown = text.replace(/^astryx /, '');
|
|
57
61
|
return lines.some(line => line.startsWith(`${key}:`) && line.trimEnd().endsWith(shown));
|
|
58
62
|
}
|
|
59
63
|
|
|
@@ -123,7 +127,7 @@ describe('search() API — filters', () => {
|
|
|
123
127
|
expect(data.results.map(r => r.name)).toContain('neutral');
|
|
124
128
|
for (const r of data.results) {
|
|
125
129
|
expect(r.domain).toBe('theme');
|
|
126
|
-
expect(r.command).toBe(`astryx theme add ${r.name}`);
|
|
130
|
+
expect(r.command).toBe(`astryx theme add --import ${r.name}`);
|
|
127
131
|
}
|
|
128
132
|
});
|
|
129
133
|
|
|
@@ -207,7 +211,9 @@ describe('search CLI — exit codes + JSON contract', () => {
|
|
|
207
211
|
expect(json.status).toBe(0);
|
|
208
212
|
const env = JSON.parse(json.stdout);
|
|
209
213
|
expect(env.data.query).toBe('dark mode');
|
|
210
|
-
|
|
214
|
+
// theme topic-level and section tie; either is correct
|
|
215
|
+
const top = env.data.results[0];
|
|
216
|
+
expect(top.name === 'theme' || top.name === 'use-a-theme' || top.section === 'light-dark-mode').toBe(true);
|
|
211
217
|
const text = await runCli(['search', 'dark', 'mode', '--type', 'doc'], REPO_ROOT);
|
|
212
218
|
expect(text.stdout).toContain('Results for "dark mode"');
|
|
213
219
|
}, SCAN_TIMEOUT);
|
|
@@ -280,7 +286,7 @@ describe('search CLI — exit codes + JSON contract', () => {
|
|
|
280
286
|
|
|
281
287
|
it('renders each result as a greppable key: value record', async () => {
|
|
282
288
|
const r = await runCli(['search', 'button'], REPO_ROOT);
|
|
283
|
-
expect(r.stdout).
|
|
289
|
+
expect(r.stdout).toMatch(/^command:\s+\S.*(?:astryx|@astryxdesign\/cli) component Button$/m);
|
|
284
290
|
// Fields mirror the JSON object and are line-greppable.
|
|
285
291
|
expect(r.stdout).toMatch(/^name:\s+Button$/m);
|
|
286
292
|
expect(r.stdout).toMatch(/^domain:\s+component$/m);
|
|
@@ -17,7 +17,10 @@ export const doc = {
|
|
|
17
17
|
description:
|
|
18
18
|
"Ejects a component's source from the resolved @astryxdesign/core (or its owning " +
|
|
19
19
|
'integration) into your project for deep customization, rewriting imports that ' +
|
|
20
|
-
'escape the component directory. With no name it lists the swizzlable components.'
|
|
20
|
+
'escape the component directory. With no name it lists the swizzlable components. ' +
|
|
21
|
+
'An integration component that replaces a Core component is what that Core name ' +
|
|
22
|
+
'copies; --package @astryxdesign/core copies the original. --list lists Core ' +
|
|
23
|
+
'components, including one an integration replaces.',
|
|
21
24
|
fn: 'swizzle',
|
|
22
25
|
args: [{name: 'component', param: 'component', required: false}],
|
|
23
26
|
options: [
|
|
@@ -30,12 +33,14 @@ export const doc = {
|
|
|
30
33
|
{
|
|
31
34
|
flag: '--package <pkg>',
|
|
32
35
|
param: 'options.package',
|
|
33
|
-
description:
|
|
36
|
+
description:
|
|
37
|
+
'Scope to a specific owning package. Use @astryxdesign/core to copy an original replaced by an integration component',
|
|
34
38
|
},
|
|
35
39
|
{
|
|
36
40
|
flag: '--list',
|
|
37
41
|
param: 'options.list',
|
|
38
|
-
description:
|
|
42
|
+
description:
|
|
43
|
+
'List the swizzlable Core components, including any that an integration component replaces',
|
|
39
44
|
},
|
|
40
45
|
{
|
|
41
46
|
flag: '-f, --overwrite',
|
|
@@ -47,6 +52,10 @@ export const doc = {
|
|
|
47
52
|
examples: [
|
|
48
53
|
{label: 'List swizzlable components', cli: 'astryx swizzle --list'},
|
|
49
54
|
{label: 'Eject a component', cli: 'astryx swizzle Button'},
|
|
55
|
+
{
|
|
56
|
+
label: 'Copy a replaced Core original',
|
|
57
|
+
cli: 'astryx swizzle SideNav --package @astryxdesign/core',
|
|
58
|
+
},
|
|
50
59
|
],
|
|
51
60
|
exitCodes: [
|
|
52
61
|
{code: 0, when: 'success'},
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {jsonOut} from '../../../foundation/response/json.mjs';
|
|
14
|
-
import {emit, section, list, text, WARN} from '../formatters/index.mjs';
|
|
14
|
+
import {emit, section, list, text, WARN, record} from '../formatters/index.mjs';
|
|
15
15
|
import {cliError} from '../lib/cli-error.mjs';
|
|
16
16
|
import {getCliInvocation} from '../../../foundation/env/package-manager.mjs';
|
|
17
17
|
import {swizzle as swizzleApi} from '../../../api/swizzle/swizzle.mjs';
|
|
@@ -60,6 +60,7 @@ export function registerSwizzle(program) {
|
|
|
60
60
|
if (result.type === 'swizzle.list') {
|
|
61
61
|
const components = result.data;
|
|
62
62
|
emit(
|
|
63
|
+
record({package: result.package}),
|
|
63
64
|
section('Available components'),
|
|
64
65
|
list(components),
|
|
65
66
|
text(`Usage: ${run} swizzle <component>`),
|
|
@@ -305,7 +305,8 @@ describe('swizzle — StyleX build setup note (#3373)', () => {
|
|
|
305
305
|
expect(humanResult.stdout).toMatch(/StyleX compiler/i);
|
|
306
306
|
expect(humanResult.stdout).toMatch(/unstyled/i);
|
|
307
307
|
expect(humanResult.stdout).toMatch(/next\/font/i);
|
|
308
|
-
|
|
308
|
+
// The fixture has no `astryx` bin installed, so the note names the scoped package.
|
|
309
|
+
expect(humanResult.stdout).toMatch(/@astryxdesign\/cli docs styling/);
|
|
309
310
|
});
|
|
310
311
|
|
|
311
312
|
it('does not print the StyleX note for components without StyleX', async () => {
|