@astryxdesign/cli 0.6.4-canary.f0355e3 → 0.6.4
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/README.md +96 -99
- package/api/build/build.doc.mjs +1 -6
- package/api/build/build.test.mjs +0 -22
- package/api/build/kit/kit.mjs +5 -44
- package/api/component/_adapter.d.mts +0 -25
- package/api/component/_adapter.mjs +5 -59
- package/api/component/component.d.mts +3 -6
- package/api/component/component.doc.mjs +17 -37
- package/api/component/component.mjs +9 -249
- package/api/component/component.type.d.mts +0 -25
- package/api/component/component.type.mjs +0 -44
- package/api/discover/_adapter.d.mts +6 -114
- package/api/discover/_adapter.mjs +17 -372
- package/api/discover/detail/detail.d.mts +6 -18
- package/api/discover/detail/detail.mjs +13 -67
- package/api/discover/detail/detail.test.mjs +0 -85
- package/api/discover/discover.d.mts +9 -3
- package/api/discover/discover.doc.mjs +18 -61
- package/api/discover/discover.mjs +36 -220
- package/api/discover/discover.test.mjs +2 -11
- package/api/discover/discover.type.d.mts +8 -147
- package/api/discover/discover.type.mjs +12 -102
- package/api/discover/list/list.d.mts +6 -20
- package/api/discover/list/list.mjs +12 -45
- package/api/discover/list/list.test.mjs +0 -46
- package/api/discover/search/search.d.mts +16 -18
- package/api/discover/search/search.mjs +56 -102
- package/api/discover/search/search.test.mjs +10 -144
- package/api/docs/_adapter.d.mts +3 -8
- package/api/docs/_adapter.mjs +6 -14
- package/api/docs/docOverlays.test.mjs +1 -27
- package/api/docs/docs.doc.mjs +2 -2
- package/api/docs/docs.test.mjs +243 -0
- package/api/docs/integration-tree.test.mjs +555 -0
- package/api/docs/integrationDocs.test.mjs +314 -0
- package/api/doctor/doctor.d.mts +3 -8
- package/api/doctor/doctor.doc.mjs +8 -17
- package/api/doctor/doctor.mjs +9 -90
- package/api/doctor/doctor.test.mjs +10 -122
- package/api/doctor/doctor.type.d.mts +1 -1
- package/api/doctor/doctor.type.mjs +1 -1
- package/api/gap-report/gap-report.doc.mjs +10 -19
- package/api/hook/hook.doc.mjs +3 -6
- package/api/index.d.mts +2 -1
- package/api/index.mjs +5 -5
- package/api/init/init.doc.mjs +12 -17
- package/api/integration/add-helpers.d.mts +2 -5
- package/api/integration/add-helpers.mjs +9 -36
- package/api/integration/add-theme.mjs +1 -22
- package/api/integration/add-theme.test.mjs +0 -34
- package/api/integration/authoring-checks.mjs +2 -2
- package/api/integration/integrationPackCheck.doc.mjs +3 -3
- package/api/integration/pack-check.mjs +9 -82
- package/api/integration/pack-check.test.mjs +0 -90
- package/api/integration/pack-check.type.mjs +1 -1
- package/api/json/assertResponse.doc.mjs +1 -1
- package/api/json/index.ts +1 -0
- package/api/json/isError.doc.mjs +1 -1
- package/api/layout/_adapter.d.mts +34 -0
- package/api/layout/_adapter.mjs +148 -0
- package/api/layout/check/check.d.mts +16 -0
- package/api/layout/check/check.mjs +40 -0
- package/api/layout/expand/expand.d.mts +22 -0
- package/api/layout/expand/expand.mjs +155 -0
- package/api/layout/expand/expand.path-safety.test.mjs +53 -0
- package/api/layout/grammar/grammar.d.mts +13 -0
- package/api/layout/grammar/grammar.mjs +87 -0
- package/api/layout/layout.d.mts +6 -0
- package/api/layout/layout.mjs +17 -0
- package/api/layout/layout.test.mjs +297 -0
- package/api/layout/layout.type.d.mts +89 -0
- package/api/layout/layout.type.mjs +103 -0
- package/api/layout/layoutCheck.doc.d.mts +11 -0
- package/api/layout/layoutCheck.doc.mjs +85 -0
- package/api/layout/layoutExpand.doc.d.mts +11 -0
- package/api/layout/layoutExpand.doc.mjs +107 -0
- package/api/layout/layoutGrammar.doc.d.mts +11 -0
- package/api/layout/layoutGrammar.doc.mjs +57 -0
- package/api/search/search.d.mts +1 -27
- package/api/search/search.doc.mjs +2 -2
- package/api/search/search.mjs +16 -228
- package/api/search/search.test.mjs +512 -0
- package/api/swizzle/swizzle.doc.mjs +5 -7
- package/api/template/copy/copy.mjs +1 -1
- package/api/template/copy/copy.test.mjs +0 -9
- package/api/template/template-integration.test.mjs +65 -1
- package/api/template/template.doc.mjs +1 -2
- package/api/template/template.mjs +1 -1
- package/api/theme/add/add.mjs +25 -17
- package/api/theme/add/add.staging.test.mjs +23 -40
- package/api/theme/build/build.family.test.mjs +12 -7
- package/api/theme/build/build.mjs +18 -8
- package/api/theme/generateTonalPalette.doc.mjs +2 -1
- package/api/theme/listThemes.doc.mjs +1 -1
- package/api/theme/themeAdd.doc.mjs +10 -9
- package/api/theme/themeBuild.doc.mjs +13 -13
- package/api/theme/themeList.doc.mjs +1 -1
- package/api/theme/themeListAvailable.doc.mjs +1 -2
- package/api/theme/themePaletteGenerate.doc.mjs +8 -15
- package/api/theme/themeTargets.doc.mjs +2 -3
- package/api/theme/themeTemplate.doc.mjs +1 -2
- package/api/upgrade/run/run.mjs +4 -6
- package/api/upgrade/upgrade.doc.mjs +22 -24
- package/api/upgrade/upgrade.type.mjs +2 -2
- package/assets/codemods/__tests__/runner.test.mjs +1 -3
- package/assets/codemods/integration-runner.mjs +3 -3
- package/assets/codemods/runner.mjs +4 -5
- package/assets/docs/README.md +2 -4
- package/assets/docs/browser-support.doc.mjs +11 -11
- package/assets/docs/color.doc.mjs +2 -8
- package/assets/docs/elevation.doc.mjs +4 -6
- package/assets/docs/getting-started.doc.mjs +16 -5
- package/assets/docs/icons.doc.mjs +21 -2
- package/assets/docs/illustrations.doc.mjs +15 -7
- package/assets/docs/internationalization.doc.mjs +5 -7
- package/assets/docs/layout.doc.dense.mjs +82 -130
- package/assets/docs/layout.doc.mjs +77 -133
- package/assets/docs/migration.doc.mjs +21 -19
- package/assets/docs/motion.doc.mjs +3 -16
- package/assets/docs/principles.doc.dense.mjs +5 -5
- package/assets/docs/principles.doc.mjs +0 -8
- package/assets/docs/principles.doc.zh.mjs +6 -6
- package/assets/docs/shape.doc.mjs +3 -8
- package/assets/docs/spacing.doc.mjs +2 -7
- package/assets/docs/styling-libraries.doc.mjs +2 -6
- package/assets/docs/styling.doc.mjs +23 -19
- package/assets/docs/theme.doc.dense.mjs +18 -58
- package/assets/docs/theme.doc.mjs +46 -56
- package/assets/docs/theme.doc.zh.mjs +8 -9
- package/assets/docs/tokens.doc.dense.mjs +2 -2
- package/assets/docs/tokens.doc.mjs +8 -389
- package/assets/docs/tokens.doc.zh.mjs +2 -2
- package/assets/docs/tree/integrations.doc.mjs +451 -25
- package/assets/docs/tree/integrations.test.mjs +62 -0
- package/assets/docs/tree/writing-docs.doc.mjs +286 -0
- package/assets/docs/typography.doc.mjs +4 -24
- package/assets/docs/working-with-ai.doc.mjs +22 -30
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
- package/authoring/config/config.doc.mjs +2 -10
- package/authoring/config/parse.d.mts +0 -2
- package/authoring/config/parse.mjs +0 -19
- package/authoring/config/parse.test.mjs +0 -8
- package/authoring/config/type.ts +2 -13
- package/authoring/doctypes/_schema.d.mts +2 -3
- package/authoring/doctypes/_schema.mjs +0 -6
- package/authoring/doctypes/base/graph-fields.doc.mjs +3 -3
- package/authoring/doctypes/base/type.ts +2 -4
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/command/type.ts +1 -1
- package/authoring/doctypes/component/component.doc.mjs +0 -6
- package/authoring/doctypes/component/type.ts +0 -8
- package/authoring/doctypes/reference/reference.doc.mjs +0 -7
- package/authoring/doctypes/reference/type.ts +0 -5
- package/authoring/doctypes/schema/schema.doc.mjs +2 -2
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +2 -2
- package/authoring/index.d.mts +0 -1
- package/authoring/index.d.ts +0 -10
- package/authoring/index.mjs +0 -1
- package/authoring/integration/integration.doc.mjs +10 -12
- package/clients/cli/command-result-coverage.test.mjs +7 -7
- package/clients/cli/commands/component/index.mjs +55 -152
- package/clients/cli/commands/component-ownership.test.mjs +0 -89
- package/clients/cli/commands/component.doc.mjs +9 -27
- package/clients/cli/commands/debug-result-summary.test.mjs +2 -2
- package/clients/cli/commands/discover.doc.mjs +9 -53
- package/clients/cli/commands/discover.mjs +118 -393
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +17 -60
- package/clients/cli/commands/docs.test.mjs +294 -0
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +2 -3
- package/clients/cli/commands/doctor-integration.test.mjs +0 -53
- package/clients/cli/commands/doctor.doc.mjs +1 -3
- package/clients/cli/commands/doctor.mjs +5 -49
- package/clients/cli/commands/gap-report.doc.mjs +9 -10
- package/clients/cli/commands/init.doc.mjs +6 -9
- package/clients/cli/commands/integration-add.doc.mjs +9 -9
- package/clients/cli/commands/integration-authoring.test.mjs +10 -61
- package/clients/cli/commands/integration-pack.doc.mjs +9 -5
- package/clients/cli/commands/integration-real-world.test.mjs +1 -1
- package/clients/cli/commands/integration.doc.mjs +4 -4
- package/clients/cli/commands/integration.mjs +43 -74
- package/clients/cli/commands/layout-check.doc.mjs +65 -0
- package/clients/cli/commands/layout-expand.doc.mjs +83 -0
- package/clients/cli/commands/layout-grammar.doc.mjs +30 -0
- package/clients/cli/commands/layout.doc.mjs +34 -0
- package/clients/cli/commands/layout.error-codes.test.mjs +66 -0
- package/clients/cli/commands/layout.exit-parity.test.mjs +41 -0
- package/clients/cli/commands/layout.mjs +275 -0
- package/clients/cli/commands/layout.path-help.test.mjs +33 -0
- package/clients/cli/commands/layout.stdin-cap.test.mjs +47 -0
- package/clients/cli/commands/layout.text-fields.test.mjs +39 -0
- package/clients/cli/commands/manifest.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +3 -10
- package/clients/cli/commands/search.mjs +2 -21
- package/clients/cli/commands/search.test.mjs +4 -21
- package/clients/cli/commands/swizzle.doc.mjs +1 -1
- package/clients/cli/commands/template.doc.mjs +1 -1
- package/clients/cli/commands/text-json-parity.test.mjs +16 -5
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +2 -3
- package/clients/cli/commands/theme-palette.doc.mjs +2 -1
- package/clients/cli/commands/theme-targets.doc.mjs +2 -2
- package/clients/cli/commands/theme.doc.mjs +1 -2
- package/clients/cli/commands/upgrade.doc.mjs +3 -62
- package/clients/cli/index.mjs +10 -28
- package/clients/cli/lib/define-command.mjs +4 -28
- package/clients/cli/lib/define-command.test.mjs +0 -54
- package/clients/cli/lib/exit-codes.test.mjs +9 -18
- package/clients/cli/lib/json-shim.mjs +14 -24
- package/clients/cli/lib/json-shim.test.mjs +20 -6
- package/clients/cli/lib/manifest.mjs +13 -18
- package/clients/cli/lib/manifest.test.mjs +2 -5
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/agent-docs/agent-docs.test.mjs +1159 -0
- package/foundation/discovery/authoring-self-docs.mjs +0 -1
- package/foundation/discovery/authoring-self-docs.test.mjs +2 -6
- package/foundation/discovery/cli-self-docs.mjs +2 -16
- package/foundation/discovery/cli-self-docs.test.mjs +0 -20
- package/foundation/discovery/docs-discovery.mjs +1 -5
- package/foundation/discovery/docs-discovery.test.mjs +0 -21
- package/foundation/discovery/docs-section-key.d.mts +1 -1
- package/foundation/discovery/docs-section-key.mjs +1 -1
- package/foundation/discovery/template-adapter.mjs +1 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +14 -3
- package/foundation/doc-compiler/tree.d.mts +0 -4
- package/foundation/doc-compiler/tree.mjs +1 -6
- package/foundation/doc-compiler/tree.test.mjs +598 -0
- package/foundation/integrations/cli-requirement.d.mts +6 -26
- package/foundation/integrations/cli-requirement.mjs +11 -46
- package/foundation/integrations/cli-requirement.test.mjs +2 -7
- package/foundation/integrations/contribution-inventory.mjs +1 -1
- package/foundation/integrations/integrations.d.mts +1 -14
- package/foundation/integrations/integrations.mjs +1 -41
- package/foundation/integrations/integrations.test.mjs +0 -31
- package/foundation/response/error-codes.doc.mjs +8 -6
- package/foundation/response/error-codes.test.mjs +5 -30
- package/foundation/response/response-types.doc.d.mts +3 -4
- package/foundation/response/response-types.doc.mjs +27 -40
- package/foundation/response/response-types.doc.test.mjs +0 -23
- package/foundation/response/response.doc.mjs +10 -11
- package/foundation/xle/browser.d.mts +3 -3
- package/foundation/xle/browser.mjs +3 -3
- package/foundation/xle/expand.mjs +2 -2
- package/foundation/xle/parse.mjs +1 -1
- package/foundation/xle/print.mjs +2 -2
- package/foundation/xle/splice.mjs +1 -1
- package/package.json +9 -9
- package/api/discover/_adapter.test.mjs +0 -215
- package/api/discover/_catalog-view.d.mts +0 -115
- package/api/discover/_catalog-view.mjs +0 -203
- package/api/discover/_catalog-view.test.mjs +0 -128
- package/api/discover/detail/item/item.d.mts +0 -26
- package/api/discover/detail/item/item.mjs +0 -78
- package/api/discover/detail/item/item.test.mjs +0 -73
- package/api/integration/pack-check.lifecycle-output.test.mjs +0 -107
- package/api/theme/add/add.rollback.test.mjs +0 -158
- package/api/theme/build/build.rollback.test.mjs +0 -148
- package/api/upgrade/run/files-changed.test.mjs +0 -111
- package/assets/codemods/file-count.test.mjs +0 -163
- package/assets/docs/tree/add-a-component.doc.mjs +0 -75
- package/assets/docs/tree/add-a-theme.doc.mjs +0 -85
- package/assets/docs/tree/add-a-topic.doc.mjs +0 -144
- package/assets/docs/tree/agent-guidance.doc.mjs +0 -138
- package/assets/docs/tree/block-template.doc.mjs +0 -130
- package/assets/docs/tree/build-the-template.doc.mjs +0 -28
- package/assets/docs/tree/building-blocks.doc.mjs +0 -46
- package/assets/docs/tree/check-your-docs.doc.mjs +0 -137
- package/assets/docs/tree/checks.doc.mjs +0 -119
- package/assets/docs/tree/codemods.doc.mjs +0 -147
- package/assets/docs/tree/component-family.doc.mjs +0 -113
- package/assets/docs/tree/component-imports.doc.mjs +0 -69
- package/assets/docs/tree/component-lookups.doc.mjs +0 -149
- package/assets/docs/tree/components.doc.mjs +0 -23
- package/assets/docs/tree/configuration.doc.mjs +0 -23
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +0 -182
- package/assets/docs/tree/define-the-theme.doc.mjs +0 -118
- package/assets/docs/tree/describe-the-component.doc.mjs +0 -57
- package/assets/docs/tree/docs.doc.mjs +0 -21
- package/assets/docs/tree/document-the-template.doc.mjs +0 -28
- package/assets/docs/tree/document-the-theme.doc.mjs +0 -68
- package/assets/docs/tree/export-template-assets.doc.mjs +0 -147
- package/assets/docs/tree/extend-or-replace.doc.mjs +0 -103
- package/assets/docs/tree/fonts-and-assets.doc.mjs +0 -106
- package/assets/docs/tree/generate-a-palette.doc.mjs +0 -66
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +0 -105
- package/assets/docs/tree/help.doc.mjs +0 -16
- package/assets/docs/tree/links.doc.mjs +0 -98
- package/assets/docs/tree/package-and-test.doc.mjs +0 -32
- package/assets/docs/tree/page-template.doc.mjs +0 -71
- package/assets/docs/tree/publishing.doc.mjs +0 -111
- package/assets/docs/tree/quick-start.doc.mjs +0 -272
- package/assets/docs/tree/replace-a-core-component.doc.mjs +0 -104
- package/assets/docs/tree/replace-a-core-template.doc.mjs +0 -172
- package/assets/docs/tree/sections-and-placement.doc.mjs +0 -108
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +0 -59
- package/assets/docs/tree/ship.doc.mjs +0 -16
- package/assets/docs/tree/short-and-findable.doc.mjs +0 -108
- package/assets/docs/tree/single-component.doc.mjs +0 -165
- package/assets/docs/tree/start-a-template.doc.mjs +0 -143
- package/assets/docs/tree/subcomponent.doc.mjs +0 -115
- package/assets/docs/tree/template-assets.doc.mjs +0 -64
- package/assets/docs/tree/template-doc-overview.doc.mjs +0 -109
- package/assets/docs/tree/template-fonts.doc.mjs +0 -102
- package/assets/docs/tree/template-grading-rubric.doc.mjs +0 -452
- package/assets/docs/tree/template-icons.doc.mjs +0 -97
- package/assets/docs/tree/template-images-media.doc.mjs +0 -127
- package/assets/docs/tree/template-styles.doc.mjs +0 -93
- package/assets/docs/tree/templates.doc.mjs +0 -34
- package/assets/docs/tree/test-in-an-app.doc.mjs +0 -115
- package/assets/docs/tree/test-template-in-app.doc.mjs +0 -128
- package/assets/docs/tree/themes.doc.mjs +0 -39
- package/assets/docs/tree/troubleshooting.doc.mjs +0 -149
- package/assets/docs/tree/upgrading.doc.mjs +0 -103
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +0 -51
- package/assets/docs/tree/verify-packed-template.doc.mjs +0 -77
- package/assets/docs/tree/versioning.doc.mjs +0 -161
- package/assets/docs/tree/write-good-templates.doc.mjs +0 -64
- package/assets/docs/tree/write-the-template-file.doc.mjs +0 -154
- package/authoring/discover/discover.doc.d.mts +0 -13
- package/authoring/discover/discover.doc.mjs +0 -138
- package/authoring/discover/parse.d.mts +0 -24
- package/authoring/discover/parse.mjs +0 -128
- package/authoring/discover/parse.test.mjs +0 -124
- package/authoring/discover/type.ts +0 -87
- package/clients/cli/commands/component-batch.test.mjs +0 -341
- package/clients/cli/commands/discover.sources.test.mjs +0 -267
- package/clients/cli/commands/integration-verify.doc.mjs +0 -22
- package/clients/cli/lib/parse-error-format.test.mjs +0 -81
- package/foundation/response/batch.type.d.mts +0 -33
- package/foundation/response/batch.type.mjs +0 -34
|
@@ -216,7 +216,6 @@ export const ComponentDocKindSchema: z.ZodObject<{
|
|
|
216
216
|
theming: z.ZodOptional<z.ZodUnknown>;
|
|
217
217
|
playground: z.ZodOptional<z.ZodUnknown>;
|
|
218
218
|
examples: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
219
|
-
replaces: z.ZodOptional<z.ZodString>;
|
|
220
219
|
name: z.ZodString;
|
|
221
220
|
displayName: z.ZodOptional<z.ZodString>;
|
|
222
221
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -317,7 +316,6 @@ export const FunctionDocKindSchema: z.ZodObject<{
|
|
|
317
316
|
export const GenericDocKindSchema: z.ZodObject<{
|
|
318
317
|
type: z.ZodLiteral<"generic">;
|
|
319
318
|
title: z.ZodOptional<z.ZodString>;
|
|
320
|
-
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
321
319
|
sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
322
320
|
id: z.ZodOptional<z.ZodString>;
|
|
323
321
|
title: z.ZodString;
|
|
@@ -386,6 +384,7 @@ export const GenericDocKindSchema: z.ZodObject<{
|
|
|
386
384
|
import: z.ZodOptional<z.ZodString>;
|
|
387
385
|
group: z.ZodOptional<z.ZodString>;
|
|
388
386
|
category: z.ZodOptional<z.ZodString>;
|
|
387
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
389
388
|
parent: z.ZodOptional<z.ZodString>;
|
|
390
389
|
relatedDocs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
391
390
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -841,6 +840,7 @@ export const LegacyDocSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
841
840
|
displayName: z.ZodOptional<z.ZodString>;
|
|
842
841
|
group: z.ZodOptional<z.ZodString>;
|
|
843
842
|
category: z.ZodOptional<z.ZodString>;
|
|
843
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
844
844
|
isHiddenFromOverview: z.ZodOptional<z.ZodBoolean>;
|
|
845
845
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
846
846
|
hiddenComponents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -865,7 +865,6 @@ export const LegacyDocSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
865
865
|
}>>;
|
|
866
866
|
title: z.ZodString;
|
|
867
867
|
description: z.ZodString;
|
|
868
|
-
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
869
868
|
sections: z.ZodArray<z.ZodObject<{
|
|
870
869
|
id: z.ZodOptional<z.ZodString>;
|
|
871
870
|
title: z.ZodString;
|
|
@@ -307,7 +307,6 @@ const ComponentBaseSchema = z
|
|
|
307
307
|
theming: z.unknown().optional(),
|
|
308
308
|
playground: z.unknown().optional(),
|
|
309
309
|
examples: z.array(z.unknown()).optional(),
|
|
310
|
-
replaces: z.string().min(1).optional(),
|
|
311
310
|
})
|
|
312
311
|
.passthrough();
|
|
313
312
|
|
|
@@ -415,9 +414,6 @@ export const GenericDocKindSchema = z
|
|
|
415
414
|
...BaseDocFields,
|
|
416
415
|
type: z.literal('generic'),
|
|
417
416
|
title: nonEmptyString.optional(),
|
|
418
|
-
// Search terms the title and sections do not use; `astryx search` matches
|
|
419
|
-
// them as keywords of the whole topic (ReferenceDoc `keywords`).
|
|
420
|
-
keywords: z.array(z.string()).optional(),
|
|
421
417
|
sections: z.array(ReferenceSectionSchema).min(1).optional(),
|
|
422
418
|
replaces: nonEmptyString.optional(),
|
|
423
419
|
extends: nonEmptyString.optional(),
|
|
@@ -734,8 +730,6 @@ const LegacyBaseDocSchema = z.object({
|
|
|
734
730
|
const LegacyReferenceDocSchema = LegacyBaseDocSchema.extend({
|
|
735
731
|
title: nonEmptyString,
|
|
736
732
|
description: z.string(),
|
|
737
|
-
// As on the stamped schema: search terms for the whole topic.
|
|
738
|
-
keywords: z.array(z.string()).optional(),
|
|
739
733
|
sections: z.array(ReferenceSectionSchema).min(1),
|
|
740
734
|
replaces: nonEmptyString.optional(),
|
|
741
735
|
extends: nonEmptyString.optional(),
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'Authored doc graph fields',
|
|
13
13
|
namespace: 'authoring',
|
|
14
14
|
description:
|
|
15
|
-
"
|
|
15
|
+
"Placement, compatibility aliases, and audience: fields every authored doc kind declares for the docs tree. The docs tree reads `placement` for every guide, the CLI's and each integration's; aliases and audience are not built yet. A reference topic outside the docs tree that sets one fails to load, and other doc kinds accept them and ignore them.",
|
|
16
16
|
appliesTo: 'Every supported .doc.mjs object',
|
|
17
17
|
fields: [
|
|
18
18
|
{
|
|
@@ -45,13 +45,13 @@ export const doc = {
|
|
|
45
45
|
name: 'aliases',
|
|
46
46
|
type: 'string[]',
|
|
47
47
|
description:
|
|
48
|
-
'
|
|
48
|
+
'Prior names or routes the docs tree will keep resolving to this doc, without creating another identity. Not read yet: a topic that sets it fails to load.',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
name: 'audience',
|
|
52
52
|
type: "'public' | 'internal'",
|
|
53
53
|
description:
|
|
54
|
-
"
|
|
54
|
+
"Which docs bundle includes this doc ('public' when omitted). Not read yet: a topic that sets it fails to load.",
|
|
55
55
|
default: "'public'",
|
|
56
56
|
},
|
|
57
57
|
],
|
|
@@ -39,11 +39,9 @@ export interface DocPlacement {
|
|
|
39
39
|
export interface AuthoredDocGraphFields {
|
|
40
40
|
/** The doc's one parent in the docs tree: a namespace of its own package. */
|
|
41
41
|
placement?: DocPlacement;
|
|
42
|
-
/**
|
|
43
|
-
* Nothing reads it yet. */
|
|
42
|
+
/** Prior routes or names the docs tree will keep resolving. Not read yet. */
|
|
44
43
|
aliases?: string[];
|
|
45
|
-
/**
|
|
46
|
-
* yet. */
|
|
44
|
+
/** Docs bundle audience; omit for public docs. Not read yet. */
|
|
47
45
|
audience?: DocAudience;
|
|
48
46
|
}
|
|
49
47
|
|
|
@@ -75,7 +75,7 @@ export interface CommandDoc extends AuthoredDocGraphFields {
|
|
|
75
75
|
args?: CommandArgDoc[];
|
|
76
76
|
/** Flags/options. */
|
|
77
77
|
options?: CommandOptionDoc[];
|
|
78
|
-
/** Subcommand names (for command groups like `theme`). */
|
|
78
|
+
/** Subcommand names (for command groups like `theme` / `layout`). */
|
|
79
79
|
subcommands?: string[];
|
|
80
80
|
/** Terminal examples. */
|
|
81
81
|
examples?: CommandExampleDoc[];
|
|
@@ -52,12 +52,6 @@ export const doc = {
|
|
|
52
52
|
description:
|
|
53
53
|
'Exact public package specifier consumers use to import an integration-owned component. The packed-package gate resolves this specifier and verifies it exports the component name.',
|
|
54
54
|
},
|
|
55
|
-
{
|
|
56
|
-
name: 'replaces',
|
|
57
|
-
type: 'string',
|
|
58
|
-
description:
|
|
59
|
-
"Integration components only: the exact `name` of the Core ComponentDoc this component takes over for unqualified lookup, so every app that loads the integration gets it from component detail, lists, search, swizzle, and issue routing. The Core original stays reachable with `--package @astryxdesign/core`. Set it only to intentionally own a Core identity; give an alternative or variant its own name instead.",
|
|
60
|
-
},
|
|
61
55
|
{
|
|
62
56
|
name: 'keywords',
|
|
63
57
|
type: 'string[]',
|
|
@@ -48,14 +48,6 @@ export interface ComponentBaseDoc extends AuthoredDocGraphFields {
|
|
|
48
48
|
displayName: string;
|
|
49
49
|
/** Exact consumer import specifier for integration-owned components. */
|
|
50
50
|
import?: string;
|
|
51
|
-
/** Integration components only: the exact `name` of the Core ComponentDoc
|
|
52
|
-
* this component takes over for unqualified lookup, so every app that loads
|
|
53
|
-
* the integration gets this component from component detail, lists, search,
|
|
54
|
-
* swizzle, and issue routing. The Core original stays reachable with
|
|
55
|
-
* `--package @astryxdesign/core`. Set it only to intentionally own a Core
|
|
56
|
-
* identity; give an alternative or variant its own name instead. Older CLIs
|
|
57
|
-
* that do not read `replaces` keep the component under its own name. */
|
|
58
|
-
replaces?: string;
|
|
59
51
|
/** Search keywords for CLI discovery. Terms a developer might type when
|
|
60
52
|
* looking for this component: synonyms, related UI concepts, and common
|
|
61
53
|
* names from other design systems (MUI, Chakra, Radix, and others).
|
|
@@ -51,13 +51,6 @@ export const doc = {
|
|
|
51
51
|
type: 'string',
|
|
52
52
|
description: "Navigation category: 'guide' or 'foundations'.",
|
|
53
53
|
},
|
|
54
|
-
{
|
|
55
|
-
name: 'keywords',
|
|
56
|
-
type: 'string[]',
|
|
57
|
-
description:
|
|
58
|
-
"Words a reader may search for that the title and sections do not use: a synonym, a task, or another library's name for the same thing. `astryx search` matches each as a keyword of the whole topic, so an exact one ranks the topic like its own title does.",
|
|
59
|
-
example: "['dark mode', 'color scheme']",
|
|
60
|
-
},
|
|
61
54
|
{
|
|
62
55
|
name: 'replaces',
|
|
63
56
|
type: 'string',
|
|
@@ -127,11 +127,6 @@ export interface ReferenceDoc extends AuthoredDocGraphFields {
|
|
|
127
127
|
description: string;
|
|
128
128
|
/** Navigation category: 'guide' or 'foundations'. */
|
|
129
129
|
category?: string;
|
|
130
|
-
/** Words a reader may search for that the title and sections do not use:
|
|
131
|
-
* a synonym, a task ("dark mode"), or another library's name for the same
|
|
132
|
-
* thing. `astryx search` matches each as a keyword of the whole topic, so
|
|
133
|
-
* an exact one ranks the topic like its own title does. */
|
|
134
|
-
keywords?: string[];
|
|
135
130
|
/** Name of an existing topic this doc takes the place of. Authored by an
|
|
136
131
|
* integration whose guide should be served instead of the built-in one —
|
|
137
132
|
* `replaces: 'getting-started'` on a doc named `getting-started` swaps the
|
|
@@ -49,7 +49,7 @@ export const doc = {
|
|
|
49
49
|
name: 'namespace',
|
|
50
50
|
type: 'string',
|
|
51
51
|
description:
|
|
52
|
-
"The group that reads this doc: 'authoring' for a file an author writes (a section of
|
|
52
|
+
"The group that reads this doc: 'authoring' for a file an author writes (a section of `astryx docs authoring`), or 'cli/api' for a shape the CLI returns (the docs tree adopts it by kind, as the leaf `cli/api/schemas/<name>`). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that nothing reads.",
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
name: 'aliases',
|
|
@@ -162,7 +162,7 @@ export const doc = {
|
|
|
162
162
|
type: '{ dir: string }',
|
|
163
163
|
description: 'Where component sources live.',
|
|
164
164
|
fields: [
|
|
165
|
-
{name: 'components.dir', type: 'string', description: 'Glob root for
|
|
165
|
+
{name: 'components.dir', type: 'string', description: 'Glob root for XDS*.tsx files.', required: true},
|
|
166
166
|
],
|
|
167
167
|
},
|
|
168
168
|
],
|
|
@@ -56,7 +56,7 @@ export const doc = {
|
|
|
56
56
|
name: 'replaces',
|
|
57
57
|
type: 'string',
|
|
58
58
|
description:
|
|
59
|
-
"Integration templates only: the exact id of the Core template this one replaces for unqualified lookup. Find it with `astryx --json template --list --package @astryxdesign/core`; the Core original stays selectable with `--package @astryxdesign/core`. A page replaces only a Core page and a block only a Core block. Needs @astryxdesign/cli 0.7.0 or later: earlier CLIs reject the field
|
|
59
|
+
"Integration templates only: the exact id of the Core template this one replaces for unqualified lookup. Find it with `astryx --json template --list --package @astryxdesign/core`; the Core original stays selectable with `--package @astryxdesign/core`. A page replaces only a Core page and a block only a Core block. Needs @astryxdesign/cli 0.7.0 or later: earlier CLIs reject the field and withhold the package's templates and doc topics.",
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: 'isReady',
|
|
@@ -33,8 +33,8 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
|
33
33
|
* replaces for unqualified lookup (find it with
|
|
34
34
|
* `astryx --json template --list --package @astryxdesign/core`). The Core
|
|
35
35
|
* original stays selectable with `--package @astryxdesign/core`. Needs
|
|
36
|
-
* `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field
|
|
37
|
-
*
|
|
36
|
+
* `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field and
|
|
37
|
+
* withhold the package's templates and doc topics. */
|
|
38
38
|
replaces?: string;
|
|
39
39
|
/** Whether this template is ready for use. Templates with
|
|
40
40
|
* isReady: false show as "(WIP)" in the gallery and CLI. */
|
package/authoring/index.d.mts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
export { parseConfig } from "./config/parse.mjs";
|
|
5
5
|
export { parseIntegration } from "./integration/parse.mjs";
|
|
6
|
-
export { parseDiscoverCatalog } from "./discover/parse.mjs";
|
|
7
6
|
export { parseCodemod } from "./codemod/parse.mjs";
|
|
8
7
|
export { parseDebugEvent } from "./debug/parse.mjs";
|
|
9
8
|
export { parseDoc } from "./doctypes/parse.mjs";
|
package/authoring/index.d.ts
CHANGED
|
@@ -44,15 +44,6 @@ export type {
|
|
|
44
44
|
GapReportTarget,
|
|
45
45
|
GapReportHandlerReceipt,
|
|
46
46
|
} from './gap-report/type.js'; // gap-report handler contract
|
|
47
|
-
export type {
|
|
48
|
-
DiscoverSource,
|
|
49
|
-
DiscoverSourceContext,
|
|
50
|
-
DiscoverCatalog,
|
|
51
|
-
DiscoverPackage,
|
|
52
|
-
DiscoverVersion,
|
|
53
|
-
DiscoverContribution,
|
|
54
|
-
DiscoverKind,
|
|
55
|
-
} from './discover/type.js'; // discover source contract
|
|
56
47
|
export type {AstryxCodemod, AstryxConfigCodemod} from './codemod/type.js'; // codemods/*
|
|
57
48
|
|
|
58
49
|
// ═══════════════════════════════════════════════════════════════════════
|
|
@@ -76,7 +67,6 @@ export {
|
|
|
76
67
|
parseGapReportHandler,
|
|
77
68
|
parseGapReportReceipt,
|
|
78
69
|
} from './gap-report/parse.mjs';
|
|
79
|
-
export {parseDiscoverCatalog} from './discover/parse.mjs';
|
|
80
70
|
export {parseCodemod} from './codemod/parse.mjs';
|
|
81
71
|
export {parseDebugEvent} from './debug/parse.mjs';
|
|
82
72
|
|
package/authoring/index.mjs
CHANGED
|
@@ -20,7 +20,6 @@ export {
|
|
|
20
20
|
parseGapReportHandler,
|
|
21
21
|
parseGapReportReceipt,
|
|
22
22
|
} from './gap-report/parse.mjs';
|
|
23
|
-
export {parseDiscoverCatalog} from './discover/parse.mjs';
|
|
24
23
|
export {parseCodemod} from './codemod/parse.mjs';
|
|
25
24
|
export {parseDebugEvent} from './debug/parse.mjs';
|
|
26
25
|
export {parseDoc} from './doctypes/parse.mjs';
|
|
@@ -23,49 +23,48 @@ export const doc = {
|
|
|
23
23
|
name: 'providerId',
|
|
24
24
|
type: 'string',
|
|
25
25
|
description:
|
|
26
|
-
'
|
|
26
|
+
'Stable logical provider ID. Omit to use package.json#name; set it to the prior package name only when an explicit rename must preserve artifact IDs. If two packages claim the same ID, the package being authored is used, otherwise the first-loaded one, and the CLI warns about the other.',
|
|
27
27
|
example: "'@acme/widgets'",
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
name: 'components',
|
|
31
31
|
type: 'string',
|
|
32
32
|
description:
|
|
33
|
-
'
|
|
33
|
+
'Relative path to the components/docs root (resolved to absolute).',
|
|
34
34
|
example: "'./src/components'",
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
name: 'templates',
|
|
38
38
|
type: 'string',
|
|
39
39
|
description:
|
|
40
|
-
'
|
|
40
|
+
'Relative path to the templates root (resolved to absolute).',
|
|
41
41
|
example: "'./src/templates'",
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
name: 'codemods',
|
|
45
45
|
type: 'string',
|
|
46
|
-
description:
|
|
47
|
-
'The folder that holds your codemods, relative to package.json.',
|
|
46
|
+
description: 'Relative path to the codemods root (resolved to absolute).',
|
|
48
47
|
example: "'./codemods'",
|
|
49
48
|
},
|
|
50
49
|
{
|
|
51
50
|
name: 'docs',
|
|
52
51
|
type: 'string',
|
|
53
52
|
description:
|
|
54
|
-
'
|
|
53
|
+
'Relative path to the reference-docs (topics) root (resolved to absolute). Every {topic}.doc.{ts,mjs,js} under it is served by `astryx docs` beside the built-in topics; a topic may also declare `replaces` or `extends` to take the place of a built-in one or merge onto it.',
|
|
55
54
|
example: "'./docs'",
|
|
56
55
|
},
|
|
57
56
|
{
|
|
58
57
|
name: 'themes',
|
|
59
58
|
type: 'string',
|
|
60
59
|
description:
|
|
61
|
-
'
|
|
60
|
+
'Relative path to a source-theme root with one directory per theme slug. Each directory contains a source module and mandatory same-stem, strongly typed .doc.mjs descriptor. Installed themes appear in `astryx theme list` and can be copied with `astryx theme add`.',
|
|
62
61
|
example: "'./themes'",
|
|
63
62
|
},
|
|
64
63
|
{
|
|
65
64
|
name: 'agentDocs',
|
|
66
65
|
type: '{ append?: readonly string[] }',
|
|
67
66
|
description:
|
|
68
|
-
'
|
|
67
|
+
'Static package guidance appended to the end of the managed agent block. The CLI owns the section heading, package labels, bullets, target files, and writes.',
|
|
69
68
|
example: "{ append: ['Run acme verify.'] }",
|
|
70
69
|
},
|
|
71
70
|
{
|
|
@@ -95,10 +94,9 @@ export const doc = {
|
|
|
95
94
|
{
|
|
96
95
|
type: 'prose',
|
|
97
96
|
text:
|
|
98
|
-
'
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'version always comes from package.json.',
|
|
97
|
+
'Provider identity defaults to package.json#name. During an explicit ' +
|
|
98
|
+
'package rename, set `providerId` to the prior canonical package name so ' +
|
|
99
|
+
'existing artifact IDs remain stable. Package version always comes from package.json.',
|
|
102
100
|
},
|
|
103
101
|
{
|
|
104
102
|
type: 'prose',
|
|
@@ -29,17 +29,17 @@ import {program} from './index.mjs';
|
|
|
29
29
|
import {reportsResult, reportsResultVia} from './lib/define-command.mjs';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Commands with no action of their own:
|
|
33
|
-
* list and does nothing else
|
|
32
|
+
* Commands with no action of their own: bare `astryx layout` prints its
|
|
33
|
+
* subcommand list and does nothing else, so there is no run to report on.
|
|
34
34
|
*
|
|
35
35
|
* Pinned as a SET rather than skipped silently — if a command joins this list,
|
|
36
36
|
* that is a real change to what the CLI does and it should be read, not
|
|
37
|
-
* absorbed.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
37
|
+
* absorbed. (`theme` is deliberately NOT here: it HAS an action — the one that
|
|
38
|
+
* rejects an unknown subcommand — so it goes through the converter like any
|
|
39
|
+
* other. Its bare form prints help and never returns from that action, which
|
|
40
|
+
* the recorder covers where help is recorded, not here.)
|
|
41
41
|
*/
|
|
42
|
-
const NO_ACTION_OF_THEIR_OWN = [];
|
|
42
|
+
const NO_ACTION_OF_THEIR_OWN = ['layout'];
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Commands that record for themselves instead of returning a descriptor.
|
|
@@ -38,7 +38,6 @@ import {doc as componentFn} from '../../../../api/component/component.doc.mjs';
|
|
|
38
38
|
*
|
|
39
39
|
* @typedef {(
|
|
40
40
|
* | import('../../../../api/component/component.type.mjs').ComponentListResponse
|
|
41
|
-
* | import('../../../../api/component/component.type.mjs').ComponentBatchResponse
|
|
42
41
|
* | import('../../../../api/component/component.type.mjs').ComponentDetailResponse
|
|
43
42
|
* | import('../../../../api/component/component.type.mjs').ComponentDetailPropsResponse
|
|
44
43
|
* | import('../../../../api/component/component.type.mjs').ComponentDetailSourceResponse
|
|
@@ -68,11 +67,6 @@ function summarize(result) {
|
|
|
68
67
|
);
|
|
69
68
|
return resultSet({count, resultKind: 'component'});
|
|
70
69
|
}
|
|
71
|
-
case 'component.batch':
|
|
72
|
-
return resultSet({
|
|
73
|
-
count: result.data.results.filter(row => row.status === 'found').length,
|
|
74
|
-
resultKind: 'component',
|
|
75
|
-
});
|
|
76
70
|
case 'component.detail':
|
|
77
71
|
case 'component.detail.props':
|
|
78
72
|
case 'component.detail.source':
|
|
@@ -88,103 +82,19 @@ function summarize(result) {
|
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
84
|
|
|
91
|
-
/**
|
|
92
|
-
* Project one single-component API result through the existing formatter kit.
|
|
93
|
-
* @param {import('../../../../api/component/component.type.mjs').ComponentSingleResponse} result
|
|
94
|
-
* @param {string} requestedName
|
|
95
|
-
* @param {'full'|'compact'|'brief'} detail
|
|
96
|
-
* @param {ReturnType<typeof resolveTheme>} themeData
|
|
97
|
-
* @returns {import('../../formatters/index.mjs').Block[]}
|
|
98
|
-
*/
|
|
99
|
-
function componentDetailBlocks(result, requestedName, detail, themeData) {
|
|
100
|
-
const resolvedName = (requestedName.split('/').pop() ?? requestedName).replace(
|
|
101
|
-
/^XDS/,
|
|
102
|
-
'',
|
|
103
|
-
);
|
|
104
|
-
switch (result.type) {
|
|
105
|
-
case 'component.detail': {
|
|
106
|
-
/** @type {import('../../formatters/index.mjs').Block[]} */
|
|
107
|
-
const out = [];
|
|
108
|
-
if (result.data.parentDoc) {
|
|
109
|
-
out.push(record(result.data, {fields: ['parentDoc']}));
|
|
110
|
-
}
|
|
111
|
-
out.push(
|
|
112
|
-
detail === 'brief'
|
|
113
|
-
? code(
|
|
114
|
-
formatBrief(result.data, resolvedName, result.data.import, {
|
|
115
|
-
themeData,
|
|
116
|
-
}),
|
|
117
|
-
)
|
|
118
|
-
: detail === 'compact'
|
|
119
|
-
? code(
|
|
120
|
-
formatCompact(result.data, resolvedName, result.data.import),
|
|
121
|
-
)
|
|
122
|
-
: code(
|
|
123
|
-
formatFull(result.data, {
|
|
124
|
-
themeData,
|
|
125
|
-
importHint: result.data.import,
|
|
126
|
-
}),
|
|
127
|
-
),
|
|
128
|
-
);
|
|
129
|
-
return out;
|
|
130
|
-
}
|
|
131
|
-
case 'component.detail.props':
|
|
132
|
-
return [code(formatProps({props: result.data}, resolvedName))];
|
|
133
|
-
case 'component.detail.source':
|
|
134
|
-
case 'component.detail.showcase':
|
|
135
|
-
return [code(result.data.source)];
|
|
136
|
-
case 'component.detail.blocks': {
|
|
137
|
-
const {showcase, examples, related} = result.data;
|
|
138
|
-
/** @type {import('../../formatters/index.mjs').Block[]} */
|
|
139
|
-
const out = [];
|
|
140
|
-
if (showcase) {
|
|
141
|
-
out.push(
|
|
142
|
-
section('Showcase'),
|
|
143
|
-
record(showcase, {fields: ['displayName', 'description']}),
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
if (examples.length > 0) {
|
|
147
|
-
out.push(
|
|
148
|
-
section('Examples'),
|
|
149
|
-
records(examples, {fields: ['name', 'description']}),
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
if (related.length > 0) {
|
|
153
|
-
out.push(
|
|
154
|
-
section(
|
|
155
|
-
`Related: ${related.length} blocks that use ${result.data.component}`,
|
|
156
|
-
),
|
|
157
|
-
list(related.map(block => block.name)),
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
if (!showcase && examples.length === 0 && related.length === 0) {
|
|
161
|
-
out.push(text(`No blocks found for ${result.data.component}`));
|
|
162
|
-
}
|
|
163
|
-
return out;
|
|
164
|
-
}
|
|
165
|
-
default:
|
|
166
|
-
return [];
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
85
|
/**
|
|
171
86
|
* @param {import('commander').Command} program
|
|
172
87
|
*/
|
|
173
88
|
export function registerComponent(program) {
|
|
174
89
|
defineCommand(program, componentCommand, {
|
|
175
90
|
fn: componentFn,
|
|
176
|
-
action: async (
|
|
177
|
-
/** @type {string[] | undefined} */ names,
|
|
178
|
-
/** @type {{list?: boolean, category?: string, props?: boolean, source?: boolean, showcase?: boolean, blocks?: boolean, package?: string}} */ options,
|
|
179
|
-
) => {
|
|
91
|
+
action: async (/** @type {string | undefined} */ name, /** @type {{list?: boolean, category?: string, props?: boolean, source?: boolean, showcase?: boolean, blocks?: boolean, package?: string}} */ options) => {
|
|
180
92
|
const run = getCliInvocation();
|
|
181
|
-
const name = names?.length === 1 ? names[0] : undefined;
|
|
182
|
-
const apiInput = !names?.length ? undefined : name ?? names;
|
|
183
93
|
const zh = program.opts().zh || false;
|
|
184
94
|
const dense = program.opts().dense || false;
|
|
185
95
|
const lang = program.opts().lang || null;
|
|
186
96
|
const detailSource = program.getOptionValueSource('detail');
|
|
187
|
-
const isListView = options.list || options.category || !
|
|
97
|
+
const isListView = options.list || options.category || !name;
|
|
188
98
|
// Default detail level is full for single-component view, brief for list views.
|
|
189
99
|
// (List views are scannable name lists; users can opt into compact/full.)
|
|
190
100
|
let detail = program.opts().detail || 'full';
|
|
@@ -209,7 +119,7 @@ export function registerComponent(program) {
|
|
|
209
119
|
/** @type {ComponentResult} */
|
|
210
120
|
let result;
|
|
211
121
|
try {
|
|
212
|
-
result = /** @type {ComponentResult} */ (await componentApi(
|
|
122
|
+
result = /** @type {ComponentResult} */ (await componentApi(name, {
|
|
213
123
|
cwd: process.cwd(),
|
|
214
124
|
list: options.list,
|
|
215
125
|
category: options.category,
|
|
@@ -227,12 +137,6 @@ export function registerComponent(program) {
|
|
|
227
137
|
}
|
|
228
138
|
|
|
229
139
|
const answered = summarize(result);
|
|
230
|
-
if (
|
|
231
|
-
result.type === 'component.batch' &&
|
|
232
|
-
result.data.results.some(row => row.status !== 'found')
|
|
233
|
-
) {
|
|
234
|
-
process.exitCode = 1;
|
|
235
|
-
}
|
|
236
140
|
if (json) {
|
|
237
141
|
jsonOut(result);
|
|
238
142
|
return answered;
|
|
@@ -248,7 +152,7 @@ export function registerComponent(program) {
|
|
|
248
152
|
const listFooter = text(
|
|
249
153
|
[
|
|
250
154
|
`Import from the path shown (e.g. import {Button} from '@astryxdesign/core/Button')`,
|
|
251
|
-
`Usage: ${run} component <name
|
|
155
|
+
`Usage: ${run} component <name>`,
|
|
252
156
|
].join('\n'),
|
|
253
157
|
);
|
|
254
158
|
|
|
@@ -327,65 +231,64 @@ export function registerComponent(program) {
|
|
|
327
231
|
break;
|
|
328
232
|
}
|
|
329
233
|
|
|
330
|
-
case 'component.
|
|
234
|
+
case 'component.detail': {
|
|
235
|
+
const resolvedName = (name || '').replace(/^XDS/, '');
|
|
236
|
+
const importHint = result.data.import;
|
|
237
|
+
if (result.data.parentDoc) emit(record(result.data, {fields: ['parentDoc']}));
|
|
238
|
+
const doc =
|
|
239
|
+
detail === 'brief'
|
|
240
|
+
? code(formatBrief(result.data, resolvedName, importHint, {themeData}))
|
|
241
|
+
: detail === 'compact'
|
|
242
|
+
? code(formatCompact(result.data, resolvedName, importHint))
|
|
243
|
+
: code(formatFull(result.data, {themeData, importHint}));
|
|
244
|
+
emit(doc);
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
case 'component.detail.props': {
|
|
249
|
+
const resolvedName = (name || '').replace(/^XDS/, '');
|
|
250
|
+
emit(code(formatProps({props: result.data}, resolvedName)));
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
case 'component.detail.source': {
|
|
255
|
+
emit(code(result.data.source));
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
case 'component.detail.showcase': {
|
|
260
|
+
emit(code(result.data.source));
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
case 'component.detail.blocks': {
|
|
265
|
+
const {showcase, examples, related} = result.data;
|
|
331
266
|
/** @type {import('../../formatters/index.mjs').Block[]} */
|
|
332
|
-
const out = [
|
|
333
|
-
|
|
334
|
-
record({count: result.data.count}),
|
|
335
|
-
section('Results'),
|
|
336
|
-
];
|
|
337
|
-
for (const row of result.data.results) {
|
|
338
|
-
out.push(section(row.selector));
|
|
339
|
-
if (row.status === 'found') {
|
|
340
|
-
out.push(
|
|
341
|
-
record(row, {fields: ['selector', 'status']}),
|
|
342
|
-
section('Result'),
|
|
343
|
-
...componentDetailBlocks(
|
|
344
|
-
row.result,
|
|
345
|
-
row.selector,
|
|
346
|
-
detail,
|
|
347
|
-
themeData,
|
|
348
|
-
),
|
|
349
|
-
);
|
|
350
|
-
continue;
|
|
351
|
-
}
|
|
267
|
+
const out = [];
|
|
268
|
+
if (showcase) {
|
|
352
269
|
out.push(
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}),
|
|
270
|
+
section('Showcase'),
|
|
271
|
+
record(showcase, {fields: ['displayName', 'description']}),
|
|
356
272
|
);
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
273
|
+
}
|
|
274
|
+
if (examples.length > 0) {
|
|
275
|
+
out.push(
|
|
276
|
+
section('Examples'),
|
|
277
|
+
records(examples, {fields: ['name', 'description']}),
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
if (related.length > 0) {
|
|
281
|
+
out.push(
|
|
282
|
+
section(`Related: ${related.length} blocks that use ${result.data.component}`),
|
|
283
|
+
list(related.map(b => b.name)),
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
if (!showcase && examples.length === 0 && related.length === 0) {
|
|
287
|
+
out.push(text(`No blocks found for ${result.data.component}`));
|
|
370
288
|
}
|
|
371
289
|
emit(...out);
|
|
372
290
|
break;
|
|
373
291
|
}
|
|
374
|
-
|
|
375
|
-
case 'component.detail':
|
|
376
|
-
case 'component.detail.props':
|
|
377
|
-
case 'component.detail.source':
|
|
378
|
-
case 'component.detail.showcase':
|
|
379
|
-
case 'component.detail.blocks':
|
|
380
|
-
emit(
|
|
381
|
-
...componentDetailBlocks(
|
|
382
|
-
result,
|
|
383
|
-
name ?? '',
|
|
384
|
-
detail,
|
|
385
|
-
themeData,
|
|
386
|
-
),
|
|
387
|
-
);
|
|
388
|
-
break;
|
|
389
292
|
}
|
|
390
293
|
return answered;
|
|
391
294
|
},
|