@astryxdesign/cli 0.6.3-canary.db4e378 → 0.6.3-canary.db52d98
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 +38 -15
- 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 +14 -7
- package/api/build/build.test.mjs +184 -6
- package/api/build/build.type.d.mts +57 -2
- package/api/build/build.type.mjs +30 -7
- package/api/build/help/help.d.mts +4 -0
- package/api/build/help/help.mjs +24 -11
- 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 +1 -0
- package/api/component/component.mjs +60 -12
- package/api/component/list/list.mjs +3 -2
- package/api/discover/discover.doc.mjs +1 -0
- package/api/docs/_adapter.d.mts +252 -34
- package/api/docs/_adapter.mjs +923 -132
- package/api/docs/detail/detail.mjs +11 -3
- package/api/docs/detail/section/section.mjs +24 -13
- package/api/docs/detail/section/section.test.mjs +15 -6
- 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 +181 -2
- package/api/docs/docs.type.mjs +117 -3
- package/api/docs/index/index.mjs +11 -3
- 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 +331 -16
- package/api/doctor/doctor.test.mjs +420 -7
- package/api/gap-report/gap-report.doc.mjs +1 -0
- package/api/hook/_adapter.mjs +19 -5
- package/api/hook/hook.doc.mjs +1 -0
- 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 +2 -1
- package/api/integration/add-contribution.d.mts +2 -1
- package/api/integration/add-contribution.mjs +114 -12
- package/api/integration/add-contribution.test.mjs +174 -3
- 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 +7 -0
- package/api/integration/integrationAddAgentDoc.doc.mjs +1 -0
- package/api/integration/integrationAddCodemod.doc.mjs +1 -0
- package/api/integration/integrationAddComponent.doc.mjs +1 -0
- 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 +34 -0
- package/api/integration/pack-check.test.mjs +138 -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 +50 -102
- package/api/integration/validate-integration.test.mjs +88 -26
- package/api/integration/validate-unread-theme-folders.test.mjs +110 -0
- package/api/integration/validateIntegration.doc.mjs +2 -1
- package/api/json/assertResponse.doc.mjs +1 -0
- package/api/json/index.ts +2 -0
- package/api/json/isError.doc.mjs +1 -0
- package/api/json/parseResponse.doc.mjs +1 -0
- package/api/layout/_adapter.mjs +20 -5
- package/api/layout/layoutCheck.doc.mjs +1 -0
- package/api/layout/layoutExpand.doc.mjs +1 -0
- package/api/layout/layoutGrammar.doc.mjs +1 -0
- package/api/search/search.d.mts +59 -1
- package/api/search/search.doc.mjs +5 -3
- package/api/search/search.mjs +458 -77
- package/api/search/search.test.mjs +91 -2
- package/api/search/search.type.d.mts +13 -1
- package/api/search/search.type.mjs +4 -1
- package/api/swizzle/swizzle.doc.mjs +1 -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 +28 -7
- package/api/template/template.mjs +45 -8
- package/api/template/template.type.d.mts +6 -8
- package/api/template/template.type.mjs +3 -2
- package/api/theme/_adapter.d.mts +2 -3
- package/api/theme/_adapter.mjs +4 -5
- package/api/theme/add/add.binary.test.mjs +10 -17
- package/api/theme/add/add.test.mjs +14 -1
- 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/template/template.test.mjs +5 -0
- package/api/theme/themeAdd.doc.mjs +4 -3
- package/api/theme/themeBuild.doc.mjs +1 -0
- 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 +2 -1
- package/api/upgrade/_adapter.d.mts +32 -5
- package/api/upgrade/_adapter.mjs +97 -69
- package/api/upgrade/provider-agreement.test.mjs +152 -0
- package/api/upgrade/run/run.mjs +356 -59
- package/api/upgrade/upgrade.doc.mjs +6 -1
- package/api/upgrade/upgrade.type.d.mts +34 -0
- package/api/upgrade/upgrade.type.mjs +15 -0
- package/assets/codemods/__tests__/runner.test.mjs +330 -8
- package/assets/codemods/integration-discovery.mjs +8 -2
- package/assets/codemods/integration-discovery.test.mjs +15 -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/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/docs/getting-started.doc.mjs +2 -2
- 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 +3 -3
- 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} +66 -38
- 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 +3 -3
- 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/Item/ItemDocumentTabs.doc.mjs +14 -0
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +100 -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/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/codemod/codemod.doc.mjs +1 -1
- package/authoring/codemod/type.ts +12 -0
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/debug/debug.doc.d.mts +11 -0
- package/authoring/debug/debug.doc.mjs +182 -0
- package/authoring/debug/parse.d.mts +3 -3
- package/authoring/doctypes/_schema.d.mts +119 -117
- package/authoring/doctypes/_schema.mjs +54 -3
- package/authoring/doctypes/base/graph-fields.doc.mjs +8 -6
- package/authoring/doctypes/base/type.ts +6 -5
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/command/type.ts +2 -2
- package/authoring/doctypes/component/type.ts +2 -2
- package/authoring/doctypes/doctypes-new.test.mjs +48 -6
- package/authoring/doctypes/enum/enum.doc.mjs +1 -1
- package/authoring/doctypes/enum/type.ts +1 -1
- package/authoring/doctypes/function/function.doc.mjs +3 -2
- package/authoring/doctypes/function/type.ts +3 -2
- package/authoring/doctypes/hook/type.ts +2 -2
- package/authoring/doctypes/load-contract.test.mjs +28 -2
- package/authoring/doctypes/namespace/namespace.doc.mjs +6 -10
- package/authoring/doctypes/namespace/parse.test.mjs +23 -25
- package/authoring/doctypes/namespace/type.ts +5 -2
- package/authoring/doctypes/parse.d.mts +4 -2
- package/authoring/doctypes/parse.mjs +10 -5
- package/authoring/doctypes/reference/reference.doc.mjs +35 -6
- package/authoring/doctypes/reference/type.ts +30 -13
- package/authoring/doctypes/schema/schema.doc.mjs +1 -1
- package/authoring/doctypes/schema/type.ts +1 -2
- package/authoring/doctypes/template/parse.d.mts +2 -0
- package/authoring/doctypes/template/parse.mjs +4 -0
- package/authoring/doctypes/template/parse.test.mjs +18 -0
- package/authoring/doctypes/template/template.doc.mjs +9 -3
- package/authoring/doctypes/template/type.ts +8 -0
- 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 +2 -1
- package/authoring/gap-report/gap-report.doc.d.mts +12 -0
- package/authoring/gap-report/gap-report.doc.mjs +183 -0
- package/authoring/identity/identity.doc.mjs +2 -2
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +7 -4
- package/authoring/index.mjs +2 -1
- package/authoring/integration/integration.doc.mjs +2 -2
- package/authoring/integration/type.ts +4 -10
- package/clients/cli/__tests__/cliManifest.test.ts +27 -29
- package/clients/cli/commands/blog.doc.mjs +1 -1
- package/clients/cli/commands/build-theme.adaptations.test.mjs +100 -1
- package/clients/cli/commands/build-theme.mjs +11 -45
- package/clients/cli/commands/build.doc.mjs +12 -7
- package/clients/cli/commands/build.mjs +105 -67
- package/clients/cli/commands/build.text-fields.test.mjs +41 -0
- package/clients/cli/commands/component/index.mjs +1 -1
- package/clients/cli/commands/component-ownership.test.mjs +3 -3
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/discover.broken-integration.test.mjs +7 -8
- package/clients/cli/commands/discover.doc.mjs +1 -1
- package/clients/cli/commands/discover.mjs +1 -1
- 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.test.mjs +90 -8
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.mjs +53 -16
- package/clients/cli/commands/gap-report.doc.mjs +1 -1
- package/clients/cli/commands/hook.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +1 -1
- package/clients/cli/commands/integration-add.controls.test.mjs +1 -1
- package/clients/cli/commands/integration-add.doc.mjs +11 -1
- 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/layout-check.doc.mjs +1 -1
- package/clients/cli/commands/layout-expand.doc.mjs +1 -1
- package/clients/cli/commands/layout-grammar.doc.mjs +1 -1
- package/clients/cli/commands/layout.doc.mjs +1 -1
- package/clients/cli/commands/manifest.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +1 -1
- package/clients/cli/commands/search.mjs +11 -2
- package/clients/cli/commands/setup-nudge.test.mjs +6 -0
- package/clients/cli/commands/swizzle.doc.mjs +1 -1
- package/clients/cli/commands/template.doc.mjs +24 -7
- package/clients/cli/commands/template.mjs +4 -91
- package/clients/cli/commands/text-json-parity.test.mjs +719 -0
- package/clients/cli/commands/theme-add.doc.mjs +2 -2
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- 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.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.doc.mjs +1 -1
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/upgrade.doc.mjs +3 -2
- package/clients/cli/commands/upgrade.file-protection.test.mjs +228 -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 +8 -0
- package/clients/cli/lib/hook-format.mjs +14 -5
- package/clients/cli/lib/manifest.mjs +9 -2
- package/foundation/agent-docs/agent-docs.d.mts +3 -2
- package/foundation/agent-docs/agent-docs.mjs +13 -9
- package/foundation/agent-docs/agent-docs.test.mjs +19 -1
- package/foundation/config/project-themes.test.mjs +11 -19
- package/foundation/config/project.d.mts +20 -11
- package/foundation/config/project.mjs +123 -80
- package/foundation/config/project.test.mjs +144 -21
- package/foundation/discovery/authoring-self-docs.d.mts +18 -0
- package/foundation/discovery/authoring-self-docs.mjs +37 -15
- package/foundation/discovery/authoring-self-docs.test.mjs +25 -9
- 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 +112 -11
- package/foundation/discovery/docs-discovery.mjs +231 -36
- package/foundation/discovery/docs-discovery.test.mjs +111 -32
- 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 +99 -6
- package/foundation/discovery/template-adapter.mjs +480 -57
- 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/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 +220 -39
- package/foundation/doc-compiler/compile.mjs +311 -15
- 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 +28 -1
- 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 +13 -0
- package/foundation/doc-compiler/ir.mjs +196 -12
- package/foundation/doc-compiler/lenses.d.mts +8 -5
- package/foundation/doc-compiler/lenses.mjs +50 -4
- 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/integrations/autolink.d.mts +58 -1
- package/foundation/integrations/autolink.mjs +143 -57
- 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 +3 -0
- package/foundation/integrations/integrations.mjs +11 -97
- 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/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.d.ts +2 -0
- package/foundation/response/error-codes.doc.mjs +12 -2
- package/foundation/response/error-codes.mjs +7 -1
- package/foundation/response/error-codes.test.mjs +55 -11
- package/foundation/response/response-types.doc.d.mts +5 -1
- package/foundation/response/response-types.doc.mjs +20 -11
- 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.mjs +1 -1
- package/foundation/xle/xle.test.mjs +13 -0
- package/package.json +10 -9
- package/assets/templates/themes/manifest.json +0 -95
|
@@ -23,10 +23,10 @@ import type {
|
|
|
23
23
|
* Standalone hooks (e.g. useMediaQuery, useFocusTrap, useOverflow) get
|
|
24
24
|
* their own {hookName}.doc.mjs file and use this type.
|
|
25
25
|
*
|
|
26
|
-
* Every hook .doc.mjs
|
|
26
|
+
* Every new hook .doc.mjs default-exports a stamped object:
|
|
27
27
|
*
|
|
28
28
|
* /\*\* @type {import('@astryxdesign/cli/authoring').HookDoc} \*\/
|
|
29
|
-
* export
|
|
29
|
+
* export default { type: 'function', ... };
|
|
30
30
|
*/
|
|
31
31
|
export interface HookDoc extends AuthoredDocGraphFields {
|
|
32
32
|
/** Doc-kind discriminant for the stamped default-export format
|
|
@@ -49,7 +49,7 @@ const EXAMPLES = Object.fromEntries(
|
|
|
49
49
|
|
|
50
50
|
describe('load check vs published type', () => {
|
|
51
51
|
it('locks every doc kind', () => {
|
|
52
|
-
const source = ['_schema.mjs', 'template/parse.mjs']
|
|
52
|
+
const source = ['_schema.mjs', 'template/parse.mjs', 'theme/parse.mjs']
|
|
53
53
|
.map(file => fs.readFileSync(path.join(HERE, file), 'utf8'))
|
|
54
54
|
.join('\n');
|
|
55
55
|
expect(Object.keys(LOCKS).sort()).toEqual([...KINDS].sort());
|
|
@@ -57,6 +57,7 @@ describe('load check vs published type', () => {
|
|
|
57
57
|
...Object.values(LOCKS),
|
|
58
58
|
'_AuthoredDocKindDriftLock',
|
|
59
59
|
'_HookDocIsFunctionDocLock',
|
|
60
|
+
'_ThemeDocDriftLock',
|
|
60
61
|
];
|
|
61
62
|
for (const lock of locks) {
|
|
62
63
|
expect(source, `${lock} is missing`).toMatch(
|
|
@@ -70,7 +71,7 @@ describe('load check vs published type', () => {
|
|
|
70
71
|
expect(() => parseDoc(EXAMPLES[kind], `${kind}.doc.mjs`)).not.toThrow();
|
|
71
72
|
}
|
|
72
73
|
expect(() => parseDoc({type: 'widget', name: 'x'}, 'x.doc.mjs')).toThrow(
|
|
73
|
-
/
|
|
74
|
+
/x\.doc\.mjs is invalid/u,
|
|
74
75
|
);
|
|
75
76
|
});
|
|
76
77
|
});
|
|
@@ -181,6 +182,31 @@ describe('unknown fields', () => {
|
|
|
181
182
|
);
|
|
182
183
|
});
|
|
183
184
|
|
|
185
|
+
it("are refused inside a section's reference block, which a section takes", () => {
|
|
186
|
+
const [section] = EXAMPLES.generic.sections;
|
|
187
|
+
const reference = {
|
|
188
|
+
type: 'reference',
|
|
189
|
+
target: '@astryxdesign/cli:schema:integration',
|
|
190
|
+
projection: {fields: ['docs']},
|
|
191
|
+
presentation: 'compact',
|
|
192
|
+
};
|
|
193
|
+
/** @param {object} block */
|
|
194
|
+
const withBlock = block =>
|
|
195
|
+
parseDoc(
|
|
196
|
+
{...EXAMPLES.generic, sections: [{...section, content: [block]}]},
|
|
197
|
+
'r.doc.mjs',
|
|
198
|
+
);
|
|
199
|
+
expect(() => withBlock(reference)).not.toThrow();
|
|
200
|
+
expect(() => withBlock({...reference, notAField: true})).toThrow();
|
|
201
|
+
expect(() =>
|
|
202
|
+
withBlock({...reference, projection: {fields: ['docs'], rows: []}}),
|
|
203
|
+
).toThrow();
|
|
204
|
+
// Workflow and collection blocks belong to a namespace doc.
|
|
205
|
+
expect(() =>
|
|
206
|
+
withBlock({type: 'collection', source: {slot: 'guides'}}),
|
|
207
|
+
).toThrow();
|
|
208
|
+
});
|
|
209
|
+
|
|
184
210
|
it('are refused inside sections and content blocks', () => {
|
|
185
211
|
const [section] = EXAMPLES.generic.sections;
|
|
186
212
|
expect(() =>
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'NamespaceDoc',
|
|
13
13
|
namespace: 'authoring',
|
|
14
14
|
description:
|
|
15
|
-
"Declares named
|
|
15
|
+
"Declares one level of the docs tree: named slots, and adoption rules for already-discovered docs. It never scans folders, lists its children, or copies child documents: a child names its parent with `placement`, or a namespace adopts a discovery group. `astryx docs <route>` lists each slot's children one level down. The CLI keeps its namespace docs in its docs tree directory; an integration ships its own in its docs directory, and they appear in `astryx docs` beside the CLI's.",
|
|
16
16
|
appliesTo: '<namespace>.doc.mjs',
|
|
17
17
|
fields: [
|
|
18
18
|
{
|
|
@@ -44,13 +44,13 @@ export const doc = {
|
|
|
44
44
|
name: 'placement',
|
|
45
45
|
type: 'DocPlacement',
|
|
46
46
|
description:
|
|
47
|
-
'Optional canonical parent
|
|
47
|
+
'Optional canonical parent: {parent, slot?, order?}. `parent` names a namespace of the same package as `namespace:<name>`. An invalid placement withdraws the namespace with a diagnostic; it never falls back.',
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
name: 'aliases',
|
|
51
51
|
type: 'string[]',
|
|
52
52
|
description:
|
|
53
|
-
'Prior names or routes the docs
|
|
53
|
+
'Prior names or routes the docs tree will keep resolving to this doc. Not read yet.',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
name: 'audience',
|
|
@@ -78,9 +78,9 @@ export const doc = {
|
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
name: 'blocks',
|
|
81
|
-
type: 'ReferenceContentBlock[]',
|
|
81
|
+
type: '(ReferenceContentBlock | GraphContentBlock)[]',
|
|
82
82
|
description:
|
|
83
|
-
'Ordered layout content
|
|
83
|
+
'Ordered layout content for the namespace page. Graph-only workflow, collection, and reference blocks are available here without widening the stable ReferenceContentBlock union used by existing topic renderers. Not rendered yet: `astryx docs <route>` lists every slot and its children in order.',
|
|
84
84
|
},
|
|
85
85
|
],
|
|
86
86
|
examples: [
|
|
@@ -103,17 +103,13 @@ export const docs = {
|
|
|
103
103
|
source: {group: 'cli-commands', kinds: ['command']},
|
|
104
104
|
into: 'reference',
|
|
105
105
|
}],
|
|
106
|
-
blocks: [
|
|
107
|
-
{type: 'collection', source: {slot: 'guides'}, presentation: 'cards'},
|
|
108
|
-
{type: 'collection', source: {slot: 'reference'}, presentation: 'compact'},
|
|
109
|
-
],
|
|
110
106
|
};`,
|
|
111
107
|
},
|
|
112
108
|
],
|
|
113
109
|
notes: [
|
|
114
110
|
{
|
|
115
111
|
type: 'prose',
|
|
116
|
-
text: "
|
|
112
|
+
text: "The docs tree reads namespace docs from the CLI and from every configured integration. An integration's namespace doc is a top-level level of the tree, and its guides name it with `placement`; a doc can be placed only in a namespace of its own package. When two packages claim one route, the CLI's own docs win, then integrations in configured order, and `astryx doctor` names the loser.",
|
|
117
113
|
},
|
|
118
114
|
{
|
|
119
115
|
type: 'prose',
|
|
@@ -134,32 +134,30 @@ describe('NamespaceDoc', () => {
|
|
|
134
134
|
});
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
describe('semantic blocks
|
|
138
|
-
it('
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
'workflow',
|
|
155
|
-
'collection',
|
|
156
|
-
'reference',
|
|
157
|
-
]);
|
|
137
|
+
describe('semantic graph blocks', () => {
|
|
138
|
+
it('keeps graph-only blocks out of the stable ReferenceDoc section union', () => {
|
|
139
|
+
expect(() =>
|
|
140
|
+
parseReference({
|
|
141
|
+
type: 'generic',
|
|
142
|
+
name: 'publishing',
|
|
143
|
+
title: 'Publishing',
|
|
144
|
+
description: 'Publish an integration.',
|
|
145
|
+
sections: [
|
|
146
|
+
{
|
|
147
|
+
id: 'start',
|
|
148
|
+
title: 'Start',
|
|
149
|
+
content: namespaceDoc.blocks,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
}),
|
|
153
|
+
).toThrow(/Invalid discriminator value/u);
|
|
158
154
|
});
|
|
159
155
|
|
|
160
|
-
it('
|
|
161
|
-
expect(
|
|
162
|
-
|
|
163
|
-
|
|
156
|
+
it('keeps shape-sniffing an unknown stamp for 0.6.x compatibility', () => {
|
|
157
|
+
expect(parseDoc({type: 'choice', name: 'x', props: []})).toMatchObject({
|
|
158
|
+
type: 'choice',
|
|
159
|
+
name: 'x',
|
|
160
|
+
props: [],
|
|
161
|
+
});
|
|
164
162
|
});
|
|
165
163
|
});
|
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type {AuthoredDocGraphFields, AuthoredDocKind} from '../base/type.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
GraphContentBlock,
|
|
12
|
+
ReferenceContentBlock,
|
|
13
|
+
} from '../reference/type.js';
|
|
11
14
|
|
|
12
15
|
/** Which providers may contribute appearances to a namespace slot. */
|
|
13
16
|
export type NamespaceProviderScope = 'same' | 'configured';
|
|
@@ -67,5 +70,5 @@ export interface NamespaceDoc extends AuthoredDocGraphFields {
|
|
|
67
70
|
/** Optional source-adoption rules for otherwise-unplaced docs. */
|
|
68
71
|
adopts?: NamespaceAdoptionRule[];
|
|
69
72
|
/** Ordered renderer-neutral content and collection blocks. */
|
|
70
|
-
blocks?: ReferenceContentBlock[];
|
|
73
|
+
blocks?: (ReferenceContentBlock | GraphContentBlock)[];
|
|
71
74
|
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
/** @typedef {import('./types.js').CommandDoc} CommandDoc */
|
|
11
11
|
/** @typedef {import('./types.js').EnumDoc} EnumDoc */
|
|
12
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,9 +19,9 @@
|
|
|
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 function parseDoc(input: unknown, label?: string): ComponentDoc | HookDoc | FunctionDoc | ReferenceDoc | TemplateDoc | SchemaDoc | CommandDoc | EnumDoc | NamespaceDoc | ThemeDoc;
|
|
24
25
|
export type ComponentDoc = import("./types.js").ComponentDoc;
|
|
25
26
|
export type HookDoc = import("./types.js").HookDoc;
|
|
26
27
|
export type FunctionDoc = import("./types.js").FunctionDoc;
|
|
@@ -30,3 +31,4 @@ export type SchemaDoc = import("./types.js").SchemaDoc;
|
|
|
30
31
|
export type CommandDoc = import("./types.js").CommandDoc;
|
|
31
32
|
export type EnumDoc = import("./types.js").EnumDoc;
|
|
32
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,6 +16,7 @@ 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
22
|
/** @typedef {import('./types.js').ComponentDoc} ComponentDoc */
|
|
@@ -27,6 +28,7 @@ import {parseLegacyDoc} from './legacy.mjs';
|
|
|
27
28
|
/** @typedef {import('./types.js').CommandDoc} CommandDoc */
|
|
28
29
|
/** @typedef {import('./types.js').EnumDoc} EnumDoc */
|
|
29
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
|
}
|
|
@@ -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
|
{
|
|
@@ -144,7 +144,27 @@ export const docs = {
|
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
type: 'prose',
|
|
147
|
-
text: 'Each `sections[].content` is an ordered array of ReferenceContentBlock,
|
|
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
|
+
}`,
|
|
148
168
|
},
|
|
149
169
|
{
|
|
150
170
|
type: 'code',
|
|
@@ -156,10 +176,19 @@ export const docs = {
|
|
|
156
176
|
| { type: 'code'; lang: string; code: string; label?: string }
|
|
157
177
|
| { type: 'table'; headers: string[]; rows: string[][] }
|
|
158
178
|
| { type: 'list'; style: 'ordered' | 'unordered' | 'do' | 'dont'; items: string[] }
|
|
159
|
-
| { 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 =
|
|
160
189
|
| { type: 'workflow'; title?: string; steps: WorkflowStep[] }
|
|
161
190
|
| { type: 'collection'; source: {slot: string}; presentation?: 'list' | 'cards' | 'compact'; whenEmpty?: 'show' | 'omit' }
|
|
162
|
-
|
|
|
191
|
+
| ReferenceDocBlock;`,
|
|
163
192
|
},
|
|
164
193
|
{
|
|
165
194
|
type: 'prose',
|
|
@@ -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. */
|
|
@@ -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',
|
|
@@ -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[];
|
|
@@ -56,6 +56,7 @@ declare const pageTemplateSchema: z.ZodObject<{
|
|
|
56
56
|
slug: z.ZodOptional<z.ZodString>;
|
|
57
57
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
58
|
}, z.core.$strict>>;
|
|
59
|
+
replaces: z.ZodOptional<z.ZodString>;
|
|
59
60
|
placement: z.ZodOptional<z.ZodObject<{
|
|
60
61
|
parent: z.ZodString;
|
|
61
62
|
slot: z.ZodOptional<z.ZodString>;
|
|
@@ -91,6 +92,7 @@ declare const blockTemplateSchema: z.ZodObject<{
|
|
|
91
92
|
slug: z.ZodOptional<z.ZodString>;
|
|
92
93
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
94
|
}, z.core.$strict>>;
|
|
95
|
+
replaces: z.ZodOptional<z.ZodString>;
|
|
94
96
|
placement: z.ZodOptional<z.ZodObject<{
|
|
95
97
|
parent: z.ZodString;
|
|
96
98
|
slot: z.ZodOptional<z.ZodString>;
|
|
@@ -51,6 +51,10 @@ const baseTemplateFields = {
|
|
|
51
51
|
scaffold: z.boolean().optional(),
|
|
52
52
|
isHiddenFromOverview: z.boolean().optional(),
|
|
53
53
|
registry: registryIdentitySchema.optional(),
|
|
54
|
+
replaces: z
|
|
55
|
+
.string()
|
|
56
|
+
.min(1, 'replaces must name a Core template id')
|
|
57
|
+
.optional(),
|
|
54
58
|
};
|
|
55
59
|
|
|
56
60
|
const pageTemplateSchema = z
|
|
@@ -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',
|
|
@@ -28,6 +28,14 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
|
28
28
|
|
|
29
29
|
/** Optional stable slug override and prior aliases for registry output. */
|
|
30
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;
|
|
31
39
|
/** Whether this template is ready for use. Templates with
|
|
32
40
|
* isReady: false show as "(WIP)" in the gallery and CLI. */
|
|
33
41
|
isReady?: boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in authoring/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Compile-time drift lock: the sealed schema must infer exactly ThemeDoc.
|
|
6
|
+
*
|
|
7
|
+
* @typedef {import('../../_shared/contract.js').Expect<
|
|
8
|
+
* import('../../_shared/contract.js').Equal<
|
|
9
|
+
* z.infer<typeof themeDocSchema>,
|
|
10
|
+
* ThemeDoc
|
|
11
|
+
* >
|
|
12
|
+
* >} _ThemeDocDriftLock
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Validate an unknown value as a theme descriptor, or throw.
|
|
16
|
+
*
|
|
17
|
+
* @param {unknown} input
|
|
18
|
+
* @param {string} [label]
|
|
19
|
+
* @returns {ThemeDoc}
|
|
20
|
+
*/
|
|
21
|
+
export function parseTheme(input: unknown, label?: string): ThemeDoc;
|
|
22
|
+
/**
|
|
23
|
+
* Compile-time drift lock: the sealed schema must infer exactly ThemeDoc.
|
|
24
|
+
*/
|
|
25
|
+
export type _ThemeDocDriftLock = import("../../_shared/contract.js").Expect<import("../../_shared/contract.js").Equal<z.infer<typeof themeDocSchema>, ThemeDoc>>;
|
|
26
|
+
export type ThemeDoc = import("./type.js").ThemeDoc;
|
|
27
|
+
import { z } from 'zod';
|
|
28
|
+
declare const themeDocSchema: z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"theme">;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
displayName: z.ZodString;
|
|
32
|
+
description: z.ZodString;
|
|
33
|
+
maintained: z.ZodBoolean;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export {};
|