@astryxdesign/cli 0.6.3 → 0.6.4-canary.0e1fbdb
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 +152 -107
- 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 +22 -10
- package/api/build/build.test.mjs +219 -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 +208 -53
- 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 +31 -12
- package/api/component/_adapter.mjs +79 -15
- package/api/component/component.d.mts +6 -3
- package/api/component/component.doc.mjs +49 -19
- package/api/component/component.mjs +339 -22
- package/api/component/component.test.mjs +38 -0
- package/api/component/component.type.d.mts +47 -11
- package/api/component/component.type.mjs +76 -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 +277 -41
- package/api/docs/_adapter.mjs +993 -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/docOverlays.test.mjs +27 -1
- 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.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/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 +104 -1
- package/api/doctor/doctor.doc.mjs +18 -8
- package/api/doctor/doctor.mjs +635 -7
- package/api/doctor/doctor.test.mjs +732 -11
- package/api/doctor/doctor.type.d.mts +1 -1
- package/api/doctor/doctor.type.mjs +1 -1
- package/api/gap-report/gap-report.doc.mjs +27 -14
- package/api/hook/_adapter.mjs +19 -5
- package/api/hook/hook.doc.mjs +7 -3
- 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 +2 -1
- package/api/index.mjs +6 -3
- package/api/init/init.doc.mjs +22 -12
- 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 +56 -65
- package/api/integration/add-theme.test.mjs +139 -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 +5 -4
- package/api/integration/integrationTemplateConflicts.doc.d.mts +3 -0
- package/api/integration/integrationTemplateConflicts.doc.mjs +4 -0
- package/api/integration/pack-check.lifecycle-output.test.mjs +107 -0
- package/api/integration/pack-check.mjs +160 -11
- package/api/integration/pack-check.test.mjs +477 -47
- package/api/integration/pack-check.type.d.mts +26 -2
- package/api/integration/pack-check.type.mjs +15 -2
- 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 +2 -1
- package/api/json/envelope-types.test.mjs +76 -0
- package/api/json/index.ts +2 -0
- package/api/json/isError.doc.mjs +2 -1
- 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 +89 -12
- package/api/search/search.doc.mjs +8 -2
- package/api/search/search.mjs +697 -97
- 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 +8 -5
- package/api/swizzle/swizzle.type.d.mts +2 -2
- package/api/swizzle/swizzle.type.mjs +2 -2
- package/api/template/copy/copy.mjs +18 -24
- package/api/template/copy/copy.test.mjs +26 -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 +32 -9
- 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 +2 -2
- 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 +12 -12
- package/api/theme/themeBuild.doc.mjs +21 -17
- package/api/theme/themeList.doc.mjs +6 -3
- package/api/theme/themeListAvailable.doc.mjs +6 -3
- package/api/theme/themePaletteGenerate.doc.mjs +16 -8
- package/api/theme/themeTargets.doc.mjs +4 -2
- package/api/theme/themeTemplate.doc.mjs +8 -3
- 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/files-changed.test.mjs +111 -0
- package/api/upgrade/run/run.mjs +358 -59
- package/api/upgrade/status/status.mjs +2 -2
- package/api/upgrade/upgrade.doc.mjs +32 -23
- package/api/upgrade/upgrade.type.d.mts +43 -5
- package/api/upgrade/upgrade.type.mjs +29 -13
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- package/assets/codemods/__tests__/runner.test.mjs +332 -8
- package/assets/codemods/file-count.test.mjs +163 -0
- package/assets/codemods/integration-discovery.mjs +48 -4
- package/assets/codemods/integration-discovery.test.mjs +73 -0
- package/assets/codemods/integration-runner.mjs +59 -7
- 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 +353 -104
- 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 +12 -1
- package/assets/docs/authoring.doc.mjs +14 -0
- package/assets/docs/browser-support.doc.mjs +11 -11
- package/assets/docs/color.doc.mjs +8 -2
- package/assets/docs/elevation.doc.mjs +6 -4
- package/assets/docs/getting-started.doc.mjs +6 -17
- package/assets/docs/icons.doc.mjs +2 -21
- package/assets/docs/illustrations.doc.mjs +7 -15
- package/assets/docs/internationalization.doc.mjs +7 -5
- package/assets/docs/layout.doc.dense.mjs +132 -84
- package/assets/docs/layout.doc.mjs +134 -78
- package/assets/docs/migration.doc.mjs +19 -21
- package/assets/docs/motion.doc.mjs +16 -3
- package/assets/docs/principles.doc.dense.mjs +5 -5
- package/assets/docs/principles.doc.mjs +14 -6
- package/assets/docs/principles.doc.zh.mjs +6 -6
- package/assets/docs/shape.doc.mjs +8 -3
- package/assets/docs/spacing.doc.mjs +7 -2
- package/assets/docs/styling-libraries.doc.mjs +10 -6
- package/assets/docs/styling.doc.mjs +22 -26
- package/assets/docs/theme.doc.dense.mjs +58 -18
- package/assets/docs/theme.doc.mjs +60 -50
- package/assets/docs/theme.doc.zh.mjs +9 -8
- package/assets/docs/tokens.doc.dense.mjs +2 -2
- package/assets/docs/tokens.doc.mjs +390 -9
- package/assets/docs/tokens.doc.zh.mjs +2 -2
- package/assets/docs/tree/add-a-component.doc.mjs +75 -0
- package/assets/docs/tree/add-a-theme.doc.mjs +85 -0
- package/assets/docs/tree/add-a-topic.doc.mjs +144 -0
- package/assets/docs/tree/agent-guidance.doc.mjs +138 -0
- package/assets/docs/tree/api.doc.mjs +30 -0
- package/assets/docs/tree/block-template.doc.mjs +130 -0
- package/assets/docs/tree/build-the-template.doc.mjs +28 -0
- package/assets/docs/tree/building-blocks.doc.mjs +46 -0
- package/assets/docs/tree/check-your-docs.doc.mjs +137 -0
- package/assets/docs/tree/checks.doc.mjs +119 -0
- package/assets/docs/tree/cli.doc.mjs +23 -0
- package/assets/docs/tree/codemods.doc.mjs +147 -0
- package/assets/docs/tree/commands.doc.mjs +25 -0
- package/assets/docs/tree/component-family.doc.mjs +113 -0
- package/assets/docs/tree/component-imports.doc.mjs +69 -0
- package/assets/docs/tree/component-lookups.doc.mjs +149 -0
- package/assets/docs/tree/components.doc.mjs +23 -0
- package/assets/docs/tree/configuration.doc.mjs +23 -0
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +182 -0
- package/assets/docs/tree/define-the-theme.doc.mjs +118 -0
- package/assets/docs/tree/describe-the-component.doc.mjs +57 -0
- package/assets/docs/tree/docs.doc.mjs +21 -0
- package/assets/docs/tree/document-the-template.doc.mjs +28 -0
- package/assets/docs/tree/document-the-theme.doc.mjs +68 -0
- package/assets/docs/tree/export-template-assets.doc.mjs +147 -0
- package/assets/docs/tree/extend-or-replace.doc.mjs +103 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +106 -0
- package/assets/docs/tree/generate-a-palette.doc.mjs +66 -0
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +105 -0
- package/assets/docs/tree/help.doc.mjs +16 -0
- package/assets/docs/tree/integrations.doc.mjs +40 -0
- package/assets/docs/tree/links.doc.mjs +98 -0
- package/assets/docs/tree/package-and-test.doc.mjs +32 -0
- package/assets/docs/tree/page-template.doc.mjs +71 -0
- package/assets/docs/tree/publishing.doc.mjs +111 -0
- package/assets/docs/tree/quick-start.doc.mjs +272 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +104 -0
- package/assets/docs/tree/replace-a-core-template.doc.mjs +172 -0
- package/assets/docs/tree/sections-and-placement.doc.mjs +108 -0
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +59 -0
- package/assets/docs/tree/ship.doc.mjs +16 -0
- package/assets/docs/tree/short-and-findable.doc.mjs +108 -0
- package/assets/docs/tree/single-component.doc.mjs +165 -0
- package/assets/docs/tree/start-a-template.doc.mjs +143 -0
- package/assets/docs/tree/subcomponent.doc.mjs +115 -0
- package/assets/docs/tree/template-assets.doc.mjs +64 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +109 -0
- package/assets/docs/tree/template-fonts.doc.mjs +102 -0
- package/assets/docs/tree/template-grading-rubric.doc.mjs +452 -0
- package/assets/docs/tree/template-icons.doc.mjs +97 -0
- package/assets/docs/tree/template-images-media.doc.mjs +127 -0
- package/assets/docs/tree/template-styles.doc.mjs +93 -0
- package/assets/docs/tree/templates.doc.mjs +34 -0
- package/assets/docs/tree/test-in-an-app.doc.mjs +115 -0
- package/assets/docs/tree/test-template-in-app.doc.mjs +128 -0
- package/assets/docs/tree/themes.doc.mjs +39 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +149 -0
- package/assets/docs/tree/upgrading.doc.mjs +103 -0
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +51 -0
- package/assets/docs/tree/verify-packed-template.doc.mjs +77 -0
- package/assets/docs/tree/versioning.doc.mjs +161 -0
- package/assets/docs/tree/write-good-templates.doc.mjs +64 -0
- package/assets/docs/tree/write-the-template-file.doc.mjs +154 -0
- package/assets/docs/typography.doc.mjs +24 -4
- package/assets/docs/working-with-ai.doc.mjs +34 -26
- 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 +11 -3
- 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 +792 -24
- package/authoring/doctypes/_schema.mjs +549 -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 +43 -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 +12 -3
- package/authoring/doctypes/component/parse.d.mts +2 -2
- package/authoring/doctypes/component/parse.mjs +1 -1
- package/authoring/doctypes/component/type.ts +14 -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 +55 -6
- package/authoring/doctypes/reference/type.ts +75 -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 +2 -2
- 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 +22 -13
- 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 +153 -61
- package/clients/cli/commands/component-batch.test.mjs +341 -0
- package/clients/cli/commands/component-ownership.test.mjs +92 -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 +28 -10
- 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 +295 -38
- package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -1
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +6 -5
- 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 +143 -8
- package/clients/cli/commands/doctor.doc.mjs +4 -2
- package/clients/cli/commands/doctor.mjs +108 -37
- package/clients/cli/commands/doctor.test.mjs +42 -0
- package/clients/cli/commands/gap-report.doc.mjs +27 -15
- 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 +24 -10
- 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 +39 -13
- package/clients/cli/commands/integration-authoring.test.mjs +74 -19
- package/clients/cli/commands/integration-pack.doc.mjs +6 -10
- package/clients/cli/commands/integration-real-world.test.mjs +4 -10
- package/clients/cli/commands/integration-verify.doc.mjs +22 -0
- package/clients/cli/commands/integration.doc.mjs +5 -5
- package/clients/cli/commands/integration.mjs +75 -43
- 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 +2 -2
- package/clients/cli/commands/no-prompt-wording.test.mjs +94 -0
- package/clients/cli/commands/search.doc.mjs +16 -6
- package/clients/cli/commands/search.mjs +49 -11
- package/clients/cli/commands/search.test.mjs +92 -0
- package/clients/cli/commands/setup-nudge.test.mjs +6 -0
- package/clients/cli/commands/swizzle.doc.mjs +4 -3
- package/clients/cli/commands/swizzle.path-safety.test.mjs +42 -0
- package/clients/cli/commands/template.doc.mjs +53 -14
- 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 +725 -0
- package/clients/cli/commands/theme-add.doc.mjs +5 -4
- 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 +12 -7
- package/clients/cli/commands/theme-palette-generate.test.mjs +19 -0
- package/clients/cli/commands/theme-palette.doc.mjs +2 -3
- package/clients/cli/commands/theme-targets.behavior.test.mjs +4 -3
- package/clients/cli/commands/theme-targets.doc.mjs +3 -3
- 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 +3 -2
- package/clients/cli/commands/upgrade.ascii-output.test.mjs +87 -0
- package/clients/cli/commands/upgrade.doc.mjs +83 -12
- 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 +47 -34
- 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 +56 -6
- package/clients/cli/lib/define-command.test.mjs +54 -0
- package/clients/cli/lib/doc-text-ascii.test.mjs +82 -0
- package/clients/cli/lib/exit-codes.test.mjs +113 -0
- package/clients/cli/lib/hook-format.mjs +19 -10
- package/clients/cli/lib/json-shim.mjs +62 -16
- 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 +53 -6
- package/clients/cli/lib/manifest.test.mjs +22 -2
- package/clients/cli/lib/parse-error-format.test.mjs +81 -0
- package/foundation/agent-docs/agent-docs.d.mts +7 -2
- package/foundation/agent-docs/agent-docs.mjs +83 -13
- package/foundation/agent-docs/agent-docs.path-safety.test.mjs +266 -4
- package/foundation/config/integration-debug.test.mjs +28 -3
- package/foundation/config/project-themes.test.mjs +11 -19
- package/foundation/config/project.d.mts +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 +174 -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 +504 -0
- package/foundation/discovery/cli-self-docs.test.mjs +395 -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 +427 -108
- package/foundation/discovery/docs-discovery.test.mjs +386 -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 +1643 -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 +298 -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 +292 -0
- package/foundation/doc-compiler/tree.mjs +881 -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 +65 -0
- package/foundation/integrations/cli-requirement.mjs +189 -0
- package/foundation/integrations/cli-requirement.test.mjs +89 -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 +28 -25
- 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/batch.type.d.mts +33 -0
- package/foundation/response/batch.type.mjs +34 -0
- 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 +19 -12
- package/foundation/response/error-codes.mjs +8 -2
- package/foundation/response/error-codes.test.mjs +166 -14
- 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 +7 -2
- package/foundation/response/response-types.doc.mjs +69 -25
- package/foundation/response/response-types.doc.test.mjs +181 -0
- package/foundation/response/response.doc.mjs +12 -11
- 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/api/docs/docs.test.mjs +0 -83
- package/api/docs/integrationDocs.test.mjs +0 -208
- package/api/search/search.test.mjs +0 -389
- package/assets/docs/cli-integrations.doc.mjs +0 -367
- package/assets/templates/themes/manifest.json +0 -95
- package/clients/cli/commands/docs.test.mjs +0 -102
- 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/foundation/agent-docs/agent-docs.test.mjs +0 -1141
package/api/doctor/doctor.mjs
CHANGED
|
@@ -26,7 +26,29 @@ import * as path from 'node:path';
|
|
|
26
26
|
import {MIN_NODE_VERSION, isNodeVersionSupported} from '../../foundation/env/node-version.mjs';
|
|
27
27
|
import {CLI_ROOT, findCoreDir, findInstalledPackage} from '../../foundation/fs/paths.mjs';
|
|
28
28
|
import {explainPackageManager, getCliInvocation} from '../../foundation/env/package-manager.mjs';
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
findConfigPath,
|
|
31
|
+
Project,
|
|
32
|
+
providerLedgerOf,
|
|
33
|
+
} from '../../foundation/config/project.mjs';
|
|
34
|
+
import {DocsCatalog} from '../../foundation/discovery/docs-discovery.mjs';
|
|
35
|
+
import {buildDocsIndexData} from '../../foundation/discovery/docs-section-key.mjs';
|
|
36
|
+
import {
|
|
37
|
+
DOC_OUTPUT_BUDGET_BYTES,
|
|
38
|
+
docsIndexBytes,
|
|
39
|
+
oversizedDocSections,
|
|
40
|
+
} from '../../foundation/discovery/docs-output-budget.mjs';
|
|
41
|
+
import {
|
|
42
|
+
builtinCatalog,
|
|
43
|
+
compileTopic,
|
|
44
|
+
docsLinkProblems,
|
|
45
|
+
guideEntry,
|
|
46
|
+
lowerTopic,
|
|
47
|
+
overlayLanguages,
|
|
48
|
+
projectTree,
|
|
49
|
+
} from '../docs/_adapter.mjs';
|
|
50
|
+
import {typedEdges} from '../docs/node/node.mjs';
|
|
51
|
+
import {detailView, indexView} from '../../foundation/doc-compiler/lenses.mjs';
|
|
30
52
|
import {semverCompare, isValidSemver, satisfiesRange} from '../../foundation/env/semver.mjs';
|
|
31
53
|
|
|
32
54
|
/**
|
|
@@ -52,6 +74,15 @@ import {semverCompare, isValidSemver, satisfiesRange} from '../../foundation/env
|
|
|
52
74
|
* @property {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]|null} [integrations]
|
|
53
75
|
* Every integration the project loaded, or null when the project could not be
|
|
54
76
|
* read at all.
|
|
77
|
+
* @property {DocsCatalog|null} [docsCatalog] - The topics a docs read sees.
|
|
78
|
+
* @property {Array<{package?: string, code: string, message: string}>} [docsCatalogIssues]
|
|
79
|
+
* `invalid_doc` issues from the project's contributed docs.
|
|
80
|
+
* @property {string|null} [docsCatalogError] - Why the project's docs catalog
|
|
81
|
+
* could not be built, when it could not.
|
|
82
|
+
* @property {Array<{package: string, code: string, severity: 'warning'|'error', message: string}>|null} [integrationIssues]
|
|
83
|
+
* @property {Array<{spec: string, error: string}>|null} [autolinkFailures]
|
|
84
|
+
* installed dependencies whose integration manifest could not be loaded
|
|
85
|
+
* Combined project-level integration issues, including cross-package template replacement warnings.
|
|
55
86
|
* @property {Error|null} [configError] - Error thrown while resolving the config
|
|
56
87
|
* path (e.g. multiple config files present), surfaced by checkConfig as a FAIL.
|
|
57
88
|
*/
|
|
@@ -392,6 +423,9 @@ export function checkImplicitIntegrations(ctx) {
|
|
|
392
423
|
const implicit = ctx.integrations.filter(
|
|
393
424
|
integration => integration.__autolinked,
|
|
394
425
|
);
|
|
426
|
+
// A dependency whose manifest cannot be loaded leaves no loaded record, so
|
|
427
|
+
// without this line doctor would say no dependency ships a manifest at all.
|
|
428
|
+
const unreadable = describeUnreadableManifests(ctx.autolinkFailures ?? []);
|
|
395
429
|
|
|
396
430
|
if (implicit.length === 0) {
|
|
397
431
|
return {
|
|
@@ -399,9 +433,12 @@ export function checkImplicitIntegrations(ctx) {
|
|
|
399
433
|
label,
|
|
400
434
|
status: 'info',
|
|
401
435
|
message:
|
|
402
|
-
ctx.integrations.length > 0
|
|
436
|
+
(ctx.integrations.length > 0
|
|
403
437
|
? 'None — every loaded integration is named in astryx.config.'
|
|
404
|
-
:
|
|
438
|
+
: unreadable
|
|
439
|
+
? 'None loaded.'
|
|
440
|
+
: 'None — no installed dependency ships an astryx.integration.* manifest.') +
|
|
441
|
+
unreadable,
|
|
405
442
|
};
|
|
406
443
|
}
|
|
407
444
|
|
|
@@ -414,11 +451,25 @@ export function checkImplicitIntegrations(ctx) {
|
|
|
414
451
|
integration.__spec && integration.__spec !== integration.name
|
|
415
452
|
? ` (declared as "${integration.__spec}")`
|
|
416
453
|
: '';
|
|
417
|
-
|
|
454
|
+
// A declared root counts only when it exists: the manifest's keys are a
|
|
455
|
+
// claim, and `integration-issues` reports the ones that are not true.
|
|
456
|
+
const declared = ['components', 'templates', 'themes', 'docs', 'codemods'].filter(
|
|
418
457
|
root => integration[/** @type {'components'} */ (root)],
|
|
419
458
|
);
|
|
459
|
+
const missing = declared.filter(root => {
|
|
460
|
+
const dir = integration[/** @type {'components'} */ (root)];
|
|
461
|
+
if (typeof dir !== 'string') return false;
|
|
462
|
+
const base =
|
|
463
|
+
typeof integration.__packageDir === 'string'
|
|
464
|
+
? integration.__packageDir
|
|
465
|
+
: (ctx.cwd ?? process.cwd());
|
|
466
|
+
return !fs.existsSync(path.isAbsolute(dir) ? dir : path.resolve(base, dir));
|
|
467
|
+
});
|
|
468
|
+
const roots = declared.filter(root => !missing.includes(root));
|
|
420
469
|
const contributes = roots.length > 0 ? roots.join(', ') : 'nothing';
|
|
421
|
-
|
|
470
|
+
const absent =
|
|
471
|
+
missing.length > 0 ? ` (declared ${missing.join(', ')} missing on disk)` : '';
|
|
472
|
+
return `${integration.name}${version}${alias} from ${integration.__dependencyField}, contributing ${contributes}${absent}`;
|
|
422
473
|
});
|
|
423
474
|
|
|
424
475
|
const plural = implicit.length === 1 ? '' : 's';
|
|
@@ -428,7 +479,8 @@ export function checkImplicitIntegrations(ctx) {
|
|
|
428
479
|
status: 'info',
|
|
429
480
|
message:
|
|
430
481
|
`${implicit.length} integration${plural} loaded from installed ` +
|
|
431
|
-
`dependencies with no astryx.config entry: ${described.join('; ')}
|
|
482
|
+
`dependencies with no astryx.config entry: ${described.join('; ')}.` +
|
|
483
|
+
unreadable,
|
|
432
484
|
fix:
|
|
433
485
|
'Nothing to fix. Keep these dependencies installed. The CLI links them ' +
|
|
434
486
|
'from package.json, so an unused-dependency check that looks only for ' +
|
|
@@ -437,6 +489,30 @@ export function checkImplicitIntegrations(ctx) {
|
|
|
437
489
|
};
|
|
438
490
|
}
|
|
439
491
|
|
|
492
|
+
/**
|
|
493
|
+
* The sentence `implicit-integrations` adds for dependencies whose manifest
|
|
494
|
+
* could not be loaded, or '' when there are none. Still informational: the
|
|
495
|
+
* package is a dependency's own bug, which `doctor integration validate`
|
|
496
|
+
* diagnoses, but doctor must not report it as absent.
|
|
497
|
+
* @param {Array<{spec: string, error: string}>} failures
|
|
498
|
+
* @returns {string}
|
|
499
|
+
*/
|
|
500
|
+
function describeUnreadableManifests(failures) {
|
|
501
|
+
if (failures.length === 0) return '';
|
|
502
|
+
const one = failures.length === 1;
|
|
503
|
+
const listed = failures
|
|
504
|
+
.map(({spec, error}) => {
|
|
505
|
+
const reason = String(error).split('\n')[0].slice(0, 160);
|
|
506
|
+
return `${spec} (${reason})`;
|
|
507
|
+
})
|
|
508
|
+
.join('; ');
|
|
509
|
+
return (
|
|
510
|
+
` ${failures.length} installed ${one ? 'dependency ships' : 'dependencies ship'} ` +
|
|
511
|
+
`an astryx.integration.* manifest that could not be loaded, so ${one ? 'it contributes' : 'they contribute'} ` +
|
|
512
|
+
`nothing: ${listed}. Run \`astryx doctor integration validate <package>\` for details.`
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
|
|
440
516
|
/**
|
|
441
517
|
* Check 7 — agent docs exist and contain the Astryx section markers.
|
|
442
518
|
* @param {DoctorContext} ctx
|
|
@@ -571,7 +647,45 @@ export function checkPeerDeps(ctx) {
|
|
|
571
647
|
}
|
|
572
648
|
|
|
573
649
|
/**
|
|
574
|
-
*
|
|
650
|
+
* Summarize the combined integration graph, including cross-package warnings.
|
|
651
|
+
* @param {DoctorContext} ctx
|
|
652
|
+
* @returns {DoctorCheck}
|
|
653
|
+
*/
|
|
654
|
+
export function checkIntegrationIssues(ctx) {
|
|
655
|
+
const issues = ctx.integrationIssues;
|
|
656
|
+
if (issues == null) {
|
|
657
|
+
return {
|
|
658
|
+
id: 'integration-issues',
|
|
659
|
+
label: 'Integration contributions',
|
|
660
|
+
status: 'info',
|
|
661
|
+
message: 'Skipped — the project integration graph could not be loaded.',
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
if (issues.length === 0) {
|
|
665
|
+
return {
|
|
666
|
+
id: 'integration-issues',
|
|
667
|
+
label: 'Integration contributions',
|
|
668
|
+
status: 'pass',
|
|
669
|
+
message: 'Integration contributions and cross-package relationships are valid.',
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
const errors = issues.filter(issue => issue.severity === 'error').length;
|
|
673
|
+
const details = issues
|
|
674
|
+
.map(issue => `${issue.package}: ${issue.message}`)
|
|
675
|
+
.join(' | ');
|
|
676
|
+
// This check is new, so it warns: a project that passed before keeps
|
|
677
|
+
// passing (spec:AST-046 FR8). `astryx doctor integration` fails on errors.
|
|
678
|
+
return {
|
|
679
|
+
id: 'integration-issues',
|
|
680
|
+
label: 'Integration contributions',
|
|
681
|
+
status: 'warn',
|
|
682
|
+
message: `${issues.length} integration issue(s)${errors > 0 ? `, ${errors} of them errors` : ''}: ${details}`,
|
|
683
|
+
fix: 'Run `astryx doctor integration` for package-specific diagnostics and resolve cross-package precedence in astryx.config.',
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Check 10 — report the detected package manager, and say so when the project's
|
|
575
689
|
* own declaration disagrees with what is on disk.
|
|
576
690
|
*
|
|
577
691
|
* Two states are worth surfacing rather than guessing past, because in both the
|
|
@@ -627,6 +741,475 @@ export function checkPackageManager(ctx) {
|
|
|
627
741
|
};
|
|
628
742
|
}
|
|
629
743
|
|
|
744
|
+
/**
|
|
745
|
+
* Check 6b — every contributing integration owns its provider identity.
|
|
746
|
+
*
|
|
747
|
+
* Artifact and document IDs are provider-scoped, so a package that claims a
|
|
748
|
+
* provider ID an earlier-loaded package already holds is loaded inert: its
|
|
749
|
+
* components, templates, themes, docs, and codemods are withdrawn while the
|
|
750
|
+
* earlier package keeps contributing. That can be a deliberate transition
|
|
751
|
+
* (a renamed package installed beside its predecessor), so it warns rather
|
|
752
|
+
* than fails, but it is never allowed to happen quietly.
|
|
753
|
+
*
|
|
754
|
+
* @param {DoctorContext} ctx
|
|
755
|
+
* @returns {DoctorCheck}
|
|
756
|
+
*/
|
|
757
|
+
export function checkProviderIdentity(ctx) {
|
|
758
|
+
const id = 'provider-identity';
|
|
759
|
+
const label = 'Integration provider identity';
|
|
760
|
+
|
|
761
|
+
if (ctx.integrations == null) {
|
|
762
|
+
return {
|
|
763
|
+
id,
|
|
764
|
+
label,
|
|
765
|
+
status: 'info',
|
|
766
|
+
message: 'Skipped — the project configuration could not be read.',
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
const conflicts = ctx.integrations.filter(
|
|
771
|
+
integration => integration.__providerConflict,
|
|
772
|
+
);
|
|
773
|
+
if (conflicts.length > 0) {
|
|
774
|
+
return {
|
|
775
|
+
id,
|
|
776
|
+
label,
|
|
777
|
+
status: 'warn',
|
|
778
|
+
message: conflicts
|
|
779
|
+
.map(integration => integration.__providerConflict?.message)
|
|
780
|
+
.join(' '),
|
|
781
|
+
fix:
|
|
782
|
+
'Give each integration its own `providerId` in astryx.integration.*. ' +
|
|
783
|
+
"A renamed package may keep its predecessor's ID only when the " +
|
|
784
|
+
'predecessor is no longer installed.',
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
const count = ctx.integrations.filter(
|
|
789
|
+
integration =>
|
|
790
|
+
integration.providerId != null && integration.__loadError == null,
|
|
791
|
+
).length;
|
|
792
|
+
// An integration that could not be read has no provider ID to check, so the
|
|
793
|
+
// count above is not a complete survey. Say so instead of counting silently.
|
|
794
|
+
const unread = ctx.integrations.filter(
|
|
795
|
+
integration => integration.__loadError != null,
|
|
796
|
+
).length;
|
|
797
|
+
const unreadNote =
|
|
798
|
+
unread === 0
|
|
799
|
+
? ''
|
|
800
|
+
: unread === 1
|
|
801
|
+
? ' 1 loaded integration could not be read, so its provider ID is unknown.'
|
|
802
|
+
: ` ${unread} loaded integrations could not be read, so their provider IDs are unknown.`;
|
|
803
|
+
if (count === 0) {
|
|
804
|
+
return {
|
|
805
|
+
id,
|
|
806
|
+
label,
|
|
807
|
+
status: 'info',
|
|
808
|
+
message:
|
|
809
|
+
(unread === 0
|
|
810
|
+
? 'None — no loaded integration has a provider identity.'
|
|
811
|
+
: 'No readable integration has a provider identity.') + unreadNote,
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
return {
|
|
815
|
+
id,
|
|
816
|
+
label,
|
|
817
|
+
status: 'pass',
|
|
818
|
+
message:
|
|
819
|
+
(count === 1
|
|
820
|
+
? '1 loaded integration has its own provider ID.'
|
|
821
|
+
: `${count} loaded integrations each have their own provider ID.`) +
|
|
822
|
+
unreadNote,
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/** @param {number} bytes */
|
|
827
|
+
const kilobytes = bytes => `${Math.ceil(bytes / 1024)} KB`;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* @param {string[]} problems
|
|
831
|
+
* @returns {string}
|
|
832
|
+
*/
|
|
833
|
+
function joinProblems(problems) {
|
|
834
|
+
return problems.length === 1
|
|
835
|
+
? problems[0]
|
|
836
|
+
: `${problems.length} problems: ${problems.join('; ')}`;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/** How the self-doc audit's problems are fixed. */
|
|
840
|
+
const AUTHORING_DOCS_FIX =
|
|
841
|
+
'List every authoring self-doc in AUTHORING_SELF_DOCS, fix the one that fails to load, and split a section that is too large.';
|
|
842
|
+
|
|
843
|
+
/** How the public-surface audit's problems are fixed. */
|
|
844
|
+
const AUTHORING_SURFACE_FIX =
|
|
845
|
+
'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.';
|
|
846
|
+
|
|
847
|
+
/** Types one problem names before it counts the rest. */
|
|
848
|
+
const NAMED_TYPES = 40;
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* @param {string[]} names
|
|
852
|
+
* @returns {string}
|
|
853
|
+
*/
|
|
854
|
+
function nameTypes(names) {
|
|
855
|
+
return names.length <= NAMED_TYPES
|
|
856
|
+
? names.join(', ')
|
|
857
|
+
: `${names.slice(0, NAMED_TYPES).join(', ')} and ${names.length - NAMED_TYPES} more`;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* The section keys `astryx docs authoring --index` lists, read the way that
|
|
862
|
+
* command reads them.
|
|
863
|
+
* @returns {Promise<{keys: Set<string>} | {keys: null, error: string}>}
|
|
864
|
+
*/
|
|
865
|
+
async function authoringTopicKeys() {
|
|
866
|
+
try {
|
|
867
|
+
const catalog = DocsCatalog.fromBuiltins();
|
|
868
|
+
const entry = catalog.resolve('authoring');
|
|
869
|
+
if (!entry) return {keys: null, error: 'it is not a built-in topic'};
|
|
870
|
+
const index = indexView(await lowerTopic(catalog, entry));
|
|
871
|
+
return {keys: new Set(index.sections.map(section => section.id))};
|
|
872
|
+
} catch (err) {
|
|
873
|
+
return {
|
|
874
|
+
keys: null,
|
|
875
|
+
error: err instanceof Error ? err.message : String(err),
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* @param {Awaited<ReturnType<typeof import('../../foundation/discovery/authoring-surface.mjs').auditAuthoringSurface>>} surface
|
|
882
|
+
* @returns {string[]}
|
|
883
|
+
*/
|
|
884
|
+
function surfaceProblems(surface) {
|
|
885
|
+
/** @type {string[]} */
|
|
886
|
+
const problems = [];
|
|
887
|
+
if (surface.types === 0 && surface.untraced.length === 0) {
|
|
888
|
+
problems.push(
|
|
889
|
+
'@astryxdesign/cli/authoring exports no types, so nothing was compared with `astryx docs authoring`',
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
for (const {module, names, reason, source, key} of surface.unreadable) {
|
|
893
|
+
const why =
|
|
894
|
+
reason === 'no-self-doc'
|
|
895
|
+
? `no self-doc sits beside ${module}`
|
|
896
|
+
: reason === 'unregistered'
|
|
897
|
+
? `${source} is not listed in AUTHORING_SELF_DOCS`
|
|
898
|
+
: reason === 'failed'
|
|
899
|
+
? `${source} does not load`
|
|
900
|
+
: `${source} renders section "${key}", which the topic's index does not list`;
|
|
901
|
+
problems.push(
|
|
902
|
+
`${nameTypes(names)} from ${module} ${names.length === 1 ? 'has' : 'have'} no doc in \`astryx docs authoring\`: ${why}`,
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
for (const {name, reason} of surface.untraced) {
|
|
906
|
+
problems.push(
|
|
907
|
+
`${name} cannot be traced to the module that declares it: ${reason}`,
|
|
908
|
+
);
|
|
909
|
+
}
|
|
910
|
+
for (const {source, subject} of surface.unmatched) {
|
|
911
|
+
problems.push(
|
|
912
|
+
subject
|
|
913
|
+
? `${source} documents ${subject}, which @astryxdesign/cli/authoring does not export`
|
|
914
|
+
: `${source} documents no type @astryxdesign/cli/authoring exports`,
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
return problems;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Every authoring self-doc is reachable from `astryx docs authoring`, loads,
|
|
922
|
+
* and fits in one read, and every type `@astryxdesign/cli/authoring` exports
|
|
923
|
+
* has its doc there: the self-doc beside the module that declares it. The
|
|
924
|
+
* audits are imported here, inside the try, so a malformed self-doc is
|
|
925
|
+
* reported rather than taking Doctor down.
|
|
926
|
+
* @param {DoctorContext} [_ctx]
|
|
927
|
+
* @param {{root?: string, sources?: string[], topicKeys?: Set<string> | null}} [options]
|
|
928
|
+
* Another authoring tree, list, or topic index to audit (for tests).
|
|
929
|
+
* @returns {Promise<DoctorCheck>}
|
|
930
|
+
*/
|
|
931
|
+
export async function checkAuthoringDocs(_ctx, options = {}) {
|
|
932
|
+
const id = 'authoring-docs';
|
|
933
|
+
const label = 'Authoring docs';
|
|
934
|
+
try {
|
|
935
|
+
const {auditAuthoringSelfDocs} =
|
|
936
|
+
await import('../../foundation/discovery/authoring-self-docs.mjs');
|
|
937
|
+
const {auditAuthoringSurface} =
|
|
938
|
+
await import('../../foundation/discovery/authoring-surface.mjs');
|
|
939
|
+
const {root, sources} = options;
|
|
940
|
+
const audit = await auditAuthoringSelfDocs({root, sources});
|
|
941
|
+
const problems = [
|
|
942
|
+
...audit.unreachable.map(
|
|
943
|
+
source => `${source} is not in \`astryx docs authoring\``,
|
|
944
|
+
),
|
|
945
|
+
...audit.failed.map(
|
|
946
|
+
({source, error}) => `${source} failed to load: ${error}`,
|
|
947
|
+
),
|
|
948
|
+
...audit.oversized.map(
|
|
949
|
+
({key, bytes}) =>
|
|
950
|
+
`authoring section "${key}" is ${kilobytes(bytes)}, over the ${kilobytes(DOC_OUTPUT_BUDGET_BYTES)} one read may return`,
|
|
951
|
+
),
|
|
952
|
+
];
|
|
953
|
+
const topic =
|
|
954
|
+
options.topicKeys === undefined
|
|
955
|
+
? await authoringTopicKeys()
|
|
956
|
+
: {keys: options.topicKeys};
|
|
957
|
+
const surface = [
|
|
958
|
+
...('error' in topic
|
|
959
|
+
? [`\`astryx docs authoring\` could not be read: ${topic.error}`]
|
|
960
|
+
: []),
|
|
961
|
+
...surfaceProblems(
|
|
962
|
+
await auditAuthoringSurface({root, sources, topicKeys: topic.keys}),
|
|
963
|
+
),
|
|
964
|
+
];
|
|
965
|
+
if (problems.length + surface.length > 0) {
|
|
966
|
+
return {
|
|
967
|
+
id,
|
|
968
|
+
label,
|
|
969
|
+
status: 'fail',
|
|
970
|
+
message: joinProblems([...problems, ...surface]),
|
|
971
|
+
fix: [
|
|
972
|
+
problems.length > 0 ? AUTHORING_DOCS_FIX : null,
|
|
973
|
+
surface.length > 0 ? AUTHORING_SURFACE_FIX : null,
|
|
974
|
+
]
|
|
975
|
+
.filter(Boolean)
|
|
976
|
+
.join(' '),
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
return {
|
|
980
|
+
id,
|
|
981
|
+
label,
|
|
982
|
+
status: 'pass',
|
|
983
|
+
message: `All ${audit.sections} authoring schemas are readable in \`astryx docs authoring\`.`,
|
|
984
|
+
};
|
|
985
|
+
} catch (err) {
|
|
986
|
+
return {
|
|
987
|
+
id,
|
|
988
|
+
label,
|
|
989
|
+
status: 'fail',
|
|
990
|
+
message: `The authoring docs could not be audited: ${err instanceof Error ? err.message : String(err)}`,
|
|
991
|
+
fix: 'Reinstall @astryxdesign/cli.',
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/** How the CLI-docs audit's problems are fixed. */
|
|
997
|
+
const CLI_DOCS_FIX =
|
|
998
|
+
"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).";
|
|
999
|
+
|
|
1000
|
+
/** How the docs-tree check's problems are fixed. */
|
|
1001
|
+
const DOCS_TREE_FIX =
|
|
1002
|
+
'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>`.';
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Every command, API function, schema, and enum doc the CLI ships declares a
|
|
1006
|
+
* namespace, and something reads it: the docs tree under `astryx docs cli`
|
|
1007
|
+
* for `cli/commands` and `cli/api`, `astryx docs authoring` for `authoring`.
|
|
1008
|
+
* @param {DoctorContext | Partial<DoctorContext>} _ctx
|
|
1009
|
+
* @param {{root?: string, sources?: string[], authoringSources?: string[]}} [options]
|
|
1010
|
+
* test seams: the CLI root, the docs to audit, and the authoring topic's list
|
|
1011
|
+
* @returns {Promise<DoctorCheck>}
|
|
1012
|
+
*/
|
|
1013
|
+
export async function checkCliDocs(_ctx, options = {}) {
|
|
1014
|
+
const id = 'cli-docs';
|
|
1015
|
+
const label = 'CLI docs';
|
|
1016
|
+
try {
|
|
1017
|
+
const {auditCliSelfDocs} =
|
|
1018
|
+
await import('../../foundation/discovery/cli-self-docs.mjs');
|
|
1019
|
+
const audit = await auditCliSelfDocs(options);
|
|
1020
|
+
const problems = [
|
|
1021
|
+
...audit.missing.map(
|
|
1022
|
+
source =>
|
|
1023
|
+
`${source} has no namespace, so no \`astryx docs\` topic reads it`,
|
|
1024
|
+
),
|
|
1025
|
+
...audit.unknown.map(
|
|
1026
|
+
({source, namespace}) =>
|
|
1027
|
+
`${source} has namespace "${namespace}", which no \`astryx docs\` topic reads`,
|
|
1028
|
+
),
|
|
1029
|
+
...audit.misfiled.map(({message}) => message),
|
|
1030
|
+
...audit.failed.map(
|
|
1031
|
+
({source, error}) => `${source} failed to load: ${error}`,
|
|
1032
|
+
),
|
|
1033
|
+
...audit.oversized.map(
|
|
1034
|
+
({key, bytes}) =>
|
|
1035
|
+
`CLI doc "${key}" is ${kilobytes(bytes)}, over the ${kilobytes(DOC_OUTPUT_BUDGET_BYTES)} one read may return`,
|
|
1036
|
+
),
|
|
1037
|
+
];
|
|
1038
|
+
if (problems.length > 0) {
|
|
1039
|
+
return {
|
|
1040
|
+
id,
|
|
1041
|
+
label,
|
|
1042
|
+
status: 'fail',
|
|
1043
|
+
message: joinProblems(problems),
|
|
1044
|
+
fix: CLI_DOCS_FIX,
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
return {
|
|
1048
|
+
id,
|
|
1049
|
+
label,
|
|
1050
|
+
status: 'pass',
|
|
1051
|
+
message: `All ${audit.docs} CLI docs are readable: ${audit.tree} in the \`astryx docs cli\` tree and ${audit.authoring} in \`astryx docs authoring\`.`,
|
|
1052
|
+
};
|
|
1053
|
+
} catch (err) {
|
|
1054
|
+
return {
|
|
1055
|
+
id,
|
|
1056
|
+
label,
|
|
1057
|
+
status: 'fail',
|
|
1058
|
+
message: `The CLI docs could not be audited: ${err instanceof Error ? err.message : String(err)}`,
|
|
1059
|
+
fix: 'Reinstall @astryxdesign/cli.',
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* The docs tree builds with no error, and every CLI typed doc in a `cli/...`
|
|
1066
|
+
* group has a route in it (spec:AST-046): each placement names a namespace of
|
|
1067
|
+
* its own package and a slot that accepts it, exactly one namespace adopts
|
|
1068
|
+
* each doc, and each route belongs to one doc.
|
|
1069
|
+
* @param {DoctorContext | Partial<DoctorContext>} _ctx
|
|
1070
|
+
* @param {{tree?: import('../../foundation/doc-compiler/tree.mjs').DocsTree}} [options]
|
|
1071
|
+
* test seam: a tree to check instead of the CLI's own
|
|
1072
|
+
* @returns {Promise<DoctorCheck>}
|
|
1073
|
+
*/
|
|
1074
|
+
export async function checkDocsTree(_ctx, options = {}) {
|
|
1075
|
+
const id = 'docs-tree';
|
|
1076
|
+
const label = 'Docs tree';
|
|
1077
|
+
try {
|
|
1078
|
+
const catalog =
|
|
1079
|
+
/** @type {any} */ (_ctx)?.docsCatalog ?? builtinCatalog();
|
|
1080
|
+
const tree = options.tree ?? (await projectTree(catalog, {fresh: true}));
|
|
1081
|
+
const problems = tree.diagnostics
|
|
1082
|
+
.filter(d => d.severity === 'error')
|
|
1083
|
+
.map(d => `${d.source ?? d.provider ?? 'docs tree'}: ${d.message}`);
|
|
1084
|
+
if (options.tree === undefined) {
|
|
1085
|
+
const {loadCliSelfDocs, CLI_DOC_NAMESPACES} =
|
|
1086
|
+
await import('../../foundation/discovery/cli-self-docs.mjs');
|
|
1087
|
+
const placed = new Set(
|
|
1088
|
+
[...tree.nodes.values()].map(
|
|
1089
|
+
node => `${node.provider}\u0000${node.kind}\u0000${node.name}`,
|
|
1090
|
+
),
|
|
1091
|
+
);
|
|
1092
|
+
for (const {source, doc} of (await loadCliSelfDocs()).loaded) {
|
|
1093
|
+
if (CLI_DOC_NAMESPACES[doc.namespace]?.reader !== 'tree') continue;
|
|
1094
|
+
if (!placed.has(`@astryxdesign/cli\u0000${doc.type}\u0000${doc.name}`)) {
|
|
1095
|
+
problems.push(
|
|
1096
|
+
`${source} has namespace "${doc.namespace}", but no docs-tree namespace adopts it`,
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
// Every link between docs names a doc that exists (spec:AST-047 FR9):
|
|
1101
|
+
// typed fields, reference and workflow blocks, and inline links. A
|
|
1102
|
+
// reference block also includes all it names.
|
|
1103
|
+
for (const node of tree.nodes.values()) {
|
|
1104
|
+
for (const edge of typedEdges(tree, node).unresolved) {
|
|
1105
|
+
problems.push(`${node.route}: ${edge}`);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
problems.push(...(await docsLinkProblems(catalog, tree)));
|
|
1109
|
+
problems.push(
|
|
1110
|
+
...(await docsLinkProblems(catalog, tree, {references: true})),
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
// New findings warn: a project that passed before keeps passing
|
|
1114
|
+
// (0.6 compatibility), and the warning names what to fix.
|
|
1115
|
+
if (problems.length > 0) {
|
|
1116
|
+
return {
|
|
1117
|
+
id,
|
|
1118
|
+
label,
|
|
1119
|
+
status: 'warn',
|
|
1120
|
+
message: joinProblems(problems),
|
|
1121
|
+
fix: DOCS_TREE_FIX,
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
const nodes = [...tree.nodes.values()];
|
|
1125
|
+
const namespaces = nodes.filter(node => node.kind === 'namespace').length;
|
|
1126
|
+
return {
|
|
1127
|
+
id,
|
|
1128
|
+
label,
|
|
1129
|
+
status: 'pass',
|
|
1130
|
+
message: `The docs tree has ${nodes.length - namespaces} docs in ${namespaces} sections (${tree.roots().length} at the top), each at one route.`,
|
|
1131
|
+
};
|
|
1132
|
+
} catch (err) {
|
|
1133
|
+
return {
|
|
1134
|
+
id,
|
|
1135
|
+
label,
|
|
1136
|
+
status: 'warn',
|
|
1137
|
+
message: `The docs tree could not be built: ${err instanceof Error ? err.message : String(err)}`,
|
|
1138
|
+
fix: 'Reinstall @astryxdesign/cli.',
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Every topic reads progressively, in every language it ships: it loads, its
|
|
1145
|
+
* section index and each of its sections fit in one read, and no contributed
|
|
1146
|
+
* doc is invalid.
|
|
1147
|
+
* @param {DoctorContext | Partial<DoctorContext>} ctx
|
|
1148
|
+
* @returns {Promise<DoctorCheck>}
|
|
1149
|
+
*/
|
|
1150
|
+
export async function checkDocsProgressiveDisclosure(ctx) {
|
|
1151
|
+
const id = 'docs-progressive-disclosure';
|
|
1152
|
+
const label = 'Documentation navigation and size';
|
|
1153
|
+
const budget = kilobytes(DOC_OUTPUT_BUDGET_BYTES);
|
|
1154
|
+
/** @type {string[]} */
|
|
1155
|
+
const problems = [];
|
|
1156
|
+
if (ctx.docsCatalogError) {
|
|
1157
|
+
problems.push(`The docs catalog could not be built: ${ctx.docsCatalogError}`);
|
|
1158
|
+
}
|
|
1159
|
+
for (const issue of ctx.docsCatalogIssues ?? []) {
|
|
1160
|
+
problems.push(`${issue.package ?? 'a contributed doc'}: ${issue.message}`);
|
|
1161
|
+
}
|
|
1162
|
+
let topics = 0;
|
|
1163
|
+
const catalog = ctx.docsCatalog;
|
|
1164
|
+
if (catalog) {
|
|
1165
|
+
// A guide the docs tree places is a topic read by its route; it is held
|
|
1166
|
+
// to the same budget as every flat topic.
|
|
1167
|
+
const guides = [...(await projectTree(catalog)).nodes.values()]
|
|
1168
|
+
// A flat topic in the Unorganized level is checked above, as a topic.
|
|
1169
|
+
.filter(node => node.kind === 'generic' && !node.ref?.flatTopic)
|
|
1170
|
+
.map(guideEntry);
|
|
1171
|
+
for (const entry of [...catalog.entries(), ...guides]) {
|
|
1172
|
+
for (const lang of [null, ...overlayLanguages(entry)]) {
|
|
1173
|
+
const where = lang ? `${entry.name} [${lang}]` : entry.name;
|
|
1174
|
+
try {
|
|
1175
|
+
const doc = detailView(await compileTopic(catalog, entry, lang));
|
|
1176
|
+
if (lang == null) topics += 1;
|
|
1177
|
+
const indexBytes = docsIndexBytes(buildDocsIndexData(doc));
|
|
1178
|
+
if (indexBytes > DOC_OUTPUT_BUDGET_BYTES) {
|
|
1179
|
+
problems.push(
|
|
1180
|
+
`${where}: its section index is ${kilobytes(indexBytes)}, over the ${budget} one read may return`,
|
|
1181
|
+
);
|
|
1182
|
+
}
|
|
1183
|
+
for (const over of oversizedDocSections(doc.sections)) {
|
|
1184
|
+
problems.push(
|
|
1185
|
+
`${where} ${over.key}: ${kilobytes(over.bytes)}, over the ${budget} one read may return`,
|
|
1186
|
+
);
|
|
1187
|
+
}
|
|
1188
|
+
} catch (err) {
|
|
1189
|
+
problems.push(
|
|
1190
|
+
`${where}: ${err instanceof Error ? err.message : String(err)}`,
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
if (problems.length > 0) {
|
|
1197
|
+
return {
|
|
1198
|
+
id,
|
|
1199
|
+
label,
|
|
1200
|
+
status: 'warn',
|
|
1201
|
+
message: joinProblems(problems),
|
|
1202
|
+
fix: 'Fix the doc each problem names; split a section that is too large into smaller ones, each with its own key.',
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
return {
|
|
1206
|
+
id,
|
|
1207
|
+
label,
|
|
1208
|
+
status: 'pass',
|
|
1209
|
+
message: `${topics} topics: every section index and section fits in one ${budget} read.`,
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
|
|
630
1213
|
/**
|
|
631
1214
|
* Ordered list of synchronous check functions. Append here to add a check.
|
|
632
1215
|
* (checkConfig is async and is awaited separately by {@link runChecks}.)
|
|
@@ -638,6 +1221,8 @@ export const SYNC_CHECKS = [
|
|
|
638
1221
|
checkVersionAlignment,
|
|
639
1222
|
checkThemes,
|
|
640
1223
|
checkImplicitIntegrations,
|
|
1224
|
+
checkProviderIdentity,
|
|
1225
|
+
checkIntegrationIssues,
|
|
641
1226
|
checkAgentDocs,
|
|
642
1227
|
checkPeerDeps,
|
|
643
1228
|
checkPackageManager,
|
|
@@ -669,11 +1254,45 @@ export async function runChecks(options = {}) {
|
|
|
669
1254
|
let configTheme = null;
|
|
670
1255
|
/** @type {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]|null} */
|
|
671
1256
|
let integrations = null;
|
|
1257
|
+
// A docs read falls back to the built-in topics when the project cannot be
|
|
1258
|
+
// read, so the docs checks do too; the config check reports the config.
|
|
1259
|
+
/** @type {DocsCatalog|null} */
|
|
1260
|
+
let docsCatalog = DocsCatalog.fromBuiltins();
|
|
1261
|
+
/** @type {Array<{package?: string, code: string, message: string}>} */
|
|
1262
|
+
let docsCatalogIssues = [];
|
|
1263
|
+
/** @type {string|null} */
|
|
1264
|
+
let docsCatalogError = null;
|
|
1265
|
+
/** @type {Array<{package: string, code: string, severity: 'warning'|'error', message: string}>|null} */
|
|
1266
|
+
let integrationIssues = null;
|
|
1267
|
+
/** @type {Array<{spec: string, error: string}>|null} */
|
|
1268
|
+
let autolinkFailures = null;
|
|
672
1269
|
try {
|
|
673
1270
|
const project = await Project.load(cwd);
|
|
674
1271
|
configTheme =
|
|
675
1272
|
/** @type {{theme?: string}} */ (project.config ?? {}).theme ?? null;
|
|
676
1273
|
integrations = project.loadedIntegrations;
|
|
1274
|
+
// An installed dependency whose manifest cannot be loaded is kept out of
|
|
1275
|
+
// loadedIntegrations on purpose. The provider ledger still records it.
|
|
1276
|
+
autolinkFailures = [...providerLedgerOf(project).values()]
|
|
1277
|
+
.filter(
|
|
1278
|
+
entry =>
|
|
1279
|
+
entry.outcome === 'load-failed' &&
|
|
1280
|
+
entry.candidate.source === 'autolinked',
|
|
1281
|
+
)
|
|
1282
|
+
.map(entry => ({
|
|
1283
|
+
spec: entry.candidate.spec ?? entry.label,
|
|
1284
|
+
error: entry.error ?? 'its manifest could not be loaded',
|
|
1285
|
+
}));
|
|
1286
|
+
try {
|
|
1287
|
+
docsCatalog = await project.docs();
|
|
1288
|
+
docsCatalogIssues = (await project.issues()).filter(
|
|
1289
|
+
issue => issue.code === 'invalid_doc',
|
|
1290
|
+
);
|
|
1291
|
+
} catch (err) {
|
|
1292
|
+
docsCatalog = null;
|
|
1293
|
+
docsCatalogError = err instanceof Error ? err.message : String(err);
|
|
1294
|
+
}
|
|
1295
|
+
integrationIssues = await project.issues();
|
|
677
1296
|
} catch {
|
|
678
1297
|
// Best-effort: a missing/invalid config leaves configTheme null.
|
|
679
1298
|
}
|
|
@@ -686,6 +1305,11 @@ export async function runChecks(options = {}) {
|
|
|
686
1305
|
configPath,
|
|
687
1306
|
configTheme,
|
|
688
1307
|
integrations,
|
|
1308
|
+
docsCatalog,
|
|
1309
|
+
docsCatalogIssues,
|
|
1310
|
+
docsCatalogError,
|
|
1311
|
+
integrationIssues,
|
|
1312
|
+
autolinkFailures,
|
|
689
1313
|
configError,
|
|
690
1314
|
};
|
|
691
1315
|
|
|
@@ -698,6 +1322,10 @@ export async function runChecks(options = {}) {
|
|
|
698
1322
|
checks.push(await checkConfig(ctx));
|
|
699
1323
|
}
|
|
700
1324
|
}
|
|
1325
|
+
checks.push(await checkAuthoringDocs(ctx));
|
|
1326
|
+
checks.push(await checkCliDocs(ctx));
|
|
1327
|
+
checks.push(await checkDocsTree(ctx));
|
|
1328
|
+
checks.push(await checkDocsProgressiveDisclosure(ctx));
|
|
701
1329
|
|
|
702
1330
|
const summary = {pass: 0, warn: 0, fail: 0, info: 0};
|
|
703
1331
|
for (const c of checks) summary[c.status] += 1;
|