@astryxdesign/cli 0.6.6 → 0.6.7
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 +483 -1
- package/api/integration/pack-check.test.mjs +568 -8
- 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 +5 -4
- 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/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/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 +4 -0
- 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 +4 -1
- 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/type.ts +1 -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 +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 +22 -0
- package/foundation/integrations/cli-requirement.mjs +31 -0
- package/foundation/integrations/cli-requirement.test.mjs +70 -0
- 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 +1 -1
- 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
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
text,
|
|
35
35
|
code,
|
|
36
36
|
wrapText,
|
|
37
|
+
record,
|
|
37
38
|
} from '../formatters/index.mjs';
|
|
38
39
|
import {cliError} from '../lib/cli-error.mjs';
|
|
39
40
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
@@ -247,17 +248,22 @@ function docsBelow(count) {
|
|
|
247
248
|
* it sits below the read's namespace.
|
|
248
249
|
* @param {import('../../../api/docs/docs.type.mjs').DocsNodeChild[]} children
|
|
249
250
|
* @param {string} root
|
|
251
|
+
* @param {string} owner the package that owns the read's namespace
|
|
250
252
|
* @returns {{name: string, summary: string}[]}
|
|
251
253
|
*/
|
|
252
|
-
function treeRows(children, root) {
|
|
254
|
+
function treeRows(children, root, owner) {
|
|
253
255
|
return children.flatMap(child => [
|
|
254
256
|
{
|
|
255
|
-
|
|
257
|
+
// A child another package owns says which one.
|
|
258
|
+
name:
|
|
259
|
+
child.package === owner
|
|
260
|
+
? belowRoot(child.route, root)
|
|
261
|
+
: `${belowRoot(child.route, root)} (${child.package})`,
|
|
256
262
|
summary: child.childCount
|
|
257
|
-
? `${childRow(child).summary} (${docsBelow(child.childCount)})`
|
|
258
|
-
: childRow(child).summary,
|
|
263
|
+
? `${childRow(child, owner).summary} (${docsBelow(child.childCount)})`
|
|
264
|
+
: childRow(child, owner).summary,
|
|
259
265
|
},
|
|
260
|
-
...(child.slots ?? []).flatMap(slot => treeRows(slot.children, root)),
|
|
266
|
+
...(child.slots ?? []).flatMap(slot => treeRows(slot.children, root, owner)),
|
|
261
267
|
]);
|
|
262
268
|
}
|
|
263
269
|
|
|
@@ -269,12 +275,16 @@ function treeRows(children, root) {
|
|
|
269
275
|
* @param {number} level
|
|
270
276
|
* @param {string} root
|
|
271
277
|
* @param {string} run
|
|
278
|
+
* @param {string} owner the package that owns the read's namespace
|
|
272
279
|
* @returns {string}
|
|
273
280
|
*/
|
|
274
|
-
function formatTreeChild(child, detail, level, root, run) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
281
|
+
function formatTreeChild(child, detail, level, root, run, owner) {
|
|
282
|
+
// A child another package owns says which one.
|
|
283
|
+
const place =
|
|
284
|
+
child.package === owner
|
|
285
|
+
? belowRoot(child.route, root)
|
|
286
|
+
: `${belowRoot(child.route, root)}, ${child.package}`;
|
|
287
|
+
const parts = [`${treeHeading(child.title, level)} (${place})`];
|
|
278
288
|
if (
|
|
279
289
|
child.summary &&
|
|
280
290
|
(child.kind === 'namespace' || child.kind === 'generic')
|
|
@@ -296,7 +306,7 @@ function formatTreeChild(child, detail, level, root, run) {
|
|
|
296
306
|
for (const slot of child.slots ?? []) {
|
|
297
307
|
parts.push(
|
|
298
308
|
...slot.children.map(each =>
|
|
299
|
-
formatTreeChild(each, detail, level + 1, root, run),
|
|
309
|
+
formatTreeChild(each, detail, level + 1, root, run, owner),
|
|
300
310
|
),
|
|
301
311
|
);
|
|
302
312
|
}
|
|
@@ -332,6 +342,7 @@ function emitTree(node, detail, childDetail, run) {
|
|
|
332
342
|
const root = allBelow ? node.route : '';
|
|
333
343
|
emit(
|
|
334
344
|
section(node.title, wrapText(node.summary)),
|
|
345
|
+
record({package: node.package}),
|
|
335
346
|
...(node.content?.length
|
|
336
347
|
? [
|
|
337
348
|
text(
|
|
@@ -354,13 +365,15 @@ function emitTree(node, detail, childDetail, run) {
|
|
|
354
365
|
? []
|
|
355
366
|
: [section(slot.title)]),
|
|
356
367
|
childDetail === 'brief'
|
|
357
|
-
? records(treeRows(slot.children, root), {
|
|
368
|
+
? records(treeRows(slot.children, root, node.package), {
|
|
358
369
|
fields: ['name', 'summary'],
|
|
359
370
|
layout: 'inline',
|
|
360
371
|
})
|
|
361
372
|
: code(
|
|
362
373
|
slot.children
|
|
363
|
-
.map(child =>
|
|
374
|
+
.map(child =>
|
|
375
|
+
formatTreeChild(child, childDetail, 2, root, run, node.package),
|
|
376
|
+
)
|
|
364
377
|
.join('\n\n'),
|
|
365
378
|
),
|
|
366
379
|
]),
|
|
@@ -401,20 +414,27 @@ function linkLines(links) {
|
|
|
401
414
|
* A topic's section index: what the topic is, one line per section with the
|
|
402
415
|
* key to read it by, and how to read further.
|
|
403
416
|
* @param {import('../../../api/docs/docs.type.mjs').DocsIndex} index
|
|
417
|
+
* @param {string} owner the package that owns the topic
|
|
404
418
|
* @param {string} run
|
|
405
419
|
*/
|
|
406
|
-
function emitIndex(index, run) {
|
|
420
|
+
function emitIndex(index, owner, run) {
|
|
407
421
|
emit(
|
|
408
422
|
section(
|
|
409
423
|
index.title,
|
|
410
424
|
index.description ? wrapText(index.description) : undefined,
|
|
411
425
|
),
|
|
426
|
+
record({package: owner}),
|
|
412
427
|
// Summaries wrap rather than being cut: the summary is how a reader picks
|
|
413
|
-
// the one section to open.
|
|
414
|
-
records(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
428
|
+
// the one section to open. A section another package wrote says which one.
|
|
429
|
+
records(
|
|
430
|
+
index.sections.map(s =>
|
|
431
|
+
s.package === owner ? s : {...s, title: `${s.title} (${s.package})`},
|
|
432
|
+
),
|
|
433
|
+
{
|
|
434
|
+
fields: ['id', 'title', 'summary'],
|
|
435
|
+
layout: 'inline',
|
|
436
|
+
},
|
|
437
|
+
),
|
|
418
438
|
text(
|
|
419
439
|
[
|
|
420
440
|
`Read one section: ${run} docs ${index.name} <section>`,
|
|
@@ -431,15 +451,17 @@ function emitIndex(index, run) {
|
|
|
431
451
|
* template`). Typed docs keep a distinct title when it carries the real symbol
|
|
432
452
|
* name (`assert-response assertResponse()`).
|
|
433
453
|
* @param {import('../../../api/docs/docs.type.mjs').DocsNodeChild} child
|
|
454
|
+
* @param {string} owner the package that owns the namespace
|
|
434
455
|
* @returns {{name: string, summary: string}}
|
|
435
456
|
*/
|
|
436
|
-
function childRow(child) {
|
|
457
|
+
function childRow(child, owner) {
|
|
437
458
|
const titleAddsIdentity =
|
|
438
459
|
child.kind !== 'namespace' &&
|
|
439
460
|
child.kind !== 'generic' &&
|
|
440
461
|
child.title !== child.name;
|
|
441
462
|
return {
|
|
442
|
-
|
|
463
|
+
// A child another package owns says which one.
|
|
464
|
+
name: child.package === owner ? child.name : `${child.name} (${child.package})`,
|
|
443
465
|
summary: titleAddsIdentity
|
|
444
466
|
? `${child.title}: ${child.summary}`
|
|
445
467
|
: child.summary,
|
|
@@ -458,6 +480,7 @@ function emitNode(node, detail, run) {
|
|
|
458
480
|
if (node.kind === 'namespace') {
|
|
459
481
|
emit(
|
|
460
482
|
section(node.title, wrapText(node.summary)),
|
|
483
|
+
record({package: node.package}),
|
|
461
484
|
// A namespace may author intro `blocks`; they render above its children.
|
|
462
485
|
...(node.content?.length
|
|
463
486
|
? [
|
|
@@ -474,7 +497,7 @@ function emitNode(node, detail, run) {
|
|
|
474
497
|
...(node.slots.length === 1 && slot.title === node.title
|
|
475
498
|
? []
|
|
476
499
|
: [section(slot.title)]),
|
|
477
|
-
records(slot.children.map(childRow), {
|
|
500
|
+
records(slot.children.map(child => childRow(child, node.package)), {
|
|
478
501
|
fields: ['name', 'summary'],
|
|
479
502
|
layout: 'inline',
|
|
480
503
|
}),
|
|
@@ -495,6 +518,7 @@ function emitNode(node, detail, run) {
|
|
|
495
518
|
return;
|
|
496
519
|
}
|
|
497
520
|
emit(
|
|
521
|
+
record({package: node.package}),
|
|
498
522
|
code(formatSection({title: node.title, content: node.content}, detail)),
|
|
499
523
|
text(linkLines(node.links).join('\n')),
|
|
500
524
|
);
|
|
@@ -655,13 +679,28 @@ export function registerDocs(program) {
|
|
|
655
679
|
}
|
|
656
680
|
|
|
657
681
|
case 'docs.index': {
|
|
658
|
-
emitIndex(result.data, run);
|
|
682
|
+
emitIndex(result.data, result.package, run);
|
|
659
683
|
break;
|
|
660
684
|
}
|
|
661
685
|
|
|
662
686
|
case 'docs.detail': {
|
|
687
|
+
const owner = result.package;
|
|
663
688
|
emit(
|
|
664
|
-
|
|
689
|
+
record({package: owner}),
|
|
690
|
+
code(
|
|
691
|
+
formatReferenceFull(
|
|
692
|
+
{
|
|
693
|
+
...result.data,
|
|
694
|
+
// A section another package wrote says which one.
|
|
695
|
+
sections: result.data.sections.map(s =>
|
|
696
|
+
s.package === owner
|
|
697
|
+
? s
|
|
698
|
+
: {...s, title: `${s.title} (${s.package})`},
|
|
699
|
+
),
|
|
700
|
+
},
|
|
701
|
+
detail,
|
|
702
|
+
),
|
|
703
|
+
),
|
|
665
704
|
text(linkLines(result.data.links).join('\n')),
|
|
666
705
|
);
|
|
667
706
|
break;
|
|
@@ -671,6 +710,7 @@ export function registerDocs(program) {
|
|
|
671
710
|
// One section ends with its moves: up to its topic's index, and to
|
|
672
711
|
// the sections before and after it.
|
|
673
712
|
emit(
|
|
713
|
+
record({package: result.package}),
|
|
674
714
|
code(formatSection(result.data, detail)),
|
|
675
715
|
text(linkLines(result.data.links).join('\n')),
|
|
676
716
|
);
|
|
@@ -98,8 +98,7 @@ describe('migration docs', () => {
|
|
|
98
98
|
|
|
99
99
|
const output = console.log.mock.calls.map(c => c[0]).join('\n');
|
|
100
100
|
expect(output).toContain('Migration Guide');
|
|
101
|
-
expect(output).toContain('
|
|
102
|
-
expect(output).toContain('Map shadcn and Radix Primitives');
|
|
101
|
+
expect(output).toContain('migration');
|
|
103
102
|
});
|
|
104
103
|
});
|
|
105
104
|
|
|
@@ -113,7 +112,8 @@ describe('progressive reads', () => {
|
|
|
113
112
|
expect(status).toBe(0);
|
|
114
113
|
expect(stdout).toMatch(/^principles +\S/m);
|
|
115
114
|
expect(widest(stdout)).toBeLessThanOrEqual(120);
|
|
116
|
-
|
|
115
|
+
// The repo root has no `astryx` bin, so the CLI names the scoped package.
|
|
116
|
+
expect(stdout).toMatch(/Usage: \S+(?: dlx)? (?:astryx|@astryxdesign\/cli) docs <topic>/);
|
|
117
117
|
}, SLOW);
|
|
118
118
|
|
|
119
119
|
it("prints a topic's section index with the keys to read by", async () => {
|
|
@@ -137,7 +137,7 @@ describe('progressive reads', () => {
|
|
|
137
137
|
const full = await runCli(['docs', 'theme', '--full']);
|
|
138
138
|
expect(full.status).toBe(0);
|
|
139
139
|
expect(full.stdout).toMatch(/^## Wrap your app in a theme/m);
|
|
140
|
-
expect(full.stdout.length).toBeGreaterThan(index.stdout.length
|
|
140
|
+
expect(full.stdout.length).toBeGreaterThan(index.stdout.length);
|
|
141
141
|
expect((await runCli(['--detail', 'full', 'docs', 'theme', '--full'])).stdout).toBe(
|
|
142
142
|
full.stdout,
|
|
143
143
|
);
|
|
@@ -198,8 +198,7 @@ describe('blocks as text', () => {
|
|
|
198
198
|
it('prints the labels of a real section above their fences', async () => {
|
|
199
199
|
const {status, stdout} = await runCli(['docs', 'theme', 'quick-start']);
|
|
200
200
|
expect(status).toBe(0);
|
|
201
|
-
expect(stdout).toContain('
|
|
202
|
-
expect(stdout).not.toContain('// Install a theme package');
|
|
201
|
+
expect(stdout).toContain('Wire the generated module once:\n```tsx\nimport {Theme}');
|
|
203
202
|
}, SLOW);
|
|
204
203
|
});
|
|
205
204
|
|
|
@@ -330,22 +329,25 @@ describe('the docs tree, one level at a time', () => {
|
|
|
330
329
|
expect(old.stderr).toContain('Unknown topic "cli-integrations"');
|
|
331
330
|
}, SLOW);
|
|
332
331
|
|
|
333
|
-
it('returns docs.node as JSON, and
|
|
332
|
+
it('returns docs.node as JSON, and reads a section of a namespace from its guide', async () => {
|
|
334
333
|
const node = JSON.parse((await runCli(['docs', 'cli', '--json'])).stdout);
|
|
335
334
|
expect(node).toMatchObject({
|
|
336
335
|
type: 'docs.node',
|
|
337
336
|
data: {route: 'cli', kind: 'namespace', breadcrumb: []},
|
|
338
337
|
});
|
|
339
338
|
expect(node.data.slots.map(slot => slot.name)).toEqual(['guides', 'reference']);
|
|
340
|
-
const section =
|
|
341
|
-
|
|
342
|
-
const error = JSON.parse(section.stdout);
|
|
343
|
-
expect(error).toMatchObject({code: 'ERR_UNKNOWN_SECTION'});
|
|
344
|
-
// It names the namespace's children, in the order its slots list them.
|
|
345
|
-
expect(error.suggestions.map(s => s.name)).toEqual(
|
|
346
|
-
node.data.slots.flatMap(slot => slot.children.map(child => child.route)),
|
|
339
|
+
const section = JSON.parse(
|
|
340
|
+
(await runCli(['docs', 'layout', 'side-panels', '--json'])).stdout,
|
|
347
341
|
);
|
|
348
|
-
expect(
|
|
342
|
+
expect(section).toMatchObject({
|
|
343
|
+
type: 'docs.detail.section',
|
|
344
|
+
data: {id: 'side-panels', title: 'Side panels'},
|
|
345
|
+
});
|
|
346
|
+
const missing = await runCli(['docs', 'cli', 'zzzz-nope', '--json']);
|
|
347
|
+
expect(missing.status).toBe(1);
|
|
348
|
+
const error = JSON.parse(missing.stdout);
|
|
349
|
+
expect(error).toMatchObject({code: 'ERR_UNKNOWN_SECTION'});
|
|
350
|
+
expect(error.suggestions.map(s => s.name)).toContain('cli/integrations/quick-start');
|
|
349
351
|
}, SLOW);
|
|
350
352
|
});
|
|
351
353
|
|
|
@@ -8,11 +8,16 @@ export const doc = {
|
|
|
8
8
|
name: 'doctor integration components',
|
|
9
9
|
displayName: 'astryx doctor integration components',
|
|
10
10
|
namespace: 'cli/commands',
|
|
11
|
-
summary: '
|
|
11
|
+
summary: 'Check integration component names and replacements against Core',
|
|
12
12
|
description:
|
|
13
13
|
'Compares one local or installed integration with Core component names. A ' +
|
|
14
14
|
'conflict is allowed and exits successfully, but the report recommends ' +
|
|
15
|
-
'renaming and gives the exact --package command for an intentional overlap.'
|
|
15
|
+
'renaming and gives the exact --package command for an intentional overlap. ' +
|
|
16
|
+
"It also checks each component's replaces: in a package that declares the CLI " +
|
|
17
|
+
'range that turns replacement on, a missing Core target, an invalid value, a ' +
|
|
18
|
+
'component named after a different Core component, or two replacements for one ' +
|
|
19
|
+
'Core component is an error. In a package without that range they are warnings, ' +
|
|
20
|
+
'with a warning for each such component, naming the range to declare.',
|
|
16
21
|
fn: 'integrationComponentConflicts',
|
|
17
22
|
args: [
|
|
18
23
|
{
|
|
@@ -31,8 +36,14 @@ export const doc = {
|
|
|
31
36
|
},
|
|
32
37
|
],
|
|
33
38
|
exitCodes: [
|
|
34
|
-
{
|
|
35
|
-
|
|
39
|
+
{
|
|
40
|
+
code: 0,
|
|
41
|
+
when: 'the check completed; component name conflicts, and replaces findings for a package without the CLI range, are warnings',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
code: 1,
|
|
45
|
+
when: 'the integration is invalid, Core cannot be resolved, or a package that declares the CLI range has an invalid replaces',
|
|
46
|
+
},
|
|
36
47
|
],
|
|
37
48
|
related: ['doctor integration templates', 'component'],
|
|
38
49
|
};
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
summary: 'Diagnose Astryx projects and integration packages',
|
|
17
17
|
description:
|
|
18
18
|
'Runs read-only project health diagnostics by default: Node version, @astryxdesign/core ' +
|
|
19
|
-
'install and version alignment, themes, config, integrations (linked without a config entry, ' +
|
|
19
|
+
'install and version alignment, theme packages, generated app themes when present, earlier copied-theme migration, config, integrations (linked without a config entry, ' +
|
|
20
20
|
'provider identity, contribution issues), agent docs, core peer dependencies, package manager, ' +
|
|
21
21
|
"and the docs the CLI reads. It writes nothing, but loading astryx.config runs that file's code. " +
|
|
22
22
|
'The `integration` subcommands provide authoring checks for one integration package.',
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
checkNodeVersion,
|
|
15
15
|
checkCoreInstalled,
|
|
16
16
|
checkVersionAlignment,
|
|
17
|
-
checkThemes,
|
|
18
17
|
checkConfig,
|
|
19
18
|
checkAgentDocs,
|
|
20
19
|
checkPeerDeps,
|
|
@@ -63,33 +62,6 @@ function installPkg(name, version = '1.0.0') {
|
|
|
63
62
|
return dir;
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
/**
|
|
67
|
-
* Mirror pnpm's layout: the real package lives under node_modules/.pnpm and
|
|
68
|
-
* the entry in the scope directory is a symlink to it.
|
|
69
|
-
*/
|
|
70
|
-
function installPkgPnpmStyle(name, version = '1.0.0') {
|
|
71
|
-
const realDir = path.join(
|
|
72
|
-
tmpDir,
|
|
73
|
-
'node_modules',
|
|
74
|
-
'.pnpm',
|
|
75
|
-
`${name.replace('/', '+')}@${version}`,
|
|
76
|
-
'node_modules',
|
|
77
|
-
...name.split('/'),
|
|
78
|
-
);
|
|
79
|
-
fs.mkdirSync(realDir, {recursive: true});
|
|
80
|
-
fs.writeFileSync(
|
|
81
|
-
path.join(realDir, 'package.json'),
|
|
82
|
-
JSON.stringify({name, version, main: 'index.js'}),
|
|
83
|
-
);
|
|
84
|
-
fs.writeFileSync(path.join(realDir, 'index.js'), 'module.exports = {};');
|
|
85
|
-
const linkPath = path.join(tmpDir, 'node_modules', ...name.split('/'));
|
|
86
|
-
fs.mkdirSync(path.dirname(linkPath), {recursive: true});
|
|
87
|
-
// 'junction' keeps this working on Windows without elevated permissions;
|
|
88
|
-
// it is ignored on posix.
|
|
89
|
-
fs.symlinkSync(realDir, linkPath, 'junction');
|
|
90
|
-
return linkPath;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
65
|
function find(checks, id) {
|
|
94
66
|
return checks.find(c => c.id === id);
|
|
95
67
|
}
|
|
@@ -128,29 +100,15 @@ describe('doctor — individual checks', () => {
|
|
|
128
100
|
expect(res.status).toBe('info');
|
|
129
101
|
});
|
|
130
102
|
|
|
131
|
-
it('themes:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
expect(res.message).toContain('@astryxdesign/theme-neutral');
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it('themes: PASS when theme installed and wired via config', () => {
|
|
144
|
-
installPkg('@astryxdesign/theme-neutral', '0.0.14');
|
|
145
|
-
const res = checkThemes({cwd: tmpDir, configTheme: 'default'});
|
|
146
|
-
expect(res.status).toBe('pass');
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it('themes: detects pnpm-style symlinked theme packages (#3530)', () => {
|
|
150
|
-
installPkgPnpmStyle('@astryxdesign/theme-neutral', '0.1.2');
|
|
151
|
-
const res = checkThemes({cwd: tmpDir, configTheme: 'default'});
|
|
152
|
-
expect(res.status).toBe('pass');
|
|
153
|
-
expect(res.message).toContain('@astryxdesign/theme-neutral');
|
|
103
|
+
it('app themes: reports unmanaged state as one INFO check', async () => {
|
|
104
|
+
fs.writeFileSync(path.join(tmpDir, 'package.json'), '{"name":"app"}\n');
|
|
105
|
+
const result = await runChecks({cwd: tmpDir});
|
|
106
|
+
const themeChecks = result.checks.filter(check =>
|
|
107
|
+
check.id.startsWith('theme-'),
|
|
108
|
+
);
|
|
109
|
+
expect(themeChecks).toEqual([
|
|
110
|
+
expect.objectContaining({id: 'theme-management', status: 'info'}),
|
|
111
|
+
]);
|
|
154
112
|
});
|
|
155
113
|
|
|
156
114
|
it('config: INFO when no astryx.config.mjs', async () => {
|
|
@@ -210,7 +168,23 @@ describe('doctor — individual checks', () => {
|
|
|
210
168
|
it('agent-docs: INFO when no docs present', () => {
|
|
211
169
|
const res = checkAgentDocs({cwd: tmpDir});
|
|
212
170
|
expect(res.status).toBe('info');
|
|
213
|
-
expect(res.fix).toContain('
|
|
171
|
+
expect(res.fix).toContain('init --features agents');
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// The npm package named `astryx` is not this CLI: a project without the
|
|
175
|
+
// `astryx` bin gets the scoped package in the fix, one with it keeps the bin.
|
|
176
|
+
it('agent-docs: the fix names the scoped package when the project has no local CLI', () => {
|
|
177
|
+
fs.writeFileSync(path.join(tmpDir, 'package-lock.json'), '{}');
|
|
178
|
+
const res = checkAgentDocs({cwd: tmpDir});
|
|
179
|
+
expect(res.fix).toContain('`npx @astryxdesign/cli init --features agents`');
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('agent-docs: the fix keeps `npx astryx` when the project has a local CLI', () => {
|
|
183
|
+
fs.writeFileSync(path.join(tmpDir, 'package-lock.json'), '{}');
|
|
184
|
+
fs.mkdirSync(path.join(tmpDir, 'node_modules', '.bin'), {recursive: true});
|
|
185
|
+
fs.writeFileSync(path.join(tmpDir, 'node_modules', '.bin', 'astryx'), '');
|
|
186
|
+
const res = checkAgentDocs({cwd: tmpDir});
|
|
187
|
+
expect(res.fix).toContain('`npx astryx init --features agents`');
|
|
214
188
|
});
|
|
215
189
|
|
|
216
190
|
it('agent-docs: WARN when docs exist without XDS markers', () => {
|
|
@@ -228,6 +202,39 @@ describe('doctor — individual checks', () => {
|
|
|
228
202
|
expect(res.status).toBe('pass');
|
|
229
203
|
});
|
|
230
204
|
|
|
205
|
+
it('agent-docs: PASS from a subfolder, reading the project root', () => {
|
|
206
|
+
fs.writeFileSync(path.join(tmpDir, 'package.json'), '{"name":"app"}');
|
|
207
|
+
fs.writeFileSync(
|
|
208
|
+
path.join(tmpDir, 'AGENTS.md'),
|
|
209
|
+
'<!-- ASTRYX:START -->\nstuff\n<!-- ASTRYX:END -->\n',
|
|
210
|
+
);
|
|
211
|
+
const src = path.join(tmpDir, 'src');
|
|
212
|
+
fs.mkdirSync(src);
|
|
213
|
+
const res = checkAgentDocs({cwd: src});
|
|
214
|
+
expect(res.status).toBe('pass');
|
|
215
|
+
expect(res.message).toBe(
|
|
216
|
+
`Astryx agent docs section present in ${path.join('..', 'AGENTS.md')}.`,
|
|
217
|
+
);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('agent-docs: reads every file init can write, Hermes included', () => {
|
|
221
|
+
fs.writeFileSync(
|
|
222
|
+
path.join(tmpDir, 'HERMES.md'),
|
|
223
|
+
'<!-- ASTRYX:START -->\nstuff\n<!-- ASTRYX:END -->\n',
|
|
224
|
+
);
|
|
225
|
+
expect(checkAgentDocs({cwd: tmpDir})).toMatchObject({
|
|
226
|
+
status: 'pass',
|
|
227
|
+
message: 'Astryx agent docs section present in HERMES.md.',
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it('agent-docs: INFO names what it looked for and where', () => {
|
|
232
|
+
const res = checkAgentDocs({cwd: tmpDir});
|
|
233
|
+
expect(res.status).toBe('info');
|
|
234
|
+
expect(res.message).toContain('AGENTS.md, CLAUDE.md');
|
|
235
|
+
expect(res.message).toContain('HERMES.md');
|
|
236
|
+
});
|
|
237
|
+
|
|
231
238
|
it('peer-deps: INFO when core not installed', () => {
|
|
232
239
|
const res = checkPeerDeps({cwd: tmpDir, coreDir: null});
|
|
233
240
|
expect(res.status).toBe('info');
|
|
@@ -13,7 +13,7 @@ export const doc = {
|
|
|
13
13
|
namespace: 'cli/commands',
|
|
14
14
|
summary: 'Report a missing component or feature to the package that owns it',
|
|
15
15
|
description:
|
|
16
|
-
'Reports a missing component, variant, layout, styling, accessibility, API, or documentation capability to the package that owns it: the --package you name, else the one package that provides the component, else Core. ' +
|
|
16
|
+
'Reports a missing component, variant, layout, styling, accessibility, API, or documentation capability to the package that owns it: the --package you name, else the integration whose component replaces it, else the one package that provides the component, else Core. ' +
|
|
17
17
|
'Every configured handler receives the report: the project config handler first, then each integration handler in config order. Public handlers run only with --confirm-public; internal handlers always run. A failing handler does not stop the others. ' +
|
|
18
18
|
"With no handler it files a GitHub issue for the owning package, only with --confirm-public (without it nothing is sent), or returns the package's issues URL when that is not on GitHub. " +
|
|
19
19
|
'The report records whether an agent or a person ran it.',
|
|
@@ -49,7 +49,7 @@ export const doc = {
|
|
|
49
49
|
flag: '--package <pkg>',
|
|
50
50
|
param: 'options.package',
|
|
51
51
|
description:
|
|
52
|
-
'Package that owns the gap: @astryxdesign/core or a loaded integration. Overrides automatic routing; needed when more than one package provides the component',
|
|
52
|
+
'Package that owns the gap: @astryxdesign/core or a loaded integration. Overrides automatic routing, which picks the integration whose component replaces the named Core component, else the one package that provides it, else Core; needed when more than one package provides the component',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
flag: '--confirm-public',
|
|
@@ -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
|
});
|