@astryxdesign/cli 0.7.16 → 0.7.17-canary.g9a957aa

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 (229) hide show
  1. package/README.md +12 -23
  2. package/api/build/_adapter.d.mts +5 -0
  3. package/api/build/_adapter.mjs +49 -34
  4. package/api/build/blocks/blocks.d.mts +7 -5
  5. package/api/build/blocks/blocks.mjs +113 -26
  6. package/api/build/build.doc.mjs +2 -1
  7. package/api/build/kit/rank.mjs +47 -9
  8. package/api/build/kit/weights.d.mts +16 -3
  9. package/api/build/kit/weights.json +1 -1
  10. package/api/build/kit/weights.mjs +238 -31
  11. package/api/build/kit/word-model.d.mts +23 -0
  12. package/api/build/kit/word-model.mjs +46 -0
  13. package/api/build/kit/words.d.mts +32 -0
  14. package/api/build/kit/words.mjs +49 -1
  15. package/api/component/__fixtures__/resolutions/modules.txt +4 -5
  16. package/api/component/list/list.d.mts +1 -1
  17. package/api/component/list/list.mjs +48 -5
  18. package/api/discover/_adapter.d.mts +1 -1
  19. package/api/docs/_adapter.d.mts +26 -2
  20. package/api/docs/_adapter.mjs +217 -5
  21. package/api/docs/docs.d.mts +3 -0
  22. package/api/docs/docs.doc.mjs +7 -1
  23. package/api/docs/docs.mjs +12 -0
  24. package/api/docs/docs.type.d.mts +5 -0
  25. package/api/docs/docs.type.mjs +2 -0
  26. package/api/docs/node/node.mjs +1 -1
  27. package/api/doctor/_adapter.d.mts +27 -5
  28. package/api/doctor/_adapter.mjs +77 -6
  29. package/api/doctor/built-checks.mjs +38 -13
  30. package/api/doctor/doctor.d.mts +4 -3
  31. package/api/doctor/doctor.mjs +14 -7
  32. package/api/doctor/theme-checks.mjs +121 -17
  33. package/api/render/_adapter.mjs +491 -186
  34. package/api/render/render.doc.mjs +10 -3
  35. package/api/render/render.type.d.mts +30 -0
  36. package/api/render/render.type.mjs +19 -0
  37. package/api/search/ORDERING.md +1 -1
  38. package/api/search/_candidate-score.mjs +51 -32
  39. package/api/search/_fit-order.mjs +3 -3
  40. package/api/search/_result.d.mts +5 -5
  41. package/api/search/_score.d.mts +6 -1
  42. package/api/search/_score.mjs +15 -3
  43. package/api/search/search.d.mts +1 -1
  44. package/api/theme/_adapter.mjs +10 -0
  45. package/api/theme/build/build.d.mts +38 -0
  46. package/api/theme/build/build.mjs +144 -24
  47. package/api/theme/theme.type.d.mts +10 -0
  48. package/api/theme/theme.type.mjs +7 -1
  49. package/api/theme-edit/_adapter.d.mts +35 -0
  50. package/api/theme-edit/_adapter.mjs +477 -41
  51. package/api/theme-edit/_check.d.mts +28 -22
  52. package/api/theme-edit/_check.mjs +1077 -200
  53. package/api/theme-edit/_compiler.mjs +9 -0
  54. package/api/theme-edit/_context.mjs +60 -3
  55. package/api/theme-edit/_css.mjs +21 -1
  56. package/api/theme-edit/_edit.d.mts +22 -0
  57. package/api/theme-edit/_edit.mjs +932 -82
  58. package/api/theme-edit/_how-commands.d.mts +49 -0
  59. package/api/theme-edit/_how-commands.mjs +386 -1
  60. package/api/theme-edit/_how-question.d.mts +56 -0
  61. package/api/theme-edit/_how-question.mjs +3509 -168
  62. package/api/theme-edit/_how.mjs +104 -4
  63. package/api/theme-edit/_marks.d.mts +31 -5
  64. package/api/theme-edit/_marks.mjs +57 -5
  65. package/api/theme-edit/_normal.d.mts +137 -0
  66. package/api/theme-edit/_normal.mjs +612 -0
  67. package/api/theme-edit/_palette.mjs +10 -4
  68. package/api/theme-edit/_parts.d.mts +4 -0
  69. package/api/theme-edit/_parts.mjs +28 -2
  70. package/api/theme-edit/_preview-app.d.mts +7 -1
  71. package/api/theme-edit/_preview-app.mjs +191 -15
  72. package/api/theme-edit/_preview.d.mts +64 -8
  73. package/api/theme-edit/_preview.mjs +401 -83
  74. package/api/theme-edit/_settings.d.mts +139 -5
  75. package/api/theme-edit/_settings.mjs +1659 -112
  76. package/api/theme-edit/_tables.mjs +17 -1
  77. package/api/theme-edit/theme-edit.type.d.mts +10 -1
  78. package/api/theme-edit/theme-edit.type.mjs +4 -1
  79. package/api/theme-edit/themeEditPreviewApp.doc.mjs +2 -2
  80. package/assets/codemods/run-codemod.mjs +73 -6
  81. package/assets/codemods/transforms/next/index.mjs +11 -1
  82. package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
  83. package/assets/docs/author-a-theme.doc.mjs +1 -0
  84. package/assets/docs/theme.doc.dense.mjs +2 -2
  85. package/assets/docs/theme.doc.mjs +1 -1
  86. package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
  87. package/assets/docs/tree/cli-command.doc.mjs +2 -3
  88. package/assets/docs/tree/render-pages.doc.mjs +43 -2
  89. package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
  90. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  91. package/assets/docs/use-a-theme.doc.mjs +1 -1
  92. package/assets/docs.generated.json +2 -2
  93. package/assets/self-audit.generated.json +1 -1
  94. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
  95. package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
  96. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
  97. package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
  98. package/assets/templates/components.generated.json +1 -1
  99. package/assets/templates/pages/ai-chat/template.doc.mjs +8 -4
  100. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +2 -1
  101. package/assets/templates/pages/blank/template.doc.mjs +1 -1
  102. package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
  103. package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
  104. package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
  105. package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
  106. package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
  107. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
  108. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
  109. package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
  110. package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
  111. package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
  112. package/assets/templates/pages/documentation/template.doc.mjs +4 -1
  113. package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
  114. package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
  115. package/assets/templates/pages/editor/template.doc.mjs +1 -7
  116. package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
  117. package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
  118. package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
  119. package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
  120. package/assets/templates/pages/ide/page.tsx +24 -2
  121. package/assets/templates/pages/library/template.doc.mjs +4 -1
  122. package/assets/templates/pages/login/template.doc.mjs +2 -1
  123. package/assets/templates/pages/login-card/template.doc.mjs +2 -1
  124. package/assets/templates/pages/login-split/template.doc.mjs +2 -1
  125. package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
  126. package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
  127. package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
  128. package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
  129. package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
  130. package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
  131. package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
  132. package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
  133. package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
  134. package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
  135. package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
  136. package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
  137. package/assets/templates/pages/table-page/template.doc.mjs +5 -4
  138. package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
  139. package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -1
  140. package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
  141. package/authoring/debug/parse.d.mts +3 -3
  142. package/authoring/doctypes/_schema.d.mts +3 -3
  143. package/authoring/doctypes/command/command.doc.mjs +1 -1
  144. package/authoring/doctypes/template/template.doc.mjs +1 -1
  145. package/authoring/doctypes/template/type.ts +9 -0
  146. package/clients/cli/bin/astryx.mjs +6 -9
  147. package/clients/cli/build-id.generated.json +1 -1
  148. package/clients/cli/commands/component.doc.mjs +1 -1
  149. package/clients/cli/commands/component.mjs +20 -2
  150. package/clients/cli/commands/docs.doc.mjs +7 -1
  151. package/clients/cli/commands/docs.mjs +3 -1
  152. package/clients/cli/commands/doctor.mjs +22 -14
  153. package/clients/cli/commands/experimental/render.mjs +32 -1
  154. package/clients/cli/commands/experimental/theme.mjs +27 -2
  155. package/clients/cli/commands/experimental-render.doc.mjs +2 -2
  156. package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
  157. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
  158. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  159. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  160. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
  161. package/clients/cli/commands/search.doc.mjs +2 -1
  162. package/clients/cli/commands/search.mjs +6 -1
  163. package/clients/cli/commands/template.mjs +4 -2
  164. package/clients/cli/commands/theme-build.doc.mjs +5 -1
  165. package/clients/cli/commands/theme.doc.mjs +1 -1
  166. package/clients/cli/commands/theme.mjs +138 -3
  167. package/clients/cli/commands/upgrade.mjs +42 -7
  168. package/clients/cli/index.mjs +1 -1
  169. package/clients/cli/lib/component-format.mjs +205 -98
  170. package/clients/cli/lib/hook-format.mjs +9 -19
  171. package/clients/cli/manifest.generated.json +1 -1
  172. package/foundation/agent-docs/agent-docs.mjs +1 -1
  173. package/foundation/config/theme-state.d.mts +13 -1
  174. package/foundation/config/theme-state.mjs +47 -7
  175. package/foundation/discovery/component-discovery.d.mts +11 -0
  176. package/foundation/discovery/component-discovery.mjs +27 -2
  177. package/foundation/discovery/component-replacement.mjs +130 -1
  178. package/foundation/discovery/entry-name-files.d.mts +43 -0
  179. package/foundation/discovery/entry-name-files.mjs +264 -0
  180. package/foundation/discovery/hook-discovery.d.mts +8 -2
  181. package/foundation/discovery/hook-discovery.mjs +20 -7
  182. package/foundation/discovery/runner-allowlist.d.mts +1 -0
  183. package/foundation/discovery/runner-allowlist.mjs +2 -0
  184. package/foundation/discovery/template-adapter.d.mts +52 -0
  185. package/foundation/discovery/template-adapter.mjs +169 -0
  186. package/foundation/discovery/theme-imports.d.mts +14 -0
  187. package/foundation/discovery/theme-imports.mjs +43 -1
  188. package/foundation/doc-compiler/import.mjs +7 -1
  189. package/foundation/doc-compiler/parse-readable.mjs +4 -1
  190. package/foundation/doc-compiler/stored-docs.d.mts +22 -0
  191. package/foundation/doc-compiler/stored-docs.mjs +49 -0
  192. package/foundation/fs/cache-eviction.d.mts +21 -0
  193. package/foundation/fs/cache-eviction.mjs +73 -0
  194. package/foundation/fs/gather-cache.d.mts +25 -4
  195. package/foundation/fs/gather-cache.mjs +138 -52
  196. package/foundation/fs/jiti-cache.d.mts +19 -1
  197. package/foundation/fs/jiti-cache.mjs +130 -6
  198. package/foundation/fs/kept-tree.d.mts +60 -0
  199. package/foundation/fs/kept-tree.mjs +154 -0
  200. package/foundation/fs/module-loader.d.mts +18 -2
  201. package/foundation/fs/module-loader.mjs +92 -20
  202. package/foundation/identity/provider-identity.d.mts +6 -0
  203. package/foundation/identity/provider-identity.mjs +10 -1
  204. package/foundation/render/file-header.d.mts +66 -0
  205. package/foundation/render/file-header.mjs +118 -0
  206. package/foundation/render/host-answer.d.mts +18 -0
  207. package/foundation/render/host-answer.mjs +46 -0
  208. package/foundation/render/host-exit.d.mts +1 -0
  209. package/foundation/render/host-exit.mjs +6 -1
  210. package/foundation/render/html-reader.d.mts +55 -2
  211. package/foundation/render/html-reader.mjs +145 -26
  212. package/foundation/render/markup-edits.d.mts +57 -0
  213. package/foundation/render/markup-edits.mjs +182 -0
  214. package/foundation/render/page-host.mjs +29 -12
  215. package/foundation/render/page-worker.mjs +79 -10
  216. package/foundation/render/render-page.d.mts +34 -2
  217. package/foundation/render/render-page.mjs +210 -29
  218. package/foundation/render/source-block.d.mts +73 -6
  219. package/foundation/render/source-block.mjs +170 -19
  220. package/foundation/render/ts-paths.d.mts +4 -1
  221. package/foundation/render/ts-paths.mjs +7 -3
  222. package/foundation/response/error-codes.d.mts +2 -1
  223. package/foundation/response/error-codes.doc.mjs +7 -1
  224. package/foundation/response/error-codes.mjs +7 -0
  225. package/foundation/text/string-utils.d.mts +3 -2
  226. package/foundation/text/string-utils.mjs +16 -3
  227. package/foundation/text/suggest-order.d.mts +9 -0
  228. package/foundation/text/suggest-order.mjs +13 -0
  229. package/package.json +6 -6
@@ -26,6 +26,7 @@ export function themeFiles(cwd: string, slug: string): {
26
26
  * files (what `git rm -r` or a branch switch leaves). A path that is not a
27
27
  * folder, or one that does not read, is not empty.
28
28
  * @param {string} dir
29
+ * @returns {boolean}
29
30
  */
30
31
  export function folderIsEmpty(dir: string): boolean;
31
32
  /**
@@ -147,6 +148,40 @@ export function unlabeledThemeName(s: unknown): string;
147
148
  * @returns {string}
148
149
  */
149
150
  export function typedThemeName(s: unknown): string;
151
+ /**
152
+ * The theme names a name typed the way the app shows it may mean, most
153
+ * likely first: a path with doubled slashes or `../` (`themes//t`), a file
154
+ * name with or without its folder (`brand.theme.ts`, `tTheme.ts`), the app
155
+ * copy's export (`tTheme`), camelCase (`brandDark`) and spaces
156
+ * (`Brand Dark`) each read as dashes. The caller picks the first that
157
+ * exists, else the first.
158
+ * @param {string} s
159
+ * @returns {string[]}
160
+ */
161
+ export function themeNameReadings(s: string): string[];
162
+ /**
163
+ * A vibrancy written as set reads typed input: a share of one (0.5) or a
164
+ * percent (50%) is that much of the 0-100 scale, as a whole number. Any
165
+ * other dial's value, or a vibrancy that is no such number, comes back as
166
+ * it was.
167
+ * @param {string} dial
168
+ * @param {string} v
169
+ * @returns {string}
170
+ */
171
+ export function vibrancyMeant(dial: string, v: string): string;
172
+ /**
173
+ * The mode and base a damaged theme file meant, read the way typed input
174
+ * is: other letters, stray spaces, `_` or a space for a dash (`Dark-Only`,
175
+ * ` Neutral`), and a base written as its package name
176
+ * (`@astryxdesign/theme-neutral`). Each is the cleaned text even when it is
177
+ * no value the editor takes; the caller checks it.
178
+ * @param {any} data
179
+ * @returns {{mode: string, like: string}}
180
+ */
181
+ export function fieldsMeant(data: any): {
182
+ mode: string;
183
+ like: string;
184
+ };
150
185
  /**
151
186
  * The settings of a theme, or a refusal naming the command that makes it.
152
187
  * @param {string} cwd
@@ -202,6 +237,20 @@ export function withoutBadValues(data: ThemeData): {
202
237
  * @returns {string | null}
203
238
  */
204
239
  export function valueProblem(s: any): string | null;
240
+ /**
241
+ * One entry of the top-level `tokens` map in a theme's own source, as
242
+ * written: its token (null for a computed key no read of the file can
243
+ * resolve), the key as typed, the line that sets it, and its value's shape.
244
+ * @typedef {{token: string | null, key: string, line: number | null, kind: 'text' | 'number' | 'pair' | 'other', value?: string | number, halves?: Array<string | number | undefined>}} OwnTokenEntry
245
+ */
246
+ /**
247
+ * The entries of the top-level `tokens` map in a theme's own source, read
248
+ * from its syntax tree, each with the line that sets it.
249
+ * @param {string} cwd
250
+ * @param {string} slug
251
+ * @returns {OwnTokenEntry[]}
252
+ */
253
+ export function ownTokenEntries(cwd: string, slug: string): OwnTokenEntry[];
205
254
  /**
206
255
  * The tokens a base theme's own component rules for a part read through
207
256
  * var() (neutral's progress-bar reads --color-border-emphasized), from its
@@ -232,6 +281,17 @@ export function baseTopTokens(cwd: string, like: string | null | undefined): Map
232
281
  * @returns {Map<string, string | null>}
233
282
  */
234
283
  export function partRuleTokens(cwd: string, slug: string, like: string | null | undefined, part: string): Map<string, string | null>;
284
+ /**
285
+ * Whether the base theme's own source gives a part's rule a property, in a
286
+ * state (`:hover`) or at rest, read from its module as written.
287
+ * @param {string} cwd
288
+ * @param {string | undefined} like
289
+ * @param {string} part
290
+ * @param {string} scope `base` or a variant such as `variant:secondary`
291
+ * @param {string | null} state a state block (`:hover`), or null
292
+ * @param {string} prop camelCase
293
+ */
294
+ export function baseRuleHas(cwd: string, like: string | undefined, part: string, scope: string, state: string | null, prop: string): boolean;
235
295
  /**
236
296
  * The tokens and properties a theme's own source sets on a part's plain
237
297
  * rule, read from the build as ownTokens reads page-wide ones: what the
@@ -342,6 +402,27 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
342
402
  stop: number;
343
403
  alpha?: string;
344
404
  }>>;
405
+ /**
406
+ * A size in px: px, rem (16px each), or a calc() of those added and
407
+ * subtracted; null for anything else.
408
+ * @param {string} v
409
+ * @param {Record<string, string>} [vars] values for the tokens a var() may name
410
+ * @returns {number | null}
411
+ */
412
+ export function sizePx(v: string, vars?: Record<string, string>): number | null;
413
+ /**
414
+ * Spacing steps scaled with the spacing dial, kept in order around the
415
+ * steps the theme keeps exact: each the plain scaled value unless it would
416
+ * meet or pass a kept one; those are spread evenly between the kept one and
417
+ * the nearest step that keeps its place. A step with no room below a kept
418
+ * one takes the value of the one below it.
419
+ * @param {Array<[string, number]>} steps token name and the base value, in px
420
+ * @param {number} f the rung's factor
421
+ * @param {Record<string, number>} kept exact steps the theme keeps, in px
422
+ * @param {string[]} [noRoom] filled with the steps left no room
423
+ * @returns {Array<[string, number]>} every step's new value in px, kept ones as kept
424
+ */
425
+ export function spacingSteps(steps: Array<[string, number]>, f: number, kept: Record<string, number>, noRoom?: string[]): Array<[string, number]>;
345
426
  /**
346
427
  * Control heights scaled with the spacing dial (a denser theme has shorter
347
428
  * controls), each kept distinct and in order: smallest to largest, a
@@ -351,9 +432,13 @@ export function stopsIn(source: string): Record<string, Record<"light" | "dark",
351
432
  * scaled above it.
352
433
  * @param {Array<[string, string]>} sizes token name and the theme's value
353
434
  * @param {number} f the spacing rung's factor
435
+ * @param {Record<string, number>} [kept] exact sizes the theme keeps, in px,
436
+ * which the others stay in order around
437
+ * @param {string[]} [noRoom] filled with the sizes left no room between
438
+ * two kept ones (each then equals the one below it)
354
439
  * @returns {Array<[string, string]>} the tokens it writes, in px
355
440
  */
356
- export function controlSizes(sizes: Array<[string, string]>, f: number): Array<[string, string]>;
441
+ export function controlSizes(sizes: Array<[string, string]>, f: number, kept?: Record<string, number>, noRoom?: string[]): Array<[string, string]>;
357
442
  /**
358
443
  * The settings, as a `defineTheme` object.
359
444
  * @param {Ctx} ctx
@@ -365,6 +450,16 @@ export function compileTheme(ctx: Ctx, data: ThemeData, base: {
365
450
  light: Record<string, string>;
366
451
  dark: Record<string, string>;
367
452
  }): any;
453
+ /**
454
+ * A background's layers with each color painted in one mode only: a color
455
+ * stop becomes light-dark(<color>, transparent) for light (the reverse for
456
+ * dark), and a layer that is a color alone becomes a gradient of it, so
457
+ * every layer is an image the other mode does not show.
458
+ * @param {string} value
459
+ * @param {'light' | 'dark'} mode
460
+ * @returns {string[]}
461
+ */
462
+ export function maskLayers(value: string, mode: "light" | "dark"): string[];
368
463
  /**
369
464
  * Settings whose effect a later or stronger setting hides, with why: `type`
370
465
  * loses heading weight and tracking to `headings`.
@@ -379,13 +474,14 @@ export function maskedSettings(data: ThemeData, ctx?: Ctx | null): Map<Setting,
379
474
  * {font-weight}`. Find those rules in the built stylesheet.
380
475
  * @param {string} cssText
381
476
  * @param {any} theme
382
- * @returns {Array<{target: string, key: string, prop: string, value: string}>}
477
+ * @returns {Array<{target: string, key: string, prop: string, value: string, state?: string}>}
383
478
  */
384
479
  export function findOverrides(cssText: string, theme: any): Array<{
385
480
  target: string;
386
481
  key: string;
387
482
  prop: string;
388
483
  value: string;
484
+ state?: string;
389
485
  }>;
390
486
  /**
391
487
  * Why `<slug>.theme.ts` cannot carry the settings, or null: it must import
@@ -460,6 +556,15 @@ export function buildTheme(ctx: Ctx, slug: string, data: ThemeData): Promise<{
460
556
  lifted: string[];
461
557
  notes: string[];
462
558
  }>;
559
+ /**
560
+ * The one color mode of a light-only or dark-only theme, from its settings,
561
+ * for the build to write into the built module (`colorModes`); null for a
562
+ * theme with both modes.
563
+ * @param {string} cwd
564
+ * @param {string} slug
565
+ * @returns {['light'] | ['dark'] | null}
566
+ */
567
+ export function buildColorModes(cwd: string, slug: string): ["light"] | ["dark"] | null;
463
568
  /**
464
569
  * Why the built outputs differ from what the theme builds now: one that is
465
570
  * missing or changed by hand, found the way `compile --check` finds it
@@ -479,6 +584,14 @@ export function resolvedTokens(ctx: Ctx, slug: string): Promise<{
479
584
  light: Record<string, string>;
480
585
  dark: Record<string, string>;
481
586
  }>;
587
+ /**
588
+ * Why a token value is not one, with a value of the token's own type to
589
+ * write instead (a size in px, a weight as a number in quotes), or none.
590
+ * @param {Ctx} ctx
591
+ * @param {string} slug
592
+ * @param {[string, unknown, ('object' | 'pair' | 'unit' | 'value' | 'mode')?]} bad
593
+ */
594
+ export function nonTextMessage(ctx: Ctx, slug: string, [name, value, kind]: [string, unknown, ("object" | "pair" | "unit" | "value" | "mode")?]): string;
482
595
  /**
483
596
  * Contrast problems this theme caused: text below 4.5:1 that was not as low
484
597
  * in the base theme. A part's own color or background setting, or a token
@@ -493,8 +606,14 @@ export function contrastProblems(ctx: Ctx, data: ThemeData, res: {
493
606
  dark: Record<string, string>;
494
607
  }): Promise<string[]>;
495
608
  /**
496
- * Whether parsed settings have the shape the editor reads: an object with a
497
- * list of settings.
609
+ * Whether every settings entry has the parts the editor reads (a thing, a
610
+ * value and a source); one without is damage `new` keeps aside.
611
+ * @param {any} data
612
+ */
613
+ export function settingsEntriesOk(data: any): any;
614
+ /**
615
+ * Whether settings data has the shape the editor reads: an object with a
616
+ * settings list.
498
617
  * @param {any} data
499
618
  */
500
619
  export function settingsShapeOk(data: any): boolean;
@@ -683,7 +802,7 @@ export function fontPackages(ctx: Ctx, data: ThemeData): {
683
802
  installed: boolean;
684
803
  of: Setting;
685
804
  }[];
686
- /** @typedef {{project: import('./_project.mjs').ThemeProject, C: import('./_compiler.mjs').Compiler, unchecked?: string | null, uncheckedCode?: string | null, wrote?: Map<string, string | null>, base?: {light: Record<string, string>, dark: Record<string, string>, components?: Record<string, any>}, keepStops?: Record<string, Record<'light' | 'dark', {family: string, stop: number, alpha?: string}>> | null, keepRadii?: Record<string, string> | null, derived?: Record<string, Array<{property: string, vars?: string[], replaces?: boolean, expand?: string}>>}} Ctx */
805
+ /** @typedef {{project: import('./_project.mjs').ThemeProject, C: import('./_compiler.mjs').Compiler, unchecked?: string | null, uncheckedCode?: string | null, wrote?: Map<string, string | null>, base?: {light: Record<string, string>, dark: Record<string, string>, components?: Record<string, any>}, keepStops?: Record<string, Record<'light' | 'dark', {family: string, stop: number, alpha?: string}>> | null, keepRadii?: Record<string, string> | null, sizeNotes?: string[], compileNotes?: string[], derived?: Record<string, Array<{property: string, vars?: string[], replaces?: boolean, expand?: string}>>}} Ctx */
687
806
  /** @typedef {import('./_parts.mjs').PaintSide} PaintSide */
688
807
  /** @typedef {import('./_parts.mjs').TextPair} TextPair */
689
808
  /** What a theme name may be, in words. */
@@ -713,6 +832,19 @@ export const EDITOR_SUFFIXES: string[];
713
832
  export function isEditorFile(slug: string, n: string): boolean;
714
833
  /** The undo steps a theme keeps; older ones are dropped. */
715
834
  export const HISTORY_STEPS: 80;
835
+ /**
836
+ * One entry of the top-level `tokens` map in a theme's own source, as
837
+ * written: its token (null for a computed key no read of the file can
838
+ * resolve), the key as typed, the line that sets it, and its value's shape.
839
+ */
840
+ export type OwnTokenEntry = {
841
+ token: string | null;
842
+ key: string;
843
+ line: number | null;
844
+ kind: "text" | "number" | "pair" | "other";
845
+ value?: string | number;
846
+ halves?: Array<string | number | undefined>;
847
+ };
716
848
  /**
717
849
  * One setting the CLI owns.
718
850
  */
@@ -777,6 +909,8 @@ export type Ctx = {
777
909
  alpha?: string;
778
910
  }>> | null;
779
911
  keepRadii?: Record<string, string> | null;
912
+ sizeNotes?: string[];
913
+ compileNotes?: string[];
780
914
  derived?: Record<string, Array<{
781
915
  property: string;
782
916
  vars?: string[];