@astryxdesign/cli 0.7.13 → 0.7.14-canary.d08ce65
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/README.md +18 -18
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/api/doctor/doctor.mjs +3 -7
- package/api/experimental.d.mts +2 -0
- package/api/experimental.mjs +10 -0
- package/api/icon/_adapter.d.mts +10 -0
- package/api/icon/_adapter.mjs +31 -2
- package/api/icon/_authoring.d.mts +2 -1
- package/api/icon/_authoring.mjs +91 -6
- package/api/icon/_options.mjs +1 -0
- package/api/icon/_records.d.mts +18 -0
- package/api/icon/_records.mjs +26 -0
- package/api/icon/add/add.mjs +7 -1
- package/api/icon/definitions/definitions.d.mts +12 -0
- package/api/icon/definitions/definitions.mjs +83 -0
- package/api/icon/icon.doc.mjs +5 -4
- package/api/icon/icon.mjs +5 -16
- package/api/icon/icon.type.d.mts +29 -2
- package/api/icon/icon.type.mjs +17 -3
- package/api/icon/iconAdd.doc.mjs +1 -1
- package/api/icon/iconMap.doc.mjs +2 -2
- package/api/icon/iconNewSet.doc.mjs +8 -2
- package/api/icon/map/map.mjs +21 -2
- package/api/icon/new-set/new-set.mjs +14 -2
- package/api/icon/search/search.mjs +2 -15
- package/api/icon/use/use.mjs +4 -3
- package/api/integration/validate-integration.mjs +6 -1
- package/api/integration/validate-integration.type.d.mts +12 -0
- package/api/integration/validate-integration.type.mjs +5 -0
- package/api/theme-edit/_adapter.d.mts +96 -0
- package/api/theme-edit/_adapter.mjs +1039 -0
- package/api/theme-edit/_catalog.d.mts +59 -0
- package/api/theme-edit/_catalog.mjs +564 -0
- package/api/theme-edit/_check.d.mts +49 -0
- package/api/theme-edit/_check.mjs +842 -0
- package/api/theme-edit/_color.d.mts +35 -0
- package/api/theme-edit/_color.mjs +125 -0
- package/api/theme-edit/_compiler.d.mts +61 -0
- package/api/theme-edit/_compiler.mjs +522 -0
- package/api/theme-edit/_css-properties.d.mts +10 -0
- package/api/theme-edit/_css-properties.mjs +556 -0
- package/api/theme-edit/_parts.d.mts +111 -0
- package/api/theme-edit/_parts.mjs +409 -0
- package/api/theme-edit/_png.d.mts +40 -0
- package/api/theme-edit/_png.mjs +187 -0
- package/api/theme-edit/_preview.d.mts +86 -0
- package/api/theme-edit/_preview.mjs +564 -0
- package/api/theme-edit/_project.d.mts +83 -0
- package/api/theme-edit/_project.mjs +289 -0
- package/api/theme-edit/_settings.d.mts +222 -0
- package/api/theme-edit/_settings.mjs +848 -0
- package/api/theme-edit/_tables.d.mts +130 -0
- package/api/theme-edit/_tables.mjs +697 -0
- package/api/theme-edit/theme-edit.d.mts +89 -0
- package/api/theme-edit/theme-edit.mjs +119 -0
- package/api/theme-edit/theme-edit.type.d.mts +270 -0
- package/api/theme-edit/theme-edit.type.mjs +155 -0
- package/api/theme-edit/themeEditExplain.doc.d.mts +6 -0
- package/api/theme-edit/themeEditExplain.doc.mjs +88 -0
- package/api/theme-edit/themeEditNew.doc.d.mts +6 -0
- package/api/theme-edit/themeEditNew.doc.mjs +89 -0
- package/api/theme-edit/themeEditPreview.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreview.doc.mjs +96 -0
- package/api/theme-edit/themeEditReset.doc.d.mts +6 -0
- package/api/theme-edit/themeEditReset.doc.mjs +161 -0
- package/api/theme-edit/themeEditSet.doc.d.mts +6 -0
- package/api/theme-edit/themeEditSet.doc.mjs +165 -0
- package/api/theme-edit/themeEditShow.doc.d.mts +6 -0
- package/api/theme-edit/themeEditShow.doc.mjs +86 -0
- package/api/theme-edit/themeEditUndo.doc.d.mts +6 -0
- package/api/theme-edit/themeEditUndo.doc.mjs +80 -0
- package/assets/docs/color.doc.mjs +5 -5
- package/assets/docs/tree/icon-sets.doc.mjs +6 -2
- package/assets/docs/tree/tokens-border.doc.mjs +1 -1
- package/assets/docs/tree/tokens-color.doc.mjs +2 -2
- package/assets/docs/tree/tokens-data.doc.mjs +2 -2
- package/assets/docs/tree/tokens-duration.doc.mjs +1 -1
- package/assets/docs/tree/tokens-ease.doc.mjs +1 -1
- package/assets/docs/tree/tokens-focus.doc.mjs +1 -1
- package/assets/docs/tree/tokens-font-weight.doc.mjs +1 -1
- package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
- package/assets/docs/tree/tokens-shadow.doc.mjs +1 -1
- package/assets/docs/tree/tokens-size.doc.mjs +1 -1
- package/assets/docs/tree/tokens-spacing.doc.mjs +1 -1
- package/assets/docs/tree/tokens-syntax.doc.mjs +1 -1
- package/assets/docs/tree/tokens-text-size.doc.mjs +1 -1
- package/assets/docs/tree/tokens-type-scale.doc.mjs +1 -1
- package/assets/docs/tree/tokens-typography.doc.mjs +1 -1
- package/assets/icons/definitions/bank.doc.mjs +1 -1
- package/assets/icons/definitions/save.doc.mjs +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider03RtlDirection.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.doc.mjs +2 -1
- package/assets/templates/blocks/components/Text/useTruncationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Text/useTruncationHookUsage.tsx +112 -0
- package/authoring/doctypes/_schema.d.mts +1 -0
- package/authoring/doctypes/_schema.mjs +1 -0
- package/authoring/doctypes/command/command.doc.mjs +7 -0
- package/authoring/doctypes/command/type.ts +3 -0
- package/authoring/doctypes/icon-set/parse.d.mts +7 -0
- package/authoring/doctypes/icon-set/parse.mjs +18 -8
- package/clients/cli/commands/doctor.mjs +33 -3
- package/clients/cli/commands/experimental/icon.mjs +67 -14
- package/clients/cli/commands/experimental/index.mjs +2 -0
- package/clients/cli/commands/experimental/theme.mjs +542 -0
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +7 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-add.doc.mjs +78 -0
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +97 -0
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +71 -0
- package/clients/cli/commands/experimental-theme-explain.doc.mjs +84 -0
- package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -0
- package/clients/cli/commands/experimental-theme-new.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +73 -0
- package/clients/cli/commands/experimental-theme-palette.doc.mjs +37 -0
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +76 -0
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme-reset.doc.mjs +103 -0
- package/clients/cli/commands/experimental-theme-set.doc.mjs +121 -0
- package/clients/cli/commands/experimental-theme-show.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +61 -0
- package/clients/cli/commands/experimental-theme-template.doc.mjs +61 -0
- package/clients/cli/commands/experimental-theme-undo.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme-use.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme.doc.mjs +66 -0
- package/clients/cli/commands/experimental.doc.mjs +10 -3
- package/clients/cli/commands/theme.mjs +101 -34
- package/clients/cli/index.mjs +16 -0
- package/clients/cli/lib/define-command.mjs +3 -0
- package/foundation/discovery/icon-set-checks.d.mts +16 -1
- package/foundation/discovery/icon-set-checks.mjs +68 -7
- package/foundation/discovery/icon-set-discovery.d.mts +21 -6
- package/foundation/discovery/icon-set-discovery.mjs +17 -8
- package/foundation/discovery/template-icon-meanings.d.mts +39 -0
- package/foundation/discovery/template-icon-meanings.mjs +95 -0
- package/foundation/discovery/theming-targets.d.mts +6 -0
- package/foundation/discovery/theming-targets.mjs +33 -0
- package/foundation/response/error-codes.d.mts +12 -1
- package/foundation/response/error-codes.doc.mjs +66 -0
- package/foundation/response/error-codes.mjs +55 -0
- package/foundation/response/response-types.doc.mjs +43 -0
- package/foundation/text/template-meanings-line.d.mts +16 -0
- package/foundation/text/template-meanings-line.mjs +37 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +6 -6
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file CommandDoc for `astryx experimental theme reset`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'command',
|
|
8
|
+
name: 'experimental theme reset',
|
|
9
|
+
displayName: 'astryx experimental theme reset',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
summary: "Return one setting to the base theme's value, rebuild, preview",
|
|
13
|
+
description:
|
|
14
|
+
"Returns one setting to the base theme's value: the setting is removed, and the theme is rebuilt and previewed. Name it 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 to reset: weight or tracking (default weight). 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
|
+
fn: 'themeEditReset',
|
|
16
|
+
args: [
|
|
17
|
+
{
|
|
18
|
+
name: 'theme',
|
|
19
|
+
param: 'theme',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'thing',
|
|
24
|
+
param: 'thing',
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'which',
|
|
29
|
+
param: 'options.value',
|
|
30
|
+
required: false,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
flag: '--on <where>',
|
|
36
|
+
param: 'options.on',
|
|
37
|
+
description:
|
|
38
|
+
'Where it applies (default: the whole theme): a part (button, card, app-shell-header; explain --list parts), a family (inputs, containers, checks, menus; explain --list families), or for font a role (body, heading, code)',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
flag: '--when <prop:value>',
|
|
42
|
+
param: 'options.when',
|
|
43
|
+
description:
|
|
44
|
+
'Only that variant of the part, such as variant:primary or status:error (explain <part> lists them); needs --on',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
flag: '--state <state>',
|
|
48
|
+
param: 'options.state',
|
|
49
|
+
description:
|
|
50
|
+
'Only that state of the part: hover, active, focus-visible, disabled, or a state the part lists (selected...); needs --on',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
flag: '--mode <mode>',
|
|
54
|
+
param: 'options.mode',
|
|
55
|
+
description:
|
|
56
|
+
'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
|
+
},
|
|
58
|
+
{
|
|
59
|
+
flag: '--only',
|
|
60
|
+
param: 'options.only',
|
|
61
|
+
description:
|
|
62
|
+
'With one member of an always-alike family (inputs, checks), style just that part instead of the whole family',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
flag: '--png',
|
|
66
|
+
param: 'options.png',
|
|
67
|
+
description:
|
|
68
|
+
'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',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
examples: [
|
|
72
|
+
{
|
|
73
|
+
label: 'Reset a whole-theme dial',
|
|
74
|
+
cli: 'astryx experimental theme reset brand corners',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'Reset a part setting',
|
|
78
|
+
cli: 'astryx experimental theme reset brand background --on app-shell-header',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: 'Reset the headings letter spacing',
|
|
82
|
+
cli: 'astryx experimental theme reset brand headings tracking',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
outsideProject: 'refuse',
|
|
86
|
+
notes: [
|
|
87
|
+
{
|
|
88
|
+
type: 'prose',
|
|
89
|
+
text: "In global mode: outside a project, with no package.json in the folder or above it, experimental theme reset writes nothing and stops with `ERR_PROJECT_REQUIRED`; run it in the 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}.",
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
exitCodes: [
|
|
93
|
+
{
|
|
94
|
+
code: 0,
|
|
95
|
+
when: "the setting is back to the base theme's value, and the theme is rebuilt and previewed",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
code: 1,
|
|
99
|
+
when: 'the theme does not have that setting, the theme does not exist, or a build failure; nothing is written',
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
related: ['experimental theme', 'experimental theme compile'],
|
|
103
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file CommandDoc for `astryx experimental theme set`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'command',
|
|
8
|
+
name: 'experimental theme set',
|
|
9
|
+
displayName: 'astryx experimental theme set',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
summary:
|
|
13
|
+
'Change one thing in a theme: checked against what the components read, built, previewed',
|
|
14
|
+
description:
|
|
15
|
+
"Changes one thing. The thing is a dial (corners, spacing, accent, 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; `explain --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 (accent text per mode, font loading), 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 <color> (kept exact; accent text is made readable per mode); 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 explain --list dials` explains each. Experimental: it may change or be removed in a patch release.",
|
|
16
|
+
fn: 'themeEditSet',
|
|
17
|
+
args: [
|
|
18
|
+
{
|
|
19
|
+
name: 'theme',
|
|
20
|
+
param: 'theme',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'thing',
|
|
25
|
+
param: 'thing',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'value',
|
|
30
|
+
param: 'value',
|
|
31
|
+
required: true,
|
|
32
|
+
variadic: true,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
options: [
|
|
36
|
+
{
|
|
37
|
+
flag: '--on <where>',
|
|
38
|
+
param: 'options.on',
|
|
39
|
+
description:
|
|
40
|
+
'Where it applies (default: the whole theme): a part (button, card, app-shell-header; explain --list parts), a family (inputs, containers, checks, menus; explain --list families), or for font a role (body, heading, code)',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
flag: '--when <prop:value>',
|
|
44
|
+
param: 'options.when',
|
|
45
|
+
description:
|
|
46
|
+
'Only that variant of the part, such as variant:primary or status:error (explain <part> lists them); needs --on',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
flag: '--state <state>',
|
|
50
|
+
param: 'options.state',
|
|
51
|
+
description:
|
|
52
|
+
'Only that state of the part: hover, active, focus-visible, disabled, or a state the part lists (selected...); needs --on',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
flag: '--mode <mode>',
|
|
56
|
+
param: 'options.mode',
|
|
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',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
flag: '--only',
|
|
62
|
+
param: 'options.only',
|
|
63
|
+
description:
|
|
64
|
+
'With one member of an always-alike family (inputs, checks), style just that part instead of the whole family',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
flag: '--png',
|
|
68
|
+
param: 'options.png',
|
|
69
|
+
description:
|
|
70
|
+
'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',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
examples: [
|
|
74
|
+
{
|
|
75
|
+
label: 'A big move with a dial',
|
|
76
|
+
cli: 'astryx experimental theme set brand corners pill',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: 'Step a dial',
|
|
80
|
+
cli: 'astryx experimental theme set brand spacing more',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'The brand color',
|
|
84
|
+
cli: 'astryx experimental theme set brand accent "#7c3aed"',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: 'A token, dark mode only',
|
|
88
|
+
cli: 'astryx experimental theme set brand --color-text-primary "#e5e7eb" --mode dark',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'A CSS property on a part',
|
|
92
|
+
cli: 'astryx experimental theme set brand background "linear-gradient(#f6d365, #fda085)" --on app-shell-header',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: 'One variant in one state',
|
|
96
|
+
cli: 'astryx experimental theme set brand background-color "#f3e8ff" --on button --when variant:ghost --state hover',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: 'Every input',
|
|
100
|
+
cli: 'astryx experimental theme set brand border "1px solid #9ca3af" --on inputs',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
outsideProject: 'refuse',
|
|
104
|
+
notes: [
|
|
105
|
+
{
|
|
106
|
+
type: 'prose',
|
|
107
|
+
text: "In global mode: outside a project, with no package.json in the folder or above it, experimental theme set writes nothing and stops with `ERR_PROJECT_REQUIRED`; run it in the 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}.",
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
exitCodes: [
|
|
111
|
+
{
|
|
112
|
+
code: 0,
|
|
113
|
+
when: 'the change is written, built and previewed (notes and contrast problems included)',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
code: 1,
|
|
117
|
+
when: 'a refused change (an unknown part, variant, state, token or thing; a value of the wrong type; --mode on something that has no mode; a token the part never reads for that; corners on a part that shows no edge), a theme that does not exist, or a build failure; nothing is written',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
related: ['experimental theme', 'experimental theme compile'],
|
|
121
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file CommandDoc for `astryx experimental theme show`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'command',
|
|
8
|
+
name: 'experimental theme show',
|
|
9
|
+
displayName: 'astryx experimental theme show',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
summary:
|
|
13
|
+
'Every setting, key values, problems the theme caused, and the theme-building page with every component',
|
|
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, 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.',
|
|
16
|
+
fn: 'themeEditShow',
|
|
17
|
+
args: [
|
|
18
|
+
{
|
|
19
|
+
name: 'theme',
|
|
20
|
+
param: 'theme',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
options: [
|
|
25
|
+
{
|
|
26
|
+
flag: '--group <name>',
|
|
27
|
+
param: 'options.group',
|
|
28
|
+
description:
|
|
29
|
+
'Only one group on the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
flag: '--png',
|
|
33
|
+
param: 'options.png',
|
|
34
|
+
description:
|
|
35
|
+
'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',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
examples: [
|
|
39
|
+
{
|
|
40
|
+
label: 'Everything',
|
|
41
|
+
cli: 'astryx experimental theme show brand',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'With pictures',
|
|
45
|
+
cli: 'astryx experimental theme show brand --png',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
outsideProject: 'refuse',
|
|
49
|
+
notes: [
|
|
50
|
+
{
|
|
51
|
+
type: 'prose',
|
|
52
|
+
text: "In global mode: outside a project, with no package.json in the folder or above it, experimental theme show writes nothing and stops with `ERR_PROJECT_REQUIRED`; run it in the 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}.",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
exitCodes: [
|
|
56
|
+
{
|
|
57
|
+
code: 0,
|
|
58
|
+
when: 'the settings are listed and both pages are written',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
code: 1,
|
|
62
|
+
when: 'the theme does not exist, an unknown --group, or a page that does not render',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
related: ['experimental theme', 'experimental theme compile'],
|
|
66
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme targets`: the experimental
|
|
5
|
+
* copy of `astryx theme targets`, with the same function, flags and output.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
9
|
+
export const doc = {
|
|
10
|
+
type: 'command',
|
|
11
|
+
name: 'experimental theme targets',
|
|
12
|
+
displayName: 'astryx experimental theme targets',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'List the component theming targets a theme can override',
|
|
16
|
+
description:
|
|
17
|
+
'Prints every `defineTheme` components key across the system: the stable class it paints, the component that declares it, and the props and states that are legal override keys under it. This is the whole themeable surface in one command: what auditing a theme, or answering "which key paints this pixel?", used to need one `{@command component <Name>}` per component to assemble. Pass a component name to scope it; pass any other text to search target keys, classes, and components. `--json` for a list a repo can lint its own theme against.',
|
|
18
|
+
fn: 'themeTargets',
|
|
19
|
+
args: [
|
|
20
|
+
{
|
|
21
|
+
name: 'filter',
|
|
22
|
+
param: 'filter',
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
examples: [
|
|
27
|
+
{
|
|
28
|
+
label: 'The whole themeable surface',
|
|
29
|
+
cli: 'astryx experimental theme targets',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "One component's targets",
|
|
33
|
+
cli: 'astryx experimental theme targets Switch',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'Search keys',
|
|
37
|
+
cli: 'astryx experimental theme targets thumb',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'For a lint or an audit script',
|
|
41
|
+
cli: 'astryx --json theme targets',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
outsideProject: 'same',
|
|
45
|
+
exitCodes: [
|
|
46
|
+
{
|
|
47
|
+
code: 0,
|
|
48
|
+
when: 'success',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
code: 1,
|
|
52
|
+
when: 'a filter matches no target, or core cannot be resolved',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
related: [
|
|
56
|
+
'component',
|
|
57
|
+
'experimental theme compile',
|
|
58
|
+
'experimental theme template',
|
|
59
|
+
],
|
|
60
|
+
replaces: ['theme targets'],
|
|
61
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme template`: the experimental
|
|
5
|
+
* copy of `astryx theme template`, with the same function, flags and output.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
9
|
+
export const doc = {
|
|
10
|
+
type: 'command',
|
|
11
|
+
name: 'experimental theme template',
|
|
12
|
+
displayName: 'astryx experimental theme template',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'Write the annotated theme template into your project',
|
|
16
|
+
description:
|
|
17
|
+
'Writes theme.template.ts: the annotated reference for the whole theme surface, covering every defineTheme field, the token families, the component override syntax, and how a theme is consumed, naming the CLI command that prints the authoritative reference for each. Read it, copy what you need into your own theme file, delete it. Use `experimental theme add <slug>` to use an installed built theme, extend that theme for ordinary customization, or use `experimental theme eject <slug>` for a complete source fork. Leaves an existing file untouched unless --overwrite.',
|
|
18
|
+
fn: 'themeTemplate',
|
|
19
|
+
args: [
|
|
20
|
+
{
|
|
21
|
+
name: 'path',
|
|
22
|
+
param: 'options.targetPath',
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
flag: '-f, --overwrite',
|
|
29
|
+
param: 'options.overwrite',
|
|
30
|
+
description: 'Replace an existing file',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
examples: [
|
|
34
|
+
{
|
|
35
|
+
label: 'Write it at the project root',
|
|
36
|
+
cli: 'astryx experimental theme template',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Somewhere else',
|
|
40
|
+
cli: 'astryx experimental theme template src/themes/starter.ts',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
outsideProject: 'same',
|
|
44
|
+
exitCodes: [
|
|
45
|
+
{
|
|
46
|
+
code: 0,
|
|
47
|
+
when: 'success, including when an existing file was left untouched',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
code: 1,
|
|
51
|
+
when: 'the target path escapes the project, or the file cannot be written',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
related: [
|
|
55
|
+
'experimental theme add',
|
|
56
|
+
'experimental theme eject',
|
|
57
|
+
'experimental theme list',
|
|
58
|
+
'experimental theme compile',
|
|
59
|
+
],
|
|
60
|
+
replaces: ['theme template'],
|
|
61
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file CommandDoc for `astryx experimental theme undo`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'command',
|
|
8
|
+
name: 'experimental theme undo',
|
|
9
|
+
displayName: 'astryx experimental theme undo',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
summary: 'Put the theme back as it was before its last change',
|
|
13
|
+
description:
|
|
14
|
+
'Steps back one change: the settings file, the theme source and the build go back to how they were before the last set, unset, or base or mode change, and the preview is rewritten. The result names what was undone and how many earlier steps are left. Experimental: it may change or be removed in a patch release.',
|
|
15
|
+
fn: 'themeEditUndo',
|
|
16
|
+
args: [
|
|
17
|
+
{
|
|
18
|
+
name: 'theme',
|
|
19
|
+
param: 'theme',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
flag: '--png',
|
|
26
|
+
param: 'options.png',
|
|
27
|
+
description:
|
|
28
|
+
'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',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
examples: [
|
|
32
|
+
{
|
|
33
|
+
label: 'Step back',
|
|
34
|
+
cli: 'astryx experimental theme undo brand',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
outsideProject: 'refuse',
|
|
38
|
+
notes: [
|
|
39
|
+
{
|
|
40
|
+
type: 'prose',
|
|
41
|
+
text: "In global mode: outside a project, with no package.json in the folder or above it, experimental theme undo writes nothing and stops with `ERR_PROJECT_REQUIRED`; run it in the 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}.",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
exitCodes: [
|
|
45
|
+
{
|
|
46
|
+
code: 0,
|
|
47
|
+
when: 'the last change is undone',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
code: 1,
|
|
51
|
+
when: 'there is no earlier change, or the theme does not exist',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
related: ['experimental theme', 'experimental theme compile'],
|
|
55
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme use`: the experimental
|
|
5
|
+
* copy of `astryx theme use`, with the same function, flags and output.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
9
|
+
export const doc = {
|
|
10
|
+
type: 'command',
|
|
11
|
+
name: 'experimental theme use',
|
|
12
|
+
displayName: 'astryx experimental theme use',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'Choose the app default from its added themes',
|
|
16
|
+
description:
|
|
17
|
+
'Sets one added slug as the default and regenerates the generated theme module. Add the theme first if it is not already in the app.',
|
|
18
|
+
fn: 'themeUse',
|
|
19
|
+
args: [
|
|
20
|
+
{
|
|
21
|
+
name: 'slug',
|
|
22
|
+
param: 'slug',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
examples: [
|
|
27
|
+
{
|
|
28
|
+
label: 'Choose the default theme',
|
|
29
|
+
cli: 'astryx experimental theme use ocean',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
outsideProject: 'refuse',
|
|
33
|
+
exitCodes: [
|
|
34
|
+
{
|
|
35
|
+
code: 0,
|
|
36
|
+
when: 'the module is regenerated with the selected default',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
code: 1,
|
|
40
|
+
when: 'the theme is not added or state is invalid',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
related: [
|
|
44
|
+
'experimental theme add',
|
|
45
|
+
'experimental theme remove',
|
|
46
|
+
'experimental theme list',
|
|
47
|
+
],
|
|
48
|
+
notes: [
|
|
49
|
+
{
|
|
50
|
+
type: 'prose',
|
|
51
|
+
text: 'In global mode: outside a project, experimental theme use 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}.',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
replaces: ['theme use'],
|
|
55
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for the `astryx experimental theme` group: make and change a
|
|
5
|
+
* theme one checked change at a time.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
9
|
+
export const doc = {
|
|
10
|
+
type: 'command',
|
|
11
|
+
name: 'experimental theme',
|
|
12
|
+
displayName: 'astryx experimental theme',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary:
|
|
16
|
+
'Make and change a theme one checked change at a time (dials, tokens, part styles), with previews',
|
|
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` (here also `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, accent, font, headings, text-size, base, mode), 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` and `preview` add the theme-building page with every component. PNG pictures only with --png. `explain` 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. The same group 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.",
|
|
19
|
+
subcommands: [
|
|
20
|
+
'new',
|
|
21
|
+
'set',
|
|
22
|
+
'reset',
|
|
23
|
+
'show',
|
|
24
|
+
'undo',
|
|
25
|
+
'preview',
|
|
26
|
+
'explain',
|
|
27
|
+
'compile',
|
|
28
|
+
'list',
|
|
29
|
+
'add',
|
|
30
|
+
'remove',
|
|
31
|
+
'use',
|
|
32
|
+
'eject',
|
|
33
|
+
'template',
|
|
34
|
+
'targets',
|
|
35
|
+
'palette',
|
|
36
|
+
],
|
|
37
|
+
examples: [
|
|
38
|
+
{
|
|
39
|
+
label: 'Start a theme',
|
|
40
|
+
cli: 'astryx experimental theme new brand --like neutral',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Round everything',
|
|
44
|
+
cli: 'astryx experimental theme set brand corners pill',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Ask how',
|
|
48
|
+
cli: 'astryx experimental theme explain "white text in the banner"',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: 'See it all',
|
|
52
|
+
cli: 'astryx experimental theme show brand',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
exitCodes: [
|
|
56
|
+
{
|
|
57
|
+
code: 0,
|
|
58
|
+
when: 'help is shown or a subcommand succeeds',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
code: 1,
|
|
62
|
+
when: 'an unknown subcommand, a refused change, or a subcommand failure',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
related: ['theme build', 'experimental render'],
|
|
66
|
+
};
|
|
@@ -14,14 +14,21 @@ export const doc = {
|
|
|
14
14
|
namespace: 'cli/commands',
|
|
15
15
|
stability: 'experimental',
|
|
16
16
|
summary:
|
|
17
|
-
'Try features that may change in a patch release: icon sets
|
|
17
|
+
'Try features that may change in a patch release: icon sets, page rendering, checked theme editing',
|
|
18
18
|
description:
|
|
19
19
|
'The experimental command group. Every command under it is experimental: its arguments, options, output, and JSON may change or be removed in any patch release, with no deprecation period. A feature leaves this group when it becomes stable. Nothing here changes what any other command does unless you use it.',
|
|
20
|
-
subcommands: ['icon', 'render'],
|
|
20
|
+
subcommands: ['icon', 'render', 'theme'],
|
|
21
21
|
examples: [
|
|
22
22
|
{label: 'List the experiments', cli: 'astryx experimental'},
|
|
23
23
|
{label: 'Find an icon by meaning', cli: 'astryx experimental icon delete'},
|
|
24
|
-
{
|
|
24
|
+
{
|
|
25
|
+
label: 'Render a page to one HTML file',
|
|
26
|
+
cli: 'astryx experimental render page.tsx',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Change a theme, checked',
|
|
30
|
+
cli: 'astryx experimental theme set brand corners pill',
|
|
31
|
+
},
|
|
25
32
|
],
|
|
26
33
|
exitCodes: [
|
|
27
34
|
{code: 0, when: 'help is shown or a subcommand succeeds'},
|