@astryxdesign/cli 0.6.3-canary.98a2e4e → 0.6.3-canary.9c4d44d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -79
- package/api/blog/blog.doc.mjs +1 -0
- package/api/build/_adapter.d.mts +50 -0
- package/api/build/_adapter.mjs +60 -0
- package/api/build/build.doc.mjs +16 -9
- package/api/build/build.test.mjs +197 -8
- package/api/build/build.type.d.mts +91 -2
- package/api/build/build.type.mjs +52 -8
- package/api/build/help/help.d.mts +12 -5
- package/api/build/help/help.mjs +69 -6
- package/api/build/kit/kit.d.mts +4 -1
- package/api/build/kit/kit.mjs +165 -49
- package/api/build/kit/rank.d.mts +44 -0
- package/api/build/kit/rank.mjs +432 -0
- package/api/build/kit/rank.test.mjs +196 -0
- package/api/component/_adapter.d.mts +6 -12
- package/api/component/_adapter.mjs +20 -10
- package/api/component/component.doc.mjs +13 -3
- package/api/component/component.mjs +91 -14
- package/api/component/component.test.mjs +38 -0
- package/api/component/component.type.d.mts +22 -11
- package/api/component/component.type.mjs +32 -24
- package/api/component/detail/blocks/blocks.d.mts +2 -1
- package/api/component/detail/blocks/blocks.mjs +4 -3
- package/api/component/list/list.d.mts +0 -5
- package/api/component/list/list.mjs +40 -11
- package/api/discover/_adapter.d.mts +114 -6
- package/api/discover/_adapter.mjs +372 -17
- package/api/discover/_adapter.test.mjs +215 -0
- package/api/discover/_catalog-view.d.mts +115 -0
- package/api/discover/_catalog-view.mjs +203 -0
- package/api/discover/_catalog-view.test.mjs +128 -0
- package/api/discover/detail/detail.d.mts +18 -6
- package/api/discover/detail/detail.mjs +67 -13
- package/api/discover/detail/detail.test.mjs +85 -0
- package/api/discover/detail/item/item.d.mts +26 -0
- package/api/discover/detail/item/item.mjs +78 -0
- package/api/discover/detail/item/item.test.mjs +73 -0
- package/api/discover/discover.d.mts +3 -9
- package/api/discover/discover.doc.mjs +62 -18
- package/api/discover/discover.mjs +220 -36
- package/api/discover/discover.test.mjs +11 -2
- package/api/discover/discover.type.d.mts +150 -11
- package/api/discover/discover.type.mjs +107 -17
- package/api/discover/list/list.d.mts +20 -6
- package/api/discover/list/list.mjs +45 -12
- package/api/discover/list/list.test.mjs +46 -0
- package/api/discover/search/search.d.mts +18 -16
- package/api/discover/search/search.mjs +102 -56
- package/api/discover/search/search.test.mjs +144 -10
- package/api/docs/_adapter.d.mts +268 -47
- package/api/docs/_adapter.mjs +970 -149
- package/api/docs/compiled-topics.test.mjs +78 -0
- package/api/docs/detail/detail.d.mts +0 -15
- package/api/docs/detail/detail.mjs +22 -78
- package/api/docs/detail/section/section.mjs +39 -24
- package/api/docs/detail/section/section.test.mjs +19 -9
- package/api/docs/docs.d.mts +5 -3
- package/api/docs/docs.doc.mjs +39 -17
- package/api/docs/docs.mjs +44 -8
- package/api/docs/docs.test.mjs +158 -4
- package/api/docs/docs.type.d.mts +185 -6
- package/api/docs/docs.type.mjs +127 -13
- package/api/docs/index/index.mjs +15 -6
- package/api/docs/index/index.test.mjs +1 -1
- package/api/docs/integration-tree.test.mjs +555 -0
- package/api/docs/integrationDocs.test.mjs +14 -14
- package/api/docs/list/list.mjs +28 -12
- package/api/docs/node/node.d.mts +43 -0
- package/api/docs/node/node.mjs +192 -0
- package/api/docs/reference-blocks.test.mjs +406 -0
- package/api/doctor/doctor.d.mts +54 -4
- package/api/doctor/doctor.doc.mjs +1 -0
- package/api/doctor/doctor.mjs +332 -21
- package/api/doctor/doctor.test.mjs +420 -7
- package/api/gap-report/gap-report.doc.mjs +8 -4
- package/api/hook/_adapter.mjs +19 -5
- package/api/hook/hook.doc.mjs +1 -0
- package/api/hook/hook.type.d.mts +3 -3
- package/api/hook/hook.type.mjs +11 -11
- package/api/hook/list/list.d.mts +1 -1
- package/api/hook/list/list.mjs +69 -17
- package/api/index.d.mts +1 -1
- package/api/index.mjs +1 -0
- package/api/init/init.doc.mjs +6 -1
- package/api/init/init.test.mjs +41 -1
- package/api/init/remove/remove.mjs +1 -1
- package/api/init/run/run.mjs +20 -10
- package/api/integration/add-contribution.component-names.test.mjs +120 -0
- package/api/integration/add-contribution.d.mts +2 -1
- package/api/integration/add-contribution.mjs +130 -15
- package/api/integration/add-contribution.test.mjs +258 -7
- package/api/integration/add-helpers.d.mts +5 -2
- package/api/integration/add-helpers.mjs +36 -9
- package/api/integration/add-theme.mjs +34 -64
- package/api/integration/add-theme.test.mjs +105 -21
- package/api/integration/authoring-checks.mjs +138 -28
- package/api/integration/authoring-checks.test.mjs +179 -7
- package/api/integration/authoring-checks.type.mjs +6 -1
- package/api/integration/integration-authoring.type.d.mts +2 -0
- package/api/integration/integration-authoring.type.mjs +2 -0
- package/api/integration/integration-block-exports.test.mjs +10 -6
- package/api/integration/integrationAdd.doc.mjs +14 -4
- package/api/integration/integrationAddAgentDoc.doc.mjs +1 -0
- package/api/integration/integrationAddCodemod.doc.mjs +1 -0
- package/api/integration/integrationAddComponent.doc.mjs +2 -1
- package/api/integration/integrationAddDoc.doc.mjs +8 -1
- package/api/integration/integrationAddTemplate.doc.mjs +1 -0
- package/api/integration/integrationAddTheme.doc.mjs +6 -5
- package/api/integration/integrationComponentConflicts.doc.mjs +1 -0
- package/api/integration/integrationDocConflicts.doc.mjs +2 -1
- package/api/integration/integrationPackCheck.doc.mjs +2 -1
- package/api/integration/integrationTemplateConflicts.doc.d.mts +3 -0
- package/api/integration/integrationTemplateConflicts.doc.mjs +4 -0
- package/api/integration/pack-check.mjs +83 -7
- package/api/integration/pack-check.test.mjs +387 -47
- package/api/integration/pack-check.type.d.mts +26 -2
- package/api/integration/pack-check.type.mjs +14 -1
- package/api/integration/summarizeIssues.doc.mjs +1 -0
- package/api/integration/template-conflict-compatibility.test.mjs +73 -0
- package/api/integration/validate-integration-fixes.test.mjs +1389 -0
- package/api/integration/validate-integration.mjs +52 -102
- package/api/integration/validate-integration.test.mjs +179 -26
- package/api/integration/validate-unread-theme-folders.test.mjs +110 -0
- package/api/integration/validateIntegration.doc.mjs +3 -2
- package/api/json/assertResponse.doc.mjs +1 -0
- package/api/json/envelope-types.test.mjs +76 -0
- package/api/json/index.ts +2 -0
- package/api/json/isError.doc.mjs +1 -0
- package/api/json/parseResponse.doc.mjs +3 -2
- package/api/layout/_adapter.mjs +20 -5
- package/api/layout/expand/expand.mjs +7 -5
- package/api/layout/expand/expand.path-safety.test.mjs +53 -0
- package/api/layout/grammar/grammar.mjs +2 -1
- package/api/layout/layoutCheck.doc.mjs +1 -0
- package/api/layout/layoutExpand.doc.mjs +2 -1
- package/api/layout/layoutGrammar.doc.mjs +1 -0
- package/api/search/search-return-type.test.mjs +54 -0
- package/api/search/search.d.mts +61 -10
- package/api/search/search.doc.mjs +8 -2
- package/api/search/search.mjs +471 -83
- package/api/search/search.test.mjs +124 -1
- package/api/search/search.type.d.mts +14 -2
- package/api/search/search.type.mjs +5 -2
- package/api/swizzle/copy/copy.mjs +28 -11
- package/api/swizzle/swizzle.doc.mjs +2 -1
- package/api/swizzle/swizzle.type.d.mts +2 -2
- package/api/swizzle/swizzle.type.mjs +2 -2
- package/api/template/copy/copy.mjs +17 -23
- package/api/template/copy/copy.test.mjs +17 -0
- package/api/template/list/list.mjs +1 -0
- package/api/template/table-floating-bulk-actions.test.mjs +66 -0
- package/api/template/template-integration.test.mjs +1072 -3
- package/api/template/template-suffix.test.mjs +41 -21
- package/api/template/template.doc.mjs +30 -8
- package/api/template/template.mjs +45 -8
- package/api/template/template.type.d.mts +11 -13
- package/api/template/template.type.mjs +15 -14
- package/api/theme/_adapter.d.mts +2 -3
- package/api/theme/_adapter.mjs +4 -5
- package/api/theme/add/add.binary.test.mjs +84 -0
- package/api/theme/add/add.mjs +31 -22
- package/api/theme/add/add.rollback.test.mjs +158 -0
- package/api/theme/add/add.staging.test.mjs +83 -0
- package/api/theme/add/add.test.mjs +14 -1
- package/api/theme/build/build.family.test.mjs +7 -12
- package/api/theme/build/build.mjs +140 -59
- package/api/theme/build/build.public-component-vars.test.mjs +1 -1
- package/api/theme/build/build.receipt-doc.test.mjs +111 -0
- package/api/theme/build/build.rollback.test.mjs +148 -0
- package/api/theme/build/build.test.mjs +127 -0
- package/api/theme/build/font-warning.mjs +3 -3
- package/api/theme/build/font-warning.test.mjs +5 -2
- package/api/theme/generateTonalPalette.doc.mjs +1 -0
- package/api/theme/integration-themes.test.mjs +39 -28
- package/api/theme/list/list.test.mjs +19 -20
- package/api/theme/listThemes.doc.mjs +6 -5
- package/api/theme/palette/generate/generate.mjs +8 -3
- package/api/theme/palette/generate/generate.test.mjs +96 -0
- package/api/theme/palette/generate/generator.d.mts +10 -13
- package/api/theme/palette/generate/generator.mjs +15 -4
- package/api/theme/palette/generate/generator.test.mjs +10 -0
- package/api/theme/template/template.mjs +11 -2
- package/api/theme/template/template.test.mjs +20 -0
- package/api/theme/theme.type.d.mts +170 -11
- package/api/theme/theme.type.mjs +94 -27
- package/api/theme/themeAdd.doc.mjs +4 -3
- package/api/theme/themeBuild.doc.mjs +8 -4
- package/api/theme/themeList.doc.mjs +6 -3
- package/api/theme/themeListAvailable.doc.mjs +5 -3
- package/api/theme/themePaletteGenerate.doc.mjs +1 -0
- package/api/theme/themeTargets.doc.mjs +1 -0
- package/api/theme/themeTemplate.doc.mjs +6 -2
- package/api/upgrade/_adapter.d.mts +32 -5
- package/api/upgrade/_adapter.mjs +124 -73
- package/api/upgrade/list/list.mjs +2 -1
- package/api/upgrade/list/list.test.mjs +73 -0
- package/api/upgrade/provider-agreement.test.mjs +152 -0
- package/api/upgrade/run/run.mjs +356 -59
- package/api/upgrade/status/status.mjs +2 -2
- package/api/upgrade/upgrade.doc.mjs +8 -2
- package/api/upgrade/upgrade.type.d.mts +42 -4
- package/api/upgrade/upgrade.type.mjs +26 -10
- package/assets/codemods/__tests__/runner.test.mjs +330 -8
- package/assets/codemods/integration-discovery.mjs +48 -4
- package/assets/codemods/integration-discovery.test.mjs +73 -0
- package/assets/codemods/integration-runner.mjs +56 -4
- package/assets/codemods/integration-runner.protection.test.mjs +153 -0
- package/assets/codemods/run-codemod.mjs +177 -34
- package/assets/codemods/runner.mjs +350 -102
- package/assets/codemods/term-log.mjs +32 -8
- package/assets/codemods/term-log.test.mjs +19 -1
- package/assets/codemods/transform-prop.mjs +109 -0
- package/assets/codemods/transform-prop.test.mjs +95 -0
- package/assets/codemods/transforms/next/__tests__/migrate-native-picker-to-presentation.test.mjs +63 -0
- package/assets/codemods/transforms/next/__tests__/migrate-theme-catalog-to-descriptors.test.mjs +220 -0
- package/assets/codemods/transforms/next/index.mjs +19 -1
- package/assets/codemods/transforms/next/migrate-native-picker-to-presentation.mjs +148 -0
- package/assets/codemods/transforms/next/migrate-theme-catalog-to-descriptors.mjs +141 -0
- package/assets/codemods/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +86 -165
- package/assets/codemods/transforms/v0.0.14/rename-status-variants.mjs +72 -210
- package/assets/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +83 -115
- package/assets/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +57 -186
- package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +27 -5
- package/assets/codemods/transforms/v0.3.0/unwrap-authoring-factories.mjs +20 -5
- package/assets/codemods/transforms/v0.6.0/__tests__/next-codemods.test.mjs +47 -0
- package/assets/codemods/transforms/v0.6.0/rename-resizable-pixel-bounds.mjs +57 -10
- package/assets/docs/getting-started.doc.mjs +2 -2
- package/assets/docs/internationalization.doc.mjs +7 -5
- package/assets/docs/layout.doc.dense.mjs +2 -2
- package/assets/docs/layout.doc.mjs +1 -1
- package/assets/docs/principles.doc.mjs +6 -6
- package/assets/docs/styling-libraries.doc.mjs +4 -4
- package/assets/docs/styling.doc.mjs +4 -4
- package/assets/docs/theme.doc.mjs +5 -5
- package/assets/docs/tokens.doc.mjs +1 -1
- package/assets/docs/tree/api.doc.mjs +30 -0
- package/assets/docs/tree/cli.doc.mjs +23 -0
- package/assets/docs/tree/commands.doc.mjs +25 -0
- package/assets/docs/{cli-integrations.doc.mjs → tree/integrations.doc.mjs} +95 -39
- package/assets/docs/tree/integrations.test.mjs +62 -0
- package/assets/docs/tree/writing-docs.doc.mjs +286 -0
- package/assets/docs/working-with-ai.doc.mjs +4 -4
- package/assets/templates/blocks/components/CheckboxList/CheckboxListSelectAllPattern.doc.mjs +1 -1
- package/assets/templates/blocks/components/CheckboxList/CheckboxListSelectAllPattern.tsx +1 -3
- package/assets/templates/blocks/components/DateInput/DateInputDateRange.tsx +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +14 -0
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +100 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.tsx +61 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.tsx +126 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.tsx +86 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.tsx +99 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.tsx +122 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.doc.mjs +14 -0
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.tsx +95 -0
- package/assets/templates/blocks/components/Table/TableBulkActionsTable.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +71 -0
- package/assets/templates/blocks/components/Table/TableFloatingBulkActionsTable.doc.mjs +19 -0
- package/assets/templates/blocks/components/Table/TableFloatingBulkActionsTable.tsx +139 -0
- package/assets/templates/blocks/components/TimeInput/TimeInputConstrained.tsx +1 -0
- package/assets/templates/pages/table-tree/page.tsx +1704 -0
- package/assets/templates/pages/table-tree/template.doc.mjs +12 -0
- package/assets/templates/themes/butter/butterTheme.doc.mjs +11 -0
- package/assets/templates/themes/chocolate/chocolateTheme.doc.mjs +11 -0
- package/assets/templates/themes/gothic/gothicTheme.doc.mjs +11 -0
- package/assets/templates/themes/matcha/matchaTheme.doc.mjs +11 -0
- package/assets/templates/themes/neutral/neutralTheme.doc.mjs +11 -0
- package/assets/templates/themes/stone/stoneTheme.doc.mjs +11 -0
- package/assets/templates/themes/y2k/y2kTheme.doc.mjs +11 -0
- package/authoring/_shared/contract.ts +22 -0
- package/authoring/codemod/codemod.doc.mjs +7 -2
- package/authoring/codemod/parse.d.mts +8 -8
- package/authoring/codemod/parse.mjs +8 -6
- package/authoring/codemod/type.ts +12 -0
- package/authoring/config/config.doc.mjs +10 -2
- package/authoring/config/debug-composition.test.mjs +92 -0
- package/authoring/config/parse.d.mts +15 -13
- package/authoring/config/parse.mjs +27 -8
- package/authoring/config/parse.test.mjs +8 -0
- package/authoring/config/type.ts +29 -6
- package/authoring/debug/debug.doc.d.mts +11 -0
- package/authoring/debug/debug.doc.mjs +182 -0
- package/authoring/debug/parse.d.mts +7 -7
- package/authoring/debug/parse.mjs +3 -3
- package/authoring/discover/discover.doc.d.mts +13 -0
- package/authoring/discover/discover.doc.mjs +138 -0
- package/authoring/discover/parse.d.mts +24 -0
- package/authoring/discover/parse.mjs +128 -0
- package/authoring/discover/parse.test.mjs +124 -0
- package/authoring/discover/type.ts +87 -0
- package/authoring/doctypes/_schema.d.mts +240 -128
- package/authoring/doctypes/_schema.mjs +198 -16
- package/authoring/doctypes/base/graph-fields.doc.mjs +15 -6
- package/authoring/doctypes/base/type.ts +9 -4
- package/authoring/doctypes/command/command.doc.mjs +4 -3
- package/authoring/doctypes/command/parse.d.mts +2 -2
- package/authoring/doctypes/command/parse.mjs +1 -1
- package/authoring/doctypes/command/type.ts +4 -4
- package/authoring/doctypes/component/component.doc.mjs +5 -2
- package/authoring/doctypes/component/parse.d.mts +2 -2
- package/authoring/doctypes/component/parse.mjs +1 -1
- package/authoring/doctypes/component/type.ts +3 -3
- package/authoring/doctypes/doctypes-new.test.mjs +48 -6
- package/authoring/doctypes/enum/enum.doc.mjs +1 -1
- package/authoring/doctypes/enum/parse.d.mts +2 -2
- package/authoring/doctypes/enum/parse.mjs +1 -1
- package/authoring/doctypes/enum/type.ts +2 -2
- package/authoring/doctypes/function/function.doc.mjs +7 -2
- package/authoring/doctypes/function/parse.d.mts +2 -2
- package/authoring/doctypes/function/parse.mjs +1 -1
- package/authoring/doctypes/function/type.ts +4 -3
- package/authoring/doctypes/hook/hook.doc.mjs +4 -0
- package/authoring/doctypes/hook/parse.d.mts +2 -2
- package/authoring/doctypes/hook/parse.mjs +1 -1
- package/authoring/doctypes/hook/type.ts +3 -3
- package/authoring/doctypes/legacy.d.mts +6 -6
- package/authoring/doctypes/legacy.mjs +3 -3
- package/authoring/doctypes/load-contract.test.mjs +233 -0
- package/authoring/doctypes/namespace/namespace.doc.mjs +9 -9
- package/authoring/doctypes/namespace/parse.d.mts +2 -2
- package/authoring/doctypes/namespace/parse.mjs +1 -1
- package/authoring/doctypes/namespace/parse.test.mjs +23 -25
- package/authoring/doctypes/namespace/type.ts +6 -3
- package/authoring/doctypes/parse.d.mts +22 -20
- package/authoring/doctypes/parse.mjs +19 -14
- package/authoring/doctypes/reference/parse.d.mts +2 -2
- package/authoring/doctypes/reference/parse.mjs +1 -1
- package/authoring/doctypes/reference/reference.doc.mjs +39 -6
- package/authoring/doctypes/reference/type.ts +31 -14
- package/authoring/doctypes/schema/parse.d.mts +2 -2
- package/authoring/doctypes/schema/parse.mjs +1 -1
- package/authoring/doctypes/schema/schema.doc.mjs +1 -1
- package/authoring/doctypes/schema/type.ts +3 -4
- package/authoring/doctypes/template/parse.d.mts +94 -1
- package/authoring/doctypes/template/parse.mjs +37 -1
- package/authoring/doctypes/template/parse.test.mjs +18 -0
- package/authoring/doctypes/template/template.doc.mjs +13 -3
- package/authoring/doctypes/template/type.ts +12 -1
- package/authoring/doctypes/theme/parse.d.mts +35 -0
- package/authoring/doctypes/theme/parse.mjs +76 -0
- package/authoring/doctypes/theme/theme.doc.d.mts +9 -0
- package/authoring/doctypes/theme/theme.doc.mjs +79 -0
- package/authoring/doctypes/theme/type.ts +42 -0
- package/authoring/doctypes/types.ts +12 -11
- package/authoring/gap-report/gap-report.doc.d.mts +12 -0
- package/authoring/gap-report/gap-report.doc.mjs +183 -0
- package/authoring/gap-report/parse.d.mts +9 -9
- package/authoring/gap-report/parse.mjs +6 -6
- package/authoring/gap-report/type.ts +1 -1
- package/authoring/identity/identity.doc.mjs +3 -2
- package/authoring/identity/type.ts +10 -10
- package/authoring/index.d.mts +2 -0
- package/authoring/index.d.ts +32 -19
- package/authoring/index.mjs +3 -1
- package/authoring/integration/integration.doc.mjs +2 -2
- package/authoring/integration/parse.d.mts +2 -2
- package/authoring/integration/parse.mjs +1 -1
- package/authoring/integration/schema.d.mts +4 -4
- package/authoring/integration/schema.mjs +3 -3
- package/authoring/integration/type.ts +5 -11
- package/clients/cli/__tests__/cliManifest.test.ts +27 -29
- package/clients/cli/command-load-failure.test.mjs +83 -0
- package/clients/cli/commands/blog.doc.mjs +1 -1
- package/clients/cli/commands/blog.mjs +23 -8
- package/clients/cli/commands/blog.test.mjs +42 -1
- package/clients/cli/commands/build-theme.adaptations.test.mjs +100 -1
- package/clients/cli/commands/build-theme.ascii-output.test.mjs +161 -0
- package/clients/cli/commands/build-theme.flag-docs.test.mjs +110 -0
- package/clients/cli/commands/build-theme.mjs +16 -50
- package/clients/cli/commands/build-theme.path-safety.test.mjs +86 -1
- package/clients/cli/commands/build-theme.variants.test.mjs +76 -0
- package/clients/cli/commands/build.doc.mjs +16 -8
- package/clients/cli/commands/build.exit-codes-doc.test.mjs +50 -0
- package/clients/cli/commands/build.mjs +137 -114
- package/clients/cli/commands/build.playbook.test.mjs +75 -0
- package/clients/cli/commands/build.text-fields.test.mjs +81 -0
- package/clients/cli/commands/component/index.mjs +3 -8
- package/clients/cli/commands/component-ownership.test.mjs +3 -3
- package/clients/cli/commands/component-package.test.mjs +46 -0
- package/clients/cli/commands/component-resolution.test.mjs +21 -0
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/component.test.mjs +19 -0
- package/clients/cli/commands/detail-levels.test.mjs +2 -2
- package/clients/cli/commands/discover.broken-integration.test.mjs +52 -5
- package/clients/cli/commands/discover.components-flag.test.mjs +97 -0
- package/clients/cli/commands/discover.doc.mjs +55 -9
- package/clients/cli/commands/discover.mjs +393 -118
- package/clients/cli/commands/discover.sources.test.mjs +267 -0
- package/clients/cli/commands/discover.text-projection.test.mjs +103 -0
- package/clients/cli/commands/docs.doc.mjs +21 -9
- package/clients/cli/commands/docs.mjs +184 -70
- package/clients/cli/commands/docs.test.mjs +120 -16
- package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +3 -3
- package/clients/cli/commands/doctor-integration-templates.doc.mjs +15 -8
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration.package-json.test.mjs +53 -0
- package/clients/cli/commands/doctor-integration.test.mjs +90 -8
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.mjs +59 -32
- package/clients/cli/commands/doctor.test.mjs +42 -0
- package/clients/cli/commands/gap-report.doc.mjs +17 -6
- package/clients/cli/commands/gap-report.test.mjs +72 -0
- package/clients/cli/commands/hook/index.mjs +7 -17
- package/clients/cli/commands/hook.doc.mjs +1 -1
- package/clients/cli/commands/hook.text-projection.test.mjs +45 -0
- package/clients/cli/commands/init.doc.mjs +20 -9
- package/clients/cli/commands/init.flag-help.test.mjs +153 -0
- package/clients/cli/commands/integration-add.controls.test.mjs +132 -0
- package/clients/cli/commands/integration-add.doc.mjs +32 -6
- package/clients/cli/commands/integration-authoring.test.mjs +13 -9
- package/clients/cli/commands/integration-pack.doc.mjs +1 -1
- package/clients/cli/commands/integration-real-world.test.mjs +3 -9
- package/clients/cli/commands/integration.doc.mjs +1 -1
- package/clients/cli/commands/integration.mjs +1 -0
- package/clients/cli/commands/interactive-guard.test.mjs +101 -24
- package/clients/cli/commands/json-contract.test.mjs +33 -0
- package/clients/cli/commands/layout-check.doc.mjs +15 -4
- package/clients/cli/commands/layout-expand.doc.mjs +22 -5
- package/clients/cli/commands/layout-grammar.doc.mjs +1 -1
- package/clients/cli/commands/layout.doc.mjs +3 -3
- package/clients/cli/commands/layout.mjs +21 -9
- package/clients/cli/commands/layout.path-help.test.mjs +33 -0
- package/clients/cli/commands/layout.stdin-cap.test.mjs +47 -0
- package/clients/cli/commands/layout.text-fields.test.mjs +39 -0
- package/clients/cli/commands/manifest.doc.mjs +1 -1
- package/clients/cli/commands/no-prompt-wording.test.mjs +94 -0
- package/clients/cli/commands/search.doc.mjs +7 -4
- package/clients/cli/commands/search.mjs +28 -9
- package/clients/cli/commands/search.test.mjs +75 -0
- package/clients/cli/commands/setup-nudge.test.mjs +6 -0
- package/clients/cli/commands/swizzle.doc.mjs +3 -2
- package/clients/cli/commands/swizzle.path-safety.test.mjs +42 -0
- package/clients/cli/commands/template.doc.mjs +52 -13
- package/clients/cli/commands/template.flag-help.test.mjs +117 -0
- package/clients/cli/commands/template.mjs +4 -91
- package/clients/cli/commands/template.path-help.test.mjs +40 -0
- package/clients/cli/commands/text-json-parity.test.mjs +719 -0
- package/clients/cli/commands/theme-add.doc.mjs +4 -3
- package/clients/cli/commands/theme-build.doc.mjs +8 -7
- package/clients/cli/commands/theme-list.doc.mjs +2 -2
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -3
- package/clients/cli/commands/theme-palette-generate.test.mjs +19 -0
- package/clients/cli/commands/theme-palette.doc.mjs +1 -1
- package/clients/cli/commands/theme-targets.behavior.test.mjs +4 -3
- package/clients/cli/commands/theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/theme-template.behavior.test.mjs +12 -0
- package/clients/cli/commands/theme-template.doc.mjs +2 -2
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/upgrade.ascii-output.test.mjs +87 -0
- package/clients/cli/commands/upgrade.doc.mjs +20 -8
- package/clients/cli/commands/upgrade.file-protection.test.mjs +228 -0
- package/clients/cli/commands/upgrade.flag-help.test.mjs +188 -0
- package/clients/cli/commands/upgrade.hook-output.test.mjs +88 -0
- package/clients/cli/commands/upgrade.mjs +29 -7
- package/clients/cli/formatters/index.mjs +2 -0
- package/clients/cli/formatters/index.test.mjs +6 -0
- package/clients/cli/index.mjs +21 -30
- package/clients/cli/latest-version-env.test.mjs +50 -0
- package/clients/cli/lib/cli-error.test.mjs +7 -0
- package/clients/cli/lib/component-format.mjs +9 -9
- package/clients/cli/lib/component-format.test.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +32 -6
- package/clients/cli/lib/doc-text-ascii.test.mjs +82 -0
- package/clients/cli/lib/exit-codes.test.mjs +97 -0
- package/clients/cli/lib/hook-format.mjs +19 -10
- package/clients/cli/lib/json-shim.mjs +38 -2
- package/clients/cli/lib/json-shim.test.mjs +83 -0
- package/clients/cli/lib/manifest.d.ts +2 -0
- package/clients/cli/lib/manifest.mjs +32 -2
- package/clients/cli/lib/manifest.test.mjs +17 -0
- package/foundation/agent-docs/agent-docs.d.mts +7 -2
- package/foundation/agent-docs/agent-docs.mjs +82 -12
- package/foundation/agent-docs/agent-docs.path-safety.test.mjs +266 -4
- package/foundation/agent-docs/agent-docs.test.mjs +19 -1
- package/foundation/config/integration-debug.test.mjs +28 -3
- package/foundation/config/project-themes.test.mjs +11 -19
- package/foundation/config/project.d.mts +20 -11
- package/foundation/config/project.mjs +246 -89
- package/foundation/config/project.test.mjs +270 -21
- package/foundation/discovery/authoring-self-docs.d.mts +18 -0
- package/foundation/discovery/authoring-self-docs.mjs +38 -15
- package/foundation/discovery/authoring-self-docs.test.mjs +87 -12
- package/foundation/discovery/authoring-surface.d.mts +74 -0
- package/foundation/discovery/authoring-surface.mjs +525 -0
- package/foundation/discovery/authoring-surface.test.mjs +392 -0
- package/foundation/discovery/cli-self-docs.d.mts +119 -0
- package/foundation/discovery/cli-self-docs.mjs +490 -0
- package/foundation/discovery/cli-self-docs.test.mjs +375 -0
- package/foundation/discovery/component-discovery.d.mts +38 -0
- package/foundation/discovery/component-discovery.mjs +48 -0
- package/foundation/discovery/component-loader.d.mts +35 -38
- package/foundation/discovery/component-loader.mjs +53 -222
- package/foundation/discovery/docs-discovery.d.mts +114 -9
- package/foundation/discovery/docs-discovery.mjs +239 -30
- package/foundation/discovery/docs-discovery.test.mjs +150 -35
- package/foundation/discovery/docs-output-budget.d.mts +2 -2
- package/foundation/discovery/docs-output-budget.mjs +1 -1
- package/foundation/discovery/docs-section-key.d.mts +28 -10
- package/foundation/discovery/docs-section-key.mjs +134 -33
- package/foundation/discovery/docs-section-key.test.mjs +41 -19
- package/foundation/discovery/template-adapter.d.mts +113 -11
- package/foundation/discovery/template-adapter.fixture-refs.test.mjs +248 -0
- package/foundation/discovery/template-adapter.integration-isolation.test.mjs +94 -0
- package/foundation/discovery/template-adapter.mjs +772 -82
- package/foundation/discovery/template-adapter.test.mjs +57 -0
- package/foundation/discovery/template-conflict-release.d.mts +13 -0
- package/foundation/discovery/template-conflict-release.mjs +40 -0
- package/foundation/discovery/template-conflict-release.test.mjs +40 -0
- package/foundation/discovery/theme-discovery.d.mts +67 -7
- package/foundation/discovery/theme-discovery.mjs +916 -186
- package/foundation/discovery/theme-discovery.test.mjs +613 -219
- package/foundation/discovery/theming-targets.test.mjs +4 -0
- package/foundation/doc-compiler/bundle.d.mts +47 -0
- package/foundation/doc-compiler/bundle.mjs +278 -0
- package/foundation/doc-compiler/bundle.test.mjs +266 -0
- package/foundation/doc-compiler/compile.d.mts +343 -0
- package/foundation/doc-compiler/compile.mjs +558 -0
- package/foundation/doc-compiler/diagnostics.d.mts +126 -0
- package/foundation/doc-compiler/diagnostics.mjs +305 -0
- package/foundation/doc-compiler/doc-compiler.test.mjs +714 -0
- package/foundation/doc-compiler/doc-loads.test.mjs +1642 -0
- package/foundation/doc-compiler/import.d.mts +24 -0
- package/foundation/doc-compiler/import.mjs +59 -0
- package/foundation/doc-compiler/inputs.d.mts +102 -0
- package/foundation/doc-compiler/inputs.mjs +291 -0
- package/foundation/doc-compiler/inputs.test.mjs +299 -0
- package/foundation/doc-compiler/ir.d.mts +22 -0
- package/foundation/doc-compiler/ir.mjs +471 -0
- package/foundation/doc-compiler/lenses.d.mts +36 -0
- package/foundation/doc-compiler/lenses.mjs +173 -0
- package/foundation/doc-compiler/links.d.mts +162 -0
- package/foundation/doc-compiler/links.mjs +294 -0
- package/foundation/doc-compiler/links.test.mjs +192 -0
- package/foundation/doc-compiler/lower-doc.test.mjs +495 -0
- package/foundation/doc-compiler/overlays.d.mts +37 -0
- package/foundation/doc-compiler/overlays.mjs +206 -0
- package/foundation/doc-compiler/parse-readable.d.mts +9 -0
- package/foundation/doc-compiler/parse-readable.mjs +29 -0
- package/foundation/doc-compiler/read.d.mts +127 -0
- package/foundation/doc-compiler/read.mjs +325 -0
- package/foundation/doc-compiler/read.test.mjs +313 -0
- package/foundation/doc-compiler/source.d.mts +33 -0
- package/foundation/doc-compiler/source.mjs +128 -0
- package/foundation/doc-compiler/tree.d.mts +288 -0
- package/foundation/doc-compiler/tree.mjs +876 -0
- package/foundation/doc-compiler/tree.test.mjs +598 -0
- package/foundation/fs/file-protection.d.mts +33 -0
- package/foundation/fs/file-protection.mjs +825 -0
- package/foundation/fs/file-protection.test.mjs +250 -0
- package/foundation/fs/module-loader.d.mts +1 -0
- package/foundation/fs/module-loader.mjs +50 -1
- package/foundation/fs/module-loader.stdout.test.mjs +332 -0
- package/foundation/fs/path-safety.d.mts +3 -2
- package/foundation/fs/path-safety.mjs +49 -19
- package/foundation/fs/path-safety.test.mjs +50 -0
- package/foundation/fs/publish-file-hardlink-unavailable.test.mjs +129 -94
- package/foundation/integrations/autolink.d.mts +58 -1
- package/foundation/integrations/autolink.mjs +143 -52
- package/foundation/integrations/autolink.test.mjs +1 -1
- package/foundation/integrations/cli-requirement.d.mts +45 -0
- package/foundation/integrations/cli-requirement.mjs +154 -0
- package/foundation/integrations/cli-requirement.test.mjs +84 -0
- package/foundation/integrations/contribution-fixes.d.mts +145 -0
- package/foundation/integrations/contribution-fixes.mjs +1284 -0
- package/foundation/integrations/contribution-inventory.d.mts +3 -2
- package/foundation/integrations/contribution-inventory.mjs +27 -24
- package/foundation/integrations/contribution-inventory.test.mjs +86 -27
- package/foundation/integrations/integration-warnings.d.mts +9 -2
- package/foundation/integrations/integration-warnings.mjs +51 -26
- package/foundation/integrations/integration-warnings.test.mjs +74 -1
- package/foundation/integrations/integrations.d.mts +17 -1
- package/foundation/integrations/integrations.mjs +52 -98
- package/foundation/integrations/integrations.test.mjs +31 -0
- package/foundation/integrations/provider-ledger.test.mjs +275 -0
- package/foundation/integrations/provider-resolution.d.mts +152 -0
- package/foundation/integrations/provider-resolution.mjs +576 -0
- package/foundation/integrations/provider-resolution.test.mjs +369 -0
- package/foundation/integrations/theme-descriptor.d.mts +8 -0
- package/foundation/integrations/theme-descriptor.mjs +44 -0
- package/foundation/integrations/validate-contributions.mjs +121 -29
- package/foundation/response/base.d.ts +8 -4
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.d.ts +2 -0
- package/foundation/response/error-codes.doc.mjs +13 -4
- package/foundation/response/error-codes.mjs +8 -2
- package/foundation/response/error-codes.test.mjs +137 -10
- package/foundation/response/json-contract.test.mjs +11 -0
- package/foundation/response/json.d.mts +4 -2
- package/foundation/response/json.mjs +8 -10
- package/foundation/response/response-types.doc.d.mts +5 -1
- package/foundation/response/response-types.doc.mjs +37 -22
- package/foundation/response/response-types.doc.test.mjs +158 -0
- package/foundation/response/response.doc.mjs +1 -1
- package/foundation/text/string-utils.d.mts +8 -0
- package/foundation/text/string-utils.mjs +40 -10
- package/foundation/xle/expand.d.mts +2 -0
- package/foundation/xle/expand.mjs +4 -3
- package/foundation/xle/expand.test.mjs +54 -0
- package/foundation/xle/xle.test.mjs +13 -0
- package/package.json +10 -11
- package/assets/templates/themes/manifest.json +0 -95
- package/clients/cli/lib/update-check.mjs +0 -83
- package/clients/cli/lib/update-check.test.mjs +0 -137
- package/clients/cli/update-hint-commands.test.mjs +0 -54
package/api/build/build.test.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file Tests for the build API (playbook
|
|
4
|
+
* @file Tests for the build API (playbook + the template-first kit).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {describe, it, expect, vi} from 'vitest';
|
|
@@ -20,10 +20,30 @@ const REPO = path.resolve(
|
|
|
20
20
|
vi.setConfig({testTimeout: 30000});
|
|
21
21
|
|
|
22
22
|
describe('build API', () => {
|
|
23
|
-
it('no query → build.help playbook
|
|
23
|
+
it('no query → build.help carries the playbook as data', async () => {
|
|
24
24
|
const r = await build();
|
|
25
25
|
expect(r.type).toBe('build.help');
|
|
26
|
-
|
|
26
|
+
if (r.type !== 'build.help') return;
|
|
27
|
+
expect(r.data.playbook).toBe(true);
|
|
28
|
+
expect(r.data.title).toMatch(/build a page/i);
|
|
29
|
+
expect(r.data.steps.length).toBeGreaterThan(0);
|
|
30
|
+
for (const step of r.data.steps) {
|
|
31
|
+
expect(step.title).toBeTruthy();
|
|
32
|
+
expect(step.commands.length).toBeGreaterThan(0);
|
|
33
|
+
}
|
|
34
|
+
expect(r.data.rules.length).toBeGreaterThan(0);
|
|
35
|
+
// Bare subcommands: the caller adds its own invocation.
|
|
36
|
+
const commands = [...r.data.steps.flatMap(s => s.commands), ...r.data.related];
|
|
37
|
+
for (const {command} of commands) expect(command).not.toMatch(/^(astryx|npx|pnpm|yarn|bunx?)\b/);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('the playbook scaffolds the named template before composing', async () => {
|
|
41
|
+
const r = await build();
|
|
42
|
+
if (r.type !== 'build.help') throw new Error(r.type);
|
|
43
|
+
const commands = r.data.steps.map(s => s.commands.map(c => c.command));
|
|
44
|
+
expect(commands[0][0]).toMatch(/^build /);
|
|
45
|
+
expect(commands[1]).toContain('template <name> <path>');
|
|
46
|
+
expect(JSON.stringify(r.data)).not.toMatch(/--skeleton|reference code/);
|
|
27
47
|
});
|
|
28
48
|
|
|
29
49
|
it('query → build.kit with raw entries + static frame/foundation', async () => {
|
|
@@ -65,10 +85,10 @@ describe('build API', () => {
|
|
|
65
85
|
expect(blocks.length).toBeLessThanOrEqual(5);
|
|
66
86
|
expect(domain.length).toBeLessThanOrEqual(6);
|
|
67
87
|
|
|
68
|
-
// Score floors: pages ≥ PAGE_FLOOR(50); blocks/domain ≥ DOMAIN_FLOOR(
|
|
88
|
+
// Score floors: pages ≥ PAGE_FLOOR(50); blocks/domain ≥ DOMAIN_FLOOR(60).
|
|
69
89
|
for (const p of pages) expect(p.score).toBeGreaterThanOrEqual(50);
|
|
70
|
-
for (const b of blocks) expect(b.score).toBeGreaterThanOrEqual(
|
|
71
|
-
for (const d of domain) expect(d.score).toBeGreaterThanOrEqual(
|
|
90
|
+
for (const b of blocks) expect(b.score).toBeGreaterThanOrEqual(60);
|
|
91
|
+
for (const d of domain) expect(d.score).toBeGreaterThanOrEqual(60);
|
|
72
92
|
|
|
73
93
|
// directMatch iff the top page is a confident match (PAGE_DIRECT = 95).
|
|
74
94
|
expect(directMatch).toBe(pages.length > 0 && pages[0].score >= 95);
|
|
@@ -190,7 +210,7 @@ describe('build kit — a thin kit says what to try next', () => {
|
|
|
190
210
|
it('hints for a matched-then-filtered query: hasResults true, nothing offerable', async () => {
|
|
191
211
|
// The case most likely to be misread, and the reason the threshold counts
|
|
192
212
|
// what SURVIVED the floors rather than what search returned.
|
|
193
|
-
const r = await build('
|
|
213
|
+
const r = await build('hydration', {cwd: REPO});
|
|
194
214
|
expect(r.type).toBe('build.kit');
|
|
195
215
|
if (r.type !== 'build.kit') return;
|
|
196
216
|
expect(r.data.hasResults).toBe(true);
|
|
@@ -213,12 +233,28 @@ describe('build kit — a thin kit says what to try next', () => {
|
|
|
213
233
|
}
|
|
214
234
|
});
|
|
215
235
|
|
|
236
|
+
it('still starts from the closest page on a loose match, and scaffolds it', async () => {
|
|
237
|
+
// A skeleton is a 35-line excerpt: a reader who studies it and composes
|
|
238
|
+
// the rest loses the spacing the template exists to carry. A loose match
|
|
239
|
+
// is still the best start there is, so `start` scaffolds it.
|
|
240
|
+
const r = await build('executive summary', {cwd: REPO});
|
|
241
|
+
expect(r.type).toBe('build.kit');
|
|
242
|
+
if (r.type !== 'build.kit') return;
|
|
243
|
+
expect(r.data.directMatch).toBe(false);
|
|
244
|
+
expect(r.data.start).toMatchObject({
|
|
245
|
+
name: 'dashboard-scorecard',
|
|
246
|
+
basis: 'closest',
|
|
247
|
+
command: 'astryx template dashboard-scorecard --type page <path>',
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
|
|
216
251
|
it('recommends scaffolding on a direct match', async () => {
|
|
217
252
|
const r = await build('contact form', {cwd: REPO});
|
|
218
253
|
expect(r.type).toBe('build.kit');
|
|
219
254
|
if (r.type !== 'build.kit') return;
|
|
220
255
|
expect(r.data.directMatch).toBe(true);
|
|
221
256
|
expect(r.data.pages.length).toBeGreaterThan(0);
|
|
257
|
+
expect(r.data.start).toMatchObject({name: r.data.pages[0].name, basis: 'direct'});
|
|
222
258
|
for (const page of r.data.pages) {
|
|
223
259
|
expect(page.command).not.toMatch(/--skeleton/);
|
|
224
260
|
}
|
|
@@ -227,12 +263,13 @@ describe('build kit — a thin kit says what to try next', () => {
|
|
|
227
263
|
it('keeps the recommendation package-manager-agnostic', async () => {
|
|
228
264
|
// Appending a flag must not turn into prefixing an invocation; that stays
|
|
229
265
|
// the renderer's job.
|
|
230
|
-
const r = await build('
|
|
266
|
+
const r = await build('executive summary', {cwd: REPO});
|
|
231
267
|
expect(r.type).toBe('build.kit');
|
|
232
268
|
if (r.type !== 'build.kit') return;
|
|
233
269
|
for (const page of r.data.pages) {
|
|
234
270
|
expect(page.command).not.toMatch(/^(pnpm|npm|yarn|bun|npx)\b/);
|
|
235
271
|
}
|
|
272
|
+
expect(r.data.start?.command).not.toMatch(/^(pnpm|npm|yarn|bun|npx)\b/);
|
|
236
273
|
});
|
|
237
274
|
|
|
238
275
|
it('keeps recovery commands bare, for the caller to render', async () => {
|
|
@@ -247,3 +284,155 @@ describe('build kit — a thin kit says what to try next', () => {
|
|
|
247
284
|
}
|
|
248
285
|
});
|
|
249
286
|
});
|
|
287
|
+
|
|
288
|
+
describe('build kit — every page starts from a template', () => {
|
|
289
|
+
it('falls back to the app shell when no page template matches', async () => {
|
|
290
|
+
// Before, an unmatched idea got "compose from AppShell": the one path
|
|
291
|
+
// with no frame, no spacing, and no section rhythm.
|
|
292
|
+
const r = await build('zzznomatch99', {cwd: REPO});
|
|
293
|
+
expect(r.type).toBe('build.kit');
|
|
294
|
+
if (r.type !== 'build.kit') return;
|
|
295
|
+
expect(r.data.hasResults).toBe(false);
|
|
296
|
+
expect(r.data.start).toMatchObject({
|
|
297
|
+
name: 'shell-top-nav',
|
|
298
|
+
basis: 'fallback',
|
|
299
|
+
command: 'astryx template shell-top-nav --type page <path>',
|
|
300
|
+
});
|
|
301
|
+
expect(r.data.start?.description).toBeTruthy();
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('starts a long idea from the family its words name', async () => {
|
|
305
|
+
// The coverage gate cannot tell layout words from subject matter: every
|
|
306
|
+
// dashboard covers one term of three, so search offers no page at all.
|
|
307
|
+
// The ranker still starts the page from the dashboard.
|
|
308
|
+
const r = await build('quarterly revenue dashboard', {cwd: REPO});
|
|
309
|
+
expect(r.type).toBe('build.kit');
|
|
310
|
+
if (r.type !== 'build.kit') return;
|
|
311
|
+
expect(r.data.start).toMatchObject({name: 'dashboard', basis: 'closest'});
|
|
312
|
+
expect(r.data.directMatch).toBe(false);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
it('does not start from a direct match that is not ready yet, and says so', async () => {
|
|
316
|
+
const r = await build('incident console', {cwd: REPO});
|
|
317
|
+
expect(r.type).toBe('build.kit');
|
|
318
|
+
if (r.type !== 'build.kit') return;
|
|
319
|
+
expect(r.data.directMatch).toBe(true);
|
|
320
|
+
expect(r.data.pages[0].name).toBe('incident-console');
|
|
321
|
+
expect(r.data.start?.name).not.toBe('incident-console');
|
|
322
|
+
expect(r.data.start?.reason).toMatch(/`incident-console` matches but is not ready yet/);
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
it('does not start from a page that matched one incidental word', async () => {
|
|
326
|
+
// A work-item detail page mentions a feed in its description. That is a
|
|
327
|
+
// worse start for a news feed than the app shell.
|
|
328
|
+
const r = await build('news feed', {cwd: REPO});
|
|
329
|
+
expect(r.type).toBe('build.kit');
|
|
330
|
+
if (r.type !== 'build.kit') return;
|
|
331
|
+
expect(r.data.start?.basis).toBe('fallback');
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it('starts a part from the page it is placed in, else from the app shell', async () => {
|
|
335
|
+
const placed = await build('an empty state for a settings page', {cwd: REPO});
|
|
336
|
+
if (placed.type !== 'build.kit') throw new Error(placed.type);
|
|
337
|
+
expect(placed.data.start).toMatchObject({name: 'settings', basis: 'closest'});
|
|
338
|
+
const loose = await build('a date range picker', {cwd: REPO});
|
|
339
|
+
if (loose.type !== 'build.kit') throw new Error(loose.type);
|
|
340
|
+
expect(loose.data.start).toMatchObject({name: 'shell-top-nav', basis: 'fallback'});
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
it('names a direct match the ranker outweighed in the reason', async () => {
|
|
344
|
+
const r = await build('dashboard with a login form', {cwd: REPO});
|
|
345
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
346
|
+
expect(r.data.directMatch).toBe(true);
|
|
347
|
+
expect(r.data.pages[0].name).toBe('login');
|
|
348
|
+
expect(r.data.start).toMatchObject({name: 'dashboard', basis: 'closest'});
|
|
349
|
+
expect(r.data.start?.reason).toContain('`login`');
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it('names the loose page matches when it falls back to the shell', async () => {
|
|
353
|
+
const r = await build('news feed', {cwd: REPO});
|
|
354
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
355
|
+
expect(r.data.pages.length).toBeGreaterThan(0);
|
|
356
|
+
expect(r.data.start?.basis).toBe('fallback');
|
|
357
|
+
for (const page of r.data.pages) expect(r.data.start?.reason).toContain(`\`${page.name}\``);
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
it('never gives a reason that denies a match the response reports', async () => {
|
|
361
|
+
for (const q of ['news feed', 'dashboard with a login form', 'user profile', 'incident console']) {
|
|
362
|
+
const r = await build(q, {cwd: REPO});
|
|
363
|
+
if (r.type !== 'build.kit') throw new Error(r.type);
|
|
364
|
+
if (r.data.pages.length) expect(r.data.start?.reason).not.toMatch(/No template matched/);
|
|
365
|
+
if (r.data.directMatch) expect(r.data.start?.reason).not.toMatch(/none is exactly this page/);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
it('names no start when the kit is narrowed to components', async () => {
|
|
370
|
+
const r = await build('dashboard', {cwd: REPO, type: 'component'});
|
|
371
|
+
expect(r.type).toBe('build.kit');
|
|
372
|
+
if (r.type !== 'build.kit') return;
|
|
373
|
+
expect(r.data.start).toBeNull();
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
it('keeps incidental description matches out of blocks and components', async () => {
|
|
379
|
+
// Toast, Popover and TextInput all say "brief" somewhere in their
|
|
380
|
+
// descriptions; none of them is part of a brief.
|
|
381
|
+
const r = await build('weekly brief', {cwd: REPO});
|
|
382
|
+
expect(r.type).toBe('build.kit');
|
|
383
|
+
if (r.type !== 'build.kit') return;
|
|
384
|
+
const names = [...r.data.blocks, ...r.data.domain].map(e => e.name);
|
|
385
|
+
for (const noise of ['Toast', 'Popover', 'TextInput']) expect(names).not.toContain(noise);
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
it('names the ranker\'s next two templates beside every start', async () => {
|
|
389
|
+
for (const idea of ['quarterly revenue dashboard', 'contact form']) {
|
|
390
|
+
const r = await build(idea, {cwd: REPO});
|
|
391
|
+
expect(r.type).toBe('build.kit');
|
|
392
|
+
if (r.type !== 'build.kit') return;
|
|
393
|
+
const alternatives = r.data.start?.alternatives ?? [];
|
|
394
|
+
expect(alternatives.length).toBeGreaterThan(0);
|
|
395
|
+
expect(alternatives.length).toBeLessThanOrEqual(2);
|
|
396
|
+
for (const alt of alternatives) {
|
|
397
|
+
expect(alt.name).not.toBe(r.data.start?.name);
|
|
398
|
+
expect(alt.description).toBeTruthy();
|
|
399
|
+
expect(alt.command).toBe(`astryx template ${alt.name} --type page <path>`);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
it('calls a start direct only when search and the ranker agree', async () => {
|
|
405
|
+
const r = await build('contact form', {cwd: REPO});
|
|
406
|
+
expect(r.type).toBe('build.kit');
|
|
407
|
+
if (r.type !== 'build.kit') return;
|
|
408
|
+
expect(r.data.directMatch).toBe(true);
|
|
409
|
+
expect(r.data.start).toMatchObject({name: r.data.pages[0].name, basis: 'direct'});
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
it('never lets a noisy search match pick the start', async () => {
|
|
413
|
+
// Search once matched "site" to the gallery's "side" and started a
|
|
414
|
+
// navigation bar from a gallery. The ranker alone picks the start now.
|
|
415
|
+
const r = await build('horizontal site navigation with a current section indicator', {cwd: REPO});
|
|
416
|
+
expect(r.type).toBe('build.kit');
|
|
417
|
+
if (r.type !== 'build.kit') return;
|
|
418
|
+
expect(r.data.start?.name).toBe('shell-top-nav');
|
|
419
|
+
expect(r.data.pages.map(p => p.name)).not.toContain('side-gallery');
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
it('starts a component in a container from a template with that frame', async () => {
|
|
423
|
+
// "in a modal": the modal is the frame, so the dialog template leads
|
|
424
|
+
// instead of the app shell.
|
|
425
|
+
const r = await build('saved drafts in a modal with resume and delete row actions', {cwd: REPO});
|
|
426
|
+
expect(r.type).toBe('build.kit');
|
|
427
|
+
if (r.type !== 'build.kit') return;
|
|
428
|
+
expect(r.data.start?.name).toBe('settings-dialog');
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
it('does not start from a template named only by a word that modifies another', async () => {
|
|
432
|
+
// "product" describes the response; it is not a product page.
|
|
433
|
+
const r = await build('an interactive command catalog with side-by-side product response and trace', {cwd: REPO});
|
|
434
|
+
expect(r.type).toBe('build.kit');
|
|
435
|
+
if (r.type !== 'build.kit') return;
|
|
436
|
+
expect(r.data.start?.name).not.toMatch(/^product-/);
|
|
437
|
+
});
|
|
438
|
+
});
|
|
@@ -2,16 +2,104 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A command the playbook tells the caller to run.
|
|
6
|
+
*/
|
|
7
|
+
export type BuildPlaybookCommand = {
|
|
8
|
+
/**
|
|
9
|
+
* Bare subcommand with `<placeholder>` arguments (e.g. `template <name> <path>`) and no package-manager prefix — render it with your own CLI invocation.
|
|
10
|
+
*/
|
|
11
|
+
command: string;
|
|
12
|
+
/**
|
|
13
|
+
* What running it is for.
|
|
14
|
+
*/
|
|
15
|
+
purpose?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* One step of the page-building workflow.
|
|
19
|
+
*/
|
|
20
|
+
export type BuildPlaybookStep = {
|
|
21
|
+
/**
|
|
22
|
+
* What to do.
|
|
23
|
+
*/
|
|
24
|
+
title: string;
|
|
25
|
+
/**
|
|
26
|
+
* The commands for this step, in the order to run them.
|
|
27
|
+
*/
|
|
28
|
+
commands: BuildPlaybookCommand[];
|
|
29
|
+
/**
|
|
30
|
+
* What the step's command gives back, when that decides the next step.
|
|
31
|
+
*/
|
|
32
|
+
returns?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* astryx --json build (no query) — the "how to build a page" playbook.
|
|
6
36
|
*/
|
|
7
37
|
export type BuildHelpResponse = {
|
|
8
38
|
type: "build.help";
|
|
9
39
|
data: {
|
|
10
40
|
playbook: true;
|
|
41
|
+
title: string;
|
|
42
|
+
steps: BuildPlaybookStep[];
|
|
43
|
+
rules: string[];
|
|
44
|
+
related: BuildPlaybookCommand[];
|
|
11
45
|
};
|
|
12
46
|
};
|
|
13
47
|
/**
|
|
14
|
-
*
|
|
48
|
+
* The page template a kit recommends starting from.
|
|
49
|
+
*/
|
|
50
|
+
export type BuildStart = {
|
|
51
|
+
/**
|
|
52
|
+
* Template id, as `astryx template <name>` takes it.
|
|
53
|
+
*/
|
|
54
|
+
name: string;
|
|
55
|
+
/**
|
|
56
|
+
* Human-facing template name.
|
|
57
|
+
*/
|
|
58
|
+
displayName: string;
|
|
59
|
+
/**
|
|
60
|
+
* What the page is: its layout and the ideas it serves.
|
|
61
|
+
*/
|
|
62
|
+
description: string;
|
|
63
|
+
/**
|
|
64
|
+
* The scaffold command that selects exactly this template, `astryx template <id> --type page <path>`: `<id>` is the Core id an integration replacement stands in for, else the template's own id, `<path>` is a placeholder for the file or folder to write the template to, and the `astryx` prefix is for the caller to replace with its own invocation.
|
|
65
|
+
*/
|
|
66
|
+
command: string;
|
|
67
|
+
/**
|
|
68
|
+
* Why this template. The page ranker picks every start: it weighs each matched word by how rare it is among page templates, favors the family the idea's head names and the container it names ("in a modal"), and discounts words that only modify another. `direct` when its pick is also search's direct match (`directMatch`); `closest` when it is not; `fallback` when no template has the evidence to lead and the page starts from the app shell.
|
|
69
|
+
*/
|
|
70
|
+
basis: "direct" | "closest" | "fallback";
|
|
71
|
+
/**
|
|
72
|
+
* One sentence saying the same as `basis`, for a reader.
|
|
73
|
+
*/
|
|
74
|
+
reason: string;
|
|
75
|
+
/**
|
|
76
|
+
* The ranker's next closest page templates (≤2), for when the start's layout is wrong.
|
|
77
|
+
*/
|
|
78
|
+
alternatives: BuildAlternative[];
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A page template to consider instead of the start.
|
|
82
|
+
*/
|
|
83
|
+
export type BuildAlternative = {
|
|
84
|
+
/**
|
|
85
|
+
* Template id, as `astryx template <name>` takes it.
|
|
86
|
+
*/
|
|
87
|
+
name: string;
|
|
88
|
+
/**
|
|
89
|
+
* Human-facing template name.
|
|
90
|
+
*/
|
|
91
|
+
displayName: string;
|
|
92
|
+
/**
|
|
93
|
+
* What the page is: its layout and the ideas it serves.
|
|
94
|
+
*/
|
|
95
|
+
description: string;
|
|
96
|
+
/**
|
|
97
|
+
* The scaffold command, in the same form as the start's.
|
|
98
|
+
*/
|
|
99
|
+
command: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* astryx --json build "<idea>" — the page template to start from, and the kit around it.
|
|
15
103
|
*
|
|
16
104
|
* Entries are raw `SearchResultEntry` objects (no package-manager-prefixed
|
|
17
105
|
* command strings — the CLI adds those); `frame`/`foundation` are static
|
|
@@ -24,6 +112,7 @@ export type BuildKitResponse = {
|
|
|
24
112
|
hasResults: boolean;
|
|
25
113
|
matchCount: number;
|
|
26
114
|
directMatch: boolean;
|
|
115
|
+
start: BuildStart | null;
|
|
27
116
|
pages: import("../search/search.type.mjs").SearchResultEntry[];
|
|
28
117
|
blocks: import("../search/search.type.mjs").SearchResultEntry[];
|
|
29
118
|
domain: import("../search/search.type.mjs").SearchResultEntry[];
|
package/api/build/build.type.mjs
CHANGED
|
@@ -2,21 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file Colocated types for the `build` command — source of truth for the
|
|
5
|
-
* `build.help` (playbook
|
|
6
|
-
* responses. Re-exported by types/build.d.ts.
|
|
5
|
+
* `build.help` (playbook) and `build.kit` (composition kit) JSON responses.
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
9
|
+
* A command the playbook tells the caller to run.
|
|
10
|
+
*
|
|
11
|
+
* @typedef {object} BuildPlaybookCommand
|
|
12
|
+
* @property {string} command Bare subcommand with `<placeholder>` arguments (e.g. `template <name> <path>`) and no package-manager prefix — render it with your own CLI invocation.
|
|
13
|
+
* @property {string} [purpose] What running it is for.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* One step of the page-building workflow.
|
|
18
|
+
*
|
|
19
|
+
* @typedef {object} BuildPlaybookStep
|
|
20
|
+
* @property {string} title What to do.
|
|
21
|
+
* @property {BuildPlaybookCommand[]} commands The commands for this step, in the order to run them.
|
|
22
|
+
* @property {string} [returns] What the step's command gives back, when that decides the next step.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* astryx --json build (no query) — the "how to build a page" playbook.
|
|
11
27
|
*
|
|
12
28
|
* @typedef {object} BuildHelpResponse
|
|
13
29
|
* @property {'build.help'} type
|
|
14
30
|
* @property {object} data
|
|
15
31
|
* @property {true} data.playbook Always true; marks this envelope as the playbook rather than a result set.
|
|
32
|
+
* @property {string} data.title The playbook's heading.
|
|
33
|
+
* @property {BuildPlaybookStep[]} data.steps The workflow, in order.
|
|
34
|
+
* @property {string[]} data.rules The rules that keep a page on-system.
|
|
35
|
+
* @property {BuildPlaybookCommand[]} data.related Lookups to reach for alongside the workflow.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The page template a kit recommends starting from.
|
|
40
|
+
*
|
|
41
|
+
* @typedef {object} BuildStart
|
|
42
|
+
* @property {string} name Template id, as `astryx template <name>` takes it.
|
|
43
|
+
* @property {string} displayName Human-facing template name.
|
|
44
|
+
* @property {string} description What the page is: its layout and the ideas it serves.
|
|
45
|
+
* @property {string} command The scaffold command that selects exactly this template, `astryx template <id> --type page <path>`: `<id>` is the Core id an integration replacement stands in for, else the template's own id, `<path>` is a placeholder for the file or folder to write the template to, and the `astryx` prefix is for the caller to replace with its own invocation.
|
|
46
|
+
* @property {'direct' | 'closest' | 'fallback'} basis Why this template. The page ranker picks every start: it weighs each matched word by how rare it is among page templates, favors the family the idea's head names and the container it names ("in a modal"), and discounts words that only modify another. `direct` when its pick is also search's direct match (`directMatch`); `closest` when it is not; `fallback` when no template has the evidence to lead and the page starts from the app shell.
|
|
47
|
+
* @property {string} reason One sentence saying the same as `basis`, for a reader.
|
|
48
|
+
* @property {BuildAlternative[]} alternatives The ranker's next closest page templates (≤2), for when the start's layout is wrong.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A page template to consider instead of the start.
|
|
53
|
+
*
|
|
54
|
+
* @typedef {object} BuildAlternative
|
|
55
|
+
* @property {string} name Template id, as `astryx template <name>` takes it.
|
|
56
|
+
* @property {string} displayName Human-facing template name.
|
|
57
|
+
* @property {string} description What the page is: its layout and the ideas it serves.
|
|
58
|
+
* @property {string} command The scaffold command, in the same form as the start's.
|
|
16
59
|
*/
|
|
17
60
|
|
|
18
61
|
/**
|
|
19
|
-
*
|
|
62
|
+
* astryx --json build "<idea>" — the page template to start from, and the kit around it.
|
|
20
63
|
*
|
|
21
64
|
* Entries are raw `SearchResultEntry` objects (no package-manager-prefixed
|
|
22
65
|
* command strings — the CLI adds those); `frame`/`foundation` are static
|
|
@@ -26,14 +69,15 @@
|
|
|
26
69
|
* @property {'build.kit'} type
|
|
27
70
|
* @property {object} data
|
|
28
71
|
* @property {string} data.query
|
|
29
|
-
* @property {boolean} data.hasResults False when search returned nothing
|
|
72
|
+
* @property {boolean} data.hasResults False when search returned nothing. The kit still names a template in `start`.
|
|
30
73
|
* @property {number} data.matchCount Total ranked search matches for the query — counted before the search `limit`, the kit's score floors, and its per-group caps, so it is never a cap read back.
|
|
31
74
|
* @property {boolean} data.directMatch True when the top page template is a confident direct match.
|
|
32
|
-
* @property {
|
|
75
|
+
* @property {BuildStart | null} data.start The page template to start from: the ranker's pick, else the app shell. Null only when the kit is narrowed to components or hooks (`type`), or when the project has no page template to offer.
|
|
76
|
+
* @property {import('../search/search.type.mjs').SearchResultEntry[]} data.pages Closest page templates by search (≤3). Each entry's `command` carries `--skeleton` when `directMatch` is false, so it previews the layout; `start.command` is the scaffold.
|
|
33
77
|
* @property {import('../search/search.type.mjs').SearchResultEntry[]} data.blocks Drop-in block patterns covering parts of the idea (≤5).
|
|
34
78
|
* @property {import('../search/search.type.mjs').SearchResultEntry[]} data.domain Idea-specific components/hooks (≤6), excluding frame/foundation.
|
|
35
|
-
* @property {string[]} data.frame Always-on page-shell component names.
|
|
36
|
-
* @property {string[]} data.foundation Always-on layout/typography/action component names.
|
|
79
|
+
* @property {string[]} data.frame Always-on page-shell component names. Every page template already uses them.
|
|
80
|
+
* @property {string[]} data.foundation Always-on layout/typography/action component names. Every page template already uses them.
|
|
37
81
|
* @property {{reason: string, commands: string[]}} [data.hint] Present only when the kit is thin. `reason` says why, `commands` are bare subcommands (e.g. `component --list`) for the caller to render with its own invocation — so a reader is never handed a command that does not resolve in their project.
|
|
38
82
|
*/
|
|
39
83
|
|
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @file build.help leaf — the "how to build a page" playbook
|
|
5
|
+
* @file build.help leaf — the "how to build a page" playbook.
|
|
6
6
|
*
|
|
7
|
-
* `build` with no query returns this envelope
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* `build` with no query returns this envelope. The playbook is data — steps,
|
|
8
|
+
* rules, and related lookups — so a `--json` or programmatic caller gets the
|
|
9
|
+
* same guidance the terminal shows. Commands are bare subcommands with no
|
|
10
|
+
* package-manager prefix, which keeps the JSON environment-agnostic; the CLI
|
|
11
|
+
* renders each one with the caller's invocation, as it does build.kit's
|
|
12
|
+
* `hint.commands`.
|
|
13
|
+
*
|
|
14
|
+
* The workflow starts every page from a template, because a template already
|
|
15
|
+
* has the frame, spacing, and section rhythm that a page composed from
|
|
16
|
+
* components has to rediscover.
|
|
10
17
|
*/
|
|
11
18
|
/**
|
|
12
|
-
* The page-building playbook
|
|
19
|
+
* The page-building playbook (emitted when `build` runs with no query).
|
|
13
20
|
*
|
|
14
21
|
* @returns {import('../build.type.mjs').BuildHelpResponse}
|
|
15
22
|
*/
|
package/api/build/help/help.mjs
CHANGED
|
@@ -1,18 +1,81 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file build.help leaf — the "how to build a page" playbook
|
|
4
|
+
* @file build.help leaf — the "how to build a page" playbook.
|
|
5
5
|
*
|
|
6
|
-
* `build` with no query returns this envelope
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* `build` with no query returns this envelope. The playbook is data — steps,
|
|
7
|
+
* rules, and related lookups — so a `--json` or programmatic caller gets the
|
|
8
|
+
* same guidance the terminal shows. Commands are bare subcommands with no
|
|
9
|
+
* package-manager prefix, which keeps the JSON environment-agnostic; the CLI
|
|
10
|
+
* renders each one with the caller's invocation, as it does build.kit's
|
|
11
|
+
* `hint.commands`.
|
|
12
|
+
*
|
|
13
|
+
* The workflow starts every page from a template, because a template already
|
|
14
|
+
* has the frame, spacing, and section rhythm that a page composed from
|
|
15
|
+
* components has to rediscover.
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
/**
|
|
12
|
-
* The page-building playbook
|
|
19
|
+
* The page-building playbook (emitted when `build` runs with no query).
|
|
13
20
|
*
|
|
14
21
|
* @returns {import('../build.type.mjs').BuildHelpResponse}
|
|
15
22
|
*/
|
|
16
23
|
export function buildHelp() {
|
|
17
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
type: 'build.help',
|
|
26
|
+
data: {
|
|
27
|
+
playbook: true,
|
|
28
|
+
title: 'How to build a page with Astryx',
|
|
29
|
+
steps: [
|
|
30
|
+
{
|
|
31
|
+
title: 'Find the page template to start from',
|
|
32
|
+
commands: [{command: 'build "<what you\'re building>"'}],
|
|
33
|
+
returns:
|
|
34
|
+
'the [page] template to start from (always one: the closest match, or the app shell when nothing matches), the next two templates, and the [block]s and [component]s for the parts it lacks',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: 'Scaffold that template into your project',
|
|
38
|
+
commands: [
|
|
39
|
+
{
|
|
40
|
+
command: 'template <name> <path>',
|
|
41
|
+
purpose: 'write the page template to <path>',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: 'Adapt it: keep its frame and spacing, replace its content',
|
|
47
|
+
commands: [
|
|
48
|
+
{
|
|
49
|
+
command: 'template <BlockName>',
|
|
50
|
+
purpose:
|
|
51
|
+
'print a block to put inside a section, for a part the template lacks',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
command: 'component <Name>',
|
|
55
|
+
purpose: 'read props before you change a component',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
rules: [
|
|
61
|
+
'Start every page from a page template. Never lay out a page from scratch.',
|
|
62
|
+
'Changing a page you already have? Keep it. Add blocks and components inside its sections.',
|
|
63
|
+
"Keep the template's page frame, gap, and padding values. Replace its data, copy, and sections.",
|
|
64
|
+
'No <div>/raw HTML for layout — use VStack/HStack/Grid/Stack/Card etc.',
|
|
65
|
+
'No style={{}} — use component props, and design tokens for values.',
|
|
66
|
+
'Wrap the app in <Theme theme={...}> and import core reset.css + astryx.css.',
|
|
67
|
+
],
|
|
68
|
+
related: [
|
|
69
|
+
{
|
|
70
|
+
command: 'template --list --type page',
|
|
71
|
+
purpose: 'every page template',
|
|
72
|
+
},
|
|
73
|
+
{command: 'docs tokens', purpose: 'the design tokens'},
|
|
74
|
+
{
|
|
75
|
+
command: 'search <query>',
|
|
76
|
+
purpose: 'a neutral lookup of any component, doc, or template',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
};
|
|
18
81
|
}
|
package/api/build/kit/kit.d.mts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
5
|
+
* The page template to start from, and the kit around it.
|
|
6
6
|
*
|
|
7
7
|
* @param {string} query what you're building (e.g. "analytics dashboard")
|
|
8
8
|
* @param {{cwd?: string, type?: import('../../search/search.type.mjs').SearchDomain, limit?: number}} [options]
|
|
@@ -13,3 +13,6 @@ export function buildKit(query: string, options?: {
|
|
|
13
13
|
type?: import("../../search/search.type.mjs").SearchDomain;
|
|
14
14
|
limit?: number;
|
|
15
15
|
}): Promise<import("../build.type.mjs").BuildKitResponse>;
|
|
16
|
+
export type SearchResultEntry = import("../../search/search.type.mjs").SearchResultEntry;
|
|
17
|
+
export type BuildStart = import("../build.type.mjs").BuildStart;
|
|
18
|
+
export type PageTemplate = import("../_adapter.mjs").PageTemplate;
|