@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,97 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme compile`: the experimental
|
|
5
|
+
* copy of `astryx theme build`, 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 compile',
|
|
12
|
+
displayName: 'astryx experimental theme compile',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'Compile standalone themes or one keyed theme family',
|
|
16
|
+
description:
|
|
17
|
+
'Compiles defineTheme() sources through the same theme pipeline into scoped CSS, standard ESM, and type declarations. Ordinary mode writes one complete set per theme. --family combines one selected extension tree into the three files named by the required --family-key, ready for one CSS load and identity-only switching. With --check it writes nothing and reports source drift. --icons-specifier keeps its existing generated-module behavior. It prints one line per built theme and one line naming fonts the themes do not load; --detail full adds the install example and the font recipe, once for a batch.',
|
|
18
|
+
fn: 'themeBuild',
|
|
19
|
+
args: [
|
|
20
|
+
{
|
|
21
|
+
name: 'files',
|
|
22
|
+
param: 'file',
|
|
23
|
+
required: true,
|
|
24
|
+
variadic: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
flag: '--family',
|
|
30
|
+
description:
|
|
31
|
+
'Build the selected extension family into one keyed CSS, JS, and declaration set, written beside the family root theme file, which must be inside the working directory to build (ERR_PATH_TRAVERSAL); --check only reads, so it compares outputs anywhere. Requires --family-key; refused with --out or --watch (ERR_THEME_INVALID)',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
flag: '--family-key <key>',
|
|
35
|
+
description:
|
|
36
|
+
'Lower-kebab filename stem required with --family and refused without it; must differ from every member name (ERR_THEME_INVALID)',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
flag: '-o, --out <path>',
|
|
40
|
+
param: 'options.out',
|
|
41
|
+
description:
|
|
42
|
+
'Output CSS file path, relative or absolute; the .js and .d.ts are written beside it (default: <theme name>.css next to the source). A build writes only inside the working directory, the defaults beside the source too (ERR_PATH_TRAVERSAL); --check writes nothing, so it compares outputs anywhere and refuses only a relative path that escapes the working directory. Single theme only: refused with more than one file or with --family (ERR_THEME_INVALID)',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
flag: '--icons-specifier <specifier>',
|
|
46
|
+
param: 'options.iconsSpecifier',
|
|
47
|
+
description:
|
|
48
|
+
"Override the icon-registry import in the generated JS module, for example ./icons.mjs (default: the specifier in the theme source's own import). With --family it applies to every member's icon import",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
flag: '-w, --watch',
|
|
52
|
+
description:
|
|
53
|
+
'Rebuild automatically when a theme file changes (Ctrl-C to stop). Refused with --check, --family, or --json (ERR_THEME_INVALID)',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
flag: '-c, --check',
|
|
57
|
+
param: 'options.check',
|
|
58
|
+
description:
|
|
59
|
+
'Verify the committed outputs match the source without writing; exit non-zero if stale. Composes with --family and several files; refused with --watch (ERR_THEME_INVALID)',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
examples: [
|
|
63
|
+
{
|
|
64
|
+
label: 'Build to a CSS file',
|
|
65
|
+
cli: 'astryx experimental theme compile ./src/themes/ocean.ts --out ./dist/ocean.css',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: 'Build one related family for attribute-only switching',
|
|
69
|
+
cli: 'astryx experimental theme compile --family ./themes/ocean.mjs ./themes/ocean-calm.mjs --family-key ocean-family',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'Build every theme in a directory',
|
|
73
|
+
cli: 'astryx experimental theme compile ./src/themes/*.ts',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'Check for drift (CI)',
|
|
77
|
+
cli: 'astryx experimental theme compile ./src/themes/ocean.ts --check',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'Build against a separately compiled icon registry',
|
|
81
|
+
cli: 'astryx experimental theme compile ./src/themes/ocean.ts --icons-specifier ./icons.mjs',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
outsideProject: 'same',
|
|
85
|
+
exitCodes: [
|
|
86
|
+
{
|
|
87
|
+
code: 0,
|
|
88
|
+
when: 'the theme builds, or --check finds the outputs up to date',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
code: 1,
|
|
92
|
+
when: 'a build or validation error, or --check finds stale or missing outputs',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
related: ['experimental theme add', 'experimental theme list'],
|
|
96
|
+
replaces: ['theme build'],
|
|
97
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme eject`: the experimental
|
|
5
|
+
* copy of `astryx theme eject`, 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 eject',
|
|
12
|
+
displayName: 'astryx experimental theme eject',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'Fork a theme as editable local source',
|
|
16
|
+
description:
|
|
17
|
+
"Copies a bundled or installed package theme's complete source into the local themes root, including a local descriptor. Writes are atomic. Existing files require --overwrite. Use --package when package themes share a slug.",
|
|
18
|
+
fn: 'themeEject',
|
|
19
|
+
args: [
|
|
20
|
+
{
|
|
21
|
+
name: 'slug',
|
|
22
|
+
param: 'slug',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'path',
|
|
27
|
+
param: 'options.targetPath',
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
options: [
|
|
32
|
+
{
|
|
33
|
+
flag: '-f, --overwrite',
|
|
34
|
+
param: 'options.overwrite',
|
|
35
|
+
description:
|
|
36
|
+
'Replace existing files. Without it, an existing file fails with ERR_FILE_EXISTS and nothing is written',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
flag: '--package <package>',
|
|
40
|
+
param: 'options.package',
|
|
41
|
+
description: 'Select the package that owns the theme',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
examples: [
|
|
45
|
+
{
|
|
46
|
+
label: 'Fork a theme into the local root',
|
|
47
|
+
cli: 'astryx experimental theme eject ocean',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: 'Fork one package theme elsewhere',
|
|
51
|
+
cli: 'astryx experimental theme eject ocean src/themes/my-ocean --package @acme/themes',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
outsideProject: 'same',
|
|
55
|
+
exitCodes: [
|
|
56
|
+
{
|
|
57
|
+
code: 0,
|
|
58
|
+
when: 'all source and descriptor files are written',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
code: 1,
|
|
62
|
+
when: 'the theme is unknown or ambiguous, a path escapes, a source file is missing, or a destination exists',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
related: [
|
|
66
|
+
'experimental theme add',
|
|
67
|
+
'experimental theme compile',
|
|
68
|
+
'experimental theme list',
|
|
69
|
+
],
|
|
70
|
+
replaces: ['theme eject'],
|
|
71
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file CommandDoc for `astryx experimental theme explain`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'command',
|
|
8
|
+
name: 'experimental theme explain',
|
|
9
|
+
displayName: 'astryx experimental theme explain',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
summary:
|
|
13
|
+
"Explain a part, family, setting or aspect; answer a question in plain words; read a picture's colors; or list what you can set",
|
|
14
|
+
description:
|
|
15
|
+
'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 under which variant or state, its variants (--when) and states (--state), the parts inside it (a token set --on the part reaches them), and its family. A family (inputs, containers, checks, menus): its members and whether styling one styles all. A setting: a dial\'s rungs and examples, a token\'s type, default and the parts that read it, or a CSS property and the parts that set it. An aspect (colors, text, background, border, corners, shadow, spacing, font, size): the dial and the whole-theme tokens most parts read for it. A question in plain words ("bold white text in the header", "glossy gradient header"): it finds the parts (header, nav links, banner, cards, inputs, buttons and their variants...) and aspects (text color, background, gradient, corners, border, shadow or bevel, spacing, font, bold, letter spacing) and answers with exact commands from what each part really reads: the direct property (always works) and the token route; a part with variants says a change without --when reaches every variant. A PNG picture: its main colors, biggest share first, with where each sits (a number after the file sets how many, default 14), or with --at the exact color at pixel points (no browser needed). --list dials|tokens|parts|families|properties lists what a change can name; a subject then filters the list. Experimental: it may change or be removed in a patch release.',
|
|
16
|
+
fn: 'themeEditExplain',
|
|
17
|
+
args: [
|
|
18
|
+
{
|
|
19
|
+
name: 'subject',
|
|
20
|
+
param: 'subject',
|
|
21
|
+
required: false,
|
|
22
|
+
variadic: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
options: [
|
|
26
|
+
{
|
|
27
|
+
flag: '--list <kind>',
|
|
28
|
+
param: 'options.list',
|
|
29
|
+
description:
|
|
30
|
+
'List what a change can name: dials, tokens (with type, default and how many parts read each), parts (with component, family, variants and states), families, or properties (the common CSS properties; a filter searches every standard one). The subject, if any, filters the list',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
flag: '--at <points...>',
|
|
34
|
+
param: 'options.at',
|
|
35
|
+
description:
|
|
36
|
+
'With a PNG picture: the exact color at pixel points x,y, given as "40,20;300,180", "40,20 300,180", a repeated --at, or a flat "40,20,300,180"',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
examples: [
|
|
40
|
+
{
|
|
41
|
+
label: 'A part',
|
|
42
|
+
cli: 'astryx experimental theme explain banner',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: 'A question',
|
|
46
|
+
cli: 'astryx experimental theme explain "bold white text in the header"',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'A setting',
|
|
50
|
+
cli: 'astryx experimental theme explain --color-accent',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'Colors in a picture',
|
|
54
|
+
cli: 'astryx experimental theme explain target.png --at "40,20;300,180"',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Every dial',
|
|
58
|
+
cli: 'astryx experimental theme explain --list dials',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'Accent tokens',
|
|
62
|
+
cli: 'astryx experimental theme explain accent --list tokens',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
outsideProject: 'refuse',
|
|
66
|
+
notes: [
|
|
67
|
+
{
|
|
68
|
+
type: 'prose',
|
|
69
|
+
text: "In global mode: outside a project, with no package.json in the folder or above it, experimental theme explain 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}.",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
exitCodes: [
|
|
73
|
+
{
|
|
74
|
+
code: 0,
|
|
75
|
+
when: 'the answer (an empty answer or list included)',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
code: 1,
|
|
79
|
+
when: 'nothing named, an unknown --list kind, --at without a picture, a missing or unreadable PNG file, or an odd count of numbers in --at',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
related: ['experimental theme', 'experimental theme compile'],
|
|
83
|
+
replaces: ['theme targets'],
|
|
84
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme list`: the experimental
|
|
5
|
+
* copy of `astryx theme list`, 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 list',
|
|
12
|
+
displayName: 'astryx experimental theme list',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'List themes available to add',
|
|
16
|
+
description:
|
|
17
|
+
'Lists bundled, package, and local themes with their owner, source, added state, and default state. Earlier descriptor-less copies are not listed as themes; the receipt names them with the upgrade command.',
|
|
18
|
+
fn: 'themeListAvailable',
|
|
19
|
+
options: [
|
|
20
|
+
{
|
|
21
|
+
flag: '--package <package>',
|
|
22
|
+
param: 'options.package',
|
|
23
|
+
description: 'Show only themes owned by this package',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
examples: [
|
|
27
|
+
{
|
|
28
|
+
label: 'List available themes',
|
|
29
|
+
cli: 'astryx experimental theme list --json',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'List one integration package',
|
|
33
|
+
cli: 'astryx experimental theme list --package @acme/themes',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
outsideProject: 'same',
|
|
37
|
+
exitCodes: [
|
|
38
|
+
{
|
|
39
|
+
code: 0,
|
|
40
|
+
when: 'success',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
code: 1,
|
|
44
|
+
when: 'a bundled or installed theme descriptor cannot be read',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
related: ['experimental theme add', 'experimental theme compile'],
|
|
48
|
+
replaces: ['theme list'],
|
|
49
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file CommandDoc for `astryx experimental theme new`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'command',
|
|
8
|
+
name: 'experimental theme new',
|
|
9
|
+
displayName: 'astryx experimental theme new',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
summary: 'Start a theme in themes/<theme>/, optionally on a built-in theme',
|
|
13
|
+
description:
|
|
14
|
+
'Makes themes/<theme>/ with <theme>.settings.json (the settings this command owns), the generated <theme>.settings.ts, <theme>.theme.ts (which extends it and is yours), and the built <theme>.css and <theme>.js (the same build as `astryx theme build`), then writes preview.html, the sample app page with the theme. --like builds on a built-in theme (neutral, stone, matcha, y2k, gothic, chocolate, butter; its package must be installed); without it the theme starts from Astryx defaults. Change the base later with `astryx experimental theme 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
|
+
fn: 'themeEditNew',
|
|
16
|
+
args: [
|
|
17
|
+
{
|
|
18
|
+
name: 'theme',
|
|
19
|
+
param: 'theme',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
flag: '--like <theme>',
|
|
26
|
+
param: 'options.like',
|
|
27
|
+
description:
|
|
28
|
+
'A built-in theme to build on: neutral, stone, matcha, y2k, gothic, chocolate, or butter',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
flag: '--png',
|
|
32
|
+
param: 'options.png',
|
|
33
|
+
description:
|
|
34
|
+
'Also take PNG pictures of the previews (light and dark), with a Playwright installed in the project or a Chrome or Chromium found on the machine; without one, the result says how to get it. Nothing else changes',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
examples: [
|
|
38
|
+
{
|
|
39
|
+
label: 'Start on a built-in theme',
|
|
40
|
+
cli: 'astryx experimental theme new brand --like neutral',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Start from Astryx defaults',
|
|
44
|
+
cli: 'astryx experimental theme new brand',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
outsideProject: 'refuse',
|
|
48
|
+
notes: [
|
|
49
|
+
{
|
|
50
|
+
type: 'prose',
|
|
51
|
+
text: "In global mode: outside a project, with no package.json in the folder or above it, experimental theme new 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}.",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
exitCodes: [
|
|
55
|
+
{
|
|
56
|
+
code: 0,
|
|
57
|
+
when: 'the theme is made and built, and its preview is written',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
code: 1,
|
|
61
|
+
when: 'a name that is not lowercase letters, digits and dashes, a theme that already exists, a --like that is not a built-in theme or is not installed, no Core installed in the folder, or a build failure (nothing is left behind)',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
related: ['experimental theme', 'experimental theme compile'],
|
|
65
|
+
replaces: ['theme template', 'theme eject'],
|
|
66
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme palette generate`: the experimental
|
|
5
|
+
* copy of `astryx theme palette generate`, 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 palette generate',
|
|
12
|
+
displayName: 'astryx experimental theme palette generate',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'Generate an OKLCH palette candidate for human review',
|
|
16
|
+
description:
|
|
17
|
+
'Reads an explicit JSON request and runs the versioned astryx-oklch-v1 recipe. The command defaults to 21 stops (0 through 100) but accepts any non-empty ordered numeric stop list, including decimals. Stops apply to every family in the request. Authors may omit the repeated endpoints with a custom list; standalone exact black and white values remain available in every candidate. For anchors, exact preserves the chosen color at its mode and stop; bounded allows movement within maxDeltaE; flexible uses the color as guidance. Without --out it prints a preview. With --out it writes a candidate file and detached receipt. --preview writes a standardized, self-contained HTML review artifact. TypeScript output is directly importable and contains no generator dependency. JSON is also supported. Existing author-owned files are left untouched unless --overwrite is explicit. When used in a theme integration, keep the palette request under the theme slug, write the candidate and receipt under that same slug, import the candidate from the theme source, and keep all three inside the theme directory. The package ships that directory as one source unit for discovery and explicit eject, while apps use its built exports.',
|
|
18
|
+
fn: 'themePaletteGenerate',
|
|
19
|
+
args: [
|
|
20
|
+
{
|
|
21
|
+
name: 'config',
|
|
22
|
+
param: 'configPath',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
flag: '-o, --out <path>',
|
|
29
|
+
param: 'options.out',
|
|
30
|
+
description:
|
|
31
|
+
'Write a candidate TypeScript or JSON file and a sibling receipt',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
flag: '--preview <path>',
|
|
35
|
+
param: 'options.preview',
|
|
36
|
+
description:
|
|
37
|
+
'Write a self-contained HTML preview page; the path must end in .html',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
flag: '-f, --overwrite',
|
|
41
|
+
param: 'options.overwrite',
|
|
42
|
+
description:
|
|
43
|
+
'Replace existing candidate, receipt, and preview files. Without it, if any of them exists, nothing is written',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
examples: [
|
|
47
|
+
{
|
|
48
|
+
label: 'Preview candidate JSON',
|
|
49
|
+
cli: 'astryx experimental theme palette generate themes/ocean/palette.config.json',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'Write candidate and receipt',
|
|
53
|
+
cli: 'astryx experimental theme palette generate themes/ocean/palette.config.json --out themes/ocean/tokens/ocean.palette.ts',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: 'Write candidate, receipt, and review preview',
|
|
57
|
+
cli: 'astryx experimental theme palette generate themes/ocean/palette.config.json --out themes/ocean/tokens/ocean.palette.ts --preview themes/ocean/tokens/ocean.palette.html',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
outsideProject: 'same',
|
|
61
|
+
exitCodes: [
|
|
62
|
+
{
|
|
63
|
+
code: 0,
|
|
64
|
+
when: 'a candidate is produced or existing output is left untouched',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
code: 1,
|
|
68
|
+
when: 'the request is invalid or output cannot be written safely',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
related: ['experimental theme compile', 'experimental theme template'],
|
|
72
|
+
replaces: ['theme palette generate'],
|
|
73
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme palette`: the experimental
|
|
5
|
+
* copy of `astryx theme palette`, 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 palette',
|
|
12
|
+
displayName: 'astryx experimental theme palette',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'Create and work with theme-owned color palettes',
|
|
16
|
+
description:
|
|
17
|
+
'Palette authoring tools. generate writes a palette candidate for you to review before a theme uses it.',
|
|
18
|
+
subcommands: ['generate'],
|
|
19
|
+
examples: [
|
|
20
|
+
{
|
|
21
|
+
label: 'Generate a candidate',
|
|
22
|
+
cli: 'astryx experimental theme palette generate palette.config.json',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
exitCodes: [
|
|
26
|
+
{
|
|
27
|
+
code: 0,
|
|
28
|
+
when: 'help is shown or a subcommand succeeds',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
code: 1,
|
|
32
|
+
when: 'an unknown subcommand is provided',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
related: ['experimental theme compile', 'experimental theme template'],
|
|
36
|
+
replaces: ['theme palette'],
|
|
37
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file CommandDoc for `astryx experimental theme preview`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').CommandDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'command',
|
|
8
|
+
name: 'experimental theme preview',
|
|
9
|
+
displayName: 'astryx experimental theme preview',
|
|
10
|
+
namespace: 'cli/commands',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
summary:
|
|
13
|
+
'The theme-building page: every component grouped, overlays open, real template pages',
|
|
14
|
+
description:
|
|
15
|
+
"Makes a page for building the theme: every component grouped (actions, inputs, selection, navigation, feedback, data, containers, overlays shown open), each variant side by side, plus the sample app page and real template pages (dashboard, form, settings; a template whose packages the app lacks is left out and named with its install line). Without --write, it renders the page with the theme to one self-contained HTML file in themes/<theme>/ (sheet.html, or sheet-<group>.html), with an auto/light/dark switch that needs no script. With --write <dir>, it writes theme-preview.tsx into the app instead (a real page using the app's own Astryx, with a light/dark switch) and the template pages beside it, for a route the app serves. --group limits it to one group. Experimental: it may change or be removed in a patch release.",
|
|
16
|
+
fn: 'themeEditPreview',
|
|
17
|
+
args: [
|
|
18
|
+
{
|
|
19
|
+
name: 'theme',
|
|
20
|
+
param: 'theme',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
options: [
|
|
25
|
+
{
|
|
26
|
+
flag: '--write <dir>',
|
|
27
|
+
param: 'options.write',
|
|
28
|
+
description:
|
|
29
|
+
'Write the page into the app, in this folder (inside the current folder): theme-preview.tsx and the template pages it shows',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
flag: '--group <name>',
|
|
33
|
+
param: 'options.group',
|
|
34
|
+
description:
|
|
35
|
+
'Only one group: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
flag: '--png',
|
|
39
|
+
param: 'options.png',
|
|
40
|
+
description:
|
|
41
|
+
'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',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
examples: [
|
|
45
|
+
{
|
|
46
|
+
label: 'One HTML file',
|
|
47
|
+
cli: 'astryx experimental theme preview brand',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: 'Into the app',
|
|
51
|
+
cli: 'astryx experimental theme preview brand --write src/app/theme-preview',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'Just the overlays',
|
|
55
|
+
cli: 'astryx experimental theme preview brand --group overlays',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
outsideProject: 'refuse',
|
|
59
|
+
notes: [
|
|
60
|
+
{
|
|
61
|
+
type: 'prose',
|
|
62
|
+
text: "In global mode: outside a project, with no package.json in the folder or above it, experimental theme preview 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}.",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
exitCodes: [
|
|
66
|
+
{
|
|
67
|
+
code: 0,
|
|
68
|
+
when: 'the page is rendered or written',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
code: 1,
|
|
72
|
+
when: 'the theme does not exist, an unknown --group, --write outside the current folder, --png with --write, or a page that does not render',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
related: ['experimental theme', 'experimental theme compile'],
|
|
76
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CommandDoc for `astryx experimental theme remove`: the experimental
|
|
5
|
+
* copy of `astryx theme remove`, 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 remove',
|
|
12
|
+
displayName: 'astryx experimental theme remove',
|
|
13
|
+
namespace: 'cli/commands',
|
|
14
|
+
stability: 'experimental',
|
|
15
|
+
summary: 'Remove a non-default theme from the app',
|
|
16
|
+
description:
|
|
17
|
+
'Removes one added theme from the generated module and regenerates the whole module. Choose another default with theme use before removing the current default.',
|
|
18
|
+
fn: 'themeRemove',
|
|
19
|
+
args: [
|
|
20
|
+
{
|
|
21
|
+
name: 'slug',
|
|
22
|
+
param: 'slug',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
examples: [
|
|
27
|
+
{
|
|
28
|
+
label: 'Remove an added theme',
|
|
29
|
+
cli: 'astryx experimental theme remove ocean',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
outsideProject: 'refuse',
|
|
33
|
+
exitCodes: [
|
|
34
|
+
{
|
|
35
|
+
code: 0,
|
|
36
|
+
when: 'the module is regenerated without the theme',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
code: 1,
|
|
40
|
+
when: 'the theme is not added, is the default, or state is invalid',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
related: [
|
|
44
|
+
'experimental theme add',
|
|
45
|
+
'experimental theme use',
|
|
46
|
+
'experimental theme list',
|
|
47
|
+
],
|
|
48
|
+
notes: [
|
|
49
|
+
{
|
|
50
|
+
type: 'prose',
|
|
51
|
+
text: 'In global mode: outside a project, experimental theme remove writes nothing and stops with `ERR_THEME_INVALID`: "No package.json found. Run this command inside an app project." In a project, the project\'s version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:problems}.',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
replaces: ['theme remove'],
|
|
55
|
+
};
|