@astryxdesign/cli 0.7.18-canary.gfacee17 → 0.7.18

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 (363) hide show
  1. package/CHANGELOG.md +185 -19
  2. package/README.md +19 -19
  3. package/api/component/_adapter.d.mts +2 -1
  4. package/api/component/_adapter.mjs +2 -1
  5. package/api/docs/_adapter.d.mts +6 -5
  6. package/api/docs/_adapter.mjs +36 -5
  7. package/api/doctor/_adapter.d.mts +6 -3
  8. package/api/doctor/_adapter.mjs +13 -5
  9. package/api/doctor/doctor.mjs +5 -5
  10. package/api/doctor/font-packages.d.mts +36 -0
  11. package/api/doctor/font-packages.mjs +124 -0
  12. package/api/doctor/theme-checks.mjs +110 -49
  13. package/api/experimental.d.mts +0 -2
  14. package/api/experimental.mjs +0 -12
  15. package/api/icon/_adapter.d.mts +2 -2
  16. package/api/icon/_adapter.mjs +6 -2
  17. package/api/icon/_authoring.mjs +22 -13
  18. package/api/icon/_default-look.mjs +15 -15
  19. package/api/icon/add/add.mjs +14 -9
  20. package/api/icon/icon.doc.mjs +7 -7
  21. package/api/icon/icon.type.d.mts +33 -33
  22. package/api/icon/icon.type.mjs +45 -45
  23. package/api/icon/iconAdd.doc.mjs +9 -10
  24. package/api/icon/iconMap.doc.mjs +11 -12
  25. package/api/icon/iconNewDefinition.doc.mjs +8 -8
  26. package/api/icon/iconNewSet.doc.mjs +5 -5
  27. package/api/icon/map/map.mjs +7 -7
  28. package/api/icon/use/use.mjs +4 -4
  29. package/api/init/run/run.mjs +0 -1
  30. package/api/integration/add-helpers.mjs +1 -1
  31. package/api/integration/validate-integration.type.d.mts +6 -6
  32. package/api/integration/validate-integration.type.mjs +6 -6
  33. package/api/render/_adapter.d.mts +5 -3
  34. package/api/render/_adapter.mjs +64 -4
  35. package/api/render/render.doc.mjs +9 -2
  36. package/api/render/render.mjs +5 -2
  37. package/api/render/render.type.d.mts +17 -0
  38. package/api/render/render.type.mjs +10 -0
  39. package/api/search/ORDERING.md +1 -1
  40. package/api/search/_candidate-score.mjs +20 -0
  41. package/api/search/_words.d.mts +8 -0
  42. package/api/search/_words.mjs +15 -0
  43. package/api/template/template.type.d.mts +2 -2
  44. package/api/template/template.type.mjs +2 -2
  45. package/api/theme/_adapter.mjs +19 -11
  46. package/api/theme/build/build.d.mts +19 -51
  47. package/api/theme/build/build.mjs +195 -189
  48. package/api/theme/build/font-warning.d.mts +19 -2
  49. package/api/theme/build/font-warning.mjs +46 -5
  50. package/api/theme/generateTonalPalette.doc.mjs +1 -1
  51. package/api/theme/palette/generate/derive-look.mjs +108 -37
  52. package/api/theme/palette/generate/mapping.mjs +2 -0
  53. package/api/theme/template/template.d.mts +0 -17
  54. package/api/theme/template/template.mjs +1 -42
  55. package/api/theme/theme.type.d.mts +5 -4
  56. package/api/theme/theme.type.mjs +5 -4
  57. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  58. package/api/theme/themeRemove.doc.mjs +1 -1
  59. package/assets/codemods/transforms/v0.7.0/preserve-bottom-sheet-content-padding.mjs +3 -1
  60. package/assets/component-list.generated.json +1 -1
  61. package/assets/discover/official-packages.json +26 -2
  62. package/assets/docs/author-a-theme.doc.mjs +6 -5
  63. package/assets/docs/browser-support.doc.mjs +1 -0
  64. package/assets/docs/icons.doc.mjs +8 -7
  65. package/assets/docs/motion.doc.mjs +46 -0
  66. package/assets/docs/theme.doc.dense.mjs +6 -17
  67. package/assets/docs/theme.doc.mjs +6 -16
  68. package/assets/docs/theme.doc.zh.mjs +6 -16
  69. package/assets/docs/tree/ci-and-containers.doc.mjs +1 -1
  70. package/assets/docs/tree/data-colors-in-renderers.doc.mjs +400 -0
  71. package/assets/docs/tree/font-setup.doc.mjs +30 -0
  72. package/assets/docs/tree/icon-sets.doc.mjs +2 -2
  73. package/assets/docs/tree/share-a-page.doc.mjs +1 -1
  74. package/assets/docs/tree/template-icons.doc.mjs +3 -3
  75. package/assets/docs/tree/tokens-color.doc.mjs +5 -0
  76. package/assets/docs/tree/tokens.doc.mjs +4 -3
  77. package/assets/docs/tree/updates.doc.mjs +1 -1
  78. package/assets/docs/tree/visualization.doc.mjs +30 -0
  79. package/assets/docs-routes.generated.json +1 -1
  80. package/assets/docs.generated.json +2 -2
  81. package/assets/icons/definitions/drag.doc.mjs +1 -0
  82. package/assets/search-catalog.generated.json +2 -2
  83. package/assets/self-audit.generated.json +1 -1
  84. package/assets/templates/blocks/components/Card/SelectableCardElevated.doc.mjs +1 -1
  85. package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +20 -10
  86. package/assets/templates/blocks/components/Card/SelectableCardShowcase.doc.mjs +1 -1
  87. package/assets/templates/blocks/components/Card/SelectableCardShowcase.tsx +36 -16
  88. package/assets/templates/blocks/components/ChatComposerInput/ChatComposerInputMentionTrigger.tsx +6 -0
  89. package/assets/templates/blocks/components/ChatComposerInput/ChatComposerInputMultipleTriggers.tsx +6 -0
  90. package/assets/templates/blocks/components/Hooks/useIndicatorFocusRingHookUsage.doc.mjs +14 -0
  91. package/assets/templates/blocks/components/Hooks/useIndicatorFocusRingHookUsage.tsx +63 -0
  92. package/assets/templates/blocks/components/Hooks/useLongPressHookUsage.doc.mjs +29 -0
  93. package/assets/templates/blocks/components/Hooks/useLongPressHookUsage.tsx +237 -0
  94. package/assets/templates/blocks/components/SideNav/SideNavShowcase.tsx +10 -72
  95. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.doc.mjs +1 -1
  96. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +7 -7
  97. package/assets/templates/blocks/components/Table/TableCustomRowTable.doc.mjs +14 -0
  98. package/assets/templates/blocks/components/Table/TableCustomRowTable.tsx +96 -0
  99. package/assets/templates/components.generated.json +1 -1
  100. package/assets/templates/pages/ai-chat-landing/page.tsx +4 -0
  101. package/assets/templates/pages/dashboard-scorecard/page.tsx +26 -7
  102. package/assets/templates/pages/editor/page.tsx +13 -3
  103. package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +2 -2
  104. package/assets/templates/themes/butter/butterTheme.ts +12 -10
  105. package/assets/templates/themes/butter/icons.tsx +2 -0
  106. package/assets/templates/themes/chocolate/chocolateTheme.ts +1 -0
  107. package/assets/templates/themes/chocolate/icons.tsx +2 -0
  108. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
  109. package/assets/templates/themes/gothic/gothicTheme.ts +1 -0
  110. package/assets/templates/themes/gothic/icons.tsx +2 -0
  111. package/assets/templates/themes/matcha/icons.tsx +2 -0
  112. package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +2 -2
  113. package/assets/templates/themes/matcha/matchaTheme.ts +1 -0
  114. package/assets/templates/themes/neutral/icons.tsx +2 -0
  115. package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +2 -2
  116. package/assets/templates/themes/neutral/neutralTheme.ts +1 -0
  117. package/assets/templates/themes/stone/icons.tsx +2 -0
  118. package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +1 -1
  119. package/assets/templates/themes/stone/stoneTheme.ts +1 -0
  120. package/assets/templates/themes/y2k/icons.tsx +2 -0
  121. package/assets/templates/themes/y2k/y2kTheme.ts +1 -0
  122. package/assets/theme.template.ts +9 -5
  123. package/authoring/config/parse.mjs +1 -1
  124. package/authoring/doctypes/base/type.ts +2 -3
  125. package/authoring/doctypes/component/component.doc.mjs +1 -1
  126. package/authoring/doctypes/icon-set/icon-names.mjs +1 -0
  127. package/authoring/integration/integration.doc.mjs +1 -1
  128. package/authoring/integration/type.ts +1 -1
  129. package/clients/cli/build-id.generated.json +1 -1
  130. package/clients/cli/commands/doctor.mjs +2 -2
  131. package/clients/cli/commands/experimental/export.mjs +2 -1
  132. package/clients/cli/commands/experimental/icon.mjs +17 -17
  133. package/clients/cli/commands/experimental/index.mjs +0 -5
  134. package/clients/cli/commands/experimental/render-output.mjs +9 -0
  135. package/clients/cli/commands/experimental-export.doc.mjs +6 -0
  136. package/clients/cli/commands/experimental-icon-add.doc.mjs +8 -8
  137. package/clients/cli/commands/experimental-icon-map.doc.mjs +6 -6
  138. package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +6 -6
  139. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +3 -3
  140. package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
  141. package/clients/cli/commands/experimental-icon.doc.mjs +6 -6
  142. package/clients/cli/commands/experimental.doc.mjs +2 -6
  143. package/clients/cli/commands/template.mjs +1 -1
  144. package/clients/cli/commands/theme-build.doc.mjs +8 -1
  145. package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -1
  146. package/clients/cli/commands/theme-remove.doc.mjs +1 -1
  147. package/clients/cli/commands/theme.doc.mjs +1 -11
  148. package/clients/cli/commands/theme.mjs +110 -475
  149. package/clients/cli/commands.generated.json +1 -1
  150. package/clients/cli/index.mjs +4 -34
  151. package/clients/cli/lib/base-gate.mjs +2 -3
  152. package/clients/cli/lib/cli-error.mjs +8 -72
  153. package/clients/cli/lib/define-command.mjs +0 -19
  154. package/clients/cli/lib/json-shim.mjs +11 -633
  155. package/clients/cli/lib/manifest.mjs +0 -4
  156. package/clients/cli/lib/stray-option.mjs +1 -2
  157. package/clients/cli/manifest.generated.json +1 -1
  158. package/foundation/agent-docs/agent-docs.mjs +1 -1
  159. package/foundation/color/css-color.mjs +2 -3
  160. package/foundation/discovery/app-layout.d.mts +13 -0
  161. package/foundation/discovery/app-layout.mjs +35 -0
  162. package/foundation/discovery/cli-self-docs.mjs +4 -4
  163. package/foundation/discovery/fixture-refs.d.mts +51 -0
  164. package/foundation/discovery/fixture-refs.mjs +351 -0
  165. package/foundation/discovery/icon-definition-discovery.mjs +7 -7
  166. package/foundation/discovery/icon-ranking.mjs +2 -2
  167. package/foundation/discovery/icon-set-checks.mjs +6 -6
  168. package/foundation/discovery/icon-set-discovery.mjs +2 -2
  169. package/foundation/discovery/icon-set-writer.d.mts +24 -7
  170. package/foundation/discovery/icon-set-writer.mjs +75 -31
  171. package/foundation/discovery/static-descriptor.d.mts +49 -0
  172. package/foundation/discovery/static-descriptor.mjs +548 -0
  173. package/foundation/discovery/template-adapter.d.mts +0 -47
  174. package/foundation/discovery/template-adapter.mjs +1 -333
  175. package/foundation/discovery/theme-discovery.d.mts +6 -47
  176. package/foundation/discovery/theme-discovery.mjs +15 -537
  177. package/foundation/doc-compiler/bundle.mjs +2 -2
  178. package/foundation/doc-compiler/import.mjs +1 -1
  179. package/foundation/env/user-dirs.d.mts +5 -2
  180. package/foundation/env/user-dirs.mjs +12 -5
  181. package/foundation/fonts/next-font.d.mts +26 -0
  182. package/foundation/fonts/next-font.mjs +149 -0
  183. package/foundation/fs/empty-folder.mjs +2 -2
  184. package/foundation/fs/read-record.mjs +11 -4
  185. package/foundation/pictures/pictures.d.mts +152 -0
  186. package/foundation/pictures/pictures.mjs +565 -0
  187. package/foundation/release/folder-lock.mjs +3 -2
  188. package/foundation/render/cut-short.d.mts +2 -2
  189. package/foundation/render/cut-short.mjs +2 -2
  190. package/foundation/render/drawn-contrast.d.mts +2 -2
  191. package/foundation/render/drawn-contrast.mjs +2 -2
  192. package/foundation/render/font-probe.d.mts +2 -2
  193. package/foundation/render/font-probe.mjs +2 -2
  194. package/foundation/render/layers.mjs +1 -2
  195. package/foundation/render/package-resolve-hooks.d.mts +25 -5
  196. package/foundation/render/package-resolve-hooks.mjs +77 -14
  197. package/foundation/render/page-worker.mjs +24 -12
  198. package/foundation/render/part-boxes.d.mts +2 -3
  199. package/foundation/render/part-boxes.mjs +2 -3
  200. package/foundation/render/picture-chrome.mjs +18 -15
  201. package/foundation/render/picture-playwright.mjs +10 -7
  202. package/foundation/render/picture-window.d.mts +13 -0
  203. package/foundation/render/picture-window.mjs +31 -0
  204. package/foundation/render/render-page.d.mts +1 -1
  205. package/foundation/render/render-page.mjs +4 -5
  206. package/foundation/render/single-copy-hooks.d.mts +2 -0
  207. package/foundation/render/single-copy-hooks.mjs +2 -0
  208. package/foundation/response/error-codes.doc.mjs +14 -14
  209. package/foundation/response/error-codes.mjs +13 -13
  210. package/foundation/response/response-types.doc.mjs +8 -69
  211. package/foundation/runtime/css-tree.mjs +2 -2
  212. package/foundation/runtime/word-table.d.mts +1 -1
  213. package/foundation/runtime/word-table.mjs +1 -1
  214. package/foundation/suggest/other-command.d.mts +52 -15
  215. package/foundation/suggest/other-command.mjs +168 -45
  216. package/foundation/text/suggest-order.d.mts +7 -0
  217. package/foundation/text/suggest-order.mjs +1 -1
  218. package/package.json +7 -8
  219. package/api/theme-edit/_adapter.d.mts +0 -228
  220. package/api/theme-edit/_adapter.mjs +0 -2025
  221. package/api/theme-edit/_catalog.d.mts +0 -172
  222. package/api/theme-edit/_catalog.mjs +0 -806
  223. package/api/theme-edit/_check.d.mts +0 -391
  224. package/api/theme-edit/_check.mjs +0 -9370
  225. package/api/theme-edit/_color.d.mts +0 -135
  226. package/api/theme-edit/_color.mjs +0 -480
  227. package/api/theme-edit/_compiler.d.mts +0 -77
  228. package/api/theme-edit/_compiler.mjs +0 -1053
  229. package/api/theme-edit/_context.d.mts +0 -399
  230. package/api/theme-edit/_context.mjs +0 -1778
  231. package/api/theme-edit/_css.d.mts +0 -169
  232. package/api/theme-edit/_css.mjs +0 -1167
  233. package/api/theme-edit/_edit.d.mts +0 -167
  234. package/api/theme-edit/_edit.mjs +0 -11220
  235. package/api/theme-edit/_how-commands.d.mts +0 -315
  236. package/api/theme-edit/_how-commands.mjs +0 -1664
  237. package/api/theme-edit/_how-question.d.mts +0 -341
  238. package/api/theme-edit/_how-question.mjs +0 -33291
  239. package/api/theme-edit/_how-sides.d.mts +0 -22
  240. package/api/theme-edit/_how-sides.mjs +0 -173
  241. package/api/theme-edit/_how-steps.d.mts +0 -42
  242. package/api/theme-edit/_how-steps.mjs +0 -208
  243. package/api/theme-edit/_how-values.d.mts +0 -29
  244. package/api/theme-edit/_how-values.mjs +0 -111
  245. package/api/theme-edit/_how-words.d.mts +0 -15
  246. package/api/theme-edit/_how-words.mjs +0 -239
  247. package/api/theme-edit/_how.d.mts +0 -55
  248. package/api/theme-edit/_how.mjs +0 -2388
  249. package/api/theme-edit/_importers.d.mts +0 -38
  250. package/api/theme-edit/_importers.mjs +0 -188
  251. package/api/theme-edit/_marks.d.mts +0 -39
  252. package/api/theme-edit/_marks.mjs +0 -67
  253. package/api/theme-edit/_missed.d.mts +0 -56
  254. package/api/theme-edit/_missed.mjs +0 -1128
  255. package/api/theme-edit/_name-rule.d.mts +0 -11
  256. package/api/theme-edit/_name-rule.mjs +0 -12
  257. package/api/theme-edit/_normal.d.mts +0 -365
  258. package/api/theme-edit/_normal.mjs +0 -1978
  259. package/api/theme-edit/_overview.d.mts +0 -9
  260. package/api/theme-edit/_overview.mjs +0 -293
  261. package/api/theme-edit/_palette.d.mts +0 -616
  262. package/api/theme-edit/_palette.mjs +0 -2776
  263. package/api/theme-edit/_part-pieces.d.mts +0 -54
  264. package/api/theme-edit/_part-pieces.mjs +0 -179
  265. package/api/theme-edit/_part-words.d.mts +0 -39
  266. package/api/theme-edit/_part-words.mjs +0 -242
  267. package/api/theme-edit/_parts.d.mts +0 -402
  268. package/api/theme-edit/_parts.mjs +0 -2294
  269. package/api/theme-edit/_picture-traits.d.mts +0 -259
  270. package/api/theme-edit/_picture-traits.mjs +0 -1030
  271. package/api/theme-edit/_png.d.mts +0 -94
  272. package/api/theme-edit/_png.mjs +0 -479
  273. package/api/theme-edit/_preview-app.d.mts +0 -172
  274. package/api/theme-edit/_preview-app.mjs +0 -6430
  275. package/api/theme-edit/_preview.d.mts +0 -549
  276. package/api/theme-edit/_preview.mjs +0 -3264
  277. package/api/theme-edit/_project.d.mts +0 -207
  278. package/api/theme-edit/_project.mjs +0 -643
  279. package/api/theme-edit/_resolved.d.mts +0 -46
  280. package/api/theme-edit/_resolved.mjs +0 -800
  281. package/api/theme-edit/_set-line.d.mts +0 -29
  282. package/api/theme-edit/_set-line.mjs +0 -100
  283. package/api/theme-edit/_settings.d.mts +0 -2426
  284. package/api/theme-edit/_settings.mjs +0 -18435
  285. package/api/theme-edit/_tables.d.mts +0 -227
  286. package/api/theme-edit/_tables.mjs +0 -1128
  287. package/api/theme-edit/_text-looks.d.mts +0 -78
  288. package/api/theme-edit/_text-looks.mjs +0 -376
  289. package/api/theme-edit/_vet.d.mts +0 -50
  290. package/api/theme-edit/_vet.mjs +0 -166
  291. package/api/theme-edit/how/how.d.mts +0 -17
  292. package/api/theme-edit/how/how.mjs +0 -28
  293. package/api/theme-edit/new/new.d.mts +0 -11
  294. package/api/theme-edit/new/new.mjs +0 -22
  295. package/api/theme-edit/preview-add/preview-add.d.mts +0 -14
  296. package/api/theme-edit/preview-add/preview-add.mjs +0 -25
  297. package/api/theme-edit/preview-app/preview-app.d.mts +0 -13
  298. package/api/theme-edit/preview-app/preview-app.mjs +0 -24
  299. package/api/theme-edit/preview-list/preview-list.d.mts +0 -10
  300. package/api/theme-edit/preview-list/preview-list.mjs +0 -21
  301. package/api/theme-edit/preview-remove/preview-remove.d.mts +0 -12
  302. package/api/theme-edit/preview-remove/preview-remove.mjs +0 -23
  303. package/api/theme-edit/set/set.d.mts +0 -13
  304. package/api/theme-edit/set/set.mjs +0 -24
  305. package/api/theme-edit/show/show.d.mts +0 -13
  306. package/api/theme-edit/show/show.mjs +0 -24
  307. package/api/theme-edit/theme-edit.d.mts +0 -12
  308. package/api/theme-edit/theme-edit.mjs +0 -36
  309. package/api/theme-edit/theme-edit.type.d.mts +0 -730
  310. package/api/theme-edit/theme-edit.type.mjs +0 -342
  311. package/api/theme-edit/themeEditHow.doc.d.mts +0 -6
  312. package/api/theme-edit/themeEditHow.doc.mjs +0 -105
  313. package/api/theme-edit/themeEditNew.doc.d.mts +0 -5
  314. package/api/theme-edit/themeEditNew.doc.mjs +0 -112
  315. package/api/theme-edit/themeEditPreviewAdd.doc.d.mts +0 -6
  316. package/api/theme-edit/themeEditPreviewAdd.doc.mjs +0 -121
  317. package/api/theme-edit/themeEditPreviewApp.doc.d.mts +0 -6
  318. package/api/theme-edit/themeEditPreviewApp.doc.mjs +0 -87
  319. package/api/theme-edit/themeEditPreviewList.doc.d.mts +0 -6
  320. package/api/theme-edit/themeEditPreviewList.doc.mjs +0 -62
  321. package/api/theme-edit/themeEditPreviewRemove.doc.d.mts +0 -6
  322. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +0 -96
  323. package/api/theme-edit/themeEditSet.doc.d.mts +0 -6
  324. package/api/theme-edit/themeEditSet.doc.mjs +0 -175
  325. package/api/theme-edit/themeEditShow.doc.d.mts +0 -6
  326. package/api/theme-edit/themeEditShow.doc.mjs +0 -118
  327. package/api/theme-edit/themeEditUndo.doc.d.mts +0 -6
  328. package/api/theme-edit/themeEditUndo.doc.mjs +0 -133
  329. package/api/theme-edit/undo/undo.d.mts +0 -13
  330. package/api/theme-edit/undo/undo.mjs +0 -24
  331. package/assets/preview-app/README.md +0 -6
  332. package/assets/preview-app/css.d.ts +0 -5
  333. package/assets/preview-app/gitignore +0 -4
  334. package/assets/preview-app/next.config.mjs +0 -12
  335. package/assets/preview-app/package.json +0 -24
  336. package/assets/preview-app/src/app/globals.css +0 -6
  337. package/assets/preview-app/src/app/layout.tsx +0 -21
  338. package/assets/preview-app/src/app/page.tsx +0 -94
  339. package/assets/preview-app/src/app/providers.tsx +0 -16
  340. package/assets/preview-app/tsconfig.json +0 -27
  341. package/clients/cli/commands/experimental/theme.mjs +0 -2990
  342. package/clients/cli/commands/experimental-theme-add.doc.mjs +0 -80
  343. package/clients/cli/commands/experimental-theme-compile.doc.mjs +0 -98
  344. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +0 -196
  345. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +0 -174
  346. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +0 -139
  347. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +0 -77
  348. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +0 -105
  349. package/clients/cli/commands/experimental-theme-editor.doc.mjs +0 -49
  350. package/clients/cli/commands/experimental-theme-eject.doc.mjs +0 -72
  351. package/clients/cli/commands/experimental-theme-list.doc.mjs +0 -49
  352. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +0 -88
  353. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +0 -61
  354. package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +0 -48
  355. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +0 -59
  356. package/clients/cli/commands/experimental-theme-preview.doc.mjs +0 -41
  357. package/clients/cli/commands/experimental-theme-remove.doc.mjs +0 -57
  358. package/clients/cli/commands/experimental-theme-targets.doc.mjs +0 -62
  359. package/clients/cli/commands/experimental-theme-template.doc.mjs +0 -63
  360. package/clients/cli/commands/experimental-theme-use.doc.mjs +0 -57
  361. package/clients/cli/commands/experimental-theme.doc.mjs +0 -60
  362. package/foundation/fonts/fontsource-families.generated.d.mts +0 -5
  363. package/foundation/fonts/fontsource-families.generated.mjs +0 -2110
@@ -187,9 +187,9 @@ export type BlockComponentsReport = {
187
187
  };
188
188
  /**
189
189
  * Experimental (spec:AST-084 FR15): for a package that declares
190
- * `experimental.iconSets`, which icon definitions each valid set leaves
190
+ * `experimental.iconSets`, which icon meanings each valid set leaves
191
191
  * unmapped, and what the checks could not judge. Listed beside the issues and
192
- * never counted: mapping an optional definition is optional, an item not
192
+ * never counted: mapping an optional meaning is optional, an item not
193
193
  * checked is not a failure, and nothing here fails a check, even under
194
194
  * `--strict`.
195
195
  */
@@ -199,8 +199,8 @@ export type IconSetCoverage = {
199
199
  */
200
200
  set: string;
201
201
  /**
202
- * Astryx's optional (not built-in) definitions the set's `map` does not
203
- * name. An unmapped built-in definition is an error issue instead.
202
+ * Astryx's optional (not built-in) meanings the set's `map` does not
203
+ * name. An unmapped built-in meaning is an error issue instead.
204
204
  */
205
205
  unmappedDefinitions: Array<{
206
206
  name: string;
@@ -209,7 +209,7 @@ export type IconSetCoverage = {
209
209
  }>;
210
210
  /**
211
211
  * For each
212
- * unmapped definition (built-in, optional, or the set's own), the best icon
212
+ * unmapped meaning (built-in, optional, or the set's own), the best icon
213
213
  * `integration check` gives it, by the rule `experimental icon new-set`
214
214
  * uses for its suggestions, when one is.
215
215
  */
@@ -231,7 +231,7 @@ export type IconSetCoverage = {
231
231
  reason: string;
232
232
  }>;
233
233
  /**
234
- * The icon definitions the bundled templates use that the set's `map`
234
+ * The icon meanings the bundled templates use that the set's `map`
235
235
  * does not name, leaving out one whose fallback (AST-084 FR23) it maps,
236
236
  * each with how many templates use it, most used first, then by name. A
237
237
  * copied template renders a placeholder for each in a
@@ -126,19 +126,19 @@
126
126
 
127
127
  /**
128
128
  * Experimental (spec:AST-084 FR15): for a package that declares
129
- * `experimental.iconSets`, which icon definitions each valid set leaves
129
+ * `experimental.iconSets`, which icon meanings each valid set leaves
130
130
  * unmapped, and what the checks could not judge. Listed beside the issues and
131
- * never counted: mapping an optional definition is optional, an item not
131
+ * never counted: mapping an optional meaning is optional, an item not
132
132
  * checked is not a failure, and nothing here fails a check, even under
133
133
  * `--strict`.
134
134
  * @experimental May change or be removed in a patch release.
135
135
  * @typedef {object} IconSetCoverage
136
136
  * @property {string} set The set's name.
137
137
  * @property {Array<{name: string, description: string, words: string[]}>} unmappedDefinitions
138
- * Astryx's optional (not built-in) definitions the set's `map` does not
139
- * name. An unmapped built-in definition is an error issue instead.
138
+ * Astryx's optional (not built-in) meanings the set's `map` does not
139
+ * name. An unmapped built-in meaning is an error issue instead.
140
140
  * @property {Array<{definition: string, icon: string}>} suggestions For each
141
- * unmapped definition (built-in, optional, or the set's own), the best icon
141
+ * unmapped meaning (built-in, optional, or the set's own), the best icon
142
142
  * `integration check` gives it, by the rule `experimental icon new-set`
143
143
  * uses for its suggestions, when one is.
144
144
  * @property {Array<{icon?: string, adapter?: string, entry?: string, reason: string}>} unchecked
@@ -148,7 +148,7 @@
148
148
  * (`adapter`); and a theme map or theme-map entry it cannot read
149
149
  * (`entry`).
150
150
  * @property {{unmapped: Array<{definition: string, templates: number}>}} [templateMeanings]
151
- * The icon definitions the bundled templates use that the set's `map`
151
+ * The icon meanings the bundled templates use that the set's `map`
152
152
  * does not name, leaving out one whose fallback (AST-084 FR23) it maps,
153
153
  * each with how many templates use it, most used first, then by name. A
154
154
  * copied template renders a placeholder for each in a
@@ -3,18 +3,20 @@
3
3
 
4
4
  /**
5
5
  * Render a page module to one HTML file and write it.
6
- * @param {{cwd: string, input: string, output: string, title?: string, keepClassNames?: boolean, absolute?: boolean}} args absolute paths;
6
+ * @param {{cwd: string, input: string, output: string, title?: string, keepClassNames?: boolean, absolute?: boolean, pictures?: boolean}} args absolute paths;
7
7
  * `absolute`: the caller named the output by an absolute path;
8
- * `keepClassNames`: keep every class of the first paint as written
8
+ * `keepClassNames`: keep every class of the first paint as written;
9
+ * `pictures`: also take pictures of the written file ({@link pagePictures})
9
10
  * @returns {Promise<import('./render.type.mjs').RenderPageResponse['data']>}
10
11
  */
11
- export function renderToFile({ cwd, input, output, title, keepClassNames, absolute }: {
12
+ export function renderToFile({ cwd, input, output, title, keepClassNames, absolute, pictures }: {
12
13
  cwd: string;
13
14
  input: string;
14
15
  output: string;
15
16
  title?: string;
16
17
  keepClassNames?: boolean;
17
18
  absolute?: boolean;
19
+ pictures?: boolean;
18
20
  }): Promise<import("./render.type.mjs").RenderPageResponse["data"]>;
19
21
  /**
20
22
  * Turn a rendered HTML file back into a page module.
@@ -49,7 +49,7 @@ import {pathsHomeFor} from '../../foundation/render/ts-paths.mjs';
49
49
  import {isAstryxMarkup} from '../../foundation/render/html-reader.mjs';
50
50
  import {rebuildPage} from '../../foundation/render/rebuild.mjs';
51
51
  import {cliVersion} from '../../foundation/integrations/cli-peer-version.mjs';
52
- import {assertWithin, PathSafetyError} from '../../foundation/fs/path-safety.mjs';
52
+ import {assertWithin, PathSafetyError, tempFolders} from '../../foundation/fs/path-safety.mjs';
53
53
  import {climbsOut, findCoreDir, findPackageRoot, isInside as liesInside, requireCoreDir} from '../../foundation/fs/paths.mjs';
54
54
  import {judgeCoreProps, projectTypeScript, propNamesOf, readCoreDocs} from '../../foundation/discovery/unknown-core-props.mjs';
55
55
  import {runChoice} from '../../foundation/release/run-context.mjs';
@@ -740,12 +740,13 @@ async function propNameWarnings(names, page, docsOf) {
740
740
 
741
741
  /**
742
742
  * Render a page module to one HTML file and write it.
743
- * @param {{cwd: string, input: string, output: string, title?: string, keepClassNames?: boolean, absolute?: boolean}} args absolute paths;
743
+ * @param {{cwd: string, input: string, output: string, title?: string, keepClassNames?: boolean, absolute?: boolean, pictures?: boolean}} args absolute paths;
744
744
  * `absolute`: the caller named the output by an absolute path;
745
- * `keepClassNames`: keep every class of the first paint as written
745
+ * `keepClassNames`: keep every class of the first paint as written;
746
+ * `pictures`: also take pictures of the written file ({@link pagePictures})
746
747
  * @returns {Promise<import('./render.type.mjs').RenderPageResponse['data']>}
747
748
  */
748
- export async function renderToFile({cwd, input, output, title, keepClassNames = false, absolute = false}) {
749
+ export async function renderToFile({cwd, input, output, title, keepClassNames = false, absolute = false, pictures = false}) {
749
750
  readInput(input, cwd);
750
751
  // An absolute --out is the caller's choice of place, also outside the
751
752
  // current folder (cli-surface DEC-16). The file there is still never one a
@@ -859,9 +860,68 @@ export async function renderToFile({cwd, input, output, title, keepClassNames =
859
860
  scriptModules: page.scriptModules ?? 0,
860
861
  checks: {outside: outsideRequests(written), roundTrip: roundTrip(written, input, page.files)},
861
862
  ...(page.remoteImages ? {remoteImages: page.remoteImages} : {}),
863
+ ...(pictures ? {pictures: await pagePictures(output, cwd, input)} : {}),
862
864
  };
863
865
  }
864
866
 
867
+ /** The phone the pictures are taken on: its window in CSS pixels. */
868
+ const PHONE = Object.freeze({width: 375, height: 812, mobile: true});
869
+
870
+ /**
871
+ * Pictures of the written file, to check how it looks, not to send: a
872
+ * phone in light and dark, and a desktop window, taken after the page's
873
+ * script ran, with a browser already on the machine (the project's
874
+ * Playwright, else a Chrome or Chromium). They go into a new folder in the
875
+ * system temp folder, never beside the file. No browser, or one that
876
+ * fails: no pictures, the reason, and the file stands as written. The
877
+ * picture runner loads only here, so an export without pictures loads
878
+ * none of it.
879
+ * @param {string} output the written file, absolute
880
+ * @param {string} cwd
881
+ * @param {string} input the page module, absolute: its folder finds the
882
+ * project's Playwright
883
+ * @returns {Promise<import('./render.type.mjs').RenderPictures>}
884
+ */
885
+ async function pagePictures(output, cwd, input) {
886
+ const {takePictures} = await import('../../foundation/pictures/pictures.mjs');
887
+ const stem = path.basename(output).replace(/\.html?$/i, '');
888
+ // The system temp folder, as for a template's scratch copy: never a disk's
889
+ // root or a folder that holds the home folder.
890
+ const [temp] = tempFolders();
891
+ if (!temp) {
892
+ // Node reads the temp folder from TEMP on Windows and from TMPDIR elsewhere.
893
+ const tempVariable = process.platform === 'win32' ? 'TEMP' : 'TMPDIR';
894
+ return {
895
+ skipped: `there is no system temp folder to write them to (a disk root or a folder holding the home folder is not one); set ${tempVariable} to a writable folder outside the home folder, then run the command again`,
896
+ };
897
+ }
898
+ /** @type {string} */
899
+ let dir;
900
+ try {
901
+ dir = fs.mkdtempSync(path.join(temp, `astryx-pictures-${stem}-`));
902
+ } catch (e) {
903
+ return {skipped: `the system temp folder cannot be written (${/** @type {any} */ (e)?.code ?? e})`};
904
+ }
905
+ const jobs = [
906
+ {html: output, png: path.join(dir, `${stem}-phone.png`), mode: /** @type {const} */ ('light'), window: PHONE},
907
+ {html: output, png: path.join(dir, `${stem}-phone-dark.png`), mode: /** @type {const} */ ('dark'), window: PHONE},
908
+ {html: output, png: path.join(dir, `${stem}-desktop.png`), mode: /** @type {const} */ ('light')},
909
+ ];
910
+ const taken = await takePictures({cwd, from: input}, jobs);
911
+ const missed = taken.find(r => !r.ok);
912
+ if (missed || taken.length < jobs.length) {
913
+ fs.rmSync(dir, {recursive: true, force: true});
914
+ if (missed && 'reason' in missed) return {skipped: missed.reason};
915
+ const failed = missed && 'failed' in missed ? missed.failed : [];
916
+ return {
917
+ skipped: failed.length
918
+ ? `${failed.join('; ')}; install Playwright with its browser, or Google Chrome or Chromium`
919
+ : 'no browser was found; install Playwright with its browser, or Google Chrome or Chromium',
920
+ };
921
+ }
922
+ return {phone: jobs[0].png, phoneDark: jobs[1].png, desktop: jobs[2].png};
923
+ }
924
+
865
925
  /**
866
926
  * Refuse files a test, story or benchmark runner would run where they land,
867
927
  * judged from the repository root (every folder above the file up to it),
@@ -60,6 +60,13 @@ export const doc = {
60
60
  description:
61
61
  "The rendered page's title (default: its first top-level heading, else the file name). Rendering only.",
62
62
  },
63
+ {
64
+ name: 'options.pictures',
65
+ type: 'boolean',
66
+ description:
67
+ 'Also take pictures of the written file, to check how it looks: a phone in light and dark, and a desktop window, after the page\u2019s script ran, with a browser already on the machine (the project\u2019s Playwright, else Chrome or Chromium), into a new folder in the system temp folder. With no browser, or one that fails, `pictures.skipped` says why, and the file stands as written. Rendering only.',
68
+ default: 'false',
69
+ },
63
70
  {
64
71
  name: 'options.overwrite',
65
72
  type: 'boolean',
@@ -84,7 +91,7 @@ export const doc = {
84
91
  {
85
92
  type: 'render.page',
86
93
  description:
87
- "The page and the HTML file written, its size, the local modules embedded, the stylesheets inlined, the class and image counts, the CSS size, the markup's size (its inlined images included), the embedded source's size, the script's size and how many modules it holds, the files it could not carry (`notCarried`, when there are any), the remote images fetched and not fetched (`remoteImages`, when the page names any), any warnings, and the checks run on the written file: every reference it loads from outside the file (none for a file that stands alone) and whether its embedded source gives back every carried file exactly, naming the files that differ.",
94
+ "The page and the HTML file written, its size, the local modules embedded, the stylesheets inlined, the class and image counts, the CSS size, the markup's size (its inlined images included), the embedded source's size, the script's size and how many modules it holds, the files it could not carry (`notCarried`, when there are any), the remote images fetched and not fetched (`remoteImages`, when the page names any), any warnings, the checks run on the written file: every reference it loads from outside the file (none for a file that stands alone) and whether its embedded source gives back every carried file exactly, naming the files that differ, and with `pictures` the pictures taken of it (`pictures`: the phone, phone dark and desktop PNG paths, or `skipped` with why).",
88
95
  },
89
96
  {
90
97
  type: 'render.reverse',
@@ -96,7 +103,7 @@ export const doc = {
96
103
  {code: 'ERR_MISSING_ARGUMENT', when: 'no file is given'},
97
104
  {
98
105
  code: 'ERR_INVALID_ARGUMENT',
99
- when: 'the file or `out` has the wrong kind of extension, `out` is the input itself, `title` or `keepClassNames` is given with `reverse`, or `overwrite` without it; with `reverse`, the page would land under a configuration name (`vite.config.ts`) or where a test, story or benchmark runner would run it (judged from the repository root)',
106
+ when: 'the file or `out` has the wrong kind of extension, `out` is the input itself, `title`, `keepClassNames` or `pictures` is given with `reverse`, or `overwrite` without it; with `reverse`, the page would land under a configuration name (`vite.config.ts`) or where a test, story or benchmark runner would run it (judged from the repository root)',
100
107
  },
101
108
  {code: 'ERR_FILE_NOT_FOUND', when: 'the file, or a local file the page imports, does not exist'},
102
109
  {code: 'ERR_READ_FAILED', when: 'the file is there but cannot be read: no read permission, a folder or a pipe given as the file, or another file-system error; the message names the reason'},
@@ -30,7 +30,7 @@ import {PAGE_EXTENSIONS, embeddedPathProblem, renderToFile, reverseToFile} from
30
30
  * @returns {Promise<import('./render.type.mjs').RenderPageResponse | import('./render.type.mjs').RenderReverseResponse>}
31
31
  */
32
32
  export async function render(file, options = {}) {
33
- const {cwd = process.cwd(), reverse = false, overwrite = false, title, keepClassNames = false} = options;
33
+ const {cwd = process.cwd(), reverse = false, overwrite = false, title, keepClassNames = false, pictures = false} = options;
34
34
  if (typeof file !== 'string' || !file.trim()) {
35
35
  throw new AstryxError(
36
36
  reverse ? 'A rendered HTML file is required' : 'A page file is required',
@@ -58,6 +58,9 @@ export async function render(file, options = {}) {
58
58
  if (keepClassNames) {
59
59
  throw new AstryxError('keepClassNames applies only to rendering, not to reverse', [], ERROR_CODES.ERR_INVALID_ARGUMENT);
60
60
  }
61
+ if (pictures) {
62
+ throw new AstryxError('--pictures applies only to exporting, not to --reverse', [], ERROR_CODES.ERR_INVALID_ARGUMENT);
63
+ }
61
64
  if (!/\.html?$/i.test(input)) {
62
65
  throw new AstryxError(
63
66
  `Turning a file back into a page reads a rendered .html file; ${file} is not one`,
@@ -111,6 +114,6 @@ export async function render(file, options = {}) {
111
114
  const target = output ?? input.replace(/\.[^.]+$/, '.html');
112
115
  return {
113
116
  type: 'render.page',
114
- data: await renderToFile({cwd, input, output: target, title, keepClassNames, absolute: Boolean(options.out) && path.isAbsolute(/** @type {string} */ (options.out))}),
117
+ data: await renderToFile({cwd, input, output: target, title, keepClassNames, pictures, absolute: Boolean(options.out) && path.isAbsolute(/** @type {string} */ (options.out))}),
115
118
  };
116
119
  }
@@ -18,6 +18,10 @@ export type RenderOptions = {
18
18
  * - The rendered page's title (default: its first heading, else the file name). Rendering only.
19
19
  */
20
20
  title?: string | undefined;
21
+ /**
22
+ * - Also take pictures of the written file (a phone in light and dark, and a desktop window) to check how it looks, with a browser already on the machine. Rendering only.
23
+ */
24
+ pictures?: boolean | undefined;
21
25
  /**
22
26
  * - Replace the existing page module when reversing (never a protected file, and never a file other than the page, which always goes into a new folder). Rendering replaces an existing HTML file only when a render wrote it.
23
27
  */
@@ -27,6 +31,18 @@ export type RenderOptions = {
27
31
  */
28
32
  keepClassNames?: boolean | undefined;
29
33
  };
34
+ /**
35
+ * Pictures of a written file, to check how it looks, not to send: absolute
36
+ * paths of PNGs in a new folder of the system temp folder, or, when no
37
+ * browser on the machine took them, why (`skipped`).
38
+ */
39
+ export type RenderPictures = {
40
+ phone: string;
41
+ phoneDark: string;
42
+ desktop: string;
43
+ } | {
44
+ skipped: string;
45
+ };
30
46
  /**
31
47
  * Something the render noticed that may make the page differ from what its
32
48
  * author meant.
@@ -83,6 +99,7 @@ export type RenderPageResponse = {
83
99
  notCarried?: string[] | undefined;
84
100
  scriptBytes: number;
85
101
  scriptModules: number;
102
+ pictures?: RenderPictures | undefined;
86
103
  checks: {
87
104
  outside: string[];
88
105
  roundTrip: {
@@ -14,10 +14,19 @@
14
14
  * @property {string} [out] - The file to write. Rendering: an .html file (default: the page's name with .html). Reversing: a page module (default: inside a new folder beside the HTML file, named after it, such as `report-restored/`).
15
15
  * @property {boolean} [reverse] - Turn a rendered HTML file back into a page module.
16
16
  * @property {string} [title] - The rendered page's title (default: its first heading, else the file name). Rendering only.
17
+ * @property {boolean} [pictures] - Also take pictures of the written file (a phone in light and dark, and a desktop window) to check how it looks, with a browser already on the machine. Rendering only.
17
18
  * @property {boolean} [overwrite] - Replace the existing page module when reversing (never a protected file, and never a file other than the page, which always goes into a new folder). Rendering replaces an existing HTML file only when a render wrote it.
18
19
  * @property {boolean} [keepClassNames] - Keep every class of the first paint as written, for a caller that takes the file's markup and styles it with its own copy of the StyleX styles. By default, once the repeated lists of the StyleX classes Astryx's packages write (the `x…` classes) add up to 16 KB, each such list becomes one short alias class, whose rules only the file's own stylesheet holds; the page's own StyleX classes keep their names. Rendering only; refused with `reverse`.
19
20
  */
20
21
 
22
+ /**
23
+ * Pictures of a written file, to check how it looks, not to send: absolute
24
+ * paths of PNGs in a new folder of the system temp folder, or, when no
25
+ * browser on the machine took them, why (`skipped`).
26
+ * @experimental May change or be removed in a patch release.
27
+ * @typedef {{phone: string, phoneDark: string, desktop: string} | {skipped: string}} RenderPictures
28
+ */
29
+
21
30
  /**
22
31
  * Something the render noticed that may make the page differ from what its
23
32
  * author meant.
@@ -58,6 +67,7 @@
58
67
  * @property {string[]} [data.notCarried] - Files the page uses that the file does not carry, so experimental import cannot give them back: a name that reads as a tool's configuration, a file a test or story runner would run, a file outside the carried folder (imported by a relative path or a path alias), an image it cannot carry, or a Sass or Less stylesheet, which a render does not compile. Each also has a warning. Present only when there are some.
59
68
  * @property {number} data.scriptBytes - Size of the page's script, which `bytes` includes.
60
69
  * @property {number} data.scriptModules - How many modules the page's script holds (the page's own, its packages', React's).
70
+ * @property {RenderPictures} [data.pictures] - With `pictures`: the pictures taken of the written file, or why there are none.
61
71
  * @property {object} data.checks - Checks run on the written file.
62
72
  * @property {string[]} data.checks.outside - Every reference the file's markup and stylesheets load from outside the file when it opens (a remote address, or a file beside it the render did not carry); empty when the file stands alone.
63
73
  * @property {{exact: boolean, files: number, differs: string[]}} data.checks.roundTrip - Whether the embedded source gives back every carried file byte for byte, how many files it carries, and the carried paths whose embedded copy differs from the file on disk or is missing on either side.
@@ -1,6 +1,6 @@
1
1
  # Search ordering data
2
2
 
3
- `astryx search` decides **what matches**, and each match's score and reason, with the lexical ranker (`_lexical.mjs` and the files it imports). The files in this folder only decide **the order of matches inside one score band**: they never add or drop a match, change a score, or move a match past one of another band or kind (doc or not), except a family root the lexical ranker marks, which moves directly before its part (below). The bands are scores 195 and up, 188–194, 170–187, 160–169, 151–159, 100–150, 55–99, and under 55. A band can be wide (55–99 holds keyword matches beside one-word description hits), so inside a band a lower score can lead a higher one. In search's own reading of the catalog (`searchView` in `_named-keywords.mjs`), another entry's name is that entry's evidence: a component a block uses (its doc's `componentsUsed`) can make the block's answer to a query word stronger but never answers a word alone, so it never lifts the block into the every-word tier (`_score.mjs`), while the order files here still read it as the block's docs text (`_entries.mjs`, `_fit-order.mjs`); an entry that is not a doc takes that tier only with two strong query words, each a keyword-strength hit or a word of its own name, display name or title, or the start of one, since one strong word and a mention of the others matches that word, not the ask, while a doc, which answers in prose, needs one (`_score.mjs`); a title inside the query takes the title tier only when every query word it leaves unanswered names no component or hook, or also names a doc; and a match whose name of two or more words the query writes as one whole word (`TableSortableTable`, `table-sortable-table`, a doc's `tokens-color`) leads the answer, alone or inside a longer query, unless a longer named run of the query, or a block's display name or a doc's title or heading that the query holds (`heldTitle` in `_titles.mjs`, as the title tier reads it), contains it (`_lexical.mjs`). An entry whose name of three or more words the query spells out as words apart, every word in order and at most one word misspelled with its first letter kept, as the lexical scorer reads a misspelled name (`pagination dots carousle`), leads its band, also ahead of its family's root, unless a longer name the query names, or another entry's display name or title the query holds, contains it; two words apart stay plain language (`_lexical.mjs`). The order files keep such an entry first in its run. In that reading, a doc that opens a level (a docs-tree namespace, holding the docs under its route as `_summarizes`) does not answer a query word through its text (its prose, or a code term or table cell its keywords gather) when a doc beneath it answers that word at least as strongly (`_candidate-score.mjs`); its name, title, description and declared keywords stay its own. `searchCore`, which build reads, keeps the gathered reading.
3
+ `astryx search` decides **what matches**, and each match's score and reason, with the lexical ranker (`_lexical.mjs` and the files it imports). The files in this folder only decide **the order of matches inside one score band**: they never add or drop a match, change a score, or move a match past one of another band or kind (doc or not), except a family root the lexical ranker marks, which moves directly before its part (below). The bands are scores 195 and up, 188–194, 170–187, 160–169, 151–159, 100–150, 55–99, and under 55. A band can be wide (55–99 holds keyword matches beside one-word description hits), so inside a band a lower score can lead a higher one. In search's own reading of the catalog (`searchView` in `_named-keywords.mjs`), another entry's name is that entry's evidence: a component a block uses (its doc's `componentsUsed`) can make the block's answer to a query word stronger but never answers a word alone, so it never lifts the block into the every-word tier (`_score.mjs`), while the order files here still read it as the block's docs text (`_entries.mjs`, `_fit-order.mjs`); an entry that is not a doc takes that tier only with two strong query words, each a keyword-strength hit or a word of its own name, display name or title, or the start of one, since one strong word and a mention of the others matches that word, not the ask, while a doc, which answers in prose, needs one (`_score.mjs`); a query word of 3+ letters, as typed, that is a whole word of a component's or hook's name is a name hit (`name contains`), however short against the name (`list` in MetadataList), while a hook's leading `use` and a template's name keep the half-the-name rule (`_candidate-score.mjs`); a title inside the query takes the title tier only when every query word it leaves unanswered names no component or hook, or also names a doc; and a match whose name of two or more words the query writes as one whole word (`TableSortableTable`, `table-sortable-table`, a doc's `tokens-color`) leads the answer, alone or inside a longer query, unless a longer named run of the query, or a block's display name or a doc's title or heading that the query holds (`heldTitle` in `_titles.mjs`, as the title tier reads it), contains it (`_lexical.mjs`). An entry whose name of three or more words the query spells out as words apart, every word in order and at most one word misspelled with its first letter kept, as the lexical scorer reads a misspelled name (`pagination dots carousle`), leads its band, also ahead of its family's root, unless a longer name the query names, or another entry's display name or title the query holds, contains it; two words apart stay plain language (`_lexical.mjs`). The order files keep such an entry first in its run. In that reading, a doc that opens a level (a docs-tree namespace, holding the docs under its route as `_summarizes`) does not answer a query word through its text (its prose, or a code term or table cell its keywords gather) when a doc beneath it answers that word at least as strongly (`_candidate-score.mjs`); its name, title, description and declared keywords stay its own. `searchCore`, which build reads, keeps the gathered reading.
4
4
 
5
5
  ## Rule
6
6
 
@@ -15,6 +15,7 @@
15
15
  * 80 name Levenshtein distance 1 (one-word lookups, words of 5+ letters)
16
16
  * 70 keyword word prefix / distance 1 (distance: one-word lookups, 5+ letters)
17
17
  * 60 name word prefix (>=4 chars, >=50% coverage)
18
+ * 60 whole word of a component or hook name (>=3 chars; search's reading)
18
19
  * 60 exact weak-keyword match
19
20
  * 50 description / prose mentions the term
20
21
  * 45 usage guidance mentions the term
@@ -44,6 +45,7 @@ import {
44
45
  wordsOf,
45
46
  joined,
46
47
  typoDistance,
48
+ isATermWordOf,
47
49
  } from './_words.mjs';
48
50
  import {pluralOf} from './_query.mjs';
49
51
 
@@ -409,6 +411,24 @@ export function scoreCandidate(
409
411
  consider(90, `name "${candidateName}" ends in "${term}"`);
410
412
  } else if (startsATermWordOf(t, candidateName)) {
411
413
  consider(60, `name contains "${term}"`);
414
+ } else if (
415
+ ownEvidence &&
416
+ !synonym &&
417
+ (domain === 'component' || domain === 'hook') &&
418
+ term.length >= 3 &&
419
+ isATermWordOf(
420
+ t,
421
+ domain === 'hook'
422
+ ? candidateName.replace(/^use(?=[A-Z])/, '')
423
+ : candidateName,
424
+ )
425
+ ) {
426
+ // In search's reading, a query word of 3+ letters that is a whole
427
+ // word of a component's or hook's name is a name hit however short
428
+ // against the name: `list` in MetadataList. A hook's leading `use`,
429
+ // which nearly every hook name starts with, is no such word, and a
430
+ // synonym standing in for a query word is not the word itself.
431
+ consider(60, `name contains "${term}"`);
412
432
  }
413
433
  if (fuzzy) {
414
434
  const dist = typoDistance(term, nameLower);
@@ -63,6 +63,14 @@ export function startsAWordOf(term: string, text: string): boolean;
63
63
  * @returns {boolean}
64
64
  */
65
65
  export function startsATermWordOf(t: TermWords, text: string): boolean;
66
+ /**
67
+ * Whether a term is one of a text's words, in any of its forms, however short
68
+ * against the whole text: `chat` in ChatComposer.
69
+ * @param {TermWords} t
70
+ * @param {string} text - The name or keyword as authored.
71
+ * @returns {boolean}
72
+ */
73
+ export function isATermWordOf(t: TermWords, text: string): boolean;
66
74
  /**
67
75
  * Whether a term is one of a text's words, or the start of one, however
68
76
  * short against the whole text: `avata` in AvatarGroupInteractive.
@@ -205,6 +205,21 @@ export function startsATermWordOf(t, text) {
205
205
  return false;
206
206
  }
207
207
 
208
+ /**
209
+ * Whether a term is one of a text's words, in any of its forms, however short
210
+ * against the whole text: `chat` in ChatComposer.
211
+ * @param {TermWords} t
212
+ * @param {string} text - The name or keyword as authored.
213
+ * @returns {boolean}
214
+ */
215
+ export function isATermWordOf(t, text) {
216
+ const words = wordsOf(text);
217
+ for (let i = 0; i < words.length; i++) {
218
+ if (sameTermWord(t, words[i])) return true;
219
+ }
220
+ return false;
221
+ }
222
+
208
223
  /**
209
224
  * Whether a term is one of a text's words, or the start of one, however
210
225
  * short against the whole text: `avata` in AvatarGroupInteractive.
@@ -140,7 +140,7 @@ export type TemplateIconsReport = {
140
140
  */
141
141
  order?: string[] | undefined;
142
142
  /**
143
- * The variant the project's icons draw, as `experimental.iconVariant` names it; present when it is set.
143
+ * The look the project's icons draw, as `experimental.iconVariant` names it; present when it is set.
144
144
  */
145
145
  variant?: string | undefined;
146
146
  /**
@@ -148,7 +148,7 @@ export type TemplateIconsReport = {
148
148
  */
149
149
  reason: string;
150
150
  /**
151
- * Icons rewritten to the first set in the project's list that has them, and the rule that chose each one: a reviewed `exact` or `strong` match, the icon the set's `map` names for the icon meaning the template declares, or `variant`, an icon the template already imports from a set in the list, moved to its export for the project's variant. `target.set` names the set used. `dropped` names the library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`) removed from the icon's elements: an icon set's icons take their size from CSS. `variant` is present when the variant asked for, the project's variant or else the variant the template's icon draws, is one the set's icon does not have: that variant and the set's default variant used instead.
151
+ * Icons rewritten to the first set in the project's list that has them, and the rule that chose each one: a reviewed `exact` or `strong` match, the icon the set's `map` names for the icon meaning the template declares, or `variant`, an icon the template already imports from a set in the list, moved to its export for the project's variant. `target.set` names the set used. `dropped` names the library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`) removed from the icon's elements: an icon set's icons take their size from CSS. `variant` is present when the look asked for, the project's variant or else the look the template's icon draws, is one the set's icon does not have: that look and the set's default look used instead.
152
152
  */
153
153
  mapped: Array<{
154
154
  source: {
@@ -105,9 +105,9 @@
105
105
  * @property {'selected' | 'none' | 'ambiguous' | 'missing' | 'withdrawn'} status The project's icon-set state.
106
106
  * @property {string | null} set The project's main icon set as `<package>/<set>`, when selected.
107
107
  * @property {string[]} [order] The main set and each backup set as `<package>/<set>`, in the order icons are looked up; present when the project lists backups.
108
- * @property {string} [variant] The variant the project's icons draw, as `experimental.iconVariant` names it; present when it is set.
108
+ * @property {string} [variant] The look the project's icons draw, as `experimental.iconVariant` names it; present when it is set.
109
109
  * @property {string} reason Why the project has that set, or none.
110
- * @property {Array<{source: {module: string, export: string}, target: {set: string, package: string, id: string, module: string, export: string}, by: 'match' | 'definition' | 'variant', dropped?: string[], variant?: {asked: string, used: string | null}}>} mapped Icons rewritten to the first set in the project's list that has them, and the rule that chose each one: a reviewed `exact` or `strong` match, the icon the set's `map` names for the icon meaning the template declares, or `variant`, an icon the template already imports from a set in the list, moved to its export for the project's variant. `target.set` names the set used. `dropped` names the library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`) removed from the icon's elements: an icon set's icons take their size from CSS. `variant` is present when the variant asked for, the project's variant or else the variant the template's icon draws, is one the set's icon does not have: that variant and the set's default variant used instead.
110
+ * @property {Array<{source: {module: string, export: string}, target: {set: string, package: string, id: string, module: string, export: string}, by: 'match' | 'definition' | 'variant', dropped?: string[], variant?: {asked: string, used: string | null}}>} mapped Icons rewritten to the first set in the project's list that has them, and the rule that chose each one: a reviewed `exact` or `strong` match, the icon the set's `map` names for the icon meaning the template declares, or `variant`, an icon the template already imports from a set in the list, moved to its export for the project's variant. `target.set` names the set used. `dropped` names the library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`) removed from the icon's elements: an icon set's icons take their size from CSS. `variant` is present when the look asked for, the project's variant or else the look the template's icon draws, is one the set's icon does not have: that look and the set's default look used instead.
111
111
  * @property {Array<{source: {module: string, export: string}, target: {local: string}, definitions: string[], fixes: string[], dropped?: string[], suggestion?: {set: string, id: string, module: string, export: string, confidence: 'likely'}}>} placeholder Icons with a meaning that no set in the project's list has. The template's original import is removed. The written code declares a small placeholder component once (`target.local`, `MissingIcon` unless the file already uses that name), and each use of the icon renders it, with a comment that names the meaning. It needs no package. `fixes` are the commands that give it a real icon: map the meaning in the main set, or add a backup set that has it.
112
112
  * @property {Array<{module: string | null, export: string, reason: string, suggestion?: {set: string, id: string, module: string, export: string, confidence: 'likely'}}>} kept Icons left as the template wrote them, with why, and a `likely` reviewed match as a suggestion when the project set has one. Every declared key is mapped, a placeholder, or kept; `module` is null for a key the template does not import, and `export` is `default` for a default import and `*` for a namespace import.
113
113
  * @property {Array<{set: string, license: string, icons: number}>} sets Each set the mapped icons come from, as `<package>/<set>`, with its license and how many icons it gave.
@@ -1961,7 +1961,7 @@ export async function addSharedThemeToApp(source, options) {
1961
1961
  if (!previous || changed.length > 0) {
1962
1962
  throw new AstryxError(
1963
1963
  previous
1964
- ? `The ${name} theme is already in this app (${relFrom(cwd, target)}), added from a shared theme, and ${changed.join(', ')} changed since; adding it again would replace those changes, so nothing was written.`
1964
+ ? `The ${name} theme is already in this app (${relFrom(cwd, target)}), added from a shared theme, and ${changed.join(', ')} changed since; adding it again would replace those changes, so nothing was written. To take the shared theme's files again, delete ${changed.length > 1 ? 'those files' : 'that file'} (or move your changes out of ${changed.length > 1 ? 'them' : 'it'}), then add it again.`
1965
1965
  : `A theme named "${name}" is already in this app (${relFrom(cwd, target)}), and theme add did not write it; adding this one would replace it, so nothing was written.`,
1966
1966
  previous
1967
1967
  ? undefined
@@ -2226,9 +2226,10 @@ function scriptsOff(pm, action, projectDir) {
2226
2226
  /**
2227
2227
  * Undo what `theme add` did for a shared theme whose record was just
2228
2228
  * removed: delete each file its copy wrote that still holds what it wrote,
2229
- * keep (and name) any the builder changed, and uninstall the packages it
2230
- * installed that no theme still in the record is owned by or imports. A
2231
- * local theme with no
2229
+ * and uninstall the packages it installed that no theme still in the record
2230
+ * is owned by or imports. When a file of the copy changed, the whole copy
2231
+ * stays instead, with its receipt and packages, and the changed files are
2232
+ * named. A local theme with no
2232
2233
  * receipt (one the app wrote or ejected itself) is left as it is.
2233
2234
  * @param {string} projectDir
2234
2235
  * @param {string} slug
@@ -2242,13 +2243,17 @@ function undoSharedTheme(projectDir, slug, remaining) {
2242
2243
  const kept = changedSharedFiles(dir, receipt);
2243
2244
  /** @type {string[]} */
2244
2245
  const removed = [];
2245
- for (const file of Object.keys(receipt.files)) {
2246
- if (kept.includes(file) || !fs.existsSync(path.join(dir, file))) continue;
2247
- fs.rmSync(path.join(dir, file), {force: true});
2248
- removed.push(relFrom(projectDir, path.join(dir, file)));
2246
+ // (A copy with a file kept stays whole, its receipt too, so the folder is
2247
+ // a copy a re-add of the same theme recognizes, never a part of one.)
2248
+ if (!kept.length) {
2249
+ for (const file of Object.keys(receipt.files)) {
2250
+ if (!fs.existsSync(path.join(dir, file))) continue;
2251
+ fs.rmSync(path.join(dir, file), {force: true});
2252
+ removed.push(relFrom(projectDir, path.join(dir, file)));
2253
+ }
2254
+ fs.rmSync(path.join(dir, SHARED_RECEIPT), {force: true});
2255
+ removeEmptyFolder(dir, {deep: true});
2249
2256
  }
2250
- fs.rmSync(path.join(dir, SHARED_RECEIPT), {force: true});
2251
- removeEmptyFolder(dir, {deep: true});
2252
2257
  const root = path.join(projectDir, LOCAL_THEME_ROOT);
2253
2258
  if (receipt.madeRoot) removeEmptyFolder(root);
2254
2259
  // A package a theme still in the record is owned by or imports stays,
@@ -2284,7 +2289,10 @@ function undoSharedTheme(projectDir, slug, remaining) {
2284
2289
  importsOf(path.join(otherDir, file));
2285
2290
  }
2286
2291
  for (const file of themeModuleCandidates(projectDir)) importsOf(file);
2287
- const uninstall = receipt.installed.filter(name => !stillUsed.has(name));
2292
+ // (A copy kept whole still imports what the add installed: those stay.)
2293
+ const uninstall = kept.length
2294
+ ? []
2295
+ : receipt.installed.filter(name => !stillUsed.has(name));
2288
2296
  if (uninstall.length === 0) return {removed, kept, uninstalled: []};
2289
2297
  const run = runPackageManager(projectDir, 'remove', uninstall);
2290
2298
  if (run.ok) return {removed, kept, uninstalled: uninstall};