@astryxdesign/cli 0.6.6 → 0.6.7-canary.7ec9564

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.
Files changed (396) hide show
  1. package/CHANGELOG.md +129 -0
  2. package/README.md +84 -82
  3. package/api/build/_adapter.d.mts +20 -0
  4. package/api/build/_adapter.mjs +24 -0
  5. package/api/build/build.doc.mjs +1 -1
  6. package/api/build/build.test.mjs +1 -1
  7. package/api/build/build.type.d.mts +12 -0
  8. package/api/build/build.type.mjs +3 -0
  9. package/api/build/help/help.mjs +1 -1
  10. package/api/build/kit/kit.mjs +13 -1
  11. package/api/component/_adapter.d.mts +19 -0
  12. package/api/component/_adapter.mjs +33 -0
  13. package/api/component/component-replacement.test.mjs +615 -0
  14. package/api/component/component.doc.mjs +5 -2
  15. package/api/component/component.mjs +49 -15
  16. package/api/component/component.test.mjs +32 -0
  17. package/api/component/component.type.d.mts +33 -3
  18. package/api/component/component.type.mjs +10 -3
  19. package/api/component/detail/blocks/blocks.d.mts +2 -1
  20. package/api/component/detail/blocks/blocks.mjs +5 -2
  21. package/api/component/detail/detail.mjs +5 -1
  22. package/api/component/detail/props/props.d.mts +2 -1
  23. package/api/component/detail/props/props.mjs +3 -2
  24. package/api/component/detail/showcase/showcase.d.mts +3 -1
  25. package/api/component/detail/showcase/showcase.mjs +3 -1
  26. package/api/component/detail/source/source.d.mts +3 -2
  27. package/api/component/detail/source/source.mjs +7 -3
  28. package/api/component/list/list.mjs +128 -10
  29. package/api/docs/_adapter.d.mts +11 -0
  30. package/api/docs/_adapter.mjs +73 -1
  31. package/api/docs/compiled-topics.test.mjs +1 -1
  32. package/api/docs/detail/detail.mjs +19 -3
  33. package/api/docs/detail/section/section.d.mts +44 -0
  34. package/api/docs/detail/section/section.mjs +171 -14
  35. package/api/docs/detail/section/section.test.mjs +4 -4
  36. package/api/docs/docOverlays.test.mjs +38 -23
  37. package/api/docs/docs.depth.test.mjs +2 -0
  38. package/api/docs/docs.doc.mjs +3 -3
  39. package/api/docs/docs.mjs +13 -16
  40. package/api/docs/docs.test.mjs +9 -10
  41. package/api/docs/docs.type.d.mts +43 -3
  42. package/api/docs/docs.type.mjs +23 -3
  43. package/api/docs/index/index.mjs +11 -2
  44. package/api/docs/index/index.test.mjs +7 -2
  45. package/api/docs/integration-tree.test.mjs +26 -26
  46. package/api/docs/integrationDocs.test.mjs +8 -7
  47. package/api/docs/namespace-section.test.mjs +260 -0
  48. package/api/docs/node/node.mjs +3 -0
  49. package/api/docs/token-tables.test.mjs +93 -0
  50. package/api/doctor/_adapter.d.mts +50 -0
  51. package/api/doctor/_adapter.mjs +190 -0
  52. package/api/doctor/doctor.d.mts +6 -10
  53. package/api/doctor/doctor.doc.mjs +1 -3
  54. package/api/doctor/doctor.mjs +144 -150
  55. package/api/doctor/doctor.test.mjs +104 -0
  56. package/api/doctor/theme-checks.d.mts +24 -0
  57. package/api/doctor/theme-checks.mjs +1231 -0
  58. package/api/doctor/theme-checks.test.mjs +667 -0
  59. package/api/gap-report/gap-report.doc.mjs +2 -1
  60. package/api/gap-report/gap-report.mjs +15 -1
  61. package/api/hook/_adapter.d.mts +1 -0
  62. package/api/hook/_adapter.mjs +3 -0
  63. package/api/hook/detail/detail.mjs +2 -2
  64. package/api/hook/detail/params/params.mjs +2 -2
  65. package/api/hook/hook.type.d.mts +12 -0
  66. package/api/hook/hook.type.mjs +3 -0
  67. package/api/hook/list/list.mjs +8 -8
  68. package/api/index.d.mts +1 -1
  69. package/api/index.mjs +4 -0
  70. package/api/init/run/run.d.mts +3 -5
  71. package/api/init/run/run.mjs +11 -11
  72. package/api/integration/__fixtures__/released-0.6.5-ocean.d.mts +14 -0
  73. package/api/integration/__fixtures__/released-0.6.5-ocean.mjs +15 -0
  74. package/api/integration/add-helpers.d.mts +26 -5
  75. package/api/integration/add-helpers.mjs +50 -5
  76. package/api/integration/add-theme.mjs +16 -2
  77. package/api/integration/add-theme.test.mjs +66 -15
  78. package/api/integration/authoring-checks.mjs +21 -1
  79. package/api/integration/integrationComponentConflicts.doc.mjs +6 -3
  80. package/api/integration/pack-check.component-replaces.test.mjs +126 -0
  81. package/api/integration/pack-check.d.mts +10 -0
  82. package/api/integration/pack-check.lifecycle-output.test.mjs +21 -2
  83. package/api/integration/pack-check.mjs +483 -1
  84. package/api/integration/pack-check.test.mjs +568 -8
  85. package/api/integration/validate-integration.mjs +20 -4
  86. package/api/integration/validate-integration.test.mjs +73 -0
  87. package/api/layout/check/check.d.mts +1 -0
  88. package/api/layout/check/check.mjs +1 -0
  89. package/api/layout/expand/expand.d.mts +1 -0
  90. package/api/layout/expand/expand.mjs +1 -0
  91. package/api/layout/grammar/grammar.d.mts +1 -0
  92. package/api/layout/grammar/grammar.mjs +1 -0
  93. package/api/layout/layoutCheck.doc.mjs +1 -1
  94. package/api/layout/layoutExpand.doc.mjs +1 -1
  95. package/api/layout/layoutGrammar.doc.mjs +1 -1
  96. package/api/search/search.d.mts +47 -3
  97. package/api/search/search.doc.mjs +1 -1
  98. package/api/search/search.domain-priority.test.mjs +261 -0
  99. package/api/search/search.mjs +247 -43
  100. package/api/search/search.test.mjs +5 -1
  101. package/api/search/search.type.d.mts +3 -3
  102. package/api/search/search.type.mjs +2 -2
  103. package/api/swizzle/_adapter.d.mts +10 -0
  104. package/api/swizzle/_adapter.mjs +23 -0
  105. package/api/swizzle/copy/copy.d.mts +5 -6
  106. package/api/swizzle/copy/copy.mjs +29 -10
  107. package/api/swizzle/list/list.mjs +2 -2
  108. package/api/swizzle/swizzle.doc.mjs +5 -2
  109. package/api/swizzle/swizzle.test.mjs +55 -5
  110. package/api/swizzle/swizzle.type.d.mts +8 -0
  111. package/api/swizzle/swizzle.type.mjs +2 -0
  112. package/api/template/copy/copy.mjs +14 -1
  113. package/api/template/show/show.mjs +2 -0
  114. package/api/template/skeleton/skeleton.mjs +2 -1
  115. package/api/template/template.d.mts +1 -1
  116. package/api/template/template.doc.mjs +1 -1
  117. package/api/template/template.mjs +1 -0
  118. package/api/template/template.type.d.mts +15 -0
  119. package/api/template/template.type.mjs +6 -0
  120. package/api/theme/_adapter.d.mts +106 -6
  121. package/api/theme/_adapter.mjs +687 -18
  122. package/api/theme/add/add.binary.test.mjs +76 -3
  123. package/api/theme/add/add.d.mts +5 -9
  124. package/api/theme/add/add.mjs +87 -64
  125. package/api/theme/add/add.rollback.test.mjs +9 -9
  126. package/api/theme/add/add.staging.test.mjs +9 -9
  127. package/api/theme/add/add.test.mjs +461 -55
  128. package/api/theme/add/add.types.test.mjs +151 -0
  129. package/api/theme/build/build.d.mts +96 -2
  130. package/api/theme/build/build.family.test.mjs +13 -4
  131. package/api/theme/build/build.mjs +286 -118
  132. package/api/theme/build/build.test.mjs +30 -0
  133. package/api/theme/build/font-warning.d.mts +11 -0
  134. package/api/theme/build/font-warning.mjs +28 -3
  135. package/api/theme/eject/eject.binary.test.mjs +90 -0
  136. package/api/theme/eject/eject.d.mts +17 -0
  137. package/api/theme/eject/eject.mjs +65 -0
  138. package/api/theme/eject/eject.rollback.test.mjs +158 -0
  139. package/api/theme/eject/eject.staging.test.mjs +83 -0
  140. package/api/theme/eject/eject.test.mjs +160 -0
  141. package/api/theme/integration-themes.test.mjs +30 -6
  142. package/api/theme/list/list.d.mts +10 -0
  143. package/api/theme/list/list.mjs +75 -7
  144. package/api/theme/list/list.test.mjs +155 -4
  145. package/api/theme/remove/remove.d.mts +12 -0
  146. package/api/theme/remove/remove.mjs +15 -0
  147. package/api/theme/remove/remove.test.mjs +94 -0
  148. package/api/theme/template/template.mjs +3 -4
  149. package/api/theme/theme.d.mts +5 -2
  150. package/api/theme/theme.mjs +13 -8
  151. package/api/theme/theme.type.d.mts +106 -2
  152. package/api/theme/theme.type.mjs +54 -5
  153. package/api/theme/themeAdd.doc.d.mts +1 -3
  154. package/api/theme/themeAdd.doc.mjs +35 -22
  155. package/api/theme/themeBuild.doc.mjs +1 -1
  156. package/api/theme/themeEject.doc.d.mts +8 -0
  157. package/api/theme/themeEject.doc.mjs +89 -0
  158. package/api/theme/themeListAvailable.doc.mjs +4 -4
  159. package/api/theme/themeListCopySources.doc.d.mts +8 -0
  160. package/api/theme/themeListCopySources.doc.mjs +60 -0
  161. package/api/theme/themeRemove.doc.d.mts +6 -0
  162. package/api/theme/themeRemove.doc.mjs +50 -0
  163. package/api/theme/themeTemplate.doc.mjs +4 -3
  164. package/api/theme/themeUse.doc.d.mts +6 -0
  165. package/api/theme/themeUse.doc.mjs +47 -0
  166. package/api/theme/use/use.d.mts +12 -0
  167. package/api/theme/use/use.mjs +15 -0
  168. package/api/theme/use/use.test.mjs +98 -0
  169. package/api/upgrade/_adapter.d.mts +1 -0
  170. package/api/upgrade/_adapter.mjs +3 -0
  171. package/api/upgrade/list/list.mjs +9 -3
  172. package/api/upgrade/upgrade.type.d.mts +4 -0
  173. package/api/upgrade/upgrade.type.mjs +1 -0
  174. package/assets/codemods/__tests__/registry.test.mjs +1 -0
  175. package/assets/codemods/integration-discovery.mjs +1 -1
  176. package/assets/codemods/integration-discovery.test.mjs +64 -0
  177. package/assets/codemods/registry.mjs +1 -0
  178. package/assets/codemods/transforms/v0.6.7/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
  179. package/assets/codemods/transforms/v0.6.7/index.mjs +23 -0
  180. package/assets/codemods/transforms/v0.6.7/migrate-copied-themes-to-descriptors.mjs +54 -0
  181. package/assets/docs/author-a-theme.doc.mjs +166 -0
  182. package/assets/docs/getting-started.doc.mjs +61 -17
  183. package/assets/docs/principles.doc.dense.mjs +4 -4
  184. package/assets/docs/principles.doc.mjs +6 -6
  185. package/assets/docs/principles.doc.zh.mjs +4 -4
  186. package/assets/docs/styling-overview.doc.mjs +211 -0
  187. package/assets/docs/theme.doc.dense.mjs +10 -198
  188. package/assets/docs/theme.doc.mjs +13 -771
  189. package/assets/docs/theme.doc.zh.mjs +31 -12
  190. package/assets/docs/tree/add-a-theme.doc.mjs +2 -2
  191. package/assets/docs/tree/checks.doc.mjs +5 -4
  192. package/assets/docs/tree/component-migration.doc.mjs +107 -0
  193. package/assets/docs/tree/css-and-stylex.doc.mjs +150 -0
  194. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  195. package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
  196. package/assets/docs/tree/font-setup.doc.mjs +122 -0
  197. package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
  198. package/assets/docs/tree/headers-and-footers.doc.mjs +67 -0
  199. package/assets/docs/tree/i18n-library-integration.doc.mjs +167 -0
  200. package/assets/docs/tree/i18n-quick-start.doc.mjs +101 -0
  201. package/assets/docs/{internationalization.doc.mjs → tree/i18n-rtl-and-testing.doc.mjs} +17 -223
  202. package/assets/docs/tree/internationalization.doc.mjs +29 -0
  203. package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
  204. package/assets/docs/tree/layout.doc.mjs +55 -0
  205. package/assets/docs/{migration.doc.mjs → tree/migration-setup.doc.mjs} +24 -129
  206. package/assets/docs/tree/migration-verification.doc.mjs +67 -0
  207. package/assets/docs/tree/migration.doc.mjs +28 -0
  208. package/assets/docs/tree/non-css-processing.doc.mjs +112 -0
  209. package/assets/docs/tree/other-libraries.doc.mjs +218 -0
  210. package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
  211. package/assets/docs/tree/responsive.doc.mjs +98 -0
  212. package/assets/docs/tree/scaffold.doc.mjs +140 -0
  213. package/assets/docs/tree/side-panels.doc.mjs +81 -0
  214. package/assets/docs/tree/structure.doc.mjs +140 -0
  215. package/assets/docs/tree/styling-advanced.doc.mjs +159 -0
  216. package/assets/docs/tree/styling-basics.doc.mjs +181 -0
  217. package/assets/docs/tree/styling-libraries.doc.mjs +30 -0
  218. package/assets/docs/tree/styling.doc.mjs +29 -0
  219. package/assets/docs/tree/tailwind.doc.mjs +65 -0
  220. package/assets/docs/tree/themes.doc.mjs +2 -2
  221. package/assets/docs/tree/tokens-and-setup.doc.mjs +128 -0
  222. package/assets/docs/tree/tokens-border.doc.mjs +46 -0
  223. package/assets/docs/tree/tokens-color.doc.dense.mjs +10 -0
  224. package/assets/docs/tree/tokens-color.doc.mjs +438 -0
  225. package/assets/docs/tree/tokens-color.doc.zh.mjs +10 -0
  226. package/assets/docs/tree/tokens-data.doc.mjs +323 -0
  227. package/assets/docs/tree/tokens-duration.doc.mjs +78 -0
  228. package/assets/docs/tree/tokens-ease.doc.mjs +46 -0
  229. package/assets/docs/tree/tokens-focus.doc.mjs +57 -0
  230. package/assets/docs/tree/tokens-font-weight.doc.mjs +58 -0
  231. package/assets/docs/tree/tokens-radius.doc.dense.mjs +10 -0
  232. package/assets/docs/tree/tokens-radius.doc.mjs +70 -0
  233. package/assets/docs/tree/tokens-radius.doc.zh.mjs +10 -0
  234. package/assets/docs/tree/tokens-shadow.doc.dense.mjs +10 -0
  235. package/assets/docs/tree/tokens-shadow.doc.mjs +74 -0
  236. package/assets/docs/tree/tokens-shadow.doc.zh.mjs +10 -0
  237. package/assets/docs/tree/tokens-size.doc.dense.mjs +10 -0
  238. package/assets/docs/tree/tokens-size.doc.mjs +54 -0
  239. package/assets/docs/tree/tokens-size.doc.zh.mjs +10 -0
  240. package/assets/docs/tree/tokens-spacing.doc.dense.mjs +10 -0
  241. package/assets/docs/tree/tokens-spacing.doc.mjs +102 -0
  242. package/assets/docs/tree/tokens-spacing.doc.zh.mjs +10 -0
  243. package/assets/docs/tree/tokens-syntax.doc.mjs +98 -0
  244. package/assets/docs/tree/tokens-text-size.doc.mjs +90 -0
  245. package/assets/docs/tree/tokens-type-scale.doc.mjs +210 -0
  246. package/assets/docs/tree/tokens-typography.doc.mjs +54 -0
  247. package/assets/docs/tree/tokens-usage.doc.dense.mjs +10 -0
  248. package/assets/docs/tree/tokens-usage.doc.mjs +36 -0
  249. package/assets/docs/tree/tokens-usage.doc.zh.mjs +10 -0
  250. package/assets/docs/tree/tokens.doc.mjs +28 -0
  251. package/assets/docs/tree/troubleshooting.doc.mjs +4 -0
  252. package/assets/docs/tree/type-scale.doc.mjs +147 -0
  253. package/assets/docs/tree/typography-best-practices.doc.mjs +55 -0
  254. package/assets/docs/tree/typography.doc.mjs +29 -0
  255. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
  256. package/assets/docs/tree/versioning.doc.mjs +4 -1
  257. package/assets/docs/use-a-theme.doc.mjs +212 -0
  258. package/assets/templates/pages/incident-console/page.tsx +1 -1
  259. package/assets/templates/pages/table-collapsible/page.tsx +1474 -0
  260. package/assets/templates/pages/table-collapsible/template.doc.mjs +12 -0
  261. package/assets/templates/pages/table-comparison/page.tsx +1449 -0
  262. package/assets/templates/pages/table-comparison/template.doc.mjs +12 -0
  263. package/assets/theme.template.ts +4 -3
  264. package/authoring/doctypes/command/command.doc.mjs +5 -0
  265. package/authoring/doctypes/command/type.ts +2 -0
  266. package/authoring/doctypes/component/component.doc.mjs +1 -1
  267. package/authoring/doctypes/component/type.ts +8 -4
  268. package/authoring/doctypes/template/type.ts +1 -0
  269. package/authoring/integration/integration.doc.mjs +1 -1
  270. package/clients/cli/commands/blog.mjs +3 -3
  271. package/clients/cli/commands/build-theme.adaptations.test.mjs +1 -1
  272. package/clients/cli/commands/build-theme.ascii-output.test.mjs +11 -1
  273. package/clients/cli/commands/build-theme.batch-report.test.mjs +335 -0
  274. package/clients/cli/commands/build-theme.font-warning.test.mjs +36 -7
  275. package/clients/cli/commands/build-theme.import-path.test.mjs +3 -3
  276. package/clients/cli/commands/build-theme.mjs +338 -45
  277. package/clients/cli/commands/build-theme.watch.test.mjs +33 -0
  278. package/clients/cli/commands/build.mjs +8 -6
  279. package/clients/cli/commands/build.text-fields.test.mjs +1 -1
  280. package/clients/cli/commands/component/index.mjs +91 -12
  281. package/clients/cli/commands/component-replacement.text.test.mjs +316 -0
  282. package/clients/cli/commands/component.doc.mjs +9 -2
  283. package/clients/cli/commands/docs.doc.mjs +2 -1
  284. package/clients/cli/commands/docs.mjs +63 -23
  285. package/clients/cli/commands/docs.test.mjs +17 -15
  286. package/clients/cli/commands/doctor-integration-components.doc.mjs +15 -4
  287. package/clients/cli/commands/doctor.doc.mjs +1 -1
  288. package/clients/cli/commands/doctor.test.mjs +59 -52
  289. package/clients/cli/commands/gap-report.doc.mjs +2 -2
  290. package/clients/cli/commands/hook/index.mjs +7 -2
  291. package/clients/cli/commands/import-hint-correctness.test.mjs +28 -5
  292. package/clients/cli/commands/init.next-steps.test.mjs +18 -23
  293. package/clients/cli/commands/integration-real-world.test.mjs +61 -12
  294. package/clients/cli/commands/layout-check.doc.mjs +2 -0
  295. package/clients/cli/commands/layout-expand.doc.mjs +2 -0
  296. package/clients/cli/commands/layout-grammar.doc.mjs +2 -0
  297. package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +140 -0
  298. package/clients/cli/commands/layout.doc.mjs +2 -0
  299. package/clients/cli/commands/layout.mjs +40 -4
  300. package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
  301. package/clients/cli/commands/search.test.mjs +10 -4
  302. package/clients/cli/commands/swizzle.doc.mjs +12 -3
  303. package/clients/cli/commands/swizzle.mjs +2 -1
  304. package/clients/cli/commands/swizzle.routing.test.mjs +2 -1
  305. package/clients/cli/commands/template.mjs +56 -5
  306. package/clients/cli/commands/text-json-parity.test.mjs +40 -0
  307. package/clients/cli/commands/theme-add-lifecycle.test.mjs +135 -0
  308. package/clients/cli/commands/theme-add.doc.mjs +19 -19
  309. package/clients/cli/commands/theme-build.doc.mjs +3 -1
  310. package/clients/cli/commands/theme-eject.doc.mjs +47 -0
  311. package/clients/cli/commands/theme-list.behavior.test.mjs +5 -2
  312. package/clients/cli/commands/theme-list.doc.mjs +2 -2
  313. package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -2
  314. package/clients/cli/commands/theme-remove.doc.mjs +22 -0
  315. package/clients/cli/commands/theme-template.doc.mjs +4 -3
  316. package/clients/cli/commands/theme-use.doc.mjs +22 -0
  317. package/clients/cli/commands/theme.doc.mjs +21 -16
  318. package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
  319. package/clients/cli/commands/upgrade.mjs +1 -1
  320. package/clients/cli/index.mjs +5 -2
  321. package/clients/cli/lib/component-format.mjs +29 -2
  322. package/clients/cli/lib/component-format.test.mjs +1 -1
  323. package/clients/cli/lib/define-command.mjs +4 -0
  324. package/clients/cli/lib/resolve-theme.mjs +80 -78
  325. package/clients/cli/lib/resolve-theme.test.mjs +523 -27
  326. package/foundation/agent-docs/agent-docs.mjs +48 -30
  327. package/foundation/agent-docs/agent-docs.test.mjs +47 -34
  328. package/foundation/agent-docs/app-theme-workflow.test.mjs +13 -0
  329. package/foundation/config/project.d.mts +20 -5
  330. package/foundation/config/project.mjs +43 -6
  331. package/foundation/config/project.test.mjs +1 -1
  332. package/foundation/config/theme-private-vars.d.mts +12 -0
  333. package/foundation/config/theme-private-vars.mjs +107 -0
  334. package/foundation/config/theme-private-vars.test.mjs +55 -0
  335. package/foundation/config/theme-state.d.mts +145 -0
  336. package/foundation/config/theme-state.mjs +417 -0
  337. package/foundation/config/theme-state.test.mjs +182 -0
  338. package/foundation/discovery/component-discovery.d.mts +5 -2
  339. package/foundation/discovery/component-discovery.mjs +12 -6
  340. package/foundation/discovery/component-replacement.d.mts +91 -0
  341. package/foundation/discovery/component-replacement.mjs +417 -0
  342. package/foundation/discovery/component-replacement.test.mjs +480 -0
  343. package/foundation/discovery/docs-discovery.test.mjs +1 -1
  344. package/foundation/discovery/docs-output-budget.d.mts +6 -2
  345. package/foundation/discovery/docs-output-budget.mjs +2 -1
  346. package/foundation/discovery/docs-section-key.d.mts +4 -2
  347. package/foundation/discovery/docs-section-key.mjs +1 -1
  348. package/foundation/discovery/module-exports.d.mts +10 -0
  349. package/foundation/discovery/module-exports.mjs +146 -0
  350. package/foundation/discovery/package-exports.d.mts +29 -0
  351. package/foundation/discovery/package-exports.mjs +200 -0
  352. package/foundation/discovery/template-needs.d.mts +31 -0
  353. package/foundation/discovery/template-needs.mjs +156 -0
  354. package/foundation/discovery/template-needs.test.mjs +203 -0
  355. package/foundation/discovery/theme-discovery.d.mts +72 -5
  356. package/foundation/discovery/theme-discovery.mjs +134 -18
  357. package/foundation/discovery/theme-discovery.test.mjs +9 -3
  358. package/foundation/discovery/theme-imports.d.mts +15 -0
  359. package/foundation/discovery/theme-imports.mjs +217 -0
  360. package/foundation/discovery/theme-imports.test.mjs +173 -0
  361. package/foundation/doc-compiler/bundle.mjs +52 -1
  362. package/foundation/doc-compiler/doc-loads.test.mjs +15 -5
  363. package/foundation/doc-compiler/inputs.mjs +2 -1
  364. package/foundation/doc-compiler/lenses.d.mts +4 -2
  365. package/foundation/doc-compiler/lenses.mjs +1 -1
  366. package/foundation/doc-compiler/split-topic-keywords.test.mjs +73 -0
  367. package/foundation/doc-compiler/tree.d.mts +10 -0
  368. package/foundation/doc-compiler/tree.mjs +22 -0
  369. package/foundation/doc-compiler/tree.test.mjs +3 -2
  370. package/foundation/env/package-manager.d.mts +31 -8
  371. package/foundation/env/package-manager.mjs +120 -13
  372. package/foundation/env/package-manager.test.mjs +174 -1
  373. package/foundation/fs/module-loader.d.mts +9 -0
  374. package/foundation/fs/module-loader.mjs +71 -2
  375. package/foundation/integrations/cli-requirement.d.mts +22 -0
  376. package/foundation/integrations/cli-requirement.mjs +31 -0
  377. package/foundation/integrations/cli-requirement.test.mjs +70 -0
  378. package/foundation/integrations/contribution-inventory.mjs +3 -3
  379. package/foundation/integrations/validate-contributions.d.mts +16 -0
  380. package/foundation/integrations/validate-contributions.mjs +56 -8
  381. package/foundation/response/base.d.ts +9 -3
  382. package/foundation/response/json.d.mts +7 -4
  383. package/foundation/response/json.mjs +10 -6
  384. package/foundation/response/response-types.doc.mjs +41 -26
  385. package/foundation/response/response.doc.mjs +18 -4
  386. package/foundation/text/copyright-header.mjs +1 -1
  387. package/foundation/text/copyright-header.test.mjs +1 -1
  388. package/package.json +9 -9
  389. package/assets/docs/layout.doc.dense.mjs +0 -388
  390. package/assets/docs/layout.doc.mjs +0 -550
  391. package/assets/docs/styling-libraries.doc.mjs +0 -469
  392. package/assets/docs/styling.doc.mjs +0 -412
  393. package/assets/docs/tokens.doc.dense.mjs +0 -15
  394. package/assets/docs/tokens.doc.mjs +0 -1491
  395. package/assets/docs/tokens.doc.zh.mjs +0 -15
  396. package/assets/docs/typography.doc.mjs +0 -286
@@ -24,6 +24,7 @@ import * as fs from 'node:fs';
24
24
  import * as path from 'node:path';
25
25
 
26
26
  import {MIN_NODE_VERSION, isNodeVersionSupported} from '../../foundation/env/node-version.mjs';
27
+ import {AGENT_DOC_PATHS} from '../../foundation/agent-docs/agent-doc-state.mjs';
27
28
  import {CLI_ROOT, findCoreDir, findInstalledPackage} from '../../foundation/fs/paths.mjs';
28
29
  import {explainPackageManager, getCliInvocation} from '../../foundation/env/package-manager.mjs';
29
30
  import {
@@ -50,6 +51,7 @@ import {
50
51
  import {typedEdges} from '../docs/node/node.mjs';
51
52
  import {detailView, indexView} from '../../foundation/doc-compiler/lenses.mjs';
52
53
  import {semverCompare, isValidSemver, satisfiesRange} from '../../foundation/env/semver.mjs';
54
+ import {checkAppThemes, checkThemes} from './theme-checks.mjs';
53
55
 
54
56
  /**
55
57
  * @typedef {'pass'|'warn'|'fail'|'info'} DoctorStatus
@@ -70,7 +72,6 @@ import {semverCompare, isValidSemver, satisfiesRange} from '../../foundation/env
70
72
  * @property {string} nodeVersion - Running Node version.
71
73
  * @property {string|null} coreDir - Resolved core package directory, or null.
72
74
  * @property {string|null} configPath - Resolved astryx.config.mjs path, or null.
73
- * @property {string|null} configTheme - theme value read from config, or null.
74
75
  * @property {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]|null} [integrations]
75
76
  * Every integration the project loaded, or null when the project could not be
76
77
  * read at all.
@@ -85,6 +86,9 @@ import {semverCompare, isValidSemver, satisfiesRange} from '../../foundation/env
85
86
  * Combined project-level integration issues, including cross-package template replacement warnings.
86
87
  * @property {Error|null} [configError] - Error thrown while resolving the config
87
88
  * path (e.g. multiple config files present), surfaced by checkConfig as a FAIL.
89
+ * @property {string|null} [projectError] - Why the CLI could not load the
90
+ * project from its config, when it could not. Checks that need the loaded
91
+ * project quote it when they skip, so a skip says what was found.
88
92
  */
89
93
 
90
94
  /* ── helpers ──────────────────────────────────────────────────────────── */
@@ -114,74 +118,61 @@ function pkgVersion(dir) {
114
118
  }
115
119
 
116
120
  /**
117
- * Walk up from `startDir` to locate the nearest node_modules directory.
118
- * @param {string} startDir
119
- * @returns {string|null}
121
+ * The first line of an error message, bounded for a one-line check message.
122
+ * @param {string} message
123
+ * @returns {string}
120
124
  */
121
- function findNodeModules(startDir) {
122
- let dir = startDir;
123
- for (let i = 0; i < 6; i++) {
124
- const candidate = path.join(dir, 'node_modules');
125
- if (fs.existsSync(candidate)) return candidate;
126
- const parent = path.dirname(dir);
127
- if (parent === dir) break;
128
- dir = parent;
129
- }
130
- return null;
125
+ function firstLine(message) {
126
+ return String(message).split('\n')[0].slice(0, 300);
131
127
  }
132
128
 
133
129
  /**
134
- * Find every installed @astryxdesign/theme-* package under node_modules.
135
- * @param {string} cwd
136
- * @returns {Array<{name: string, version: string|null}>}
130
+ * The message of a check that needs the loaded project and could not have it.
131
+ * It carries the reason the CLI gave, so the line says what Doctor found
132
+ * instead of only that it did not look.
133
+ * @param {DoctorContext} ctx
134
+ * @param {string} what
135
+ * @returns {string}
137
136
  */
138
- function findThemePackages(cwd) {
139
- const nm = findNodeModules(cwd);
140
- /** @type {Array<{name: string, version: string|null}>} */
141
- const found = [];
142
- if (!nm) return found;
143
- const scopeDir = path.join(nm, '@astryxdesign');
144
- if (!fs.existsSync(scopeDir)) return found;
145
- let entries;
146
- try {
147
- entries = fs.readdirSync(scopeDir, {withFileTypes: true});
148
- } catch {
149
- return found;
150
- }
151
- for (const entry of entries) {
152
- if (!entry.name.startsWith('theme-')) continue;
153
- const dir = path.join(scopeDir, entry.name);
154
- // pnpm installs packages as symlinks into node_modules/.pnpm, and a
155
- // symlink dirent reports isDirectory() as false — stat the target instead.
156
- let isDir = entry.isDirectory();
157
- if (!isDir && entry.isSymbolicLink()) {
158
- try {
159
- isDir = fs.statSync(dir).isDirectory();
160
- } catch {
161
- isDir = false;
162
- }
163
- }
164
- if (!isDir) continue;
165
- const name = `@astryxdesign/${entry.name}`;
166
- found.push({name, version: pkgVersion(dir)});
167
- }
168
- return found;
137
+ function skippedBecause(ctx, what) {
138
+ return ctx.projectError
139
+ ? `Skipped — ${what}: ${firstLine(ctx.projectError)}`
140
+ : `Skipped — ${what}.`;
169
141
  }
170
142
 
143
+ /** Integrations one message names before it counts the rest. */
144
+ const NAMED_INTEGRATIONS = 10;
145
+
171
146
  /**
172
- * Detect whether a theme appears to be wired up via the ASTRYX_THEME env var or
173
- * an `xds.theme` field in the nearest package.json. Config-based wiring is
174
- * handled by the caller (ctx.configTheme). This only inspects static signals.
175
- * @param {string} cwd
176
- * @returns {{wired: boolean, source: string|null}}
147
+ * @param {Array<{name?: string, __spec?: string}>} integrations
148
+ * @returns {string}
177
149
  */
178
- function detectThemeWiring(cwd) {
179
- if (process.env.ASTRYX_THEME) return {wired: true, source: 'ASTRYX_THEME env var'};
180
- const nm = findNodeModules(cwd);
181
- const projectDir = nm ? path.dirname(nm) : cwd;
182
- const pkg = readPkg(path.join(projectDir, 'package.json'));
183
- if (pkg?.astryx?.theme) return {wired: true, source: 'package.json astryx.theme'};
184
- return {wired: false, source: null};
150
+ function nameIntegrations(integrations) {
151
+ const names = integrations.map(
152
+ integration => integration.name ?? integration.__spec ?? '(integration)',
153
+ );
154
+ return names.length <= NAMED_INTEGRATIONS
155
+ ? names.join(', ')
156
+ : `${names.slice(0, NAMED_INTEGRATIONS).join(', ')} and ${names.length - NAMED_INTEGRATIONS} more`;
157
+ }
158
+
159
+ /**
160
+ * The project's root: the folder of its config, else of the nearest
161
+ * package.json above the working directory (where the config is looked for),
162
+ * else the working directory.
163
+ * @param {DoctorContext} ctx
164
+ * @returns {string}
165
+ */
166
+ function projectRootOf(ctx) {
167
+ if (ctx.configPath) return path.dirname(ctx.configPath);
168
+ let dir = ctx.cwd;
169
+ for (let i = 0; i < 50; i++) {
170
+ if (fs.existsSync(path.join(dir, 'package.json'))) return dir;
171
+ const parent = path.dirname(dir);
172
+ if (parent === dir) break;
173
+ dir = parent;
174
+ }
175
+ return ctx.cwd;
185
176
  }
186
177
 
187
178
  /* ── individual checks ────────────────────────────────────────────────── */
@@ -284,47 +275,6 @@ export function checkVersionAlignment(ctx) {
284
275
  };
285
276
  }
286
277
 
287
- /**
288
- * Check 4 — at least one @astryxdesign/theme-* is installed and a theme is wired.
289
- * @param {DoctorContext} ctx
290
- * @returns {DoctorCheck}
291
- */
292
- export function checkThemes(ctx) {
293
- const themes = findThemePackages(ctx.cwd);
294
- const wiring = detectThemeWiring(ctx.cwd);
295
- const hasConfigTheme = Boolean(ctx.configTheme);
296
- const wired = wiring.wired || hasConfigTheme;
297
-
298
- if (themes.length === 0) {
299
- return {
300
- id: 'themes',
301
- label: 'Theme packages',
302
- status: 'warn',
303
- message: 'No @astryxdesign/theme-* packages are installed.',
304
- fix: 'Install a theme, e.g. `npm install @astryxdesign/theme-neutral`, then import its CSS or set astryx.theme.',
305
- };
306
- }
307
-
308
- const names = themes.map(t => t.name).join(', ');
309
- if (!wired) {
310
- return {
311
- id: 'themes',
312
- label: 'Theme packages',
313
- status: 'warn',
314
- message: `Theme package(s) installed (${names}) but no theme appears wired.`,
315
- fix: 'Wire a theme via the `astryx.theme` field in package.json, the ASTRYX_THEME env var, or your astryx.config.mjs.',
316
- };
317
- }
318
-
319
- const source = hasConfigTheme ? 'astryx.config.mjs theme' : wiring.source;
320
- return {
321
- id: 'themes',
322
- label: 'Theme packages',
323
- status: 'pass',
324
- message: `Theme package(s) installed (${names}); wired via ${source}.`,
325
- };
326
- }
327
-
328
278
  /**
329
279
  * Check 5 — astryx.config.mjs (if present) loads and has a valid shape.
330
280
  * @param {DoctorContext} ctx
@@ -367,6 +317,18 @@ export async function checkConfig(ctx) {
367
317
  fix: 'Export a default object from astryx.config.mjs, e.g. `export default { integrations: [] };`.',
368
318
  };
369
319
  }
320
+ // Importing is not the whole test: the CLI also validates the config, and
321
+ // a config it rejects leaves every project-aware command without the
322
+ // project. That config is not clean, so this warns (exit code unchanged).
323
+ if (ctx.projectError) {
324
+ return {
325
+ id: 'config',
326
+ label: 'astryx.config.mjs',
327
+ status: 'warn',
328
+ message: `astryx.config.mjs loads, but the CLI could not load the project from it: ${firstLine(ctx.projectError)}`,
329
+ fix: 'Fix what the message names. `astryx docs authoring config` lists every field astryx.config accepts.',
330
+ };
331
+ }
370
332
  return {
371
333
  id: 'config',
372
334
  label: 'astryx.config.mjs',
@@ -416,7 +378,7 @@ export function checkImplicitIntegrations(ctx) {
416
378
  id,
417
379
  label,
418
380
  status: 'info',
419
- message: 'Skipped — the project configuration could not be read.',
381
+ message: skippedBecause(ctx, 'the project configuration could not be read'),
420
382
  };
421
383
  }
422
384
 
@@ -519,27 +481,30 @@ function describeUnreadableManifests(failures) {
519
481
  * @returns {DoctorCheck}
520
482
  */
521
483
  export function checkAgentDocs(ctx) {
522
- const candidates = [
523
- 'AGENTS.md',
524
- 'CLAUDE.md',
525
- path.join('.claude', 'CLAUDE.md'),
526
- '.cursorrules',
527
- ];
528
- const present = candidates.filter(rel => fs.existsSync(path.join(ctx.cwd, rel)));
484
+ // Every file init can write (one shared list), looked for in the working
485
+ // directory and in the project root: run from src/, the docs sit at the root.
486
+ const dirs = [...new Set([ctx.cwd, projectRootOf(ctx)])];
487
+ const present = dirs.flatMap(dir =>
488
+ AGENT_DOC_PATHS.map(rel => path.join(dir, rel)).filter(abs =>
489
+ fs.existsSync(abs),
490
+ ),
491
+ );
492
+ /** @param {string} abs */
493
+ const shown = abs => path.relative(ctx.cwd, abs) || path.basename(abs);
529
494
 
530
495
  if (present.length === 0) {
531
496
  return {
532
497
  id: 'agent-docs',
533
498
  label: 'AI agent docs',
534
499
  status: 'info',
535
- message: 'No agent docs (CLAUDE.md / AGENTS.md / .cursorrules) found.',
500
+ message: `No agent docs found: looked for ${AGENT_DOC_PATHS.join(', ')} in ${dirs.map(dir => path.relative(ctx.cwd, dir) || '.').join(' and ')}.`,
536
501
  fix: `Generate agent docs with \`${getCliInvocation(ctx.cwd)} init --features agents\`.`,
537
502
  };
538
503
  }
539
504
 
540
- const withMarkers = present.filter(rel => {
505
+ const withMarkers = present.filter(abs => {
541
506
  try {
542
- const content = fs.readFileSync(path.join(ctx.cwd, rel), 'utf-8');
507
+ const content = fs.readFileSync(abs, 'utf-8');
543
508
  return (
544
509
  (content.includes('<!-- ASTRYX:START -->') || content.includes('<!-- XDS:START -->')) &&
545
510
  (content.includes('<!-- ASTRYX:END -->') || content.includes('<!-- XDS:END -->'))
@@ -554,7 +519,7 @@ export function checkAgentDocs(ctx) {
554
519
  id: 'agent-docs',
555
520
  label: 'AI agent docs',
556
521
  status: 'warn',
557
- message: `Agent docs present (${present.join(', ')}) but no Astryx section markers found.`,
522
+ message: `Agent docs present (${present.map(shown).join(', ')}) but no Astryx section markers found.`,
558
523
  fix: `Add the Astryx section to your agent docs with \`${getCliInvocation(ctx.cwd)} init --features agents\`.`,
559
524
  };
560
525
  }
@@ -563,7 +528,7 @@ export function checkAgentDocs(ctx) {
563
528
  id: 'agent-docs',
564
529
  label: 'AI agent docs',
565
530
  status: 'pass',
566
- message: `Astryx agent docs section present in ${withMarkers.join(', ')}.`,
531
+ message: `Astryx agent docs section present in ${withMarkers.map(shown).join(', ')}.`,
567
532
  };
568
533
  }
569
534
 
@@ -658,15 +623,31 @@ export function checkIntegrationIssues(ctx) {
658
623
  id: 'integration-issues',
659
624
  label: 'Integration contributions',
660
625
  status: 'info',
661
- message: 'Skipped — the project integration graph could not be loaded.',
626
+ message: skippedBecause(
627
+ ctx,
628
+ 'the project integration graph could not be loaded',
629
+ ),
662
630
  };
663
631
  }
664
632
  if (issues.length === 0) {
633
+ // "No problems" is a finding only when something was looked at.
634
+ const checked = (ctx.integrations ?? []).filter(
635
+ integration => integration.__loadError == null,
636
+ );
637
+ if (checked.length === 0) {
638
+ return {
639
+ id: 'integration-issues',
640
+ label: 'Integration contributions',
641
+ status: 'info',
642
+ message:
643
+ 'No integration is loaded, so there are no integration contributions to check.',
644
+ };
645
+ }
665
646
  return {
666
647
  id: 'integration-issues',
667
648
  label: 'Integration contributions',
668
649
  status: 'pass',
669
- message: 'Integration contributions and cross-package relationships are valid.',
650
+ message: `${checked.length} loaded integration${checked.length === 1 ? '' : 's'} checked (${nameIntegrations(checked)}): contributions and cross-package relationships are valid.`,
670
651
  };
671
652
  }
672
653
  const errors = issues.filter(issue => issue.severity === 'error').length;
@@ -763,7 +744,7 @@ export function checkProviderIdentity(ctx) {
763
744
  id,
764
745
  label,
765
746
  status: 'info',
766
- message: 'Skipped — the project configuration could not be read.',
747
+ message: skippedBecause(ctx, 'the project configuration could not be read'),
767
748
  };
768
749
  }
769
750
 
@@ -1219,7 +1200,6 @@ export const SYNC_CHECKS = [
1219
1200
  checkNodeVersion,
1220
1201
  checkCoreInstalled,
1221
1202
  checkVersionAlignment,
1222
- checkThemes,
1223
1203
  checkImplicitIntegrations,
1224
1204
  checkProviderIdentity,
1225
1205
  checkIntegrationIssues,
@@ -1249,9 +1229,7 @@ export async function runChecks(options = {}) {
1249
1229
  configError = /** @type {Error} */ (err);
1250
1230
  }
1251
1231
 
1252
- // Resolve a possible theme key from config, and the integrations the project
1253
- // actually loaded (best-effort; never throws).
1254
- let configTheme = null;
1232
+ // Resolve integrations the project actually loaded (best-effort; never throws).
1255
1233
  /** @type {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]|null} */
1256
1234
  let integrations = null;
1257
1235
  // A docs read falls back to the built-in topics when the project cannot be
@@ -1266,35 +1244,48 @@ export async function runChecks(options = {}) {
1266
1244
  let integrationIssues = null;
1267
1245
  /** @type {Array<{spec: string, error: string}>|null} */
1268
1246
  let autolinkFailures = null;
1247
+ /** @type {string|null} */
1248
+ let projectError = null;
1249
+ /** @type {import('../../foundation/config/project.mjs').Project | null} */
1250
+ let project = null;
1269
1251
  try {
1270
- const project = await Project.load(cwd);
1271
- configTheme =
1272
- /** @type {{theme?: string}} */ (project.config ?? {}).theme ?? null;
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
- }));
1252
+ project = await Project.load(cwd);
1253
+ } catch (err) {
1254
+ // A project the CLI cannot load leaves the checks that need it
1255
+ // skipped. The reason is kept: those checks and the config
1256
+ // check quote it, so a skip is never silent.
1257
+ projectError = err instanceof Error ? err.message : String(err);
1258
+ }
1259
+ if (project) {
1286
1260
  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);
1261
+ integrations = project.loadedIntegrations;
1262
+ // An installed dependency whose manifest cannot be loaded is kept out of
1263
+ // loadedIntegrations on purpose. The provider ledger still records it.
1264
+ autolinkFailures = [...providerLedgerOf(project).values()]
1265
+ .filter(
1266
+ entry =>
1267
+ entry.outcome === 'load-failed' &&
1268
+ entry.candidate.source === 'autolinked',
1269
+ )
1270
+ .map(entry => ({
1271
+ spec: entry.candidate.spec ?? entry.label,
1272
+ error: entry.error ?? 'its manifest could not be loaded',
1273
+ }));
1274
+ try {
1275
+ docsCatalog = await project.docs();
1276
+ docsCatalogIssues = (await project.issues()).filter(
1277
+ issue => issue.code === 'invalid_doc',
1278
+ );
1279
+ } catch (err) {
1280
+ docsCatalog = null;
1281
+ docsCatalogError = err instanceof Error ? err.message : String(err);
1282
+ }
1283
+ integrationIssues = await project.issues();
1284
+ } catch {
1285
+ // Best-effort: once the project has loaded, a later read that throws
1286
+ // leaves the remaining fields at their defaults. It is no reason to
1287
+ // blame the config, so it never becomes projectError.
1294
1288
  }
1295
- integrationIssues = await project.issues();
1296
- } catch {
1297
- // Best-effort: a missing/invalid config leaves configTheme null.
1298
1289
  }
1299
1290
 
1300
1291
  /** @type {DoctorContext} */
@@ -1303,7 +1294,6 @@ export async function runChecks(options = {}) {
1303
1294
  nodeVersion: process.versions.node,
1304
1295
  coreDir,
1305
1296
  configPath,
1306
- configTheme,
1307
1297
  integrations,
1308
1298
  docsCatalog,
1309
1299
  docsCatalogIssues,
@@ -1311,14 +1301,18 @@ export async function runChecks(options = {}) {
1311
1301
  integrationIssues,
1312
1302
  autolinkFailures,
1313
1303
  configError,
1304
+ projectError,
1314
1305
  };
1315
1306
 
1316
1307
  /** @type {DoctorCheck[]} */
1317
1308
  const checks = [];
1318
- // checkConfig is async; run it in its declared slot (after themes).
1309
+ // Run the theme checks and config check after the environment checks. The
1310
+ // released `themes` check keeps its place, ahead of the app-theme checks.
1319
1311
  for (const fn of SYNC_CHECKS) {
1320
1312
  checks.push(fn(ctx));
1321
- if (fn === checkThemes) {
1313
+ if (fn === checkVersionAlignment) {
1314
+ const appThemeChecks = await checkAppThemes(cwd);
1315
+ checks.push(checkThemes(cwd, appThemeChecks), ...appThemeChecks);
1322
1316
  checks.push(await checkConfig(ctx));
1323
1317
  }
1324
1318
  }
@@ -1018,3 +1018,107 @@ describe('doctor says what it could not check', () => {
1018
1018
  expect(check.message).toContain('could not be read');
1019
1019
  });
1020
1020
  });
1021
+
1022
+ describe('doctor says why it skipped and what it checked', () => {
1023
+ const CORE_STUB = {
1024
+ 'node_modules/@astryxdesign/core/package.json': JSON.stringify({
1025
+ name: '@astryxdesign/core',
1026
+ version: '0.6.3',
1027
+ }),
1028
+ };
1029
+
1030
+ /** A project under the working directory, so its config can be imported. */
1031
+ function cwdProject(files) {
1032
+ const dir = fs.mkdtempSync(
1033
+ path.join(process.cwd(), '.astryx-doctor-shape-'),
1034
+ );
1035
+ tmpDirs.push(dir);
1036
+ for (const [rel, content] of Object.entries(files)) {
1037
+ const abs = path.join(dir, rel);
1038
+ fs.mkdirSync(path.dirname(abs), {recursive: true});
1039
+ fs.writeFileSync(abs, content);
1040
+ }
1041
+ return dir;
1042
+ }
1043
+
1044
+ it(
1045
+ 'warns, and quotes the reason, when the CLI cannot load the project from a config that imports',
1046
+ async () => {
1047
+ const dir = cwdProject({
1048
+ 'package.json': '{"name":"app"}',
1049
+ ...CORE_STUB,
1050
+ 'astryx.config.mjs': "export default { integrations: 'oops' };\n",
1051
+ });
1052
+ const {checks, summary} = (await doctor({cwd: dir})).data;
1053
+ const by = Object.fromEntries(checks.map(c => [c.id, c]));
1054
+ expect(by.config.status).toBe('warn');
1055
+ expect(by.config.message).toMatch(
1056
+ /^astryx\.config\.mjs loads, but the CLI could not load the project from it: .*integrations/,
1057
+ );
1058
+ expect(by.config.fix).toContain('astryx docs authoring config');
1059
+ for (const id of ['implicit-integrations', 'provider-identity']) {
1060
+ expect(by[id].message).toMatch(
1061
+ /^Skipped — the project configuration could not be read: .*integrations/,
1062
+ );
1063
+ }
1064
+ expect(by['integration-issues'].message).toMatch(
1065
+ /^Skipped — the project integration graph could not be loaded: .*integrations/,
1066
+ );
1067
+ // A warning: the exit code a released CLI gave this project is unchanged.
1068
+ expect(summary.fail).toBe(0);
1069
+ },
1070
+ SLOW,
1071
+ );
1072
+
1073
+ it(
1074
+ 'passes the config check when the CLI loads the project from it',
1075
+ async () => {
1076
+ const dir = cwdProject({
1077
+ 'package.json': '{"name":"app"}',
1078
+ ...CORE_STUB,
1079
+ 'astryx.config.mjs': 'export default { integrations: [] };\n',
1080
+ });
1081
+ const by = Object.fromEntries(
1082
+ (await doctor({cwd: dir})).data.checks.map(c => [c.id, c]),
1083
+ );
1084
+ expect(by.config.status).toBe('pass');
1085
+ expect(by['implicit-integrations'].message).not.toContain('Skipped');
1086
+ },
1087
+ SLOW,
1088
+ );
1089
+
1090
+ it('says there is nothing to check when no integration is loaded', () => {
1091
+ expect(
1092
+ checkIntegrationIssues({integrationIssues: [], integrations: []}),
1093
+ ).toEqual({
1094
+ id: 'integration-issues',
1095
+ label: 'Integration contributions',
1096
+ status: 'info',
1097
+ message:
1098
+ 'No integration is loaded, so there are no integration contributions to check.',
1099
+ });
1100
+ });
1101
+
1102
+ it('names what it checked when every loaded integration is clean', () => {
1103
+ expect(
1104
+ checkIntegrationIssues({
1105
+ integrationIssues: [],
1106
+ integrations: [{name: '@acme/widgets'}],
1107
+ }),
1108
+ ).toMatchObject({
1109
+ status: 'pass',
1110
+ message:
1111
+ '1 loaded integration checked (@acme/widgets): contributions and cross-package relationships are valid.',
1112
+ });
1113
+ });
1114
+
1115
+ it('bounds the names it lists', () => {
1116
+ const integrations = Array.from({length: 12}, (_, i) => ({
1117
+ name: `@acme/kit-${i}`,
1118
+ }));
1119
+ const c = checkIntegrationIssues({integrationIssues: [], integrations});
1120
+ expect(c.message).toMatch(
1121
+ /^12 loaded integrations checked \(.* and 2 more\): /,
1122
+ );
1123
+ });
1124
+ });
@@ -0,0 +1,24 @@
1
+ // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
+ // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
+
4
+ /**
5
+ * The `themes` check that every released doctor report carries. Its id is
6
+ * stable, so it stays beside the app-theme checks. Without a generated theme
7
+ * module it reports what it always has: whether an `@astryxdesign/theme-*`
8
+ * package is installed, and whether the app's package.json names a theme in
9
+ * `astryx.theme`. With a generated module it reports the overall result of the
10
+ * app-theme checks.
11
+ * @param {string} cwd
12
+ * @param {DoctorCheck[]} appChecks - the checks {@link checkAppThemes} returned
13
+ * @returns {DoctorCheck}
14
+ */
15
+ export function checkThemes(cwd: string, appChecks: DoctorCheck[]): DoctorCheck;
16
+ /**
17
+ * Run all ten app-theme checks.
18
+ * @param {string} cwd
19
+ * @returns {Promise<DoctorCheck[]>}
20
+ */
21
+ export function checkAppThemes(cwd: string): Promise<DoctorCheck[]>;
22
+ export type DoctorCheck = import("./doctor.mjs").DoctorCheck;
23
+ export type DiscoveredTheme = import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme;
24
+ export type ResolvedAppTheme = import("../../foundation/config/theme-state.mjs").ResolvedAppTheme;