@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.
- package/CHANGELOG.md +197 -0
- package/api/component/_adapter.d.mts +15 -0
- package/api/component/_adapter.mjs +76 -0
- package/api/component/component.mjs +8 -1
- package/api/search/_named-keywords.d.mts +31 -0
- package/api/search/_named-keywords.mjs +177 -0
- package/api/search/search-index.mjs +8 -1
- package/api/search/search.d.mts +6 -1
- package/api/search/search.mjs +49 -8
- package/api/theme/_adapter.d.mts +33 -0
- package/api/theme/_adapter.mjs +352 -16
- package/api/theme/build/build.mjs +261 -10
- package/api/theme/eject/eject.mjs +13 -1
- package/api/theme/list/list.mjs +11 -2
- package/api/theme/palette/generate/color.d.mts +2 -0
- package/api/theme/palette/generate/color.mjs +1 -1
- package/api/theme/template/template.mjs +139 -6
- package/api/theme/theme.type.d.mts +15 -1
- package/api/theme/theme.type.mjs +9 -3
- package/api/theme/themeAdd.doc.mjs +1 -1
- package/api/theme/themeBuild.doc.mjs +10 -2
- package/api/theme/themeEject.doc.mjs +2 -2
- package/api/theme/themeListAvailable.doc.mjs +1 -1
- package/api/theme/themeRemove.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +8 -0
- package/api/theme/themeUse.doc.mjs +1 -1
- package/api/theme-edit/_adapter.d.mts +36 -2
- package/api/theme-edit/_adapter.mjs +340 -12
- package/api/theme-edit/_check.d.mts +28 -25
- package/api/theme-edit/_check.mjs +876 -308
- package/api/theme-edit/_color.d.mts +53 -4
- package/api/theme-edit/_color.mjs +406 -79
- package/api/theme-edit/_compiler.d.mts +14 -6
- package/api/theme-edit/_compiler.mjs +89 -59
- package/api/theme-edit/_context.d.mts +28 -8
- package/api/theme-edit/_context.mjs +142 -19
- package/api/theme-edit/_edit.d.mts +3 -1
- package/api/theme-edit/_edit.mjs +746 -76
- package/api/theme-edit/_how-commands.d.mts +91 -0
- package/api/theme-edit/_how-commands.mjs +269 -0
- package/api/theme-edit/_how-question.d.mts +57 -0
- package/api/theme-edit/_how-question.mjs +2574 -0
- package/api/theme-edit/_how.d.mts +27 -8
- package/api/theme-edit/_how.mjs +776 -175
- package/api/theme-edit/_overview.d.mts +9 -0
- package/api/theme-edit/_overview.mjs +296 -0
- package/api/theme-edit/_palette.d.mts +155 -15
- package/api/theme-edit/_palette.mjs +1446 -262
- package/api/theme-edit/_parts.mjs +61 -5
- package/api/theme-edit/_png.d.mts +18 -6
- package/api/theme-edit/_png.mjs +135 -25
- package/api/theme-edit/_preview-app.d.mts +32 -11
- package/api/theme-edit/_preview-app.mjs +1976 -285
- package/api/theme-edit/_preview.d.mts +39 -8
- package/api/theme-edit/_preview.mjs +367 -41
- package/api/theme-edit/_settings.d.mts +147 -11
- package/api/theme-edit/_settings.mjs +908 -99
- package/api/theme-edit/_tables.d.mts +4 -16
- package/api/theme-edit/_tables.mjs +51 -117
- package/api/theme-edit/theme-edit.type.d.mts +102 -66
- package/api/theme-edit/theme-edit.type.mjs +58 -40
- package/api/theme-edit/themeEditHow.doc.mjs +17 -6
- package/api/theme-edit/themeEditNew.doc.mjs +21 -5
- package/api/theme-edit/themeEditPreviewAdd.doc.mjs +18 -5
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +12 -9
- package/api/theme-edit/themeEditPreviewList.doc.mjs +11 -2
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +29 -3
- package/api/theme-edit/themeEditSet.doc.mjs +14 -8
- package/api/theme-edit/themeEditShow.doc.mjs +10 -5
- package/api/theme-edit/themeEditUndo.doc.mjs +9 -4
- package/assets/discover/official-packages.json +4 -0
- package/assets/docs/tree/icon-sets.doc.mjs +3 -3
- package/assets/docs.generated.json +1 -0
- package/assets/icons/definitions/bookmarkAdd.doc.mjs +9 -0
- package/assets/icons/definitions/documentSearch.doc.mjs +9 -0
- package/assets/icons/definitions/keyboard.doc.mjs +9 -0
- package/assets/icons/definitions/paintBrush.doc.mjs +9 -0
- package/assets/icons/definitions/wallet.doc.mjs +9 -0
- package/assets/preview-app/gitignore +3 -0
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/Lightbox/LightboxGallery.tsx +1 -1
- package/assets/templates/components.generated.json +1 -0
- package/assets/templates/pages/gallery-hero/page.tsx +8 -2
- package/assets/templates/pages/settings-dialog/template.doc.mjs +3 -3
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table-filter/template.doc.mjs +2 -2
- package/assets/templates/pages/theme-showcase/template.doc.mjs +1 -1
- package/clients/cli/bin/astryx.mjs +37 -5
- package/clients/cli/commands/experimental/theme.mjs +422 -57
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +22 -9
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +103 -4
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +13 -8
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +5 -5
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +5 -5
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +2 -8
- package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme.doc.mjs +3 -4
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme-eject.doc.mjs +3 -3
- package/clients/cli/commands/theme-remove.doc.mjs +2 -2
- package/clients/cli/commands/theme-template.doc.mjs +11 -4
- package/clients/cli/commands/theme.mjs +145 -46
- package/clients/cli/commands.generated.json +1 -0
- package/clients/cli/index.mjs +96 -5
- package/clients/cli/lib/json-shim.mjs +29 -1
- package/foundation/config/project.d.mts +16 -2
- package/foundation/config/project.mjs +40 -6
- package/foundation/config/theme-state.d.mts +9 -0
- package/foundation/config/theme-state.mjs +20 -1
- package/foundation/discovery/template-adapter.d.mts +12 -1
- package/foundation/discovery/template-adapter.mjs +29 -4
- package/foundation/discovery/template-icons.d.mts +13 -0
- package/foundation/discovery/template-icons.mjs +76 -0
- package/foundation/discovery/template-needs.d.mts +7 -0
- package/foundation/discovery/template-needs.mjs +117 -8
- package/foundation/discovery/template-source-tree.d.mts +5 -1
- package/foundation/discovery/template-source-tree.mjs +6 -4
- package/foundation/discovery/theme-discovery.d.mts +14 -3
- package/foundation/discovery/theme-discovery.mjs +45 -12
- package/foundation/doc-compiler/import.mjs +68 -3
- package/foundation/doc-compiler/stored-docs.d.mts +27 -0
- package/foundation/doc-compiler/stored-docs.mjs +65 -0
- package/foundation/fs/fs-error.d.mts +17 -0
- package/foundation/fs/fs-error.mjs +34 -0
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.doc.mjs +13 -1
- package/foundation/response/error-codes.mjs +11 -1
- package/foundation/response/response-types.doc.mjs +6 -6
- package/package.json +6 -7
- package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +0 -73
- package/clients/cli/commands/experimental-theme-palette.doc.mjs +0 -37
|
@@ -11,9 +11,9 @@ export const doc = {
|
|
|
11
11
|
stability: 'experimental',
|
|
12
12
|
displayName: 'themeEditHow()',
|
|
13
13
|
summary:
|
|
14
|
-
"Look up a part,
|
|
14
|
+
"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.",
|
|
15
15
|
description:
|
|
16
|
-
'One command for every question. A part (button, card; --list parts): what it reads for each aspect (text, background, border, corners, shadow, spacing, font, size) and
|
|
16
|
+
'One command for every question. 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.',
|
|
17
17
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
18
18
|
signature:
|
|
19
19
|
'themeEditHow(subject?: string, options?: object): Promise<object>',
|
|
@@ -29,12 +29,19 @@ export const doc = {
|
|
|
29
29
|
name: 'subject',
|
|
30
30
|
type: 'string',
|
|
31
31
|
description:
|
|
32
|
-
'A part,
|
|
32
|
+
'A part, group, setting, aspect, question, or PNG file; with `list`, a filter.',
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
name: 'options.list',
|
|
36
36
|
type: 'string',
|
|
37
|
-
description:
|
|
37
|
+
description:
|
|
38
|
+
'dials, tokens, parts, groups, or properties; an empty string lists the kinds.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'options.theme',
|
|
42
|
+
type: 'string',
|
|
43
|
+
description:
|
|
44
|
+
'The theme the suggested commands are for (default: the only theme, the one an editor command changed last, or my-theme when there is none); an empty name is refused.',
|
|
38
45
|
},
|
|
39
46
|
{
|
|
40
47
|
name: 'options.at',
|
|
@@ -56,7 +63,7 @@ export const doc = {
|
|
|
56
63
|
{
|
|
57
64
|
type: 'themeEdit.how',
|
|
58
65
|
description:
|
|
59
|
-
'`kind` says which answer it is: part (variants, states, reads per aspect, parts inside,
|
|
66
|
+
'`kind` says which answer it is: part (variants, states, reads per aspect with the flags for each condition, parts inside, group), group (members), setting, aspect or question (answers with checked commands for `theme`), picture (main colors, or the color and alpha at points), or list (the items).',
|
|
60
67
|
},
|
|
61
68
|
],
|
|
62
69
|
throws: [
|
|
@@ -66,12 +73,16 @@ export const doc = {
|
|
|
66
73
|
},
|
|
67
74
|
{
|
|
68
75
|
code: 'ERR_INVALID_ARGUMENT',
|
|
69
|
-
when: 'an unknown --list kind, --at without a picture, a picture that is not a PNG, an
|
|
76
|
+
when: 'an empty `theme`, an unknown --list kind, --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',
|
|
70
77
|
},
|
|
71
78
|
{
|
|
72
79
|
code: 'ERR_FILE_NOT_FOUND',
|
|
73
80
|
when: 'the picture does not exist',
|
|
74
81
|
},
|
|
82
|
+
{
|
|
83
|
+
code: 'ERR_UNKNOWN_THEME',
|
|
84
|
+
when: '`theme` names a theme the editor did not make',
|
|
85
|
+
},
|
|
75
86
|
{
|
|
76
87
|
code: 'ERR_PROJECT_REQUIRED',
|
|
77
88
|
when: '@astryxdesign/core is not installed in the folder',
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'themeEditNew()',
|
|
13
13
|
summary: 'Start a theme in themes/<theme>/, optionally on a built-in theme.',
|
|
14
14
|
description:
|
|
15
|
-
'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.',
|
|
15
|
+
'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. `settings` takes any `set` dial by name ({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.',
|
|
16
16
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
17
17
|
signature: 'themeEditNew(theme: string, options?: object): Promise<object>',
|
|
18
18
|
keywords: [
|
|
@@ -26,7 +26,8 @@ export const doc = {
|
|
|
26
26
|
{
|
|
27
27
|
name: 'theme',
|
|
28
28
|
type: 'string',
|
|
29
|
-
description:
|
|
29
|
+
description:
|
|
30
|
+
'The theme name: lowercase letters, digits and dashes, starting with a letter, 64 characters at most.',
|
|
30
31
|
required: true,
|
|
31
32
|
},
|
|
32
33
|
{
|
|
@@ -39,10 +40,17 @@ export const doc = {
|
|
|
39
40
|
type: 'boolean',
|
|
40
41
|
description: 'Also take PNG pictures of the preview.',
|
|
41
42
|
},
|
|
43
|
+
{
|
|
44
|
+
name: 'options.settings',
|
|
45
|
+
type: 'Record<string, string>',
|
|
46
|
+
description:
|
|
47
|
+
'Dial settings to start with, by dial name, each checked as `set` checks it: every dial but base (use `like`).',
|
|
48
|
+
},
|
|
42
49
|
{
|
|
43
50
|
name: 'options.cwd',
|
|
44
51
|
type: 'string',
|
|
45
|
-
description:
|
|
52
|
+
description:
|
|
53
|
+
'The folder to start from (default: the current directory): commands act on the Astryx project at or above it, so a subfolder of an app works.',
|
|
46
54
|
},
|
|
47
55
|
],
|
|
48
56
|
returns: [
|
|
@@ -55,7 +63,7 @@ export const doc = {
|
|
|
55
63
|
throws: [
|
|
56
64
|
{
|
|
57
65
|
code: 'ERR_INVALID_ARGUMENT',
|
|
58
|
-
when: 'the name is not lowercase letters, digits and dashes',
|
|
66
|
+
when: 'the name is not lowercase letters, digits and dashes, or `settings` names something that is not a dial',
|
|
59
67
|
},
|
|
60
68
|
{
|
|
61
69
|
code: 'ERR_FILE_EXISTS',
|
|
@@ -63,7 +71,11 @@ export const doc = {
|
|
|
63
71
|
},
|
|
64
72
|
{
|
|
65
73
|
code: 'ERR_THEME_BAD_VALUE',
|
|
66
|
-
when: '`like` is not a built-in theme',
|
|
74
|
+
when: '`like` is not a built-in theme, or a setting has a value `set` refuses',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
code: 'ERR_THEME_NO_EFFECT',
|
|
78
|
+
when: '`settings` has vibrancy and no color',
|
|
67
79
|
},
|
|
68
80
|
{
|
|
69
81
|
code: 'ERR_UNKNOWN_THEME',
|
|
@@ -73,6 +85,10 @@ export const doc = {
|
|
|
73
85
|
code: 'ERR_PROJECT_REQUIRED',
|
|
74
86
|
when: '@astryxdesign/core is not installed in the folder',
|
|
75
87
|
},
|
|
88
|
+
{
|
|
89
|
+
code: 'ERR_THEME_BUSY',
|
|
90
|
+
when: 'another command is changing the same theme and did not finish within 30 seconds; nothing was changed',
|
|
91
|
+
},
|
|
76
92
|
{
|
|
77
93
|
code: 'ERR_THEME_INVALID',
|
|
78
94
|
when: 'the theme does not build',
|
|
@@ -13,7 +13,7 @@ export const doc = {
|
|
|
13
13
|
summary:
|
|
14
14
|
'Add pages to the theme preview in the app: the default pages, the best template pages for a description, or one template.',
|
|
15
15
|
description:
|
|
16
|
-
|
|
16
|
+
"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 `themeEditPreviewApp`, 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 lists it in `skipped`, with 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 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.",
|
|
17
17
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
18
18
|
signature:
|
|
19
19
|
'themeEditPreviewAdd(description?: string, options?: object): Promise<object>',
|
|
@@ -49,7 +49,8 @@ export const doc = {
|
|
|
49
49
|
{
|
|
50
50
|
name: 'options.cwd',
|
|
51
51
|
type: 'string',
|
|
52
|
-
description:
|
|
52
|
+
description:
|
|
53
|
+
'The folder to start from (default: the current directory): commands act on the Astryx project at or above it, so a subfolder of an app works.',
|
|
53
54
|
},
|
|
54
55
|
],
|
|
55
56
|
returns: [
|
|
@@ -66,7 +67,7 @@ export const doc = {
|
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
code: 'ERR_FILE_EXISTS',
|
|
69
|
-
when: 'a file there that the preview did not write',
|
|
70
|
+
when: 'a file there that the preview did not write, or one it wrote and someone changed since',
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
73
|
code: 'ERR_PATH_TRAVERSAL',
|
|
@@ -74,7 +75,7 @@ export const doc = {
|
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
code: 'ERR_INVALID_ARGUMENT',
|
|
77
|
-
when: 'a description with `template`,
|
|
78
|
+
when: 'a description with `template`, an empty `template`, `top` other than 1, 2 or 3 as typed or with no description, or a folder that is no place for the preview',
|
|
78
79
|
},
|
|
79
80
|
{
|
|
80
81
|
code: 'ERR_DEP_MISSING',
|
|
@@ -82,7 +83,7 @@ export const doc = {
|
|
|
82
83
|
},
|
|
83
84
|
{
|
|
84
85
|
code: 'ERR_UNKNOWN_TEMPLATE',
|
|
85
|
-
when: '`template` names no page template',
|
|
86
|
+
when: '`template` names no page template (a block is named as one), with the closest page templates as commands',
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
89
|
code: 'ERR_THEME_LOAD',
|
|
@@ -92,6 +93,18 @@ export const doc = {
|
|
|
92
93
|
code: 'ERR_UNKNOWN_THEME',
|
|
93
94
|
when: '`theme` names a theme this command did not make',
|
|
94
95
|
},
|
|
96
|
+
{
|
|
97
|
+
code: 'ERR_THEME_INVALID',
|
|
98
|
+
when: 'theme-preview.json is damaged, or the theme does not load; nothing is written',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
code: 'ERR_WRITE_FAILED',
|
|
102
|
+
when: 'a write failed; every file is put back as it was',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
code: 'ERR_THEME_BUSY',
|
|
106
|
+
when: 'another preview command in the project did not finish within 30 seconds; nothing is changed',
|
|
107
|
+
},
|
|
95
108
|
{
|
|
96
109
|
code: 'ERR_PROJECT_REQUIRED',
|
|
97
110
|
when: 'no package.json in the folder or above it',
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'themeEditPreviewApp()',
|
|
13
13
|
summary: 'Make a new starter app with the theme preview inside.',
|
|
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: the result says how to install, run and open it. `dir` must be new or empty, inside the current folder;
|
|
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: the result says how to install, run and open it. `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. 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. 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
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
17
17
|
signature:
|
|
18
18
|
'themeEditPreviewApp(dir: string, options?: object): Promise<object>',
|
|
@@ -37,11 +37,6 @@ export const doc = {
|
|
|
37
37
|
description:
|
|
38
38
|
"A theme made by `experimental theme editor` here: copied into the app, and the pages wear it (default: the app's own neutral theme).",
|
|
39
39
|
},
|
|
40
|
-
{
|
|
41
|
-
name: 'options.overwrite',
|
|
42
|
-
type: 'boolean',
|
|
43
|
-
description: 'Write into a folder that is not empty.',
|
|
44
|
-
},
|
|
45
40
|
{
|
|
46
41
|
name: 'options.cwd',
|
|
47
42
|
type: 'string',
|
|
@@ -58,7 +53,7 @@ export const doc = {
|
|
|
58
53
|
throws: [
|
|
59
54
|
{
|
|
60
55
|
code: 'ERR_FILE_EXISTS',
|
|
61
|
-
when: '`dir` is not empty
|
|
56
|
+
when: '`dir` is not empty, is a file or a dangling link, or was filled while the app was written',
|
|
62
57
|
},
|
|
63
58
|
{
|
|
64
59
|
code: 'ERR_PATH_TRAVERSAL',
|
|
@@ -66,11 +61,19 @@ export const doc = {
|
|
|
66
61
|
},
|
|
67
62
|
{
|
|
68
63
|
code: 'ERR_UNKNOWN_THEME',
|
|
69
|
-
when: '`theme` names a theme
|
|
64
|
+
when: '`theme` names a theme `experimental theme editor` did not make; the closest editor theme is named, and for a package theme what to do instead',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
code: 'ERR_THEME_BUSY',
|
|
68
|
+
when: 'another command changing the theme did not finish within 30 seconds; nothing is written',
|
|
70
69
|
},
|
|
71
70
|
{
|
|
72
71
|
code: 'ERR_INVALID_ARGUMENT',
|
|
73
|
-
when: 'no `dir
|
|
72
|
+
when: 'no `dir`, or a folder that is no place for an app',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
code: 'ERR_WRITE_FAILED',
|
|
76
|
+
when: 'a write failed; nothing is left behind',
|
|
74
77
|
},
|
|
75
78
|
],
|
|
76
79
|
examples: [
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'themeEditPreviewList()',
|
|
13
13
|
summary: 'The pages of the theme preview in the app.',
|
|
14
14
|
description:
|
|
15
|
-
'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 (app/ or src/app/) for one, the list is empty. Experimental: it may change or be removed in a patch release.',
|
|
15
|
+
'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 (app/ or src/app/) for one, the 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. Experimental: it may change or be removed in a patch release.',
|
|
16
16
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
17
17
|
signature: 'themeEditPreviewList(options?: object): Promise<object>',
|
|
18
18
|
keywords: ['theme', 'experimental theme', 'preview', 'theme preview'],
|
|
@@ -26,7 +26,8 @@ export const doc = {
|
|
|
26
26
|
{
|
|
27
27
|
name: 'options.cwd',
|
|
28
28
|
type: 'string',
|
|
29
|
-
description:
|
|
29
|
+
description:
|
|
30
|
+
'The folder to start from (default: the current directory): commands act on the Astryx project at or above it, so a subfolder of an app works.',
|
|
30
31
|
},
|
|
31
32
|
],
|
|
32
33
|
returns: [
|
|
@@ -37,6 +38,14 @@ export const doc = {
|
|
|
37
38
|
},
|
|
38
39
|
],
|
|
39
40
|
throws: [
|
|
41
|
+
{
|
|
42
|
+
code: 'ERR_THEME_INVALID',
|
|
43
|
+
when: 'theme-preview.json is damaged',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
code: 'ERR_INVALID_ARGUMENT',
|
|
47
|
+
when: 'several recorded previews and none in the default place',
|
|
48
|
+
},
|
|
40
49
|
{
|
|
41
50
|
code: 'ERR_PROJECT_REQUIRED',
|
|
42
51
|
when: 'no package.json in the folder or above it',
|
|
@@ -12,7 +12,7 @@ export const doc = {
|
|
|
12
12
|
displayName: 'themeEditPreviewRemove()',
|
|
13
13
|
summary: 'Remove one page from the theme preview, or the whole preview.',
|
|
14
14
|
description:
|
|
15
|
-
'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.',
|
|
15
|
+
'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. 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.',
|
|
16
16
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
17
17
|
signature:
|
|
18
18
|
'themeEditPreviewRemove(page?: string, options?: object): Promise<object>',
|
|
@@ -32,13 +32,15 @@ export const doc = {
|
|
|
32
32
|
{
|
|
33
33
|
name: 'options.cwd',
|
|
34
34
|
type: 'string',
|
|
35
|
-
description:
|
|
35
|
+
description:
|
|
36
|
+
'The folder to start from (default: the current directory): commands act on the Astryx project at or above it, so a subfolder of an app works.',
|
|
36
37
|
},
|
|
37
38
|
],
|
|
38
39
|
returns: [
|
|
39
40
|
{
|
|
40
41
|
type: 'themeEdit.previewRemove',
|
|
41
|
-
description:
|
|
42
|
+
description:
|
|
43
|
+
'The files deleted, kept, missing and written again, notes, and the pages left.',
|
|
42
44
|
},
|
|
43
45
|
],
|
|
44
46
|
throws: [
|
|
@@ -50,6 +52,30 @@ export const doc = {
|
|
|
50
52
|
code: 'ERR_NOT_FOUND',
|
|
51
53
|
when: 'there is no preview, or it has no such page',
|
|
52
54
|
},
|
|
55
|
+
{
|
|
56
|
+
code: 'ERR_THEME_INVALID',
|
|
57
|
+
when: 'theme-preview.json is damaged, or the theme the route wears does not load; nothing is deleted',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
code: 'ERR_UNKNOWN_THEME',
|
|
61
|
+
when: 'the theme the route wears is not a theme; nothing is deleted',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
code: 'ERR_FILE_EXISTS',
|
|
65
|
+
when: 'the route file was changed by hand, so it is not written again (a page remove) or its pages are not deleted (a whole remove); nothing is deleted',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
code: 'ERR_WRITE_FAILED',
|
|
69
|
+
when: 'a write or delete failed; the files are put back',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
code: 'ERR_THEME_BUSY',
|
|
73
|
+
when: 'another preview command in the project did not finish within 30 seconds; nothing is changed',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
code: 'ERR_THEME_LOAD',
|
|
77
|
+
when: 'the theme the route wears has no build and does not build; nothing is deleted',
|
|
78
|
+
},
|
|
53
79
|
{
|
|
54
80
|
code: 'ERR_PROJECT_REQUIRED',
|
|
55
81
|
when: 'no package.json in the folder or above it',
|
|
@@ -13,7 +13,7 @@ export const doc = {
|
|
|
13
13
|
summary:
|
|
14
14
|
'Change one thing in a theme: checked against what the components read, built, previewed.',
|
|
15
15
|
description:
|
|
16
|
-
"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
|
|
16
|
+
"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.",
|
|
17
17
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
18
18
|
signature:
|
|
19
19
|
'themeEditSet(theme: string, thing: string, value: string, options?: object): Promise<object>',
|
|
@@ -47,7 +47,7 @@ export const doc = {
|
|
|
47
47
|
{
|
|
48
48
|
name: 'options.on',
|
|
49
49
|
type: 'string',
|
|
50
|
-
description: 'A part, a
|
|
50
|
+
description: 'A part, a group, or for `font` a role.',
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
name: 'options.when',
|
|
@@ -62,13 +62,14 @@ export const doc = {
|
|
|
62
62
|
{
|
|
63
63
|
name: 'options.mode',
|
|
64
64
|
type: 'string',
|
|
65
|
-
description:
|
|
65
|
+
description:
|
|
66
|
+
'`light` or `dark`: only that color mode (colors only; a shadow is one value for both modes).',
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
name: 'options.only',
|
|
69
70
|
type: 'boolean',
|
|
70
71
|
description:
|
|
71
|
-
'With a member of an always-alike
|
|
72
|
+
'With a member of an always-alike group, style just that part.',
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
75
|
name: 'options.png',
|
|
@@ -78,14 +79,15 @@ export const doc = {
|
|
|
78
79
|
{
|
|
79
80
|
name: 'options.cwd',
|
|
80
81
|
type: 'string',
|
|
81
|
-
description:
|
|
82
|
+
description:
|
|
83
|
+
'The folder to start from (default: the current directory): commands act on the Astryx project at or above it, so a subfolder of an app works.',
|
|
82
84
|
},
|
|
83
85
|
],
|
|
84
86
|
returns: [
|
|
85
87
|
{
|
|
86
88
|
type: 'themeEdit.set',
|
|
87
89
|
description:
|
|
88
|
-
'The setting written and the one it replaced, the parts and
|
|
90
|
+
'The setting written and the one it replaced, the parts and group it styles, resolved token changes, part styles written, part settings a dial kept, newly lifted variant keys, notes, contrast problems, build warnings, and the preview.',
|
|
89
91
|
},
|
|
90
92
|
],
|
|
91
93
|
throws: [
|
|
@@ -95,7 +97,7 @@ export const doc = {
|
|
|
95
97
|
},
|
|
96
98
|
{
|
|
97
99
|
code: 'ERR_THEME_UNKNOWN_PART',
|
|
98
|
-
when: '--on is not a part or a
|
|
100
|
+
when: '--on is not a part or a group',
|
|
99
101
|
},
|
|
100
102
|
{
|
|
101
103
|
code: 'ERR_THEME_UNKNOWN_VARIANT',
|
|
@@ -135,7 +137,7 @@ export const doc = {
|
|
|
135
137
|
},
|
|
136
138
|
{
|
|
137
139
|
code: 'ERR_INVALID_ARGUMENT',
|
|
138
|
-
when: '--only on a part that is not a member of an always-alike
|
|
140
|
+
when: '--only on a part that is not a member of an always-alike group',
|
|
139
141
|
},
|
|
140
142
|
{
|
|
141
143
|
code: 'ERR_UNKNOWN_THEME',
|
|
@@ -145,6 +147,10 @@ export const doc = {
|
|
|
145
147
|
code: 'ERR_PROJECT_REQUIRED',
|
|
146
148
|
when: '@astryxdesign/core is not installed in the folder',
|
|
147
149
|
},
|
|
150
|
+
{
|
|
151
|
+
code: 'ERR_THEME_BUSY',
|
|
152
|
+
when: 'another command is changing the same theme and did not finish within 30 seconds; nothing was changed',
|
|
153
|
+
},
|
|
148
154
|
{
|
|
149
155
|
code: 'ERR_THEME_INVALID',
|
|
150
156
|
when: 'the theme does not build (the change is undone)',
|
|
@@ -13,7 +13,7 @@ export const doc = {
|
|
|
13
13
|
summary:
|
|
14
14
|
'Every setting, key values, problems the theme caused, and the theme-building page with every component.',
|
|
15
15
|
description:
|
|
16
|
-
'Lists every setting with where it applies and its source (dial, token or property), the resolved value of key tokens in each mode, the
|
|
16
|
+
'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.',
|
|
17
17
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
18
18
|
signature: 'themeEditShow(theme: string, options?: object): Promise<object>',
|
|
19
19
|
keywords: [
|
|
@@ -31,9 +31,9 @@ export const doc = {
|
|
|
31
31
|
required: true,
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
name: 'options.
|
|
34
|
+
name: 'options.section',
|
|
35
35
|
type: 'string',
|
|
36
|
-
description: 'Only one
|
|
36
|
+
description: 'Only one section of the sheet.',
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
name: 'options.png',
|
|
@@ -43,7 +43,8 @@ export const doc = {
|
|
|
43
43
|
{
|
|
44
44
|
name: 'options.cwd',
|
|
45
45
|
type: 'string',
|
|
46
|
-
description:
|
|
46
|
+
description:
|
|
47
|
+
'The folder to start from (default: the current directory): commands act on the Astryx project at or above it, so a subfolder of an app works.',
|
|
47
48
|
},
|
|
48
49
|
],
|
|
49
50
|
returns: [
|
|
@@ -56,7 +57,7 @@ export const doc = {
|
|
|
56
57
|
throws: [
|
|
57
58
|
{
|
|
58
59
|
code: 'ERR_INVALID_ARGUMENT',
|
|
59
|
-
when: 'an unknown
|
|
60
|
+
when: 'an unknown section',
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
code: 'ERR_UNKNOWN_THEME',
|
|
@@ -66,6 +67,10 @@ export const doc = {
|
|
|
66
67
|
code: 'ERR_PROJECT_REQUIRED',
|
|
67
68
|
when: '@astryxdesign/core is not installed in the folder',
|
|
68
69
|
},
|
|
70
|
+
{
|
|
71
|
+
code: 'ERR_THEME_BUSY',
|
|
72
|
+
when: 'another command is changing the same theme and did not finish within 30 seconds; nothing was changed',
|
|
73
|
+
},
|
|
69
74
|
{
|
|
70
75
|
code: 'ERR_THEME_INVALID',
|
|
71
76
|
when: 'the theme does not build (the change is undone)',
|
|
@@ -13,7 +13,7 @@ export const doc = {
|
|
|
13
13
|
summary:
|
|
14
14
|
'Put the theme back as it was before its last change, or remove one setting.',
|
|
15
15
|
description:
|
|
16
|
-
'
|
|
16
|
+
'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 `thing`, it removes that one setting instead, wherever it is in the settings, and the `now` field of the result says what applies instead (a dial that still writes it, a whole-theme setting of the same thing, or the value of the base theme); name it the way it was set, with the same `on`, `when`, `state`, `mode` and `only`. 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. 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.',
|
|
17
17
|
importPath: '@astryxdesign/cli/api/experimental',
|
|
18
18
|
signature: 'themeEditUndo(theme: string, options?: object): Promise<object>',
|
|
19
19
|
keywords: [
|
|
@@ -34,7 +34,7 @@ export const doc = {
|
|
|
34
34
|
name: 'options.thing',
|
|
35
35
|
type: 'string',
|
|
36
36
|
description:
|
|
37
|
-
"Remove this one setting (a dial, a token, or a CSS property) instead of stepping back one change;
|
|
37
|
+
"Remove this one setting (a dial, a token, or a CSS property) instead of stepping back one change; the result's `now` says what applies instead: a whole-theme setting of the same thing, or the base theme's value.",
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
name: 'options.value',
|
|
@@ -45,7 +45,7 @@ export const doc = {
|
|
|
45
45
|
{
|
|
46
46
|
name: 'options.on',
|
|
47
47
|
type: 'string',
|
|
48
|
-
description: 'With `thing`: the part,
|
|
48
|
+
description: 'With `thing`: the part, group or role it was set on.',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
name: 'options.when',
|
|
@@ -77,7 +77,8 @@ export const doc = {
|
|
|
77
77
|
{
|
|
78
78
|
name: 'options.cwd',
|
|
79
79
|
type: 'string',
|
|
80
|
-
description:
|
|
80
|
+
description:
|
|
81
|
+
'The folder to start from (default: the current directory): commands act on the Astryx project at or above it, so a subfolder of an app works.',
|
|
81
82
|
},
|
|
82
83
|
],
|
|
83
84
|
returns: [
|
|
@@ -104,6 +105,10 @@ export const doc = {
|
|
|
104
105
|
code: 'ERR_PROJECT_REQUIRED',
|
|
105
106
|
when: '@astryxdesign/core is not installed in the folder',
|
|
106
107
|
},
|
|
108
|
+
{
|
|
109
|
+
code: 'ERR_THEME_BUSY',
|
|
110
|
+
when: 'another command is changing the same theme and did not finish within 30 seconds; nothing was changed',
|
|
111
|
+
},
|
|
107
112
|
{
|
|
108
113
|
code: 'ERR_THEME_INVALID',
|
|
109
114
|
when: 'the theme does not build (the change is undone)',
|
|
@@ -366,7 +366,7 @@ astryx experimental icon use outline --backup brand # a main set, then a backu
|
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
type: 'prose',
|
|
369
|
-
text: "A template declares, in its descriptor's `icons`, the definition each imported icon draws (`{TrashIcon: 'delete'}`). Once the project sets `experimental.iconSet` in astryx.config (`experimental icon use` writes it), each declared icon becomes the icon for that definition from the first set in the project's list that maps it. An icon that no set in the list has draws a placeholder instead (see When no set has an icon, below)
|
|
369
|
+
text: "A template declares, in its descriptor's `icons`, the definition each imported icon draws (`{TrashIcon: 'delete'}`). Once the project sets `experimental.iconSet` in astryx.config (`experimental icon use` writes it), each declared icon becomes the icon for that definition from the first set in the project's list that maps it. An icon that no set in the list has draws a placeholder instead (see When no set has an icon, below), unless it comes from the library a set in the list wraps (the `source` in the set's data). Such an icon is already one your project chose: a template written with the main set's own library keeps its icons as written, and an icon from a backup set's library that no set maps keeps its import. The copy reports every icon as mapped, a placeholder, or kept. Nothing is guessed from names. A mapped icon loses its library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`), since a set's icons take their size from CSS; the report names them as `dropped`. Comments on a rewritten import line are kept.",
|
|
370
370
|
},
|
|
371
371
|
{
|
|
372
372
|
type: 'prose',
|
|
@@ -420,7 +420,7 @@ astryx experimental icon use outline --backup brand # a main set, then a backu
|
|
|
420
420
|
content: [
|
|
421
421
|
{
|
|
422
422
|
type: 'prose',
|
|
423
|
-
text: "When no set in the list maps an icon's meaning, the copied file removes that icon from the template's library import. It declares a small `MissingIcon` component once (another free name when the file already uses `MissingIcon`), and each place the icon was renders it, so the page still builds and needs no new package. The placeholder is a dashed square, 1em in size, in the current text color. It is hidden from screen readers unless that use gives it an `aria-label`. A comment beside each use records the meaning.",
|
|
423
|
+
text: "When no set in the list maps an icon's meaning, and no set in the list wraps the library the template imports it from, the copied file removes that icon from the template's library import. It declares a small `MissingIcon` component once (another free name when the file already uses `MissingIcon`), and each place the icon was renders it, so the page still builds and needs no new package. The placeholder is a dashed square, 1em in size, in the current text color. It is hidden from screen readers unless that use gives it an `aria-label`. A comment beside each use records the meaning.",
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
426
|
type: 'code',
|
|
@@ -479,7 +479,7 @@ astryx experimental icon use outline --backup brand # a main set, then a backu
|
|
|
479
479
|
],
|
|
480
480
|
[
|
|
481
481
|
"A template descriptor's `icons`",
|
|
482
|
-
"The icon definition each imported icon draws (`{TrashIcon: 'delete'}`): a named import by the name it imports, a default import by its local name. `astryx template`, shown or copied, then writes the icons from the first set in the list that has each meaning and reports `icons` (status, set, order, mapped, placeholder, kept, sets): every key is mapped, a placeholder when no set has its meaning, or kept with why (a namespace or type-only import, a re-export, an Astryx import or one from a set in the list, no import at all, or an icon that draws no definition and has no match). `integration check` notes a key the template's source never imports (`template_icon_not_imported`), never failing, and notes an imported icon the package's templates do not declare (`template_icon_undeclared`), which fails `--strict --next`.",
|
|
482
|
+
"The icon definition each imported icon draws (`{TrashIcon: 'delete'}`): a named import by the name it imports, a default import by its local name. `astryx template`, shown or copied, then writes the icons from the first set in the list that has each meaning and reports `icons` (status, set, order, mapped, placeholder, kept, sets): every key is mapped, a placeholder when no set has its meaning, or kept with why (a namespace or type-only import, a re-export, an Astryx import or one from a set in the list, an import from the library a set in the list wraps, no import at all, or an icon that draws no definition and has no match). `integration check` notes a key the template's source never imports (`template_icon_not_imported`), never failing, and notes an imported icon the package's templates do not declare (`template_icon_undeclared`), which fails `--strict --next`.",
|
|
483
483
|
],
|
|
484
484
|
[
|
|
485
485
|
'`astryx discover`',
|