@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
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'enum',
|
|
13
13
|
name: 'error-codes',
|
|
14
14
|
displayName: 'Error Codes',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/api',
|
|
16
16
|
description:
|
|
17
17
|
'Stable, append-only machine-readable error codes on the --json error envelope (envelope.code). Codes never change or get removed; branch on these, not on prose.',
|
|
18
18
|
members: [
|
|
@@ -154,6 +154,16 @@ export const doc = {
|
|
|
154
154
|
value: 'ERR_CODEMOD_FAILED',
|
|
155
155
|
description: 'One or more codemods failed during an upgrade run.',
|
|
156
156
|
},
|
|
157
|
+
{
|
|
158
|
+
value: 'ERR_CODEMOD_PROTECTED',
|
|
159
|
+
description:
|
|
160
|
+
'A required codemod change remains blocked by a protected consumer file.',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
value: 'ERR_CODEMOD_PROTECTION_SOURCE',
|
|
164
|
+
description:
|
|
165
|
+
'A working-tree protection declaration could not be read or parsed.',
|
|
166
|
+
},
|
|
157
167
|
{
|
|
158
168
|
value: 'ERR_NOT_FOUND',
|
|
159
169
|
description:
|
|
@@ -203,7 +213,7 @@ export const doc = {
|
|
|
203
213
|
{
|
|
204
214
|
value: 'ERR_THEME_INVALID',
|
|
205
215
|
description:
|
|
206
|
-
'A theme definition or contributed theme
|
|
216
|
+
'A theme definition or contributed theme descriptor is invalid.',
|
|
207
217
|
},
|
|
208
218
|
{
|
|
209
219
|
value: 'ERR_THEME_LOAD',
|
|
@@ -64,6 +64,8 @@
|
|
|
64
64
|
* | 'ERR_UNKNOWN_FEATURE'
|
|
65
65
|
* | 'ERR_UNKNOWN_CODEMOD'
|
|
66
66
|
* | 'ERR_CODEMOD_FAILED'
|
|
67
|
+
* | 'ERR_CODEMOD_PROTECTED'
|
|
68
|
+
* | 'ERR_CODEMOD_PROTECTION_SOURCE'
|
|
67
69
|
* | 'ERR_NOT_FOUND'
|
|
68
70
|
* | 'ERR_NO_DOC'
|
|
69
71
|
* | 'ERR_NO_SHOWCASE'
|
|
@@ -161,6 +163,10 @@ export const ERROR_CODES = Object.freeze({
|
|
|
161
163
|
ERR_UNKNOWN_CODEMOD: 'ERR_UNKNOWN_CODEMOD',
|
|
162
164
|
/** One or more codemods failed during an upgrade run. */
|
|
163
165
|
ERR_CODEMOD_FAILED: 'ERR_CODEMOD_FAILED',
|
|
166
|
+
/** A required codemod change remains blocked by a protected consumer file. */
|
|
167
|
+
ERR_CODEMOD_PROTECTED: 'ERR_CODEMOD_PROTECTED',
|
|
168
|
+
/** A working-tree protection declaration could not be read or parsed. */
|
|
169
|
+
ERR_CODEMOD_PROTECTION_SOURCE: 'ERR_CODEMOD_PROTECTION_SOURCE',
|
|
164
170
|
/** A generic discover/lookup query matched nothing in any package. */
|
|
165
171
|
ERR_NOT_FOUND: 'ERR_NOT_FOUND',
|
|
166
172
|
|
|
@@ -185,7 +191,7 @@ export const ERROR_CODES = Object.freeze({
|
|
|
185
191
|
ERR_WRITE_FAILED: 'ERR_WRITE_FAILED',
|
|
186
192
|
|
|
187
193
|
// ── Theme build ──────────────────────────────────────────────────
|
|
188
|
-
/** A theme definition or contributed theme
|
|
194
|
+
/** A theme definition or contributed theme descriptor is invalid. */
|
|
189
195
|
ERR_THEME_INVALID: 'ERR_THEME_INVALID',
|
|
190
196
|
/** A theme file could not be loaded / parsed into a defineTheme result. */
|
|
191
197
|
ERR_THEME_LOAD: 'ERR_THEME_LOAD',
|
|
@@ -86,6 +86,8 @@ describe('error codes: shipped set', () => {
|
|
|
86
86
|
'ERR_AMBIGUOUS_TEMPLATE',
|
|
87
87
|
'ERR_AMBIGUOUS_THEME',
|
|
88
88
|
'ERR_CODEMOD_FAILED',
|
|
89
|
+
'ERR_CODEMOD_PROTECTED',
|
|
90
|
+
'ERR_CODEMOD_PROTECTION_SOURCE',
|
|
89
91
|
'ERR_CORE_INCOMPATIBLE',
|
|
90
92
|
'ERR_CORE_NOT_FOUND',
|
|
91
93
|
'ERR_DEP_MISSING',
|
|
@@ -135,25 +137,67 @@ describe('error codes: shipped set', () => {
|
|
|
135
137
|
];
|
|
136
138
|
|
|
137
139
|
it('still carries every shipped code, spelled the same', () => {
|
|
138
|
-
const missing = SHIPPED.filter(
|
|
140
|
+
const missing = SHIPPED.filter(
|
|
141
|
+
code => !isErrorCode(code) || ERROR_CODES[code] !== code,
|
|
142
|
+
);
|
|
139
143
|
expect(missing, 'shipped codes removed or respelled').toEqual([]);
|
|
140
144
|
});
|
|
141
145
|
});
|
|
142
146
|
|
|
143
147
|
describe('error codes: end-to-end JSON envelopes', () => {
|
|
144
148
|
const cases = [
|
|
145
|
-
{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
{
|
|
150
|
+
name: 'unknown component',
|
|
151
|
+
args: ['component', 'Bogus', '--json'],
|
|
152
|
+
code: 'ERR_UNKNOWN_COMPONENT',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'unknown hook',
|
|
156
|
+
args: ['hook', 'bogusHook', '--json'],
|
|
157
|
+
code: 'ERR_UNKNOWN_HOOK',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'unknown topic',
|
|
161
|
+
args: ['docs', 'bogusTopic', '--json'],
|
|
162
|
+
code: 'ERR_UNKNOWN_TOPIC',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'unknown template',
|
|
166
|
+
args: ['template', 'bogusTemplate', '--json'],
|
|
167
|
+
code: 'ERR_UNKNOWN_TEMPLATE',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'unknown command',
|
|
171
|
+
args: ['bogus-cmd', '--json'],
|
|
172
|
+
code: 'ERR_UNKNOWN_COMMAND',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'invalid --lang',
|
|
176
|
+
args: ['docs', 'color', '--lang', 'fr', '--json'],
|
|
177
|
+
code: 'ERR_INVALID_LANG',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'invalid --detail',
|
|
181
|
+
args: ['docs', 'color', '--detail', 'bogus', '--json'],
|
|
182
|
+
code: 'ERR_INVALID_DETAIL',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'unknown option',
|
|
186
|
+
args: ['component', 'Button', '--bogus-flag', '--json'],
|
|
187
|
+
code: 'ERR_INVALID_OPTION',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'missing argument',
|
|
191
|
+
args: ['theme', 'build', '--json'],
|
|
192
|
+
code: 'ERR_MISSING_ARGUMENT',
|
|
193
|
+
},
|
|
154
194
|
// `theme` is not on the --json allowlist, so --json on any theme subcommand
|
|
155
195
|
// is rejected at the preAction gate with a stable invalid-option code.
|
|
156
|
-
{
|
|
196
|
+
{
|
|
197
|
+
name: 'json not supported',
|
|
198
|
+
args: ['theme', 'bogus-sub', '--json'],
|
|
199
|
+
code: 'ERR_INVALID_OPTION',
|
|
200
|
+
},
|
|
157
201
|
];
|
|
158
202
|
|
|
159
203
|
for (const {name, args, code} of cases) {
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
* @file EnumDoc for the `type` discriminant carried on every --json success
|
|
6
6
|
* envelope. The vocabulary mirrors the RESPONSE_TYPES map (each command's
|
|
7
7
|
* `jsonOut(...)` call sites) in `clients/cli/lib/manifest.mjs`; a consumer
|
|
8
|
-
* switches on `type` to narrow the `data` payload.
|
|
8
|
+
* switches on `type` to narrow the `data` payload. Descriptions follow the
|
|
9
|
+
* currently published response projection, not a future package-version boundary.
|
|
10
|
+
*
|
|
11
|
+
* @input Public response discriminants and their currently released payloads.
|
|
12
|
+
* @output Generated consumer reference for every typed JSON success response.
|
|
9
13
|
* @position packages/cli/foundation/response — enum documentation
|
|
10
14
|
*/
|
|
11
15
|
/** @type {import('@astryxdesign/cli/authoring').EnumDoc} */
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
* @file EnumDoc for the `type` discriminant carried on every --json success
|
|
5
5
|
* envelope. The vocabulary mirrors the RESPONSE_TYPES map (each command's
|
|
6
6
|
* `jsonOut(...)` call sites) in `clients/cli/lib/manifest.mjs`; a consumer
|
|
7
|
-
* switches on `type` to narrow the `data` payload.
|
|
7
|
+
* switches on `type` to narrow the `data` payload. Descriptions follow the
|
|
8
|
+
* currently published response projection, not a future package-version boundary.
|
|
9
|
+
*
|
|
10
|
+
* @input Public response discriminants and their currently released payloads.
|
|
11
|
+
* @output Generated consumer reference for every typed JSON success response.
|
|
8
12
|
* @position packages/cli/foundation/response — enum documentation
|
|
9
13
|
*/
|
|
10
14
|
|
|
@@ -13,7 +17,7 @@ export const doc = {
|
|
|
13
17
|
type: 'enum',
|
|
14
18
|
name: 'response-types',
|
|
15
19
|
displayName: 'Response Types',
|
|
16
|
-
namespace: 'cli',
|
|
20
|
+
namespace: 'cli/api',
|
|
17
21
|
description:
|
|
18
22
|
'The `type` discriminant present on every --json success envelope. Consumers switch on it to narrow `data`.',
|
|
19
23
|
members: [
|
|
@@ -61,22 +65,27 @@ export const doc = {
|
|
|
61
65
|
{
|
|
62
66
|
value: 'docs.list',
|
|
63
67
|
description:
|
|
64
|
-
|
|
68
|
+
"All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load.",
|
|
65
69
|
},
|
|
66
70
|
{
|
|
67
71
|
value: 'docs.detail',
|
|
68
72
|
description:
|
|
69
|
-
"One topic's full ReferenceDoc, with token-ref blocks inlined.",
|
|
73
|
+
"One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there).",
|
|
70
74
|
},
|
|
71
75
|
{
|
|
72
76
|
value: 'docs.index',
|
|
73
77
|
description:
|
|
74
|
-
"One topic's section index (--index): the topic's name, title, and description, plus sections, each {id, title, summary} (pass the id as the section argument; summary is the section's one-line summary).",
|
|
78
|
+
"One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, summary} (pass the id as the section argument; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there).",
|
|
75
79
|
},
|
|
76
80
|
{
|
|
77
81
|
value: 'docs.detail.section',
|
|
78
82
|
description:
|
|
79
|
-
'One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined.',
|
|
83
|
+
'One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it).',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: 'docs.node',
|
|
87
|
+
description:
|
|
88
|
+
"One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names).",
|
|
80
89
|
},
|
|
81
90
|
|
|
82
91
|
// blog (read from the published RSS feed)
|
|
@@ -116,7 +125,7 @@ export const doc = {
|
|
|
116
125
|
{
|
|
117
126
|
value: 'search',
|
|
118
127
|
description:
|
|
119
|
-
'The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, score, reason, description, command}, plus import (components, hooks), title (docs), or displayName and kind (templates).',
|
|
128
|
+
'The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, score, reason, description, command}, plus import (components, hooks), title, parent (the command that opens the level above), package (for a docs-tree hit), and, for a hit on one section, section (docs), or displayName and kind (templates).',
|
|
120
129
|
},
|
|
121
130
|
|
|
122
131
|
// build
|
|
@@ -128,7 +137,7 @@ export const doc = {
|
|
|
128
137
|
{
|
|
129
138
|
value: 'build.kit',
|
|
130
139
|
description:
|
|
131
|
-
|
|
140
|
+
"The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, command, basis, reason, alternatives, ...}, pages (search's closest templates), blocks and domain as SearchResultEntry[], frame, foundation, and hint {reason, commands} when thin.",
|
|
132
141
|
},
|
|
133
142
|
|
|
134
143
|
// swizzle
|
|
@@ -158,7 +167,7 @@ export const doc = {
|
|
|
158
167
|
{
|
|
159
168
|
value: 'template.list',
|
|
160
169
|
description:
|
|
161
|
-
'
|
|
170
|
+
'The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list.',
|
|
162
171
|
},
|
|
163
172
|
{
|
|
164
173
|
value: 'template.show',
|
|
@@ -286,7 +295,7 @@ export const doc = {
|
|
|
286
295
|
{
|
|
287
296
|
value: 'integration.template-conflicts',
|
|
288
297
|
description:
|
|
289
|
-
'The integration identity, structural issues, and non-blocking
|
|
298
|
+
'The integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}.',
|
|
290
299
|
},
|
|
291
300
|
{
|
|
292
301
|
value: 'integration.component-conflicts',
|
|
@@ -296,7 +305,7 @@ export const doc = {
|
|
|
296
305
|
{
|
|
297
306
|
value: 'integration.doc-conflicts',
|
|
298
307
|
description:
|
|
299
|
-
'The integration identity, structural issues, and Core doc overlaps
|
|
308
|
+
'The integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` | `error`) and `relationship` (`replaces` | `extends` | `accidental`).',
|
|
300
309
|
},
|
|
301
310
|
|
|
302
311
|
// layout (XLE/XLO)
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
type: 'schema',
|
|
13
13
|
name: 'output',
|
|
14
14
|
displayName: 'Output Envelope',
|
|
15
|
-
namespace: 'cli',
|
|
15
|
+
namespace: 'cli/api',
|
|
16
16
|
description:
|
|
17
17
|
'The single JSON envelope every command emits under --json. Success is ' +
|
|
18
18
|
'{ apiVersion, type, data, meta? }; failure is { apiVersion, error, code, ' +
|
|
@@ -40,4 +40,12 @@ export function searchComponents(needle: string, coreDir: string, components: Re
|
|
|
40
40
|
score: number;
|
|
41
41
|
reason: string;
|
|
42
42
|
}[]>;
|
|
43
|
+
/**
|
|
44
|
+
* The first sentence of a text, whitespace collapsed. A period after "e.g" or
|
|
45
|
+
* "i.e" does not end the sentence. Used where a description has to fit on one
|
|
46
|
+
* line: `build`'s alternatives and its text kit.
|
|
47
|
+
* @param {string} text
|
|
48
|
+
* @returns {string}
|
|
49
|
+
*/
|
|
50
|
+
export function firstSentence(text: string): string;
|
|
43
51
|
export { levenshteinDistance } from "./levenshtein.mjs";
|
|
@@ -56,7 +56,7 @@ export function findClosestComponents(name, components, maxDistance = 3) {
|
|
|
56
56
|
* @returns {Promise<{name: string, score: number, reason: string}[]>}
|
|
57
57
|
*/
|
|
58
58
|
export async function searchComponents(needle, coreDir, components) {
|
|
59
|
-
const {
|
|
59
|
+
const {readDocView} = await import('../doc-compiler/read.mjs');
|
|
60
60
|
const fs = await import('node:fs');
|
|
61
61
|
const path = await import('node:path');
|
|
62
62
|
|
|
@@ -100,8 +100,10 @@ export async function searchComponents(needle, coreDir, components) {
|
|
|
100
100
|
// Levenshtein on name
|
|
101
101
|
const dist = levenshteinDistance(term, compLower);
|
|
102
102
|
if (dist === 1) addMatch(comp, 80, 'similar name (distance ' + dist + ')');
|
|
103
|
-
else if (dist === 2)
|
|
104
|
-
|
|
103
|
+
else if (dist === 2)
|
|
104
|
+
addMatch(comp, 40, 'similar name (distance ' + dist + ')');
|
|
105
|
+
else if (dist === 3)
|
|
106
|
+
addMatch(comp, 20, 'similar name (distance ' + dist + ')');
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
// --- Pass 2: Keyword + description matching (async, reads doc files) ---
|
|
@@ -124,15 +126,22 @@ export async function searchComponents(needle, coreDir, components) {
|
|
|
124
126
|
for (const entry of entries) {
|
|
125
127
|
if (!entry.isDirectory()) continue;
|
|
126
128
|
const nested = path.join(srcDir, entry.name, comp, comp + '.doc.mjs');
|
|
127
|
-
if (fs.existsSync(nested)) {
|
|
129
|
+
if (fs.existsSync(nested)) {
|
|
130
|
+
docPath = nested;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
128
133
|
}
|
|
129
134
|
}
|
|
130
135
|
|
|
131
136
|
if (!docPath) continue;
|
|
132
137
|
|
|
133
138
|
try {
|
|
134
|
-
|
|
135
|
-
const docs =
|
|
139
|
+
// Only the legacy `docs` export has ever been indexed here.
|
|
140
|
+
const docs = await readDocView(docPath, {
|
|
141
|
+
root: 'components',
|
|
142
|
+
loader: 'native',
|
|
143
|
+
exports: ['docs'],
|
|
144
|
+
});
|
|
136
145
|
if (!docs) continue;
|
|
137
146
|
|
|
138
147
|
// Keyword matching
|
|
@@ -157,8 +166,10 @@ export async function searchComponents(needle, coreDir, components) {
|
|
|
157
166
|
}
|
|
158
167
|
|
|
159
168
|
const dist = levenshteinDistance(term, kwLower);
|
|
160
|
-
if (dist === 1)
|
|
161
|
-
|
|
169
|
+
if (dist === 1)
|
|
170
|
+
addMatch(comp, 70, 'keyword "' + kw + '" (distance ' + dist + ')');
|
|
171
|
+
else if (dist === 2)
|
|
172
|
+
addMatch(comp, 30, 'keyword "' + kw + '" (distance ' + dist + ')');
|
|
162
173
|
}
|
|
163
174
|
}
|
|
164
175
|
|
|
@@ -191,8 +202,27 @@ export async function searchComponents(needle, coreDir, components) {
|
|
|
191
202
|
}
|
|
192
203
|
}
|
|
193
204
|
|
|
194
|
-
const results = Array.from(scored.values())
|
|
195
|
-
|
|
205
|
+
const results = Array.from(scored.values()).sort(
|
|
206
|
+
(a, b) => b.score - a.score || a.name.localeCompare(b.name),
|
|
207
|
+
);
|
|
196
208
|
|
|
197
209
|
return results;
|
|
198
210
|
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The first sentence of a text, whitespace collapsed. A period after "e.g" or
|
|
214
|
+
* "i.e" does not end the sentence. Used where a description has to fit on one
|
|
215
|
+
* line: `build`'s alternatives and its text kit.
|
|
216
|
+
* @param {string} text
|
|
217
|
+
* @returns {string}
|
|
218
|
+
*/
|
|
219
|
+
export function firstSentence(text) {
|
|
220
|
+
const flat = String(text ?? '').replace(/\s+/g, ' ').trim();
|
|
221
|
+
const ends = /[.!?](?=\s|$)/g;
|
|
222
|
+
for (let m = ends.exec(flat); m; m = ends.exec(flat)) {
|
|
223
|
+
if (!/\b(e\.g|i\.e)$/i.test(flat.slice(0, m.index))) {
|
|
224
|
+
return flat.slice(0, m.index + 1);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return flat;
|
|
228
|
+
}
|
|
@@ -545,7 +545,7 @@ class Emitter {
|
|
|
545
545
|
const flags = hint.flags.length > 0 ? ` (+${hint.flags.join(' +')})` : '';
|
|
546
546
|
const arg = hint.arg ? `:${hint.arg}` : '';
|
|
547
547
|
return [
|
|
548
|
-
`${pad}{/* TODO(xle): content block '${hint.block.name}'${flags}${arg} — scaffold it with: astryx template ${hint.block.name} */}`,
|
|
548
|
+
`${pad}{/* TODO(xle): content block '${hint.block.name}'${flags}${arg} — scaffold it with: astryx template ${hint.block.name} --type block */}`,
|
|
549
549
|
];
|
|
550
550
|
}
|
|
551
551
|
this.todos.push(`unresolved hint {${hint.name}}`);
|
|
@@ -10,6 +10,7 @@ import {describe, it, expect} from 'vitest';
|
|
|
10
10
|
import {parse, parseCompact, parseOutline, detectForm, XLEParseError} from './parse.mjs';
|
|
11
11
|
import {toCompact, toOutline} from './print.mjs';
|
|
12
12
|
import {validate} from './validate.mjs';
|
|
13
|
+
import {expand} from './expand.mjs';
|
|
13
14
|
import {parseEnumValues, SPACING_STEPS} from './registry.mjs';
|
|
14
15
|
|
|
15
16
|
// ─── parser: compact ───────────────────────────────────────────────────────
|
|
@@ -309,6 +310,18 @@ describe('validate', () => {
|
|
|
309
310
|
expect(doc.roots[0].hint.block.name).toBe('CardCallout');
|
|
310
311
|
});
|
|
311
312
|
|
|
313
|
+
it('includes --type block when a known block source is unavailable', () => {
|
|
314
|
+
const doc = parse('Bx{card-callout}');
|
|
315
|
+
expect(validate(doc, registry, BLOCKS).errors).toEqual([]);
|
|
316
|
+
const result = expand(doc, registry, {
|
|
317
|
+
componentName: 'Demo',
|
|
318
|
+
blockModules: new Map(),
|
|
319
|
+
});
|
|
320
|
+
expect(result.code).toContain(
|
|
321
|
+
'astryx template CardCallout --type block',
|
|
322
|
+
);
|
|
323
|
+
});
|
|
324
|
+
|
|
312
325
|
it('enforces structural pairings', () => {
|
|
313
326
|
const doc = parse('Bx > Sh');
|
|
314
327
|
const {errors} = validate(doc, registry, BLOCKS);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.6.3-canary.
|
|
3
|
+
"version": "0.6.3-canary.db52d98",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"@babel/types": "7.29.8",
|
|
92
92
|
"ast-types": "0.16.3",
|
|
93
93
|
"commander": "^12.1.0",
|
|
94
|
+
"ignore": "^7.0.5",
|
|
94
95
|
"jiti": "^2.7.0",
|
|
95
96
|
"jscodeshift": "^17.3.0",
|
|
96
97
|
"node-diff3": "3.2.1",
|
|
@@ -100,10 +101,10 @@
|
|
|
100
101
|
"zod": "^4.4.3"
|
|
101
102
|
},
|
|
102
103
|
"peerDependencies": {
|
|
103
|
-
"@astryxdesign/charts": "0.6.3-canary.
|
|
104
|
-
"@astryxdesign/core": "0.6.3-canary.
|
|
105
|
-
"@astryxdesign/lab": "0.6.3-canary.
|
|
106
|
-
"@astryxdesign/theme-neutral": "0.6.3-canary.
|
|
104
|
+
"@astryxdesign/charts": "0.6.3-canary.db52d98",
|
|
105
|
+
"@astryxdesign/core": "0.6.3-canary.db52d98",
|
|
106
|
+
"@astryxdesign/lab": "0.6.3-canary.db52d98",
|
|
107
|
+
"@astryxdesign/theme-neutral": "0.6.3-canary.db52d98"
|
|
107
108
|
},
|
|
108
109
|
"peerDependenciesMeta": {
|
|
109
110
|
"@astryxdesign/charts": {
|
|
@@ -120,10 +121,10 @@
|
|
|
120
121
|
}
|
|
121
122
|
},
|
|
122
123
|
"devDependencies": {
|
|
123
|
-
"@astryxdesign/charts": "0.6.3-canary.
|
|
124
|
-
"@astryxdesign/core": "0.6.3-canary.
|
|
125
|
-
"@astryxdesign/lab": "0.6.3-canary.
|
|
126
|
-
"@astryxdesign/theme-neutral": "0.6.3-canary.
|
|
124
|
+
"@astryxdesign/charts": "0.6.3-canary.db52d98",
|
|
125
|
+
"@astryxdesign/core": "0.6.3-canary.db52d98",
|
|
126
|
+
"@astryxdesign/lab": "0.6.3-canary.db52d98",
|
|
127
|
+
"@astryxdesign/theme-neutral": "0.6.3-canary.db52d98",
|
|
127
128
|
"@heroicons/react": "^2.2.0",
|
|
128
129
|
"@stylexjs/stylex": "^0.19.0",
|
|
129
130
|
"@types/babel__core": "^7.20.5",
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"generatedBy": "scripts/generate-cli-themes.mjs",
|
|
4
|
-
"themes": [
|
|
5
|
-
{
|
|
6
|
-
"slug": "butter",
|
|
7
|
-
"displayName": "Butter",
|
|
8
|
-
"description": "Warm, creamy yellows with a friendly blue accent. Playful enough for consumer surfaces, soft enough to stay readable.",
|
|
9
|
-
"maintained": false,
|
|
10
|
-
"entry": "butterTheme.ts",
|
|
11
|
-
"exportName": "butterTheme",
|
|
12
|
-
"files": [
|
|
13
|
-
"butterTheme.ts",
|
|
14
|
-
"icons.tsx"
|
|
15
|
-
]
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"slug": "chocolate",
|
|
19
|
-
"displayName": "Chocolate",
|
|
20
|
-
"description": "Warm chocolate theme for Astryx — rich brown palette with Fraunces headings, Albert Sans body, and Lucide icons",
|
|
21
|
-
"maintained": false,
|
|
22
|
-
"entry": "chocolateTheme.ts",
|
|
23
|
-
"exportName": "chocolateTheme",
|
|
24
|
-
"files": [
|
|
25
|
-
"chocolateTheme.ts",
|
|
26
|
-
"icons.tsx"
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"slug": "gothic",
|
|
31
|
-
"displayName": "Gothic",
|
|
32
|
-
"description": "Deep blue-grays and a signature display serif. Dramatic and editorial, for surfaces that want to be remembered.",
|
|
33
|
-
"maintained": false,
|
|
34
|
-
"entry": "gothicTheme.ts",
|
|
35
|
-
"exportName": "gothicTheme",
|
|
36
|
-
"files": [
|
|
37
|
-
"gothicTheme.ts",
|
|
38
|
-
"icons.tsx"
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"slug": "matcha",
|
|
43
|
-
"displayName": "Matcha",
|
|
44
|
-
"description": "Earthy greens with a calm, organic feel. Naturalistic and grounded, great for wellness or content-first apps.",
|
|
45
|
-
"maintained": false,
|
|
46
|
-
"entry": "matchaTheme.ts",
|
|
47
|
-
"exportName": "matchaTheme",
|
|
48
|
-
"files": [
|
|
49
|
-
"matchaTheme.ts",
|
|
50
|
-
"icons.tsx"
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"slug": "neutral",
|
|
55
|
-
"displayName": "Neutral",
|
|
56
|
-
"description": "Restrained warm grays. Minimal and quiet, so the content stays the focus.",
|
|
57
|
-
"maintained": true,
|
|
58
|
-
"entry": "neutralTheme.ts",
|
|
59
|
-
"exportName": "neutralTheme",
|
|
60
|
-
"files": [
|
|
61
|
-
"neutralTheme.ts",
|
|
62
|
-
"icons.tsx",
|
|
63
|
-
"neutralPalettes.ts",
|
|
64
|
-
"neutralPalettes.generated.ts",
|
|
65
|
-
"neutralPaletteRefs.generated.ts",
|
|
66
|
-
"neutralPalettes.generated.receipt.json",
|
|
67
|
-
"palette.config.json"
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"slug": "stone",
|
|
72
|
-
"displayName": "Stone",
|
|
73
|
-
"description": "Warm stone and slate, earthy and understated, with just enough character to feel handcrafted.",
|
|
74
|
-
"maintained": false,
|
|
75
|
-
"entry": "stoneTheme.ts",
|
|
76
|
-
"exportName": "stoneTheme",
|
|
77
|
-
"files": [
|
|
78
|
-
"stoneTheme.ts",
|
|
79
|
-
"icons.tsx"
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"slug": "y2k",
|
|
84
|
-
"displayName": "Y2K",
|
|
85
|
-
"description": "Hot pinks, lime greens, and Poppins. Bubbly, playful, and unmistakably retro.",
|
|
86
|
-
"maintained": false,
|
|
87
|
-
"entry": "y2kTheme.ts",
|
|
88
|
-
"exportName": "y2kTheme",
|
|
89
|
-
"files": [
|
|
90
|
-
"y2kTheme.ts",
|
|
91
|
-
"icons.tsx"
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|