@astryxdesign/cli 0.6.3-canary.98a2e4e → 0.6.3-canary.9c4d44d
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 +117 -79
- package/api/blog/blog.doc.mjs +1 -0
- package/api/build/_adapter.d.mts +50 -0
- package/api/build/_adapter.mjs +60 -0
- package/api/build/build.doc.mjs +16 -9
- package/api/build/build.test.mjs +197 -8
- package/api/build/build.type.d.mts +91 -2
- package/api/build/build.type.mjs +52 -8
- package/api/build/help/help.d.mts +12 -5
- package/api/build/help/help.mjs +69 -6
- package/api/build/kit/kit.d.mts +4 -1
- package/api/build/kit/kit.mjs +165 -49
- package/api/build/kit/rank.d.mts +44 -0
- package/api/build/kit/rank.mjs +432 -0
- package/api/build/kit/rank.test.mjs +196 -0
- package/api/component/_adapter.d.mts +6 -12
- package/api/component/_adapter.mjs +20 -10
- package/api/component/component.doc.mjs +13 -3
- package/api/component/component.mjs +91 -14
- package/api/component/component.test.mjs +38 -0
- package/api/component/component.type.d.mts +22 -11
- package/api/component/component.type.mjs +32 -24
- package/api/component/detail/blocks/blocks.d.mts +2 -1
- package/api/component/detail/blocks/blocks.mjs +4 -3
- package/api/component/list/list.d.mts +0 -5
- package/api/component/list/list.mjs +40 -11
- package/api/discover/_adapter.d.mts +114 -6
- package/api/discover/_adapter.mjs +372 -17
- package/api/discover/_adapter.test.mjs +215 -0
- package/api/discover/_catalog-view.d.mts +115 -0
- package/api/discover/_catalog-view.mjs +203 -0
- package/api/discover/_catalog-view.test.mjs +128 -0
- package/api/discover/detail/detail.d.mts +18 -6
- package/api/discover/detail/detail.mjs +67 -13
- package/api/discover/detail/detail.test.mjs +85 -0
- package/api/discover/detail/item/item.d.mts +26 -0
- package/api/discover/detail/item/item.mjs +78 -0
- package/api/discover/detail/item/item.test.mjs +73 -0
- package/api/discover/discover.d.mts +3 -9
- package/api/discover/discover.doc.mjs +62 -18
- package/api/discover/discover.mjs +220 -36
- package/api/discover/discover.test.mjs +11 -2
- package/api/discover/discover.type.d.mts +150 -11
- package/api/discover/discover.type.mjs +107 -17
- package/api/discover/list/list.d.mts +20 -6
- package/api/discover/list/list.mjs +45 -12
- package/api/discover/list/list.test.mjs +46 -0
- package/api/discover/search/search.d.mts +18 -16
- package/api/discover/search/search.mjs +102 -56
- package/api/discover/search/search.test.mjs +144 -10
- package/api/docs/_adapter.d.mts +268 -47
- package/api/docs/_adapter.mjs +970 -149
- package/api/docs/compiled-topics.test.mjs +78 -0
- package/api/docs/detail/detail.d.mts +0 -15
- package/api/docs/detail/detail.mjs +22 -78
- package/api/docs/detail/section/section.mjs +39 -24
- package/api/docs/detail/section/section.test.mjs +19 -9
- package/api/docs/docs.d.mts +5 -3
- package/api/docs/docs.doc.mjs +39 -17
- package/api/docs/docs.mjs +44 -8
- package/api/docs/docs.test.mjs +158 -4
- package/api/docs/docs.type.d.mts +185 -6
- package/api/docs/docs.type.mjs +127 -13
- package/api/docs/index/index.mjs +15 -6
- package/api/docs/index/index.test.mjs +1 -1
- package/api/docs/integration-tree.test.mjs +555 -0
- package/api/docs/integrationDocs.test.mjs +14 -14
- package/api/docs/list/list.mjs +28 -12
- package/api/docs/node/node.d.mts +43 -0
- package/api/docs/node/node.mjs +192 -0
- package/api/docs/reference-blocks.test.mjs +406 -0
- package/api/doctor/doctor.d.mts +54 -4
- package/api/doctor/doctor.doc.mjs +1 -0
- package/api/doctor/doctor.mjs +332 -21
- package/api/doctor/doctor.test.mjs +420 -7
- package/api/gap-report/gap-report.doc.mjs +8 -4
- package/api/hook/_adapter.mjs +19 -5
- package/api/hook/hook.doc.mjs +1 -0
- package/api/hook/hook.type.d.mts +3 -3
- package/api/hook/hook.type.mjs +11 -11
- package/api/hook/list/list.d.mts +1 -1
- package/api/hook/list/list.mjs +69 -17
- package/api/index.d.mts +1 -1
- package/api/index.mjs +1 -0
- package/api/init/init.doc.mjs +6 -1
- package/api/init/init.test.mjs +41 -1
- package/api/init/remove/remove.mjs +1 -1
- package/api/init/run/run.mjs +20 -10
- package/api/integration/add-contribution.component-names.test.mjs +120 -0
- package/api/integration/add-contribution.d.mts +2 -1
- package/api/integration/add-contribution.mjs +130 -15
- package/api/integration/add-contribution.test.mjs +258 -7
- package/api/integration/add-helpers.d.mts +5 -2
- package/api/integration/add-helpers.mjs +36 -9
- package/api/integration/add-theme.mjs +34 -64
- package/api/integration/add-theme.test.mjs +105 -21
- package/api/integration/authoring-checks.mjs +138 -28
- package/api/integration/authoring-checks.test.mjs +179 -7
- package/api/integration/authoring-checks.type.mjs +6 -1
- package/api/integration/integration-authoring.type.d.mts +2 -0
- package/api/integration/integration-authoring.type.mjs +2 -0
- package/api/integration/integration-block-exports.test.mjs +10 -6
- package/api/integration/integrationAdd.doc.mjs +14 -4
- package/api/integration/integrationAddAgentDoc.doc.mjs +1 -0
- package/api/integration/integrationAddCodemod.doc.mjs +1 -0
- package/api/integration/integrationAddComponent.doc.mjs +2 -1
- package/api/integration/integrationAddDoc.doc.mjs +8 -1
- package/api/integration/integrationAddTemplate.doc.mjs +1 -0
- package/api/integration/integrationAddTheme.doc.mjs +6 -5
- package/api/integration/integrationComponentConflicts.doc.mjs +1 -0
- package/api/integration/integrationDocConflicts.doc.mjs +2 -1
- package/api/integration/integrationPackCheck.doc.mjs +2 -1
- package/api/integration/integrationTemplateConflicts.doc.d.mts +3 -0
- package/api/integration/integrationTemplateConflicts.doc.mjs +4 -0
- package/api/integration/pack-check.mjs +83 -7
- package/api/integration/pack-check.test.mjs +387 -47
- package/api/integration/pack-check.type.d.mts +26 -2
- package/api/integration/pack-check.type.mjs +14 -1
- package/api/integration/summarizeIssues.doc.mjs +1 -0
- package/api/integration/template-conflict-compatibility.test.mjs +73 -0
- package/api/integration/validate-integration-fixes.test.mjs +1389 -0
- package/api/integration/validate-integration.mjs +52 -102
- package/api/integration/validate-integration.test.mjs +179 -26
- package/api/integration/validate-unread-theme-folders.test.mjs +110 -0
- package/api/integration/validateIntegration.doc.mjs +3 -2
- package/api/json/assertResponse.doc.mjs +1 -0
- package/api/json/envelope-types.test.mjs +76 -0
- package/api/json/index.ts +2 -0
- package/api/json/isError.doc.mjs +1 -0
- package/api/json/parseResponse.doc.mjs +3 -2
- package/api/layout/_adapter.mjs +20 -5
- package/api/layout/expand/expand.mjs +7 -5
- package/api/layout/expand/expand.path-safety.test.mjs +53 -0
- package/api/layout/grammar/grammar.mjs +2 -1
- package/api/layout/layoutCheck.doc.mjs +1 -0
- package/api/layout/layoutExpand.doc.mjs +2 -1
- package/api/layout/layoutGrammar.doc.mjs +1 -0
- package/api/search/search-return-type.test.mjs +54 -0
- package/api/search/search.d.mts +61 -10
- package/api/search/search.doc.mjs +8 -2
- package/api/search/search.mjs +471 -83
- package/api/search/search.test.mjs +124 -1
- package/api/search/search.type.d.mts +14 -2
- package/api/search/search.type.mjs +5 -2
- package/api/swizzle/copy/copy.mjs +28 -11
- package/api/swizzle/swizzle.doc.mjs +2 -1
- package/api/swizzle/swizzle.type.d.mts +2 -2
- package/api/swizzle/swizzle.type.mjs +2 -2
- package/api/template/copy/copy.mjs +17 -23
- package/api/template/copy/copy.test.mjs +17 -0
- package/api/template/list/list.mjs +1 -0
- package/api/template/table-floating-bulk-actions.test.mjs +66 -0
- package/api/template/template-integration.test.mjs +1072 -3
- package/api/template/template-suffix.test.mjs +41 -21
- package/api/template/template.doc.mjs +30 -8
- package/api/template/template.mjs +45 -8
- package/api/template/template.type.d.mts +11 -13
- package/api/template/template.type.mjs +15 -14
- package/api/theme/_adapter.d.mts +2 -3
- package/api/theme/_adapter.mjs +4 -5
- package/api/theme/add/add.binary.test.mjs +84 -0
- package/api/theme/add/add.mjs +31 -22
- package/api/theme/add/add.rollback.test.mjs +158 -0
- package/api/theme/add/add.staging.test.mjs +83 -0
- package/api/theme/add/add.test.mjs +14 -1
- package/api/theme/build/build.family.test.mjs +7 -12
- package/api/theme/build/build.mjs +140 -59
- package/api/theme/build/build.public-component-vars.test.mjs +1 -1
- package/api/theme/build/build.receipt-doc.test.mjs +111 -0
- package/api/theme/build/build.rollback.test.mjs +148 -0
- package/api/theme/build/build.test.mjs +127 -0
- package/api/theme/build/font-warning.mjs +3 -3
- package/api/theme/build/font-warning.test.mjs +5 -2
- package/api/theme/generateTonalPalette.doc.mjs +1 -0
- package/api/theme/integration-themes.test.mjs +39 -28
- package/api/theme/list/list.test.mjs +19 -20
- package/api/theme/listThemes.doc.mjs +6 -5
- package/api/theme/palette/generate/generate.mjs +8 -3
- package/api/theme/palette/generate/generate.test.mjs +96 -0
- package/api/theme/palette/generate/generator.d.mts +10 -13
- package/api/theme/palette/generate/generator.mjs +15 -4
- package/api/theme/palette/generate/generator.test.mjs +10 -0
- package/api/theme/template/template.mjs +11 -2
- package/api/theme/template/template.test.mjs +20 -0
- package/api/theme/theme.type.d.mts +170 -11
- package/api/theme/theme.type.mjs +94 -27
- package/api/theme/themeAdd.doc.mjs +4 -3
- package/api/theme/themeBuild.doc.mjs +8 -4
- package/api/theme/themeList.doc.mjs +6 -3
- package/api/theme/themeListAvailable.doc.mjs +5 -3
- package/api/theme/themePaletteGenerate.doc.mjs +1 -0
- package/api/theme/themeTargets.doc.mjs +1 -0
- package/api/theme/themeTemplate.doc.mjs +6 -2
- package/api/upgrade/_adapter.d.mts +32 -5
- package/api/upgrade/_adapter.mjs +124 -73
- package/api/upgrade/list/list.mjs +2 -1
- package/api/upgrade/list/list.test.mjs +73 -0
- package/api/upgrade/provider-agreement.test.mjs +152 -0
- package/api/upgrade/run/run.mjs +356 -59
- package/api/upgrade/status/status.mjs +2 -2
- package/api/upgrade/upgrade.doc.mjs +8 -2
- package/api/upgrade/upgrade.type.d.mts +42 -4
- package/api/upgrade/upgrade.type.mjs +26 -10
- package/assets/codemods/__tests__/runner.test.mjs +330 -8
- package/assets/codemods/integration-discovery.mjs +48 -4
- package/assets/codemods/integration-discovery.test.mjs +73 -0
- package/assets/codemods/integration-runner.mjs +56 -4
- package/assets/codemods/integration-runner.protection.test.mjs +153 -0
- package/assets/codemods/run-codemod.mjs +177 -34
- package/assets/codemods/runner.mjs +350 -102
- package/assets/codemods/term-log.mjs +32 -8
- package/assets/codemods/term-log.test.mjs +19 -1
- package/assets/codemods/transform-prop.mjs +109 -0
- package/assets/codemods/transform-prop.test.mjs +95 -0
- package/assets/codemods/transforms/next/__tests__/migrate-native-picker-to-presentation.test.mjs +63 -0
- package/assets/codemods/transforms/next/__tests__/migrate-theme-catalog-to-descriptors.test.mjs +220 -0
- package/assets/codemods/transforms/next/index.mjs +19 -1
- package/assets/codemods/transforms/next/migrate-native-picker-to-presentation.mjs +148 -0
- package/assets/codemods/transforms/next/migrate-theme-catalog-to-descriptors.mjs +141 -0
- package/assets/codemods/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +86 -165
- package/assets/codemods/transforms/v0.0.14/rename-status-variants.mjs +72 -210
- package/assets/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +83 -115
- package/assets/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +57 -186
- package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +27 -5
- package/assets/codemods/transforms/v0.3.0/unwrap-authoring-factories.mjs +20 -5
- package/assets/codemods/transforms/v0.6.0/__tests__/next-codemods.test.mjs +47 -0
- package/assets/codemods/transforms/v0.6.0/rename-resizable-pixel-bounds.mjs +57 -10
- package/assets/docs/getting-started.doc.mjs +2 -2
- package/assets/docs/internationalization.doc.mjs +7 -5
- package/assets/docs/layout.doc.dense.mjs +2 -2
- package/assets/docs/layout.doc.mjs +1 -1
- package/assets/docs/principles.doc.mjs +6 -6
- package/assets/docs/styling-libraries.doc.mjs +4 -4
- package/assets/docs/styling.doc.mjs +4 -4
- package/assets/docs/theme.doc.mjs +5 -5
- package/assets/docs/tokens.doc.mjs +1 -1
- package/assets/docs/tree/api.doc.mjs +30 -0
- package/assets/docs/tree/cli.doc.mjs +23 -0
- package/assets/docs/tree/commands.doc.mjs +25 -0
- package/assets/docs/{cli-integrations.doc.mjs → tree/integrations.doc.mjs} +95 -39
- package/assets/docs/tree/integrations.test.mjs +62 -0
- package/assets/docs/tree/writing-docs.doc.mjs +286 -0
- package/assets/docs/working-with-ai.doc.mjs +4 -4
- package/assets/templates/blocks/components/CheckboxList/CheckboxListSelectAllPattern.doc.mjs +1 -1
- package/assets/templates/blocks/components/CheckboxList/CheckboxListSelectAllPattern.tsx +1 -3
- package/assets/templates/blocks/components/DateInput/DateInputDateRange.tsx +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +14 -0
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +100 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.tsx +61 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.tsx +126 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.tsx +86 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.tsx +99 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.tsx +122 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.tsx +95 -0
- package/assets/templates/blocks/components/Table/TableBulkActionsTable.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +71 -0
- package/assets/templates/blocks/components/Table/TableFloatingBulkActionsTable.doc.mjs +19 -0
- package/assets/templates/blocks/components/Table/TableFloatingBulkActionsTable.tsx +139 -0
- package/assets/templates/blocks/components/TimeInput/TimeInputConstrained.tsx +1 -0
- package/assets/templates/pages/table-tree/page.tsx +1704 -0
- package/assets/templates/pages/table-tree/template.doc.mjs +12 -0
- package/assets/templates/themes/butter/butterTheme.doc.mjs +11 -0
- package/assets/templates/themes/chocolate/chocolateTheme.doc.mjs +11 -0
- package/assets/templates/themes/gothic/gothicTheme.doc.mjs +11 -0
- package/assets/templates/themes/matcha/matchaTheme.doc.mjs +11 -0
- package/assets/templates/themes/neutral/neutralTheme.doc.mjs +11 -0
- package/assets/templates/themes/stone/stoneTheme.doc.mjs +11 -0
- package/assets/templates/themes/y2k/y2kTheme.doc.mjs +11 -0
- package/authoring/_shared/contract.ts +22 -0
- package/authoring/codemod/codemod.doc.mjs +7 -2
- package/authoring/codemod/parse.d.mts +8 -8
- package/authoring/codemod/parse.mjs +8 -6
- package/authoring/codemod/type.ts +12 -0
- package/authoring/config/config.doc.mjs +10 -2
- package/authoring/config/debug-composition.test.mjs +92 -0
- package/authoring/config/parse.d.mts +15 -13
- package/authoring/config/parse.mjs +27 -8
- package/authoring/config/parse.test.mjs +8 -0
- package/authoring/config/type.ts +29 -6
- package/authoring/debug/debug.doc.d.mts +11 -0
- package/authoring/debug/debug.doc.mjs +182 -0
- package/authoring/debug/parse.d.mts +7 -7
- package/authoring/debug/parse.mjs +3 -3
- package/authoring/discover/discover.doc.d.mts +13 -0
- package/authoring/discover/discover.doc.mjs +138 -0
- package/authoring/discover/parse.d.mts +24 -0
- package/authoring/discover/parse.mjs +128 -0
- package/authoring/discover/parse.test.mjs +124 -0
- package/authoring/discover/type.ts +87 -0
- package/authoring/doctypes/_schema.d.mts +240 -128
- package/authoring/doctypes/_schema.mjs +198 -16
- package/authoring/doctypes/base/graph-fields.doc.mjs +15 -6
- package/authoring/doctypes/base/type.ts +9 -4
- package/authoring/doctypes/command/command.doc.mjs +4 -3
- package/authoring/doctypes/command/parse.d.mts +2 -2
- package/authoring/doctypes/command/parse.mjs +1 -1
- package/authoring/doctypes/command/type.ts +4 -4
- package/authoring/doctypes/component/component.doc.mjs +5 -2
- package/authoring/doctypes/component/parse.d.mts +2 -2
- package/authoring/doctypes/component/parse.mjs +1 -1
- package/authoring/doctypes/component/type.ts +3 -3
- package/authoring/doctypes/doctypes-new.test.mjs +48 -6
- package/authoring/doctypes/enum/enum.doc.mjs +1 -1
- package/authoring/doctypes/enum/parse.d.mts +2 -2
- package/authoring/doctypes/enum/parse.mjs +1 -1
- package/authoring/doctypes/enum/type.ts +2 -2
- package/authoring/doctypes/function/function.doc.mjs +7 -2
- package/authoring/doctypes/function/parse.d.mts +2 -2
- package/authoring/doctypes/function/parse.mjs +1 -1
- package/authoring/doctypes/function/type.ts +4 -3
- package/authoring/doctypes/hook/hook.doc.mjs +4 -0
- package/authoring/doctypes/hook/parse.d.mts +2 -2
- package/authoring/doctypes/hook/parse.mjs +1 -1
- package/authoring/doctypes/hook/type.ts +3 -3
- package/authoring/doctypes/legacy.d.mts +6 -6
- package/authoring/doctypes/legacy.mjs +3 -3
- package/authoring/doctypes/load-contract.test.mjs +233 -0
- package/authoring/doctypes/namespace/namespace.doc.mjs +9 -9
- package/authoring/doctypes/namespace/parse.d.mts +2 -2
- package/authoring/doctypes/namespace/parse.mjs +1 -1
- package/authoring/doctypes/namespace/parse.test.mjs +23 -25
- package/authoring/doctypes/namespace/type.ts +6 -3
- package/authoring/doctypes/parse.d.mts +22 -20
- package/authoring/doctypes/parse.mjs +19 -14
- package/authoring/doctypes/reference/parse.d.mts +2 -2
- package/authoring/doctypes/reference/parse.mjs +1 -1
- package/authoring/doctypes/reference/reference.doc.mjs +39 -6
- package/authoring/doctypes/reference/type.ts +31 -14
- package/authoring/doctypes/schema/parse.d.mts +2 -2
- package/authoring/doctypes/schema/parse.mjs +1 -1
- package/authoring/doctypes/schema/schema.doc.mjs +1 -1
- package/authoring/doctypes/schema/type.ts +3 -4
- package/authoring/doctypes/template/parse.d.mts +94 -1
- package/authoring/doctypes/template/parse.mjs +37 -1
- package/authoring/doctypes/template/parse.test.mjs +18 -0
- package/authoring/doctypes/template/template.doc.mjs +13 -3
- package/authoring/doctypes/template/type.ts +12 -1
- package/authoring/doctypes/theme/parse.d.mts +35 -0
- package/authoring/doctypes/theme/parse.mjs +76 -0
- package/authoring/doctypes/theme/theme.doc.d.mts +9 -0
- package/authoring/doctypes/theme/theme.doc.mjs +79 -0
- package/authoring/doctypes/theme/type.ts +42 -0
- package/authoring/doctypes/types.ts +12 -11
- package/authoring/gap-report/gap-report.doc.d.mts +12 -0
- package/authoring/gap-report/gap-report.doc.mjs +183 -0
- package/authoring/gap-report/parse.d.mts +9 -9
- package/authoring/gap-report/parse.mjs +6 -6
- package/authoring/gap-report/type.ts +1 -1
- package/authoring/identity/identity.doc.mjs +3 -2
- package/authoring/identity/type.ts +10 -10
- package/authoring/index.d.mts +2 -0
- package/authoring/index.d.ts +32 -19
- package/authoring/index.mjs +3 -1
- package/authoring/integration/integration.doc.mjs +2 -2
- package/authoring/integration/parse.d.mts +2 -2
- package/authoring/integration/parse.mjs +1 -1
- package/authoring/integration/schema.d.mts +4 -4
- package/authoring/integration/schema.mjs +3 -3
- package/authoring/integration/type.ts +5 -11
- package/clients/cli/__tests__/cliManifest.test.ts +27 -29
- package/clients/cli/command-load-failure.test.mjs +83 -0
- package/clients/cli/commands/blog.doc.mjs +1 -1
- package/clients/cli/commands/blog.mjs +23 -8
- package/clients/cli/commands/blog.test.mjs +42 -1
- package/clients/cli/commands/build-theme.adaptations.test.mjs +100 -1
- package/clients/cli/commands/build-theme.ascii-output.test.mjs +161 -0
- package/clients/cli/commands/build-theme.flag-docs.test.mjs +110 -0
- package/clients/cli/commands/build-theme.mjs +16 -50
- package/clients/cli/commands/build-theme.path-safety.test.mjs +86 -1
- package/clients/cli/commands/build-theme.variants.test.mjs +76 -0
- package/clients/cli/commands/build.doc.mjs +16 -8
- package/clients/cli/commands/build.exit-codes-doc.test.mjs +50 -0
- package/clients/cli/commands/build.mjs +137 -114
- package/clients/cli/commands/build.playbook.test.mjs +75 -0
- package/clients/cli/commands/build.text-fields.test.mjs +81 -0
- package/clients/cli/commands/component/index.mjs +3 -8
- package/clients/cli/commands/component-ownership.test.mjs +3 -3
- package/clients/cli/commands/component-package.test.mjs +46 -0
- package/clients/cli/commands/component-resolution.test.mjs +21 -0
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/component.test.mjs +19 -0
- package/clients/cli/commands/detail-levels.test.mjs +2 -2
- package/clients/cli/commands/discover.broken-integration.test.mjs +52 -5
- package/clients/cli/commands/discover.components-flag.test.mjs +97 -0
- package/clients/cli/commands/discover.doc.mjs +55 -9
- package/clients/cli/commands/discover.mjs +393 -118
- package/clients/cli/commands/discover.sources.test.mjs +267 -0
- package/clients/cli/commands/discover.text-projection.test.mjs +103 -0
- package/clients/cli/commands/docs.doc.mjs +21 -9
- package/clients/cli/commands/docs.mjs +184 -70
- package/clients/cli/commands/docs.test.mjs +120 -16
- package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +3 -3
- package/clients/cli/commands/doctor-integration-templates.doc.mjs +15 -8
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration.package-json.test.mjs +53 -0
- package/clients/cli/commands/doctor-integration.test.mjs +90 -8
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.mjs +59 -32
- package/clients/cli/commands/doctor.test.mjs +42 -0
- package/clients/cli/commands/gap-report.doc.mjs +17 -6
- package/clients/cli/commands/gap-report.test.mjs +72 -0
- package/clients/cli/commands/hook/index.mjs +7 -17
- package/clients/cli/commands/hook.doc.mjs +1 -1
- package/clients/cli/commands/hook.text-projection.test.mjs +45 -0
- package/clients/cli/commands/init.doc.mjs +20 -9
- package/clients/cli/commands/init.flag-help.test.mjs +153 -0
- package/clients/cli/commands/integration-add.controls.test.mjs +132 -0
- package/clients/cli/commands/integration-add.doc.mjs +32 -6
- package/clients/cli/commands/integration-authoring.test.mjs +13 -9
- package/clients/cli/commands/integration-pack.doc.mjs +1 -1
- package/clients/cli/commands/integration-real-world.test.mjs +3 -9
- package/clients/cli/commands/integration.doc.mjs +1 -1
- package/clients/cli/commands/integration.mjs +1 -0
- package/clients/cli/commands/interactive-guard.test.mjs +101 -24
- package/clients/cli/commands/json-contract.test.mjs +33 -0
- package/clients/cli/commands/layout-check.doc.mjs +15 -4
- package/clients/cli/commands/layout-expand.doc.mjs +22 -5
- package/clients/cli/commands/layout-grammar.doc.mjs +1 -1
- package/clients/cli/commands/layout.doc.mjs +3 -3
- package/clients/cli/commands/layout.mjs +21 -9
- 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/no-prompt-wording.test.mjs +94 -0
- package/clients/cli/commands/search.doc.mjs +7 -4
- package/clients/cli/commands/search.mjs +28 -9
- package/clients/cli/commands/search.test.mjs +75 -0
- package/clients/cli/commands/setup-nudge.test.mjs +6 -0
- package/clients/cli/commands/swizzle.doc.mjs +3 -2
- package/clients/cli/commands/swizzle.path-safety.test.mjs +42 -0
- package/clients/cli/commands/template.doc.mjs +52 -13
- package/clients/cli/commands/template.flag-help.test.mjs +117 -0
- package/clients/cli/commands/template.mjs +4 -91
- package/clients/cli/commands/template.path-help.test.mjs +40 -0
- package/clients/cli/commands/text-json-parity.test.mjs +719 -0
- package/clients/cli/commands/theme-add.doc.mjs +4 -3
- package/clients/cli/commands/theme-build.doc.mjs +8 -7
- package/clients/cli/commands/theme-list.doc.mjs +2 -2
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -3
- package/clients/cli/commands/theme-palette-generate.test.mjs +19 -0
- package/clients/cli/commands/theme-palette.doc.mjs +1 -1
- package/clients/cli/commands/theme-targets.behavior.test.mjs +4 -3
- package/clients/cli/commands/theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/theme-template.behavior.test.mjs +12 -0
- package/clients/cli/commands/theme-template.doc.mjs +2 -2
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/upgrade.ascii-output.test.mjs +87 -0
- package/clients/cli/commands/upgrade.doc.mjs +20 -8
- package/clients/cli/commands/upgrade.file-protection.test.mjs +228 -0
- package/clients/cli/commands/upgrade.flag-help.test.mjs +188 -0
- package/clients/cli/commands/upgrade.hook-output.test.mjs +88 -0
- package/clients/cli/commands/upgrade.mjs +29 -7
- package/clients/cli/formatters/index.mjs +2 -0
- package/clients/cli/formatters/index.test.mjs +6 -0
- package/clients/cli/index.mjs +21 -30
- package/clients/cli/latest-version-env.test.mjs +50 -0
- package/clients/cli/lib/cli-error.test.mjs +7 -0
- package/clients/cli/lib/component-format.mjs +9 -9
- package/clients/cli/lib/component-format.test.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +32 -6
- package/clients/cli/lib/doc-text-ascii.test.mjs +82 -0
- package/clients/cli/lib/exit-codes.test.mjs +97 -0
- package/clients/cli/lib/hook-format.mjs +19 -10
- package/clients/cli/lib/json-shim.mjs +38 -2
- package/clients/cli/lib/json-shim.test.mjs +83 -0
- package/clients/cli/lib/manifest.d.ts +2 -0
- package/clients/cli/lib/manifest.mjs +32 -2
- package/clients/cli/lib/manifest.test.mjs +17 -0
- package/foundation/agent-docs/agent-docs.d.mts +7 -2
- package/foundation/agent-docs/agent-docs.mjs +82 -12
- package/foundation/agent-docs/agent-docs.path-safety.test.mjs +266 -4
- package/foundation/agent-docs/agent-docs.test.mjs +19 -1
- package/foundation/config/integration-debug.test.mjs +28 -3
- package/foundation/config/project-themes.test.mjs +11 -19
- package/foundation/config/project.d.mts +20 -11
- package/foundation/config/project.mjs +246 -89
- package/foundation/config/project.test.mjs +270 -21
- package/foundation/discovery/authoring-self-docs.d.mts +18 -0
- package/foundation/discovery/authoring-self-docs.mjs +38 -15
- package/foundation/discovery/authoring-self-docs.test.mjs +87 -12
- package/foundation/discovery/authoring-surface.d.mts +74 -0
- package/foundation/discovery/authoring-surface.mjs +525 -0
- package/foundation/discovery/authoring-surface.test.mjs +392 -0
- package/foundation/discovery/cli-self-docs.d.mts +119 -0
- package/foundation/discovery/cli-self-docs.mjs +490 -0
- package/foundation/discovery/cli-self-docs.test.mjs +375 -0
- package/foundation/discovery/component-discovery.d.mts +38 -0
- package/foundation/discovery/component-discovery.mjs +48 -0
- package/foundation/discovery/component-loader.d.mts +35 -38
- package/foundation/discovery/component-loader.mjs +53 -222
- package/foundation/discovery/docs-discovery.d.mts +114 -9
- package/foundation/discovery/docs-discovery.mjs +239 -30
- package/foundation/discovery/docs-discovery.test.mjs +150 -35
- package/foundation/discovery/docs-output-budget.d.mts +2 -2
- package/foundation/discovery/docs-output-budget.mjs +1 -1
- package/foundation/discovery/docs-section-key.d.mts +28 -10
- package/foundation/discovery/docs-section-key.mjs +134 -33
- package/foundation/discovery/docs-section-key.test.mjs +41 -19
- package/foundation/discovery/template-adapter.d.mts +113 -11
- package/foundation/discovery/template-adapter.fixture-refs.test.mjs +248 -0
- package/foundation/discovery/template-adapter.integration-isolation.test.mjs +94 -0
- package/foundation/discovery/template-adapter.mjs +772 -82
- package/foundation/discovery/template-adapter.test.mjs +57 -0
- package/foundation/discovery/template-conflict-release.d.mts +13 -0
- package/foundation/discovery/template-conflict-release.mjs +40 -0
- package/foundation/discovery/template-conflict-release.test.mjs +40 -0
- package/foundation/discovery/theme-discovery.d.mts +67 -7
- package/foundation/discovery/theme-discovery.mjs +916 -186
- package/foundation/discovery/theme-discovery.test.mjs +613 -219
- package/foundation/discovery/theming-targets.test.mjs +4 -0
- package/foundation/doc-compiler/bundle.d.mts +47 -0
- package/foundation/doc-compiler/bundle.mjs +278 -0
- package/foundation/doc-compiler/bundle.test.mjs +266 -0
- package/foundation/doc-compiler/compile.d.mts +343 -0
- package/foundation/doc-compiler/compile.mjs +558 -0
- package/foundation/doc-compiler/diagnostics.d.mts +126 -0
- package/foundation/doc-compiler/diagnostics.mjs +305 -0
- package/foundation/doc-compiler/doc-compiler.test.mjs +714 -0
- package/foundation/doc-compiler/doc-loads.test.mjs +1642 -0
- package/foundation/doc-compiler/import.d.mts +24 -0
- package/foundation/doc-compiler/import.mjs +59 -0
- package/foundation/doc-compiler/inputs.d.mts +102 -0
- package/foundation/doc-compiler/inputs.mjs +291 -0
- package/foundation/doc-compiler/inputs.test.mjs +299 -0
- package/foundation/doc-compiler/ir.d.mts +22 -0
- package/foundation/doc-compiler/ir.mjs +471 -0
- package/foundation/doc-compiler/lenses.d.mts +36 -0
- package/foundation/doc-compiler/lenses.mjs +173 -0
- package/foundation/doc-compiler/links.d.mts +162 -0
- package/foundation/doc-compiler/links.mjs +294 -0
- package/foundation/doc-compiler/links.test.mjs +192 -0
- package/foundation/doc-compiler/lower-doc.test.mjs +495 -0
- package/foundation/doc-compiler/overlays.d.mts +37 -0
- package/foundation/doc-compiler/overlays.mjs +206 -0
- package/foundation/doc-compiler/parse-readable.d.mts +9 -0
- package/foundation/doc-compiler/parse-readable.mjs +29 -0
- package/foundation/doc-compiler/read.d.mts +127 -0
- package/foundation/doc-compiler/read.mjs +325 -0
- package/foundation/doc-compiler/read.test.mjs +313 -0
- package/foundation/doc-compiler/source.d.mts +33 -0
- package/foundation/doc-compiler/source.mjs +128 -0
- package/foundation/doc-compiler/tree.d.mts +288 -0
- package/foundation/doc-compiler/tree.mjs +876 -0
- package/foundation/doc-compiler/tree.test.mjs +598 -0
- package/foundation/fs/file-protection.d.mts +33 -0
- package/foundation/fs/file-protection.mjs +825 -0
- package/foundation/fs/file-protection.test.mjs +250 -0
- package/foundation/fs/module-loader.d.mts +1 -0
- package/foundation/fs/module-loader.mjs +50 -1
- package/foundation/fs/module-loader.stdout.test.mjs +332 -0
- package/foundation/fs/path-safety.d.mts +3 -2
- package/foundation/fs/path-safety.mjs +49 -19
- package/foundation/fs/path-safety.test.mjs +50 -0
- package/foundation/fs/publish-file-hardlink-unavailable.test.mjs +129 -94
- package/foundation/integrations/autolink.d.mts +58 -1
- package/foundation/integrations/autolink.mjs +143 -52
- package/foundation/integrations/autolink.test.mjs +1 -1
- package/foundation/integrations/cli-requirement.d.mts +45 -0
- package/foundation/integrations/cli-requirement.mjs +154 -0
- package/foundation/integrations/cli-requirement.test.mjs +84 -0
- package/foundation/integrations/contribution-fixes.d.mts +145 -0
- package/foundation/integrations/contribution-fixes.mjs +1284 -0
- package/foundation/integrations/contribution-inventory.d.mts +3 -2
- package/foundation/integrations/contribution-inventory.mjs +27 -24
- package/foundation/integrations/contribution-inventory.test.mjs +86 -27
- package/foundation/integrations/integration-warnings.d.mts +9 -2
- package/foundation/integrations/integration-warnings.mjs +51 -26
- package/foundation/integrations/integration-warnings.test.mjs +74 -1
- package/foundation/integrations/integrations.d.mts +17 -1
- package/foundation/integrations/integrations.mjs +52 -98
- package/foundation/integrations/integrations.test.mjs +31 -0
- package/foundation/integrations/provider-ledger.test.mjs +275 -0
- package/foundation/integrations/provider-resolution.d.mts +152 -0
- package/foundation/integrations/provider-resolution.mjs +576 -0
- package/foundation/integrations/provider-resolution.test.mjs +369 -0
- package/foundation/integrations/theme-descriptor.d.mts +8 -0
- package/foundation/integrations/theme-descriptor.mjs +44 -0
- package/foundation/integrations/validate-contributions.mjs +121 -29
- package/foundation/response/base.d.ts +8 -4
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.d.ts +2 -0
- package/foundation/response/error-codes.doc.mjs +13 -4
- package/foundation/response/error-codes.mjs +8 -2
- package/foundation/response/error-codes.test.mjs +137 -10
- package/foundation/response/json-contract.test.mjs +11 -0
- package/foundation/response/json.d.mts +4 -2
- package/foundation/response/json.mjs +8 -10
- package/foundation/response/response-types.doc.d.mts +5 -1
- package/foundation/response/response-types.doc.mjs +37 -22
- package/foundation/response/response-types.doc.test.mjs +158 -0
- package/foundation/response/response.doc.mjs +1 -1
- package/foundation/text/string-utils.d.mts +8 -0
- package/foundation/text/string-utils.mjs +40 -10
- package/foundation/xle/expand.d.mts +2 -0
- package/foundation/xle/expand.mjs +4 -3
- package/foundation/xle/expand.test.mjs +54 -0
- package/foundation/xle/xle.test.mjs +13 -0
- package/package.json +10 -11
- package/assets/templates/themes/manifest.json +0 -95
- package/clients/cli/lib/update-check.mjs +0 -83
- package/clients/cli/lib/update-check.test.mjs +0 -137
- package/clients/cli/update-hint-commands.test.mjs +0 -54
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in authoring/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
-
/** @typedef {import('./types').ComponentDoc} ComponentDoc */
|
|
5
|
-
/** @typedef {import('./types').HookDoc} HookDoc */
|
|
6
|
-
/** @typedef {import('./types').FunctionDoc} FunctionDoc */
|
|
7
|
-
/** @typedef {import('./types').ReferenceDoc} ReferenceDoc */
|
|
8
|
-
/** @typedef {import('./types').TemplateDoc} TemplateDoc */
|
|
9
|
-
/** @typedef {import('./types').SchemaDoc} SchemaDoc */
|
|
10
|
-
/** @typedef {import('./types').CommandDoc} CommandDoc */
|
|
11
|
-
/** @typedef {import('./types').EnumDoc} EnumDoc */
|
|
12
|
-
/** @typedef {import('./types').NamespaceDoc} NamespaceDoc */
|
|
4
|
+
/** @typedef {import('./types.js').ComponentDoc} ComponentDoc */
|
|
5
|
+
/** @typedef {import('./types.js').HookDoc} HookDoc */
|
|
6
|
+
/** @typedef {import('./types.js').FunctionDoc} FunctionDoc */
|
|
7
|
+
/** @typedef {import('./types.js').ReferenceDoc} ReferenceDoc */
|
|
8
|
+
/** @typedef {import('./types.js').TemplateDoc} TemplateDoc */
|
|
9
|
+
/** @typedef {import('./types.js').SchemaDoc} SchemaDoc */
|
|
10
|
+
/** @typedef {import('./types.js').CommandDoc} CommandDoc */
|
|
11
|
+
/** @typedef {import('./types.js').EnumDoc} EnumDoc */
|
|
12
|
+
/** @typedef {import('./types.js').NamespaceDoc} NamespaceDoc */
|
|
13
|
+
/** @typedef {import('./types.js').ThemeDoc} ThemeDoc */
|
|
13
14
|
/**
|
|
14
15
|
* Validate an unknown loaded doc value into its typed shape, or throw.
|
|
15
16
|
* Dispatches on the stamped `type`; unstamped docs fall back to
|
|
@@ -18,15 +19,16 @@
|
|
|
18
19
|
*
|
|
19
20
|
* @param {unknown} input
|
|
20
21
|
* @param {string} [label]
|
|
21
|
-
* @returns {ComponentDoc | HookDoc | FunctionDoc | ReferenceDoc | TemplateDoc | SchemaDoc | CommandDoc | EnumDoc | NamespaceDoc}
|
|
22
|
+
* @returns {ComponentDoc | HookDoc | FunctionDoc | ReferenceDoc | TemplateDoc | SchemaDoc | CommandDoc | EnumDoc | NamespaceDoc | ThemeDoc}
|
|
22
23
|
*/
|
|
23
|
-
export function parseDoc(input: unknown, label?: string): ComponentDoc | HookDoc | FunctionDoc | ReferenceDoc | TemplateDoc | SchemaDoc | CommandDoc | EnumDoc | NamespaceDoc;
|
|
24
|
-
export type ComponentDoc = import("./types").ComponentDoc;
|
|
25
|
-
export type HookDoc = import("./types").HookDoc;
|
|
26
|
-
export type FunctionDoc = import("./types").FunctionDoc;
|
|
27
|
-
export type ReferenceDoc = import("./types").ReferenceDoc;
|
|
28
|
-
export type TemplateDoc = import("./types").TemplateDoc;
|
|
29
|
-
export type SchemaDoc = import("./types").SchemaDoc;
|
|
30
|
-
export type CommandDoc = import("./types").CommandDoc;
|
|
31
|
-
export type EnumDoc = import("./types").EnumDoc;
|
|
32
|
-
export type NamespaceDoc = import("./types").NamespaceDoc;
|
|
24
|
+
export function parseDoc(input: unknown, label?: string): ComponentDoc | HookDoc | FunctionDoc | ReferenceDoc | TemplateDoc | SchemaDoc | CommandDoc | EnumDoc | NamespaceDoc | ThemeDoc;
|
|
25
|
+
export type ComponentDoc = import("./types.js").ComponentDoc;
|
|
26
|
+
export type HookDoc = import("./types.js").HookDoc;
|
|
27
|
+
export type FunctionDoc = import("./types.js").FunctionDoc;
|
|
28
|
+
export type ReferenceDoc = import("./types.js").ReferenceDoc;
|
|
29
|
+
export type TemplateDoc = import("./types.js").TemplateDoc;
|
|
30
|
+
export type SchemaDoc = import("./types.js").SchemaDoc;
|
|
31
|
+
export type CommandDoc = import("./types.js").CommandDoc;
|
|
32
|
+
export type EnumDoc = import("./types.js").EnumDoc;
|
|
33
|
+
export type NamespaceDoc = import("./types.js").NamespaceDoc;
|
|
34
|
+
export type ThemeDoc = import("./types.js").ThemeDoc;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @file The doc load boundary. `parseDoc` validates an unknown loaded doc value
|
|
5
5
|
* into its typed shape (or throws a readable error), dispatching on the stamped
|
|
6
6
|
* `type` and falling back to legacy shape-sniffing for unstamped docs. Its
|
|
7
|
-
* acceptance set
|
|
8
|
-
*
|
|
7
|
+
* acceptance set preserves the old permissive `ComponentDocSchema` while new
|
|
8
|
+
* stamped kinds, including `theme`, use their sealed parser.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import {parseComponent} from './component/parse.mjs';
|
|
@@ -16,17 +16,19 @@ import {parseSchema} from './schema/parse.mjs';
|
|
|
16
16
|
import {parseCommand} from './command/parse.mjs';
|
|
17
17
|
import {parseEnum} from './enum/parse.mjs';
|
|
18
18
|
import {parseNamespace} from './namespace/parse.mjs';
|
|
19
|
+
import {parseTheme} from './theme/parse.mjs';
|
|
19
20
|
import {parseLegacyDoc} from './legacy.mjs';
|
|
20
21
|
|
|
21
|
-
/** @typedef {import('./types').ComponentDoc} ComponentDoc */
|
|
22
|
-
/** @typedef {import('./types').HookDoc} HookDoc */
|
|
23
|
-
/** @typedef {import('./types').FunctionDoc} FunctionDoc */
|
|
24
|
-
/** @typedef {import('./types').ReferenceDoc} ReferenceDoc */
|
|
25
|
-
/** @typedef {import('./types').TemplateDoc} TemplateDoc */
|
|
26
|
-
/** @typedef {import('./types').SchemaDoc} SchemaDoc */
|
|
27
|
-
/** @typedef {import('./types').CommandDoc} CommandDoc */
|
|
28
|
-
/** @typedef {import('./types').EnumDoc} EnumDoc */
|
|
29
|
-
/** @typedef {import('./types').NamespaceDoc} NamespaceDoc */
|
|
22
|
+
/** @typedef {import('./types.js').ComponentDoc} ComponentDoc */
|
|
23
|
+
/** @typedef {import('./types.js').HookDoc} HookDoc */
|
|
24
|
+
/** @typedef {import('./types.js').FunctionDoc} FunctionDoc */
|
|
25
|
+
/** @typedef {import('./types.js').ReferenceDoc} ReferenceDoc */
|
|
26
|
+
/** @typedef {import('./types.js').TemplateDoc} TemplateDoc */
|
|
27
|
+
/** @typedef {import('./types.js').SchemaDoc} SchemaDoc */
|
|
28
|
+
/** @typedef {import('./types.js').CommandDoc} CommandDoc */
|
|
29
|
+
/** @typedef {import('./types.js').EnumDoc} EnumDoc */
|
|
30
|
+
/** @typedef {import('./types.js').NamespaceDoc} NamespaceDoc */
|
|
31
|
+
/** @typedef {import('./types.js').ThemeDoc} ThemeDoc */
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
34
|
* Validate an unknown loaded doc value into its typed shape, or throw.
|
|
@@ -36,7 +38,7 @@ import {parseLegacyDoc} from './legacy.mjs';
|
|
|
36
38
|
*
|
|
37
39
|
* @param {unknown} input
|
|
38
40
|
* @param {string} [label]
|
|
39
|
-
* @returns {ComponentDoc | HookDoc | FunctionDoc | ReferenceDoc | TemplateDoc | SchemaDoc | CommandDoc | EnumDoc | NamespaceDoc}
|
|
41
|
+
* @returns {ComponentDoc | HookDoc | FunctionDoc | ReferenceDoc | TemplateDoc | SchemaDoc | CommandDoc | EnumDoc | NamespaceDoc | ThemeDoc}
|
|
40
42
|
*/
|
|
41
43
|
export function parseDoc(input, label = 'doc') {
|
|
42
44
|
const type =
|
|
@@ -62,9 +64,12 @@ export function parseDoc(input, label = 'doc') {
|
|
|
62
64
|
return parseEnum(input, label);
|
|
63
65
|
case 'namespace':
|
|
64
66
|
return parseNamespace(input, label);
|
|
67
|
+
case 'theme':
|
|
68
|
+
return parseTheme(input, label);
|
|
65
69
|
case undefined:
|
|
66
|
-
return parseLegacyDoc(input, label);
|
|
67
70
|
default:
|
|
68
|
-
|
|
71
|
+
// 0.6.x shape-sniffed unknown stamps. Keep accepting them through the
|
|
72
|
+
// patch compatibility window; canonical writers emit a known stamp.
|
|
73
|
+
return parseLegacyDoc(input, label);
|
|
69
74
|
}
|
|
70
75
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in authoring/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
-
/** @typedef {import('../types').ReferenceDoc} ReferenceDoc */
|
|
4
|
+
/** @typedef {import('../types.js').ReferenceDoc} ReferenceDoc */
|
|
5
5
|
/**
|
|
6
6
|
* Validate an unknown value as a stamped reference/topic doc, or throw.
|
|
7
7
|
*
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
* @returns {ReferenceDoc}
|
|
11
11
|
*/
|
|
12
12
|
export function parseReference(input: unknown, label?: string): ReferenceDoc;
|
|
13
|
-
export type ReferenceDoc = import("../types").ReferenceDoc;
|
|
13
|
+
export type ReferenceDoc = import("../types.js").ReferenceDoc;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import {GenericDocKindSchema} from '../_schema.mjs';
|
|
10
10
|
import {formatZodError} from '../../_shared/errors.mjs';
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../types').ReferenceDoc} ReferenceDoc */
|
|
12
|
+
/** @typedef {import('../types.js').ReferenceDoc} ReferenceDoc */
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Validate an unknown value as a stamped reference/topic doc, or throw.
|
|
@@ -62,7 +62,7 @@ export const doc = {
|
|
|
62
62
|
name: 'extends',
|
|
63
63
|
type: 'string',
|
|
64
64
|
description:
|
|
65
|
-
|
|
65
|
+
"Name of an existing topic this doc merges onto, section by section: a section whose title matches one in the base replaces it, a section the base does not have is appended. The topic keeps the base's title and description. For correcting or adding to a topic rather than owning it. Exclusive with `replaces`.",
|
|
66
66
|
example: "'theme'",
|
|
67
67
|
},
|
|
68
68
|
{
|
|
@@ -93,9 +93,9 @@ export const doc = {
|
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
name: 'sections[].content',
|
|
96
|
-
type: 'ReferenceContentBlock[]',
|
|
96
|
+
type: '(ReferenceContentBlock | ReferenceDocBlock)[]',
|
|
97
97
|
description:
|
|
98
|
-
|
|
98
|
+
"Ordered content blocks: prose, heading, code, table, list, token-ref, and reference. A `reference` block (`{type: 'reference', target, projection?, presentation?}`) includes another doc from its canonical source instead of a copy: a schema, command, function, or enum doc as `astryx docs` prints it, then the command that opens it. `projection.fields` keeps only those fields of a schema; `presentation` is `full` (the default), `compact` (no code blocks), or `summary` (only the doc's title, summary, and command). Any other doc shows as a summary. Graph-only workflow and collection blocks are available through GraphContentBlock on NamespaceDoc, without widening the stable ReferenceContentBlock union. Inside text, `{@link <target>}` links another doc by identity (`[<provider>:]<kind>:<name>`): the CLI prints the command that opens it, and `astryx doctor` warns on one that names no doc.",
|
|
99
99
|
required: true,
|
|
100
100
|
},
|
|
101
101
|
{
|
|
@@ -140,7 +140,31 @@ export const docs = {
|
|
|
140
140
|
notes: [
|
|
141
141
|
{
|
|
142
142
|
type: 'prose',
|
|
143
|
-
text: '
|
|
143
|
+
text: 'A stamped generic doc without `title`, `description` or `sections` still loads, as older codemod output does; its title falls back to `displayName` or `name`. Without a description and sections it is not a usable topic, and `astryx doctor` reports it.',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: 'prose',
|
|
147
|
+
text: 'Each `sections[].content` is an ordered array of ReferenceContentBlock, the stable discriminated union of prose, heading, code, table, list, and token-ref, plus the reference block (ReferenceDocBlock). A read inlines a reference block the way it inlines a token-ref, so `astryx docs`, in text and in `--json`, returns only the stable block kinds. Docs-graph-only workflow and collection blocks are exported separately as GraphContentBlock and accepted by NamespaceDoc. choice, callout, and checklist remain invalid. ReferenceContentBlock is also reused by the `notes` field on SchemaDoc and CommandDoc. Inside text, `{@link <target>}` links another doc by identity (`[<provider>:]<kind>:<name>`): the CLI prints the command that opens it, and `astryx doctor` warns on one that names no doc.',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: 'prose',
|
|
151
|
+
text: "A reference block includes content, where a link only points at it: `astryx doctor integration docs` fails when its target names no doc, when `projection.fields` names a field the schema does not have, or when the doc cannot take the projection or presentation it sets, and a read marks the missing content. A target without a provider names a doc of the package that wrote it, so an integration names the CLI's docs with the CLI's provider, as in `@astryxdesign/cli:schema:integration`.",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: 'code',
|
|
155
|
+
lang: 'js',
|
|
156
|
+
label: 'A section that includes two fields of the integration manifest',
|
|
157
|
+
code: `{
|
|
158
|
+
title: 'Point the manifest at your folders',
|
|
159
|
+
content: [
|
|
160
|
+
{type: 'prose', text: 'Add these fields to astryx.integration.mjs.'},
|
|
161
|
+
{
|
|
162
|
+
type: 'reference',
|
|
163
|
+
target: '@astryxdesign/cli:schema:integration',
|
|
164
|
+
projection: {fields: ['components', 'docs']},
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
}`,
|
|
144
168
|
},
|
|
145
169
|
{
|
|
146
170
|
type: 'code',
|
|
@@ -152,10 +176,19 @@ export const docs = {
|
|
|
152
176
|
| { type: 'code'; lang: string; code: string; label?: string }
|
|
153
177
|
| { type: 'table'; headers: string[]; rows: string[][] }
|
|
154
178
|
| { type: 'list'; style: 'ordered' | 'unordered' | 'do' | 'dont'; items: string[] }
|
|
155
|
-
| { type: 'token-ref'; topic: string; section: string }
|
|
179
|
+
| { type: 'token-ref'; topic: string; section: string };
|
|
180
|
+
|
|
181
|
+
type ReferenceDocBlock = {
|
|
182
|
+
type: 'reference';
|
|
183
|
+
target: string;
|
|
184
|
+
projection?: { fields?: string[]; sections?: string[] };
|
|
185
|
+
presentation?: 'summary' | 'compact' | 'full';
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
type GraphContentBlock =
|
|
156
189
|
| { type: 'workflow'; title?: string; steps: WorkflowStep[] }
|
|
157
190
|
| { type: 'collection'; source: {slot: string}; presentation?: 'list' | 'cards' | 'compact'; whenEmpty?: 'show' | 'omit' }
|
|
158
|
-
|
|
|
191
|
+
| ReferenceDocBlock;`,
|
|
159
192
|
},
|
|
160
193
|
{
|
|
161
194
|
type: 'prose',
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @file Reference/topic doc types.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type {AuthoredDocGraphFields} from '../base/type';
|
|
7
|
+
import type {AuthoredDocGraphFields} from '../base/type.js';
|
|
8
8
|
|
|
9
9
|
/** One step in a renderer-neutral workflow. */
|
|
10
10
|
export interface WorkflowStep {
|
|
@@ -30,19 +30,37 @@ export interface CollectionDocBlock {
|
|
|
30
30
|
whenEmpty?: 'show' | 'omit';
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* A bounded projection of one canonical doc. In a namespace doc's `blocks` it
|
|
35
|
+
* is layout the docs tree renders later. In a topic section, a read includes
|
|
36
|
+
* the doc it names in place of the block: a schema, command, function, or
|
|
37
|
+
* enum doc as `astryx docs` prints it (`projection.fields` keeps only those
|
|
38
|
+
* fields of a schema), then the command that opens that doc. Any other doc
|
|
39
|
+
* shows its title and summary.
|
|
40
|
+
*/
|
|
34
41
|
export interface ReferenceDocBlock {
|
|
35
42
|
type: 'reference';
|
|
43
|
+
/** The doc it names, by identity: `[<provider>:]<kind>:<name>`. */
|
|
36
44
|
target: string;
|
|
37
45
|
projection?: {
|
|
38
46
|
fields?: string[];
|
|
39
47
|
sections?: string[];
|
|
40
48
|
};
|
|
49
|
+
/** `summary`: only the doc's title, summary, and the command that opens it.
|
|
50
|
+
* `compact`: the included doc without its code blocks. `full`, the default:
|
|
51
|
+
* the included doc. */
|
|
41
52
|
presentation?: 'summary' | 'compact' | 'full';
|
|
42
53
|
}
|
|
43
54
|
|
|
55
|
+
/** Graph-only content blocks, for a namespace doc's `blocks`. These are
|
|
56
|
+
* additive and do not widen the stable {@link ReferenceContentBlock} union
|
|
57
|
+
* consumed by existing exhaustive renderers. A topic section accepts the
|
|
58
|
+
* `reference` block too, and a read inlines it as stable blocks. */
|
|
59
|
+
export type GraphContentBlock =
|
|
60
|
+
WorkflowDocBlock | CollectionDocBlock | ReferenceDocBlock;
|
|
61
|
+
|
|
44
62
|
/**
|
|
45
|
-
* A content block within a reference doc section
|
|
63
|
+
* A content block within a reference doc section.
|
|
46
64
|
* Ordered arrays of these blocks form renderer-neutral documentation content.
|
|
47
65
|
* A new semantic kind must ship with every renderer or fail visibly at a legacy
|
|
48
66
|
* reader boundary until that renderer is available.
|
|
@@ -55,12 +73,12 @@ export interface ReferenceDocBlock {
|
|
|
55
73
|
* { type: 'table', headers: ['Token', 'Value'], rows: [['--spacing-4', '16px']] }
|
|
56
74
|
* { type: 'list', style: 'do', items: ['Use semantic tokens'] }
|
|
57
75
|
* { type: 'token-ref', topic: 'tokens', section: 'Color Tokens' }
|
|
58
|
-
* { type: '
|
|
59
|
-
* { type: 'collection', source: {slot: 'guides'}, presentation: 'cards' }
|
|
60
|
-
* { type: 'reference', target: 'schema:integration', projection: {fields: ['docs']} }
|
|
76
|
+
* { type: 'prose', text: 'Check it with {@link command:doctor}.' }
|
|
61
77
|
* ```
|
|
62
78
|
*/
|
|
63
79
|
export type ReferenceContentBlock =
|
|
80
|
+
/** Text. `{@link [<provider>:]<kind>:<name>}` inside it links another doc
|
|
81
|
+
* by identity; `astryx docs` prints the command that opens that doc. */
|
|
64
82
|
| {type: 'prose'; text: string}
|
|
65
83
|
| {type: 'heading'; level: 3 | 4 | 5 | 6; text: string}
|
|
66
84
|
| {type: 'code'; lang: string; code: string; label?: string}
|
|
@@ -80,10 +98,7 @@ export type ReferenceContentBlock =
|
|
|
80
98
|
topic: string;
|
|
81
99
|
/** Section title to pull from that topic. e.g. `'Color Tokens'` */
|
|
82
100
|
section: string;
|
|
83
|
-
}
|
|
84
|
-
| WorkflowDocBlock
|
|
85
|
-
| CollectionDocBlock
|
|
86
|
-
| ReferenceDocBlock;
|
|
101
|
+
};
|
|
87
102
|
|
|
88
103
|
/**
|
|
89
104
|
* A reference documentation file (.doc.mjs).
|
|
@@ -93,10 +108,10 @@ export type ReferenceContentBlock =
|
|
|
93
108
|
* they aren't tied to a specific component — just drop a .doc.mjs file
|
|
94
109
|
* in the docs/ directory and it shows up in `astryx docs`.
|
|
95
110
|
*
|
|
96
|
-
* Every reference .doc.mjs
|
|
111
|
+
* Every new reference .doc.mjs default-exports a stamped object:
|
|
97
112
|
*
|
|
98
113
|
* /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} *\/
|
|
99
|
-
* export
|
|
114
|
+
* export default { type: 'generic', ... };
|
|
100
115
|
*/
|
|
101
116
|
export interface ReferenceDoc extends AuthoredDocGraphFields {
|
|
102
117
|
/** Doc-kind discriminant for the stamped default-export format
|
|
@@ -146,8 +161,10 @@ export interface ReferenceSection {
|
|
|
146
161
|
/** Navigation category ('guide' | 'foundations'). Mirrors the parent doc's
|
|
147
162
|
* category so sections can be grouped independently in the docsite nav. */
|
|
148
163
|
category?: string;
|
|
149
|
-
/** Ordered content blocks. Mix prose, code, tables, and lists freely.
|
|
150
|
-
|
|
164
|
+
/** Ordered content blocks. Mix prose, code, tables, and lists freely. A
|
|
165
|
+
* `reference` block includes another doc from its canonical source, so a
|
|
166
|
+
* guide never copies a schema's fields or a command's options. */
|
|
167
|
+
content: (ReferenceContentBlock | ReferenceDocBlock)[];
|
|
151
168
|
/** Preview type for token tables in this section. When set, the docsite
|
|
152
169
|
* renders a visual preview column using the token's computed CSS value
|
|
153
170
|
* from the current theme. Omit for non-token sections. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in authoring/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
-
/** @typedef {import('../types').SchemaDoc} SchemaDoc */
|
|
4
|
+
/** @typedef {import('../types.js').SchemaDoc} SchemaDoc */
|
|
5
5
|
/**
|
|
6
6
|
* Validate an unknown value as a stamped schema doc, or throw.
|
|
7
7
|
*
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
* @returns {SchemaDoc}
|
|
11
11
|
*/
|
|
12
12
|
export function parseSchema(input: unknown, label?: string): SchemaDoc;
|
|
13
|
-
export type SchemaDoc = import("../types").SchemaDoc;
|
|
13
|
+
export type SchemaDoc = import("../types.js").SchemaDoc;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import {SchemaDocKindSchema} from '../_schema.mjs';
|
|
9
9
|
import {formatZodError} from '../../_shared/errors.mjs';
|
|
10
10
|
|
|
11
|
-
/** @typedef {import('../types').SchemaDoc} SchemaDoc */
|
|
11
|
+
/** @typedef {import('../types.js').SchemaDoc} SchemaDoc */
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Validate an unknown value as a stamped schema doc, or throw.
|
|
@@ -49,7 +49,7 @@ export const doc = {
|
|
|
49
49
|
name: 'namespace',
|
|
50
50
|
type: 'string',
|
|
51
51
|
description:
|
|
52
|
-
"
|
|
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',
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* response envelope). Colocated as a `.doc.mjs` next to the schema it describes.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {AuthoredDocGraphFields} from '../base/type';
|
|
10
|
-
import type {ReferenceContentBlock} from '../reference/type';
|
|
9
|
+
import type {AuthoredDocGraphFields} from '../base/type.js';
|
|
10
|
+
import type {ReferenceContentBlock} from '../reference/type.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* One documented field of a schema. Object fields nest via `fields`, so a whole
|
|
@@ -47,8 +47,7 @@ export interface SchemaDoc extends AuthoredDocGraphFields {
|
|
|
47
47
|
displayName: string;
|
|
48
48
|
/** One-line summary shown in listings. */
|
|
49
49
|
description: string;
|
|
50
|
-
/**
|
|
51
|
-
* the docs index; set explicitly to place the schema. */
|
|
50
|
+
/** 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. */
|
|
52
51
|
namespace?: string;
|
|
53
52
|
/** Alternate slugs that also resolve to this doc (back-compat). */
|
|
54
53
|
aliases?: string[];
|
|
@@ -11,4 +11,97 @@
|
|
|
11
11
|
* @returns {TemplateDoc}
|
|
12
12
|
*/
|
|
13
13
|
export function parseTemplate(input: unknown, label?: string): TemplateDoc;
|
|
14
|
-
export type TemplateDoc = import("../types").TemplateDoc;
|
|
14
|
+
export type TemplateDoc = import("../types.js").TemplateDoc;
|
|
15
|
+
export type PageTemplateDoc = import("./type.js").PageTemplateDoc;
|
|
16
|
+
export type BlockTemplateDoc = import("./type.js").BlockTemplateDoc;
|
|
17
|
+
/**
|
|
18
|
+
* Templates as they load. Integration templates already published omit
|
|
19
|
+
* `displayName` and `aspectRatio` and group themselves under their own
|
|
20
|
+
* `category`, so the loader accepts those (template discovery falls back to an
|
|
21
|
+
* aspect ratio of 1). The published types keep asking authors for all three.
|
|
22
|
+
*/
|
|
23
|
+
export type LoadedPageTemplateDoc = Omit<PageTemplateDoc, "displayName" | "category"> & {
|
|
24
|
+
displayName?: string;
|
|
25
|
+
category?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Templates as they load. Integration templates already published omit
|
|
29
|
+
* `displayName` and `aspectRatio` and group themselves under their own
|
|
30
|
+
* `category`, so the loader accepts those (template discovery falls back to an
|
|
31
|
+
* aspect ratio of 1). The published types keep asking authors for all three.
|
|
32
|
+
*/
|
|
33
|
+
export type LoadedBlockTemplateDoc = Omit<BlockTemplateDoc, "displayName" | "aspectRatio" | "category"> & {
|
|
34
|
+
displayName?: string;
|
|
35
|
+
aspectRatio?: number;
|
|
36
|
+
category?: string;
|
|
37
|
+
};
|
|
38
|
+
export type _PageTemplateDocDriftLock = import("../../_shared/contract.js").Expect<import("../../_shared/contract.js").MutuallyAssignable<import("../../_shared/contract.js").NamedFields<z.infer<typeof pageTemplateSchema>>, import("../../_shared/contract.js").NamedFields<LoadedPageTemplateDoc>>>;
|
|
39
|
+
export type _BlockTemplateDocDriftLock = import("../../_shared/contract.js").Expect<import("../../_shared/contract.js").MutuallyAssignable<import("../../_shared/contract.js").NamedFields<z.infer<typeof blockTemplateSchema>>, import("../../_shared/contract.js").NamedFields<LoadedBlockTemplateDoc>>>;
|
|
40
|
+
import { z } from 'zod';
|
|
41
|
+
declare const pageTemplateSchema: z.ZodObject<{
|
|
42
|
+
type: z.ZodLiteral<"page">;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
45
|
+
description: z.ZodOptional<z.ZodString>;
|
|
46
|
+
category: z.ZodOptional<z.ZodString>;
|
|
47
|
+
componentsUsed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
image: z.ZodOptional<z.ZodString>;
|
|
50
|
+
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
isReady: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
scaffold: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
isHiddenFromOverview: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
57
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
|
+
}, z.core.$strict>>;
|
|
59
|
+
replaces: z.ZodOptional<z.ZodString>;
|
|
60
|
+
placement: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
parent: z.ZodString;
|
|
62
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
63
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
public: "public";
|
|
68
|
+
internal: "internal";
|
|
69
|
+
}>>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
declare const blockTemplateSchema: z.ZodObject<{
|
|
72
|
+
type: z.ZodLiteral<"block">;
|
|
73
|
+
exampleFor: z.ZodOptional<z.ZodString>;
|
|
74
|
+
alsoExampleFor: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
alsoShowcaseFor: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
|
+
aspectRatio: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
isShowcase: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
81
|
+
description: z.ZodOptional<z.ZodString>;
|
|
82
|
+
category: z.ZodOptional<z.ZodString>;
|
|
83
|
+
componentsUsed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
image: z.ZodOptional<z.ZodString>;
|
|
86
|
+
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, z.core.$strict>>;
|
|
88
|
+
isReady: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
scaffold: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
isHiddenFromOverview: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
93
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
|
+
replaces: z.ZodOptional<z.ZodString>;
|
|
96
|
+
placement: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
parent: z.ZodString;
|
|
98
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
99
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
}, z.core.$strict>>;
|
|
101
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
103
|
+
public: "public";
|
|
104
|
+
internal: "internal";
|
|
105
|
+
}>>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
export {};
|
|
@@ -12,7 +12,9 @@ import {z} from 'zod';
|
|
|
12
12
|
import {AuthoredDocGraphFields} from '../_schema.mjs';
|
|
13
13
|
import {formatZodError} from '../../_shared/errors.mjs';
|
|
14
14
|
|
|
15
|
-
/** @typedef {import('../types').TemplateDoc} TemplateDoc */
|
|
15
|
+
/** @typedef {import('../types.js').TemplateDoc} TemplateDoc */
|
|
16
|
+
/** @typedef {import('./type.js').PageTemplateDoc} PageTemplateDoc */
|
|
17
|
+
/** @typedef {import('./type.js').BlockTemplateDoc} BlockTemplateDoc */
|
|
16
18
|
|
|
17
19
|
const previewSchema = z
|
|
18
20
|
.object({
|
|
@@ -49,6 +51,10 @@ const baseTemplateFields = {
|
|
|
49
51
|
scaffold: z.boolean().optional(),
|
|
50
52
|
isHiddenFromOverview: z.boolean().optional(),
|
|
51
53
|
registry: registryIdentitySchema.optional(),
|
|
54
|
+
replaces: z
|
|
55
|
+
.string()
|
|
56
|
+
.min(1, 'replaces must name a Core template id')
|
|
57
|
+
.optional(),
|
|
52
58
|
};
|
|
53
59
|
|
|
54
60
|
const pageTemplateSchema = z
|
|
@@ -67,6 +73,36 @@ const blockTemplateSchema = z
|
|
|
67
73
|
})
|
|
68
74
|
.strict();
|
|
69
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Templates as they load. Integration templates already published omit
|
|
78
|
+
* `displayName` and `aspectRatio` and group themselves under their own
|
|
79
|
+
* `category`, so the loader accepts those (template discovery falls back to an
|
|
80
|
+
* aspect ratio of 1). The published types keep asking authors for all three.
|
|
81
|
+
*
|
|
82
|
+
* @typedef {Omit<PageTemplateDoc, 'displayName' | 'category'>
|
|
83
|
+
* & {displayName?: string, category?: string}} LoadedPageTemplateDoc
|
|
84
|
+
* @typedef {Omit<BlockTemplateDoc, 'displayName' | 'aspectRatio' | 'category'>
|
|
85
|
+
* & {displayName?: string, aspectRatio?: number, category?: string}} LoadedBlockTemplateDoc
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @typedef {import('../../_shared/contract.js').Expect<
|
|
90
|
+
* import('../../_shared/contract.js').MutuallyAssignable<
|
|
91
|
+
* import('../../_shared/contract.js').NamedFields<z.infer<typeof pageTemplateSchema>>,
|
|
92
|
+
* import('../../_shared/contract.js').NamedFields<LoadedPageTemplateDoc>
|
|
93
|
+
* >
|
|
94
|
+
* >} _PageTemplateDocDriftLock
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @typedef {import('../../_shared/contract.js').Expect<
|
|
99
|
+
* import('../../_shared/contract.js').MutuallyAssignable<
|
|
100
|
+
* import('../../_shared/contract.js').NamedFields<z.infer<typeof blockTemplateSchema>>,
|
|
101
|
+
* import('../../_shared/contract.js').NamedFields<LoadedBlockTemplateDoc>
|
|
102
|
+
* >
|
|
103
|
+
* >} _BlockTemplateDocDriftLock
|
|
104
|
+
*/
|
|
105
|
+
|
|
70
106
|
const templateEnvelopeSchema = z
|
|
71
107
|
.discriminatedUnion('type', [pageTemplateSchema, blockTemplateSchema])
|
|
72
108
|
.superRefine((template, context) => {
|
|
@@ -22,6 +22,24 @@ function reason(value, label = 'template') {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
describe('parseTemplate (load boundary)', () => {
|
|
25
|
+
it('accepts replaces on page and block templates', () => {
|
|
26
|
+
for (const type of ['page', 'block']) {
|
|
27
|
+
const parsed = parseTemplate({
|
|
28
|
+
type,
|
|
29
|
+
name: 'Acme shell',
|
|
30
|
+
description: 'Replaces a Core template.',
|
|
31
|
+
replaces: 'shell-side-nav',
|
|
32
|
+
});
|
|
33
|
+
expect(parsed.replaces).toBe('shell-side-nav');
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('rejects an empty replaces', () => {
|
|
38
|
+
expect(reason({type: 'page', name: 'Acme shell', replaces: ''})).toMatch(
|
|
39
|
+
/replaces must name a Core template id/,
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
25
43
|
it('accepts a stamped page template', () => {
|
|
26
44
|
const parsed = parseTemplate({
|
|
27
45
|
type: 'page',
|
|
@@ -18,7 +18,7 @@ export const doc = {
|
|
|
18
18
|
"(type: 'page') for full page templates and BlockTemplateDoc (type: 'block') for " +
|
|
19
19
|
'editable compositions. A block can stand alone or use `exampleFor` to attach ' +
|
|
20
20
|
'to one component; `isShowcase` requires that component ownership.',
|
|
21
|
-
appliesTo: '<Name>.
|
|
21
|
+
appliesTo: '<Name>.doc.mjs',
|
|
22
22
|
fields: [
|
|
23
23
|
{
|
|
24
24
|
name: 'type',
|
|
@@ -52,6 +52,12 @@ export const doc = {
|
|
|
52
52
|
type: 'string',
|
|
53
53
|
description: 'One-sentence description of what the template provides.',
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
name: 'replaces',
|
|
57
|
+
type: 'string',
|
|
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 and withhold the package's templates and doc topics.",
|
|
60
|
+
},
|
|
55
61
|
{
|
|
56
62
|
name: 'isReady',
|
|
57
63
|
type: 'boolean',
|
|
@@ -123,7 +129,7 @@ export const doc = {
|
|
|
123
129
|
{
|
|
124
130
|
label: 'Page template',
|
|
125
131
|
code: `/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
126
|
-
export
|
|
132
|
+
export default {
|
|
127
133
|
type: 'page',
|
|
128
134
|
name: 'Dashboard',
|
|
129
135
|
displayName: 'Dashboard',
|
|
@@ -135,7 +141,7 @@ export const doc = {
|
|
|
135
141
|
{
|
|
136
142
|
label: 'Block template (component example)',
|
|
137
143
|
code: `/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
138
|
-
export
|
|
144
|
+
export default {
|
|
139
145
|
type: 'block',
|
|
140
146
|
name: 'ButtonGroupExample',
|
|
141
147
|
displayName: 'Button Group Example',
|
|
@@ -148,6 +154,10 @@ export const doc = {
|
|
|
148
154
|
},
|
|
149
155
|
],
|
|
150
156
|
notes: [
|
|
157
|
+
{
|
|
158
|
+
type: 'prose',
|
|
159
|
+
text: 'When it loads, a template may leave out `displayName` and `aspectRatio` and use its own `category`, as integration templates already published do; a block with no `aspectRatio` previews at 1. Write to the type anyway; it is the contract.',
|
|
160
|
+
},
|
|
151
161
|
{
|
|
152
162
|
type: 'prose',
|
|
153
163
|
text: "TemplateDoc is a discriminated union keyed by `type`. Set `type: 'page'` for a full page template. Set `type: 'block'` for an editable composition; add `exampleFor` only when one component owns the example.",
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* @file Template doc types.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
AuthoredDocGraphFields,
|
|
9
|
+
RegistryDocIdentity,
|
|
10
|
+
} from '../base/type.js';
|
|
8
11
|
|
|
9
12
|
export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
10
13
|
/** Identifier name for the template. For block templates this matches
|
|
@@ -25,6 +28,14 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
|
25
28
|
|
|
26
29
|
/** Optional stable slug override and prior aliases for registry output. */
|
|
27
30
|
registry?: RegistryDocIdentity;
|
|
31
|
+
|
|
32
|
+
/** Integration templates only: the exact id of the Core template this one
|
|
33
|
+
* replaces for unqualified lookup (find it with
|
|
34
|
+
* `astryx --json template --list --package @astryxdesign/core`). The Core
|
|
35
|
+
* original stays selectable with `--package @astryxdesign/core`. Needs
|
|
36
|
+
* `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field and
|
|
37
|
+
* withhold the package's templates and doc topics. */
|
|
38
|
+
replaces?: string;
|
|
28
39
|
/** Whether this template is ready for use. Templates with
|
|
29
40
|
* isReady: false show as "(WIP)" in the gallery and CLI. */
|
|
30
41
|
isReady?: boolean;
|