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

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 (653) hide show
  1. package/README.md +14 -9
  2. package/api/build/_adapter.d.mts +33 -4
  3. package/api/build/_adapter.mjs +43 -8
  4. package/api/build/blocks/blocks.d.mts +1 -0
  5. package/api/build/blocks/blocks.mjs +2 -1
  6. package/api/build/blocks/blocks.weights.json +1 -1
  7. package/api/build/build.doc.mjs +2 -2
  8. package/api/build/build.type.d.mts +13 -1
  9. package/api/build/build.type.mjs +6 -3
  10. package/api/build/kit/kind.d.mts +6 -0
  11. package/api/build/kit/kind.mjs +1 -1
  12. package/api/build/kit/kit.mjs +3 -3
  13. package/api/build/kit/rank.d.mts +9 -3
  14. package/api/build/kit/rank.mjs +21 -8
  15. package/api/build/kit/signals.d.mts +7 -1
  16. package/api/build/kit/signals.mjs +124 -41
  17. package/api/build/kit/start.d.mts +20 -5
  18. package/api/build/kit/start.mjs +103 -23
  19. package/api/build/kit/weights.d.mts +20 -4
  20. package/api/build/kit/weights.json +1 -1
  21. package/api/build/kit/weights.mjs +68 -18
  22. package/api/build/kit/words.d.mts +44 -2
  23. package/api/build/kit/words.mjs +159 -4
  24. package/api/build/tree.mjs +1 -1
  25. package/api/component/__fixtures__/resolutions/modules.txt +4 -4
  26. package/api/component/_adapter.d.mts +51 -20
  27. package/api/component/_adapter.mjs +198 -29
  28. package/api/component/component.mjs +18 -5
  29. package/api/component/component.type.d.mts +4 -0
  30. package/api/component/component.type.mjs +1 -0
  31. package/api/component/detail/blocks/blocks.mjs +1 -0
  32. package/api/component/detail/detail.d.mts +2 -2
  33. package/api/component/detail/detail.mjs +1 -1
  34. package/api/component/list/list.d.mts +2 -2
  35. package/api/component/list/list.mjs +4 -4
  36. package/api/discover/_adapter.d.mts +10 -0
  37. package/api/discover/_adapter.mjs +110 -16
  38. package/api/discover/detail/item/item.mjs +5 -0
  39. package/api/discover/discover.mjs +12 -3
  40. package/api/discover/discover.type.d.mts +16 -3
  41. package/api/discover/discover.type.mjs +13 -3
  42. package/api/docs/_adapter.d.mts +74 -30
  43. package/api/docs/_adapter.mjs +488 -234
  44. package/api/docs/_entry-names-lazily.d.mts +22 -0
  45. package/api/docs/_entry-names-lazily.mjs +25 -0
  46. package/api/docs/_entry-names.d.mts +23 -0
  47. package/api/docs/_entry-names.mjs +105 -0
  48. package/api/doctor/_adapter.d.mts +63 -2
  49. package/api/doctor/_adapter.mjs +141 -5
  50. package/api/doctor/doctor.d.mts +11 -0
  51. package/api/doctor/doctor.doc.mjs +1 -1
  52. package/api/doctor/doctor.mjs +81 -30
  53. package/api/doctor/theme-checks.d.mts +35 -3
  54. package/api/doctor/theme-checks.mjs +449 -99
  55. package/api/error.d.mts +4 -3
  56. package/api/error.mjs +3 -2
  57. package/api/hook/_adapter.d.mts +14 -7
  58. package/api/hook/_adapter.mjs +46 -9
  59. package/api/hook/detail/detail.mjs +5 -2
  60. package/api/hook/detail/params/params.mjs +10 -3
  61. package/api/icon/_options.d.mts +17 -0
  62. package/api/icon/_options.mjs +54 -0
  63. package/api/icon/exportIconIndex.doc.d.mts +10 -0
  64. package/api/icon/exportIconIndex.doc.mjs +59 -0
  65. package/api/icon/icon.mjs +11 -34
  66. package/api/icon/icon.type.d.mts +49 -0
  67. package/api/icon/icon.type.mjs +24 -0
  68. package/api/icon/rankIconIndex.doc.d.mts +10 -0
  69. package/api/icon/rankIconIndex.doc.mjs +79 -0
  70. package/api/icon/search/icon-index.d.mts +41 -0
  71. package/api/icon/search/icon-index.mjs +139 -0
  72. package/api/icon/search/search.d.mts +18 -0
  73. package/api/icon/search/search.mjs +13 -0
  74. package/api/index.d.mts +1 -0
  75. package/api/index.mjs +1 -0
  76. package/api/integration/add-helpers.mjs +10 -0
  77. package/api/integration/authoring-checks.mjs +5 -2
  78. package/api/integration/check/check.mjs +6 -1
  79. package/api/integration/pack-check.mjs +50 -3
  80. package/api/integration/validate-integration.d.mts +18 -6
  81. package/api/integration/validate-integration.mjs +110 -14
  82. package/api/integration/validate-integration.type.d.mts +13 -0
  83. package/api/integration/validate-integration.type.mjs +2 -1
  84. package/api/integration/validateIntegration.doc.mjs +1 -1
  85. package/api/render/render.type.d.mts +1 -1
  86. package/api/render/render.type.mjs +1 -1
  87. package/api/search/ORDERING.md +1 -1
  88. package/api/search/_adapter.d.mts +8 -5
  89. package/api/search/_adapter.mjs +14 -10
  90. package/api/search/_candidate-score.d.mts +9 -4
  91. package/api/search/_candidate-score.mjs +82 -14
  92. package/api/search/_gather-components.d.mts +4 -4
  93. package/api/search/_gather-components.mjs +4 -3
  94. package/api/search/_gather-hooks.d.mts +2 -2
  95. package/api/search/_gather-hooks.mjs +1 -1
  96. package/api/search/_gather-templates.mjs +1 -0
  97. package/api/search/_lexical.d.mts +16 -0
  98. package/api/search/_lexical.mjs +98 -10
  99. package/api/search/_priority.d.mts +10 -2
  100. package/api/search/_priority.mjs +37 -7
  101. package/api/search/_result.d.mts +1 -0
  102. package/api/search/_result.mjs +1 -0
  103. package/api/search/_score.d.mts +12 -3
  104. package/api/search/_score.mjs +6 -3
  105. package/api/search/_words.mjs +12 -3
  106. package/api/search/search.d.mts +7 -1
  107. package/api/search/search.doc.mjs +1 -1
  108. package/api/search/search.mjs +37 -4
  109. package/api/search/search.type.d.mts +4 -0
  110. package/api/search/search.type.mjs +1 -0
  111. package/api/swizzle/_adapter.d.mts +7 -5
  112. package/api/swizzle/_adapter.mjs +22 -6
  113. package/api/swizzle/copy/copy.mjs +5 -4
  114. package/api/template/_adapter.d.mts +16 -0
  115. package/api/template/_adapter.mjs +39 -2
  116. package/api/template/cdn/cdn.mjs +37 -8
  117. package/api/template/copy/copy.d.mts +6 -3
  118. package/api/template/copy/copy.mjs +83 -8
  119. package/api/template/show/show.mjs +1 -0
  120. package/api/template/skeleton/skeleton.mjs +1 -0
  121. package/api/template/template.doc.mjs +5 -5
  122. package/api/template/template.mjs +63 -11
  123. package/api/template/template.type.d.mts +4 -0
  124. package/api/template/template.type.mjs +5 -1
  125. package/api/theme/_adapter.d.mts +20 -1
  126. package/api/theme/_adapter.mjs +149 -12
  127. package/api/theme/_app-provider.d.mts +31 -0
  128. package/api/theme/_app-provider.mjs +135 -0
  129. package/api/theme/add/add.mjs +3 -1
  130. package/api/theme/build/build.d.mts +127 -11
  131. package/api/theme/build/build.mjs +2047 -352
  132. package/api/theme/build/core-interception.d.mts +10 -0
  133. package/api/theme/build/core-interception.mjs +10 -0
  134. package/api/theme/build/family.mjs +61 -21
  135. package/api/theme/build/font-warning.d.mts +99 -5
  136. package/api/theme/build/font-warning.mjs +379 -61
  137. package/api/theme/build/icon-imports.mjs +83 -15
  138. package/api/theme/build/input-fields.d.mts +110 -0
  139. package/api/theme/build/input-fields.mjs +667 -0
  140. package/api/theme/build/null-values.d.mts +42 -0
  141. package/api/theme/build/null-values.mjs +283 -0
  142. package/api/theme/build/self-contained.d.mts +90 -0
  143. package/api/theme/build/self-contained.mjs +380 -0
  144. package/api/theme/build/source-syntax.d.mts +11 -0
  145. package/api/theme/build/source-syntax.mjs +28 -0
  146. package/api/theme/build/style-keys.d.mts +72 -0
  147. package/api/theme/build/style-keys.mjs +589 -0
  148. package/api/theme/build/typography-values.d.mts +61 -0
  149. package/api/theme/build/typography-values.mjs +408 -0
  150. package/api/theme/build/written-values.d.mts +78 -0
  151. package/api/theme/build/written-values.mjs +482 -0
  152. package/api/theme/generateTonalPalette.doc.mjs +1 -1
  153. package/api/theme/list/list.mjs +17 -1
  154. package/api/theme/palette/generate/generator.d.mts +14 -2
  155. package/api/theme/palette/generate/generator.mjs +94 -8
  156. package/api/theme/remove/remove.d.mts +2 -1
  157. package/api/theme/remove/remove.mjs +7 -3
  158. package/api/theme/theme.type.d.mts +89 -5
  159. package/api/theme/theme.type.mjs +46 -7
  160. package/api/theme/themeAdd.doc.mjs +1 -1
  161. package/api/theme/themeBuild.doc.mjs +1 -1
  162. package/api/theme/themeListAvailable.doc.mjs +1 -1
  163. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  164. package/api/theme/themeRemove.doc.mjs +8 -5
  165. package/api/theme/themeTemplate.doc.mjs +18 -3
  166. package/api/theme-edit/_adapter.d.mts +57 -4
  167. package/api/theme-edit/_adapter.mjs +380 -73
  168. package/api/theme-edit/_catalog.d.mts +82 -4
  169. package/api/theme-edit/_catalog.mjs +397 -24
  170. package/api/theme-edit/_check.d.mts +153 -2
  171. package/api/theme-edit/_check.mjs +3028 -563
  172. package/api/theme-edit/_color.d.mts +27 -2
  173. package/api/theme-edit/_color.mjs +66 -8
  174. package/api/theme-edit/_compiler.d.mts +7 -2
  175. package/api/theme-edit/_compiler.mjs +335 -21
  176. package/api/theme-edit/_context.d.mts +192 -7
  177. package/api/theme-edit/_context.mjs +750 -70
  178. package/api/theme-edit/_css.d.mts +32 -0
  179. package/api/theme-edit/_css.mjs +121 -34
  180. package/api/theme-edit/_edit.d.mts +68 -5
  181. package/api/theme-edit/_edit.mjs +5119 -667
  182. package/api/theme-edit/_how-commands.d.mts +28 -1
  183. package/api/theme-edit/_how-commands.mjs +621 -17
  184. package/api/theme-edit/_how-question.d.mts +101 -9
  185. package/api/theme-edit/_how-question.mjs +13901 -1282
  186. package/api/theme-edit/_how.d.mts +13 -2
  187. package/api/theme-edit/_how.mjs +389 -32
  188. package/api/theme-edit/_importers.d.mts +38 -0
  189. package/api/theme-edit/_importers.mjs +188 -0
  190. package/api/theme-edit/_missed.d.mts +54 -0
  191. package/api/theme-edit/_missed.mjs +917 -0
  192. package/api/theme-edit/_normal.d.mts +110 -21
  193. package/api/theme-edit/_normal.mjs +700 -105
  194. package/api/theme-edit/_palette.d.mts +77 -0
  195. package/api/theme-edit/_palette.mjs +364 -73
  196. package/api/theme-edit/_part-words.d.mts +39 -0
  197. package/api/theme-edit/_part-words.mjs +191 -0
  198. package/api/theme-edit/_parts.d.mts +74 -4
  199. package/api/theme-edit/_parts.mjs +677 -73
  200. package/api/theme-edit/_preview-app.d.mts +8 -13
  201. package/api/theme-edit/_preview-app.mjs +1189 -559
  202. package/api/theme-edit/_preview.d.mts +151 -10
  203. package/api/theme-edit/_preview.mjs +785 -98
  204. package/api/theme-edit/_project.d.mts +38 -3
  205. package/api/theme-edit/_project.mjs +135 -8
  206. package/api/theme-edit/_settings.d.mts +678 -83
  207. package/api/theme-edit/_settings.mjs +6037 -1051
  208. package/api/theme-edit/_tables.d.mts +43 -3
  209. package/api/theme-edit/_tables.mjs +244 -59
  210. package/api/theme-edit/_vet.d.mts +14 -1
  211. package/api/theme-edit/_vet.mjs +86 -12
  212. package/api/theme-edit/theme-edit.type.d.mts +53 -3
  213. package/api/theme-edit/theme-edit.type.mjs +23 -5
  214. package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
  215. package/api/upgrade/_adapter.mjs +13 -2
  216. package/api/upgrade/upgrade.mjs +16 -1
  217. package/assets/codemods/integration-runner.mjs +1 -1
  218. package/assets/codemods/jscodeshift.d.ts +1 -1
  219. package/assets/codemods/parse.mjs +2 -2
  220. package/assets/codemods/run-codemod.mjs +71 -18
  221. package/assets/codemods/runner.mjs +1 -4
  222. package/assets/component-list.generated.json +1 -1
  223. package/assets/docs/author-a-theme.doc.mjs +1 -0
  224. package/assets/docs/theme.doc.dense.mjs +86 -7
  225. package/assets/docs/theme.doc.mjs +76 -2
  226. package/assets/docs/theme.doc.zh.mjs +61 -1
  227. package/assets/docs/tree/authoring.doc.mjs +1 -0
  228. package/assets/docs/tree/checks.doc.mjs +2 -2
  229. package/assets/docs/tree/cli.doc.mjs +1 -0
  230. package/assets/docs/tree/computer-agent-guide.doc.mjs +1 -1
  231. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  232. package/assets/docs/tree/font-setup.doc.mjs +1 -1
  233. package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
  234. package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
  235. package/assets/docs/tree/global.doc.mjs +1 -0
  236. package/assets/docs/tree/install-once.doc.mjs +1 -1
  237. package/assets/docs/tree/problems.doc.mjs +1 -1
  238. package/assets/docs/tree/render-pages.doc.mjs +2 -2
  239. package/assets/docs/tree/share-a-page.doc.mjs +162 -0
  240. package/assets/docs/tree/single-component.doc.mjs +40 -2
  241. package/assets/docs/tree/updates.doc.mjs +1 -1
  242. package/assets/docs/tree/who-answers.doc.mjs +3 -3
  243. package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
  244. package/assets/docs/use-a-theme.doc.mjs +1 -1
  245. package/assets/docs-routes.generated.json +1 -0
  246. package/assets/docs.generated.json +2 -2
  247. package/assets/search-catalog.generated.json +2 -2
  248. package/assets/self-audit.generated.json +1 -1
  249. package/assets/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -1
  250. package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +4 -4
  251. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsCustomSeparator.tsx +1 -0
  252. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsSupportingVariant.tsx +2 -2
  253. package/assets/templates/blocks/components/Card/CardElevations.tsx +1 -1
  254. package/assets/templates/blocks/components/Card/CardWithInnerLayout.tsx +19 -3
  255. package/assets/templates/blocks/components/Card/ClickableCardWithNestedButton.tsx +11 -1
  256. package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +1 -1
  257. package/assets/templates/blocks/components/Card/SelectableCardMulti.tsx +1 -1
  258. package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +1 -1
  259. package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
  260. package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +8 -0
  261. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +8 -2
  262. package/assets/templates/blocks/components/ChatComposerInput/useChatPasteAsTokenHookUsage.doc.mjs +14 -0
  263. package/assets/templates/blocks/components/ChatComposerInput/useChatPasteAsTokenHookUsage.tsx +32 -0
  264. package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.doc.mjs +14 -0
  265. package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.tsx +43 -0
  266. package/assets/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +1 -0
  267. package/assets/templates/blocks/components/ChatLayout/ChatLayoutShowcase.tsx +1 -1
  268. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleCustomContent.tsx +9 -1
  269. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +12 -2
  270. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +28 -7
  271. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +35 -7
  272. package/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx +1 -1
  273. package/assets/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +20 -4
  274. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +15 -3
  275. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +29 -6
  276. package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -2
  277. package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +1 -1
  278. package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -2
  279. package/assets/templates/blocks/components/Divider/DividerFullBleed.tsx +1 -1
  280. package/assets/templates/blocks/components/Divider/DividerShowcase.tsx +1 -1
  281. package/assets/templates/blocks/components/Divider/DividerVariants.tsx +1 -1
  282. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +23 -4
  283. package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +18 -2
  284. package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +20 -2
  285. package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +16 -2
  286. package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +11 -1
  287. package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +12 -2
  288. package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +1 -1
  289. package/assets/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +1 -1
  290. package/assets/templates/blocks/components/LayoutContent/LayoutContentShowcase.tsx +1 -1
  291. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +17 -3
  292. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterShowcase.tsx +17 -3
  293. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderShowcase.tsx +15 -3
  294. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +9 -2
  295. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +1 -1
  296. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelShowcase.tsx +1 -1
  297. package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +1 -1
  298. package/assets/templates/blocks/components/MultiSelector/MultiSelectorGhostToolbar.tsx +14 -2
  299. package/assets/templates/blocks/components/Outline/OutlineDensity.tsx +2 -0
  300. package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +6 -1
  301. package/assets/templates/blocks/components/Pagination/PaginationVariants.tsx +4 -0
  302. package/assets/templates/blocks/components/Popover/PopoverHookUsage.tsx +17 -2
  303. package/assets/templates/blocks/components/SegmentedControl/SegmentedControlFillLayout.tsx +1 -1
  304. package/assets/templates/blocks/components/Selector/SelectorGhostToolbar.tsx +14 -2
  305. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +8 -1
  306. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +2 -2
  307. package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -0
  308. package/assets/templates/blocks/components/Switch/SwitchWithStatus.tsx +1 -1
  309. package/assets/templates/blocks/components/TabList/TabListTabsFillLayout.tsx +1 -1
  310. package/assets/templates/blocks/components/TabList/TabListTabsWithActions.tsx +12 -1
  311. package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +11 -1
  312. package/assets/templates/blocks/components/Table/TableInCard.tsx +2 -2
  313. package/assets/templates/blocks/components/Text/TextTruncation.tsx +1 -1
  314. package/assets/templates/blocks/components/Text/TextWordBreak.tsx +12 -2
  315. package/assets/templates/blocks/components/Text/TextWrap.tsx +19 -4
  316. package/assets/templates/blocks/components/TextArea/TextAreaCharacterCount.tsx +1 -1
  317. package/assets/templates/blocks/components/TextArea/TextAreaShowcase.tsx +1 -1
  318. package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
  319. package/assets/templates/blocks/components/TextArea/TextAreaValidation.tsx +1 -1
  320. package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +1 -1
  321. package/assets/templates/blocks/components/TextInput/TextInputStatusVariant.tsx +2 -2
  322. package/assets/templates/blocks/components/Timestamp/TimestampAutoFormat.tsx +15 -1
  323. package/assets/templates/blocks/components/Timestamp/TimestampRelativeFormat.tsx +15 -1
  324. package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +8 -0
  325. package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +12 -1
  326. package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +18 -3
  327. package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +6 -0
  328. package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -1
  329. package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +2 -2
  330. package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +9 -0
  331. package/assets/templates/components.generated.json +1 -1
  332. package/assets/templates/pages/ai-chat/page.tsx +102 -6
  333. package/assets/templates/pages/ai-chat-landing/page.tsx +31 -4
  334. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +3 -0
  335. package/assets/templates/pages/canvas-editor/page.tsx +73 -2
  336. package/assets/templates/pages/centered-hero/page.tsx +10 -4
  337. package/assets/templates/pages/course-detail/page.tsx +46 -2
  338. package/assets/templates/pages/dashboard/page.tsx +45 -16
  339. package/assets/templates/pages/dashboard-alert-rail/page.tsx +1 -1
  340. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +32 -21
  341. package/assets/templates/pages/dashboard-comparison/page.tsx +11 -2
  342. package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
  343. package/assets/templates/pages/dashboard-progress/page.tsx +28 -16
  344. package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
  345. package/assets/templates/pages/detail-page/page.tsx +157 -76
  346. package/assets/templates/pages/documentation/page.tsx +15 -2
  347. package/assets/templates/pages/documentation-design/page.tsx +7 -34
  348. package/assets/templates/pages/documentation-technical/page.tsx +122 -65
  349. package/assets/templates/pages/editor/page.tsx +41 -24
  350. package/assets/templates/pages/file-explorer/page.tsx +44 -1
  351. package/assets/templates/pages/form-two-column/page.tsx +2 -3
  352. package/assets/templates/pages/form-wizard/page.tsx +31 -3
  353. package/assets/templates/pages/form-wizard-vertical/page.tsx +55 -6
  354. package/assets/templates/pages/gallery-hero/page.tsx +2 -1
  355. package/assets/templates/pages/ide/page.tsx +23 -0
  356. package/assets/templates/pages/ide/template.doc.mjs +1 -1
  357. package/assets/templates/pages/incident-console/page.tsx +130 -30
  358. package/assets/templates/pages/incident-console/template.doc.mjs +2 -2
  359. package/assets/templates/pages/kanban-board/page.tsx +50 -3
  360. package/assets/templates/pages/login-card/page.tsx +16 -0
  361. package/assets/templates/pages/login-split/page.tsx +19 -6
  362. package/assets/templates/pages/messaging-shell/page.tsx +409 -419
  363. package/assets/templates/pages/messaging-shell/template.doc.mjs +6 -6
  364. package/assets/templates/pages/payment-form/page.tsx +107 -43
  365. package/assets/templates/pages/product-detail/page.tsx +26 -2
  366. package/assets/templates/pages/product-gallery/page.tsx +16 -14
  367. package/assets/templates/pages/settings/page.tsx +35 -3
  368. package/assets/templates/pages/settings-dialog/page.tsx +196 -17
  369. package/assets/templates/pages/settings-sidebar/page.tsx +23 -3
  370. package/assets/templates/pages/shell-nav/page.tsx +28 -12
  371. package/assets/templates/pages/shell-side-nav/page.tsx +27 -4
  372. package/assets/templates/pages/shell-top-nav/page.tsx +27 -1
  373. package/assets/templates/pages/side-gallery/page.tsx +1 -1
  374. package/assets/templates/pages/table/page.tsx +575 -61
  375. package/assets/templates/pages/table/template.doc.mjs +11 -1
  376. package/assets/templates/pages/table-collapsible/page.tsx +1 -1
  377. package/assets/templates/pages/table-comparison/page.tsx +1 -1
  378. package/assets/templates/pages/table-filter/page.tsx +17 -1
  379. package/assets/templates/pages/table-grouped/page.tsx +171 -133
  380. package/assets/templates/pages/table-inbox/page.tsx +60 -1
  381. package/assets/templates/pages/table-page/page.tsx +23 -2
  382. package/assets/templates/pages/table-tree/page.tsx +95 -13
  383. package/assets/templates/pages/theme-showcase/page.tsx +107 -11
  384. package/assets/templates/pages/work-item-detail/page.tsx +134 -80
  385. package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -1
  386. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
  387. package/assets/templates/themes/gothic/gothicTheme.ts +5 -0
  388. package/assets/templates/themes/neutral/neutralTheme.ts +1 -1
  389. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
  390. package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
  391. package/assets/theme.template.ts +3 -2
  392. package/authoring/debug/parse.d.mts +1 -1
  393. package/authoring/doctypes/_schema.d.mts +28 -14
  394. package/authoring/doctypes/_schema.mjs +31 -0
  395. package/authoring/doctypes/command/command.doc.mjs +24 -0
  396. package/authoring/doctypes/command/type.ts +31 -0
  397. package/authoring/doctypes/component/component.doc.mjs +1 -1
  398. package/authoring/doctypes/component/type.ts +8 -5
  399. package/authoring/doctypes/namespace/namespace.doc.mjs +6 -0
  400. package/authoring/doctypes/namespace/type.ts +4 -0
  401. package/authoring/doctypes/template/template.doc.mjs +1 -1
  402. package/authoring/doctypes/template/type.ts +1 -1
  403. package/authoring/index.d.ts +6 -1
  404. package/authoring/integration/integration.doc.mjs +15 -0
  405. package/authoring/integration/schema.d.mts +30 -1
  406. package/authoring/integration/schema.mjs +129 -4
  407. package/authoring/integration/type.ts +48 -0
  408. package/clients/cli/bin/astryx.mjs +9 -3
  409. package/clients/cli/build-id.generated.json +1 -1
  410. package/clients/cli/commands/build.mjs +17 -5
  411. package/clients/cli/commands/component.doc.mjs +1 -0
  412. package/clients/cli/commands/component.mjs +107 -42
  413. package/clients/cli/commands/discover.mjs +70 -3
  414. package/clients/cli/commands/docs.doc.mjs +1 -1
  415. package/clients/cli/commands/docs.mjs +41 -5
  416. package/clients/cli/commands/doctor.mjs +52 -2
  417. package/clients/cli/commands/experimental/index.mjs +4 -1
  418. package/clients/cli/commands/experimental/theme.mjs +1504 -186
  419. package/clients/cli/commands/experimental-render.doc.mjs +18 -5
  420. package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
  421. package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -2
  422. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -0
  423. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -1
  424. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +4 -3
  425. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +3 -2
  426. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +5 -4
  427. package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -0
  428. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -0
  429. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +3 -2
  430. package/clients/cli/commands/experimental-theme-remove.doc.mjs +6 -4
  431. package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -0
  432. package/clients/cli/commands/experimental-theme-template.doc.mjs +1 -0
  433. package/clients/cli/commands/experimental-theme-use.doc.mjs +2 -0
  434. package/clients/cli/commands/gap-report.doc.mjs +1 -0
  435. package/clients/cli/commands/hook.doc.mjs +1 -1
  436. package/clients/cli/commands/init.doc.mjs +1 -1
  437. package/clients/cli/commands/init.mjs +14 -6
  438. package/clients/cli/commands/integration-add.doc.mjs +1 -0
  439. package/clients/cli/commands/manifest.mjs +10 -3
  440. package/clients/cli/commands/search.mjs +13 -1
  441. package/clients/cli/commands/swizzle.doc.mjs +9 -2
  442. package/clients/cli/commands/swizzle.mjs +13 -6
  443. package/clients/cli/commands/template.doc.mjs +4 -1
  444. package/clients/cli/commands/template.mjs +34 -7
  445. package/clients/cli/commands/theme-add.doc.mjs +3 -2
  446. package/clients/cli/commands/theme-build.doc.mjs +11 -2
  447. package/clients/cli/commands/theme-eject.doc.mjs +1 -1
  448. package/clients/cli/commands/theme-list.doc.mjs +1 -1
  449. package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
  450. package/clients/cli/commands/theme-remove.doc.mjs +15 -6
  451. package/clients/cli/commands/theme-targets.doc.mjs +1 -0
  452. package/clients/cli/commands/theme-template.doc.mjs +1 -0
  453. package/clients/cli/commands/theme-use.doc.mjs +2 -1
  454. package/clients/cli/commands/theme.doc.mjs +7 -2
  455. package/clients/cli/commands/theme.mjs +824 -576
  456. package/clients/cli/commands/upgrade.mjs +7 -3
  457. package/clients/cli/index.mjs +177 -78
  458. package/clients/cli/lib/base-gate.mjs +522 -0
  459. package/clients/cli/lib/cli-error.mjs +21 -0
  460. package/clients/cli/lib/command-path.mjs +26 -0
  461. package/clients/cli/lib/define-command.mjs +161 -12
  462. package/clients/cli/lib/json-shim.mjs +679 -40
  463. package/clients/cli/lib/manifest.d.ts +14 -0
  464. package/clients/cli/lib/manifest.mjs +78 -22
  465. package/clients/cli/lib/not-ready.mjs +22 -0
  466. package/clients/cli/lib/root-args.mjs +79 -0
  467. package/clients/cli/lib/stray-option.mjs +491 -0
  468. package/clients/cli/lib/unknown-command.mjs +374 -0
  469. package/clients/cli/manifest.generated.json +1 -1
  470. package/clients/cli/run.mjs +39 -3
  471. package/foundation/agent-docs/agent-docs.mjs +1 -1
  472. package/foundation/agent-docs/computer-agent-text.mjs +1 -1
  473. package/foundation/bases/core-docs.d.mts +10 -0
  474. package/foundation/bases/core-docs.mjs +42 -0
  475. package/foundation/bases/core.d.mts +11 -0
  476. package/foundation/bases/core.mjs +32 -0
  477. package/foundation/bases/requirements.d.mts +128 -0
  478. package/foundation/bases/requirements.mjs +193 -0
  479. package/foundation/bases/resolve.d.mts +134 -0
  480. package/foundation/bases/resolve.mjs +295 -0
  481. package/foundation/bases/state.d.mts +24 -0
  482. package/foundation/bases/state.mjs +46 -0
  483. package/foundation/bases/steps.d.mts +49 -0
  484. package/foundation/bases/steps.mjs +88 -0
  485. package/foundation/config/project.d.mts +22 -0
  486. package/foundation/config/project.mjs +94 -30
  487. package/foundation/config/theme-build-header.d.mts +14 -0
  488. package/foundation/config/theme-build-header.mjs +14 -0
  489. package/foundation/config/theme-private-vars.d.mts +26 -2
  490. package/foundation/config/theme-private-vars.mjs +65 -5
  491. package/foundation/config/theme-state.d.mts +19 -2
  492. package/foundation/config/theme-state.mjs +93 -1
  493. package/foundation/debug/event.d.mts +8 -2
  494. package/foundation/debug/event.mjs +6 -7
  495. package/foundation/debug/recorder.d.mts +8 -1
  496. package/foundation/debug/recorder.mjs +8 -2
  497. package/foundation/discovery/cli-self-doc-names.d.mts +13 -0
  498. package/foundation/discovery/cli-self-doc-names.mjs +51 -0
  499. package/foundation/discovery/cli-self-docs.d.mts +0 -2
  500. package/foundation/discovery/cli-self-docs.mjs +11 -16
  501. package/foundation/discovery/command-pointers.d.mts +28 -0
  502. package/foundation/discovery/command-pointers.mjs +31 -0
  503. package/foundation/discovery/component-discovery.d.mts +9 -8
  504. package/foundation/discovery/component-discovery.mjs +12 -6
  505. package/foundation/discovery/core-component-docs.d.mts +29 -0
  506. package/foundation/discovery/core-component-docs.mjs +83 -0
  507. package/foundation/discovery/core-theme-facts.d.mts +70 -0
  508. package/foundation/discovery/core-theme-facts.mjs +384 -0
  509. package/foundation/discovery/docs-discovery.d.mts +84 -9
  510. package/foundation/discovery/docs-discovery.mjs +151 -60
  511. package/foundation/discovery/entry-name-files.d.mts +72 -9
  512. package/foundation/discovery/entry-name-files.mjs +193 -103
  513. package/foundation/discovery/hook-discovery.d.mts +16 -6
  514. package/foundation/discovery/hook-discovery.mjs +82 -43
  515. package/foundation/discovery/integration-component-views.d.mts +15 -0
  516. package/foundation/discovery/integration-component-views.mjs +91 -0
  517. package/foundation/discovery/module-exports.d.mts +26 -1
  518. package/foundation/discovery/module-exports.mjs +114 -40
  519. package/foundation/discovery/name-roots.d.mts +38 -0
  520. package/foundation/discovery/name-roots.mjs +108 -0
  521. package/foundation/discovery/next-routes.d.mts +48 -0
  522. package/foundation/discovery/next-routes.mjs +197 -0
  523. package/foundation/discovery/stored-self-audit.mjs +2 -0
  524. package/foundation/discovery/template-adapter.d.mts +31 -63
  525. package/foundation/discovery/template-adapter.mjs +38 -207
  526. package/foundation/discovery/template-destination.d.mts +28 -0
  527. package/foundation/discovery/template-destination.mjs +106 -0
  528. package/foundation/discovery/template-ids.d.mts +69 -0
  529. package/foundation/discovery/template-ids.mjs +203 -0
  530. package/foundation/discovery/template-needs.mjs +3 -1
  531. package/foundation/discovery/theme-discovery.d.mts +12 -0
  532. package/foundation/discovery/theme-discovery.mjs +34 -2
  533. package/foundation/discovery/theme-imports.d.mts +10 -0
  534. package/foundation/discovery/theme-imports.mjs +37 -4
  535. package/foundation/discovery/theming-targets.d.mts +13 -5
  536. package/foundation/discovery/theming-targets.mjs +38 -45
  537. package/foundation/doc-compiler/generated-levels.d.mts +43 -0
  538. package/foundation/doc-compiler/generated-levels.mjs +72 -0
  539. package/foundation/doc-compiler/literal-doc.d.mts +12 -0
  540. package/foundation/doc-compiler/literal-doc.mjs +322 -0
  541. package/foundation/doc-compiler/stored-docs.d.mts +7 -0
  542. package/foundation/doc-compiler/stored-docs.mjs +14 -1
  543. package/foundation/doc-compiler/tree.d.mts +18 -87
  544. package/foundation/doc-compiler/tree.mjs +57 -64
  545. package/foundation/env/intl-defaults.d.mts +39 -0
  546. package/foundation/env/intl-defaults.mjs +150 -0
  547. package/foundation/env/intl-now.d.mts +21 -0
  548. package/foundation/env/intl-now.mjs +25 -0
  549. package/foundation/env/package-manager.d.mts +11 -2
  550. package/foundation/env/package-manager.mjs +28 -4
  551. package/foundation/fonts/font-stylesheet.d.mts +38 -0
  552. package/foundation/fonts/font-stylesheet.mjs +128 -12
  553. package/foundation/fs/cache-eviction.d.mts +3 -1
  554. package/foundation/fs/cache-eviction.mjs +7 -1
  555. package/foundation/fs/exact-codec.d.mts +12 -2
  556. package/foundation/fs/exact-codec.mjs +23 -6
  557. package/foundation/fs/file-protection.mjs +12 -2
  558. package/foundation/fs/gather-cache.d.mts +81 -2
  559. package/foundation/fs/gather-cache.mjs +615 -97
  560. package/foundation/fs/glob.d.mts +16 -0
  561. package/foundation/fs/glob.mjs +105 -0
  562. package/foundation/fs/jiti-cache.mjs +14 -6
  563. package/foundation/fs/kept-tree.d.mts +39 -15
  564. package/foundation/fs/kept-tree.mjs +155 -46
  565. package/foundation/fs/loaded-files.d.mts +30 -0
  566. package/foundation/fs/loaded-files.mjs +148 -0
  567. package/foundation/fs/module-loader.d.mts +53 -8
  568. package/foundation/fs/module-loader.mjs +559 -39
  569. package/foundation/fs/own-modules.d.mts +29 -0
  570. package/foundation/fs/own-modules.mjs +57 -0
  571. package/foundation/fs/path-safety.d.mts +34 -2
  572. package/foundation/fs/path-safety.mjs +170 -18
  573. package/foundation/fs/paths.d.mts +41 -2
  574. package/foundation/fs/paths.mjs +95 -5
  575. package/foundation/fs/read-record.d.mts +84 -7
  576. package/foundation/fs/read-record.mjs +333 -56
  577. package/foundation/fs/regular-file.d.mts +29 -0
  578. package/foundation/fs/regular-file.mjs +77 -0
  579. package/foundation/fs/stop-cleanup.d.mts +12 -0
  580. package/foundation/fs/stop-cleanup.mjs +66 -0
  581. package/foundation/fs/stylesheet-file.d.mts +37 -0
  582. package/foundation/fs/stylesheet-file.mjs +48 -0
  583. package/foundation/fs/theme-module-rejections.d.mts +32 -0
  584. package/foundation/fs/theme-module-rejections.mjs +82 -0
  585. package/foundation/integrations/integrations.d.mts +27 -1
  586. package/foundation/integrations/integrations.mjs +24 -2
  587. package/foundation/integrations/pack-state.d.mts +85 -0
  588. package/foundation/integrations/pack-state.mjs +509 -0
  589. package/foundation/integrations/shipped-imports.d.mts +125 -0
  590. package/foundation/integrations/shipped-imports.mjs +530 -0
  591. package/foundation/integrations/validate-contributions.d.mts +0 -17
  592. package/foundation/integrations/validate-contributions.mjs +81 -290
  593. package/foundation/release/choose.d.mts +7 -0
  594. package/foundation/release/choose.mjs +16 -2
  595. package/foundation/release/handoff.mjs +68 -13
  596. package/foundation/release/notices.d.mts +46 -9
  597. package/foundation/release/notices.mjs +78 -20
  598. package/foundation/release/pnp-runtime.d.mts +66 -0
  599. package/foundation/release/pnp-runtime.mjs +139 -0
  600. package/foundation/release/project.d.mts +11 -0
  601. package/foundation/release/project.mjs +23 -7
  602. package/foundation/release/run-context.d.mts +7 -2
  603. package/foundation/release/run-context.mjs +6 -2
  604. package/foundation/render/assets.mjs +52 -7
  605. package/foundation/render/charts.d.mts +78 -27
  606. package/foundation/render/charts.mjs +319 -90
  607. package/foundation/render/css-cut.d.mts +14 -1
  608. package/foundation/render/css-cut.mjs +117 -4
  609. package/foundation/render/cut-short.d.mts +35 -0
  610. package/foundation/render/cut-short.mjs +124 -0
  611. package/foundation/render/embedded-imports.d.mts +31 -0
  612. package/foundation/render/embedded-imports.mjs +169 -39
  613. package/foundation/render/font-probe.d.mts +27 -0
  614. package/foundation/render/font-probe.mjs +77 -0
  615. package/foundation/render/layers.d.mts +49 -0
  616. package/foundation/render/layers.mjs +347 -0
  617. package/foundation/render/offline.d.mts +32 -0
  618. package/foundation/render/offline.mjs +56 -0
  619. package/foundation/render/page-worker.mjs +374 -15
  620. package/foundation/render/picture-chrome.mjs +46 -4
  621. package/foundation/render/picture-playwright.mjs +41 -5
  622. package/foundation/render/picture-window.d.mts +32 -0
  623. package/foundation/render/picture-window.mjs +146 -0
  624. package/foundation/render/render-page.d.mts +46 -4
  625. package/foundation/render/render-page.mjs +453 -98
  626. package/foundation/response/base.d.ts +25 -0
  627. package/foundation/response/error-codes.d.mts +4 -1
  628. package/foundation/response/error-codes.d.ts +4 -1
  629. package/foundation/response/error-codes.doc.mjs +17 -0
  630. package/foundation/response/error-codes.mjs +21 -0
  631. package/foundation/response/json.d.mts +3 -1
  632. package/foundation/response/json.mjs +7 -2
  633. package/foundation/response/response-types.doc.mjs +12 -12
  634. package/foundation/runtime/css-tree.d.mts +24 -0
  635. package/foundation/runtime/css-tree.mjs +103 -0
  636. package/foundation/runtime/lazy-dependencies.d.mts +3 -1
  637. package/foundation/runtime/lazy-dependencies.mjs +20 -5
  638. package/foundation/suggest/name-index.d.mts +149 -0
  639. package/foundation/suggest/name-index.mjs +317 -0
  640. package/foundation/suggest/other-command.d.mts +146 -0
  641. package/foundation/suggest/other-command.mjs +783 -0
  642. package/foundation/text/css-escape.d.mts +18 -0
  643. package/foundation/text/css-escape.mjs +35 -0
  644. package/foundation/text/entry-names.d.mts +14 -0
  645. package/foundation/text/entry-names.mjs +14 -0
  646. package/foundation/text/string-utils.d.mts +49 -5
  647. package/foundation/text/string-utils.mjs +124 -26
  648. package/foundation/text/suggest-order.d.mts +75 -4
  649. package/foundation/text/suggest-order.mjs +285 -9
  650. package/foundation/text/written-string.d.mts +17 -0
  651. package/foundation/text/written-string.mjs +22 -0
  652. package/foundation/xle/browser.d.mts +2 -2
  653. package/package.json +8 -7
@@ -33,6 +33,7 @@
33
33
 
34
34
  import {writeThemeTemplate} from '../theme/template/template.mjs';
35
35
  import {
36
+ blankOptionProblem,
36
37
  buildInputProblem,
37
38
  buildSuggestion,
38
39
  realLocation,
@@ -40,16 +41,26 @@ import {
40
41
  } from '../theme/build/build.mjs';
41
42
  import {createHash} from 'node:crypto';
42
43
  import * as fs from 'node:fs';
43
- import {createRequire} from 'node:module';
44
44
  import * as path from 'node:path';
45
45
  import * as edit from './_edit.mjs';
46
- import {baseInstalled, themeCacheRoot} from './_project.mjs';
46
+ import {
47
+ baseInstalled,
48
+ installLine,
49
+ packageInstalled,
50
+ themeCacheRoot,
51
+ } from './_project.mjs';
47
52
  import * as preview from './_preview-app.mjs';
48
53
  import {AstryxError} from '../error.mjs';
49
54
  import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
50
55
  import {findPackageRoot} from '../../foundation/fs/paths.mjs';
51
- import {context, coreApp} from './_context.mjs';
56
+ import {
57
+ baseWeightNotes,
58
+ context,
59
+ coreApp,
60
+ loneFamilyNotes,
61
+ } from './_context.mjs';
52
62
  import {APP_COPY_MARK} from './_marks.mjs';
63
+ import {irregularFileKind} from '../../foundation/fs/regular-file.mjs';
53
64
  import {
54
65
  fontKey,
55
66
  importedFontFamilies,
@@ -65,6 +76,7 @@ import {LIKE, P} from './_tables.mjs';
65
76
  /** The preview command, as a person runs it. */
66
77
  const PREVIEW_WORDS = P.replace(/ editor$/, ' preview');
67
78
  import {setLine} from './_check.mjs';
79
+ export {modeDialValue} from './_check.mjs';
68
80
  import {followLine, splitCommand} from './_vet.mjs';
69
81
  import {
70
82
  SHOWCASE_GROUPS,
@@ -80,11 +92,13 @@ import {
80
92
  buildColorModes,
81
93
  camel,
82
94
  folderIsEmpty,
95
+ editorMadeFolder,
83
96
  loadTheme,
84
97
  setAfterBuild,
85
98
  editedThemes,
86
99
  themeFiles,
87
100
  fontsourcePackageOf,
101
+ fontsourceSuggestion,
88
102
  themeSourceRefusal,
89
103
  typedThemeName,
90
104
  } from './_settings.mjs';
@@ -94,7 +108,13 @@ setAfterBuild(writeAppCopy);
94
108
  import {LOCAL_THEME_ROOT} from '../../foundation/config/theme-state.mjs';
95
109
 
96
110
  export {parsePoints} from './_how.mjs';
97
- export {newFlagList} from './_edit.mjs';
111
+ export {
112
+ newFlagList,
113
+ checkedChangeLine as editorCheckedLine,
114
+ checkedNewLines as editorCheckedNewLines,
115
+ checkedShowLines as editorCheckedShowLines,
116
+ } from './_edit.mjs';
117
+ export {splitCommand} from './_vet.mjs';
98
118
  import {themeEditHow as howAt} from './_how.mjs';
99
119
 
100
120
  /**
@@ -145,7 +165,19 @@ export const editorBaseIn = (slug, cwd) =>
145
165
  /** The sections `show --section` takes. */
146
166
  export const showSections = () => [...SHOWCASE_GROUPS];
147
167
 
148
- export {dialValueFits} from './_settings.mjs';
168
+ /**
169
+ * A free folder for a new starter app here, the one `preview app`'s own
170
+ * refusals offer.
171
+ * @param {string} cwd
172
+ */
173
+ export const editorFreeAppFolder = cwd => preview.freeAppFolder(cwd);
174
+
175
+ export {
176
+ dialTakesText,
177
+ dialValueFits,
178
+ slugOk as editorNameOk,
179
+ usableNewName as editorFreeName,
180
+ } from './_settings.mjs';
149
181
 
150
182
  /**
151
183
  * The project a command acts on: the Astryx project at or above `cwd`, found
@@ -419,14 +451,14 @@ function absolute(result, root, from) {
419
451
  /^themes\/\S*$/.test(v) && !(key && PROSE.has(key))
420
452
  ? path.join(root, v)
421
453
  : key && PROSE.has(key)
422
- ? v.replace(
454
+ ? previewCommandsFrom(v, root, from).replace(
423
455
  /(^|[\s(,])((?:themes|src|app)\/[^\s,;)]*)/g,
424
456
  (all, before, file) =>
425
457
  /^themes\//.test(file) || inRoot(file)
426
458
  ? `${before}${path.join(root, file)}`
427
459
  : all,
428
460
  )
429
- : v
461
+ : previewCommandsFrom(v, root, from)
430
462
  : Array.isArray(v)
431
463
  ? v.map(x => map(x, key))
432
464
  : v && typeof v === 'object'
@@ -481,6 +513,23 @@ async function inProject(options, lock, fn, bestEffort = false, again = null) {
481
513
  */
482
514
  function fromCaller(e, root, from) {
483
515
  if (path.resolve(from) === root || !Array.isArray(e?.suggestions)) return e;
516
+ for (const s of e.suggestions)
517
+ if (typeof s?.name === 'string')
518
+ s.name = previewCommandsFrom(s.name, root, from);
519
+ return e;
520
+ }
521
+
522
+ /**
523
+ * The preview commands in a line, rebased from the project root onto the
524
+ * folder the command ran in: each `--path` and each `preview app` folder,
525
+ * so a pointer works where it is printed (in a refusal, a `see` line, a
526
+ * note). A folder that comes out starting with `-` goes after `--`.
527
+ * @param {string} line
528
+ * @param {string} root
529
+ * @param {string} from
530
+ */
531
+ export function previewCommandsFrom(line, root, from) {
532
+ if (path.resolve(from) === root) return line;
484
533
  const ARG = String.raw`('(?:[^']|'\\'')*'|"[^"]*"|[^\s'"]+)`;
485
534
  /** @param {string} v */
486
535
  const unquote = v =>
@@ -493,32 +542,40 @@ function fromCaller(e, root, from) {
493
542
  const rel = v =>
494
543
  /^<.*>$/.test(v)
495
544
  ? v
496
- : quoteCommandArgument(
497
- path.relative(path.resolve(from), path.resolve(root, unquote(v))) ||
498
- '.',
499
- );
500
- for (const s of e.suggestions) {
501
- if (typeof s?.name !== 'string') continue;
502
- if (!s.name.startsWith('astryx experimental theme preview ')) continue;
503
- s.name = s.name
504
- .replace(
545
+ : path.relative(path.resolve(from), path.resolve(root, unquote(v))) ||
546
+ '.';
547
+ const CMD = 'astryx experimental theme preview ';
548
+ const parts = line.split(CMD);
549
+ return parts
550
+ .map((part, i) => {
551
+ // A command after a `cd … &&` runs in the folder it names: as given.
552
+ if (i === 0 || /\bcd [^&]*&& (?:npx \S+ )?$/.test(parts[i - 1]))
553
+ return part;
554
+ let out = part.replace(
505
555
  new RegExp(`(--path )${ARG}`, 'g'),
506
556
  (
507
557
  /** @type {string} */ _m,
508
558
  /** @type {string} */ flag,
509
559
  /** @type {string} */ v,
510
- ) => flag + rel(v),
511
- )
512
- .replace(
513
- new RegExp(`^(astryx experimental theme preview app )${ARG}`),
560
+ ) => flag + quoteCommandArgument(rel(v)),
561
+ );
562
+ out = out.replace(
563
+ new RegExp(`^app ((?:--theme ${ARG} )?)(-- )?${ARG}`),
514
564
  (
515
- /** @type {string} */ _m,
516
- /** @type {string} */ cmd,
565
+ /** @type {string} */ m,
566
+ /** @type {string} */ flags,
567
+ /** @type {string} */ _t,
568
+ /** @type {string | undefined} */ dash,
517
569
  /** @type {string} */ v,
518
- ) => cmd + rel(v),
570
+ ) => {
571
+ if (!dash && v.startsWith('-')) return m;
572
+ const r = rel(v);
573
+ return `app ${flags}${r.startsWith('-') ? '-- ' : ''}${quoteCommandArgument(r)}`;
574
+ },
519
575
  );
520
- }
521
- return e;
576
+ return out;
577
+ })
578
+ .join(CMD);
522
579
  }
523
580
 
524
581
  /**
@@ -620,7 +677,8 @@ export const themeEditPreviewAdd = (description, options = {}) =>
620
677
  * saying where the change stands (a change stopped part way is finished by
621
678
  * the next preview command), never an ok with exit 0.
622
679
  * @template T
623
- * @param {string} where where the change stands, and what finishes it
680
+ * @param {string | (() => string)} where where the change stands, and what
681
+ * finishes it; a function is asked when the stop lands, so it can look
624
682
  * @param {() => Promise<T>} fn
625
683
  * @returns {Promise<T>}
626
684
  */
@@ -628,7 +686,9 @@ async function stopTold(where, fn) {
628
686
  const on = (/** @type {NodeJS.Signals} */ sig) => {
629
687
  process.removeListener('SIGINT', on);
630
688
  process.removeListener('SIGTERM', on);
631
- process.stderr.write(`Stopped: ${where}.\n`);
689
+ process.stderr.write(
690
+ `Stopped: ${typeof where === 'function' ? where() : where}.\n`,
691
+ );
632
692
  // With no other listener (a lock's, which ends the process itself),
633
693
  // the stop ends it here.
634
694
  if (process.listenerCount(sig) === 0) process.kill(process.pid, sig);
@@ -657,9 +717,23 @@ async function stopTold(where, fn) {
657
717
  */
658
718
  export const themeEditPreviewApp = async (dir, options = {}) => {
659
719
  const from = options.cwd ?? process.cwd();
720
+ // The app is written into a temp folder and moved into place in one step,
721
+ // with no pause on the way: when a stop lands, the folder holds the whole
722
+ // app or is as it was. Which one is told.
723
+ const target =
724
+ typeof dir === 'string' && dir.trim() ? path.resolve(from, dir) : null;
725
+ /** @param {string} d */
726
+ const holdsApp = d => fs.existsSync(path.join(d, 'package.json'));
727
+ const hadApp = target != null && holdsApp(target);
728
+ const shownTarget = target
729
+ ? path.relative(from, target).split(path.sep).join('/') || '.'
730
+ : null;
660
731
  return fromHere(
661
732
  await stopTold(
662
- `the new app may be part made; ${PREVIEW_WORDS} app with a new folder name makes a whole one`,
733
+ () =>
734
+ target && !hadApp && holdsApp(target)
735
+ ? `the new app in ${shownTarget}/ is written whole (it is moved into place in one step); cd ${quoteCommandArgument(shownTarget?.startsWith('-') ? `./${shownTarget}` : (shownTarget ?? '.'))} && npm install && npm run dev opens it`
736
+ : `nothing was written${shownTarget ? ` (${shownTarget}/ is as it was)` : ''}; run the same command again`,
663
737
  () =>
664
738
  inProject(
665
739
  options,
@@ -727,11 +801,15 @@ export const themeEditPreviewRemove = (page, options = {}) =>
727
801
  * does not).
728
802
  * @param {string} root
729
803
  * @param {string} word a path or a name
804
+ * @param {{made?: boolean}} [options] `made`: a folder the editor made that
805
+ * lost its settings counts too (the editor commands refuse it, and so
806
+ * does compile)
730
807
  * @returns {{root: string, slug: string} | null}
731
808
  */
732
- function editorThemeAt(root, word) {
809
+ function editorThemeAt(root, word, {made = false} = {}) {
733
810
  const has = (/** @type {string} */ r, /** @type {string} */ slug) =>
734
- fs.existsSync(path.join(r, 'themes', slug, `${slug}.settings.json`));
811
+ fs.existsSync(path.join(r, 'themes', slug, `${slug}.settings.json`)) ||
812
+ (made && editorMadeFolder(r, slug));
735
813
  if (/^[a-z][a-z0-9-]*$/.test(word))
736
814
  return has(root, word) ? {root, slug: word} : null;
737
815
  // Through a link, the real path decides (a linked theme folder is the
@@ -893,7 +971,9 @@ export function editorThemeRefusal(err, cwd) {
893
971
  }
894
972
 
895
973
  /** The shared typo rule, for a typed subcommand. */
896
- export {typoOf} from './_normal.mjs';
974
+ export {booleanWord, typoNear, typoOf} from './_normal.mjs';
975
+ // How a setting is named in a result: one wording for the API and the CLI.
976
+ export {describe, namesSetting, needsPart} from './_settings.mjs';
897
977
 
898
978
  /**
899
979
  * The editor themes of the app the folder `cwd` is in, by name; none when
@@ -1015,6 +1095,32 @@ export async function editorCompileProblem(
1015
1095
  ) {
1016
1096
  const cwdRoot = projectRoot(cwd);
1017
1097
  const COMPILE = {group: 'experimental theme', build: 'compile'};
1098
+ // An empty or blank --out or --icons-specifier names nothing: refused
1099
+ // before anything is built, with the compile without it.
1100
+ const blank =
1101
+ blankOptionProblem(
1102
+ '--out',
1103
+ out,
1104
+ 'name a file or folder, or leave out --out to write beside the source',
1105
+ buildSuggestion(
1106
+ files.length === 1 ? files[0] : files,
1107
+ {check, iconsSpecifier},
1108
+ cwd,
1109
+ COMPILE,
1110
+ ),
1111
+ ) ??
1112
+ blankOptionProblem(
1113
+ '--icons-specifier',
1114
+ iconsSpecifier,
1115
+ "name the registry module, or leave out --icons-specifier to keep the theme source's own import",
1116
+ buildSuggestion(
1117
+ files.length === 1 ? files[0] : files,
1118
+ {check, out},
1119
+ cwd,
1120
+ COMPILE,
1121
+ ),
1122
+ );
1123
+ if (blank) return blank;
1018
1124
  /**
1019
1125
  * The compile of `source` (from `from`) with the caller's mode: a check
1020
1126
  * stays a check, and --out names the same file from there.
@@ -1065,16 +1171,17 @@ export async function editorCompileProblem(
1065
1171
  // built (the module rewritten, the stylesheet not) and the copy made from
1066
1172
  // it.
1067
1173
  if (out) {
1068
- // Any --out in the copy folder, the folder itself too, in any case,
1069
- // written with backslashes or through a link, as the build reads it.
1174
+ // Any --out in the copy folder, the folder itself too, written with
1175
+ // backslashes, through a link or (on a case-insensitive disk) in
1176
+ // another case, as the build reads it: real paths name the folder as
1177
+ // the disk does.
1070
1178
  const rel = path
1071
1179
  .relative(
1072
1180
  realLocation(cwdRoot),
1073
1181
  realLocation(path.resolve(cwd, slashed(out))),
1074
1182
  )
1075
1183
  .split(path.sep)
1076
- .filter(Boolean)
1077
- .map(x => x.toLowerCase());
1184
+ .filter(Boolean);
1078
1185
  const inCopy =
1079
1186
  rel[0] === 'src' &&
1080
1187
  rel[1] === 'themes' &&
@@ -1171,11 +1278,22 @@ export async function editorCompileProblem(
1171
1278
  );
1172
1279
  }
1173
1280
  // Its source too: a compile of the copy builds neither the theme
1174
- // nor a current copy.
1281
+ // nor a current copy. The compile offered is the one this check
1282
+ // takes (an --out in the theme's own folder is refused there, and its
1283
+ // refusal's line is offered instead).
1284
+ const ownRefused = await editorCompileProblem([own], {
1285
+ cwd,
1286
+ check,
1287
+ family,
1288
+ iconsSpecifier,
1289
+ out,
1290
+ });
1175
1291
  return new AstryxError(
1176
1292
  `${file} is ${relParts.length === 3 ? '' : 'part of '}${t}'s app copy, which the editor writes from themes/${t}/ after every build; compile the theme itself.`,
1177
1293
  [
1178
- {name: compileLine(own, cwd), reason: 'do this instead'},
1294
+ ...(ownRefused?.suggestions?.length
1295
+ ? ownRefused.suggestions
1296
+ : [{name: compileLine(own, cwd), reason: 'do this instead'}]),
1179
1297
  {
1180
1298
  name: runLine(cwdRoot, `experimental theme editor show ${t}`),
1181
1299
  reason: 'writes the app copy again from the theme',
@@ -1184,9 +1302,21 @@ export async function editorCompileProblem(
1184
1302
  ERROR_CODES.ERR_INVALID_ARGUMENT,
1185
1303
  );
1186
1304
  }
1187
- const at = editorThemeAt(cwdRoot, abs);
1305
+ const at = editorThemeAt(cwdRoot, abs, {made: true});
1188
1306
  if (!at || !editorOwnFile(at.slug, file)) continue;
1189
1307
  const {root, slug} = at;
1308
+ // An editor theme that lost its settings is refused as every editor
1309
+ // command refuses it, with the line that makes it again: a plain build
1310
+ // of it would drop the editor's settings and app copy.
1311
+ if (
1312
+ !fs.existsSync(path.join(root, 'themes', slug, `${slug}.settings.json`))
1313
+ )
1314
+ try {
1315
+ loadTheme(root, slug);
1316
+ } catch (e) {
1317
+ if (e instanceof AstryxError) return e;
1318
+ throw e;
1319
+ }
1190
1320
  const source = `themes/${slug}/${slug}.theme.ts`;
1191
1321
  // An editor theme is built from its project's root, as every editor
1192
1322
  // command runs there: from a subfolder the build would write outside
@@ -1250,8 +1380,9 @@ export async function editorCompileProblem(
1250
1380
  );
1251
1381
  } catch (e) {
1252
1382
  // A settings file damaged by hand is refused like any refusal,
1253
- // never as a raw error.
1254
- if (e instanceof AstryxError) return e;
1383
+ // never as a raw error, with the lines every command gives it.
1384
+ if (e instanceof AstryxError)
1385
+ return edit.editorSavedRefusal(e, root, slug);
1255
1386
  throw e;
1256
1387
  }
1257
1388
  // An own change to the theme source is what compile builds (and what
@@ -1263,12 +1394,10 @@ export async function editorCompileProblem(
1263
1394
  )
1264
1395
  )
1265
1396
  why = null;
1266
- // A missing built output is one compile writes itself.
1267
- if (
1268
- why &&
1269
- !check &&
1270
- /^[^/]+\.(css|js|d\.ts|css\.d\.ts) was missing$/.test(why)
1271
- )
1397
+ // A missing built output is one compile writes itself, and one a
1398
+ // check names in its own result (the stale outputs, upToDate false):
1399
+ // never a reason to refuse either.
1400
+ if (why && /^[^/]+\.(css|js|d\.ts|css\.d\.ts) was missing$/.test(why))
1272
1401
  why = null;
1273
1402
  // Saved settings the editor no longer accepts: show refuses them too,
1274
1403
  // so the refusal names the undo that removes each.
@@ -1315,6 +1444,36 @@ const COMPILE_HELD = new Set();
1315
1444
  /** @type {((refused?: boolean) => Promise<void>) | null} The release of the running compile's hold; `refused`: it wrote nothing, so no app copy either. */
1316
1445
  let releaseCompileHold = null;
1317
1446
 
1447
+ /** @type {Array<{root: string, slug: string, copy: (refused: boolean) => boolean, report: () => Record<string, unknown> | null}>} The running compile's held themes. */
1448
+ let compileHoldItems = [];
1449
+
1450
+ /**
1451
+ * For `compile`, once its outputs are written: write each held editor
1452
+ * theme's app copy now, and say per file what the write did (`appCopy` on
1453
+ * a first write, `appCopyStale` when something keeps the copy behind), so
1454
+ * the JSON result carries what the text says.
1455
+ * @param {string[]} files
1456
+ * @param {string} cwd
1457
+ * @returns {Promise<Record<string, Record<string, unknown>>>}
1458
+ */
1459
+ export async function editorAfterBuild(files, cwd) {
1460
+ const root = projectRoot(cwd);
1461
+ /** @type {Record<string, Record<string, unknown>>} */
1462
+ const out = {};
1463
+ for (const item of compileHoldItems) {
1464
+ item.copy(false);
1465
+ const report = item.report();
1466
+ if (!report) continue;
1467
+ for (const file of files) {
1468
+ const abs = path.resolve(cwd, file);
1469
+ const own = editorThemeAt(root, abs);
1470
+ if (own?.slug === item.slug && editorOwnFile(own.slug, file))
1471
+ out[file] = report;
1472
+ }
1473
+ }
1474
+ return out;
1475
+ }
1476
+
1318
1477
  /**
1319
1478
  * Hold the theme lock of every editor theme among the files while
1320
1479
  * `compile` builds or checks them, so it never reads a change half
@@ -1339,8 +1498,9 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
1339
1498
  if (copy) found.set(`${copy.root}\0${copy.slug}`, copy);
1340
1499
  }
1341
1500
  const themes = [...found.keys()].sort().map(k => found.get(k));
1342
- /** @type {Array<{copy: (refused: boolean) => boolean, finish: (later: boolean) => Promise<void>}>} */
1501
+ /** @type {Array<{root: string, slug: string, copy: (refused: boolean) => boolean, report: () => Record<string, unknown> | null, finish: (later: boolean) => Promise<void>}>} */
1343
1502
  const releases = [];
1503
+ compileHoldItems = releases;
1344
1504
  // Every theme's copy is written first, at once (a refusal ends the run
1345
1505
  // without waiting), then each lock goes.
1346
1506
  const releaseAll = async (refused = false) => {
@@ -1373,6 +1533,11 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
1373
1533
  // An --out elsewhere builds neither themes/<theme>/ nor its copy.
1374
1534
  const skipped = outSkipsCopy(root, slug, cwd, {check, out});
1375
1535
  let ran = false;
1536
+ let copied = false;
1537
+ /** @type {string[] | null} */
1538
+ let firstWrite = null;
1539
+ /** @type {string | null} */
1540
+ let keptBack = null;
1376
1541
  /** @type {any} */
1377
1542
  let copyCtx = null;
1378
1543
  try {
@@ -1402,7 +1567,13 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
1402
1567
  // a later theme did; one that was refused or failed keeps its copy.
1403
1568
  // True when the copy still needs its font stylesheet from the
1404
1569
  // theme's settings (written in finish).
1570
+ root,
1571
+ slug,
1405
1572
  copy: (/** @type {boolean} */ refused) => {
1573
+ // Once per run: after the build's writes when the command asks
1574
+ // (its result then says what the copy write did), else at release.
1575
+ if (copied) return false;
1576
+ copied = true;
1406
1577
  ran = !refused && (process.exitCode ?? 0) === 0;
1407
1578
  if (check || skipped) return false;
1408
1579
  // This run built the theme: its module and stylesheet, one unit,
@@ -1430,25 +1601,33 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
1430
1601
  // A theme that does not load keeps its copy as it was.
1431
1602
  }
1432
1603
  }
1604
+ // What the write did, for the result and the text alike: the
1605
+ // files of a first write, or what keeps the copy behind.
1606
+ firstWrite = takeFirstAppCopy(root, slug);
1607
+ keptBack = appCopyStale(root, slug).appCopyStale ?? null;
1433
1608
  return false;
1434
1609
  },
1610
+ report: () =>
1611
+ firstWrite || keptBack
1612
+ ? {
1613
+ ...(firstWrite ? {appCopy: {wrote: firstWrite}} : {}),
1614
+ ...(keptBack ? {appCopyStale: keptBack} : {}),
1615
+ }
1616
+ : null,
1435
1617
  finish: async () => {
1436
1618
  // Said only after a build or check that ran: a refused one wrote
1437
1619
  // and checked nothing.
1438
1620
  if (skipped) {
1439
1621
  if (ran) humanWarn(skipped);
1440
1622
  } else if (!check) {
1441
- // The first write of the app copy is named once (the compile's
1442
- // own JSON envelope is the stable command's).
1443
- const wrote = takeFirstAppCopy(root, slug);
1444
- if (wrote)
1623
+ // The first write of the app copy is named once.
1624
+ if (firstWrite)
1445
1625
  humanWarn(
1446
- `wrote ${slug}'s app copy, a local theme \`theme add ${slug}\` takes, written again after every build: ${wrote.join(', ')}`,
1626
+ `wrote ${slug}'s app copy, a local theme \`theme add ${slug}\` takes, written again after every build: ${firstWrite.join(', ')}`,
1447
1627
  );
1448
1628
  // A copy a file or a link keeps behind, or one that could not be
1449
1629
  // written, is said, as set and show say it.
1450
- const stale = appCopyStale(root, slug).appCopyStale;
1451
- if (stale) humanWarn(stale);
1630
+ if (keptBack) humanWarn(keptBack);
1452
1631
  }
1453
1632
  release();
1454
1633
  await done;
@@ -1458,13 +1637,98 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
1458
1637
  return releaseAll;
1459
1638
  }
1460
1639
 
1640
+ /**
1641
+ * For `compile` of an editor theme's own source: how the app takes the
1642
+ * theme, in place of importing the build's own outputs. The app takes its
1643
+ * app copy (src/themes/<t>/, written after every build, with the font
1644
+ * stylesheet that loads the theme's fonts), which `theme add` wires in.
1645
+ * Null for any other file.
1646
+ * @param {string} file the path as given
1647
+ * @param {string} cwd
1648
+ * @returns {string | null}
1649
+ */
1650
+ export function editorInstall(file, cwd) {
1651
+ const root = projectRoot(cwd);
1652
+ const at = editorThemeAt(root, path.resolve(cwd, file));
1653
+ if (!at || path.basename(file) !== `${at.slug}.theme.ts`) return null;
1654
+ return `Install in your app: the editor writes ${at.slug}'s app copy in src/themes/${at.slug}/ after every build (its module, stylesheet and font stylesheet), and the app takes that copy, not themes/${at.slug}/. Wire it in once:
1655
+
1656
+ ${runLine(root, `theme add ${at.slug}`)}`;
1657
+ }
1658
+
1659
+ /**
1660
+ * For `compile` of an editor theme's own source: how to load a family the
1661
+ * build names, as the editor says it (the app copy imports a family's
1662
+ * installed Fontsource package); null for any other file.
1663
+ * @param {string} file the path as given
1664
+ * @param {string} cwd
1665
+ * @returns {import('../theme/build/build.mjs').FontHelp | null}
1666
+ */
1667
+ export function editorFontHelp(file, cwd) {
1668
+ const root = projectRoot(cwd);
1669
+ const at = editorThemeAt(root, path.resolve(cwd, file));
1670
+ if (!at || path.basename(file) !== `${at.slug}.theme.ts`) return null;
1671
+ const copy = `src/themes/${at.slug}/${at.slug}.fonts.css`;
1672
+ /** @param {string} family */
1673
+ const notice = family => {
1674
+ const s = fontsourceSuggestion(family);
1675
+ return s
1676
+ ? `Font "${family}" is named by this theme but not loaded; ${s.known ? '' : 'if Fontsource publishes it, '}${installLine(root, [s.pkg])} installs its package, which ${copy} then imports`
1677
+ : `Font "${family}" is named by this theme but not loaded, and no font package is named for it: the app must load it, or it falls back`;
1678
+ };
1679
+ return {
1680
+ notice,
1681
+ recipe: families => {
1682
+ const all = families.map(fontsourceSuggestion).filter(s => s !== null);
1683
+ // Packages the editor knows Fontsource publishes go on one install
1684
+ // line; a name it cannot vouch for gets its own, so one that does
1685
+ // not exist never stops the others installing.
1686
+ const known = all.filter(s => s.known).map(s => s.pkg);
1687
+ const guessed = all.filter(s => !s.known).map(s => s.pkg);
1688
+ const lines = [
1689
+ ...(known.length ? [installLine(root, known)] : []),
1690
+ ...guessed.map(
1691
+ pkg => `${installLine(root, [pkg])} (if Fontsource publishes it)`,
1692
+ ),
1693
+ ];
1694
+ return ` The built CSS only sets font-family. ${at.slug}'s app copy loads a family
1695
+ once its package is installed, importing it in ${copy} on the next
1696
+ compile, set or show:
1697
+ ${lines.length ? `\n${lines.map(l => ` ${l}`).join('\n')}\n` : '\n (no Fontsource package is named for these families: load them in your app)\n'}
1698
+ Recipe and fallback-stack guidance: ${runLine(root, 'docs typography')}
1699
+ `;
1700
+ },
1701
+ };
1702
+ }
1703
+
1704
+ /**
1705
+ * For `compile`: the path an editor theme's own file builds under when it
1706
+ * was named through a link (its real path, which every output's header
1707
+ * names and `--check` compares); null for any other file.
1708
+ * @param {string} file the path as given
1709
+ * @param {string} cwd
1710
+ * @returns {string | null}
1711
+ */
1712
+ export function editorSourcePath(file, cwd) {
1713
+ const abs = path.resolve(cwd, slashed(file));
1714
+ const realCwd = realLocation(cwd);
1715
+ const real = realLocation(abs);
1716
+ if (real === path.join(realCwd, path.relative(cwd, abs))) return null;
1717
+ const at = editorThemeAt(projectRoot(cwd), real);
1718
+ if (!at || !editorOwnFile(at.slug, real)) return null;
1719
+ return path.relative(realCwd, real) || null;
1720
+ }
1721
+
1461
1722
  /** @param {string} p a path as typed, with Windows separators read as `/` */
1462
1723
  const slashed = p => String(p).replace(/\\/g, '/');
1463
1724
 
1464
1725
  /**
1465
- * Whether --out names an editor theme's default output (its folder, or
1466
- * its stylesheet there), where the build writes without --out; no --out
1467
- * counts.
1726
+ * Whether --out names an editor theme's default output, where the build
1727
+ * writes without --out: its folder, or its stylesheet file there (the same
1728
+ * file, as the file system tells files apart: a name that differs only in
1729
+ * case is another file on a case-sensitive disk). A folder form (a
1730
+ * trailing slash) names a folder, so it is the default only as the theme's
1731
+ * folder. No --out counts.
1468
1732
  * @param {string} root the app root
1469
1733
  * @param {string} slug
1470
1734
  * @param {string} cwd
@@ -1472,12 +1736,27 @@ const slashed = p => String(p).replace(/\\/g, '/');
1472
1736
  */
1473
1737
  function outIsDefault(root, slug, cwd, out) {
1474
1738
  if (!out) return true;
1475
- const at = realLocation(path.resolve(cwd, slashed(out)));
1476
- const dir = realLocation(themeFiles(root, slug).dir);
1477
- return (
1478
- at.toLowerCase() === dir.toLowerCase() ||
1479
- at.toLowerCase() === path.join(dir, `${slug}.css`).toLowerCase()
1480
- );
1739
+ const typed = slashed(out);
1740
+ const at = path.resolve(cwd, typed);
1741
+ const f = themeFiles(root, slug);
1742
+ if (sameFile(at, f.dir)) return true;
1743
+ return !typed.endsWith('/') && sameFile(at, f.css);
1744
+ }
1745
+
1746
+ /**
1747
+ * Whether two paths name one file: the same file on disk when both are
1748
+ * there, else the same real path.
1749
+ * @param {string} a
1750
+ * @param {string} b
1751
+ */
1752
+ function sameFile(a, b) {
1753
+ try {
1754
+ const x = fs.statSync(a);
1755
+ const y = fs.statSync(b);
1756
+ return x.dev === y.dev && x.ino === y.ino;
1757
+ } catch {
1758
+ return realLocation(a) === realLocation(b);
1759
+ }
1481
1760
  }
1482
1761
 
1483
1762
  /**
@@ -1501,6 +1780,9 @@ function outSkipsCopy(root, slug, cwd, {check, out}) {
1501
1780
  * @param {string} file
1502
1781
  */
1503
1782
  function isCopyFile(file) {
1783
+ // A pipe or a device there is never opened: it stands where the copy's
1784
+ // file goes.
1785
+ if (irregularFileKind(file)) return true;
1504
1786
  try {
1505
1787
  const head = fs.readFileSync(file, 'utf8').slice(0, 600);
1506
1788
  return (
@@ -1536,7 +1818,7 @@ function appCopyTheme(root, file) {
1536
1818
  * copy.
1537
1819
  * @param {string} file the path as given
1538
1820
  * @param {string} cwd
1539
- * @param {{check: boolean, upToDate?: boolean, out?: string}} opts
1821
+ * @param {{check: boolean, upToDate?: boolean, out?: string, iconsSpecifier?: string}} opts
1540
1822
  * `upToDate`: the check's own verdict on the theme's outputs
1541
1823
  * @returns {Promise<Record<string, unknown> | null>}
1542
1824
  */
@@ -1552,6 +1834,36 @@ export async function editorBuildExtra(file, cwd, opts) {
1552
1834
  const skipped = outSkipsCopy(root, slug, cwd, opts);
1553
1835
  if (skipped) return {appCopySkipped: skipped};
1554
1836
  }
1837
+ if (!opts.check) {
1838
+ // Every set and show builds the theme again from its source, without
1839
+ // --icons-specifier: said, with the change that keeps it.
1840
+ const warnings = opts.iconsSpecifier
1841
+ ? [
1842
+ `${slug} is a theme the editor made: every set and show builds it again from themes/${slug}/${slug}.theme.ts without --icons-specifier, which puts the theme's own import of the registry back. To keep this one, import the registry from its package in ${slug}.theme.ts.`,
1843
+ ]
1844
+ : [];
1845
+ // What show says of the source's own type on phones, said by the
1846
+ // compile that builds the app copy from it too.
1847
+ /** @type {string[]} */
1848
+ let notices;
1849
+ try {
1850
+ const data = loadTheme(root, slug);
1851
+ notices = [
1852
+ ...edit.ownPhoneNotes(root, slug, data),
1853
+ // A weight the base theme's font stylesheet does not load.
1854
+ ...baseWeightNotes(await context(root), data),
1855
+ // A font role built as one family with no fallback.
1856
+ ...loneFamilyNotes(await context(root), data),
1857
+ ];
1858
+ } catch {
1859
+ notices = [];
1860
+ }
1861
+ if (warnings.length || notices.length)
1862
+ return {
1863
+ ...(warnings.length ? {warnings} : {}),
1864
+ ...(notices.length ? {notices} : {}),
1865
+ };
1866
+ }
1555
1867
  if (opts.check) {
1556
1868
  // A theme output that is stale is the check's own finding (it names
1557
1869
  // the file); the copy is compared only with a current build.
@@ -1576,8 +1888,8 @@ export async function editorBuildExtra(file, cwd, opts) {
1576
1888
  }
1577
1889
  : null;
1578
1890
  }
1579
- const stale = appCopyStale(root, slug).appCopyStale;
1580
- return stale ? {appCopyStale: stale} : null;
1891
+ // A build's copy write is reported once it has run (editorAfterBuild).
1892
+ return null;
1581
1893
  }
1582
1894
 
1583
1895
  /**
@@ -1635,15 +1947,10 @@ export async function editorLoadedFonts(file, cwd) {
1635
1947
  for (const f of importedFontFamilies(spec, from)) loaded.add(f);
1636
1948
  // A family the build names whose @fontsource package is installed: the
1637
1949
  // copy written after this build imports that package (copyFontsCss).
1638
- const req = createRequire(path.join(root, 'package.json'));
1639
1950
  /** @param {string} family */
1640
1951
  const installed = family => {
1641
- try {
1642
- req.resolve(`${fontsourcePackageOf(family)}/package.json`);
1643
- return true;
1644
- } catch {
1645
- return false;
1646
- }
1952
+ const pkg = fontsourcePackageOf(family);
1953
+ return pkg !== null && packageInstalled(root, pkg);
1647
1954
  };
1648
1955
  return family => loaded.has(fontKey(family)) || installed(family);
1649
1956
  }