@astryxdesign/cli 0.7.14-canary.gfdb9213 → 0.7.14

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 (95) hide show
  1. package/CHANGELOG.md +197 -0
  2. package/api/theme/_adapter.d.mts +33 -0
  3. package/api/theme/_adapter.mjs +352 -16
  4. package/api/theme/build/build.mjs +261 -10
  5. package/api/theme/eject/eject.mjs +13 -1
  6. package/api/theme/list/list.mjs +11 -2
  7. package/api/theme/template/template.mjs +139 -6
  8. package/api/theme/theme.type.d.mts +15 -1
  9. package/api/theme/theme.type.mjs +9 -3
  10. package/api/theme/themeAdd.doc.mjs +1 -1
  11. package/api/theme/themeBuild.doc.mjs +10 -2
  12. package/api/theme/themeEject.doc.mjs +2 -2
  13. package/api/theme/themeListAvailable.doc.mjs +1 -1
  14. package/api/theme/themeRemove.doc.mjs +1 -1
  15. package/api/theme/themeTemplate.doc.mjs +8 -0
  16. package/api/theme/themeUse.doc.mjs +1 -1
  17. package/api/theme-edit/_adapter.d.mts +10 -2
  18. package/api/theme-edit/_adapter.mjs +52 -31
  19. package/api/theme-edit/_check.d.mts +28 -25
  20. package/api/theme-edit/_check.mjs +586 -548
  21. package/api/theme-edit/_color.d.mts +28 -2
  22. package/api/theme-edit/_color.mjs +306 -68
  23. package/api/theme-edit/_compiler.d.mts +8 -4
  24. package/api/theme-edit/_compiler.mjs +30 -27
  25. package/api/theme-edit/_context.d.mts +10 -4
  26. package/api/theme-edit/_context.mjs +21 -4
  27. package/api/theme-edit/_edit.mjs +300 -43
  28. package/api/theme-edit/_how-commands.d.mts +91 -0
  29. package/api/theme-edit/_how-commands.mjs +269 -0
  30. package/api/theme-edit/_how-question.d.mts +57 -0
  31. package/api/theme-edit/_how-question.mjs +2574 -0
  32. package/api/theme-edit/_how.d.mts +25 -17
  33. package/api/theme-edit/_how.mjs +727 -305
  34. package/api/theme-edit/_palette.d.mts +127 -19
  35. package/api/theme-edit/_palette.mjs +1313 -399
  36. package/api/theme-edit/_parts.mjs +36 -3
  37. package/api/theme-edit/_png.d.mts +18 -6
  38. package/api/theme-edit/_png.mjs +135 -25
  39. package/api/theme-edit/_preview-app.d.mts +26 -7
  40. package/api/theme-edit/_preview-app.mjs +1611 -280
  41. package/api/theme-edit/_preview.d.mts +4 -2
  42. package/api/theme-edit/_preview.mjs +18 -7
  43. package/api/theme-edit/_settings.d.mts +56 -5
  44. package/api/theme-edit/_settings.mjs +197 -49
  45. package/api/theme-edit/_tables.d.mts +0 -12
  46. package/api/theme-edit/_tables.mjs +24 -97
  47. package/api/theme-edit/theme-edit.type.d.mts +22 -5
  48. package/api/theme-edit/theme-edit.type.mjs +17 -6
  49. package/api/theme-edit/themeEditHow.doc.mjs +13 -3
  50. package/api/theme-edit/themeEditNew.doc.mjs +2 -1
  51. package/api/theme-edit/themeEditPreviewAdd.doc.mjs +16 -4
  52. package/api/theme-edit/themeEditPreviewApp.doc.mjs +12 -4
  53. package/api/theme-edit/themeEditPreviewList.doc.mjs +9 -1
  54. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +27 -2
  55. package/api/theme-edit/themeEditUndo.doc.mjs +1 -1
  56. package/assets/docs.generated.json +1 -0
  57. package/assets/preview-app/gitignore +3 -0
  58. package/assets/templates/components.generated.json +1 -0
  59. package/clients/cli/bin/astryx.mjs +37 -5
  60. package/clients/cli/commands/experimental/theme.mjs +231 -31
  61. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +14 -5
  62. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +0 -1
  63. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  64. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +3 -2
  65. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +2 -2
  66. package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +2 -2
  67. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
  68. package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -1
  69. package/clients/cli/commands/experimental-theme.doc.mjs +2 -2
  70. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  71. package/clients/cli/commands/theme-eject.doc.mjs +3 -3
  72. package/clients/cli/commands/theme-remove.doc.mjs +2 -2
  73. package/clients/cli/commands/theme-template.doc.mjs +11 -4
  74. package/clients/cli/commands/theme.mjs +104 -40
  75. package/clients/cli/commands.generated.json +1 -0
  76. package/clients/cli/index.mjs +96 -4
  77. package/clients/cli/lib/json-shim.mjs +29 -1
  78. package/foundation/config/project.d.mts +16 -2
  79. package/foundation/config/project.mjs +40 -6
  80. package/foundation/config/theme-state.d.mts +9 -0
  81. package/foundation/config/theme-state.mjs +20 -1
  82. package/foundation/discovery/template-adapter.d.mts +12 -1
  83. package/foundation/discovery/template-adapter.mjs +24 -1
  84. package/foundation/discovery/template-needs.d.mts +7 -0
  85. package/foundation/discovery/template-needs.mjs +117 -8
  86. package/foundation/discovery/template-source-tree.d.mts +5 -1
  87. package/foundation/discovery/template-source-tree.mjs +6 -4
  88. package/foundation/discovery/theme-discovery.d.mts +14 -3
  89. package/foundation/discovery/theme-discovery.mjs +45 -12
  90. package/foundation/doc-compiler/import.mjs +68 -3
  91. package/foundation/doc-compiler/stored-docs.d.mts +27 -0
  92. package/foundation/doc-compiler/stored-docs.mjs +65 -0
  93. package/foundation/fs/fs-error.d.mts +17 -0
  94. package/foundation/fs/fs-error.mjs +34 -0
  95. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,202 @@
1
1
  # @xds/cli
2
2
 
3
+ # 0.7.14
4
+
5
+ #### Experimental APIs
6
+
7
+ - `astryx discover` lists `WeightedSVGIcon` among `@astryxdesign/lab`'s components: an experimental SVG icon whose drawing follows the surrounding font-weight. (#7918)
8
+ - `astryx experimental theme editor how` answers a question that names the background ("a yellow background") for the background, with its tokens first, instead of as a color question. The preview's Overview page shows its open popover and tooltip first, below their anchors in space kept free for them, so they no longer cover the table. (#11159)
9
+ - `astryx experimental theme editor`: colors are generated the way the official themes are. (#11209)
10
+
11
+ - An exact color you give stays exactly as given. In light it never moves: when no text reads on it, the text changes, and a pale fill that does not stand out from the page is reported. In dark it is kept too when text on it reads at 4.5:1 and it stands out from the dark page at 3:1, so the dark shades around it follow it; otherwise dark mode starts at shade 70, as the official themes do, and the result says why. A dark side never uses a light shade.
12
+ - `set <theme> neutral <color>`: your exact color sits at its own shade in light and dark, and the shades around it follow it.
13
+ - Text on accent and status fills comes from the neutral color's white or near-black (near-black first on warning), or pure black or white without a neutral color. Status tints are see-through in dark, and their text is measured over the surface; the accent tint is dark shade 30, or the nearest darker shade that citation text reads on; a tint is never the fill's own shade.
14
+ - An exact `--color-accent` (or another main color token) wins over the color it would replace: the text on it is picked to read on your color, the focus ring keeps following it, a pale one is reported, and the result says so.
15
+ - Text, icons and the focus ring take the nearest shade that reads, lighter or darker, so bases with dark light-mode surfaces get readable colors too.
16
+ - Hand edits to `palette.config.json` are kept: your own anchors, names, `kind`, `neutralProfile`, vibrancy written by hand, and colors of your own. One-mode themes generate one mode. A stop layout maps by its own shades, half stops included; one without black and white, with too few shades or with a wide gap is refused. Fields the generator does not read are named. What the editor replaced is named when a color change touches the config.
17
+ - A hand-edited generated color file is never overwritten, receipt or not; formatting is not an edit. Only color changes wait, and the refusal says how to keep or discard the edit; other changes go ahead. A file from another generator version is generated again. No unresolved color ever reaches the built CSS.
18
+ - The theme imports only the shades it uses, from `tokens/<theme>.palette-refs.ts`.
19
+ - Colors are read as browsers read them: negative hues, out-of-range saturation and chroma, `color(srgb …)` and `color(display-p3 …)`. Malformed functions, system colors and see-through colors are refused with the reason and a command that works, such as the color with its `#`, without quotes, opaque, or the nearest color name. A dial named another way (`gray`, `brand`, `error`, `saturation`, `Accent`) suggests the dial; a color dial with `--on` suggests what the part really reads.
20
+ - `vibrancy more` at 100 and `less` at 0 are refused, a number out of range suggests the nearest one, undoing the last color removes vibrancy too, a vibrancy edited by hand into something invalid can be fixed with `undo` or `set`, and a replaced color shows what it was. A wide-gamut color says it is used as its nearest sRGB color.
21
+
22
+ - `astryx experimental theme editor`: colors without palette commands. Colors come only from `editor set <theme> accent|neutral|success|warning|danger|info <color>`, which generates the light and dark shades and points the color tokens at them, as before. The new `vibrancy <0-100>` setting (`more`/`less` step by 10) sets how saturated the generated colors are; it needs a color and applies to the whole theme. `editor new <theme>` now takes any setting as a flag (`--accent "#7c3aed" --font inter --corners round --vibrancy 60`), checked the same way as `set` and applied in one build. The experimental copy `experimental theme palette generate` is gone; `theme palette generate` is unchanged, and `editor set` lists it as the command it replaces. Help, results and errors say "colors" and "shades" instead of palette, family and stop; `show` lists each color with its seed and the shade each token uses, with the generated files last (`colors`, `colorNotes`, `vibrancy` and `colorFiles` replace `palette`). Component families are now groups: `how --list groups`, and the `group` field in `set` and `how` results. `how colors` (or `how palette`) explains how colors are made, and plain-words color questions ("brand color", "make it more colorful", "dark mode colors", "error red", "see all shades", "exact color for one token") answer with the commands. `preview add` with no description adds a Colors page when the theme sets a color: every shade in light and dark with its number, hex and the tokens that use it, kept in step with each change. (#11149)
23
+ - `astryx experimental theme`: make and change a theme one checked change at a time (`editor`), and preview it on real pages in your app (`preview`). Only the new experimental command group changes; `astryx theme` and its output stay as they were. (#11101)
24
+
25
+ - **Checked changes.** `editor set <theme> <thing> <value>` takes a dial (corners, spacing, accent, neutral, success, warning, danger, info, font, headings, surfaces, buttons, type, text-size, base, mode), a design token, or a CSS property on a part, with `--on <part|family>`, `--when <prop>:<value>`, `--state`, `--mode light|dark` and `--only`. Each change is checked against what the installed Core's parts really read and against the token's type. A change that cannot take effect is refused (exit 1, an `ERR_THEME_*` code, nothing written), and the error leads with the command that works.
26
+ - **What parts read.** It is derived from the installed Core itself, version for version: a catalog of every component renders on the server with the project's own React, joined to Core's stylesheet. The result is cached under `node_modules/.cache/astryx-theme/`. No new dependency.
27
+ - **An ordinary local theme.** `<theme>.settings.json` holds the settings; `<theme>.settings.ts` is generated from it; `<theme>.theme.ts` extends it, is written once, and keeps your own edits; the CSS and JS are built by the same build as `astryx theme build`. A plain part setting that a more specific base-theme rule would beat is repeated on those variant keys, and the result says so.
28
+ - **Families, modes, contrast.** Styling one input or check styles its whole family unless `--only`; `--on containers` and `--on menus` style every member. Only colors and shadows take `--mode`. Text this theme makes unreadable (below 4.5:1, and not that low in the base theme) is reported.
29
+ - **Editor commands.** `editor new`, `editor set`, `editor undo` (one step back; with a thing, removes that one setting so it goes back to the base theme's value), `editor show` (every setting, key values, contrast problems, and two self-contained HTML pages: the sample app page and every component; PNG pictures only with `--png`, using a Playwright or Chrome found on the machine), and `editor how` (what a part reads, a family, a setting or aspect, a question in plain words answered with exact commands, a PNG picture's colors, or `--list dials|tokens|parts|families|properties`).
30
+ - **Preview in your app.** `preview add` writes one route into the app's routes folder (`theme-preview/` in `app/` or `src/app/`, or `--path`): a normal page that keeps your layout and providers, in an app shell with a nav item per page and, when it wears a theme made by `editor`, a light, dark and system switch. With no description it adds the sample app page and every component; with a description it adds the page templates the `build` ranking picks for it (`--top`); `--template` adds one. `preview list` and `preview remove` manage the pages; only files the preview wrote are replaced or deleted, only inside its folder, and every check runs before the first write. A template page that needs a package the app lacks is skipped, with the install command. With no app, `preview app <dir>` writes a starter Next.js app with the preview in it (`--theme` copies a theme in for the pages to wear) and prints the install and dev commands.
31
+ - **Experimental copies of `astryx theme`.** `compile` (the copy of `theme build`), `list`, `add`, `remove`, `use`, `eject`, `template`, `targets` and `palette generate` run the same functions with the same flags and JSON. Each experimental command doc names the stable command it will replace in a new `replaces` field, shown in its help as "Will replace: astryx theme build".
32
+
33
+ - `astryx experimental theme editor how`: questions read the way people write them. (#11209)
34
+
35
+ - Negation and "too" read the right way round: "shouldn't", "turn off", "never", "stop", "unbold", "too sharp" (rounder) and "too heavy" (lighter). "Everything except X", "but not in X" and "all but X" keep X as it is now. "Without" is read in the shipped languages, and "sans" means a typeface only before serif or font.
36
+ - A typed value always wins. A hex beats a color word. A hex with the wrong number of digits is refused by name and never replaced with a sample. The sign, multi-value padding, `%` opacity, `em` tracking, numeric weights, written-out shadows and "40px tall" are kept. No color is picked when the question gives none.
37
+ - "In dark mode" carries `--mode dark` to every color command, parts included. A change that is the same in both modes, or a dark-mode ask on a light-only theme, says so instead of changing light.
38
+ - Better parts and properties: side nav items, focus rings as outlines, tab underlines, icons, border colors (darker, subtler, contrast), the overlay, transparent backgrounds, progress bar thickness, smaller headings, underlines, line height and body weight. A question about what something is ("what does --color-accent do") gets the lookup.
39
+ - Typos with swapped letters and short forms (`bttn`, `brdr`) are corrected. Portuguese, Italian and Korean words for buttons and rounded are read.
40
+ - Sequences drop repeated and overwritten steps and stop at 12. Two asks that contradict each other are offered as choices, not run in turn. Changes come before lookups.
41
+ - Text output prints each command on its own line and never wraps one. A sequence prints as one line.
42
+ - `--theme ""` and a repeated `--theme` are refused, for every subject. The default theme is the one an editor command changed last, not the newest settings file, and `themeChosenBy` says how it was picked.
43
+ - Pictures: every pixel is read up to 4 million, so 1-pixel lines count. tRNS is honored for gray and RGB pictures. A 0x0 picture names its size. 16-bit pictures are capped at 20 million pixels.
44
+ - Parallel lookups in an app with no themes leave no empty `themes/` folder. A refusal's commands start the same way as the answer's.
45
+
46
+ - `astryx experimental theme editor how`: answers that are safe, bounded and right. (#11209)
47
+
48
+ - Every command `how` suggests names your theme (the only one, the one changed last, or `--theme <name>`; with no theme, `my-theme`, made first), has a real value instead of a `<placeholder>`, carries no shell comment, and is checked as `set` checks it: a command that `set` would refuse, or that changes nothing, is left out, and the answer says why.
49
+ - Plain-words questions read negations and more or less ("remove shadows from cards" gives `box-shadow none`, "less rounded cards" gives `corners less`), the values you type (hex, rgb(), lengths, dashed), states (hover, focus, checked, selected, disabled, pressed, invalid), dark or light mode, several changes in one question, a few words in other languages, and small typos. A question with no answer says so in JSON too, with the next commands to try.
50
+ - `how <part>` writes each condition as the `--when` and `--state` flags `set` takes, or says why no flag reaches it; lists every state `set` accepts; and says when a part has no recorded reads, with commands that still apply.
51
+ - `how <token>` says when no part in the part data reads a token but Core's stylesheet does.
52
+ - Lookups take any case, plurals and token names without dashes; `--list` takes the kind anywhere, singular or plural, `--list=tokens` and a filter that starts with `--`, and refuses `--list` given twice.
53
+ - Pictures: a header bigger than 40 million pixels or pixel data shorter than the header says is refused at once; damaged files are refused; see-through pixels are skipped; `--at` gives each point's alpha and refuses points it cannot read exactly or that fall outside the picture; any file name works, and other formats are refused by their bytes.
54
+ - `set` refuses a value that holds a `<placeholder>` or a `#` comment.
55
+ - A damaged part-data cache is built again, the cache is written whole, and a lookup in an app with no themes leaves no `themes/` folder.
56
+ - Text and JSON start commands the same way, and text output escapes control characters in what you typed.
57
+
58
+ - `astryx experimental theme`: data safety and value checks. (#11180)
59
+
60
+ - A refused change puts back only the files that command wrote in that run, each whole, and only while they still hold what it wrote; a file changed by someone else meanwhile, or one it cannot restore, is left and named. The settings and undo history are written inside that rollback, and a refused `new` leaves no trace. A link anywhere in `themes/` or the theme folder is refused, and never followed or removed. A palette.config.json the editor did not write is kept. `show` finds a build that does not match the settings (a command stopped mid-build, a hand edit) and builds it again, saying so. Temp files have their own editor names and are removed by the write that made them; nothing else is ever removed. Run from a subfolder, a command acts on the Astryx project above it, found as `upgrade` finds it: the search stops at a repository root and never takes the home folder. A package without Astryx inside that project is refused with the folder to run from, a package.json that does not parse is never walked past, and reply paths are absolute when the project is above the current folder. Yarn Plug'n'Play and a package.json without Core get their own messages. A full or read-only disk is `ERR_WRITE_FAILED`.
61
+ - Commands on one theme run one after the other, so no change is lost. The lock lives in the project's `node_modules/.cache` (a folder that cannot be written is refused with `ERR_WRITE_FAILED`); a lock left by a stopped command, or by one on another computer that stopped, is taken over. A command that waits more than 30 seconds is refused with the new code `ERR_THEME_BUSY`, naming the lock.
62
+ - Every name the name check accepts builds (`brand-2`). Names are at most 64 characters. `new` refuses a link or a file where the theme goes, a stray word, a flag given two values, and an empty `--like`; `--headings` takes a weight and a tracking; a refused flag suggests a `new` command.
63
+ - Settings edited by hand are checked on load, and so is the step `undo` goes back to. A saved value the editor no longer accepts names the `undo <theme> <thing>` that removes it, and that command works; a step `undo` goes back to that holds one is passed with that value left out, and the result says so. A damaged undo step drops only itself and the steps before it. A quoted string or a data URL may hold a semicolon.
64
+ - Token values are checked by their type: time, easing, font, shadow and outline style too, and heading weights as numbers. A value that would break the CSS, read itself, or name a placeholder such as `<color>` is refused. Only colors take `--mode`; a shadow per mode would remove it in both.
65
+ - Code highlighting, display text sizes and colored icon tokens can be set.
66
+ - An exact font family applies on phones too; phones keep their own reading sizes.
67
+ - A text size or type scale keeps the base theme's ratio and the theme's heading weights (an exact weight token still feeds them), on phones too.
68
+ - `text-size` takes 10 to 32 pixels. `font` refuses values that would not build. `vibrancy` is refused when every color is a gray.
69
+ - `undo <theme> <token>` names the dial that still writes the token.
70
+ - Reading a built theme writes no copy into the theme folder.
71
+
72
+ - `astryx experimental theme editor`: settings that do what they say. (#11222)
73
+
74
+ - An exact token or part property always wins over a dial, whatever the order. A changed setting moves last, so it wins over what came before it. A shorthand set after its longhands says it replaces them. A setting for both modes replaces the one-mode settings it would sit under.
75
+ - One mode on a part whose variants each have their own value is refused, with the command that names the variant. A setting saved for a mode a one-mode theme does not have can still be removed. A base theme package that is gone no longer blocks moving off it.
76
+ - `--when` must be one property and value, and on a group it must belong to a member, as `--state` must. An empty or repeated `--on`, `--when`, `--state` or `--mode` is refused, and so are extra words after `undo` and `show`.
77
+ - `undo <theme> <thing> <value>` removes the setting only when that is its value. Scope flags without a thing are refused. `undo <theme> base` and `undo <theme> mode` set them back to their defaults. A stored setting this Core does not know can still be removed.
78
+ - `show` builds the theme again when its settings were edited by hand or built by another CLI; `--section` writes `sheet-<section>.html`, not over the full sheet, and takes any case. A setting listed twice is refused.
79
+ - `spacing` scales the base theme's spacing; a corners step starts from the base theme's radius or the whole-theme setting; `corners pill` keeps checkboxes square; `headings` refuses `--mode`; `font` refuses `--when` and `--state` and takes a preset in any case.
80
+ - A change that shows nothing says so. A switch of base or mode lists the parts it restyles and the color notes. A misspelled token in `var()` and a typed path or capital letter for a theme get a did-you-mean. Text contrast that is not measured (one variant or state, the soft or outline button) is listed as not checked. The colors in `show` give each mode its own exact value.
81
+ - The copied `theme` commands name `experimental theme` commands in their refusals. `editor new` and `editor how` no longer claim to replace stable commands their copies replace. A package.json without Core gets the install command.
82
+
83
+ - A whole-theme token that no rendered part was seen reading is set with a note saying so, not refused. A part that reads the token the user named takes it for whatever property it feeds. A token named for another variant value (`--color-error-muted` with `--when status:error` on a banner, `--color-icon-pink` on an icon) is taken. A part name such as `constructor` is an unknown part, not a crash.
84
+ - A font for one role keeps its font after a whole-theme font, whatever the order.
85
+ - Easings, font family lists, `light-dark()` and `color-mix()` colors, shadows and times are checked the way the browser reads them. A shadow may use a token color, any length unit or a stacked shadow token. `var()` with a fallback, relative colors and system colors are taken. A time is at most 60 seconds. A font name may hold an apostrophe. `var( --x )` with spaces is checked for cycles.
86
+ - Saved exact tokens are checked on every command; one the rules no longer take names the `undo` that removes it.
87
+ - A size change says that phones keep the base theme's reading sizes, and names scale steps outside 9 to 200 pixels. A refusal that suggests setting a property directly names the property that takes the value. Every suggestion `set`, `undo` and `show` give names the theme and a value it takes, never a placeholder.
88
+ - The theme lock lives beside the Core the command reads, and a command outside a project takes none. When `show` builds again, it says why: a file missing, another CLI version, settings changed after the build, or a build that did not finish.
89
+
90
+ - `astryx experimental theme editor`: theme colors now come from the palette generator. `set <theme> accent <color>` (and the new `neutral`, `success`, `warning`, `danger` and `info` dials) writes the color as a family in `themes/<theme>/palette.config.json`, in the shape `theme palette generate` reads, and runs the same generator to write `tokens/<theme>.palette.ts` and its receipt. The theme's color tokens point at stops of that palette, light and dark from one color, following the stops the official themes use. A token moves to a nearer stop of the same family when it must read (text at 4.5:1, the focus ring at 3:1); the editor no longer mixes colors of its own. `show` reports the palette, which stop feeds each token, and the contrast behind each choice; `how palette` explains it; `undo <theme> accent` removes the family and its tokens. An exact token (`set <theme> --color-accent <color>`) still wins over the palette. Color dials apply to the whole theme: `--on` and `--mode` are refused, with the exact-token command to use instead. (#11134)
91
+ - `experimental theme preview add` checks the theme before it writes any page, and skips a StyleX template page in an app with no StyleX compiler (the result says why). `experimental theme preview app` checks the folder before it builds a `--theme`, so a refusal writes nothing. (#11134)
92
+ - `astryx experimental theme preview`: the preview pages work in a production build. Leaving the Components page no longer crashes the route: a typeahead part (Tokenizer, CommandPalette) gets a small sample search source. On the Components page, a part renders inside the parent its playground names (Step in a Stepper, a SegmentedControlItem in a SegmentedControl, a RadioListItem in a RadioList), a part that only works deeper inside its parent is left out, a status variant is passed as `{type}`, ButtonGroup shows three buttons, and layers that stay closed are left out. A component that still throws shows a short note instead of a blank cell. The Overview page is the sample page's content, without a second app shell. Font: `editor set <theme> font <name>` and `editor show` say near the top when the font's package is not installed, with the exact install line; once it is installed, the next `set` or `show` makes the preview route import its stylesheet. (#11134)
93
+ - `astryx experimental theme preview`: safer refusals and recovery. (#11209)
94
+
95
+ - No refusal suggests deleting or moving files: a damaged theme-preview.json, a page changed by hand, or a file in the way gets plain instructions instead.
96
+ - `--path` at the project root, in `src/` or at the routes folder itself is refused: those folders hold the app. An older preview found there is named, with the remove that clears it.
97
+ - A whole `remove` stops, deleting nothing, when `page.tsx` was changed by hand, since it imports the pages.
98
+ - A formatter run no longer counts as a change by hand. `editor set` and `show` name the preview files they left as they were (`previewStale`).
99
+ - A recorded page whose file is gone is written again, or left out of the nav, so the route always builds. Moved pages get a hash. A failed write leaves no temp file or empty folder, and says which step failed. A read-only file keeps its mode.
100
+ - `preview app --theme` waits for other commands changing that theme, and its retry suggestion keeps `--theme`.
101
+
102
+ - `astryx experimental theme preview`: safer adds, removes and starter apps. (#11209)
103
+
104
+ - Preview pages go in `_pages/`, a folder Next never routes, so a preview at the project root or in `src/` no longer turns on the Pages Router. A preview an older release wrote into `pages/` is moved on the next add or remove.
105
+ - A refusal deletes nothing: `remove <page>` loads the theme before it deletes a file, and names the whole-preview remove when the theme does not load. A theme that is gone is replaced by the app's own theme, with a note.
106
+ - Only files the preview wrote are replaced or deleted, and never one changed by hand since (theme-preview.json records a hash of each). `remove` names the files it kept, the ones already gone, and the ones it wrote again.
107
+ - Files are staged and renamed into place together; a failed write puts every file back and is refused with `ERR_WRITE_FAILED`.
108
+ - A damaged theme-preview.json is refused with `ERR_THEME_INVALID`, naming the file and the way out, in add, list and remove.
109
+ - `--path` is refused when it is a file, in `themes/`, `node_modules/` or a Pages Router folder, in a folder Next does not route, or written with Windows separators, `~` or white space at either end. The open line drops route groups and encodes each folder name.
110
+ - Without `--path`, list and remove find a preview recorded for a theme.
111
+ - `add`: an empty `--template` is refused; a block passed to `--template` says it is not a page and suggests page templates as commands; `--top` is taken as typed and only with a description; a description may be several words without quotes, and only its first 40 different words are ranked; a package that is named but not installed counts as missing; a changed theme writes the default pages again; a page file an interrupted run left behind with the same text is taken over.
112
+ - Suggested commands are shell-safe, and a wrong `--theme` names the closest editor theme.
113
+ - `list`, `remove` and `preview app` refuse extra arguments.
114
+ - `preview app`: the app is written into a temp folder and moved into place, so a failure leaves nothing; folders inside the routes, `themes/` or `node_modules/`, files, dangling links and odd names are refused; a folder with only `.git` counts as empty; every open font the theme names is added with a pinned range; the Colors page is included; a one-mode theme starts in its mode; a stale theme build is rebuilt first; the home page links to the preview, the `.gitignore` covers `node_modules`, and the open line is quoted.
115
+
116
+ - `astryx experimental theme editor how --list` is now a switch, as `--list` is everywhere else in the CLI: the first word says what to list and any words after it filter the list (`how --list tokens accent`), and `--list` alone lists the kinds. Reading a built theme no longer writes a temporary file into `themes/<theme>/`; it uses the project's cache folder. (#11173)
117
+ - `astryx experimental theme`: fixes from a third theming round. `preview add "<description>"` adds the closest page when no page is exactly the one described, and `matched` says which words of the description it covers; only a description no page relates to is refused, and its suggestions repeat `--theme` and `--path`. A page the app cannot show is skipped and the next match is taken, from the ranking and then the template search. A page's nav label is its template's name, however it was added. The accent and status fills keep your exact color in dark mode too when text on them reads at 4.5:1; otherwise dark mode uses the nearest shade that reads, and the result says why. Setting `vibrancy` names the status colors the theme does not set, which keep the base theme's colors (and so do info-tinted surfaces such as colored cards), with the commands that bring them in. `new` lists the mode it applied with the other settings. `show` prints your exact value where an exact token setting wins, and sizes, numbers and fonts once instead of per mode. Notes name a part inside the part a token is set on ("button inside toast"). A token no part reads says it changes nothing you see now. `how` names the resting border (`border … --when variant:secondary`), answers a part's fill and text together ("light gray button with dark text"), and answers a status background ("the error background") with the status color. The Overview page's tabs and other controlled samples no longer throw when clicked, and its open popover and tooltip keep clear of each other at narrow widths too. (#11163)
118
+ - `astryx experimental theme`: fixes from a fourth theming round. `preview add "<description>"` adds an app page when the description names one (an issue tracker, a board, a dashboard, an app screenshot) instead of a hero, takes the side hero for a left-aligned or split hero, says that no page has a top nav of its own, and always says why it picked a page. A base `preview add` says which pages were there already and are written again (`refreshed`). `how` gives each token a value of its own type (`--color-border "<color>"`, `--border-width 1px`; only the `border` property takes a whole border), keeps the fill for a named tint ("light blue tint with blue text"), and no longer reads "border color" as a fill. `undo <theme> <thing>` names the setting it removed (`removed`) instead of printing it as the value in effect. A light-only or dark-only theme lists only its own mode's shades and notes. `show` lists corners or spacing set on a part or group, with what its parts get beside the whole-theme value (`partValues`). `neutral` names the base theme's page background and the command for a white page. `type` says what it still sets when `headings` sets weight or tracking; `type` and `text-size` keep each other's part of the scale in any order. A token no part reads says which tokens are built from it instead of claiming it changes nothing. An installed font says it is installed. A color's text switching between white and near-black says why. (#11165)
119
+ - `astryx experimental theme`: an accent or status fill keeps your exact color in dark mode only when it also stands out from the dark page (3:1) besides text reading on it; otherwise dark mode uses the nearest shade that does both, and the result says why. The preview's Colors page marks such a fill under the shade it really uses, for dark mode too. Suggestions from `preview add` quote the options they repeat, such as a `--path` with a space. (#11165)
120
+ - `astryx experimental theme`: `preview add "<description>"` picks an app page only when the description names the app in a phrase (an issue tracker, an issue detail, a kanban board), so a page with a "buy tickets" button or a landing page for an AI tool no longer gets an app page; a detail view comes before its list, and the ranked page stays first when it already is that app. `how` keeps the fill when a color word belongs to it ("a dark card with a thin border", "colored buttons with a border"). `show` names the radius token each part's corners really read. The `neutral` note offers a white page only in a theme with a light mode. When your exact accent or status color cannot be the dark fill, dark mode uses the shade nearest your color where text reads at 4.5:1 and the fill stands out from the dark page at 3:1. `undo <theme> <thing>` prints `setting` and `removed` as its JSON does. (#11168)
121
+ - `astryx experimental theme`: fixes from a full review. (#11173)
122
+
123
+ - `preview app --theme` copies the whole theme folder, generated colors included, byte for byte, so the new app type-checks.
124
+ - `preview app <dir>` writes only into a new or empty folder (its `--overwrite` option is gone): a folder that is not empty is refused, with a free folder name to use.
125
+ - Translucent text and backgrounds are measured as drawn: each is laid over what is under it before contrast is checked.
126
+ - Two commands can run at once: each render uses a folder of its own.
127
+ - A change that is saved but cannot be checked says "saved, not checked" and exits 0.
128
+ - A light-only or dark-only theme applies only its own mode's settings and names the others, writes one value for the colors it sets, and its in-app preview starts in that mode with no switch.
129
+ - A damaged undo history no longer breaks `set` (a new history starts, with a note), and `undo` says how to fix it.
130
+ - Colors are picked against the theme's own exact page and surface colors.
131
+ - A change that changes nothing builds nothing and adds no undo step.
132
+ - `undo <theme> <thing>` says what applies now (`now`).
133
+ - `show` names the radius token each part reads, or says it is unknown.
134
+ - `how` answers border-only questions without a fill.
135
+ - The preview picker matches app and article pages by phrase: a news story or blog post gets an article page, never a record page; a description no page relates to (no phrase, and fewer than three words or two fifths of them matched) is refused.
136
+ - A preview outside the routes folder says the app does not serve it.
137
+ - More than eight contrast problems end with "and N more".
138
+
139
+ - `astryx experimental theme editor show`: the text output prints the palette paths and contrast notes whole instead of one character per line, and keeps one line for each token a palette family feeds. (#11149)
140
+ - `astryx experimental theme`: fixes from a real theming round. `headings` now keeps heading weight and letter spacing whatever order it and `type` are set in; `type` says what it no longer sets, and `show` marks a setting another one partly hides. A steep `type` scale (editorial, display) keeps text below the base size at its standard sizes, so small text stays readable. `show` lists every setting with its whole scope (`--on`, `--when`, `--state`, `--mode`). A gray color (`accent #171717`) makes gray shades in light and dark instead of inventing a hue. `neutral` no longer tints the page background (`--color-background-body` stays the base theme's). `set` accepts every token a color, `type`, `headings`, `corners`, `spacing` or `text-size` writes, so a dial's notes never name a token `set` refuses. When the components cannot be rendered (two copies of React, say), `new`, `set` and `undo` save the change and say "saved, not checked" with the cause and the code `ERR_THEME_NOT_CHECKED`, instead of failing after writing; `how` says what it could not check instead of listing no readers. A font that is not installed names the closest font that needs no install. `how` answers each aspect once, turns sizes in the question into `--when size:…`, takes each color from the word it belongs to, says when text takes the page's text color, and `how --list` with no kind lists the kinds. `preview add "<description>"` says what it matched and why, leaves app frames out, refuses with the closest pages to name when no page really matches, and takes the next match when a page cannot be shown here. The preview fills the whole window with the theme, shell and edges included; the Overview page now shows what themes most often break, and each cell of the Components page names the command that changes it most. `show --group` is now `show --section`: it picks a section of the theme-building sheet, so "group" only means a group of parts (`--on inputs`). (#11149)
141
+ - Icon sets: authoring a set is easier. An author sees which icon meanings the bundled templates use that the set does not map yet, such as `document` and `share`; a copied template shows a placeholder for each. Only the experimental icon commands, the icon-set lists in `integration check` and Doctor, two icon definitions' search words, and the icon-set guide change. (#11090)
142
+
143
+ - **Authoring receipts.** `experimental icon new-set`, `add`, and `map` end with one line when the set leaves template meanings unmapped: how many there are, the most used first with their template counts, and the `map` command to run. The JSON adds `templateMeanings: {unmapped: [{definition, templates}]}`. A dry run adds nothing.
144
+ - **`experimental icon --definitions`.** Each definition shows how many bundled templates use it (`templates`) and whether the set maps it (`mapped`). The set is the one `--set` names, else the project's main set, else the only set of the icon-set package you run it in. `--set` is now accepted with `--definitions`.
145
+ - **`integration check`.** Each set's `iconSets` entry adds `templateMeanings`, printed under "Template icon meanings not mapped". It is never counted and never fails a check, even with `--strict`.
146
+ - **`new-set --adapter ./<path>#<export>`.** Declares the adapter a library of icon data objects or SVG strings needs, so the set wraps it with no hand edit to the data file.
147
+ - **Clearer receipts.** The first `new-set --from` into a set with no icons says the set was created, not refreshed. `add --variant <look> --all` names the first ten icons the module lacks and how many more; the JSON still lists every one. The command that adds unlisted sets as backups (from `icon use` and Doctor) names every set the same way: by its name, or as `<package>/<set>` when two packages ship that name.
148
+ - **Better suggestions.** A suggested icon whose id only starts with the definition's name and adds another thing (`delete-left`, a backspace key) comes after the icons the definition's words name (`trash`), and a word two definitions share (`store`) comes after the words only one has. `save` adds the word "floppy disk", and `bank` reads "building library" instead of "library".
149
+
150
+ - Icon sets: copied templates draw the right icons in more sets, once a set maps the five new icon definitions. Only the experimental icon-set rewrite of `astryx template`, five new icon definitions, the bundled templates' `icons` declarations, and the icon-set guide change. (#11142)
151
+
152
+ - **Distinct icons keep distinct meanings.** Some bundled templates gave two different icons one meaning, so both drew the same icon in every set. The Settings Dialog's "Keyboard shortcuts" and "Developer" rows, and its paintbrush and swatch, now draw different icons, and so do the icon pairs in Table Filter, Theme Showcase, and the Button Group showcase block. New icon definitions: `keyboard`, `paintBrush`, `documentSearch`, `bookmarkAdd`, and `wallet`. No set released before this change maps them, so with such a set the Settings Dialog's "Keyboard shortcuts", "Color theme" and "Verbose logging" rows, Table Filter's save-view button, and Theme Showcase's wallet draw the placeholder. A set draws these icons once it maps the new definitions (`astryx experimental icon map <definition> <icon> --set <main>`); until then each draws the placeholder, unless a set in your list wraps the template's library.
153
+ - **An icon from a set's own library stays.** When a set in your list wraps the library a template imports an icon from, the icon is one your project chose. With the main set's own library, the icon keeps its import as written. With a backup set's library, an icon that no set maps keeps its import instead of becoming a placeholder. The report lists each one under `kept` with the reason.
154
+
155
+ #### New Features
156
+
157
+ - Open a sign-in dialog from the theme showcase's Sign in button, which was an inert link, so a theme's dialog header, close control, fields and footer buttons can be reviewed together. (#11130)
158
+
159
+ #### Fixes
160
+
161
+ - `astryx component <ExampleName>`, given an example block, still fails with `ERR_UNKNOWN_COMPONENT` and the same name suggestions, but its message now says the name is an example block, that `astryx template <ExampleName>` prints its source, and which `astryx component <Parent> --blocks` lists it. (#11153)
162
+ - `astryx search` no longer counts a component or hook keyword that is another entry's name as a match for that entry, so `spinner` lists Spinner without NumberInput beside it. A keyword still counts when the entry's own description uses the word, or when it names the entry's own family member or its hook. `build` reads keywords as before. (#11162)
163
+ - `astryx template` and `astryx build` read a template's needs from its real imports only. Words in comments, strings and JSX text no longer count as packages, so templates such as `form-wizard`, `form-wizard-vertical` and `table-tree` no longer ask you to install `Next`, `Distribution` or `canvas-editor`. A path alias such as `~/lib` or `#internal`, or a name npm does not accept, is not reported as a package to install. (#11224)
164
+ - Template placeholder images follow dark mode. The placeholder a copied template page shows in place of its demo pictures is now a soft gray at low opacity that takes its tone from the surface behind it, so it no longer shows as a bright light-gray block in a dark theme. The gallery-hero, side-gallery and lightbox gallery examples no longer warn about duplicate keys when every picture is the placeholder. (#11150)
165
+ - Theme commands no longer replace files they do not own, and they report the right errors. `theme template --overwrite` replaces only an earlier copy of the template or a theme source file, and refuses folders, blank paths and paths that are not `.ts`. `theme eject --overwrite` never writes into another theme's folder or a theme the theme editor made, and the result names the packages the fork needs (`missingPackages`, `installCommand`). `theme build --out <folder>` writes `<name>.css` into the folder; a build never replaces its source, or a file at a path `--out` names that it did not write, and two themes with one name in one run are refused (a header-less output of a CLI before 0.6.7 at the default paths, family outputs included, is still replaced). When `--out` names a file that a CLI before 0.6.7 wrote, the build says so: delete that file and run the same build again. Two `theme add`, `use` or `remove` commands at once keep both changes. A theme whose local folder or package is gone no longer blocks `use`, `add` or `remove` of other themes; it is left out with a note; one broken local theme folder no longer hides every other theme from `list` and `add`. `add` says which owner it chose when a local theme shadows a package theme. An option without its value is `ERR_MISSING_ARGUMENT` with the command's usage, and `astryx help <group> <command>` prints that command's help. (#11210)
166
+ - The theme showcase's Sign in dialog opens empty each time, not with what was typed before a Cancel. (#11139)
167
+
168
+ #### Performance
169
+
170
+ - The CLI turns on Node's compile cache, so a run skips most of compiling the CLI's modules again. The cache sits in the user's own folder in the system temp folder (`node-compile-cache-<uid>`), used only once it exists (the first run on a machine just makes the folder, so a one-off run pays nothing for it) and only while it is a real folder the user owns and no one else can reach. Where the system has no user ids (Windows), that cannot be checked, so the cache stays off. `NODE_DISABLE_COMPILE_CACHE=1` turns it off. A cache that cannot be read or written is skipped without a word, and every command prints the same output. (#11217)
171
+ - `astryx --help`, `-h` and `help` print the root help from a command list stored in the package when it is published, instead of loading every command first. The list holds the terms and descriptions the fully loaded CLI prints, so while every command loads the help reads the same. A command whose module fails to load is listed in the published root help under its normal description, instead of being marked as failed; running that command still reports the failure. (#11194)
172
+ - Commands that read the docs Astryx ships (`search`, `build`, `docs`, `template`) read each shipped doc that holds only plain data from a copy of its exports stored in the package when it is published, instead of importing the file. The copy is keyed by the file's text, so an edited doc, a doc that imports or calls anything as it loads, and every integration's docs are imported as before. Every command prints the same output. (#11191)
173
+ - `search` and `build` read the components of a template Astryx ships from a list stored in the package when it is published, instead of parsing the template's source on every call; `template` does too when it leaves a template's demo content unchanged. The list holds exactly what parsing returns, keyed by the source text, so a changed source or an integration's template is parsed as before. Every command prints the same output. (#11190)
174
+ - A process that calls `themeTargets()` more than once scans Core's component docs once. It reuses that scan while every folder and doc it read is unchanged, as the docs and search catalogs do. A Core reached through a symlink, as a project's node_modules reaches it, shares the scan of its real path. A one-shot `astryx theme targets` and the theme build's target check still scan once. Every command reports the same targets. (#10981)
175
+
176
+ #### Documentation
177
+
178
+ - AppShell's guidance on naming its navigation landmarks now says to pass `label` to TopNav and `aria-label` to SideNav. SideNav has no `label` prop; it has a translated default name, and `aria-label` renames it. (#11151)
179
+ - The calendars guide names every calendar by its CLDR name, such as Minguo, Dangi, Hijri, and Ethiopic, with its identifier beside it. (#11102)
180
+ - The token tables in `astryx docs` say that their values are Core's defaults, which a theme replaces: the columns read "Core default", "Core default (light)" and "Core default (dark)". The Color topic also says that each theme defines its own values and that `astryx theme list` shows the themes that are available. (#11089)
181
+ - Add hook documentation and interactive table cell truncation example block for `useTruncation`, demonstrating responsive string truncation and accessibility tooltips. (#10555)
182
+ - InternationalizationProvider shows its examples in reading order: load a shipped locale, mirror the layout for right-to-left text (a new code example), override one string, then the calendar examples. Each live example is titled after its code example, so the two lists match. (#11094)
183
+
184
+ #### Other Changes
185
+
186
+ - Internal: the module loader imports a user module through the same small module the doc importers use, which the CLI's own test project loads natively, so a theme build's doc reads no longer time out its tests on a busy machine. No change to any command's output. (#11119)
187
+
188
+ #### Contributors
189
+
190
+ Thanks to everyone who contributed to this release:
191
+
192
+ - @cixzhang
193
+ - @josephfarina
194
+ - @nynexman4464
195
+ - @utkarshpatwa393-sys
196
+ - @vjeux
197
+
198
+ ---
199
+
3
200
  # 0.7.13
4
201
 
5
202
  #### Experimental APIs
@@ -16,6 +16,19 @@ export function themeRecordOwner(theme: import("../../foundation/discovery/theme
16
16
  * @returns {BundledTheme[]}
17
17
  */
18
18
  export function listThemes(): BundledTheme[];
19
+ /**
20
+ * A local theme folder that failed validation and was left out.
21
+ * @typedef {{slug: string, path: string, reason: string}} SkippedLocalTheme
22
+ */
23
+ /**
24
+ * Available themes, and the local folders left out because they are broken.
25
+ * @param {string} [cwd]
26
+ * @returns {Promise<{themes: import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme[], skipped: SkippedLocalTheme[]}>}
27
+ */
28
+ export function listAvailableThemeState(cwd?: string): Promise<{
29
+ themes: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme[];
30
+ skipped: SkippedLocalTheme[];
31
+ }>;
19
32
  /**
20
33
  * Bundled themes plus local and installed integration themes available to the
21
34
  * project.
@@ -61,6 +74,18 @@ export function ejectThemeFiles(theme: import("../../foundation/discovery/theme-
61
74
  targetPath?: string;
62
75
  overwrite?: boolean;
63
76
  }): string;
77
+ /**
78
+ * The packages the fork imports that the app does not declare. A fork that
79
+ * imports a missing package (bundled icon sets use `lucide-react`) fails to
80
+ * build, so the receipt names them with an install command.
81
+ * @param {string} outputDir fork folder, relative to cwd
82
+ * @param {string[]} files
83
+ * @param {string} cwd
84
+ */
85
+ export function forkNeeds(outputDir: string, files: string[], cwd: string): {
86
+ missingPackages: string[];
87
+ installCommand: string | null;
88
+ };
64
89
  /**
65
90
  * Resolve an available theme by case-insensitive slug and optional owner package.
66
91
  * Without an explicit package, a local theme shadows package themes that share
@@ -149,6 +174,14 @@ export function fetchCarriedThemeCoreDir(cwd: string): string | null;
149
174
  * A bundled theme entry kept for the historical public `listThemes()` helper.
150
175
  */
151
176
  export type BundledTheme = Pick<import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme, "slug" | "displayName" | "description" | "maintained" | "entry" | "exportName" | "files">;
177
+ /**
178
+ * A local theme folder that failed validation and was left out.
179
+ */
180
+ export type SkippedLocalTheme = {
181
+ slug: string;
182
+ path: string;
183
+ reason: string;
184
+ };
152
185
  import { readThemeState } from '../../foundation/config/theme-state.mjs';
153
186
  import { BUNDLED_THEME_PACKAGE } from '../../foundation/discovery/theme-discovery.mjs';
154
187
  import { THEMES_DIR } from '../../foundation/discovery/theme-discovery.mjs';