@astryxdesign/cli 0.7.14-canary.gfb823d9 → 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 (135) hide show
  1. package/CHANGELOG.md +197 -0
  2. package/api/component/_adapter.d.mts +15 -0
  3. package/api/component/_adapter.mjs +76 -0
  4. package/api/component/component.mjs +8 -1
  5. package/api/search/_named-keywords.d.mts +31 -0
  6. package/api/search/_named-keywords.mjs +177 -0
  7. package/api/search/search-index.mjs +8 -1
  8. package/api/search/search.d.mts +6 -1
  9. package/api/search/search.mjs +49 -8
  10. package/api/theme/_adapter.d.mts +33 -0
  11. package/api/theme/_adapter.mjs +352 -16
  12. package/api/theme/build/build.mjs +261 -10
  13. package/api/theme/eject/eject.mjs +13 -1
  14. package/api/theme/list/list.mjs +11 -2
  15. package/api/theme/palette/generate/color.d.mts +2 -0
  16. package/api/theme/palette/generate/color.mjs +1 -1
  17. package/api/theme/template/template.mjs +139 -6
  18. package/api/theme/theme.type.d.mts +15 -1
  19. package/api/theme/theme.type.mjs +9 -3
  20. package/api/theme/themeAdd.doc.mjs +1 -1
  21. package/api/theme/themeBuild.doc.mjs +10 -2
  22. package/api/theme/themeEject.doc.mjs +2 -2
  23. package/api/theme/themeListAvailable.doc.mjs +1 -1
  24. package/api/theme/themeRemove.doc.mjs +1 -1
  25. package/api/theme/themeTemplate.doc.mjs +8 -0
  26. package/api/theme/themeUse.doc.mjs +1 -1
  27. package/api/theme-edit/_adapter.d.mts +36 -2
  28. package/api/theme-edit/_adapter.mjs +340 -12
  29. package/api/theme-edit/_check.d.mts +28 -25
  30. package/api/theme-edit/_check.mjs +876 -308
  31. package/api/theme-edit/_color.d.mts +53 -4
  32. package/api/theme-edit/_color.mjs +406 -79
  33. package/api/theme-edit/_compiler.d.mts +14 -6
  34. package/api/theme-edit/_compiler.mjs +89 -59
  35. package/api/theme-edit/_context.d.mts +28 -8
  36. package/api/theme-edit/_context.mjs +142 -19
  37. package/api/theme-edit/_edit.d.mts +3 -1
  38. package/api/theme-edit/_edit.mjs +746 -76
  39. package/api/theme-edit/_how-commands.d.mts +91 -0
  40. package/api/theme-edit/_how-commands.mjs +269 -0
  41. package/api/theme-edit/_how-question.d.mts +57 -0
  42. package/api/theme-edit/_how-question.mjs +2574 -0
  43. package/api/theme-edit/_how.d.mts +27 -8
  44. package/api/theme-edit/_how.mjs +776 -175
  45. package/api/theme-edit/_overview.d.mts +9 -0
  46. package/api/theme-edit/_overview.mjs +296 -0
  47. package/api/theme-edit/_palette.d.mts +155 -15
  48. package/api/theme-edit/_palette.mjs +1446 -262
  49. package/api/theme-edit/_parts.mjs +61 -5
  50. package/api/theme-edit/_png.d.mts +18 -6
  51. package/api/theme-edit/_png.mjs +135 -25
  52. package/api/theme-edit/_preview-app.d.mts +32 -11
  53. package/api/theme-edit/_preview-app.mjs +1976 -285
  54. package/api/theme-edit/_preview.d.mts +39 -8
  55. package/api/theme-edit/_preview.mjs +367 -41
  56. package/api/theme-edit/_settings.d.mts +147 -11
  57. package/api/theme-edit/_settings.mjs +908 -99
  58. package/api/theme-edit/_tables.d.mts +4 -16
  59. package/api/theme-edit/_tables.mjs +51 -117
  60. package/api/theme-edit/theme-edit.type.d.mts +102 -66
  61. package/api/theme-edit/theme-edit.type.mjs +58 -40
  62. package/api/theme-edit/themeEditHow.doc.mjs +17 -6
  63. package/api/theme-edit/themeEditNew.doc.mjs +21 -5
  64. package/api/theme-edit/themeEditPreviewAdd.doc.mjs +18 -5
  65. package/api/theme-edit/themeEditPreviewApp.doc.mjs +12 -9
  66. package/api/theme-edit/themeEditPreviewList.doc.mjs +11 -2
  67. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +29 -3
  68. package/api/theme-edit/themeEditSet.doc.mjs +14 -8
  69. package/api/theme-edit/themeEditShow.doc.mjs +10 -5
  70. package/api/theme-edit/themeEditUndo.doc.mjs +9 -4
  71. package/assets/discover/official-packages.json +4 -0
  72. package/assets/docs/tree/icon-sets.doc.mjs +3 -3
  73. package/assets/docs.generated.json +1 -0
  74. package/assets/icons/definitions/bookmarkAdd.doc.mjs +9 -0
  75. package/assets/icons/definitions/documentSearch.doc.mjs +9 -0
  76. package/assets/icons/definitions/keyboard.doc.mjs +9 -0
  77. package/assets/icons/definitions/paintBrush.doc.mjs +9 -0
  78. package/assets/icons/definitions/wallet.doc.mjs +9 -0
  79. package/assets/preview-app/gitignore +3 -0
  80. package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.doc.mjs +1 -1
  81. package/assets/templates/blocks/components/Lightbox/LightboxGallery.tsx +1 -1
  82. package/assets/templates/components.generated.json +1 -0
  83. package/assets/templates/pages/gallery-hero/page.tsx +8 -2
  84. package/assets/templates/pages/settings-dialog/template.doc.mjs +3 -3
  85. package/assets/templates/pages/side-gallery/page.tsx +1 -1
  86. package/assets/templates/pages/table-filter/template.doc.mjs +2 -2
  87. package/assets/templates/pages/theme-showcase/template.doc.mjs +1 -1
  88. package/clients/cli/bin/astryx.mjs +37 -5
  89. package/clients/cli/commands/experimental/theme.mjs +422 -57
  90. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +22 -9
  91. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +103 -4
  92. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +13 -8
  93. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +5 -5
  94. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +5 -5
  95. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  96. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +3 -2
  97. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +2 -8
  98. package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +2 -2
  99. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
  100. package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -1
  101. package/clients/cli/commands/experimental-theme.doc.mjs +3 -4
  102. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  103. package/clients/cli/commands/theme-eject.doc.mjs +3 -3
  104. package/clients/cli/commands/theme-remove.doc.mjs +2 -2
  105. package/clients/cli/commands/theme-template.doc.mjs +11 -4
  106. package/clients/cli/commands/theme.mjs +145 -46
  107. package/clients/cli/commands.generated.json +1 -0
  108. package/clients/cli/index.mjs +96 -5
  109. package/clients/cli/lib/json-shim.mjs +29 -1
  110. package/foundation/config/project.d.mts +16 -2
  111. package/foundation/config/project.mjs +40 -6
  112. package/foundation/config/theme-state.d.mts +9 -0
  113. package/foundation/config/theme-state.mjs +20 -1
  114. package/foundation/discovery/template-adapter.d.mts +12 -1
  115. package/foundation/discovery/template-adapter.mjs +29 -4
  116. package/foundation/discovery/template-icons.d.mts +13 -0
  117. package/foundation/discovery/template-icons.mjs +76 -0
  118. package/foundation/discovery/template-needs.d.mts +7 -0
  119. package/foundation/discovery/template-needs.mjs +117 -8
  120. package/foundation/discovery/template-source-tree.d.mts +5 -1
  121. package/foundation/discovery/template-source-tree.mjs +6 -4
  122. package/foundation/discovery/theme-discovery.d.mts +14 -3
  123. package/foundation/discovery/theme-discovery.mjs +45 -12
  124. package/foundation/doc-compiler/import.mjs +68 -3
  125. package/foundation/doc-compiler/stored-docs.d.mts +27 -0
  126. package/foundation/doc-compiler/stored-docs.mjs +65 -0
  127. package/foundation/fs/fs-error.d.mts +17 -0
  128. package/foundation/fs/fs-error.mjs +34 -0
  129. package/foundation/response/error-codes.d.mts +3 -1
  130. package/foundation/response/error-codes.doc.mjs +13 -1
  131. package/foundation/response/error-codes.mjs +11 -1
  132. package/foundation/response/response-types.doc.mjs +6 -6
  133. package/package.json +6 -7
  134. package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +0 -73
  135. package/clients/cli/commands/experimental-theme-palette.doc.mjs +0 -37
@@ -10,9 +10,9 @@ export const doc = {
10
10
  namespace: 'cli/commands',
11
11
  stability: 'experimental',
12
12
  summary:
13
- "Look up a part, family, setting or aspect; answer a question in plain words; read a picture's colors; or list what you can set",
13
+ "Look up a part, group, setting or aspect; answer a question in plain words; read a picture's colors; or list what you can set",
14
14
  description:
15
- 'One command for every question. With nothing named, it prints its usage and examples. A part (button, card; --list parts): what it reads for each aspect (text, background, border, corners, shadow, spacing, font, size) and under which variant or state, its variants (--when) and states (--state), the parts inside it (a token set --on the part reaches them), and its family. A family (inputs, containers, checks, menus): its members and whether styling one styles all. A setting: a dial\'s rungs and examples, a token\'s type, default and the parts that read it, or a CSS property and the parts that set it. An aspect (colors, text, background, border, corners, shadow, spacing, font, size): the dial and the whole-theme tokens most parts read for it. `palette`: how the color dials grow the theme palette and which stop feeds each token; a color dial (accent, neutral, success, warning, danger, info) also lists its stops. A question in plain words ("bold white text in the header", "glossy gradient header"): it finds the parts (header, nav links, banner, cards, inputs, buttons and their variants...) and aspects (text color, background, gradient, corners, border, shadow or bevel, spacing, font, bold, letter spacing) and answers with exact commands from what each part really reads: the direct property (always works) and the token route; a part with variants says a change without --when reaches every variant. A PNG picture: its main colors, biggest share first, with where each sits (a number after the file sets how many, default 14), or with --at the exact color at pixel points (no browser needed). --list dials|tokens|parts|families|properties lists what a change can name; a subject then filters the list. Experimental: it may change or be removed in a patch release.',
15
+ 'One command for every question. With nothing named, it prints its usage and examples. A part (button, card; --list parts): what it reads for each aspect (text, background, border, corners, shadow, spacing, font, size), each condition written as the --when and --state flags `set` takes or marked not settable with the reason, its variants, every state `set` accepts, the parts inside it (a token set --on the part reaches them), and its group; a part the part data does not have says so, with commands that still apply. A group (inputs, containers, checks, menus): its members and whether styling one styles all. A setting: a dial\'s rungs and examples, a token\'s type, default and the parts that read it (and, when none does, whether Core\'s stylesheet still uses it), or a CSS property and the parts that set it. An aspect (text, background, border, corners, shadow, spacing, font, size): the dial and the whole-theme tokens most parts read for it. `colors` (or `palette`): how the theme\'s colors are made: one seed per color, light and dark shades generated with the same generator as `theme palette generate`, the shade each token starts from, vibrancy, the Colors preview page and the exact-token escape hatch. A lookup takes any case, a plural, and a token name without its dashes. A question in plain words ("bold white text in the header", "remove shadows from cards", "cards: 8px radius; buttons: 4px"): it reads each clause for the parts (and their variant, size, state or mode), what to change, the values typed (hex, rgb(), lengths, dashed), and whether it asks for more, less or none ("shouldn\'t", "turn off", "never", "too sharp", "everything except X" included), and answers with exact commands; a typed value always wins over a color word, and a hex color with the wrong number of digits is refused by name, never replaced with a sample. "In dark mode" carries --mode dark to every color command; a change that cannot differ by mode, or a dark-mode ask on a light-only theme, says so instead. A question about what something is ("what does --color-accent do") gets the lookup. Several changes in one question come first as one sequence (`sequence: true`: run every command in order, at most 12), with repeated and overwritten steps left out; two asks that contradict each other are offered as choices. Changes come before lookups. Every suggested command names the theme (`theme`: the one named with `theme`, the only one, or the one an editor command changed last, said in `themeNote`; `themeChosenBy` says which: named, only, last-changed or none; with none, my-theme, made first), holds a real value, never a placeholder or a comment, and is checked as `set` checks it: a command `set` would refuse, or that changes nothing, is left out and listed in `refused` with the reason. A question with no answer says why in `hint`, with the next commands in `run`. A PNG picture (by any file name; other formats are refused by their bytes): its main colors from every pixel (on an even grid past 4 million), biggest share first, with where each sits, see-through pixels skipped, tRNS included (a number after the file sets how many, default 14), or with --at the exact color and alpha at pixel points; a picture over 40 million pixels (20 million at 16 bits), or with pixel data that is damaged or shorter than its header says, is refused before it is decoded. --list <what> lists what a change can name (dials, tokens, parts, groups or properties, in any case, singular or plural; kinds or no word lists those kinds), and the other words filter the list. Experimental: it may change or be removed in a patch release.',
16
16
  fn: 'themeEditHow',
17
17
  args: [
18
18
  {
@@ -24,16 +24,22 @@ export const doc = {
24
24
  ],
25
25
  options: [
26
26
  {
27
- flag: '--list <kind>',
27
+ flag: '--list',
28
28
  param: 'options.list',
29
29
  description:
30
- 'List what a change can name: dials, tokens (with type, default and how many parts read each), parts (with component, family, variants and states), families, or properties (the common CSS properties; a filter searches every standard one). The subject, if any, filters the list',
30
+ 'List what a change can name; the word that names a kind says what, wherever it is (any case, singular or plural): dials, tokens (with type, default and how many parts read each), parts (one item per name, with its components, group, variants and states), groups, or properties (the common CSS properties; a filter searches every standard one). The other words filter the list, and may start with --. --list=tokens works too. With no word, or kinds, the kinds it lists',
31
+ },
32
+ {
33
+ flag: '--theme <name>',
34
+ param: 'options.theme',
35
+ description:
36
+ 'The theme the suggested commands are for, checked against its settings (default: the only theme the editor made in the app; with several, the one an editor command changed last; with none, a theme named my-theme that the answer makes first). An empty name or --theme given twice is refused, for every subject',
31
37
  },
32
38
  {
33
39
  flag: '--at <points...>',
34
40
  param: 'options.at',
35
41
  description:
36
- 'With a PNG picture: the exact color at pixel points x,y, given as "40,20;300,180", "40,20 300,180", a repeated --at, or a flat "40,20,300,180"',
42
+ 'With a PNG picture: the exact color and alpha at pixel points x,y (whole numbers inside the picture), given as "40,20;300,180", "40,20 300,180", a repeated --at, or a flat "40,20,300,180"',
37
43
  },
38
44
  ],
39
45
  examples: [
@@ -45,6 +51,10 @@ export const doc = {
45
51
  label: 'A question',
46
52
  cli: 'astryx experimental theme editor how "bold white text in the header"',
47
53
  },
54
+ {
55
+ label: 'A question, with commands for one theme',
56
+ cli: 'astryx experimental theme editor how "remove shadows from cards" --theme brand',
57
+ },
48
58
  {
49
59
  label: 'A setting',
50
60
  cli: 'astryx experimental theme editor how --color-accent',
@@ -54,8 +64,12 @@ export const doc = {
54
64
  cli: 'astryx experimental theme editor how target.png --at "40,20;300,180"',
55
65
  },
56
66
  {
57
- label: 'The palette the color dials grow',
58
- cli: 'astryx experimental theme editor how palette',
67
+ label: 'How the colors are made',
68
+ cli: 'astryx experimental theme editor how colors',
69
+ },
70
+ {
71
+ label: 'A color question in plain words',
72
+ cli: 'astryx experimental theme editor how "make it more colorful"',
59
73
  },
60
74
  {
61
75
  label: 'Every dial',
@@ -80,9 +94,8 @@ export const doc = {
80
94
  },
81
95
  {
82
96
  code: 1,
83
- when: 'an unknown option, an unknown --list kind, --at without a picture, a missing or unreadable PNG file, or an odd count of numbers in --at',
97
+ when: 'an unknown option, an unknown or empty theme, --theme given twice, an unknown --list kind, --list given twice, --at without a picture, a picture that is not a PNG or is damaged or too big, an --at point that is not whole pixel numbers or falls outside the picture, a count beside --at, or a count that is not a positive whole number, or a missing picture',
84
98
  },
85
99
  ],
86
100
  related: ['experimental theme editor', 'experimental theme targets'],
87
- replaces: ['theme targets'],
88
101
  };
@@ -11,7 +11,7 @@ export const doc = {
11
11
  stability: 'experimental',
12
12
  summary: 'Start a theme in themes/<theme>/, optionally on a built-in theme',
13
13
  description:
14
- 'Makes themes/<theme>/ with <theme>.settings.json (the settings this command owns), the generated <theme>.settings.ts, <theme>.theme.ts (which extends it and is yours), and the built <theme>.css and <theme>.js (the same build as `astryx theme build`), then writes preview.html, the sample app page with the theme. --like builds on a built-in theme (neutral, stone, matcha, y2k, gothic, chocolate, butter; its package must be installed); without it the theme starts from Astryx defaults. Change the base later with `astryx experimental theme editor set <theme> base <theme|none>`. Afterwards, <theme>.theme.ts is yours: it extends the generated <theme>.settings.ts, and every later change rewrites only the settings files, so your own edits in <theme>.theme.ts survive. A theme name is lowercase letters, digits and dashes. Experimental: it may change or be removed in a patch release.',
14
+ 'Makes themes/<theme>/ with <theme>.settings.json (the settings this command owns), the generated <theme>.settings.ts, <theme>.theme.ts (which extends it and is yours), and the built <theme>.css and <theme>.js (the same build as `astryx theme build`), then writes preview.html, the sample app page with the theme. --like builds on a built-in theme (neutral, stone, matcha, y2k, gothic, chocolate, butter; its package must be installed); without it the theme starts from Astryx defaults. Any `set` dial can be a flag too (--accent "#7c3aed" --font inter --corners round --vibrancy 60 ...): the same names, values and checks as `set`, all applied in the one build, with one result that lists them. Change the base later with `astryx experimental theme editor set <theme> base <theme|none>`. Afterwards, <theme>.theme.ts is yours: it extends the generated <theme>.settings.ts, and every later change rewrites only the settings files, so your own edits in <theme>.theme.ts survive. A theme name is lowercase letters, digits and dashes. Experimental: it may change or be removed in a patch release.',
15
15
  fn: 'themeEditNew',
16
16
  args: [
17
17
  {
@@ -33,6 +33,102 @@ export const doc = {
33
33
  description:
34
34
  'Also take PNG pictures of the previews (light and dark), with a Playwright installed in the project or a Chrome or Chromium found on the machine; without one, the result says how to get it. Nothing else changes',
35
35
  },
36
+ {
37
+ flag: '--corners <rung>',
38
+ param: 'options.settings',
39
+ description:
40
+ 'How round corners are: square, small, medium, large, round, pill, or a size like 6px. The same value and check as `set <theme> corners`',
41
+ },
42
+ {
43
+ flag: '--spacing <rung>',
44
+ param: 'options.settings',
45
+ description:
46
+ 'How much room: tight, compact, medium, roomy or spacious. The same value and check as `set <theme> spacing`',
47
+ },
48
+ {
49
+ flag: '--accent <color>',
50
+ param: 'options.settings',
51
+ description:
52
+ 'The brand color; its light and dark shades are generated from it. The same value and check as `set <theme> accent`',
53
+ },
54
+ {
55
+ flag: '--neutral <color>',
56
+ param: 'options.settings',
57
+ description:
58
+ 'The gray of surfaces, text and borders; its shades are generated from it. The same value and check as `set <theme> neutral`',
59
+ },
60
+ {
61
+ flag: '--success <color>',
62
+ param: 'options.settings',
63
+ description:
64
+ 'The success color. The same value and check as `set <theme> success`',
65
+ },
66
+ {
67
+ flag: '--warning <color>',
68
+ param: 'options.settings',
69
+ description:
70
+ 'The warning color. The same value and check as `set <theme> warning`',
71
+ },
72
+ {
73
+ flag: '--danger <color>',
74
+ param: 'options.settings',
75
+ description:
76
+ 'The danger (error) color. The same value and check as `set <theme> danger`',
77
+ },
78
+ {
79
+ flag: '--info <color>',
80
+ param: 'options.settings',
81
+ description:
82
+ 'The info color. The same value and check as `set <theme> info`',
83
+ },
84
+ {
85
+ flag: '--vibrancy <0-100>',
86
+ param: 'options.settings',
87
+ description:
88
+ 'How saturated the generated colors are (50 is the default); needs a color. The same value and check as `set <theme> vibrancy`',
89
+ },
90
+ {
91
+ flag: '--font <font>',
92
+ param: 'options.settings',
93
+ description:
94
+ 'The typeface: a preset, an open font, a family name or a stack. The same value and check as `set <theme> font`',
95
+ },
96
+ {
97
+ flag: '--headings <style>',
98
+ param: 'options.settings',
99
+ description:
100
+ 'Heading weight (light to heavy) or tracking (tight, tighter, normal, wide). The same value and check as `set <theme> headings`',
101
+ },
102
+ {
103
+ flag: '--surfaces <style>',
104
+ param: 'options.settings',
105
+ description:
106
+ 'flat, outlined, raised or glass. The same value and check as `set <theme> surfaces`',
107
+ },
108
+ {
109
+ flag: '--buttons <style>',
110
+ param: 'options.settings',
111
+ description:
112
+ 'solid, outline, soft or caps. The same value and check as `set <theme> buttons`',
113
+ },
114
+ {
115
+ flag: '--type <style>',
116
+ param: 'options.settings',
117
+ description:
118
+ 'compact, standard, editorial or display. The same value and check as `set <theme> type`',
119
+ },
120
+ {
121
+ flag: '--text-size <size>',
122
+ param: 'options.settings',
123
+ description:
124
+ 'small, medium, large, larger, or a number. The same value and check as `set <theme> text-size`',
125
+ },
126
+ {
127
+ flag: '--mode <modes>',
128
+ param: 'options.settings',
129
+ description:
130
+ 'both, light-only or dark-only. The same value and check as `set <theme> mode`',
131
+ },
36
132
  ],
37
133
  examples: [
38
134
  {
@@ -43,6 +139,10 @@ export const doc = {
43
139
  label: 'Start from Astryx defaults',
44
140
  cli: 'astryx experimental theme editor new brand',
45
141
  },
142
+ {
143
+ label: 'Start with settings, in one build',
144
+ cli: 'astryx experimental theme editor new brand --like neutral --accent "#7c3aed" --font inter --corners round --vibrancy 60',
145
+ },
46
146
  ],
47
147
  outsideProject: 'refuse',
48
148
  notes: [
@@ -54,13 +154,12 @@ export const doc = {
54
154
  exitCodes: [
55
155
  {
56
156
  code: 0,
57
- when: 'the theme is made and built, and its preview is written',
157
+ when: 'the theme is made and built, and its preview is written; or made but not checked, when the components could not be rendered: the output starts with [warn] saved, not checked (ERR_THEME_NOT_CHECKED) and the cause',
58
158
  },
59
159
  {
60
160
  code: 1,
61
- when: 'a name that is not lowercase letters, digits and dashes, a theme that already exists, a --like that is not a built-in theme or is not installed, no Core installed in the folder, or a build failure (nothing is left behind)',
161
+ when: 'a name that is not lowercase letters, digits and dashes, a theme that already exists, a --like that is not a built-in theme or is not installed, a setting flag that `set` would refuse, no Core installed in the folder, or a build failure (nothing is left behind)',
62
162
  },
63
163
  ],
64
164
  related: ['experimental theme editor', 'experimental theme compile'],
65
- replaces: ['theme template', 'theme eject'],
66
165
  };
@@ -12,7 +12,7 @@ export const doc = {
12
12
  summary:
13
13
  'Change one thing in a theme: checked against what the components read, built, previewed',
14
14
  description:
15
- "Changes one thing. The thing is a dial (corners, spacing, accent, neutral, success, warning, danger, info, font, headings, surfaces, buttons, type, text-size, base, mode: big moves with named rungs; `more`/`less` step a rung), a design token by name (--color-background-body; `how --list tokens`), or a CSS property on a part (background --on card; needs --on). Every change is CHECKED first against the installed Core: the part, the --when variant and value, the --state, the token's type (color, size, number, font, shadow; only colors and shadows may differ by mode), and whether the part, or a part inside it, actually reads the token for what you mean. A change that cannot take effect is REFUSED: exit 1, an error code, nothing written, and the suggestions lead with the command that works (the token the part really reads, or the property that sets it directly). Families: --on <family> styles every member; styling one member of an always-alike family (inputs, checks) styles the whole family unless --only. A setting on a part beats a whole-theme dial, and a dial never overwrites one. After building, a plain part setting that a more specific base-theme rule would beat (such as a heading level) is repeated on those variant keys, and the result says so. The result lists resolved token changes, part styles written, contrast problems this theme caused versus its base (text below 4.5:1), notes (the palette stops a color dial feeds and any stop contrast moved, and font loading: the exact install line when the font package is missing), and writes themes/<theme>/preview.html. Values with spaces go in quotes: gradients, several shadows, font stacks. Dials: corners square|small|medium|large|round|pill|more|less|<size>; spacing tight|compact|medium|roomy|spacious|more|less; accent, neutral, success, warning, danger, info <color> (a color dial: it seeds that family of the theme palette, themes/<theme>/palette.config.json, grown by the same generator as `theme palette generate` into tokens/<theme>.palette.ts and its receipt; the color tokens point at palette stops, light and dark from the one color, and 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 whole theme only, no --on or --mode; `how palette` lists the stops); font <preset, open font, family or stack>; headings light|regular|medium|semibold|bold|heavy or tight|tighter|normal|wide; surfaces flat|outlined|raised|glass; buttons solid|outline|soft|caps; type compact|standard|editorial|display; text-size small|medium|large|larger|more|less|<number>; base <built-in theme>|none; mode both|light-only|dark-only. `astryx experimental theme editor how --list dials` explains each. An exact token always wins over the palette: `set <theme> --color-accent <color>` (with --on or --mode if you need them) is the escape hatch, whatever order the settings were made in. Experimental: it may change or be removed in a patch release.",
15
+ "Changes one thing. The thing is a dial (corners, spacing, accent, neutral, success, warning, danger, info, vibrancy, font, headings, surfaces, buttons, type, text-size, base, mode: big moves with named rungs; `more`/`less` step a rung), a design token by name (--color-background-body; `how --list tokens`), or a CSS property on a part (background --on card; needs --on). Every change is CHECKED first against the installed Core: the part, the --when variant and value, the --state, the token's type (color, size, number, font, shadow; only colors may differ by mode; a shadow is one value for both), and whether the part, or a part inside it, actually reads the token for what you mean. A change that cannot take effect is REFUSED: exit 1, an error code, nothing written, and the suggestions lead with the command that works (the token the part really reads, or the property that sets it directly). Groups: --on <group> (inputs, checks, containers, menus) styles every member; styling one member of an always-alike group (inputs, checks) styles the whole group unless --only. A setting on a part beats a whole-theme dial, and a dial never overwrites one. After building, a plain part setting that a more specific base-theme rule would beat (such as a heading level) is repeated on those variant keys, and the result says so. The result lists resolved token changes, part styles written, contrast problems this theme caused versus its base (text below 4.5:1), notes (the shade a color's main token uses, any shade moved so text reads, and the generated color files; font loading: the exact install line when the font package is missing), and writes themes/<theme>/preview.html. Values with spaces go in quotes: gradients, several shadows, font stacks. Dials: corners square|small|medium|large|round|pill|more|less|<size>; spacing tight|compact|medium|roomy|spacious|more|less; accent, neutral, success, warning, danger, info <color> (a color: the editor generates its light and dark shades from the one color, with the same generator as `theme palette generate`, and points the color tokens at them; a token moves to a nearby shade when it must read: text at 4.5:1, the focus ring at 3:1; the whole theme only, no --on or --mode; `how colors` explains it and the Colors preview page shows every shade); vibrancy 0-100|more|less (how saturated the generated colors are; 50 is the default; needs a color); font <preset, open font, family or stack>; headings light|regular|medium|semibold|bold|heavy or tight|tighter|normal|wide; surfaces flat|outlined|raised|glass; buttons solid|outline|soft|caps; type compact|standard|editorial|display; text-size small|medium|large|larger|more|less|<number of pixels, 10 to 32>; base <built-in theme>|none; mode both|light-only|dark-only. `astryx experimental theme editor how --list dials` explains each. An exact token always wins over the generated colors: `set <theme> --color-accent <color>` (with --on or --mode if you need them) is the escape hatch, whatever order the settings were made in. Experimental: it may change or be removed in a patch release.",
16
16
  fn: 'themeEditSet',
17
17
  args: [
18
18
  {
@@ -37,7 +37,7 @@ export const doc = {
37
37
  flag: '--on <where>',
38
38
  param: 'options.on',
39
39
  description:
40
- 'Where it applies (default: the whole theme): a part (button, card, app-shell-header; how --list parts), a family (inputs, containers, checks, menus; how --list families), or for font a role (body, heading, code)',
40
+ 'Where it applies (default: the whole theme): a part (button, card, app-shell-header; how --list parts), a group (inputs, containers, checks, menus; how --list groups), or for font a role (body, heading, code)',
41
41
  },
42
42
  {
43
43
  flag: '--when <prop:value>',
@@ -55,13 +55,13 @@ export const doc = {
55
55
  flag: '--mode <mode>',
56
56
  param: 'options.mode',
57
57
  description:
58
- 'light or dark: only that color mode. Colors and shadows only; sizes, numbers and fonts are the same in both modes, and a light-only or dark-only theme takes no --mode',
58
+ 'light or dark: only that color mode. Colors only; sizes, numbers, fonts and shadows are the same in both modes, and a light-only or dark-only theme takes no --mode',
59
59
  },
60
60
  {
61
61
  flag: '--only',
62
62
  param: 'options.only',
63
63
  description:
64
- 'With one member of an always-alike family (inputs, checks), style just that part instead of the whole family',
64
+ 'With one member of an always-alike group (inputs, checks), style just that part instead of the whole group',
65
65
  },
66
66
  {
67
67
  flag: '--png',
@@ -80,15 +80,19 @@ export const doc = {
80
80
  cli: 'astryx experimental theme editor set brand spacing more',
81
81
  },
82
82
  {
83
- label: 'The brand color, through the palette',
83
+ label: 'The brand color: its shades are generated, light and dark',
84
84
  cli: 'astryx experimental theme editor set brand accent "#7c3aed"',
85
85
  },
86
86
  {
87
- label: 'The gray of surfaces and text, through the palette',
87
+ label: 'The gray of surfaces and text',
88
88
  cli: 'astryx experimental theme editor set brand neutral "#64748b"',
89
89
  },
90
90
  {
91
- label: 'An exact accent that wins over the palette',
91
+ label: 'How saturated the generated colors are',
92
+ cli: 'astryx experimental theme editor set brand vibrancy 70',
93
+ },
94
+ {
95
+ label: 'An exact accent that wins over the generated colors',
92
96
  cli: 'astryx experimental theme editor set brand --color-accent "#7c3aed"',
93
97
  },
94
98
  {
@@ -118,7 +122,7 @@ export const doc = {
118
122
  exitCodes: [
119
123
  {
120
124
  code: 0,
121
- when: 'the change is written, built and previewed (notes and contrast problems included)',
125
+ when: 'the change is written, built and previewed (notes and contrast problems included); or written but not checked, when the components could not be rendered: the output starts with [warn] saved, not checked (ERR_THEME_NOT_CHECKED) and the cause, such as two copies of React',
122
126
  },
123
127
  {
124
128
  code: 1,
@@ -126,4 +130,5 @@ export const doc = {
126
130
  },
127
131
  ],
128
132
  related: ['experimental theme editor', 'experimental theme compile'],
133
+ replaces: ['theme palette generate'],
129
134
  };
@@ -12,7 +12,7 @@ export const doc = {
12
12
  summary:
13
13
  'Every setting, key values, problems the theme caused, and the theme-building page with every component',
14
14
  description:
15
- 'Lists every setting with where it applies and its source (dial, token or property), the resolved value of key tokens in each mode, the palette (its files, the family and seed of each color dial, the stop that feeds each token in light and dark, the contrast check behind each stop choice, and the tokens an exact token setting overrides), contrast problems this theme caused versus its base, and font notes. Writes two self-contained HTML files: preview.html (the sample app page) and sheet.html (the theme-building page: every component grouped, each variant side by side, overlays open, and real template pages, with an auto/light/dark switch; the same page `preview` makes). --group limits the sheet to one group. Experimental: it may change or be removed in a patch release.',
15
+ 'Lists every setting with where it applies and its source (dial, token or property), the resolved value of key tokens in each mode, the colors (the vibrancy; each color with its seed and the shade each token uses in light and dark, marked when an exact token setting wins; any shade moved so text reads), contrast problems this theme caused versus its base, font notes, and last the generated color files. Writes two self-contained HTML files: preview.html (the sample app page) and sheet.html (the theme-building page: every component grouped, each variant side by side, overlays open, and real template pages, with an auto/light/dark switch). A theme with no build is built first, and an in-app preview (`preview add`) of the theme has its route and Colors page rewritten. --section limits the sheet to one section. Experimental: it may change or be removed in a patch release.',
16
16
  fn: 'themeEditShow',
17
17
  args: [
18
18
  {
@@ -23,10 +23,10 @@ export const doc = {
23
23
  ],
24
24
  options: [
25
25
  {
26
- flag: '--group <name>',
27
- param: 'options.group',
26
+ flag: '--section <name>',
27
+ param: 'options.section',
28
28
  description:
29
- 'Only one group on the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages',
29
+ 'Only one section of the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages',
30
30
  },
31
31
  {
32
32
  flag: '--png',
@@ -59,7 +59,7 @@ export const doc = {
59
59
  },
60
60
  {
61
61
  code: 1,
62
- when: 'the theme does not exist, an unknown --group, or a page that does not render',
62
+ when: 'the theme does not exist, an unknown --section, or a page that does not render',
63
63
  },
64
64
  ],
65
65
  related: ['experimental theme editor', 'experimental theme compile'],
@@ -10,9 +10,9 @@ export const doc = {
10
10
  namespace: 'cli/commands',
11
11
  stability: 'experimental',
12
12
  summary:
13
- 'Step back one change, or remove one setting so it goes back to the base theme',
13
+ 'Step back one change, or remove one setting; the result says what applies instead',
14
14
  description:
15
- "With only the theme, it steps back one change: the settings file, the theme source and the build go back to how they were before the last change, and the preview is rewritten; the result names what was undone and how many earlier steps are left. When the settings file is damaged (not valid JSON), the step back restores the settings from before the last change without reading it. With a thing, it removes that one setting wherever it is in the settings, so it goes back to the base theme's value, and the theme is rebuilt and previewed. Name the setting the way it was set: the same thing and the same --on, --when, --state, --mode and --only (`show` lists every setting that way). For the headings dial, name which half: weight or tracking (default weight). Removing a color dial (accent, neutral, success, warning, danger, info) removes its family from the palette config and the tokens it fed; with no family left, the palette config, palette and receipt are deleted. A setting the theme does not have is refused and the error lists the settings it has for that thing. Experimental: it may change or be removed in a patch release.",
15
+ "With only the theme, it steps back one change: the settings file, the theme source and the build go back to how they were before the last change, and the preview is rewritten; the result names what was undone and how many earlier steps are left. When the settings file is damaged (not valid JSON), the step back restores the settings from before the last change without reading it. With a thing, it removes that one setting wherever it is in the settings, and the result says what applies now (`now`): the whole-theme setting for a part setting removed, or the base theme's value; the theme is rebuilt and previewed. Name the setting the way it was set: the same thing and the same --on, --when, --state, --mode and --only (`show` lists every setting that way). For the headings dial, name which half: weight or tracking (default weight). Removing a color (accent, neutral, success, warning, danger, info) stops generating it, and the tokens it fed go back to the base theme; with no color left, the generated color files the editor wrote are deleted; a palette.config.json you made, or one that holds a color of your own, stays. Removing vibrancy makes the colors again at the default, 50; removing the last color removes vibrancy too, as it needs a color. A setting the theme does not have is refused and the error lists the settings it has for that thing. The history keeps the last 80 steps (in <theme>.history.json); older steps are dropped. Experimental: it may change or be removed in a patch release.",
16
16
  fn: 'themeEditUndo',
17
17
  args: [
18
18
  {
@@ -36,7 +36,7 @@ export const doc = {
36
36
  flag: '--on <where>',
37
37
  param: 'options.on',
38
38
  description:
39
- 'Where it applies (default: the whole theme): a part (button, card, app-shell-header; how --list parts), a family (inputs, containers, checks, menus; how --list families), or for font a role (body, heading, code)',
39
+ 'Where it applies (default: the whole theme): a part (button, card, app-shell-header; how --list parts), a group (inputs, containers, checks, menus; how --list groups), or for font a role (body, heading, code)',
40
40
  },
41
41
  {
42
42
  flag: '--when <prop:value>',
@@ -54,13 +54,13 @@ export const doc = {
54
54
  flag: '--mode <mode>',
55
55
  param: 'options.mode',
56
56
  description:
57
- 'light or dark: only that color mode. Colors and shadows only; sizes, numbers and fonts are the same in both modes, and a light-only or dark-only theme takes no --mode',
57
+ 'light or dark: only that color mode. Colors only; sizes, numbers, fonts and shadows are the same in both modes, and a light-only or dark-only theme takes no --mode',
58
58
  },
59
59
  {
60
60
  flag: '--only',
61
61
  param: 'options.only',
62
62
  description:
63
- 'With one member of an always-alike family (inputs, checks), style just that part instead of the whole family',
63
+ 'With one member of an always-alike group (inputs, checks), style just that part instead of the whole group',
64
64
  },
65
65
  {
66
66
  flag: '--png',
@@ -15,7 +15,7 @@ export const doc = {
15
15
  summary:
16
16
  'Make and change a theme one checked change at a time (dials, tokens, part styles), with previews',
17
17
  description:
18
- "A type-safe compiler for themes. A theme lives in themes/<theme>/: <theme>.settings.json holds the checked settings and is owned by this command; <theme>.settings.ts is generated from it on every change; <theme>.theme.ts extends it, is written once and is yours to edit; <theme>.css and <theme>.js are built from it by the same build as `astryx theme build` (`experimental theme compile`). Every change is CHECKED against what the installed Core's components really read (derived from Core itself, version for version, and cached under node_modules/.cache/) and against the token's type; a change that cannot take effect is refused, nothing is written, and the error leads with the command that works. The thing you set is a dial (a big move with named rungs: corners, spacing, font, headings, text-size, base, mode; or a color dial: accent, neutral, success, warning, danger, info, each a family of the theme palette, grown by the palette generator, that the color tokens point at), a design token by name, or a CSS property on a part. Where it applies: --on <part|family>, --when <prop>:<value>, --state <state>, --mode light|dark, --only. Every accepted change rebuilds and writes preview.html (the sample app page); `show` adds the theme-building page with every component. PNG pictures only with --png. `how` answers everything else: what a part, family, setting or aspect does, plain-words questions (with exact commands), a picture's colors, and lists of what you can set. Experimental: it may change or be removed in a patch release.",
18
+ "A type-safe compiler for themes. A theme lives in themes/<theme>/: <theme>.settings.json holds the checked settings and is owned by this command; <theme>.settings.ts is generated from it on every change; <theme>.theme.ts extends it, is written once and is yours to edit; <theme>.css and <theme>.js are built from it by the same build as `astryx theme build` (`experimental theme compile`). Every change is CHECKED against what the installed Core's components really read (derived from Core itself, version for version, and cached under node_modules/.cache/) and against the token's type; a change that cannot take effect is refused, nothing is written, and the error leads with the command that works. The thing you set is a dial (a big move with named rungs: corners, spacing, font, headings, text-size, base, mode; or a color: accent, neutral, success, warning, danger, info, each generating its light and dark shades from one color for the color tokens, and vibrancy, how saturated they are), a design token by name, or a CSS property on a part. Where it applies: --on <part|group>, --when <prop>:<value>, --state <state>, --mode light|dark, --only. Every accepted change rebuilds and writes preview.html (the sample app page); `show` adds the theme-building page with every component. PNG pictures only with --png. `how` answers everything else: what a part, group, setting or aspect does, how the colors are made, plain-words questions (with exact commands), a picture's colors, and lists of what you can set. Experimental: it may change or be removed in a patch release.",
19
19
  subcommands: ['new', 'set', 'undo', 'show', 'how'],
20
20
  examples: [
21
21
  {
@@ -12,13 +12,14 @@ export const doc = {
12
12
  summary:
13
13
  'Add pages to the theme preview in the app: the default pages, the best template pages for a description, or one template',
14
14
  description:
15
- 'Writes the theme preview into the app: one route, a normal page of the app that keeps its layout, global CSS and providers, in an app shell with a side nav item per preview page and a top bar with the theme name and, when it wears a theme made by `editor`, a light, dark and system switch. A description ("a sales dashboard") asks the same page ranking `build` uses for the template pages that fit it best (--top of them, default 1), and adds each as a page; --template names one page template instead; with neither, it adds the default pages: the sample app page and every component grouped. The route goes in theme-preview/ in the app\'s routes folder (app/ or src/app/), or in --path; the first add records the pages and the files it wrote in theme-preview.json beside the route, so later calls find it. With no routes folder and no --path, it refuses and names both ways on: --path, or `experimental theme preview app <dir>`, which makes a new starter app with the preview in it. Every check (the theme, the template, the ranking and every file it writes) runs before the first write, so a refusal changes nothing. A template page that imports a package the app lacks, or that uses StyleX in an app with no StyleX compiler, is not added: the result names it and the command that installs what it needs. A file the preview did not write is never replaced. The pages wear --theme (default: the only theme under themes/; with none or several, the app\'s own theme). Experimental: it may change or be removed in a patch release.',
15
+ "Writes the theme preview into the app: one route, a normal page of the app that keeps its layout, global CSS and providers, in an app shell with a side nav item per preview page and a top bar with the theme name and, when it wears a theme made by `editor`, a light, dark and system switch. A description (\"a sales dashboard\") asks the same page ranking `build` uses for the template pages that fit it best (--top of them, default 1), and adds each as a page, saying in `matched` what it picked and why (the words of the description it covers). App frames (the Shell templates) are left out, since the preview is an app shell already. When no page is exactly the one described, the closest is added and `matched` says the rest of the description is not on it; only a description no page relates to is refused, writing nothing and naming the closest pages to add with --template, with the other options repeated. A page the app cannot show (a missing package, or StyleX without a compiler) is skipped and the next match is taken (from the ranking, then the template search), and the result says so. A page's nav label is its template's display name, however it was added; --template names one page template instead; with neither, it adds the default pages: Overview (the theme at a glance, built to show what themes most often break: long and short text, every text level on every surface, every button variant and size with disabled and loading, inputs in their states, selected navigation, status colors, a table, open layers), Components (every component grouped, each with the command that changes it most) and, when the theme sets a color, Colors (each color's shades in light and dark, with the shade number, the hex and the tokens that use each; it reads the theme's generated colors, so it changes with every `editor set`). The route goes in theme-preview/ in the app's routes folder (app/ or src/app/), or in --path; the first add records the pages and the files it wrote in theme-preview.json beside the route, so later calls find it. With no routes folder and no --path, it refuses and names both ways on: --path, or `experimental theme preview app <dir>`, which makes a new starter app with the preview in it. The route fills the whole window with the theme, shell and edges included. Every check (the theme, the template, the ranking and every file it writes) runs before the first write, so a refusal changes nothing. A template page that imports a package the app lacks, or that uses StyleX in an app with no StyleX compiler, is not added: the result names it and the command that installs what it needs. A file the preview did not write is never replaced. The pages wear --theme (default: the only theme under themes/; with none or several, the app's own theme). The pages go in _pages/ beside the route, a folder Next never serves as a route; a preview an older release wrote into pages/ is moved there. theme-preview.json records a hash of each file the preview writes: a file changed by hand since is never replaced (the refusal names it), and a page file that already holds exactly the planned text is taken over. The files are staged and renamed into place together; when a write fails, every file is put back as it was. A damaged theme-preview.json is refused with `ERR_THEME_INVALID`, naming the file. The folder is refused when it is a file, in themes/ or node_modules/, in a Pages Router folder (pages/ or src/pages/), in a folder Next does not route (_private, @slot, [param]), or written with Windows separators, a leading ~ or white space at either end. With no --path and no preview in the default place, a preview recorded for a theme is used; with several, the refusal names each. A theme the preview wore that is gone is replaced by the app's own theme, with a note; a changed theme writes the default pages again. A template page whose package the app's package.json names but nobody installed is skipped like a missing one. Only the first 40 different words of a long description go to the ranking, with a note. The description may be several words without quotes. The project root, src/ and the routes folder itself are refused too: they hold the app. An older preview found there is named, with the remove that clears it. A recorded page whose file is gone is written again (a default page, or the template its id names), or else left out of the nav, with a note. A formatter run (white space, quotes, semicolons, commas) does not count as a change by hand. Refusals never suggest deleting files: they say what to move or rename. Preview commands in one project run one after another. Experimental: it may change or be removed in a patch release.",
16
16
  fn: 'themeEditPreviewAdd',
17
17
  args: [
18
18
  {
19
19
  name: 'description',
20
20
  param: 'description',
21
21
  required: false,
22
+ variadic: true,
22
23
  },
23
24
  ],
24
25
  options: [
@@ -75,7 +76,7 @@ export const doc = {
75
76
  },
76
77
  {
77
78
  code: 1,
78
- when: 'outside a project, no routes folder and no --path, a file there that the preview did not write, a path outside the project, an unknown theme or template, no template page whose packages the app has, or a bad --top',
79
+ when: 'outside a project, no routes folder and no --path, a --path that is no place for the preview, a file there that the preview did not write or that was changed by hand, a path outside the project, a damaged theme-preview.json, an unknown theme or template, an empty --template, no template page whose packages the app has, a bad --top, a failed write, or another preview command that did not finish within 30 seconds (ERR_THEME_BUSY)',
79
80
  },
80
81
  ],
81
82
  related: [
@@ -12,7 +12,7 @@ export const doc = {
12
12
  summary:
13
13
  'Make a new starter app with the theme preview inside, ready to install and run',
14
14
  description:
15
- "Writes a new starter app into <dir> (Next.js app router, Core and the neutral theme, with the Astryx packages pinned to this CLI's release), with the theme preview route and its default pages (the sample app page and every component grouped) in src/app/theme-preview/. With --theme, the theme folder is copied into the app's themes/ and the pages wear it; a base theme or font package it needs is added to package.json. No install runs: it prints the install and dev commands and the page to open. <dir> must be new or empty, inside the current folder; --overwrite uses a folder that is not empty, but never replaces a protected file there, and keeps its own package.json and .gitignore. Every check runs before the first write, so a refusal changes nothing. Later pages go in with `experimental theme preview add`, run in the new app. Experimental: it may change or be removed in a patch release.",
15
+ "Writes a new starter app into <dir> (Next.js app router, Core and the neutral theme, with the Astryx packages pinned to this CLI's release), with the theme preview route and its default pages (the sample app page and every component grouped) in src/app/theme-preview/. With --theme, the theme folder is copied into the app's themes/ and the pages wear it; a base theme or font package it needs is added to package.json. No install runs: it prints the install and dev commands and the page to open. <dir> must be new or empty, inside the current folder; a folder that is not empty is refused, with a free folder name to use instead. Every check runs before the first write, so a refusal changes nothing. Later pages go in with `experimental theme preview add`, run in the new app. Every open font the theme names is added to package.json, at the version this project has or a pinned range, and the route imports it; a theme with generated colors gets the Colors page too, and a one-mode theme starts the route in its mode. The app is written into a temp folder beside the folder and moved into place, so a failure leaves nothing behind. A folder holding only .git, .DS_Store or Thumbs.db counts as empty. The folder is refused when it is a file, a dangling link, inside this app's routes folder, themes/ or node_modules/, or written with Windows separators, white space at either end or a name too long. A theme whose build is missing or older than its settings is built first, with a note. The app's home page links to the preview, and its .gitignore leaves out node_modules, next-env.d.ts and *.tsbuildinfo. Inside a project with a tsconfig.json, a note says to exclude the new folder. It takes one folder; more arguments are refused. With a theme, it holds that theme's lock while it builds and copies it, so an `editor set` on the same theme waits for it. A folder given from a subfolder of the project is taken from where it was given. Experimental: it may change or be removed in a patch release.",
16
16
  fn: 'themeEditPreviewApp',
17
17
  args: [
18
18
  {
@@ -28,12 +28,6 @@ export const doc = {
28
28
  description:
29
29
  "A theme made by experimental theme editor here: copied into the app, and the pages wear it (default: the app's own neutral theme)",
30
30
  },
31
- {
32
- flag: '--overwrite',
33
- param: 'options.overwrite',
34
- description:
35
- 'Write into a folder that is not empty; a protected file is never replaced, and its own package.json and .gitignore are kept',
36
- },
37
31
  ],
38
32
  examples: [
39
33
  {
@@ -59,7 +53,7 @@ export const doc = {
59
53
  },
60
54
  {
61
55
  code: 1,
62
- when: 'no <dir>, a folder that is not empty without --overwrite or a protected file in it, a folder outside the current one, or an unknown theme',
56
+ when: 'no <dir>, a folder that is not empty or is no place for an app, a folder outside the current one, an unknown theme, more than one folder, a failed write, or another command changing the theme that did not finish within 30 seconds (ERR_THEME_BUSY)',
63
57
  },
64
58
  ],
65
59
  related: ['experimental theme preview', 'experimental theme preview add'],
@@ -11,7 +11,7 @@ export const doc = {
11
11
  stability: 'experimental',
12
12
  summary: 'The pages of the theme preview in the app',
13
13
  description:
14
- 'Lists the pages of the theme preview, in nav order, with the theme they wear and the route folder. With no preview, and with no routes folder for one, it says so and how to add one (the JSON list is empty). Experimental: it may change or be removed in a patch release.',
14
+ 'Lists the pages of the theme preview, in nav order, with the theme they wear and the route folder. With no preview, and with no routes folder for one, it says so and how to add one (the JSON list is empty). A damaged theme-preview.json is refused with `ERR_THEME_INVALID`, naming the file. With no folder given and no preview in the default place, a preview recorded for a theme is listed; with several, the refusal names each. The tip repeats --path. Experimental: it may change or be removed in a patch release.',
15
15
  fn: 'themeEditPreviewList',
16
16
  options: [
17
17
  {
@@ -41,7 +41,7 @@ export const doc = {
41
41
  },
42
42
  {
43
43
  code: 1,
44
- when: 'outside a project',
44
+ when: 'outside a project, a damaged theme-preview.json, several recorded previews and no --path, or an argument',
45
45
  },
46
46
  ],
47
47
  related: ['experimental theme preview'],
@@ -11,7 +11,7 @@ export const doc = {
11
11
  stability: 'experimental',
12
12
  summary: 'Remove one page from the theme preview, or the whole preview',
13
13
  description:
14
- 'Removes one page and its nav item, and rewrites the route. With no page, or for the last page, it removes the whole preview: only the files the preview wrote (theme-preview.json lists them) are deleted, and the folder only when nothing else is in it. A path in theme-preview.json that leads outside the route folder is refused before anything is deleted. Experimental: it may change or be removed in a patch release.',
14
+ 'Removes one page and its nav item, and rewrites the route. With no page, or for the last page, it removes the whole preview: only the files the preview wrote (theme-preview.json lists them) are deleted, and the folder only when nothing else is in it. A path in theme-preview.json that leads outside the route folder is refused before anything is deleted. Only files the preview wrote are deleted: a page file it did not write, or one changed by hand since it wrote it (by the hash theme-preview.json records), is kept and named in `kept`, with a note; files already gone are named in `missing`, and the route and Colors page written again in `rewritten`. Every check runs before the first delete: the theme the route wears is loaded first, so a theme that does not load is refused with nothing deleted, and the refusal names the whole-preview remove, which needs no theme. A theme that is gone is replaced by the theme of the app itself, with a note. A page id matches in any case. A damaged theme-preview.json (not JSON, the wrong shape, a duplicate page, a folder or an absolute path in its files) is refused with `ERR_THEME_INVALID`, naming the file. With no folder given and no preview in the default place, a preview recorded for a theme is used. It takes one page; more arguments are refused. A whole remove stops, deleting nothing, when page.tsx was changed by hand: it imports the pages. A page whose file is gone leaves the nav, with a note. Refusals never suggest deleting files. Preview commands in one project run one after another. Experimental: it may change or be removed in a patch release.',
15
15
  fn: 'themeEditPreviewRemove',
16
16
  args: [
17
17
  {
@@ -52,7 +52,7 @@ export const doc = {
52
52
  },
53
53
  {
54
54
  code: 1,
55
- when: 'there is no preview, it has no such page, theme-preview.json names a file outside the route folder, or outside a project',
55
+ when: 'there is no preview, it has no such page, theme-preview.json is damaged or names a file outside the route folder, the theme the route wears does not load (ERR_THEME_INVALID, ERR_UNKNOWN_THEME, ERR_THEME_LOAD), another preview command did not finish within 30 seconds (ERR_THEME_BUSY), the route file was changed by hand, a write failed, more than one page, or outside a project',
56
56
  },
57
57
  ],
58
58
  related: ['experimental theme preview'],
@@ -38,7 +38,7 @@ export const doc = {
38
38
  },
39
39
  {
40
40
  label: 'For a lint or an audit script',
41
- cli: 'astryx --json theme targets',
41
+ cli: 'astryx --json experimental theme targets',
42
42
  },
43
43
  ],
44
44
  outsideProject: 'same',
@@ -15,7 +15,7 @@ export const doc = {
15
15
  summary:
16
16
  'Make and change a theme one checked change at a time, preview it in the app, and the experimental copies of the theme commands',
17
17
  description:
18
- "Themes, experimental. `editor` makes and changes a theme one checked change at a time: every change is checked against what the installed Core's components really read, and a change that cannot take effect is refused. `preview` writes a page into the app that shows the theme on real pages. The group also carries experimental copies of every `astryx theme` command (compile, the copy of theme build; list, add, remove, use, eject, template, targets, palette), with the same functions and output. Experimental: it may change or be removed in a patch release.",
18
+ "Themes, experimental. `editor` makes and changes a theme one checked change at a time: every change is checked against what the installed Core's components really read, and a change that cannot take effect is refused. `preview` writes a page into the app that shows the theme on real pages. The group also carries experimental copies of the `astryx theme` commands (compile, the copy of theme build; list, add, remove, use, eject, template, targets), with the same functions and output. Colors come from `editor set` (accent, neutral, success, warning, danger, info, vibrancy), which generates them, so the group has no command of its own for that. Experimental: it may change or be removed in a patch release.",
19
19
  subcommands: [
20
20
  'editor',
21
21
  'preview',
@@ -27,7 +27,6 @@ export const doc = {
27
27
  'eject',
28
28
  'template',
29
29
  'targets',
30
- 'palette',
31
30
  ],
32
31
  examples: [
33
32
  {
@@ -39,8 +38,8 @@ export const doc = {
39
38
  cli: 'astryx experimental theme editor set brand corners pill',
40
39
  },
41
40
  {
42
- label: 'Build it',
43
- cli: 'astryx experimental theme compile',
41
+ label: 'See the theme and its settings',
42
+ cli: 'astryx experimental theme editor show brand',
44
43
  },
45
44
  ],
46
45
  exitCodes: [
@@ -41,7 +41,7 @@ export const doc = {
41
41
  flag: '-o, --out <path>',
42
42
  param: 'options.out',
43
43
  description:
44
- 'Output CSS file path, relative or absolute; the .js and .d.ts are written beside it (default: <theme name>.css next to the source). A build writes only inside the working directory, the defaults beside the source too (ERR_PATH_TRAVERSAL); --check writes nothing, so it compares outputs anywhere and refuses only a relative path that escapes the working directory. Single theme only: refused with more than one file or with --family (ERR_THEME_INVALID)',
44
+ 'Output CSS file path, relative or absolute; the .js and .d.ts are written beside it (default: <theme name>.css next to the source). A folder, or a path ending in /, writes <theme name>.css into it. A build never replaces the theme source (ERR_THEME_INVALID). At a path --out names, it replaces only its own earlier outputs: any other existing file fails with ERR_FILE_EXISTS and nothing is written. A build writes only inside the working directory, the defaults beside the source too (ERR_PATH_TRAVERSAL); --check writes nothing, so it compares outputs anywhere and refuses only a relative path that escapes the working directory. Single theme only: refused with more than one file or with --family (ERR_THEME_INVALID)',
45
45
  },
46
46
  {
47
47
  flag: '--icons-specifier <specifier>',
@@ -10,7 +10,7 @@ export const doc = {
10
10
  namespace: 'cli/commands',
11
11
  summary: 'Fork a theme as editable local source',
12
12
  description:
13
- "Copies a bundled or installed package theme's complete source into the local themes root, including a local descriptor. Writes are atomic. Existing files require --overwrite. Use --package when package themes share a slug.",
13
+ "Copies a bundled or installed package theme's complete source into the local themes root, including a local descriptor. Writes are atomic. Existing files require --overwrite. Eject never writes into a folder that holds another theme or a theme the theme editor made, even with --overwrite. When the fork imports packages the app lacks, the result names them with an install command. Use --package when package themes share a slug.",
14
14
  fn: 'themeEject',
15
15
  args: [
16
16
  {name: 'slug', param: 'slug', required: true},
@@ -21,7 +21,7 @@ export const doc = {
21
21
  flag: '-f, --overwrite',
22
22
  param: 'options.overwrite',
23
23
  description:
24
- 'Replace existing files. Without it, an existing file fails with ERR_FILE_EXISTS and nothing is written',
24
+ 'Replace the existing files of an earlier fork of the same theme. Without it, an existing file fails with ERR_FILE_EXISTS and nothing is written',
25
25
  },
26
26
  {
27
27
  flag: '--package <package>',
@@ -41,7 +41,7 @@ export const doc = {
41
41
  {code: 0, when: 'all source and descriptor files are written'},
42
42
  {
43
43
  code: 1,
44
- when: 'the theme is unknown or ambiguous, a path escapes, a source file is missing, or a destination exists',
44
+ when: 'the theme is unknown or ambiguous, a path escapes, a source file is missing, a destination exists, or the folder holds another theme',
45
45
  },
46
46
  ],
47
47
  related: ['theme add', 'theme build', 'theme list'],
@@ -10,7 +10,7 @@ export const doc = {
10
10
  namespace: 'cli/commands',
11
11
  summary: 'Remove a non-default theme from the app',
12
12
  description:
13
- 'Removes one added theme from the generated module and regenerates the whole module. Choose another default with theme use before removing the current default.',
13
+ 'Removes one added theme from the generated module and regenerates the whole module. Choose another default with theme use before removing the current default. A theme whose local folder or package is gone can be removed, and theme use still works when the default is the one that is gone.',
14
14
  fn: 'themeRemove',
15
15
  args: [{name: 'slug', param: 'slug', required: true}],
16
16
  examples: [{label: 'Remove an added theme', cli: 'astryx theme remove ocean'}],
@@ -23,7 +23,7 @@ export const doc = {
23
23
  notes: [
24
24
  {
25
25
  type: 'prose',
26
- text: "In global mode: outside a project, theme remove writes nothing and stops with `ERR_THEME_INVALID`: \"No package.json found. Run this command inside an app project.\" In a project, the project's version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:problems}.",
26
+ text: 'In global mode: outside a project, theme remove writes nothing and stops with `ERR_THEME_INVALID`: "No package.json found. Run this command inside an app project." In a project, the project\'s version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:problems}.',
27
27
  },
28
28
  ],
29
29
  };