@astryxdesign/cli 0.6.3-canary.98a2e4e → 0.6.3-canary.a00065f
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 +106 -73
- package/api/blog/blog.doc.mjs +1 -0
- package/api/build/build.doc.mjs +4 -3
- package/api/build/build.test.mjs +14 -3
- package/api/build/build.type.d.mts +36 -2
- package/api/build/build.type.mjs +25 -4
- package/api/build/help/help.d.mts +8 -5
- package/api/build/help/help.mjs +56 -6
- package/api/component/component.doc.mjs +13 -3
- package/api/component/component.mjs +31 -2
- 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 +37 -9
- package/api/discover/discover.doc.mjs +2 -1
- package/api/discover/discover.type.d.mts +4 -4
- package/api/discover/discover.type.mjs +10 -10
- package/api/docs/_adapter.d.mts +28 -30
- package/api/docs/_adapter.mjs +73 -135
- package/api/docs/compiled-topics.test.mjs +78 -0
- package/api/docs/detail/detail.d.mts +0 -15
- package/api/docs/detail/detail.mjs +14 -78
- package/api/docs/detail/section/section.mjs +22 -18
- package/api/docs/detail/section/section.test.mjs +4 -3
- package/api/docs/docs.doc.mjs +1 -0
- package/api/docs/docs.type.d.mts +4 -4
- package/api/docs/docs.type.mjs +10 -10
- package/api/docs/index/index.mjs +6 -5
- package/api/docs/list/list.mjs +3 -7
- package/api/doctor/doctor.d.mts +25 -3
- package/api/doctor/doctor.doc.mjs +1 -0
- package/api/doctor/doctor.mjs +186 -18
- package/api/doctor/doctor.test.mjs +326 -1
- 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/init/init.doc.mjs +5 -0
- 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.mjs +23 -10
- package/api/integration/add-contribution.test.mjs +121 -7
- package/api/integration/add-theme.mjs +34 -64
- package/api/integration/add-theme.test.mjs +105 -21
- package/api/integration/authoring-checks.test.mjs +8 -4
- package/api/integration/integration-block-exports.test.mjs +10 -6
- package/api/integration/integrationAdd.doc.mjs +8 -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 +1 -0
- 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 +1 -0
- package/api/integration/integrationPackCheck.doc.mjs +1 -0
- package/api/integration/integrationTemplateConflicts.doc.mjs +1 -0
- package/api/integration/pack-check.mjs +49 -7
- package/api/integration/pack-check.test.mjs +266 -47
- package/api/integration/summarizeIssues.doc.mjs +1 -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 +176 -23
- 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/envelope-types.test.mjs +76 -0
- package/api/json/isError.doc.mjs +1 -0
- package/api/json/parseResponse.doc.mjs +3 -2
- 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 +2 -9
- package/api/search/search.doc.mjs +6 -1
- package/api/search/search.mjs +31 -14
- package/api/search/search.test.mjs +34 -0
- package/api/search/search.type.d.mts +1 -1
- package/api/search/search.type.mjs +1 -1
- 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/template-suffix.test.mjs +41 -21
- package/api/template/template.doc.mjs +3 -1
- package/api/template/template.type.d.mts +5 -5
- package/api/template/template.type.mjs +12 -12
- 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 +20 -3
- package/api/theme/add/add.staging.test.mjs +66 -0
- package/api/theme/add/add.test.mjs +14 -1
- package/api/theme/build/build.mjs +133 -42
- 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.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 +15 -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 +5 -1
- package/api/upgrade/_adapter.d.mts +12 -3
- package/api/upgrade/_adapter.mjs +108 -70
- 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 +1 -0
- package/api/upgrade/status/status.mjs +2 -2
- package/api/upgrade/upgrade.doc.mjs +3 -1
- package/api/upgrade/upgrade.type.d.mts +8 -4
- package/api/upgrade/upgrade.type.mjs +11 -10
- package/assets/codemods/integration-discovery.mjs +48 -4
- package/assets/codemods/integration-discovery.test.mjs +73 -0
- package/assets/codemods/runner.mjs +115 -5
- 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-theme-catalog-to-descriptors.test.mjs +216 -0
- package/assets/codemods/transforms/next/index.mjs +11 -1
- 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/cli-integrations.doc.mjs +26 -30
- package/assets/docs/cli.doc.mjs +15 -0
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +1 -1
- 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/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/config/config.doc.mjs +2 -2
- package/authoring/config/debug-composition.test.mjs +92 -0
- package/authoring/config/parse.d.mts +13 -13
- package/authoring/config/parse.mjs +8 -8
- package/authoring/config/type.ts +18 -6
- package/authoring/debug/debug.doc.d.mts +11 -0
- package/authoring/debug/debug.doc.mjs +182 -0
- package/authoring/debug/parse.d.mts +4 -4
- package/authoring/debug/parse.mjs +3 -3
- package/authoring/doctypes/_schema.d.mts +121 -11
- package/authoring/doctypes/_schema.mjs +144 -13
- package/authoring/doctypes/base/graph-fields.doc.mjs +11 -4
- package/authoring/doctypes/base/type.ts +8 -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 +3 -3
- 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 +5 -1
- package/authoring/doctypes/function/parse.d.mts +2 -2
- package/authoring/doctypes/function/parse.mjs +1 -1
- package/authoring/doctypes/function/type.ts +2 -2
- 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 +208 -0
- package/authoring/doctypes/namespace/namespace.doc.mjs +7 -3
- package/authoring/doctypes/namespace/parse.d.mts +2 -2
- package/authoring/doctypes/namespace/parse.mjs +1 -1
- package/authoring/doctypes/namespace/type.ts +2 -2
- package/authoring/doctypes/parse.d.mts +22 -20
- package/authoring/doctypes/parse.mjs +16 -12
- package/authoring/doctypes/reference/parse.d.mts +2 -2
- package/authoring/doctypes/reference/parse.mjs +1 -1
- package/authoring/doctypes/reference/reference.doc.mjs +7 -3
- package/authoring/doctypes/reference/type.ts +3 -3
- 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 +92 -1
- package/authoring/doctypes/template/parse.mjs +33 -1
- package/authoring/doctypes/template/template.doc.mjs +7 -3
- package/authoring/doctypes/template/type.ts +4 -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 +1 -0
- package/authoring/index.d.ts +21 -19
- package/authoring/index.mjs +2 -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 +4 -10
- 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.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 +5 -5
- 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 +5 -2
- package/clients/cli/commands/build.exit-codes-doc.test.mjs +50 -0
- package/clients/cli/commands/build.mjs +32 -47
- package/clients/cli/commands/build.playbook.test.mjs +75 -0
- package/clients/cli/commands/build.text-fields.test.mjs +40 -0
- package/clients/cli/commands/component/index.mjs +2 -7
- 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 +48 -0
- package/clients/cli/commands/discover.components-flag.test.mjs +97 -0
- package/clients/cli/commands/discover.doc.mjs +5 -3
- package/clients/cli/commands/discover.mjs +3 -3
- package/clients/cli/commands/discover.text-projection.test.mjs +103 -0
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-templates.doc.mjs +1 -1
- 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 +15 -7
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.mjs +6 -16
- 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 +22 -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/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 +17 -7
- package/clients/cli/commands/search.test.mjs +75 -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 +29 -7
- package/clients/cli/commands/template.flag-help.test.mjs +117 -0
- package/clients/cli/commands/template.path-help.test.mjs +40 -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.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 +18 -7
- 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/index.mjs +13 -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 +22 -0
- package/clients/cli/lib/manifest.test.mjs +17 -0
- package/foundation/agent-docs/agent-docs.d.mts +4 -0
- package/foundation/agent-docs/agent-docs.mjs +69 -3
- package/foundation/agent-docs/agent-docs.path-safety.test.mjs +266 -4
- package/foundation/config/integration-debug.test.mjs +28 -3
- package/foundation/config/project-themes.test.mjs +11 -19
- package/foundation/config/project.d.mts +8 -0
- package/foundation/config/project.mjs +173 -30
- package/foundation/config/project.test.mjs +129 -16
- package/foundation/discovery/authoring-self-docs.d.mts +6 -0
- package/foundation/discovery/authoring-self-docs.mjs +17 -7
- package/foundation/discovery/authoring-self-docs.test.mjs +71 -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 +113 -0
- package/foundation/discovery/cli-self-docs.mjs +514 -0
- package/foundation/discovery/cli-self-docs.test.mjs +437 -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 +7 -2
- package/foundation/discovery/docs-discovery.mjs +24 -14
- package/foundation/discovery/docs-discovery.test.mjs +55 -16
- package/foundation/discovery/template-adapter.d.mts +21 -5
- 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 +319 -65
- package/foundation/discovery/template-adapter.test.mjs +15 -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 +218 -0
- package/foundation/doc-compiler/bundle.test.mjs +255 -0
- package/foundation/doc-compiler/compile.d.mts +362 -0
- package/foundation/doc-compiler/compile.mjs +511 -0
- package/foundation/doc-compiler/diagnostics.d.mts +126 -0
- package/foundation/doc-compiler/diagnostics.mjs +277 -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 +286 -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 +464 -0
- package/foundation/doc-compiler/lenses.d.mts +33 -0
- package/foundation/doc-compiler/lenses.mjs +127 -0
- package/foundation/doc-compiler/lower-doc.test.mjs +492 -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 +126 -0
- package/foundation/doc-compiler/read.mjs +320 -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/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/contribution-fixes.d.mts +145 -0
- package/foundation/integrations/contribution-fixes.mjs +1284 -0
- package/foundation/integrations/contribution-inventory.d.mts +1 -1
- package/foundation/integrations/contribution-inventory.mjs +17 -20
- package/foundation/integrations/contribution-inventory.test.mjs +67 -27
- 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 +104 -10
- package/foundation/response/base.d.ts +8 -4
- package/foundation/response/error-codes.doc.mjs +3 -4
- package/foundation/response/error-codes.mjs +2 -2
- package/foundation/response/error-codes.test.mjs +83 -0
- 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.mjs +11 -11
- package/foundation/response/response-types.doc.test.mjs +158 -0
- package/foundation/response/response.doc.mjs +1 -1
- package/foundation/text/string-utils.mjs +22 -10
- package/foundation/xle/expand.d.mts +2 -0
- package/foundation/xle/expand.mjs +3 -2
- package/foundation/xle/expand.test.mjs +54 -0
- package/package.json +9 -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
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Every authored doc kind has a compile-time lock between its load check
|
|
5
|
+
* and its published type: the `_*DriftLock` typedefs in `_schema.mjs` and
|
|
6
|
+
* `template/parse.mjs`, which the strict typecheck evaluates. A lock names each
|
|
7
|
+
* place the loader is deliberately looser than the type. These tests pin that
|
|
8
|
+
* looser behavior and the published unknown-field policy, so tightening a load
|
|
9
|
+
* check is a reviewed change rather than a silent one.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import * as fs from 'node:fs';
|
|
13
|
+
import * as path from 'node:path';
|
|
14
|
+
import {fileURLToPath, pathToFileURL} from 'node:url';
|
|
15
|
+
import {describe, expect, it} from 'vitest';
|
|
16
|
+
import {parseDoc} from './parse.mjs';
|
|
17
|
+
import {AuthoredDocKindSchema} from './_schema.mjs';
|
|
18
|
+
import {doc as graphFieldsDoc} from './base/graph-fields.doc.mjs';
|
|
19
|
+
import {problemsInTopic} from '../../foundation/discovery/docs-discovery.mjs';
|
|
20
|
+
|
|
21
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
22
|
+
const KINDS = AuthoredDocKindSchema.options;
|
|
23
|
+
|
|
24
|
+
/** The lock that pins each kind's load check to its published type. */
|
|
25
|
+
const LOCKS = {
|
|
26
|
+
component: '_ComponentDocDriftLock',
|
|
27
|
+
function: '_FunctionDocDriftLock',
|
|
28
|
+
generic: '_ReferenceDocDriftLock',
|
|
29
|
+
page: '_PageTemplateDocDriftLock',
|
|
30
|
+
block: '_BlockTemplateDocDriftLock',
|
|
31
|
+
schema: '_SchemaDocDriftLock',
|
|
32
|
+
command: '_CommandDocDriftLock',
|
|
33
|
+
enum: '_EnumDocDriftLock',
|
|
34
|
+
namespace: '_NamespaceDocDriftLock',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** One valid example doc per kind, from the typed examples. */
|
|
38
|
+
const EXAMPLES = Object.fromEntries(
|
|
39
|
+
await Promise.all(
|
|
40
|
+
KINDS.map(async kind => {
|
|
41
|
+
const file = {generic: 'reference', function: 'function'}[kind] ?? kind;
|
|
42
|
+
const url = pathToFileURL(
|
|
43
|
+
path.join(HERE, '../../test/authoring-types', `${file}.doc.mjs`),
|
|
44
|
+
);
|
|
45
|
+
return [kind, (await import(url.href)).docs];
|
|
46
|
+
}),
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
describe('load check vs published type', () => {
|
|
51
|
+
it('locks every doc kind', () => {
|
|
52
|
+
const source = ['_schema.mjs', 'template/parse.mjs', 'theme/parse.mjs']
|
|
53
|
+
.map(file => fs.readFileSync(path.join(HERE, file), 'utf8'))
|
|
54
|
+
.join('\n');
|
|
55
|
+
expect(Object.keys(LOCKS).sort()).toEqual([...KINDS].sort());
|
|
56
|
+
const locks = [
|
|
57
|
+
...Object.values(LOCKS),
|
|
58
|
+
'_AuthoredDocKindDriftLock',
|
|
59
|
+
'_HookDocIsFunctionDocLock',
|
|
60
|
+
'_ThemeDocDriftLock',
|
|
61
|
+
];
|
|
62
|
+
for (const lock of locks) {
|
|
63
|
+
expect(source, `${lock} is missing`).toMatch(
|
|
64
|
+
new RegExp(`\\}\\s*${lock}\\b`),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('dispatches every doc kind and refuses any other', () => {
|
|
70
|
+
for (const kind of KINDS) {
|
|
71
|
+
expect(() => parseDoc(EXAMPLES[kind], `${kind}.doc.mjs`)).not.toThrow();
|
|
72
|
+
}
|
|
73
|
+
expect(() => parseDoc({type: 'widget', name: 'x'}, 'x.doc.mjs')).toThrow(
|
|
74
|
+
/unsupported type "widget"/,
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe('where loading is deliberately looser than the type', () => {
|
|
80
|
+
it('a stamped component needs no displayName; usage, theming and examples are unchecked', () => {
|
|
81
|
+
expect(() =>
|
|
82
|
+
parseDoc(
|
|
83
|
+
{
|
|
84
|
+
type: 'component',
|
|
85
|
+
name: 'Badge',
|
|
86
|
+
category: 'badges',
|
|
87
|
+
props: [],
|
|
88
|
+
usage: 'free text',
|
|
89
|
+
theming: 5,
|
|
90
|
+
examples: [{title: 'Basic'}],
|
|
91
|
+
},
|
|
92
|
+
'Badge.doc.mjs',
|
|
93
|
+
),
|
|
94
|
+
).not.toThrow();
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('each entry of a stamped group doc needs a name, and nothing more', () => {
|
|
98
|
+
const group = (/** @type {unknown[]} */ components) => ({
|
|
99
|
+
type: 'component',
|
|
100
|
+
name: 'Tabs',
|
|
101
|
+
components,
|
|
102
|
+
});
|
|
103
|
+
expect(() =>
|
|
104
|
+
parseDoc(
|
|
105
|
+
group([{name: 'Tab'}, {name: 'TabPanel', description: 'x'}]),
|
|
106
|
+
'Tabs.doc.mjs',
|
|
107
|
+
),
|
|
108
|
+
).not.toThrow();
|
|
109
|
+
for (const bad of [null, 5, 'Tab', {}, {name: ''}, {displayName: 'Tab'}]) {
|
|
110
|
+
expect(() => parseDoc(group([bad]), 'Tabs.doc.mjs')).toThrow(
|
|
111
|
+
/components\.0/,
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('a stamped function needs no displayName; usage is unchecked', () => {
|
|
117
|
+
expect(() =>
|
|
118
|
+
parseDoc(
|
|
119
|
+
{type: 'function', name: 'useX', params: [], returns: [], usage: 5},
|
|
120
|
+
'useX.doc.mjs',
|
|
121
|
+
),
|
|
122
|
+
).not.toThrow();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('a stamped generic doc loads without title, description or sections, but is no topic', () => {
|
|
126
|
+
const doc = parseDoc({type: 'generic', name: 'notes'}, 'notes.doc.mjs');
|
|
127
|
+
expect(doc.title).toBe('notes');
|
|
128
|
+
expect(problemsInTopic(doc)).toEqual([
|
|
129
|
+
'description: expected a non-empty string',
|
|
130
|
+
'sections: expected at least one section',
|
|
131
|
+
]);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('a template needs no displayName or aspectRatio and may use its own category', () => {
|
|
135
|
+
expect(() =>
|
|
136
|
+
parseDoc(
|
|
137
|
+
{type: 'block', name: 'widget-demo', category: 'components/Widget'},
|
|
138
|
+
'widget-demo.doc.mjs',
|
|
139
|
+
),
|
|
140
|
+
).not.toThrow();
|
|
141
|
+
expect(() =>
|
|
142
|
+
parseDoc(
|
|
143
|
+
{type: 'page', name: 'widget-page', category: 'Widgets'},
|
|
144
|
+
'widget-page.doc.mjs',
|
|
145
|
+
),
|
|
146
|
+
).not.toThrow();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('schema, command and enum docs load only as their type allows', () => {
|
|
150
|
+
const {fields, ...schemaDoc} = EXAMPLES.schema;
|
|
151
|
+
const {summary, ...commandDoc} = EXAMPLES.command;
|
|
152
|
+
const {members, ...enumDoc} = EXAMPLES.enum;
|
|
153
|
+
expect(() => parseDoc(schemaDoc, 's.doc.mjs')).toThrow(/fields/);
|
|
154
|
+
expect(() => parseDoc(commandDoc, 'c.doc.mjs')).toThrow(/summary/);
|
|
155
|
+
expect(() => parseDoc(enumDoc, 'e.doc.mjs')).toThrow(/members/);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
describe('unknown fields', () => {
|
|
160
|
+
const keeps = KINDS.filter(kind => {
|
|
161
|
+
try {
|
|
162
|
+
parseDoc({...EXAMPLES[kind], notAField: true}, `${kind}.doc.mjs`);
|
|
163
|
+
return true;
|
|
164
|
+
} catch {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('match the published policy', () => {
|
|
170
|
+
const policy = graphFieldsDoc.notes
|
|
171
|
+
.map(note => ('text' in note ? note.text : ''))
|
|
172
|
+
.find(text => text.startsWith('Unknown fields'));
|
|
173
|
+
expect(policy, 'graph-fields.doc.mjs states the policy').toBeDefined();
|
|
174
|
+
const [kept, refused] = /** @type {string} */ (policy).split(
|
|
175
|
+
' docs accept',
|
|
176
|
+
);
|
|
177
|
+
const named = (/** @type {string} */ text) =>
|
|
178
|
+
[...text.matchAll(/`([a-z]+)`/g)].map(match => match[1]).sort();
|
|
179
|
+
expect(named(kept)).toEqual([...keeps].sort());
|
|
180
|
+
expect(named(refused).filter(kind => KINDS.includes(kind))).toEqual(
|
|
181
|
+
KINDS.filter(kind => !keeps.includes(kind)).sort(),
|
|
182
|
+
);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('are refused inside sections and content blocks', () => {
|
|
186
|
+
const [section] = EXAMPLES.generic.sections;
|
|
187
|
+
expect(() =>
|
|
188
|
+
parseDoc(
|
|
189
|
+
{...EXAMPLES.generic, sections: [{...section, notAField: true}]},
|
|
190
|
+
'r.doc.mjs',
|
|
191
|
+
),
|
|
192
|
+
).toThrow();
|
|
193
|
+
expect(() =>
|
|
194
|
+
parseDoc(
|
|
195
|
+
{
|
|
196
|
+
...EXAMPLES.generic,
|
|
197
|
+
sections: [
|
|
198
|
+
{
|
|
199
|
+
...section,
|
|
200
|
+
content: [{type: 'prose', text: 'x', notAField: true}],
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
'r.doc.mjs',
|
|
205
|
+
),
|
|
206
|
+
).toThrow();
|
|
207
|
+
});
|
|
208
|
+
});
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'NamespaceDoc',
|
|
13
13
|
namespace: 'authoring',
|
|
14
14
|
description:
|
|
15
|
-
|
|
15
|
+
"Declares named navigation slots and renderer-neutral layout blocks for already-discovered docs. It never scans folders or copies child documents. Not loaded yet: only the docs graph reads namespace docs, and it is not built, so keep them out of an integration's docs directory for now.",
|
|
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 request: {parent, slot?, order?}. Invalid explicit placement
|
|
47
|
+
'Optional canonical parent request: {parent, slot?, order?}. Invalid explicit placement will fail compilation instead of falling back.',
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
name: 'aliases',
|
|
51
51
|
type: 'string[]',
|
|
52
52
|
description:
|
|
53
|
-
'Prior names or routes
|
|
53
|
+
'Prior names or routes the docs graph will keep resolving to this doc.',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
name: 'audience',
|
|
@@ -111,6 +111,10 @@ export const docs = {
|
|
|
111
111
|
},
|
|
112
112
|
],
|
|
113
113
|
notes: [
|
|
114
|
+
{
|
|
115
|
+
type: 'prose',
|
|
116
|
+
text: "Namespace docs are not loaded yet. Only the docs graph reads them, and it is not built. A namespace doc in an integration's docs directory fails to load as a topic, and with it every topic that package contributes, until the file is removed.",
|
|
117
|
+
},
|
|
114
118
|
{
|
|
115
119
|
type: 'prose',
|
|
116
120
|
text: 'Child docs request one canonical home with placement. Collections store and render stable references to those docs; they never create a second identity or parent.',
|
|
@@ -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').NamespaceDoc} NamespaceDoc */
|
|
4
|
+
/** @typedef {import('../types.js').NamespaceDoc} NamespaceDoc */
|
|
5
5
|
/**
|
|
6
6
|
* Validate an unknown value as a NamespaceDoc, or throw a readable error.
|
|
7
7
|
* @param {unknown} input
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* @returns {NamespaceDoc}
|
|
10
10
|
*/
|
|
11
11
|
export function parseNamespace(input: unknown, label?: string): NamespaceDoc;
|
|
12
|
-
export type NamespaceDoc = import("../types").NamespaceDoc;
|
|
12
|
+
export type NamespaceDoc = import("../types.js").NamespaceDoc;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import {NamespaceDocKindSchema} from '../_schema.mjs';
|
|
9
9
|
import {formatZodError} from '../../_shared/errors.mjs';
|
|
10
10
|
|
|
11
|
-
/** @typedef {import('../types').NamespaceDoc} NamespaceDoc */
|
|
11
|
+
/** @typedef {import('../types.js').NamespaceDoc} NamespaceDoc */
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Validate an unknown value as a NamespaceDoc, or throw a readable error.
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* or copies child documents.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {AuthoredDocGraphFields, AuthoredDocKind} from '../base/type';
|
|
10
|
-
import type {ReferenceContentBlock} from '../reference/type';
|
|
9
|
+
import type {AuthoredDocGraphFields, AuthoredDocKind} from '../base/type.js';
|
|
10
|
+
import type {ReferenceContentBlock} from '../reference/type.js';
|
|
11
11
|
|
|
12
12
|
/** Which providers may contribute appearances to a namespace slot. */
|
|
13
13
|
export type NamespaceProviderScope = 'same' | 'configured';
|
|
@@ -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,6 +64,8 @@ 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
70
|
return parseLegacyDoc(input, label);
|
|
67
71
|
default:
|
|
@@ -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
|
{
|
|
@@ -95,7 +95,7 @@ export const doc = {
|
|
|
95
95
|
name: 'sections[].content',
|
|
96
96
|
type: 'ReferenceContentBlock[]',
|
|
97
97
|
description:
|
|
98
|
-
'Ordered content blocks
|
|
98
|
+
'Ordered content blocks: prose, heading, code, table, list, and token-ref. workflow, collection, and reference are declared for the docs graph and parse, but a topic that uses one fails to load until the docs graph ships.',
|
|
99
99
|
required: true,
|
|
100
100
|
},
|
|
101
101
|
{
|
|
@@ -140,7 +140,11 @@ 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, a discriminated union. workflow, collection, and reference are declared for the docs graph: they parse, but topic loading rejects them until the docs graph ships. choice, callout, and checklist remain invalid. The same union is reused by the `notes` field on SchemaDoc and CommandDoc.',
|
|
144
148
|
},
|
|
145
149
|
{
|
|
146
150
|
type: 'code',
|
|
@@ -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 {
|
|
@@ -93,10 +93,10 @@ export type ReferenceContentBlock =
|
|
|
93
93
|
* they aren't tied to a specific component — just drop a .doc.mjs file
|
|
94
94
|
* in the docs/ directory and it shows up in `astryx docs`.
|
|
95
95
|
*
|
|
96
|
-
* Every reference .doc.mjs
|
|
96
|
+
* Every new reference .doc.mjs default-exports a stamped object:
|
|
97
97
|
*
|
|
98
98
|
* /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} *\/
|
|
99
|
-
* export
|
|
99
|
+
* export default { type: 'generic', ... };
|
|
100
100
|
*/
|
|
101
101
|
export interface ReferenceDoc extends AuthoredDocGraphFields {
|
|
102
102
|
/** Doc-kind discriminant for the stamped default-export format
|
|
@@ -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 `astryx docs` topic 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 section `api-<name>` of the `cli` topic). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that no topic 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 `astryx docs` topic 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 section `api-<name>` of the `cli` topic). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that no topic reads. */
|
|
52
51
|
namespace?: string;
|
|
53
52
|
/** Alternate slugs that also resolve to this doc (back-compat). */
|
|
54
53
|
aliases?: string[];
|
|
@@ -11,4 +11,95 @@
|
|
|
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
|
+
placement: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
parent: z.ZodString;
|
|
61
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
62
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
public: "public";
|
|
67
|
+
internal: "internal";
|
|
68
|
+
}>>;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
declare const blockTemplateSchema: z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"block">;
|
|
72
|
+
exampleFor: z.ZodOptional<z.ZodString>;
|
|
73
|
+
alsoExampleFor: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
74
|
+
alsoShowcaseFor: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
aspectRatio: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
isShowcase: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
80
|
+
description: z.ZodOptional<z.ZodString>;
|
|
81
|
+
category: z.ZodOptional<z.ZodString>;
|
|
82
|
+
componentsUsed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
image: z.ZodOptional<z.ZodString>;
|
|
85
|
+
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
isReady: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
scaffold: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
isHiddenFromOverview: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
92
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
+
}, z.core.$strict>>;
|
|
94
|
+
placement: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
parent: z.ZodString;
|
|
96
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
97
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
public: "public";
|
|
102
|
+
internal: "internal";
|
|
103
|
+
}>>;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
export {};
|