@astryxdesign/cli 0.7.17-canary.g5a3fd39 → 0.7.17-canary.g5cf5d69

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 (426) hide show
  1. package/README.md +64 -63
  2. package/api/build/_adapter.d.mts +51 -0
  3. package/api/build/_adapter.mjs +122 -6
  4. package/api/build/build.doc.mjs +1 -1
  5. package/api/build/build.mjs +23 -14
  6. package/api/build/build.type.d.mts +1 -1
  7. package/api/build/build.type.mjs +3 -3
  8. package/api/build/help/help.d.mts +15 -14
  9. package/api/build/help/help.mjs +62 -3
  10. package/api/build/kit/answer.mjs +2 -3
  11. package/api/build/kit/signals.d.mts +10 -0
  12. package/api/build/kit/signals.mjs +15 -2
  13. package/api/component/detail/blocks/blocks.mjs +2 -1
  14. package/api/discover/_adapter.d.mts +57 -6
  15. package/api/discover/_adapter.mjs +278 -49
  16. package/api/discover/_catalog-view.d.mts +7 -0
  17. package/api/discover/_catalog-view.mjs +10 -1
  18. package/api/discover/detail/detail.d.mts +3 -2
  19. package/api/discover/detail/detail.mjs +3 -2
  20. package/api/discover/detail/doc/doc.mjs +1 -1
  21. package/api/discover/discover.d.mts +24 -0
  22. package/api/discover/discover.doc.mjs +1 -1
  23. package/api/discover/discover.mjs +146 -25
  24. package/api/discover/discover.type.d.mts +6 -4
  25. package/api/discover/discover.type.mjs +6 -4
  26. package/api/discover/search/search.d.mts +22 -0
  27. package/api/discover/search/search.mjs +290 -70
  28. package/api/docs/_entry-names.mjs +4 -3
  29. package/api/doctor/_adapter.d.mts +43 -3
  30. package/api/doctor/_adapter.mjs +142 -18
  31. package/api/doctor/built-checks.d.mts +30 -3
  32. package/api/doctor/built-checks.mjs +132 -5
  33. package/api/doctor/doctor.d.mts +93 -6
  34. package/api/doctor/doctor.doc.mjs +2 -2
  35. package/api/doctor/doctor.mjs +524 -33
  36. package/api/doctor/doctor.type.d.mts +2 -1
  37. package/api/doctor/doctor.type.mjs +2 -1
  38. package/api/doctor/theme-checks.d.mts +19 -0
  39. package/api/doctor/theme-checks.mjs +74 -6
  40. package/api/hook/hook.type.d.mts +1 -1
  41. package/api/hook/hook.type.mjs +1 -1
  42. package/api/hook/list/list.mjs +11 -7
  43. package/api/icon/_adapter.d.mts +2 -1
  44. package/api/icon/_adapter.mjs +10 -15
  45. package/api/icon/_records.d.mts +3 -1
  46. package/api/icon/_records.mjs +30 -3
  47. package/api/icon/exportIconIndex.doc.mjs +1 -1
  48. package/api/icon/icon.doc.mjs +3 -3
  49. package/api/icon/icon.type.d.mts +32 -1
  50. package/api/icon/icon.type.mjs +19 -3
  51. package/api/icon/list/list.mjs +4 -1
  52. package/api/icon/rankIconIndex.doc.mjs +1 -1
  53. package/api/icon/search/icon-index.mjs +18 -8
  54. package/api/icon/search/search.d.mts +26 -3
  55. package/api/icon/search/search.mjs +155 -9
  56. package/api/init/_adapter.d.mts +14 -0
  57. package/api/init/_adapter.mjs +26 -4
  58. package/api/init/init.d.mts +1 -1
  59. package/api/init/init.doc.mjs +2 -2
  60. package/api/init/init.mjs +1 -1
  61. package/api/init/init.type.d.mts +29 -1
  62. package/api/init/init.type.mjs +14 -1
  63. package/api/init/run/run.d.mts +11 -1
  64. package/api/init/run/run.mjs +84 -5
  65. package/api/integration/_adapter.d.mts +5 -4
  66. package/api/integration/_adapter.mjs +7 -5
  67. package/api/integration/integrationCheck.doc.mjs +1 -1
  68. package/api/integration/pack-check.mjs +8 -9
  69. package/api/integration/validate-integration.d.mts +1 -1
  70. package/api/integration/validate-integration.mjs +26 -24
  71. package/api/integration/validate-integration.type.d.mts +5 -2
  72. package/api/integration/validate-integration.type.mjs +5 -2
  73. package/api/integration/validateIntegration.doc.mjs +1 -1
  74. package/api/render/_adapter.d.mts +4 -2
  75. package/api/render/_adapter.mjs +62 -21
  76. package/api/render/render.doc.mjs +8 -5
  77. package/api/render/render.mjs +1 -1
  78. package/api/render/render.type.d.mts +2 -0
  79. package/api/render/render.type.mjs +2 -0
  80. package/api/search/ORDERING.md +2 -2
  81. package/api/search/_candidate-score.d.mts +3 -0
  82. package/api/search/_candidate-score.mjs +36 -3
  83. package/api/search/_gather-docs.mjs +29 -2
  84. package/api/search/_gather-templates.mjs +2 -1
  85. package/api/search/_main-searcher.mjs +13 -0
  86. package/api/search/_named-keywords.d.mts +2 -1
  87. package/api/search/_named-keywords.mjs +48 -6
  88. package/api/search/_order.d.mts +36 -1
  89. package/api/search/_order.mjs +141 -3
  90. package/api/swizzle/list/list.mjs +8 -1
  91. package/api/swizzle/swizzle.type.d.mts +1 -1
  92. package/api/swizzle/swizzle.type.mjs +1 -1
  93. package/api/template/copy/copy.mjs +3 -4
  94. package/api/template/list/list.mjs +2 -1
  95. package/api/template/show/show.mjs +2 -1
  96. package/api/template/skeleton/skeleton.mjs +2 -1
  97. package/api/template/template.doc.mjs +1 -1
  98. package/api/template/template.mjs +19 -1
  99. package/api/template/template.type.d.mts +1 -0
  100. package/api/template/template.type.mjs +2 -1
  101. package/api/theme/_adapter.d.mts +1 -0
  102. package/api/theme/_adapter.mjs +3 -5
  103. package/api/theme/_app-provider.d.mts +42 -0
  104. package/api/theme/_app-provider.mjs +61 -27
  105. package/api/theme/build/build.d.mts +4 -10
  106. package/api/theme/build/build.mjs +165 -116
  107. package/api/theme/build/input-fields.d.mts +9 -0
  108. package/api/theme/build/input-fields.mjs +155 -16
  109. package/api/theme/build/radius-values.d.mts +18 -0
  110. package/api/theme/build/radius-values.mjs +76 -0
  111. package/api/theme/build/typography-values.mjs +7 -23
  112. package/api/theme/build/written-values.d.mts +18 -0
  113. package/api/theme/build/written-values.mjs +107 -31
  114. package/api/theme/eject/eject.mjs +6 -1
  115. package/api/theme/palette/generate/generator.mjs +24 -0
  116. package/api/theme/theme.type.d.mts +4 -2
  117. package/api/theme/theme.type.mjs +3 -2
  118. package/api/theme/themeBuild.doc.mjs +2 -2
  119. package/api/theme/themeEject.doc.mjs +1 -1
  120. package/api/theme-edit/_catalog.d.mts +40 -0
  121. package/api/theme-edit/_catalog.mjs +100 -22
  122. package/api/theme-edit/_check.mjs +213 -43
  123. package/api/theme-edit/_color.d.mts +14 -0
  124. package/api/theme-edit/_color.mjs +22 -0
  125. package/api/theme-edit/_compiler.mjs +52 -0
  126. package/api/theme-edit/_context.d.mts +20 -2
  127. package/api/theme-edit/_context.mjs +157 -29
  128. package/api/theme-edit/_edit.mjs +426 -58
  129. package/api/theme-edit/_how-question.d.mts +14 -0
  130. package/api/theme-edit/_how-question.mjs +1541 -127
  131. package/api/theme-edit/_how.mjs +43 -0
  132. package/api/theme-edit/_missed.mjs +107 -27
  133. package/api/theme-edit/_normal.d.mts +18 -4
  134. package/api/theme-edit/_normal.mjs +84 -3
  135. package/api/theme-edit/_palette.d.mts +9 -0
  136. package/api/theme-edit/_palette.mjs +158 -33
  137. package/api/theme-edit/_part-words.mjs +16 -3
  138. package/api/theme-edit/_parts.d.mts +8 -0
  139. package/api/theme-edit/_parts.mjs +120 -36
  140. package/api/theme-edit/_png.d.mts +24 -0
  141. package/api/theme-edit/_png.mjs +99 -0
  142. package/api/theme-edit/_preview-app.d.mts +16 -0
  143. package/api/theme-edit/_preview-app.mjs +52 -18
  144. package/api/theme-edit/_preview.d.mts +44 -26
  145. package/api/theme-edit/_preview.mjs +255 -67
  146. package/api/theme-edit/_project.d.mts +12 -1
  147. package/api/theme-edit/_project.mjs +16 -1
  148. package/api/theme-edit/_settings.d.mts +116 -0
  149. package/api/theme-edit/_settings.mjs +1197 -58
  150. package/api/theme-edit/_tables.d.mts +16 -0
  151. package/api/theme-edit/_tables.mjs +34 -4
  152. package/api/theme-edit/theme-edit.type.d.mts +15 -2
  153. package/api/theme-edit/theme-edit.type.mjs +8 -6
  154. package/api/upgrade/_adapter.d.mts +46 -7
  155. package/api/upgrade/_adapter.mjs +110 -15
  156. package/api/upgrade/registry/registry.d.mts +6 -3
  157. package/api/upgrade/registry/registry.mjs +21 -6
  158. package/api/upgrade/run/run.mjs +23 -11
  159. package/api/upgrade/upgrade.doc.mjs +4 -3
  160. package/assets/component-list.generated.json +1 -1
  161. package/assets/docs/tree/agent-guidance.doc.mjs +3 -2
  162. package/assets/docs/tree/checks.doc.mjs +2 -2
  163. package/assets/docs/tree/host-entry.doc.mjs +4 -0
  164. package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
  165. package/assets/docs/tree/icon-sets.doc.mjs +6 -6
  166. package/assets/docs/tree/problems.doc.mjs +3 -3
  167. package/assets/docs/tree/render-pages.doc.mjs +17 -3
  168. package/assets/docs/tree/share-a-page.doc.mjs +5 -5
  169. package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
  170. package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
  171. package/assets/docs/tree/updates.doc.mjs +1 -1
  172. package/assets/docs/tree/versioning.doc.mjs +1 -1
  173. package/assets/docs/working-with-ai.doc.mjs +40 -5
  174. package/assets/docs-routes.generated.json +1 -1
  175. package/assets/docs.generated.json +2 -2
  176. package/assets/icons/installed-icon-set.doc.mjs +30 -0
  177. package/assets/search-catalog.generated.json +2 -2
  178. package/assets/self-audit.generated.json +1 -1
  179. package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
  180. package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
  181. package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
  182. package/assets/templates/components.generated.json +1 -1
  183. package/assets/templates/pages/ai-chat/page.tsx +6 -2
  184. package/assets/templates/pages/ai-chat-landing/page.tsx +1 -1
  185. package/assets/templates/pages/blank/page.tsx +4 -2
  186. package/assets/templates/pages/canvas-editor/page.tsx +3 -1
  187. package/assets/templates/pages/centered-hero/page.tsx +1 -1
  188. package/assets/templates/pages/checkout-wizard/page.tsx +1 -1
  189. package/assets/templates/pages/classic-gallery/page.tsx +1 -1
  190. package/assets/templates/pages/contact-form/page.tsx +2 -2
  191. package/assets/templates/pages/course-detail/page.tsx +1 -1
  192. package/assets/templates/pages/dashboard/page.tsx +24 -8
  193. package/assets/templates/pages/dashboard-alert-rail/page.tsx +4 -2
  194. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +7 -3
  195. package/assets/templates/pages/dashboard-comparison/page.tsx +5 -2
  196. package/assets/templates/pages/dashboard-composition/page.tsx +10 -4
  197. package/assets/templates/pages/dashboard-progress/page.tsx +6 -3
  198. package/assets/templates/pages/dashboard-scorecard/page.tsx +17 -8
  199. package/assets/templates/pages/detail-page/page.tsx +22 -5
  200. package/assets/templates/pages/documentation/page.tsx +4 -2
  201. package/assets/templates/pages/documentation-design/page.tsx +5 -2
  202. package/assets/templates/pages/documentation-technical/page.tsx +4 -2
  203. package/assets/templates/pages/editor/page.tsx +28 -9
  204. package/assets/templates/pages/file-explorer/page.tsx +3 -1
  205. package/assets/templates/pages/form-two-column/page.tsx +1 -1
  206. package/assets/templates/pages/form-wizard/page.tsx +1 -1
  207. package/assets/templates/pages/form-wizard-dialog/page.tsx +3 -1
  208. package/assets/templates/pages/form-wizard-inline/page.tsx +1 -1
  209. package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
  210. package/assets/templates/pages/gallery-hero/page.tsx +1 -1
  211. package/assets/templates/pages/ide/page.tsx +7 -2
  212. package/assets/templates/pages/kanban-board/page.tsx +10 -4
  213. package/assets/templates/pages/library/page.tsx +31 -61
  214. package/assets/templates/pages/login/page.tsx +4 -2
  215. package/assets/templates/pages/login-card/page.tsx +4 -2
  216. package/assets/templates/pages/login-split/page.tsx +3 -2
  217. package/assets/templates/pages/login-sso/page.tsx +4 -4
  218. package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
  219. package/assets/templates/pages/payment-form/page.tsx +1 -1
  220. package/assets/templates/pages/product-detail/page.tsx +16 -4
  221. package/assets/templates/pages/product-gallery/page.tsx +1 -1
  222. package/assets/templates/pages/settings/page.tsx +10 -4
  223. package/assets/templates/pages/settings-dialog/page.tsx +5 -6
  224. package/assets/templates/pages/settings-sidebar/page.tsx +39 -13
  225. package/assets/templates/pages/side-gallery/page.tsx +1 -1
  226. package/assets/templates/pages/table/page.tsx +2 -2
  227. package/assets/templates/pages/table-filter/page.tsx +21 -6
  228. package/assets/templates/pages/table-grouped/page.tsx +23 -2
  229. package/assets/templates/pages/table-inbox/page.tsx +82 -32
  230. package/assets/templates/pages/theme-showcase/page.tsx +3 -2
  231. package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
  232. package/assets/templates/themes/butter/butterTheme.ts +197 -4
  233. package/assets/templates/themes/chocolate/chocolateTheme.ts +72 -8
  234. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
  235. package/assets/templates/themes/gothic/gothicTheme.ts +114 -4
  236. package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
  237. package/assets/templates/themes/matcha/matchaTheme.ts +48 -12
  238. package/assets/templates/themes/neutral/neutralTheme.ts +29 -0
  239. package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +2 -2
  240. package/assets/templates/themes/stone/stoneTheme.ts +69 -0
  241. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
  242. package/assets/templates/themes/y2k/y2kTheme.ts +249 -14
  243. package/authoring/codemod/parse.d.mts +0 -36
  244. package/authoring/codemod/parse.mjs +62 -41
  245. package/authoring/config/config.doc.mjs +1 -1
  246. package/authoring/config/parse.d.mts +0 -47
  247. package/authoring/config/parse.mjs +128 -103
  248. package/authoring/config/type.ts +4 -3
  249. package/authoring/debug/parse.d.mts +2 -2
  250. package/authoring/discover/parse.d.mts +2 -2
  251. package/authoring/discover/parse.mjs +52 -38
  252. package/authoring/discover/type.ts +2 -1
  253. package/authoring/doctypes/_schema.d.mts +834 -950
  254. package/authoring/doctypes/_schema.mjs +863 -825
  255. package/authoring/doctypes/command/parse.mjs +2 -2
  256. package/authoring/doctypes/component/parse.mjs +2 -2
  257. package/authoring/doctypes/enum/parse.mjs +2 -2
  258. package/authoring/doctypes/hook/parse.mjs +2 -2
  259. package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +1 -1
  260. package/authoring/doctypes/icon-definition/parse.d.mts +0 -24
  261. package/authoring/doctypes/icon-definition/parse.mjs +59 -43
  262. package/authoring/doctypes/icon-set/parse.d.mts +0 -75
  263. package/authoring/doctypes/icon-set/parse.mjs +239 -210
  264. package/authoring/doctypes/legacy.mjs +3 -3
  265. package/authoring/doctypes/namespace/parse.mjs +2 -2
  266. package/authoring/doctypes/reference/parse.mjs +2 -2
  267. package/authoring/doctypes/schema/parse.mjs +2 -2
  268. package/authoring/doctypes/template/parse.d.mts +0 -101
  269. package/authoring/doctypes/template/parse.mjs +131 -106
  270. package/authoring/doctypes/theme/parse.d.mts +0 -23
  271. package/authoring/doctypes/theme/parse.mjs +52 -36
  272. package/authoring/gap-report/parse.d.mts +1 -1
  273. package/authoring/integration/integration.doc.mjs +8 -0
  274. package/authoring/integration/schema.d.mts +14 -3
  275. package/authoring/integration/schema.mjs +20 -2
  276. package/authoring/integration/type.ts +14 -0
  277. package/clients/cli/build-id.generated.json +1 -1
  278. package/clients/cli/commands/build.mjs +27 -13
  279. package/clients/cli/commands/component.mjs +14 -3
  280. package/clients/cli/commands/discover.doc.mjs +2 -2
  281. package/clients/cli/commands/discover.mjs +20 -3
  282. package/clients/cli/commands/docs.doc.mjs +11 -9
  283. package/clients/cli/commands/docs.mjs +50 -21
  284. package/clients/cli/commands/experimental/icon.mjs +330 -227
  285. package/clients/cli/commands/experimental/render.mjs +16 -1
  286. package/clients/cli/commands/experimental/theme.mjs +42 -17
  287. package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
  288. package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
  289. package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
  290. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
  291. package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
  292. package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
  293. package/clients/cli/commands/experimental-render.doc.mjs +3 -3
  294. package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
  295. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
  296. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
  297. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
  298. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  299. package/clients/cli/commands/init.doc.mjs +36 -24
  300. package/clients/cli/commands/integration-check.doc.mjs +1 -1
  301. package/clients/cli/commands/mcp.doc.mjs +53 -0
  302. package/clients/cli/commands/mcp.mjs +51 -0
  303. package/clients/cli/commands/search.mjs +46 -9
  304. package/clients/cli/commands/template.mjs +3 -2
  305. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  306. package/clients/cli/commands/theme.mjs +12 -2
  307. package/clients/cli/commands/upgrade.doc.mjs +3 -2
  308. package/clients/cli/commands.generated.json +1 -1
  309. package/clients/cli/formatters/index.mjs +52 -6
  310. package/clients/cli/index.mjs +23 -17
  311. package/clients/cli/lib/base-gate.mjs +37 -5
  312. package/clients/cli/lib/define-command.mjs +82 -4
  313. package/clients/cli/lib/json-shim.mjs +61 -4
  314. package/clients/cli/lib/manifest.mjs +9 -1
  315. package/clients/cli/lib/mcp-server.mjs +286 -0
  316. package/clients/cli/lib/mcp-tools.mjs +405 -0
  317. package/clients/cli/lib/other-cli-words.mjs +99 -0
  318. package/clients/cli/lib/stray-option.mjs +27 -1
  319. package/clients/cli/lib/unknown-command.mjs +326 -11
  320. package/clients/cli/manifest.generated.json +1 -1
  321. package/clients/cli/run.mjs +1 -1
  322. package/foundation/agent-docs/agent-docs.d.mts +49 -1
  323. package/foundation/agent-docs/agent-docs.mjs +108 -7
  324. package/foundation/agent-docs/computer-agent-text.mjs +1 -1
  325. package/foundation/bases/core.d.mts +1 -1
  326. package/foundation/bases/core.mjs +3 -3
  327. package/foundation/bases/resolve.d.mts +4 -8
  328. package/foundation/bases/resolve.mjs +15 -21
  329. package/foundation/bases/state.d.mts +15 -9
  330. package/foundation/bases/state.mjs +33 -6
  331. package/foundation/config/project.d.mts +5 -4
  332. package/foundation/config/project.mjs +33 -17
  333. package/foundation/discovery/component-discovery.mjs +15 -28
  334. package/foundation/discovery/icon-imports.d.mts +66 -0
  335. package/foundation/discovery/icon-imports.mjs +225 -0
  336. package/foundation/discovery/icon-ranking.d.mts +12 -2
  337. package/foundation/discovery/icon-ranking.mjs +197 -10
  338. package/foundation/discovery/icon-set-checks.mjs +2 -1
  339. package/foundation/discovery/icon-set-discovery.d.mts +28 -0
  340. package/foundation/discovery/icon-set-discovery.mjs +42 -0
  341. package/foundation/discovery/icon-set-writer.d.mts +2 -11
  342. package/foundation/discovery/icon-set-writer.mjs +3 -29
  343. package/foundation/discovery/module-exports.d.mts +1 -1
  344. package/foundation/discovery/module-exports.mjs +136 -33
  345. package/foundation/discovery/name-roots.d.mts +5 -0
  346. package/foundation/discovery/name-roots.mjs +11 -0
  347. package/foundation/discovery/runner-allowlist.d.mts +1 -0
  348. package/foundation/discovery/runner-allowlist.mjs +2 -0
  349. package/foundation/discovery/runner-commands.mjs +1 -0
  350. package/foundation/discovery/template-adapter.d.mts +1 -1
  351. package/foundation/discovery/template-destination.d.mts +14 -6
  352. package/foundation/discovery/template-destination.mjs +42 -8
  353. package/foundation/discovery/template-icons.d.mts +45 -2
  354. package/foundation/discovery/template-icons.mjs +26 -54
  355. package/foundation/discovery/template-needs.d.mts +28 -2
  356. package/foundation/discovery/template-needs.mjs +92 -11
  357. package/foundation/discovery/theme-discovery.d.mts +8 -0
  358. package/foundation/discovery/theme-discovery.mjs +23 -6
  359. package/foundation/discovery/theme-imports.mjs +2 -4
  360. package/foundation/doc-compiler/parse-readable.mjs +4 -3
  361. package/foundation/doc-compiler/stored-docs.d.mts +13 -0
  362. package/foundation/doc-compiler/stored-docs.mjs +74 -3
  363. package/foundation/env/cli-command.d.mts +68 -10
  364. package/foundation/env/cli-command.mjs +116 -22
  365. package/foundation/env/project-scope.d.mts +9 -0
  366. package/foundation/env/project-scope.mjs +28 -2
  367. package/foundation/fs/gather-cache.d.mts +23 -0
  368. package/foundation/fs/gather-cache.mjs +94 -2
  369. package/foundation/fs/module-loader.d.mts +3 -1
  370. package/foundation/fs/module-loader.mjs +85 -5
  371. package/foundation/fs/read-record.mjs +9 -5
  372. package/foundation/identity/package-names.d.mts +18 -0
  373. package/foundation/identity/package-names.mjs +19 -0
  374. package/foundation/identity/providers.mjs +3 -2
  375. package/foundation/integrations/icon-features.d.mts +63 -0
  376. package/foundation/integrations/icon-features.mjs +54 -0
  377. package/foundation/integrations/integrations.d.mts +13 -1
  378. package/foundation/integrations/integrations.mjs +47 -6
  379. package/foundation/integrations/pack-state.d.mts +21 -0
  380. package/foundation/integrations/pack-state.mjs +42 -19
  381. package/foundation/integrations/validate-contributions.d.mts +11 -3
  382. package/foundation/integrations/validate-contributions.mjs +51 -13
  383. package/foundation/release/cache.d.mts +13 -1
  384. package/foundation/release/cache.mjs +94 -14
  385. package/foundation/release/notices.d.mts +15 -0
  386. package/foundation/release/notices.mjs +111 -7
  387. package/foundation/release/project.d.mts +3 -4
  388. package/foundation/release/project.mjs +5 -6
  389. package/foundation/render/client-bundle.d.mts +126 -0
  390. package/foundation/render/client-bundle.mjs +565 -0
  391. package/foundation/render/cut-short.d.mts +7 -1
  392. package/foundation/render/cut-short.mjs +46 -6
  393. package/foundation/render/embedded-imports.d.mts +4 -3
  394. package/foundation/render/embedded-imports.mjs +13 -8
  395. package/foundation/render/esbuild-dependency.d.mts +14 -0
  396. package/foundation/render/esbuild-dependency.mjs +41 -0
  397. package/foundation/render/file-header.mjs +5 -4
  398. package/foundation/render/page-worker.mjs +562 -86
  399. package/foundation/render/picture-chrome.mjs +54 -29
  400. package/foundation/render/picture-playwright.mjs +78 -42
  401. package/foundation/render/picture-window.d.mts +33 -0
  402. package/foundation/render/picture-window.mjs +78 -0
  403. package/foundation/render/render-page.d.mts +55 -4
  404. package/foundation/render/render-page.mjs +199 -28
  405. package/foundation/render/restore-folder.d.mts +13 -0
  406. package/foundation/render/restore-folder.mjs +30 -0
  407. package/foundation/render/served-packages.d.mts +2 -1
  408. package/foundation/render/served-packages.mjs +5 -3
  409. package/foundation/render/ts-paths.d.mts +11 -0
  410. package/foundation/render/ts-paths.mjs +27 -2
  411. package/foundation/render/value-uses.d.mts +43 -0
  412. package/foundation/render/value-uses.mjs +110 -0
  413. package/foundation/response/error-codes.d.mts +2 -1
  414. package/foundation/response/error-codes.doc.mjs +7 -1
  415. package/foundation/response/error-codes.mjs +10 -2
  416. package/foundation/response/response-types.doc.mjs +12 -12
  417. package/foundation/runtime/package-root.d.mts +8 -0
  418. package/foundation/runtime/package-root.mjs +20 -0
  419. package/foundation/suggest/other-command.d.mts +11 -0
  420. package/foundation/suggest/other-command.mjs +1 -1
  421. package/foundation/text/icon-id.d.mts +20 -0
  422. package/foundation/text/icon-id.mjs +40 -0
  423. package/foundation/text/icon-set-next.d.mts +25 -0
  424. package/foundation/text/icon-set-next.mjs +29 -0
  425. package/foundation/xle/browser.d.mts +2 -2
  426. package/package.json +7 -6
@@ -63,6 +63,7 @@ import * as os from 'node:os';
63
63
  import * as path from 'node:path';
64
64
  import {createRequire, isBuiltin} from 'node:module';
65
65
  import {moduleImports} from '../../../foundation/render/embedded-imports.mjs';
66
+ import {projectMapsImport} from '../../../foundation/render/ts-paths.mjs';
66
67
  import {STYLESHEET_FILE} from '../../../foundation/fs/stylesheet-file.mjs';
67
68
  import {fileURLToPath, pathToFileURL} from 'node:url';
68
69
  import {babelParse as parse} from '../../../foundation/runtime/lazy-dependencies.mjs';
@@ -113,12 +114,14 @@ import {interceptCore} from './core-interception.mjs';
113
114
  import {irregularFileKind} from '../../../foundation/fs/regular-file.mjs';
114
115
  import {keyPathLine, keyValueLine, nullThemeValues} from './null-values.mjs';
115
116
  import {typographyInputProblems} from './typography-values.mjs';
117
+ import {radiusInputProblems} from './radius-values.mjs';
116
118
  import {sourcePlugins} from './source-syntax.mjs';
117
119
  import {
118
120
  INPUT_DECLARATION_FILES,
119
121
  inputFieldsFrom,
120
122
  sourceFieldProblems,
121
123
  inputFieldProblems,
124
+ sourceInputField,
122
125
  sourceTypography,
123
126
  } from './input-fields.mjs';
124
127
  import {styleKeyProblems} from './style-keys.mjs';
@@ -130,6 +133,7 @@ import {
130
133
  import {levenshteinDistance} from '../../../foundation/text/levenshtein.mjs';
131
134
  import {
132
135
  installCommandFor,
136
+ installStepFor,
133
137
  parsedSpecifiers,
134
138
  } from '../../../foundation/discovery/template-needs.mjs';
135
139
  import {generateFamilyCSS, resolveThemeFamily} from './family.mjs';
@@ -605,6 +609,15 @@ function inAstryxRepository(cwd) {
605
609
  return false;
606
610
  }
607
611
 
612
+ /**
613
+ * The step that installs Core in the project at `cwd`, as message text.
614
+ * @param {string} cwd
615
+ */
616
+ function coreInstallText(cwd) {
617
+ const {line, note} = installStepFor(['@astryxdesign/core'], cwd);
618
+ return note ? `\`${line}\` (${note})` : `\`${line}\``;
619
+ }
620
+
608
621
  /**
609
622
  * Why `theme build` has no Core to generate with, and the fix for where it
610
623
  * ran: the Astryx repository builds Core, an app installs it, and an installed
@@ -632,7 +645,7 @@ export function coreUnavailableMessage(cwd, importError) {
632
645
  }
633
646
  return (
634
647
  `This project does not have @astryxdesign/core installed: ${why}. Install ` +
635
- `it: \`npm install @astryxdesign/core\` (or yarn/pnpm/bun).${detail}`
648
+ `it: ${coreInstallText(cwd)}.${detail}`
636
649
  );
637
650
  }
638
651
 
@@ -690,6 +703,56 @@ function headerRoot(outDir, cwd) {
690
703
  return findPackageRoot(outDir) ?? path.resolve(cwd);
691
704
  }
692
705
 
706
+ /**
707
+ * Whether a file is an output of some released `theme build`: its header has
708
+ * the build's mark, or, with `legacy`, a mark or shape of the CLI before it
709
+ * was named Astryx: its header's mark, or for its releases that wrote no
710
+ * header, the shape they wrote: a stylesheet in the `xds.theme`,
711
+ * `xds-theme` or `reset` layer scoped to `[data-xds-theme=…]`, a module
712
+ * that says it was built by `xds theme build` (`xds build-theme` at first),
713
+ * declarations of a built theme with their import, or variant declarations
714
+ * that open with `// Generated by xds theme build`.
715
+ * @param {string} file
716
+ * @param {{legacy?: boolean}} [options]
717
+ */
718
+ function isBuildOutput(file, {legacy = false} = {}) {
719
+ const head = fileHead(file);
720
+ if (head.includes(GENERATED_MARKER)) return true;
721
+ if (!legacy) return false;
722
+ if (head.includes(LEGACY_BUILD_MARKER)) return true;
723
+ const text = head.trimStart();
724
+ if (/\.css$/i.test(file))
725
+ return (
726
+ /^@layer (?:xds\.theme|xds-theme|reset) \{/.test(text) &&
727
+ text.includes('[data-xds-theme=')
728
+ );
729
+ if (/\.d\.ts$/i.test(file)) {
730
+ // A theme's variant declarations (`<theme>.variants.d.ts`) opened with
731
+ // this line in those releases.
732
+ if (text.startsWith('// Generated by xds theme build')) return true;
733
+ const lines = text
734
+ .split('\n')
735
+ .map(line => line.trim())
736
+ .filter(Boolean);
737
+ return (
738
+ lines.includes(
739
+ "import type { XDSDefinedTheme } from '@xds/core/theme';",
740
+ ) &&
741
+ lines.every(line =>
742
+ /^(?:import type \{[^}]*\} from '@xds\/core[^']*';|export declare const [A-Za-z_$][\w$]*: [A-Za-z_$][\w$]*;)$/.test(
743
+ line,
744
+ ),
745
+ )
746
+ );
747
+ }
748
+ if (/\.js$/i.test(file))
749
+ return /theme — built by `[^`]*xds (?:theme build|build-theme)`/.test(head);
750
+ return false;
751
+ }
752
+
753
+ /** The mark headers of the CLI carried before it was named Astryx. */
754
+ const LEGACY_BUILD_MARKER = '@generated by `xds theme build`';
755
+
693
756
  /**
694
757
  * Whether a build refuses to replace, at a path `--out` names, the output of
695
758
  * another theme source that still exists. False makes it warn and replace.
@@ -1319,7 +1382,10 @@ function assertThemeSourceFile(filePath, cwd, mode = {}) {
1319
1382
  * `familyInterception` make the build a family member's plan.
1320
1383
  * `colorModes` is the one color mode a calling command knows the theme has
1321
1384
  * (the theme editor, from its settings), written into the built module.
1322
- * @typedef {{prepareFamily?: boolean, familyLoader?: any, familyInterception?: any, writeRoot?: string, claimedOutputs?: Map<string, string>, deferredWrites?: Array<Array<{dest: string, content: string}>>, commandWords?: {group: string, build: string}, colorModes?: ['light'] | ['dark'] | null, fontHelp?: FontHelp | null, loadedFonts?: ((family: string) => boolean) | null, install?: string | null}} ThemeBuildHandOff
1385
+ * `ownsOutputs` says the caller made the folder the outputs go into and owns
1386
+ * every file there named like one (the theme editor's theme folder), so a
1387
+ * damaged or half-written output is replaced, never refused.
1388
+ * @typedef {{ownsOutputs?: boolean, prepareFamily?: boolean, familyLoader?: any, familyInterception?: any, writeRoot?: string, claimedOutputs?: Map<string, string>, deferredWrites?: Array<Array<{dest: string, content: string}>>, commandWords?: {group: string, build: string}, colorModes?: ['light'] | ['dark'] | null, fontHelp?: FontHelp | null, loadedFonts?: ((family: string) => boolean) | null, install?: string | null}} ThemeBuildHandOff
1323
1389
  */
1324
1390
 
1325
1391
  /**
@@ -1449,17 +1515,20 @@ export function buildSuggestion(source, mode, cwd, words, shape = {}) {
1449
1515
  /**
1450
1516
  * Refuse a build that would replace a file it does not own. A build never
1451
1517
  * writes over its input, two of its own outputs at one path, or an output
1452
- * another theme in the same run already wrote. With `refuseUnmarked` (a path
1453
- * --out names), it also replaces only its own earlier outputs (their header
1454
- * names this source, or a source that is gone) and empty files, never another
1455
- * source's output or another file such as `package.json` or app source.
1518
+ * another theme in the same run already wrote. With `refuseUnmarked` (every
1519
+ * build but one whose caller owns the output folder), it also replaces only
1520
+ * outputs of a release of the build (isBuildOutput) and empty files, never
1521
+ * another file such as the user's own stylesheet, `package.json` or app
1522
+ * source.
1456
1523
  * @param {Array<{dest: string}>} writes
1457
1524
  * @param {string} filePath the theme source
1458
1525
  * @param {string} cwd
1459
- * @param {{claimed?: Map<string, string>, rerun?: (out: string | null) => string, refuseUnmarked?: boolean, warnUnmarked?: boolean, elsewhere?: string, onEditorFolder?: (warning: string) => void, onWarning?: (message: string) => void}} [options]
1526
+ * @param {{claimed?: Map<string, string>, rerun?: (out: string | null) => string, refuseUnmarked?: boolean, warnUnmarked?: boolean, acceptLegacy?: boolean, elsewhere?: string, onEditorFolder?: (warning: string) => void, onWarning?: (message: string) => void}} [options]
1460
1527
  * `claimed`: outputs written earlier in this run, by the source that wrote
1461
1528
  * them; `rerun`: this build's command with another --out, or without one;
1462
- * `warnUnmarked` (with `refuseUnmarked`): a header-less file is replaced
1529
+ * `acceptLegacy`: an output of the CLI before it was named Astryx counts
1530
+ * as the build's own (the default paths, where the build always replaced
1531
+ * them); `warnUnmarked` (with `refuseUnmarked`): a header-less file is replaced
1463
1532
  * with a warning naming it, as a family build has always replaced one;
1464
1533
  * `elsewhere`: the option that moves the outputs; `onEditorFolder`: takes
1465
1534
  * the editor-folder warning instead of the logger (a watcher prints it
@@ -1474,6 +1543,7 @@ function assertOutputsReplaceable(
1474
1543
  rerun,
1475
1544
  refuseUnmarked = false,
1476
1545
  warnUnmarked = false,
1546
+ acceptLegacy = false,
1477
1547
  elsewhere = '--out',
1478
1548
  onEditorFolder,
1479
1549
  onWarning,
@@ -1553,8 +1623,6 @@ function assertOutputsReplaceable(
1553
1623
  ERROR_CODES.ERR_INVALID_ARGUMENT,
1554
1624
  );
1555
1625
  }
1556
- // Only a path --out names is checked: at the default paths beside the
1557
- // source, a build replaces what is there, as it always has.
1558
1626
  const otherSource = refuseUnmarked
1559
1627
  ? builtFromOtherSource(write.dest, owner, cwd)
1560
1628
  : null;
@@ -1571,33 +1639,29 @@ function assertOutputsReplaceable(
1571
1639
  ERROR_CODES.ERR_FILE_EXISTS,
1572
1640
  );
1573
1641
  }
1574
- // Outputs from CLIs before 0.6.7 have no header, so they read as files
1575
- // the build did not write; only the user can say they may go.
1576
- if (
1577
- refuseUnmarked &&
1578
- stat.size > 0 &&
1579
- !fileHead(write.dest).includes(GENERATED_MARKER)
1580
- ) {
1642
+ // A file no release of the build wrote is the user's or another
1643
+ // tool's: only the user can say it may go.
1644
+ // A family build keeps its released rule: a file without the current
1645
+ // mark is replaced with a warning naming it.
1646
+ const ours = isBuildOutput(write.dest, {legacy: acceptLegacy});
1647
+ if (refuseUnmarked && stat.size > 0 && !ours) {
1581
1648
  if (warnUnmarked) {
1582
1649
  unmarkedReplaced.push(rel(write.dest));
1583
1650
  continue;
1584
1651
  }
1585
- // Never advice to delete it: it may be the person's file (a settings
1586
- // file, app source). A path that takes every output instead.
1652
+ // A path that takes every output, where nothing is replaced; never
1653
+ // the same paths again.
1587
1654
  const free = freeOutPath(writes);
1588
1655
  throw new AstryxError(
1589
- `${rel(write.dest)} is a file this build did not write (it has no build header: your own file, another tool's, or an output from a CLI before 0.6.7), so the build does not replace it. Pick another ${elsewhere}.`,
1590
- [
1591
- ...(free && rerun
1592
- ? [
1593
- {
1594
- name: rerun(rel(free)),
1595
- reason: 'a path where no output of this build exists yet',
1596
- },
1597
- ]
1598
- : []),
1599
- beside,
1600
- ],
1656
+ `${rel(write.dest)} is a file this build did not write (it has no build header: your own file or another tool's), so the build does not replace it. Build to another place with ${elsewhere}, or move or rename ${rel(write.dest)} and build again.`,
1657
+ free && rerun
1658
+ ? [
1659
+ {
1660
+ name: rerun(rel(free)),
1661
+ reason: 'a path where no output of this build exists yet',
1662
+ },
1663
+ ]
1664
+ : [],
1601
1665
  ERROR_CODES.ERR_FILE_EXISTS,
1602
1666
  );
1603
1667
  }
@@ -1609,7 +1673,7 @@ function assertOutputsReplaceable(
1609
1673
  onWarning?.(warnedOtherSource);
1610
1674
  }
1611
1675
  if (unmarkedReplaced.length) {
1612
- const message = `${unmarkedReplaced.join(', ')} ${unmarkedReplaced.length > 1 ? 'have' : 'has'} no build header (an output from a CLI before 0.6.7, or a file of your own or another tool's), and this build of ${rel(filePath)} replaces ${unmarkedReplaced.length > 1 ? 'them' : 'it'}; to keep a file of your own there, build with another ${elsewhere}.`;
1676
+ const message = `${unmarkedReplaced.join(', ')} ${unmarkedReplaced.length > 1 ? 'have' : 'has'} no build header (an output of an earlier build, or a file of your own or another tool's), and this build of ${rel(filePath)} replaces ${unmarkedReplaced.length > 1 ? 'them' : 'it'}; to keep a file of your own there, build with another ${elsewhere}.`;
1613
1677
  logger.warn(`Warning: ${message}`);
1614
1678
  onWarning?.(message);
1615
1679
  }
@@ -3101,16 +3165,20 @@ function isPlainObject(value) {
3101
3165
 
3102
3166
  /**
3103
3167
  * @param {any} value
3168
+ * @param {Set<any>} [seen] the themes already met on the way up its bases
3104
3169
  * @returns {boolean}
3105
3170
  */
3106
- function isThemeObject(value) {
3171
+ function isThemeObject(value, seen = new Set()) {
3172
+ if (seen.has(value)) return false;
3173
+ seen.add(value);
3107
3174
  return Boolean(
3108
3175
  value &&
3109
3176
  typeof value === 'object' &&
3110
3177
  typeof value.name === 'string' &&
3111
3178
  ((value.tokens && typeof value.tokens === 'object') ||
3112
- // A theme with no tokens of its own over a base it extends.
3113
- (value.extends !== value && isThemeObject(value.extends))),
3179
+ // A theme with no tokens of its own over a base it extends (a base
3180
+ // that reaches back to it is no theme: `extends` cycles).
3181
+ isThemeObject(value.extends, seen)),
3114
3182
  );
3115
3183
  }
3116
3184
 
@@ -3458,14 +3526,15 @@ function themeLoadSuggestions(error, shown, cwd, mode = {}) {
3458
3526
  ];
3459
3527
  const missing = missingThemePackage(error.cause ?? error);
3460
3528
  if (missing) {
3461
- const {installCommand} = installCommandFor(
3529
+ const {installCommand, installGuidance} = installCommandFor(
3462
3530
  [missing],
3463
3531
  findPackageRoot(cwd) ?? cwd,
3464
3532
  );
3465
- if (installCommand) {
3533
+ const install = installGuidance ?? installCommand;
3534
+ if (install) {
3466
3535
  return [
3467
3536
  {
3468
- name: installCommand,
3537
+ name: install,
3469
3538
  reason: `install ${missing}, which the theme imports`,
3470
3539
  },
3471
3540
  ];
@@ -3522,70 +3591,6 @@ function importerOf(message) {
3522
3591
  }
3523
3592
  }
3524
3593
 
3525
- /**
3526
- * Whether the project that holds `from` maps `specifier` itself: the nearest
3527
- * tsconfig.json or jsconfig.json names it in `compilerOptions.paths` (`@app/*`
3528
- * maps `@app/c`), or its `baseUrl` holds the file (`lib/c`). The theme loader
3529
- * maps neither, so such an import is a path alias, never a package.
3530
- * @param {string} specifier
3531
- * @param {string | null} from the importing module
3532
- * @returns {boolean}
3533
- */
3534
- export function projectMapsImport(specifier, from) {
3535
- if (!from) return false;
3536
- for (let dir = path.dirname(from); ; dir = path.dirname(dir)) {
3537
- for (const name of ['tsconfig.json', 'jsconfig.json']) {
3538
- const file = path.join(dir, name);
3539
- /** @type {any} */
3540
- let config;
3541
- try {
3542
- // JSON with comments and trailing commas, as TypeScript reads it.
3543
- config = JSON.parse(
3544
- fs
3545
- .readFileSync(file, 'utf8')
3546
- .replace(
3547
- /("(?:[^"\\]|\\.)*")|\/\/[^\n]*|\/\*[\s\S]*?\*\//g,
3548
- (m, str) => str ?? '',
3549
- )
3550
- .replace(/,(\s*[}\]])/g, '$1'),
3551
- );
3552
- } catch {
3553
- continue;
3554
- }
3555
- const options = config?.compilerOptions ?? {};
3556
- const paths = Object.keys(
3557
- options.paths && typeof options.paths === 'object' ? options.paths : {},
3558
- );
3559
- if (
3560
- paths.some(pattern =>
3561
- pattern.endsWith('*')
3562
- ? specifier.startsWith(pattern.slice(0, -1))
3563
- : specifier === pattern,
3564
- )
3565
- )
3566
- return true;
3567
- if (typeof options.baseUrl === 'string') {
3568
- const base = path.resolve(dir, options.baseUrl, specifier);
3569
- if (
3570
- ['', ...THEME_MODULE_EXTENSIONS].some(ext => {
3571
- try {
3572
- return fs.statSync(base + ext).isFile();
3573
- } catch {
3574
- return false;
3575
- }
3576
- }) ||
3577
- THEME_MODULE_EXTENSIONS.some(ext =>
3578
- fs.existsSync(path.join(base, `index${ext}`)),
3579
- )
3580
- )
3581
- return true;
3582
- }
3583
- return false;
3584
- }
3585
- if (path.dirname(dir) === dir) return false;
3586
- }
3587
- }
3588
-
3589
3594
  /**
3590
3595
  * The package an import specifier names, or undefined when it names none:
3591
3596
  * a relative or absolute path, a `#` subpath import, or a path alias such
@@ -4007,17 +4012,32 @@ function isDefinedTheme(theme) {
4007
4012
  * @param {Set<any>} [seen] the bases already met, for one that extends itself
4008
4013
  * @returns {any}
4009
4014
  */
4010
- function defineThemeInput(theme, seen = new Set()) {
4015
+ function defineThemeInput(theme, seen = new Set([theme])) {
4016
+ // Each value as the build writes it (a BigInt as its digits, a boxed
4017
+ // primitive as itself), so defineTheme reads what is written, as the
4018
+ // value judge does.
4011
4019
  const input = Object.fromEntries(
4012
- Object.entries(theme).filter(([, value]) => value !== undefined),
4020
+ Object.entries(theme)
4021
+ .filter(([, value]) => value !== undefined)
4022
+ .map(([key, value]) => [
4023
+ key,
4024
+ key === 'extends' ? value : writtenPrimitives(value),
4025
+ ]),
4013
4026
  );
4014
4027
  const base = input.extends;
4015
- if (
4016
- base &&
4017
- typeof base === 'object' &&
4018
- !isDefinedTheme(base) &&
4019
- !seen.has(base)
4020
- ) {
4028
+ if (base && typeof base === 'object' && !isDefinedTheme(base)) {
4029
+ // A plain base that reaches back to a theme already on the way (`a`
4030
+ // extends `b`, `b` extends `a`) has no base to build from.
4031
+ if (seen.has(base)) {
4032
+ const names = [...seen, base].map(t =>
4033
+ typeof t?.name === 'string' ? `"${t.name}"` : 'a theme with no name',
4034
+ );
4035
+ throw new AstryxError(
4036
+ `The themes extend each other in a cycle (${names.join(' extends ')}), so none has a base to build from. Give the cycle a theme that extends nothing.`,
4037
+ undefined,
4038
+ ERROR_CODES.ERR_THEME_INVALID,
4039
+ );
4040
+ }
4021
4041
  seen.add(base);
4022
4042
  input.extends = _defineTheme(defineThemeInput(base, seen));
4023
4043
  }
@@ -5189,11 +5209,18 @@ async function themeBuildInternal(
5189
5209
  from = {file: path.relative(cwd, base.file) || base.file, line: at};
5190
5210
  break;
5191
5211
  }
5212
+ // From the theme it extends only when that theme holds this very
5213
+ // value: a resolved base holds every token, so holding the path alone
5214
+ // says nothing.
5192
5215
  const inherited =
5193
5216
  line == null &&
5194
5217
  (from != null ||
5195
5218
  (parentTheme != null &&
5196
- valueAt(parentTheme, item.path) !== undefined));
5219
+ valueAt(parentTheme, item.path) !== undefined &&
5220
+ Object.is(
5221
+ valueAt(parentTheme, item.path),
5222
+ valueAt(themeDef, item.path),
5223
+ )));
5197
5224
  return inherited && handOff.prepareFamily
5198
5225
  ? []
5199
5226
  : [{...item, line, inherited, elsewhere: line == null, from}];
@@ -5201,7 +5228,7 @@ async function themeBuildInternal(
5201
5228
  const nulls = placed(nullThemeValues(themeDef));
5202
5229
  /** @param {{path: string[], why: string, line: number | null, inherited?: boolean, elsewhere?: boolean, from?: {file: string, line: number} | null, at?: {file: string, line: number} | null}} n */
5203
5230
  const nullLine = n =>
5204
- `${n.path.join('.')}${n.line != null ? ` (line ${n.line})` : n.at ? ` (in ${n.at.file}, line ${n.at.line})` : n.from ? ` (in ${n.from.file}, line ${n.from.line}, the theme it extends)` : n.inherited ? ' (from the theme it extends)' : n.elsewhere ? ' (not written in this file as it is: from the theme it extends or a module it imports)' : ''}: ${n.why}`;
5231
+ `${n.path.join('.')}${n.line != null ? ` (line ${n.line})` : n.at ? ` (in ${n.at.file}, line ${n.at.line})` : n.from ? ` (in ${n.from.file}, line ${n.from.line}, the theme it extends)` : n.inherited ? ' (from the theme it extends)' : n.elsewhere ? ` (not written in this file as it is: computed in it, or from ${parentTheme != null ? '' : 'the theme it extends or '}a module it imports)` : ''}: ${n.why}`;
5205
5232
  const unbuildable = nulls.filter(n => n.unbuildable);
5206
5233
  if (unbuildable.length > 0) {
5207
5234
  const first = unbuildable.find(n => n.line != null);
@@ -5348,8 +5375,23 @@ async function themeBuildInternal(
5348
5375
  return {...t, line, inherited: false, elsewhere: line == null, from: null};
5349
5376
  });
5350
5377
 
5378
+ // A radius scale missing a field builds every scaled corner as NaNpx:
5379
+ // warned at its line, as the editor refuses it.
5380
+ const radiusInput =
5381
+ interception?.inputOf(themeDef)?.radius ??
5382
+ // A plain-object theme is its own input.
5383
+ (isDefinedTheme(themeDef) ? undefined : themeDef.radius) ??
5384
+ sourceInputField(themeSource, filePath, 'radius');
5385
+ const badRadius = radiusInputProblems(radiusInput).map(t => {
5386
+ const line =
5387
+ keyPathLine(themeSource, t.path, filePath) ??
5388
+ keyPathLine(themeSource, ['radius'], filePath);
5389
+ return {...t, line, inherited: false, elsewhere: line == null, from: null};
5390
+ });
5391
+
5351
5392
  // Validate component overrides
5352
5393
  const warnings = await validateComponentOverrides(themeDef);
5394
+ /** @type {string[]} */
5353
5395
  const warningMessages = [];
5354
5396
  /** Advisories about a correct theme — see the `notices` note on the receipt. */
5355
5397
  const noticeMessages = [];
@@ -5374,8 +5416,11 @@ async function themeBuildInternal(
5374
5416
  ...badKeys.map(nullLine),
5375
5417
  ...badValueLines.map(nullLine),
5376
5418
  ...badTypography.map(nullLine),
5419
+ ...badRadius.map(nullLine),
5377
5420
  ...badFields.map(nullLine),
5378
5421
  ]) {
5422
+ // The source reader and the loaded value can name one field alike.
5423
+ if (warningMessages.includes(w)) continue;
5379
5424
  warningMessages.push(w);
5380
5425
  logger.warn(` [warn] ${source}${w}`);
5381
5426
  }
@@ -6102,13 +6147,17 @@ async function themeBuildInternal(
6102
6147
  {iconsSpecifier: options.iconsSpecifier, out: out ?? undefined},
6103
6148
  cwd,
6104
6149
  );
6105
- // A header-less file at the default paths beside the source is an output
6106
- // of a CLI before 0.6.7, which the build has always replaced. A path that
6107
- // --out names may hold anything, so there only build outputs are replaced.
6150
+ // Beside the source or at a path --out names, only build outputs are
6151
+ // replaced: a file of the user's own of the same name is kept. A caller
6152
+ // that owns the output folder (the theme editor) repairs it instead.
6108
6153
  assertOutputsReplaceable(writes, filePath, cwd, {
6109
6154
  claimed: handOff.claimedOutputs,
6110
6155
  rerun,
6111
- refuseUnmarked: Boolean(options.out),
6156
+ refuseUnmarked: !handOff.ownsOutputs,
6157
+ // At the default paths the build always replaced what was there, so an
6158
+ // output of the CLI before it was named Astryx is still its own; a path
6159
+ // --out names keeps its released rule (the current mark only).
6160
+ acceptLegacy: !options.out,
6112
6161
  onEditorFolder: editorFolderListener ?? undefined,
6113
6162
  // The result's warnings carry what text prints.
6114
6163
  onWarning: message => warningMessages.push(message),
@@ -55,6 +55,15 @@ export function inputFieldProblems(input: any, fields: InputFields): Array<{
55
55
  * @returns {unknown}
56
56
  */
57
57
  export function sourceTypography(source: string, file?: string): unknown;
58
+ /**
59
+ * One field of a theme source's input (`typography`, `radius`) as the plain
60
+ * values it writes, read as sourceTypography() reads typography.
61
+ * @param {string} source
62
+ * @param {string} file the source's file name
63
+ * @param {string} field
64
+ * @returns {unknown}
65
+ */
66
+ export function sourceInputField(source: string, file: string, field: string): unknown;
58
67
  /**
59
68
  * The fields Core's `defineTheme()` input takes, read from the type
60
69
  * declarations of the installed Core, so the editor names a misspelled