@astryxdesign/cli 0.6.5 → 0.6.6-canary.0d27f83
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 +87 -0
- package/README.md +91 -88
- package/api/build/_adapter.d.mts +70 -2
- package/api/build/_adapter.mjs +122 -10
- package/api/build/build.doc.mjs +3 -3
- package/api/build/build.test.mjs +111 -2
- 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 +110 -22
- package/api/build/kit/rank.d.mts +32 -8
- package/api/build/kit/rank.mjs +291 -97
- package/api/build/kit/rank.test.mjs +231 -48
- package/api/build/kit/weights.d.mts +82 -0
- package/api/build/kit/weights.json +1 -0
- package/api/build/kit/weights.mjs +305 -0
- package/api/build/kit/weights.test.mjs +190 -0
- package/api/component/_adapter.d.mts +19 -0
- package/api/component/_adapter.mjs +33 -0
- package/api/component/component-replacement.test.mjs +603 -0
- 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 +25 -0
- package/api/docs/detail/detail.mjs +19 -3
- package/api/docs/detail/section/section.mjs +7 -1
- package/api/docs/docOverlays.test.mjs +10 -6
- package/api/docs/docs.d.mts +6 -0
- package/api/docs/docs.depth.test.mjs +134 -0
- package/api/docs/docs.doc.mjs +31 -2
- package/api/docs/docs.mjs +46 -1
- package/api/docs/docs.test.mjs +279 -0
- package/api/docs/docs.type.d.mts +81 -4
- package/api/docs/docs.type.mjs +41 -4
- package/api/docs/index/index.mjs +11 -2
- package/api/docs/index/index.test.mjs +7 -2
- package/api/docs/integration-tree.test.mjs +572 -0
- package/api/docs/integrationDocs.test.mjs +337 -0
- package/api/docs/node/node.d.mts +28 -3
- package/api/docs/node/node.mjs +149 -23
- package/api/doctor/_adapter.d.mts +50 -0
- package/api/doctor/_adapter.mjs +190 -0
- package/api/doctor/doctor.d.mts +0 -10
- package/api/doctor/doctor.doc.mjs +1 -3
- package/api/doctor/doctor.mjs +8 -123
- 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/error.d.mts +22 -0
- package/api/error.mjs +42 -0
- package/api/gap-report/gap-report.d.mts +3 -1
- package/api/gap-report/gap-report.mjs +27 -3
- package/api/gap-report/gap-report.test.mjs +106 -0
- 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.d.mts +1 -1
- 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-contribution.d.mts +2 -1
- package/api/integration/add-contribution.mjs +7 -3
- package/api/integration/add-contribution.test.mjs +3 -3
- package/api/integration/add-helpers.d.mts +26 -5
- package/api/integration/add-helpers.mjs +50 -5
- package/api/integration/add-theme.mjs +354 -28
- package/api/integration/add-theme.test.mjs +380 -16
- package/api/integration/authoring-checks.mjs +31 -8
- package/api/integration/authoring-checks.type.d.mts +8 -0
- package/api/integration/authoring-checks.type.mjs +7 -3
- package/api/integration/integration-authoring.type.d.mts +4 -1
- package/api/integration/integration-authoring.type.mjs +6 -1
- package/api/integration/integrationAdd.doc.mjs +6 -0
- package/api/integration/integrationAddTheme.doc.mjs +10 -0
- package/api/integration/integrationComponentConflicts.doc.mjs +6 -3
- package/api/integration/integrationDocConflicts.doc.mjs +1 -1
- package/api/integration/integrationTemplateConflicts.doc.mjs +1 -1
- 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 +495 -4
- package/api/integration/pack-check.test.mjs +619 -10
- package/api/integration/validate-integration.d.mts +4 -2
- package/api/integration/validate-integration.mjs +7 -2
- package/api/integration/validate-integration.test.mjs +55 -0
- package/api/integration/validate-integration.type.d.mts +5 -0
- package/api/integration/validate-integration.type.mjs +5 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- 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 +13 -7
- package/api/layout/expand/expand.receipt.test.mjs +74 -0
- package/api/layout/grammar/grammar.d.mts +1 -0
- package/api/layout/grammar/grammar.mjs +1 -0
- package/api/layout/layout.type.d.mts +1 -0
- package/api/layout/layout.type.mjs +1 -0
- package/api/layout/layoutCheck.doc.mjs +1 -1
- package/api/layout/layoutExpand.doc.mjs +2 -2
- package/api/layout/layoutGrammar.doc.mjs +1 -1
- package/api/search/search.d.mts +39 -8
- package/api/search/search.doc.mjs +4 -4
- package/api/search/search.mjs +248 -66
- package/api/search/search.test.mjs +829 -0
- package/api/search/search.type.d.mts +6 -6
- package/api/search/search.type.mjs +5 -5
- 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 +95 -13
- package/api/swizzle/list/list.mjs +2 -2
- package/api/swizzle/swizzle.doc.mjs +4 -0
- 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 +27 -8
- package/api/template/copy/copy.receipt.test.mjs +77 -0
- package/api/template/show/show.mjs +17 -4
- package/api/template/show/show.test.mjs +76 -0
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template-integration.test.mjs +14 -0
- package/api/template/template.d.mts +1 -1
- package/api/template/template.doc.mjs +6 -2
- package/api/template/template.mjs +2 -0
- package/api/template/template.type.d.mts +17 -0
- package/api/template/template.type.mjs +8 -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 +120 -2
- package/api/theme/build/build.family.test.mjs +13 -4
- package/api/theme/build/build.icon-lineage.test.mjs +117 -0
- package/api/theme/build/build.icon-preservation.test.mjs +639 -0
- package/api/theme/build/build.mjs +667 -195
- package/api/theme/build/build.project-core.test.mjs +165 -0
- package/api/theme/build/build.test.mjs +220 -1
- package/api/theme/build/font-warning.d.mts +11 -0
- package/api/theme/build/font-warning.mjs +28 -3
- package/api/theme/build/icon-imports.d.mts +47 -0
- package/api/theme/build/icon-imports.mjs +691 -0
- 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.d.mts +4 -1
- package/api/theme/themeBuild.doc.mjs +15 -4
- 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/run/run.mjs +20 -3
- package/api/upgrade/run/run.test.mjs +45 -1
- package/api/upgrade/upgrade.doc.mjs +1 -1
- package/api/upgrade/upgrade.type.d.mts +5 -0
- package/api/upgrade/upgrade.type.mjs +2 -0
- package/assets/codemods/integration-discovery.mjs +1 -1
- package/assets/codemods/integration-discovery.test.mjs +64 -0
- package/assets/codemods/transforms/next/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
- package/assets/codemods/transforms/next/index.mjs +14 -1
- package/assets/codemods/transforms/next/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 +59 -15
- package/assets/docs/icons.doc.mjs +1 -0
- package/assets/docs/principles.doc.dense.mjs +2 -2
- package/assets/docs/principles.doc.mjs +2 -2
- package/assets/docs/principles.doc.zh.mjs +2 -2
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/styling-overview.doc.mjs +211 -0
- package/assets/docs/styling.doc.mjs +2 -2
- package/assets/docs/theme.doc.dense.mjs +10 -198
- package/assets/docs/theme.doc.mjs +13 -770
- package/assets/docs/theme.doc.zh.mjs +31 -12
- package/assets/docs/tokens.doc.mjs +4 -4
- package/assets/docs/tree/add-a-theme.doc.mjs +6 -2
- package/assets/docs/tree/add-a-topic.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +2 -2
- package/assets/docs/tree/checks.doc.mjs +6 -5
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
- package/assets/docs/tree/define-the-theme.doc.mjs +2 -2
- package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
- package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
- package/assets/docs/tree/headers-and-footers.doc.mjs +68 -0
- package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
- package/assets/docs/tree/layout.doc.mjs +52 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
- package/assets/docs/tree/responsive.doc.mjs +102 -0
- package/assets/docs/tree/scaffold.doc.mjs +145 -0
- package/assets/docs/tree/sections-and-placement.doc.mjs +1 -1
- package/assets/docs/tree/side-panels.doc.mjs +82 -0
- package/assets/docs/tree/structure.doc.mjs +144 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +13 -1
- package/assets/docs/tree/themes.doc.mjs +2 -2
- package/assets/docs/tree/troubleshooting.doc.mjs +13 -5
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
- package/assets/docs/tree/versioning.doc.mjs +11 -7
- package/assets/docs/use-a-theme.doc.mjs +212 -0
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +38 -0
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.doc.mjs +20 -0
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.tsx +48 -0
- package/assets/templates/pages/ai-chat/template.doc.mjs +16 -1
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +9 -1
- package/assets/templates/pages/blank/template.doc.mjs +3 -1
- package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -1
- package/assets/templates/pages/centered-hero/template.doc.mjs +3 -1
- package/assets/templates/pages/checkout-wizard/template.doc.mjs +1 -0
- package/assets/templates/pages/classic-gallery/template.doc.mjs +3 -1
- package/assets/templates/pages/contact-form/template.doc.mjs +16 -1
- package/assets/templates/pages/dashboard/template.doc.mjs +15 -1
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +23 -1
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +10 -1
- package/assets/templates/pages/dashboard-comparison/template.doc.mjs +9 -1
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +10 -1
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +17 -1
- package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +2 -1
- package/assets/templates/pages/detail-page/template.doc.mjs +8 -0
- package/assets/templates/pages/documentation/template.doc.mjs +10 -1
- package/assets/templates/pages/documentation-design/template.doc.mjs +10 -1
- package/assets/templates/pages/documentation-technical/template.doc.mjs +10 -1
- package/assets/templates/pages/editor/template.doc.mjs +9 -1
- package/assets/templates/pages/file-explorer/template.doc.mjs +3 -1
- package/assets/templates/pages/form-two-column/template.doc.mjs +17 -1
- package/assets/templates/pages/form-wizard/template.doc.mjs +14 -1
- package/assets/templates/pages/form-wizard-dialog/template.doc.mjs +1 -0
- package/assets/templates/pages/gallery-hero/template.doc.mjs +10 -1
- package/assets/templates/pages/ide/template.doc.mjs +9 -1
- package/assets/templates/pages/incident-console/page.tsx +1 -1
- package/assets/templates/pages/incident-console/template.doc.mjs +10 -1
- package/assets/templates/pages/kanban-board/template.doc.mjs +11 -1
- package/assets/templates/pages/library/template.doc.mjs +15 -1
- package/assets/templates/pages/login/template.doc.mjs +10 -1
- package/assets/templates/pages/login-card/template.doc.mjs +11 -1
- package/assets/templates/pages/login-split/template.doc.mjs +10 -1
- package/assets/templates/pages/login-sso/template.doc.mjs +10 -1
- package/assets/templates/pages/messaging-shell/template.doc.mjs +11 -1
- package/assets/templates/pages/mixed-gallery/template.doc.mjs +10 -1
- package/assets/templates/pages/payment-form/template.doc.mjs +3 -1
- package/assets/templates/pages/product-detail/template.doc.mjs +9 -1
- package/assets/templates/pages/product-gallery/template.doc.mjs +10 -1
- package/assets/templates/pages/settings/template.doc.mjs +3 -1
- package/assets/templates/pages/settings-dialog/template.doc.mjs +9 -1
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +9 -1
- package/assets/templates/pages/shell-nav/template.doc.mjs +10 -1
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +14 -1
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +11 -1
- package/assets/templates/pages/side-gallery/template.doc.mjs +3 -1
- package/assets/templates/pages/table/template.doc.mjs +11 -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/templates/pages/table-filter/template.doc.mjs +21 -1
- package/assets/templates/pages/table-grouped/template.doc.mjs +15 -1
- package/assets/templates/pages/table-inbox/template.doc.mjs +18 -6
- package/assets/templates/pages/table-page/template.doc.mjs +20 -1
- package/assets/templates/pages/table-tree/template.doc.mjs +14 -1
- package/assets/templates/pages/theme-showcase/template.doc.mjs +10 -1
- package/assets/templates/pages/work-item-detail/template.doc.mjs +10 -0
- package/assets/templates/themes/butter/icons.tsx +2 -0
- package/assets/templates/themes/chocolate/icons.tsx +2 -0
- package/assets/templates/themes/gothic/icons.tsx +2 -0
- package/assets/templates/themes/matcha/icons.tsx +2 -0
- package/assets/templates/themes/neutral/icons.tsx +2 -0
- package/assets/templates/themes/stone/icons.tsx +2 -0
- package/assets/templates/themes/y2k/icons.tsx +2 -0
- 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/parse.d.mts +2 -0
- package/authoring/doctypes/template/parse.mjs +1 -0
- package/authoring/doctypes/template/parse.test.mjs +21 -0
- package/authoring/doctypes/template/template.doc.mjs +6 -0
- package/authoring/doctypes/template/type.ts +11 -0
- 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 +346 -47
- 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 +88 -12
- package/clients/cli/commands/component-replacement.text.test.mjs +271 -0
- package/clients/cli/commands/component.doc.mjs +9 -2
- package/clients/cli/commands/discover.mjs +29 -1
- package/clients/cli/commands/discover.no-source.test.mjs +75 -0
- package/clients/cli/commands/docs.depth.test.mjs +219 -0
- package/clients/cli/commands/docs.doc.mjs +15 -2
- package/clients/cli/commands/docs.mjs +273 -16
- package/clients/cli/commands/docs.test.mjs +383 -0
- 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.mjs +4 -4
- package/clients/cli/commands/doctor.test.mjs +26 -52
- package/clients/cli/commands/gap-report.doc.mjs +2 -2
- package/clients/cli/commands/gap-report.mjs +12 -0
- package/clients/cli/commands/gap-report.test.mjs +63 -0
- 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-add.doc.mjs +10 -0
- package/clients/cli/commands/integration-authoring.test.mjs +12 -2
- package/clients/cli/commands/integration-real-world.test.mjs +61 -12
- package/clients/cli/commands/integration.mjs +3 -1
- package/clients/cli/commands/layout-check.doc.mjs +2 -0
- package/clients/cli/commands/layout-expand.doc.mjs +5 -1
- 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.expand-receipt.test.mjs +94 -0
- package/clients/cli/commands/layout.mjs +56 -4
- package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
- package/clients/cli/commands/search.doc.mjs +5 -4
- package/clients/cli/commands/search.mjs +30 -6
- package/clients/cli/commands/search.test.mjs +69 -19
- 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.copy-receipt.test.mjs +60 -0
- package/clients/cli/commands/template.mjs +71 -6
- package/clients/cli/commands/template.show-media.test.mjs +62 -0
- 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 +44 -0
- 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.ascii-output.test.mjs +14 -0
- package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
- package/clients/cli/commands/upgrade.mjs +1 -1
- package/clients/cli/commands/write-failure.test.mjs +175 -0
- package/clients/cli/index.mjs +5 -2
- package/clients/cli/lib/component-format.mjs +19 -2
- package/clients/cli/lib/component-format.test.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +4 -0
- package/clients/cli/lib/manifest.mjs +44 -165
- package/clients/cli/lib/manifest.test.mjs +98 -7
- 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 +34 -28
- package/foundation/agent-docs/agent-docs.test.mjs +1181 -0
- 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/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-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-adapter.d.mts +14 -0
- package/foundation/discovery/template-adapter.fixture-refs.test.mjs +37 -1
- package/foundation/discovery/template-adapter.mjs +21 -1
- 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 +78 -5
- package/foundation/discovery/theme-discovery.mjs +143 -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/doc-loads.test.mjs +18 -8
- package/foundation/doc-compiler/inputs.mjs +2 -1
- package/foundation/doc-compiler/inputs.test.mjs +0 -1
- package/foundation/doc-compiler/lenses.d.mts +4 -2
- package/foundation/doc-compiler/lenses.mjs +1 -1
- package/foundation/doc-compiler/tree.test.mjs +649 -0
- package/foundation/env/package-manager.d.mts +28 -8
- package/foundation/env/package-manager.mjs +49 -10
- package/foundation/env/package-manager.test.mjs +93 -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 +79 -13
- package/foundation/integrations/cli-requirement.mjs +115 -22
- package/foundation/integrations/cli-requirement.test.mjs +205 -8
- package/foundation/integrations/contribution-inventory.mjs +3 -3
- 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.d.mts +5 -5
- package/foundation/response/response-types.doc.mjs +52 -37
- 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
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '../../lib/hook-format.mjs';
|
|
15
15
|
import {getCliInvocation} from '../../../../foundation/env/package-manager.mjs';
|
|
16
16
|
import {jsonOut} from '../../../../foundation/response/json.mjs';
|
|
17
|
-
import {emit, section, text, list, records, code} from '../../formatters/index.mjs';
|
|
17
|
+
import {emit, section, text, list, records, code, record} from '../../formatters/index.mjs';
|
|
18
18
|
import {cliError} from '../../lib/cli-error.mjs';
|
|
19
19
|
import {defineCommand} from '../../lib/define-command.mjs';
|
|
20
20
|
import {resultSet} from '../../../../foundation/debug/index.mjs';
|
|
@@ -103,6 +103,7 @@ export function registerHook(program) {
|
|
|
103
103
|
// ── Text output ────────────────────────────────────────────
|
|
104
104
|
switch (result.type) {
|
|
105
105
|
case 'hook.list': {
|
|
106
|
+
emit(record({package: result.package}));
|
|
106
107
|
// One list type across all three detail levels; the depth is carried
|
|
107
108
|
// in result.data.detail and the grouped map in result.data.components.
|
|
108
109
|
if (result.data.detail === 'full') {
|
|
@@ -172,6 +173,7 @@ export function registerHook(program) {
|
|
|
172
173
|
// under `component <name> --blocks`.
|
|
173
174
|
const related = result.data.relatedComponents ?? [];
|
|
174
175
|
emit(
|
|
176
|
+
record({package: result.package}),
|
|
175
177
|
code(doc),
|
|
176
178
|
related.length > 0 &&
|
|
177
179
|
text(
|
|
@@ -182,7 +184,10 @@ export function registerHook(program) {
|
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
case 'hook.detail.params': {
|
|
185
|
-
emit(
|
|
187
|
+
emit(
|
|
188
|
+
record({package: result.package}),
|
|
189
|
+
code(formatHookParams({params: result.data, name})),
|
|
190
|
+
);
|
|
186
191
|
break;
|
|
187
192
|
}
|
|
188
193
|
}
|
|
@@ -85,7 +85,7 @@ describe('import hint correctness', () => {
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
describe('CLI --detail
|
|
88
|
+
describe('CLI --detail compact shows correct import path', () => {
|
|
89
89
|
// Test a representative set across different patterns
|
|
90
90
|
const representative = [
|
|
91
91
|
{name: 'Button', expected: '@astryxdesign/core/Button'},
|
|
@@ -101,8 +101,8 @@ describe('import hint correctness', () => {
|
|
|
101
101
|
];
|
|
102
102
|
|
|
103
103
|
for (const {name, expected} of representative) {
|
|
104
|
-
it(`npx astryx component ${name} --detail
|
|
105
|
-
const result = await runCli(['component', name, '--detail', '
|
|
104
|
+
it(`npx astryx component ${name} --detail compact shows ${expected}`, async () => {
|
|
105
|
+
const result = await runCli(['component', name, '--detail', 'compact'], REPO_ROOT);
|
|
106
106
|
expect(result.code).toBe(0);
|
|
107
107
|
expect(result.stdout).toContain(expected);
|
|
108
108
|
});
|
|
@@ -179,11 +179,11 @@ describe('import hint correctness', () => {
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
it('component <Name> --detail
|
|
182
|
+
it('component <Name> --detail compact also shows the integration package', async () => {
|
|
183
183
|
const fixtureDir = createIntegrationFixture();
|
|
184
184
|
try {
|
|
185
185
|
const result = await runCli(
|
|
186
|
-
['component', 'Widget', '--detail', '
|
|
186
|
+
['component', 'Widget', '--detail', 'compact'],
|
|
187
187
|
fixtureDir,
|
|
188
188
|
);
|
|
189
189
|
expect(result.code).toBe(0);
|
|
@@ -248,4 +248,27 @@ describe('import hint correctness', () => {
|
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
});
|
|
251
|
+
|
|
252
|
+
describe('CLI --detail brief text output for a single component', () => {
|
|
253
|
+
it('brief text output names the component and its package', async () => {
|
|
254
|
+
const result = await runCli(['component', 'Button', '--detail', 'brief'], REPO_ROOT);
|
|
255
|
+
expect(result.code).toBe(0);
|
|
256
|
+
expect(result.stdout).toContain('Button');
|
|
257
|
+
expect(result.stdout).toContain('@astryxdesign/core');
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it('brief text is shorter than compact text', async () => {
|
|
261
|
+
const brief = await runCli(['component', 'Button', '--detail', 'brief'], REPO_ROOT);
|
|
262
|
+
const compact = await runCli(['component', 'Button', '--detail', 'compact'], REPO_ROOT);
|
|
263
|
+
expect(brief.code).toBe(0);
|
|
264
|
+
expect(compact.code).toBe(0);
|
|
265
|
+
expect(brief.stdout.length).toBeLessThan(compact.stdout.length);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it('brief text shows the import path in the signature line', async () => {
|
|
269
|
+
const result = await runCli(['component', 'Button', '--detail', 'brief'], REPO_ROOT);
|
|
270
|
+
expect(result.code).toBe(0);
|
|
271
|
+
expect(result.stdout).toContain('@astryxdesign/core/Button');
|
|
272
|
+
});
|
|
273
|
+
});
|
|
251
274
|
});
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file Regression
|
|
4
|
+
* @file Regression tests for `astryx init` app-theme next steps.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* import { neutralTheme } from '@astryxdesign/theme-neutral'
|
|
10
|
-
* <Theme theme={neutralTheme}>...</Theme>
|
|
11
|
-
*
|
|
12
|
-
* ...which contradicted the runtime console warning emitted by core's
|
|
13
|
-
* <Theme> component (packages/core/src/theme/Theme.tsx) recommending the
|
|
14
|
-
* pre-built path, and left users with an unstyled app because the base CSS
|
|
15
|
-
* imports were never mentioned (facebook/astryx#3080).
|
|
16
|
-
*
|
|
17
|
-
* These assertions lock in the corrected guidance: base CSS imports, the
|
|
18
|
-
* pre-built (`/built` + `theme.css`) theme path, and the custom-theme build
|
|
19
|
-
* command.
|
|
6
|
+
* The guidance follows the generated-module workflow: base CSS once, add an
|
|
7
|
+
* installed theme, import the generated record once, extend to customize, and
|
|
8
|
+
* eject only to make an independent source fork.
|
|
20
9
|
*/
|
|
21
10
|
|
|
22
11
|
import {describe, it, expect} from 'vitest';
|
|
@@ -30,17 +19,23 @@ describe('init Next steps theme guidance', () => {
|
|
|
30
19
|
expect(text).toContain("'@astryxdesign/core/astryx.css'");
|
|
31
20
|
});
|
|
32
21
|
|
|
33
|
-
it('
|
|
34
|
-
expect(text).toContain(
|
|
35
|
-
expect(text).toContain(
|
|
22
|
+
it('adds an installed theme through the CLI', () => {
|
|
23
|
+
expect(text).toContain('npm install @astryxdesign/theme-neutral');
|
|
24
|
+
expect(text).toContain('npx astryx theme add neutral --import');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('wires the generated theme record once', () => {
|
|
28
|
+
expect(text).toContain("{ themes, defaultThemeSlug } from './astryx-themes'");
|
|
29
|
+
expect(text).toContain('themes[defaultThemeSlug]');
|
|
36
30
|
});
|
|
37
31
|
|
|
38
|
-
it('
|
|
39
|
-
expect(text).toContain('
|
|
32
|
+
it('names extension for customization and eject only for a source fork', () => {
|
|
33
|
+
expect(text).toContain('Extend an imported theme');
|
|
34
|
+
expect(text).toContain('npx astryx theme eject <slug>');
|
|
35
|
+
expect(text).toContain('only to fork source');
|
|
40
36
|
});
|
|
41
37
|
|
|
42
|
-
it('does not
|
|
43
|
-
|
|
44
|
-
expect(text).not.toContain("from '@astryxdesign/theme-neutral'");
|
|
38
|
+
it('does not teach a direct package theme import', () => {
|
|
39
|
+
expect(text).not.toContain("from '@astryxdesign/theme-neutral");
|
|
45
40
|
});
|
|
46
41
|
});
|
|
@@ -56,6 +56,12 @@ export const doc = {
|
|
|
56
56
|
description:
|
|
57
57
|
"Namespace of this package to place the doc in, as a guide in its `guides` slot; writes the namespace doc when it is missing, and declares the CLI that reads it as an optional `@astryxdesign/cli` peer. Only valid for doc, and not with --replaces or --extends",
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
flag: '--from <theme>',
|
|
61
|
+
param: 'options.from',
|
|
62
|
+
description:
|
|
63
|
+
'Existing theme slug to fork as a starting point instead of a blank scaffold; the new theme copies the base and has no link back, and package.json `dependencies` gains the npm packages the copied files import (other than Core and React). Only valid for theme',
|
|
64
|
+
},
|
|
59
65
|
{
|
|
60
66
|
flag: '--to <version>',
|
|
61
67
|
param: 'options.to',
|
|
@@ -102,6 +108,10 @@ export const doc = {
|
|
|
102
108
|
cli: "astryx integration add agent-doc 'Run acme verify before finishing.'",
|
|
103
109
|
},
|
|
104
110
|
{label: 'Add a source theme', cli: 'astryx integration add theme ocean'},
|
|
111
|
+
{
|
|
112
|
+
label: 'Fork an existing theme',
|
|
113
|
+
cli: 'astryx integration add theme ocean --from neutral',
|
|
114
|
+
},
|
|
105
115
|
],
|
|
106
116
|
exitCodes: [
|
|
107
117
|
{code: 0, when: 'the contribution is written or the dry run succeeds'},
|
|
@@ -174,11 +174,21 @@ describe('integration authoring CLI', () => {
|
|
|
174
174
|
expect(text.stdout).toBe(verifyText.stdout);
|
|
175
175
|
expect(text.stderr).toContain('`integration pack --check` is deprecated');
|
|
176
176
|
expect(text.stderr).toContain('astryx integration verify');
|
|
177
|
-
// Without --check it fails, as it did, and
|
|
177
|
+
// Without --check it fails, as it did, and points only at the new name:
|
|
178
|
+
// suggesting `--check` would send people to the deprecated spelling.
|
|
178
179
|
const bare = await runCli(['integration', 'pack'], tmpDir);
|
|
179
180
|
expect(bare.status).not.toBe(0);
|
|
180
|
-
expect(bare.stderr).toContain(
|
|
181
|
+
expect(bare.stderr).toContain(
|
|
182
|
+
'`integration pack` is now `integration verify`',
|
|
183
|
+
);
|
|
181
184
|
expect(bare.stderr).toContain('astryx integration verify');
|
|
185
|
+
expect(bare.stderr).toContain('npm pack');
|
|
186
|
+
expect(bare.stderr).not.toContain('--check');
|
|
187
|
+
const bareJson = await runCli(['--json', 'integration', 'pack'], tmpDir);
|
|
188
|
+
expect(parseEnvelope(bareJson.stdout)).toMatchObject({
|
|
189
|
+
code: 'ERR_INVALID_ARGUMENT',
|
|
190
|
+
error: expect.stringContaining('astryx integration verify'),
|
|
191
|
+
});
|
|
182
192
|
// Help lists it, marked deprecated: nothing is hidden.
|
|
183
193
|
const help = await runCli(['integration', '--help'], tmpDir);
|
|
184
194
|
expect(help.stdout).toMatch(
|
|
@@ -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',
|
|
@@ -115,6 +115,7 @@ export function registerIntegration(program) {
|
|
|
115
115
|
extends: options.extends,
|
|
116
116
|
parent: options.parent,
|
|
117
117
|
to: options.to,
|
|
118
|
+
from: options.from,
|
|
118
119
|
});
|
|
119
120
|
} catch (error) {
|
|
120
121
|
const err =
|
|
@@ -168,8 +169,9 @@ export function registerIntegration(program) {
|
|
|
168
169
|
fn: integrationPackCheckFn,
|
|
169
170
|
action: async options => {
|
|
170
171
|
if (!options.check) {
|
|
172
|
+
// One way forward: the new name. `npm pack` is what builds a tarball.
|
|
171
173
|
return cliError(
|
|
172
|
-
'
|
|
174
|
+
'`integration pack` is now `integration verify`: run `astryx integration verify` to check the package the way npm will publish it. To build the tarball, run `npm pack`.',
|
|
173
175
|
{code: ERROR_CODES.ERR_INVALID_ARGUMENT},
|
|
174
176
|
);
|
|
175
177
|
}
|
|
@@ -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
|
};
|
|
@@ -18,7 +18,9 @@ export const doc = {
|
|
|
18
18
|
description:
|
|
19
19
|
'Parses and validates a compressed XLE/XLO expression, then expands it into ' +
|
|
20
20
|
'ready-to-use XDS TSX, routing children into slots, scaffolding typed useState for ' +
|
|
21
|
-
'interactive controls, and splicing referenced blocks. Writes to a path, or returns the code.'
|
|
21
|
+
'interactive controls, and splicing referenced blocks. Writes to a path, or returns the code. ' +
|
|
22
|
+
'Astryx demo media in a spliced block becomes a placeholder, and the output says how many ' +
|
|
23
|
+
'references were replaced (as a closing line comment when it prints the code).',
|
|
22
24
|
fn: 'layoutExpand',
|
|
23
25
|
args: [
|
|
24
26
|
{
|
|
@@ -79,5 +81,7 @@ export const doc = {
|
|
|
79
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',
|
|
80
82
|
},
|
|
81
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."}],
|
|
82
86
|
related: ['layout check', 'layout grammar'],
|
|
83
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
|
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx layout expand` tells the caller, in JSON and in text, when demo
|
|
5
|
+
* media in a spliced template block was replaced with placeholders. Printed
|
|
6
|
+
* code stays verbatim and valid TSX: the disclosure follows it as a comment.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {describe, it, expect, beforeEach, afterEach} from 'vitest';
|
|
10
|
+
import * as fs from 'node:fs';
|
|
11
|
+
import * as path from 'node:path';
|
|
12
|
+
import ts from 'typescript';
|
|
13
|
+
import {runCli} from '../../../test-utils/run-cli.mjs';
|
|
14
|
+
import {discoverTemplates} from '../../../api/template/template.mjs';
|
|
15
|
+
|
|
16
|
+
const SLOW = 60_000;
|
|
17
|
+
const DISCLOSURE = /demo media/i;
|
|
18
|
+
|
|
19
|
+
/** @param {string} name */
|
|
20
|
+
const hintKey = name => name.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
21
|
+
|
|
22
|
+
/** @param {string} source */
|
|
23
|
+
const tsxErrors = source =>
|
|
24
|
+
/** @type {any} */ (
|
|
25
|
+
ts.createSourceFile('out.tsx', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX)
|
|
26
|
+
).parseDiagnostics.map((/** @type {ts.Diagnostic} */ d) =>
|
|
27
|
+
ts.flattenDiagnosticMessageText(d.messageText, ' '),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
/** A `{hint}` for a template block whose source carries demo media. */
|
|
31
|
+
async function mediaBlockHint() {
|
|
32
|
+
const blocks = /** @type {Array<{dirName: string, type: string, filePath: string}>} */ (
|
|
33
|
+
await discoverTemplates()
|
|
34
|
+
).filter(t => t.type === 'block' && t.filePath && fs.existsSync(t.filePath));
|
|
35
|
+
const seen = new Map();
|
|
36
|
+
for (const t of blocks) seen.set(hintKey(t.dirName), (seen.get(hintKey(t.dirName)) ?? 0) + 1);
|
|
37
|
+
const found = blocks.find(
|
|
38
|
+
t =>
|
|
39
|
+
seen.get(hintKey(t.dirName)) === 1 &&
|
|
40
|
+
/\/template-assets\/[\w.-]+\.\w+/.test(fs.readFileSync(t.filePath, 'utf-8')),
|
|
41
|
+
);
|
|
42
|
+
if (!found) throw new Error('no template block carries demo media');
|
|
43
|
+
return hintKey(found.dirName);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
describe('layout expand discloses replaced demo media', () => {
|
|
47
|
+
let cwd;
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
// Inside the workspace so @astryxdesign/core resolves.
|
|
50
|
+
cwd = fs.mkdtempSync(path.join(process.cwd(), '.xle-media-receipt-'));
|
|
51
|
+
});
|
|
52
|
+
afterEach(() => fs.rmSync(cwd, {recursive: true, force: true}));
|
|
53
|
+
|
|
54
|
+
it('--json carries demoMediaReplaced; the text receipt states it for the written file', async () => {
|
|
55
|
+
const expr = `V > {${await mediaBlockHint()}}`;
|
|
56
|
+
const json = await runCli(['layout', 'expand', expr, './a', '--json'], cwd);
|
|
57
|
+
expect(json.status).toBe(0);
|
|
58
|
+
const {data} = JSON.parse(json.stdout);
|
|
59
|
+
expect(data.demoMediaReplaced).toBeGreaterThan(0);
|
|
60
|
+
|
|
61
|
+
const human = await runCli(['layout', 'expand', expr, './b'], cwd);
|
|
62
|
+
expect(human.status).toBe(0);
|
|
63
|
+
expect(human.stdout).toContain(
|
|
64
|
+
`Replaced ${data.demoMediaReplaced} Astryx demo media reference`,
|
|
65
|
+
);
|
|
66
|
+
expect(human.stdout).toContain(path.join('b', 'GeneratedLayout.tsx'));
|
|
67
|
+
}, SLOW);
|
|
68
|
+
|
|
69
|
+
it('prints the code verbatim, then states the count in a comment that keeps it valid TSX', async () => {
|
|
70
|
+
const expr = `V > {${await mediaBlockHint()}}`;
|
|
71
|
+
const {data} = JSON.parse((await runCli(['layout', 'expand', expr, '--json'], cwd)).stdout);
|
|
72
|
+
|
|
73
|
+
const human = await runCli(['layout', 'expand', expr], cwd);
|
|
74
|
+
expect(human.status).toBe(0);
|
|
75
|
+
expect(human.stdout.startsWith(data.code)).toBe(true);
|
|
76
|
+
expect(human.stdout.slice(data.code.length).trim()).toMatch(
|
|
77
|
+
new RegExp(`^// Replaced ${data.demoMediaReplaced} Astryx demo media references? in the code above: [^\\n]+$`),
|
|
78
|
+
);
|
|
79
|
+
expect(tsxErrors(human.stdout)).toEqual([]);
|
|
80
|
+
}, SLOW);
|
|
81
|
+
|
|
82
|
+
it('says nothing about demo media when none was replaced', async () => {
|
|
83
|
+
const json = await runCli(['layout', 'expand', 'V > B"Save"', '--json'], cwd);
|
|
84
|
+
const {data} = JSON.parse(json.stdout);
|
|
85
|
+
expect(data.demoMediaReplaced).toBe(0);
|
|
86
|
+
|
|
87
|
+
const written = await runCli(['layout', 'expand', 'V > B"Save"', './a'], cwd);
|
|
88
|
+
expect(written.status).toBe(0);
|
|
89
|
+
expect(written.stdout).not.toMatch(DISCLOSURE);
|
|
90
|
+
const printed = await runCli(['layout', 'expand', 'V > B"Save"'], cwd);
|
|
91
|
+
expect(printed.status).toBe(0);
|
|
92
|
+
expect(printed.stdout).toBe(`${data.code}\n`);
|
|
93
|
+
}, SLOW);
|
|
94
|
+
});
|