@astryxdesign/cli 0.6.3 → 0.6.4-canary.10dd683
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/CHANGELOG.md +194 -0
- package/README.md +117 -78
- 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 +272 -41
- package/api/docs/_adapter.mjs +985 -108
- package/api/docs/compiled-topics.test.mjs +78 -0
- package/api/docs/detail/detail.mjs +22 -63
- package/api/docs/detail/section/section.d.mts +1 -1
- package/api/docs/detail/section/section.mjs +54 -19
- package/api/docs/detail/section/section.test.mjs +50 -0
- package/api/docs/docs.d.mts +10 -3
- package/api/docs/docs.doc.mjs +55 -16
- package/api/docs/docs.mjs +53 -10
- package/api/docs/docs.test.mjs +164 -4
- package/api/docs/docs.type.d.mts +221 -5
- package/api/docs/docs.type.mjs +153 -11
- package/api/docs/index/index.d.mts +18 -0
- package/api/docs/index/index.mjs +40 -0
- package/api/docs/index/index.test.mjs +62 -0
- package/api/docs/integration-tree.test.mjs +555 -0
- package/api/docs/integrationDocs.test.mjs +114 -8
- 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 +99 -1
- package/api/doctor/doctor.doc.mjs +1 -0
- package/api/doctor/doctor.mjs +548 -1
- package/api/doctor/doctor.test.mjs +610 -1
- package/api/gap-report/gap-report.doc.mjs +8 -4
- package/api/hook/_adapter.mjs +19 -5
- package/api/hook/hook.doc.mjs +1 -0
- package/api/hook/hook.type.d.mts +3 -3
- package/api/hook/hook.type.mjs +11 -11
- package/api/hook/list/list.d.mts +2 -2
- 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 +3 -1
- 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 +62 -11
- 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 +15 -3
- 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.d.mts +1 -1
- package/api/template/template.doc.mjs +30 -8
- package/api/template/template.mjs +45 -8
- package/api/template/template.type.d.mts +12 -14
- 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 +139 -22
- package/api/upgrade/list/list.mjs +2 -1
- package/api/upgrade/list/list.test.mjs +73 -0
- package/api/upgrade/project-context.test.mjs +272 -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 +12 -5
- package/api/upgrade/upgrade.type.d.mts +43 -5
- package/api/upgrade/upgrade.type.mjs +27 -11
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- 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/registry.mjs +1 -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/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/codemods/transforms/v0.6.4/__tests__/migrate-native-picker-to-presentation.test.mjs +63 -0
- package/assets/codemods/transforms/v0.6.4/__tests__/migrate-theme-catalog-to-descriptors.test.mjs +220 -0
- package/assets/codemods/transforms/v0.6.4/index.mjs +31 -0
- package/assets/codemods/transforms/v0.6.4/migrate-native-picker-to-presentation.mjs +148 -0
- package/assets/codemods/transforms/v0.6.4/migrate-theme-catalog-to-descriptors.mjs +141 -0
- package/assets/docs/README.md +9 -0
- package/assets/docs/authoring.doc.mjs +14 -0
- 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} +144 -26
- 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/blocks/components/Timer/TimerFormats.doc.mjs +14 -0
- package/assets/templates/blocks/components/Timer/TimerFormats.tsx +34 -0
- package/assets/templates/blocks/components/Timer/TimerInline.doc.mjs +14 -0
- package/assets/templates/blocks/components/Timer/TimerInline.tsx +14 -0
- package/assets/templates/blocks/components/Timer/TimerShowcase.doc.mjs +13 -0
- package/assets/templates/blocks/components/Timer/TimerShowcase.tsx +47 -0
- package/assets/templates/blocks/components/Timer/TimerTypography.doc.mjs +14 -0
- package/assets/templates/blocks/components/Timer/TimerTypography.tsx +31 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.doc.mjs +19 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +383 -65
- 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 +8 -8
- 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 +790 -23
- package/authoring/doctypes/_schema.mjs +543 -39
- package/authoring/doctypes/base/graph-fields.doc.d.mts +9 -0
- package/authoring/doctypes/base/graph-fields.doc.mjs +64 -0
- package/authoring/doctypes/base/type.ts +41 -0
- 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 +5 -4
- package/authoring/doctypes/component/component.doc.mjs +6 -3
- package/authoring/doctypes/component/parse.d.mts +2 -2
- package/authoring/doctypes/component/parse.mjs +1 -1
- package/authoring/doctypes/component/type.ts +6 -5
- 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 +4 -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 +9 -4
- 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 +5 -4
- package/authoring/doctypes/legacy.d.mts +8 -6
- package/authoring/doctypes/legacy.mjs +5 -4
- package/authoring/doctypes/load-contract.test.mjs +233 -0
- package/authoring/doctypes/namespace/namespace.doc.d.mts +9 -0
- package/authoring/doctypes/namespace/namespace.doc.mjs +128 -0
- package/authoring/doctypes/namespace/parse.d.mts +12 -0
- package/authoring/doctypes/namespace/parse.mjs +25 -0
- package/authoring/doctypes/namespace/parse.test.mjs +163 -0
- package/authoring/doctypes/namespace/type.ts +74 -0
- package/authoring/doctypes/parse.d.mts +22 -18
- package/authoring/doctypes/parse.mjs +22 -11
- package/authoring/doctypes/parse.test.mjs +77 -3
- package/authoring/doctypes/reference/parse.d.mts +2 -2
- package/authoring/doctypes/reference/parse.mjs +8 -5
- package/authoring/doctypes/reference/reference.doc.mjs +48 -6
- package/authoring/doctypes/reference/type.ts +70 -7
- 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 +4 -4
- package/authoring/doctypes/template/parse.d.mts +94 -1
- package/authoring/doctypes/template/parse.mjs +40 -2
- package/authoring/doctypes/template/parse.test.mjs +26 -2
- package/authoring/doctypes/template/template.doc.mjs +13 -3
- package/authoring/doctypes/template/type.ts +13 -2
- 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 -10
- 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 +10 -10
- package/authoring/gap-report/parse.mjs +6 -6
- package/authoring/gap-report/type.ts +1 -1
- package/authoring/identity/identity.doc.d.mts +9 -0
- package/authoring/identity/identity.doc.mjs +61 -0
- package/authoring/identity/type.ts +132 -0
- package/authoring/index.d.mts +3 -0
- package/authoring/index.d.ts +62 -17
- package/authoring/index.mjs +4 -1
- package/authoring/integration/integration.doc.mjs +15 -8
- package/authoring/integration/parse.d.mts +2 -2
- package/authoring/integration/parse.mjs +1 -1
- package/authoring/integration/parse.test.mjs +10 -1
- package/authoring/integration/schema.d.mts +6 -4
- package/authoring/integration/schema.mjs +9 -3
- package/authoring/integration/type.ts +19 -8
- package/authoring/shadcn/receipt.d.mts +6 -6
- 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 +28 -6
- package/clients/cli/commands/docs.mjs +240 -26
- package/clients/cli/commands/docs.test.mjs +193 -1
- 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 +9 -5
- 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 +22 -10
- 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 +164 -1
- package/clients/cli/formatters/index.test.mjs +97 -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 +37 -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 +263 -91
- package/foundation/config/project.test.mjs +270 -21
- package/foundation/discovery/authoring-self-docs.d.mts +87 -0
- package/foundation/discovery/authoring-self-docs.mjs +237 -0
- package/foundation/discovery/authoring-self-docs.test.mjs +170 -0
- 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 +39 -1
- package/foundation/discovery/component-discovery.mjs +50 -1
- package/foundation/discovery/component-loader.d.mts +35 -38
- package/foundation/discovery/component-loader.mjs +53 -222
- package/foundation/discovery/docs-discovery.d.mts +119 -11
- package/foundation/discovery/docs-discovery.mjs +423 -108
- package/foundation/discovery/docs-discovery.test.mjs +365 -20
- package/foundation/discovery/docs-output-budget.d.mts +28 -0
- package/foundation/discovery/docs-output-budget.mjs +50 -0
- package/foundation/discovery/docs-section-key.d.mts +116 -0
- package/foundation/discovery/docs-section-key.mjs +322 -0
- package/foundation/discovery/docs-section-key.test.mjs +246 -0
- 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 +774 -83
- 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/identity/provider-identity.d.mts +90 -0
- package/foundation/identity/provider-identity.mjs +320 -0
- package/foundation/identity/provider-identity.test.mjs +254 -0
- package/foundation/identity/providers.d.mts +7 -0
- package/foundation/identity/providers.mjs +16 -0
- package/foundation/integrations/autolink.d.mts +58 -1
- package/foundation/integrations/autolink.mjs +143 -45
- 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 +52 -21
- package/foundation/integrations/integration-warnings.test.mjs +74 -1
- package/foundation/integrations/integrations.d.mts +63 -3
- package/foundation/integrations/integrations.mjs +122 -9
- package/foundation/integrations/integrations.test.mjs +415 -1
- package/foundation/integrations/provider-conflicts.test.mjs +125 -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.d.mts +2 -0
- package/foundation/integrations/validate-contributions.mjs +131 -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 +57 -17
- 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 +41 -21
- 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/doctor/doctor.mjs
CHANGED
|
@@ -27,6 +27,24 @@ import {MIN_NODE_VERSION, isNodeVersionSupported} from '../../foundation/env/nod
|
|
|
27
27
|
import {CLI_ROOT, findCoreDir, findInstalledPackage} from '../../foundation/fs/paths.mjs';
|
|
28
28
|
import {explainPackageManager, getCliInvocation} from '../../foundation/env/package-manager.mjs';
|
|
29
29
|
import {findConfigPath, Project} from '../../foundation/config/project.mjs';
|
|
30
|
+
import {DocsCatalog} from '../../foundation/discovery/docs-discovery.mjs';
|
|
31
|
+
import {buildDocsIndexData} from '../../foundation/discovery/docs-section-key.mjs';
|
|
32
|
+
import {
|
|
33
|
+
DOC_OUTPUT_BUDGET_BYTES,
|
|
34
|
+
docsIndexBytes,
|
|
35
|
+
oversizedDocSections,
|
|
36
|
+
} from '../../foundation/discovery/docs-output-budget.mjs';
|
|
37
|
+
import {
|
|
38
|
+
builtinCatalog,
|
|
39
|
+
compileTopic,
|
|
40
|
+
docsLinkProblems,
|
|
41
|
+
guideEntry,
|
|
42
|
+
lowerTopic,
|
|
43
|
+
overlayLanguages,
|
|
44
|
+
projectTree,
|
|
45
|
+
} from '../docs/_adapter.mjs';
|
|
46
|
+
import {typedEdges} from '../docs/node/node.mjs';
|
|
47
|
+
import {detailView, indexView} from '../../foundation/doc-compiler/lenses.mjs';
|
|
30
48
|
import {semverCompare, isValidSemver, satisfiesRange} from '../../foundation/env/semver.mjs';
|
|
31
49
|
|
|
32
50
|
/**
|
|
@@ -52,6 +70,13 @@ import {semverCompare, isValidSemver, satisfiesRange} from '../../foundation/env
|
|
|
52
70
|
* @property {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]|null} [integrations]
|
|
53
71
|
* Every integration the project loaded, or null when the project could not be
|
|
54
72
|
* read at all.
|
|
73
|
+
* @property {DocsCatalog|null} [docsCatalog] - The topics a docs read sees.
|
|
74
|
+
* @property {Array<{package?: string, code: string, message: string}>} [docsCatalogIssues]
|
|
75
|
+
* `invalid_doc` issues from the project's contributed docs.
|
|
76
|
+
* @property {string|null} [docsCatalogError] - Why the project's docs catalog
|
|
77
|
+
* could not be built, when it could not.
|
|
78
|
+
* @property {Array<{package: string, code: string, severity: 'warning'|'error', message: string}>|null} [integrationIssues]
|
|
79
|
+
* Combined project-level integration issues, including cross-package template replacement warnings.
|
|
55
80
|
* @property {Error|null} [configError] - Error thrown while resolving the config
|
|
56
81
|
* path (e.g. multiple config files present), surfaced by checkConfig as a FAIL.
|
|
57
82
|
*/
|
|
@@ -571,7 +596,45 @@ export function checkPeerDeps(ctx) {
|
|
|
571
596
|
}
|
|
572
597
|
|
|
573
598
|
/**
|
|
574
|
-
*
|
|
599
|
+
* Summarize the combined integration graph, including cross-package warnings.
|
|
600
|
+
* @param {DoctorContext} ctx
|
|
601
|
+
* @returns {DoctorCheck}
|
|
602
|
+
*/
|
|
603
|
+
export function checkIntegrationIssues(ctx) {
|
|
604
|
+
const issues = ctx.integrationIssues;
|
|
605
|
+
if (issues == null) {
|
|
606
|
+
return {
|
|
607
|
+
id: 'integration-issues',
|
|
608
|
+
label: 'Integration contributions',
|
|
609
|
+
status: 'info',
|
|
610
|
+
message: 'Skipped — the project integration graph could not be loaded.',
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
if (issues.length === 0) {
|
|
614
|
+
return {
|
|
615
|
+
id: 'integration-issues',
|
|
616
|
+
label: 'Integration contributions',
|
|
617
|
+
status: 'pass',
|
|
618
|
+
message: 'Integration contributions and cross-package relationships are valid.',
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
const errors = issues.filter(issue => issue.severity === 'error').length;
|
|
622
|
+
const details = issues
|
|
623
|
+
.map(issue => `${issue.package}: ${issue.message}`)
|
|
624
|
+
.join(' | ');
|
|
625
|
+
// This check is new, so it warns: a project that passed before keeps
|
|
626
|
+
// passing (spec:AST-046 FR8). `astryx doctor integration` fails on errors.
|
|
627
|
+
return {
|
|
628
|
+
id: 'integration-issues',
|
|
629
|
+
label: 'Integration contributions',
|
|
630
|
+
status: 'warn',
|
|
631
|
+
message: `${issues.length} integration issue(s)${errors > 0 ? `, ${errors} of them errors` : ''}: ${details}`,
|
|
632
|
+
fix: 'Run `astryx doctor integration` for package-specific diagnostics and resolve cross-package precedence in astryx.config.',
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Check 10 — report the detected package manager, and say so when the project's
|
|
575
638
|
* own declaration disagrees with what is on disk.
|
|
576
639
|
*
|
|
577
640
|
* Two states are worth surfacing rather than guessing past, because in both the
|
|
@@ -627,6 +690,460 @@ export function checkPackageManager(ctx) {
|
|
|
627
690
|
};
|
|
628
691
|
}
|
|
629
692
|
|
|
693
|
+
/**
|
|
694
|
+
* Check 6b — every contributing integration owns its provider identity.
|
|
695
|
+
*
|
|
696
|
+
* Artifact and document IDs are provider-scoped, so a package that claims a
|
|
697
|
+
* provider ID an earlier-loaded package already holds is loaded inert: its
|
|
698
|
+
* components, templates, themes, docs, and codemods are withdrawn while the
|
|
699
|
+
* earlier package keeps contributing. That can be a deliberate transition
|
|
700
|
+
* (a renamed package installed beside its predecessor), so it warns rather
|
|
701
|
+
* than fails, but it is never allowed to happen quietly.
|
|
702
|
+
*
|
|
703
|
+
* @param {DoctorContext} ctx
|
|
704
|
+
* @returns {DoctorCheck}
|
|
705
|
+
*/
|
|
706
|
+
export function checkProviderIdentity(ctx) {
|
|
707
|
+
const id = 'provider-identity';
|
|
708
|
+
const label = 'Integration provider identity';
|
|
709
|
+
|
|
710
|
+
if (ctx.integrations == null) {
|
|
711
|
+
return {
|
|
712
|
+
id,
|
|
713
|
+
label,
|
|
714
|
+
status: 'info',
|
|
715
|
+
message: 'Skipped — the project configuration could not be read.',
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
const conflicts = ctx.integrations.filter(
|
|
720
|
+
integration => integration.__providerConflict,
|
|
721
|
+
);
|
|
722
|
+
if (conflicts.length > 0) {
|
|
723
|
+
return {
|
|
724
|
+
id,
|
|
725
|
+
label,
|
|
726
|
+
status: 'warn',
|
|
727
|
+
message: conflicts
|
|
728
|
+
.map(integration => integration.__providerConflict?.message)
|
|
729
|
+
.join(' '),
|
|
730
|
+
fix:
|
|
731
|
+
'Give each integration its own `providerId` in astryx.integration.*. ' +
|
|
732
|
+
"A renamed package may keep its predecessor's ID only when the " +
|
|
733
|
+
'predecessor is no longer installed.',
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
const count = ctx.integrations.filter(
|
|
738
|
+
integration =>
|
|
739
|
+
integration.providerId != null && integration.__loadError == null,
|
|
740
|
+
).length;
|
|
741
|
+
if (count === 0) {
|
|
742
|
+
return {
|
|
743
|
+
id,
|
|
744
|
+
label,
|
|
745
|
+
status: 'info',
|
|
746
|
+
message: 'None — no loaded integration has a provider identity.',
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
return {
|
|
750
|
+
id,
|
|
751
|
+
label,
|
|
752
|
+
status: 'pass',
|
|
753
|
+
message:
|
|
754
|
+
count === 1
|
|
755
|
+
? '1 loaded integration has its own provider ID.'
|
|
756
|
+
: `${count} loaded integrations each have their own provider ID.`,
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/** @param {number} bytes */
|
|
761
|
+
const kilobytes = bytes => `${Math.ceil(bytes / 1024)} KB`;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* @param {string[]} problems
|
|
765
|
+
* @returns {string}
|
|
766
|
+
*/
|
|
767
|
+
function joinProblems(problems) {
|
|
768
|
+
return problems.length === 1
|
|
769
|
+
? problems[0]
|
|
770
|
+
: `${problems.length} problems: ${problems.join('; ')}`;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/** How the self-doc audit's problems are fixed. */
|
|
774
|
+
const AUTHORING_DOCS_FIX =
|
|
775
|
+
'List every authoring self-doc in AUTHORING_SELF_DOCS, fix the one that fails to load, and split a section that is too large.';
|
|
776
|
+
|
|
777
|
+
/** How the public-surface audit's problems are fixed. */
|
|
778
|
+
const AUTHORING_SURFACE_FIX =
|
|
779
|
+
'Put a self-doc beside each module whose types @astryxdesign/cli/authoring exports and list it in AUTHORING_SELF_DOCS; export what each listed self-doc documents, or remove that self-doc.';
|
|
780
|
+
|
|
781
|
+
/** Types one problem names before it counts the rest. */
|
|
782
|
+
const NAMED_TYPES = 40;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @param {string[]} names
|
|
786
|
+
* @returns {string}
|
|
787
|
+
*/
|
|
788
|
+
function nameTypes(names) {
|
|
789
|
+
return names.length <= NAMED_TYPES
|
|
790
|
+
? names.join(', ')
|
|
791
|
+
: `${names.slice(0, NAMED_TYPES).join(', ')} and ${names.length - NAMED_TYPES} more`;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* The section keys `astryx docs authoring --index` lists, read the way that
|
|
796
|
+
* command reads them.
|
|
797
|
+
* @returns {Promise<{keys: Set<string>} | {keys: null, error: string}>}
|
|
798
|
+
*/
|
|
799
|
+
async function authoringTopicKeys() {
|
|
800
|
+
try {
|
|
801
|
+
const catalog = DocsCatalog.fromBuiltins();
|
|
802
|
+
const entry = catalog.resolve('authoring');
|
|
803
|
+
if (!entry) return {keys: null, error: 'it is not a built-in topic'};
|
|
804
|
+
const index = indexView(await lowerTopic(catalog, entry));
|
|
805
|
+
return {keys: new Set(index.sections.map(section => section.id))};
|
|
806
|
+
} catch (err) {
|
|
807
|
+
return {
|
|
808
|
+
keys: null,
|
|
809
|
+
error: err instanceof Error ? err.message : String(err),
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* @param {Awaited<ReturnType<typeof import('../../foundation/discovery/authoring-surface.mjs').auditAuthoringSurface>>} surface
|
|
816
|
+
* @returns {string[]}
|
|
817
|
+
*/
|
|
818
|
+
function surfaceProblems(surface) {
|
|
819
|
+
/** @type {string[]} */
|
|
820
|
+
const problems = [];
|
|
821
|
+
if (surface.types === 0 && surface.untraced.length === 0) {
|
|
822
|
+
problems.push(
|
|
823
|
+
'@astryxdesign/cli/authoring exports no types, so nothing was compared with `astryx docs authoring`',
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
for (const {module, names, reason, source, key} of surface.unreadable) {
|
|
827
|
+
const why =
|
|
828
|
+
reason === 'no-self-doc'
|
|
829
|
+
? `no self-doc sits beside ${module}`
|
|
830
|
+
: reason === 'unregistered'
|
|
831
|
+
? `${source} is not listed in AUTHORING_SELF_DOCS`
|
|
832
|
+
: reason === 'failed'
|
|
833
|
+
? `${source} does not load`
|
|
834
|
+
: `${source} renders section "${key}", which the topic's index does not list`;
|
|
835
|
+
problems.push(
|
|
836
|
+
`${nameTypes(names)} from ${module} ${names.length === 1 ? 'has' : 'have'} no doc in \`astryx docs authoring\`: ${why}`,
|
|
837
|
+
);
|
|
838
|
+
}
|
|
839
|
+
for (const {name, reason} of surface.untraced) {
|
|
840
|
+
problems.push(
|
|
841
|
+
`${name} cannot be traced to the module that declares it: ${reason}`,
|
|
842
|
+
);
|
|
843
|
+
}
|
|
844
|
+
for (const {source, subject} of surface.unmatched) {
|
|
845
|
+
problems.push(
|
|
846
|
+
subject
|
|
847
|
+
? `${source} documents ${subject}, which @astryxdesign/cli/authoring does not export`
|
|
848
|
+
: `${source} documents no type @astryxdesign/cli/authoring exports`,
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
return problems;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Every authoring self-doc is reachable from `astryx docs authoring`, loads,
|
|
856
|
+
* and fits in one read, and every type `@astryxdesign/cli/authoring` exports
|
|
857
|
+
* has its doc there: the self-doc beside the module that declares it. The
|
|
858
|
+
* audits are imported here, inside the try, so a malformed self-doc is
|
|
859
|
+
* reported rather than taking Doctor down.
|
|
860
|
+
* @param {DoctorContext} [_ctx]
|
|
861
|
+
* @param {{root?: string, sources?: string[], topicKeys?: Set<string> | null}} [options]
|
|
862
|
+
* Another authoring tree, list, or topic index to audit (for tests).
|
|
863
|
+
* @returns {Promise<DoctorCheck>}
|
|
864
|
+
*/
|
|
865
|
+
export async function checkAuthoringDocs(_ctx, options = {}) {
|
|
866
|
+
const id = 'authoring-docs';
|
|
867
|
+
const label = 'Authoring docs';
|
|
868
|
+
try {
|
|
869
|
+
const {auditAuthoringSelfDocs} =
|
|
870
|
+
await import('../../foundation/discovery/authoring-self-docs.mjs');
|
|
871
|
+
const {auditAuthoringSurface} =
|
|
872
|
+
await import('../../foundation/discovery/authoring-surface.mjs');
|
|
873
|
+
const {root, sources} = options;
|
|
874
|
+
const audit = await auditAuthoringSelfDocs({root, sources});
|
|
875
|
+
const problems = [
|
|
876
|
+
...audit.unreachable.map(
|
|
877
|
+
source => `${source} is not in \`astryx docs authoring\``,
|
|
878
|
+
),
|
|
879
|
+
...audit.failed.map(
|
|
880
|
+
({source, error}) => `${source} failed to load: ${error}`,
|
|
881
|
+
),
|
|
882
|
+
...audit.oversized.map(
|
|
883
|
+
({key, bytes}) =>
|
|
884
|
+
`authoring section "${key}" is ${kilobytes(bytes)}, over the ${kilobytes(DOC_OUTPUT_BUDGET_BYTES)} one read may return`,
|
|
885
|
+
),
|
|
886
|
+
];
|
|
887
|
+
const topic =
|
|
888
|
+
options.topicKeys === undefined
|
|
889
|
+
? await authoringTopicKeys()
|
|
890
|
+
: {keys: options.topicKeys};
|
|
891
|
+
const surface = [
|
|
892
|
+
...('error' in topic
|
|
893
|
+
? [`\`astryx docs authoring\` could not be read: ${topic.error}`]
|
|
894
|
+
: []),
|
|
895
|
+
...surfaceProblems(
|
|
896
|
+
await auditAuthoringSurface({root, sources, topicKeys: topic.keys}),
|
|
897
|
+
),
|
|
898
|
+
];
|
|
899
|
+
if (problems.length + surface.length > 0) {
|
|
900
|
+
return {
|
|
901
|
+
id,
|
|
902
|
+
label,
|
|
903
|
+
status: 'fail',
|
|
904
|
+
message: joinProblems([...problems, ...surface]),
|
|
905
|
+
fix: [
|
|
906
|
+
problems.length > 0 ? AUTHORING_DOCS_FIX : null,
|
|
907
|
+
surface.length > 0 ? AUTHORING_SURFACE_FIX : null,
|
|
908
|
+
]
|
|
909
|
+
.filter(Boolean)
|
|
910
|
+
.join(' '),
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
return {
|
|
914
|
+
id,
|
|
915
|
+
label,
|
|
916
|
+
status: 'pass',
|
|
917
|
+
message: `All ${audit.sections} authoring schemas are readable in \`astryx docs authoring\`.`,
|
|
918
|
+
};
|
|
919
|
+
} catch (err) {
|
|
920
|
+
return {
|
|
921
|
+
id,
|
|
922
|
+
label,
|
|
923
|
+
status: 'fail',
|
|
924
|
+
message: `The authoring docs could not be audited: ${err instanceof Error ? err.message : String(err)}`,
|
|
925
|
+
fix: 'Reinstall @astryxdesign/cli.',
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/** How the CLI-docs audit's problems are fixed. */
|
|
931
|
+
const CLI_DOCS_FIX =
|
|
932
|
+
"Set `namespace` on each CLI doc to the one that reads it: cli/commands for a command, cli/api for an API function or the output schema, error codes, and response types, and authoring for a file an author writes (and list it in AUTHORING_SELF_DOCS).";
|
|
933
|
+
|
|
934
|
+
/** How the docs-tree check's problems are fixed. */
|
|
935
|
+
const DOCS_TREE_FIX =
|
|
936
|
+
'Fix each placement, adoption rule, or link the message names: a placement names a namespace of its own package, one of its slots, and a slot that accepts its kind; exactly one namespace adopts each doc; every route belongs to one doc; every link names a doc that exists, as `[<provider>:]<kind>:<name>`.';
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* Every command, API function, schema, and enum doc the CLI ships declares a
|
|
940
|
+
* namespace, and something reads it: the docs tree under `astryx docs cli`
|
|
941
|
+
* for `cli/commands` and `cli/api`, `astryx docs authoring` for `authoring`.
|
|
942
|
+
* @param {DoctorContext | Partial<DoctorContext>} _ctx
|
|
943
|
+
* @param {{root?: string, sources?: string[], authoringSources?: string[]}} [options]
|
|
944
|
+
* test seams: the CLI root, the docs to audit, and the authoring topic's list
|
|
945
|
+
* @returns {Promise<DoctorCheck>}
|
|
946
|
+
*/
|
|
947
|
+
export async function checkCliDocs(_ctx, options = {}) {
|
|
948
|
+
const id = 'cli-docs';
|
|
949
|
+
const label = 'CLI docs';
|
|
950
|
+
try {
|
|
951
|
+
const {auditCliSelfDocs} =
|
|
952
|
+
await import('../../foundation/discovery/cli-self-docs.mjs');
|
|
953
|
+
const audit = await auditCliSelfDocs(options);
|
|
954
|
+
const problems = [
|
|
955
|
+
...audit.missing.map(
|
|
956
|
+
source =>
|
|
957
|
+
`${source} has no namespace, so no \`astryx docs\` topic reads it`,
|
|
958
|
+
),
|
|
959
|
+
...audit.unknown.map(
|
|
960
|
+
({source, namespace}) =>
|
|
961
|
+
`${source} has namespace "${namespace}", which no \`astryx docs\` topic reads`,
|
|
962
|
+
),
|
|
963
|
+
...audit.misfiled.map(({message}) => message),
|
|
964
|
+
...audit.failed.map(
|
|
965
|
+
({source, error}) => `${source} failed to load: ${error}`,
|
|
966
|
+
),
|
|
967
|
+
...audit.oversized.map(
|
|
968
|
+
({key, bytes}) =>
|
|
969
|
+
`CLI doc "${key}" is ${kilobytes(bytes)}, over the ${kilobytes(DOC_OUTPUT_BUDGET_BYTES)} one read may return`,
|
|
970
|
+
),
|
|
971
|
+
];
|
|
972
|
+
if (problems.length > 0) {
|
|
973
|
+
return {
|
|
974
|
+
id,
|
|
975
|
+
label,
|
|
976
|
+
status: 'fail',
|
|
977
|
+
message: joinProblems(problems),
|
|
978
|
+
fix: CLI_DOCS_FIX,
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
return {
|
|
982
|
+
id,
|
|
983
|
+
label,
|
|
984
|
+
status: 'pass',
|
|
985
|
+
message: `All ${audit.docs} CLI docs are readable: ${audit.tree} in the \`astryx docs cli\` tree and ${audit.authoring} in \`astryx docs authoring\`.`,
|
|
986
|
+
};
|
|
987
|
+
} catch (err) {
|
|
988
|
+
return {
|
|
989
|
+
id,
|
|
990
|
+
label,
|
|
991
|
+
status: 'fail',
|
|
992
|
+
message: `The CLI docs could not be audited: ${err instanceof Error ? err.message : String(err)}`,
|
|
993
|
+
fix: 'Reinstall @astryxdesign/cli.',
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* The docs tree builds with no error, and every CLI typed doc in a `cli/...`
|
|
1000
|
+
* group has a route in it (spec:AST-046): each placement names a namespace of
|
|
1001
|
+
* its own package and a slot that accepts it, exactly one namespace adopts
|
|
1002
|
+
* each doc, and each route belongs to one doc.
|
|
1003
|
+
* @param {DoctorContext | Partial<DoctorContext>} _ctx
|
|
1004
|
+
* @param {{tree?: import('../../foundation/doc-compiler/tree.mjs').DocsTree}} [options]
|
|
1005
|
+
* test seam: a tree to check instead of the CLI's own
|
|
1006
|
+
* @returns {Promise<DoctorCheck>}
|
|
1007
|
+
*/
|
|
1008
|
+
export async function checkDocsTree(_ctx, options = {}) {
|
|
1009
|
+
const id = 'docs-tree';
|
|
1010
|
+
const label = 'Docs tree';
|
|
1011
|
+
try {
|
|
1012
|
+
const catalog =
|
|
1013
|
+
/** @type {any} */ (_ctx)?.docsCatalog ?? builtinCatalog();
|
|
1014
|
+
const tree = options.tree ?? (await projectTree(catalog, {fresh: true}));
|
|
1015
|
+
const problems = tree.diagnostics
|
|
1016
|
+
.filter(d => d.severity === 'error')
|
|
1017
|
+
.map(d => `${d.source ?? d.provider ?? 'docs tree'}: ${d.message}`);
|
|
1018
|
+
if (options.tree === undefined) {
|
|
1019
|
+
const {loadCliSelfDocs, CLI_DOC_NAMESPACES} =
|
|
1020
|
+
await import('../../foundation/discovery/cli-self-docs.mjs');
|
|
1021
|
+
const placed = new Set(
|
|
1022
|
+
[...tree.nodes.values()].map(
|
|
1023
|
+
node => `${node.provider}\u0000${node.kind}\u0000${node.name}`,
|
|
1024
|
+
),
|
|
1025
|
+
);
|
|
1026
|
+
for (const {source, doc} of (await loadCliSelfDocs()).loaded) {
|
|
1027
|
+
if (CLI_DOC_NAMESPACES[doc.namespace]?.reader !== 'tree') continue;
|
|
1028
|
+
if (!placed.has(`@astryxdesign/cli\u0000${doc.type}\u0000${doc.name}`)) {
|
|
1029
|
+
problems.push(
|
|
1030
|
+
`${source} has namespace "${doc.namespace}", but no docs-tree namespace adopts it`,
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
// Every link between docs names a doc that exists (spec:AST-047 FR9):
|
|
1035
|
+
// typed fields, reference and workflow blocks, and inline links. A
|
|
1036
|
+
// reference block also includes all it names.
|
|
1037
|
+
for (const node of tree.nodes.values()) {
|
|
1038
|
+
for (const edge of typedEdges(tree, node).unresolved) {
|
|
1039
|
+
problems.push(`${node.route}: ${edge}`);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
problems.push(...(await docsLinkProblems(catalog, tree)));
|
|
1043
|
+
problems.push(
|
|
1044
|
+
...(await docsLinkProblems(catalog, tree, {references: true})),
|
|
1045
|
+
);
|
|
1046
|
+
}
|
|
1047
|
+
// New findings warn: a project that passed before keeps passing
|
|
1048
|
+
// (0.6 compatibility), and the warning names what to fix.
|
|
1049
|
+
if (problems.length > 0) {
|
|
1050
|
+
return {
|
|
1051
|
+
id,
|
|
1052
|
+
label,
|
|
1053
|
+
status: 'warn',
|
|
1054
|
+
message: joinProblems(problems),
|
|
1055
|
+
fix: DOCS_TREE_FIX,
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
const nodes = [...tree.nodes.values()];
|
|
1059
|
+
const namespaces = nodes.filter(node => node.kind === 'namespace').length;
|
|
1060
|
+
return {
|
|
1061
|
+
id,
|
|
1062
|
+
label,
|
|
1063
|
+
status: 'pass',
|
|
1064
|
+
message: `The docs tree has ${nodes.length - namespaces} docs in ${namespaces} sections (${tree.roots().length} at the top), each at one route.`,
|
|
1065
|
+
};
|
|
1066
|
+
} catch (err) {
|
|
1067
|
+
return {
|
|
1068
|
+
id,
|
|
1069
|
+
label,
|
|
1070
|
+
status: 'warn',
|
|
1071
|
+
message: `The docs tree could not be built: ${err instanceof Error ? err.message : String(err)}`,
|
|
1072
|
+
fix: 'Reinstall @astryxdesign/cli.',
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Every topic reads progressively, in every language it ships: it loads, its
|
|
1079
|
+
* section index and each of its sections fit in one read, and no contributed
|
|
1080
|
+
* doc is invalid.
|
|
1081
|
+
* @param {DoctorContext | Partial<DoctorContext>} ctx
|
|
1082
|
+
* @returns {Promise<DoctorCheck>}
|
|
1083
|
+
*/
|
|
1084
|
+
export async function checkDocsProgressiveDisclosure(ctx) {
|
|
1085
|
+
const id = 'docs-progressive-disclosure';
|
|
1086
|
+
const label = 'Documentation navigation and size';
|
|
1087
|
+
const budget = kilobytes(DOC_OUTPUT_BUDGET_BYTES);
|
|
1088
|
+
/** @type {string[]} */
|
|
1089
|
+
const problems = [];
|
|
1090
|
+
if (ctx.docsCatalogError) {
|
|
1091
|
+
problems.push(`The docs catalog could not be built: ${ctx.docsCatalogError}`);
|
|
1092
|
+
}
|
|
1093
|
+
for (const issue of ctx.docsCatalogIssues ?? []) {
|
|
1094
|
+
problems.push(`${issue.package ?? 'a contributed doc'}: ${issue.message}`);
|
|
1095
|
+
}
|
|
1096
|
+
let topics = 0;
|
|
1097
|
+
const catalog = ctx.docsCatalog;
|
|
1098
|
+
if (catalog) {
|
|
1099
|
+
// A guide the docs tree places is a topic read by its route; it is held
|
|
1100
|
+
// to the same budget as every flat topic.
|
|
1101
|
+
const guides = [...(await projectTree(catalog)).nodes.values()]
|
|
1102
|
+
// A flat topic in the Unorganized level is checked above, as a topic.
|
|
1103
|
+
.filter(node => node.kind === 'generic' && !node.ref?.flatTopic)
|
|
1104
|
+
.map(guideEntry);
|
|
1105
|
+
for (const entry of [...catalog.entries(), ...guides]) {
|
|
1106
|
+
for (const lang of [null, ...overlayLanguages(entry)]) {
|
|
1107
|
+
const where = lang ? `${entry.name} [${lang}]` : entry.name;
|
|
1108
|
+
try {
|
|
1109
|
+
const doc = detailView(await compileTopic(catalog, entry, lang));
|
|
1110
|
+
if (lang == null) topics += 1;
|
|
1111
|
+
const indexBytes = docsIndexBytes(buildDocsIndexData(doc));
|
|
1112
|
+
if (indexBytes > DOC_OUTPUT_BUDGET_BYTES) {
|
|
1113
|
+
problems.push(
|
|
1114
|
+
`${where}: its section index is ${kilobytes(indexBytes)}, over the ${budget} one read may return`,
|
|
1115
|
+
);
|
|
1116
|
+
}
|
|
1117
|
+
for (const over of oversizedDocSections(doc.sections)) {
|
|
1118
|
+
problems.push(
|
|
1119
|
+
`${where} ${over.key}: ${kilobytes(over.bytes)}, over the ${budget} one read may return`,
|
|
1120
|
+
);
|
|
1121
|
+
}
|
|
1122
|
+
} catch (err) {
|
|
1123
|
+
problems.push(
|
|
1124
|
+
`${where}: ${err instanceof Error ? err.message : String(err)}`,
|
|
1125
|
+
);
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
if (problems.length > 0) {
|
|
1131
|
+
return {
|
|
1132
|
+
id,
|
|
1133
|
+
label,
|
|
1134
|
+
status: 'warn',
|
|
1135
|
+
message: joinProblems(problems),
|
|
1136
|
+
fix: 'Fix the doc each problem names; split a section that is too large into smaller ones, each with its own key.',
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
return {
|
|
1140
|
+
id,
|
|
1141
|
+
label,
|
|
1142
|
+
status: 'pass',
|
|
1143
|
+
message: `${topics} topics: every section index and section fits in one ${budget} read.`,
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
|
|
630
1147
|
/**
|
|
631
1148
|
* Ordered list of synchronous check functions. Append here to add a check.
|
|
632
1149
|
* (checkConfig is async and is awaited separately by {@link runChecks}.)
|
|
@@ -638,6 +1155,8 @@ export const SYNC_CHECKS = [
|
|
|
638
1155
|
checkVersionAlignment,
|
|
639
1156
|
checkThemes,
|
|
640
1157
|
checkImplicitIntegrations,
|
|
1158
|
+
checkProviderIdentity,
|
|
1159
|
+
checkIntegrationIssues,
|
|
641
1160
|
checkAgentDocs,
|
|
642
1161
|
checkPeerDeps,
|
|
643
1162
|
checkPackageManager,
|
|
@@ -669,11 +1188,31 @@ export async function runChecks(options = {}) {
|
|
|
669
1188
|
let configTheme = null;
|
|
670
1189
|
/** @type {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]|null} */
|
|
671
1190
|
let integrations = null;
|
|
1191
|
+
// A docs read falls back to the built-in topics when the project cannot be
|
|
1192
|
+
// read, so the docs checks do too; the config check reports the config.
|
|
1193
|
+
/** @type {DocsCatalog|null} */
|
|
1194
|
+
let docsCatalog = DocsCatalog.fromBuiltins();
|
|
1195
|
+
/** @type {Array<{package?: string, code: string, message: string}>} */
|
|
1196
|
+
let docsCatalogIssues = [];
|
|
1197
|
+
/** @type {string|null} */
|
|
1198
|
+
let docsCatalogError = null;
|
|
1199
|
+
/** @type {Array<{package: string, code: string, severity: 'warning'|'error', message: string}>|null} */
|
|
1200
|
+
let integrationIssues = null;
|
|
672
1201
|
try {
|
|
673
1202
|
const project = await Project.load(cwd);
|
|
674
1203
|
configTheme =
|
|
675
1204
|
/** @type {{theme?: string}} */ (project.config ?? {}).theme ?? null;
|
|
676
1205
|
integrations = project.loadedIntegrations;
|
|
1206
|
+
try {
|
|
1207
|
+
docsCatalog = await project.docs();
|
|
1208
|
+
docsCatalogIssues = (await project.issues()).filter(
|
|
1209
|
+
issue => issue.code === 'invalid_doc',
|
|
1210
|
+
);
|
|
1211
|
+
} catch (err) {
|
|
1212
|
+
docsCatalog = null;
|
|
1213
|
+
docsCatalogError = err instanceof Error ? err.message : String(err);
|
|
1214
|
+
}
|
|
1215
|
+
integrationIssues = await project.issues();
|
|
677
1216
|
} catch {
|
|
678
1217
|
// Best-effort: a missing/invalid config leaves configTheme null.
|
|
679
1218
|
}
|
|
@@ -686,6 +1225,10 @@ export async function runChecks(options = {}) {
|
|
|
686
1225
|
configPath,
|
|
687
1226
|
configTheme,
|
|
688
1227
|
integrations,
|
|
1228
|
+
docsCatalog,
|
|
1229
|
+
docsCatalogIssues,
|
|
1230
|
+
docsCatalogError,
|
|
1231
|
+
integrationIssues,
|
|
689
1232
|
configError,
|
|
690
1233
|
};
|
|
691
1234
|
|
|
@@ -698,6 +1241,10 @@ export async function runChecks(options = {}) {
|
|
|
698
1241
|
checks.push(await checkConfig(ctx));
|
|
699
1242
|
}
|
|
700
1243
|
}
|
|
1244
|
+
checks.push(await checkAuthoringDocs(ctx));
|
|
1245
|
+
checks.push(await checkCliDocs(ctx));
|
|
1246
|
+
checks.push(await checkDocsTree(ctx));
|
|
1247
|
+
checks.push(await checkDocsProgressiveDisclosure(ctx));
|
|
701
1248
|
|
|
702
1249
|
const summary = {pass: 0, warn: 0, fail: 0, info: 0};
|
|
703
1250
|
for (const c of checks) summary[c.status] += 1;
|