@astryxdesign/cli 0.7.13 → 0.7.14-canary.108f354
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 +12 -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 +116 -0
- package/api/theme-edit/_adapter.mjs +1683 -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 +845 -0
- package/api/theme-edit/_color.d.mts +29 -0
- package/api/theme-edit/_color.mjs +300 -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 +121 -0
- package/api/theme-edit/_preview.mjs +720 -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 +861 -0
- package/api/theme-edit/_tables.d.mts +132 -0
- package/api/theme-edit/_tables.mjs +700 -0
- package/api/theme-edit/theme-edit.d.mts +93 -0
- package/api/theme-edit/theme-edit.mjs +145 -0
- package/api/theme-edit/theme-edit.type.d.mts +413 -0
- package/api/theme-edit/theme-edit.type.mjs +233 -0
- package/api/theme-edit/themeEditHow.doc.d.mts +6 -0
- package/api/theme-edit/themeEditHow.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/themeEditPreviewAdd.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewAdd.doc.mjs +100 -0
- package/api/theme-edit/themeEditPreviewApp.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +84 -0
- package/api/theme-edit/themeEditPreviewList.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewList.doc.mjs +53 -0
- package/api/theme-edit/themeEditPreviewRemove.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +66 -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 +124 -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/preview-app/README.md +6 -0
- package/assets/preview-app/css.d.ts +5 -0
- package/assets/preview-app/gitignore +1 -0
- package/assets/preview-app/next.config.mjs +6 -0
- package/assets/preview-app/package.json +23 -0
- package/assets/preview-app/src/app/globals.css +5 -0
- package/assets/preview-app/src/app/layout.tsx +21 -0
- package/assets/preview-app/src/app/page.tsx +94 -0
- package/assets/preview-app/src/app/providers.tsx +16 -0
- package/assets/preview-app/tsconfig.json +27 -0
- 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 +684 -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-editor-how.doc.mjs +84 -0
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +121 -0
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +104 -0
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +49 -0
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +71 -0
- package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -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-add.doc.mjs +86 -0
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +48 -0
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +59 -0
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +40 -0
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -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-use.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme.doc.mjs +57 -0
- package/clients/cli/commands/experimental.doc.mjs +10 -3
- package/clients/cli/commands/theme.mjs +101 -34
- package/clients/cli/index.mjs +18 -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 +55 -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,233 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Colocated types for `astryx experimental theme editor`: the source of truth
|
|
5
|
+
* for its option and response shapes.
|
|
6
|
+
*
|
|
7
|
+
* @position api/theme-edit — typedefs for api/theme-edit/theme-edit.mjs
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* One setting a theme made by `experimental theme editor` holds.
|
|
12
|
+
* @experimental May change or be removed in a patch release.
|
|
13
|
+
* @typedef {object} ThemeEditSetting
|
|
14
|
+
* @property {string} thing - A dial (`corners`), a design token (`--color-accent`), or a CSS property (`background`).
|
|
15
|
+
* @property {string} value - The value as stored (a dial step is stored as the rung it reached).
|
|
16
|
+
* @property {'dial' | 'token' | 'property'} source - What kind of thing it is.
|
|
17
|
+
* @property {string} [on] - The part, family, or typography role it applies to; absent for the whole theme.
|
|
18
|
+
* @property {string} [when] - `<prop>:<value>`: only that variant.
|
|
19
|
+
* @property {string} [state] - Only that state.
|
|
20
|
+
* @property {'light' | 'dark'} [mode] - Only that color mode.
|
|
21
|
+
* @property {boolean} [only] - One member of an always-alike family, not the whole family.
|
|
22
|
+
* @property {string} [axis] - For the `headings` dial: `weight` or `tracking`.
|
|
23
|
+
* @property {string} [note] - What the check found worth saying (what the token feeds, parts it misses).
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @experimental May change or be removed in a patch release.
|
|
28
|
+
* @typedef {object} ThemeEditNewOptions
|
|
29
|
+
* @property {string} [cwd] - The app folder (default: process.cwd()).
|
|
30
|
+
* @property {string} [like] - A built-in theme to build on: neutral, stone, matcha, y2k, gothic, chocolate, or butter.
|
|
31
|
+
* @property {boolean} [png] - Also take PNG pictures of the preview with a Playwright or Chrome found on the machine.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @experimental May change or be removed in a patch release.
|
|
36
|
+
* @typedef {object} ThemeEditChangeOptions
|
|
37
|
+
* @property {string} [cwd] - The app folder (default: process.cwd()).
|
|
38
|
+
* @property {string} [on] - A part (`button`), a family (`inputs`), or for `font` a role (`heading`).
|
|
39
|
+
* @property {string} [when] - `<prop>:<value>`: only that variant, such as `variant:primary`.
|
|
40
|
+
* @property {string} [state] - Only that state, such as `hover`.
|
|
41
|
+
* @property {string} [mode] - `light` or `dark`: only that color mode (colors and shadows only).
|
|
42
|
+
* @property {boolean} [only] - With a member of an always-alike family (inputs, checks), style just that part.
|
|
43
|
+
* @property {boolean} [png] - Also take PNG pictures of the preview.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @experimental May change or be removed in a patch release.
|
|
48
|
+
* @typedef {object} ThemeEditPreviewFields
|
|
49
|
+
* @property {string} preview - The sample app page with the theme, one self-contained HTML file.
|
|
50
|
+
* @property {string[]} pictures - PNG pictures taken (only with `png`).
|
|
51
|
+
* @property {string | null} pictureProblem - Why no picture was taken, and how to get a browser for it.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* `astryx --json experimental theme editor new <theme>`.
|
|
56
|
+
* @experimental May change or be removed in a patch release.
|
|
57
|
+
* @typedef {object} ThemeEditNewResponse
|
|
58
|
+
* @property {'themeEdit.new'} type
|
|
59
|
+
* @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, problems: string[]} & ThemeEditPreviewFields} data
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* `astryx --json experimental theme editor set <theme> <thing> <value>`, and
|
|
64
|
+
* `undo <theme> <thing>`, which removes one setting.
|
|
65
|
+
* @experimental May change or be removed in a patch release.
|
|
66
|
+
* @typedef {object} ThemeEditChangeResponse
|
|
67
|
+
* @property {'themeEdit.set' | 'themeEdit.undo'} type
|
|
68
|
+
* @property {ThemeEditChangeData} data
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @experimental May change or be removed in a patch release.
|
|
73
|
+
* @typedef {object} ThemeEditChangeData
|
|
74
|
+
* @property {string} theme
|
|
75
|
+
* @property {'set' | 'undo'} action
|
|
76
|
+
* @property {ThemeEditSetting} setting - The setting written, or for `undo` the one removed.
|
|
77
|
+
* @property {ThemeEditSetting | null} replaced - The setting this one replaced.
|
|
78
|
+
* @property {string | null} was - For `base` and `mode`: the value before.
|
|
79
|
+
* @property {string[]} parts - The parts it styles (a family's members when it spread).
|
|
80
|
+
* @property {{name: string, members: string[], onlyHint: boolean} | null} family - The family it spread to; `onlyHint` when `--only` would style one member.
|
|
81
|
+
* @property {string[]} changedTokens - Resolved token changes, `name (mode): before -> after`.
|
|
82
|
+
* @property {string[]} styled - Part styles and typography the change wrote.
|
|
83
|
+
* @property {string[]} kept - Part settings a whole-theme dial left in place (a part setting wins).
|
|
84
|
+
* @property {string[]} lifted - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
|
|
85
|
+
* @property {string[]} notes - What else to know: accent text per mode, font loading, what a token feeds.
|
|
86
|
+
* @property {string[]} problems - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
|
|
87
|
+
* @property {string[]} warnings - Warnings from the theme build.
|
|
88
|
+
* @property {string} preview
|
|
89
|
+
* @property {string[]} pictures
|
|
90
|
+
* @property {string | null} pictureProblem
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @experimental May change or be removed in a patch release.
|
|
95
|
+
* @typedef {object} ThemeEditShowOptions
|
|
96
|
+
* @property {string} [cwd] - The app folder (default: process.cwd()).
|
|
97
|
+
* @property {string} [group] - Only one group on the sheet: actions, inputs, selection, navigation, feedback, data, containers, overlays, or pages.
|
|
98
|
+
* @property {boolean} [png] - Also take PNG pictures of the previews.
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* `astryx --json experimental theme editor show <theme>`.
|
|
103
|
+
* @experimental May change or be removed in a patch release.
|
|
104
|
+
* @typedef {object} ThemeEditShowResponse
|
|
105
|
+
* @property {'themeEdit.show'} type
|
|
106
|
+
* @property {object} data
|
|
107
|
+
* @property {string} data.theme
|
|
108
|
+
* @property {string | null} data.like
|
|
109
|
+
* @property {string} data.mode
|
|
110
|
+
* @property {Array<ThemeEditSetting & {parts: string[]}>} data.settings
|
|
111
|
+
* @property {Record<string, Record<string, string | null>>} data.resolved - Key tokens, per mode.
|
|
112
|
+
* @property {string[]} data.problems
|
|
113
|
+
* @property {string[]} data.notes
|
|
114
|
+
* @property {string} data.preview
|
|
115
|
+
* @property {string} data.sheet - The theme-building page with every component.
|
|
116
|
+
* @property {number} data.sheetComponents
|
|
117
|
+
* @property {string[]} data.skipped - Template pages left out, with the install line each needs.
|
|
118
|
+
* @property {string[]} data.pictures
|
|
119
|
+
* @property {string | null} data.pictureProblem
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @experimental May change or be removed in a patch release.
|
|
124
|
+
* @typedef {object} ThemeEditUndoOptions
|
|
125
|
+
* @property {string} [cwd] - The app folder (default: process.cwd()).
|
|
126
|
+
* @property {string} [thing] - Remove this one setting (a dial, a token, or a CSS property) instead of stepping back one change; it goes back to the base theme's value.
|
|
127
|
+
* @property {string} [value] - With `thing` `headings`: which half to remove, `weight` or `tracking`.
|
|
128
|
+
* @property {string} [on] - With `thing`: the part, family or role it was set on.
|
|
129
|
+
* @property {string} [when] - With `thing`: the variant it was set for.
|
|
130
|
+
* @property {string} [state] - With `thing`: the state it was set for.
|
|
131
|
+
* @property {string} [mode] - With `thing`: the mode it was set for.
|
|
132
|
+
* @property {boolean} [only] - With `thing`: whether it was set with `--only`.
|
|
133
|
+
* @property {boolean} [png] - Also take PNG pictures of the preview.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* `astryx --json experimental theme editor undo <theme>`: one step back.
|
|
138
|
+
* With a thing, undo returns a {@link ThemeEditChangeResponse} instead.
|
|
139
|
+
* @experimental May change or be removed in a patch release.
|
|
140
|
+
* @typedef {object} ThemeEditUndoResponse
|
|
141
|
+
* @property {'themeEdit.undo'} type
|
|
142
|
+
* @property {{theme: string, action: 'step', undone: string[], settings: number, stepsLeft: number} & ThemeEditPreviewFields} data
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @experimental May change or be removed in a patch release.
|
|
147
|
+
* @typedef {object} ThemeEditPreviewAddOptions
|
|
148
|
+
* @property {string} [cwd] - The project folder (default: process.cwd()).
|
|
149
|
+
* @property {string} [theme] - The theme the pages wear: a theme made by `experimental theme editor` (default: the only one under themes/; with none or several, the app's own theme).
|
|
150
|
+
* @property {string} [template] - Add this page template instead of ranking one from a description.
|
|
151
|
+
* @property {number} [top] - With a description: how many of the best-fitting page templates to add, 1 to 3 (default 1).
|
|
152
|
+
* @property {string} [path] - The folder of the preview route, inside the project (default: theme-preview/ in the app's routes folder, app/ or src/app/).
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* `astryx --json experimental theme preview add [<description>]`.
|
|
157
|
+
* @experimental May change or be removed in a patch release.
|
|
158
|
+
* @typedef {object} ThemeEditPreviewAddResponse
|
|
159
|
+
* @property {'themeEdit.previewAdd'} type
|
|
160
|
+
* @property {object} data
|
|
161
|
+
* @property {string} data.folder - The preview route folder.
|
|
162
|
+
* @property {string | null} data.theme - The theme the pages wear; null for the app's own theme.
|
|
163
|
+
* @property {string[]} data.added - Pages added by this call.
|
|
164
|
+
* @property {Array<{page: string, missingPackages: string[], installCommand: string | null}>} data.skipped - Template pages not added because the app lacks packages they import, with the command that installs them.
|
|
165
|
+
* @property {string[]} data.notes - What else to know.
|
|
166
|
+
* @property {string[]} data.pages - Every page of the preview, in order.
|
|
167
|
+
* @property {string[]} data.files - Every file the preview wrote.
|
|
168
|
+
* @property {string} data.open - How to open the preview.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @experimental May change or be removed in a patch release.
|
|
173
|
+
* @typedef {object} ThemeEditPreviewAppOptions
|
|
174
|
+
* @property {string} [cwd] - The folder the app folder is inside (default: process.cwd()).
|
|
175
|
+
* @property {string} [theme] - A theme made by `experimental theme editor` here: it is copied into the app, and the preview pages wear it (default: the app's own neutral theme).
|
|
176
|
+
* @property {boolean} [overwrite] - Write into a folder that is not empty. A protected file there is never replaced, and the folder's own package.json and .gitignore are kept.
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* `astryx --json experimental theme preview app <dir>`.
|
|
181
|
+
* @experimental May change or be removed in a patch release.
|
|
182
|
+
* @typedef {object} ThemeEditPreviewAppResponse
|
|
183
|
+
* @property {'themeEdit.previewApp'} type
|
|
184
|
+
* @property {object} data
|
|
185
|
+
* @property {string} data.folder - The new app folder.
|
|
186
|
+
* @property {string | null} data.theme - The theme copied into the app, which the pages wear; null for the app's own neutral theme.
|
|
187
|
+
* @property {string[]} data.pages - The preview pages.
|
|
188
|
+
* @property {string[]} data.files - Every file written.
|
|
189
|
+
* @property {string[]} data.notes - What else to know.
|
|
190
|
+
* @property {string} data.open - How to install, run and open the app.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @experimental May change or be removed in a patch release.
|
|
195
|
+
* @typedef {object} ThemeEditPreviewListOptions
|
|
196
|
+
* @property {string} [cwd] - The project folder (default: process.cwd()).
|
|
197
|
+
* @property {string} [path] - The folder of the preview route, when it is not in the default place.
|
|
198
|
+
*/
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* `astryx --json experimental theme preview list`.
|
|
202
|
+
* @experimental May change or be removed in a patch release.
|
|
203
|
+
* @typedef {object} ThemeEditPreviewListResponse
|
|
204
|
+
* @property {'themeEdit.previewList'} type
|
|
205
|
+
* @property {{folder: string | null, theme: string | null, pages: Array<{id: string, label: string}>}} data
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* `astryx --json experimental theme preview remove [<page>]`.
|
|
210
|
+
* @experimental May change or be removed in a patch release.
|
|
211
|
+
* @typedef {object} ThemeEditPreviewRemoveResponse
|
|
212
|
+
* @property {'themeEdit.previewRemove'} type
|
|
213
|
+
* @property {{folder: string, removed: string[], pages: string[]}} data
|
|
214
|
+
*/
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @experimental May change or be removed in a patch release.
|
|
218
|
+
* @typedef {object} ThemeEditHowOptions
|
|
219
|
+
* @property {string} [cwd] - The app folder (default: process.cwd()).
|
|
220
|
+
* @property {string} [list] - List what a change can name: dials, tokens, parts, families, or properties; the subject filters it.
|
|
221
|
+
* @property {string[]} [at] - With a PNG picture: pixel points x,y ("40,20;300,180", "40,20 300,180", several entries, or a flat "40,20,300,180").
|
|
222
|
+
* @property {number} [count] - With a PNG picture: how many main colors (default 14).
|
|
223
|
+
*/
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* `astryx --json experimental theme editor how <subject>`. `kind` says which answer it is.
|
|
227
|
+
* @experimental May change or be removed in a patch release.
|
|
228
|
+
* @typedef {object} ThemeEditHowResponse
|
|
229
|
+
* @property {'themeEdit.how'} type
|
|
230
|
+
* @property {{kind: 'part' | 'family' | 'setting' | 'aspect' | 'question' | 'picture' | 'list', subject: string, [key: string]: any}} data
|
|
231
|
+
*/
|
|
232
|
+
|
|
233
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/** @file FunctionDoc for `themeEditHow()` / `astryx experimental theme editor how`. */
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file FunctionDoc for `themeEditHow()` / `astryx experimental theme editor how`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'function',
|
|
8
|
+
kind: 'api',
|
|
9
|
+
name: 'themeEditHow',
|
|
10
|
+
namespace: 'cli/api',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
displayName: 'themeEditHow()',
|
|
13
|
+
summary:
|
|
14
|
+
"Look up a part, family, setting or aspect; answer a question in plain words; read a picture's colors; or list what you can set.",
|
|
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 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.',
|
|
17
|
+
importPath: '@astryxdesign/cli/api/experimental',
|
|
18
|
+
signature:
|
|
19
|
+
'themeEditHow(subject?: string, options?: object): Promise<object>',
|
|
20
|
+
keywords: [
|
|
21
|
+
'theme',
|
|
22
|
+
'experimental theme',
|
|
23
|
+
'help',
|
|
24
|
+
'design tokens',
|
|
25
|
+
'type-checked',
|
|
26
|
+
],
|
|
27
|
+
params: [
|
|
28
|
+
{
|
|
29
|
+
name: 'subject',
|
|
30
|
+
type: 'string',
|
|
31
|
+
description:
|
|
32
|
+
'A part, family, setting, aspect, question, or PNG file; with `list`, a filter.',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'options.list',
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'dials, tokens, parts, families, or properties.',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'options.at',
|
|
41
|
+
type: 'string[]',
|
|
42
|
+
description: 'With a picture: pixel points x,y.',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'options.count',
|
|
46
|
+
type: 'number',
|
|
47
|
+
description: 'With a picture: how many main colors (default 14).',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'options.cwd',
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The app folder.',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
returns: [
|
|
56
|
+
{
|
|
57
|
+
type: 'themeEdit.how',
|
|
58
|
+
description:
|
|
59
|
+
'`kind` says which answer it is: part (variants, states, reads per aspect, parts inside, family), family (members), setting, aspect or question (answers with commands), picture (main colors or the color at points), or list (the items).',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
throws: [
|
|
63
|
+
{
|
|
64
|
+
code: 'ERR_MISSING_ARGUMENT',
|
|
65
|
+
when: 'nothing named',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
code: 'ERR_INVALID_ARGUMENT',
|
|
69
|
+
when: 'an unknown --list kind, --at without a picture, a picture that is not a PNG, an odd count of numbers in --at, or a bad count',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
code: 'ERR_FILE_NOT_FOUND',
|
|
73
|
+
when: 'the picture does not exist',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
code: 'ERR_PROJECT_REQUIRED',
|
|
77
|
+
when: '@astryxdesign/core is not installed in the folder',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
examples: [
|
|
81
|
+
{
|
|
82
|
+
label: 'A part',
|
|
83
|
+
code: 'await themeEditHow(...)',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
command: 'experimental theme editor how',
|
|
87
|
+
related: ['themeBuild'],
|
|
88
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/** @file FunctionDoc for `themeEditNew()` / `astryx experimental theme editor new`. */
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file FunctionDoc for `themeEditNew()` / `astryx experimental theme editor new`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'function',
|
|
8
|
+
kind: 'api',
|
|
9
|
+
name: 'themeEditNew',
|
|
10
|
+
namespace: 'cli/api',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
displayName: 'themeEditNew()',
|
|
13
|
+
summary: 'Start a theme in themes/<theme>/, optionally on a built-in theme.',
|
|
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.',
|
|
16
|
+
importPath: '@astryxdesign/cli/api/experimental',
|
|
17
|
+
signature: 'themeEditNew(theme: string, options?: object): Promise<object>',
|
|
18
|
+
keywords: [
|
|
19
|
+
'theme',
|
|
20
|
+
'experimental theme',
|
|
21
|
+
'new',
|
|
22
|
+
'design tokens',
|
|
23
|
+
'type-checked',
|
|
24
|
+
],
|
|
25
|
+
params: [
|
|
26
|
+
{
|
|
27
|
+
name: 'theme',
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'The theme name: lowercase letters, digits and dashes.',
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'options.like',
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'A built-in theme to build on.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'options.png',
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
description: 'Also take PNG pictures of the preview.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'options.cwd',
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'The app folder (default: the current directory).',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
returns: [
|
|
49
|
+
{
|
|
50
|
+
type: 'themeEdit.new',
|
|
51
|
+
description:
|
|
52
|
+
'The theme, its base, the files written, contrast problems, and the preview.',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
throws: [
|
|
56
|
+
{
|
|
57
|
+
code: 'ERR_INVALID_ARGUMENT',
|
|
58
|
+
when: 'the name is not lowercase letters, digits and dashes',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
code: 'ERR_FILE_EXISTS',
|
|
62
|
+
when: 'the theme, or files in its folder, already exist',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
code: 'ERR_THEME_BAD_VALUE',
|
|
66
|
+
when: '`like` is not a built-in theme',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
code: 'ERR_UNKNOWN_THEME',
|
|
70
|
+
when: 'the built-in theme is not installed; the suggestion is its install line',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
code: 'ERR_PROJECT_REQUIRED',
|
|
74
|
+
when: '@astryxdesign/core is not installed in the folder',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
code: 'ERR_THEME_INVALID',
|
|
78
|
+
when: 'the theme does not build',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
examples: [
|
|
82
|
+
{
|
|
83
|
+
label: 'Start on a built-in theme',
|
|
84
|
+
code: 'await themeEditNew(...)',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
command: 'experimental theme editor new',
|
|
88
|
+
related: ['themeBuild'],
|
|
89
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/** @file FunctionDoc for `themeEditPreviewAdd()` / `astryx experimental theme preview add`. */
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file FunctionDoc for `themeEditPreviewAdd()` / `astryx experimental theme preview add`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'function',
|
|
8
|
+
kind: 'api',
|
|
9
|
+
name: 'themeEditPreviewAdd',
|
|
10
|
+
namespace: 'cli/api',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
displayName: 'themeEditPreviewAdd()',
|
|
13
|
+
summary:
|
|
14
|
+
'Add pages to the theme preview in the app: the default pages, the best template pages for a description, or one template.',
|
|
15
|
+
description:
|
|
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; `template` names one page template instead; with neither, it adds the default pages: the sample app page and every component grouped. The route goes in theme-preview/ in the app\'s routes folder (app/ or src/app/), or in `path`; the first add records the pages and the files it wrote in theme-preview.json beside the route, so later calls find it. With no routes folder and no `path`, it refuses and names both ways on: `path`, or `themeEditPreviewApp`, which makes a new starter app with the preview in it. Every check (the theme, the template, the ranking and every file it writes) runs before the first write, so a refusal changes nothing. A template page that imports a package the app lacks is not added: the result lists it in `skipped` with the command that installs it. A file the preview did not write is never replaced. The pages wear `theme` (default: the only theme under themes/; with none or several, the app\'s own theme). Experimental: it may change or be removed in a patch release.',
|
|
17
|
+
importPath: '@astryxdesign/cli/api/experimental',
|
|
18
|
+
signature:
|
|
19
|
+
'themeEditPreviewAdd(description?: string, options?: object): Promise<object>',
|
|
20
|
+
keywords: ['theme', 'experimental theme', 'preview', 'theme preview'],
|
|
21
|
+
params: [
|
|
22
|
+
{
|
|
23
|
+
name: 'description',
|
|
24
|
+
type: 'string',
|
|
25
|
+
description:
|
|
26
|
+
'What the page is for; the build ranking picks the template pages that fit it.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'options.theme',
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'The theme the pages wear.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'options.template',
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Add this page template instead of ranking one.',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'options.top',
|
|
40
|
+
type: 'number',
|
|
41
|
+
description:
|
|
42
|
+
'With a description: how many template pages, 1 to 3 (default 1).',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'options.path',
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'The folder of the preview route, inside the project.',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'options.cwd',
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The project folder.',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
returns: [
|
|
56
|
+
{
|
|
57
|
+
type: 'themeEdit.previewAdd',
|
|
58
|
+
description:
|
|
59
|
+
'The route folder, the theme, the pages added, the template pages skipped for missing packages, every page, the files written, and how to open the preview.',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
throws: [
|
|
63
|
+
{
|
|
64
|
+
code: 'ERR_NOT_FOUND',
|
|
65
|
+
when: 'no routes folder and no `path`, or no page template to show',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
code: 'ERR_FILE_EXISTS',
|
|
69
|
+
when: 'a file there that the preview did not write',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
code: 'ERR_PATH_TRAVERSAL',
|
|
73
|
+
when: '`path` is outside the project, or a file it writes leads outside the route folder through a link',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
code: 'ERR_INVALID_ARGUMENT',
|
|
77
|
+
when: 'a description with `template`, or `top` outside 1 to 3',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
code: 'ERR_DEP_MISSING',
|
|
81
|
+
when: 'every template page asked for imports a package the app lacks; the suggestion is the install command',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
code: 'ERR_UNKNOWN_THEME',
|
|
85
|
+
when: '`theme` names a theme this command did not make',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
code: 'ERR_PROJECT_REQUIRED',
|
|
89
|
+
when: 'no package.json in the folder or above it',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
examples: [
|
|
93
|
+
{
|
|
94
|
+
label: 'Default pages',
|
|
95
|
+
code: 'await themeEditPreviewAdd(...)',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
command: 'experimental theme preview add',
|
|
99
|
+
related: ['themeEditShow', 'themeEditPreviewApp'],
|
|
100
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/** @file FunctionDoc for `themeEditPreviewApp()` / `astryx experimental theme preview app`. */
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file FunctionDoc for `themeEditPreviewApp()` / `astryx experimental theme preview app`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'function',
|
|
8
|
+
kind: 'api',
|
|
9
|
+
name: 'themeEditPreviewApp',
|
|
10
|
+
namespace: 'cli/api',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
displayName: 'themeEditPreviewApp()',
|
|
13
|
+
summary: 'Make a new starter app with the theme preview inside.',
|
|
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; with `overwrite`, a folder that is not empty is used, a protected file there is refused, and its own package.json and .gitignore are kept. Every check runs before the first write, so a refusal changes nothing. Experimental: it may change or be removed in a patch release.",
|
|
16
|
+
importPath: '@astryxdesign/cli/api/experimental',
|
|
17
|
+
signature:
|
|
18
|
+
'themeEditPreviewApp(dir: string, options?: object): Promise<object>',
|
|
19
|
+
keywords: [
|
|
20
|
+
'theme',
|
|
21
|
+
'experimental theme',
|
|
22
|
+
'preview',
|
|
23
|
+
'starter app',
|
|
24
|
+
'next.js',
|
|
25
|
+
],
|
|
26
|
+
params: [
|
|
27
|
+
{
|
|
28
|
+
name: 'dir',
|
|
29
|
+
type: 'string',
|
|
30
|
+
description:
|
|
31
|
+
'The folder for the new app: new or empty, inside the current folder.',
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'options.theme',
|
|
36
|
+
type: 'string',
|
|
37
|
+
description:
|
|
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
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'options.overwrite',
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
description: 'Write into a folder that is not empty.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'options.cwd',
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'The folder the app folder is inside.',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
returns: [
|
|
52
|
+
{
|
|
53
|
+
type: 'themeEdit.previewApp',
|
|
54
|
+
description:
|
|
55
|
+
'The app folder, the theme the pages wear, the pages, the files written, notes, and how to install, run and open it.',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
throws: [
|
|
59
|
+
{
|
|
60
|
+
code: 'ERR_FILE_EXISTS',
|
|
61
|
+
when: '`dir` is not empty (without `overwrite`), or a protected file is in it (with `overwrite`)',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
code: 'ERR_PATH_TRAVERSAL',
|
|
65
|
+
when: '`dir` is outside the current folder, or a file it writes leads outside it through a link',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
code: 'ERR_UNKNOWN_THEME',
|
|
69
|
+
when: '`theme` names a theme this command did not make',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
code: 'ERR_INVALID_ARGUMENT',
|
|
73
|
+
when: 'no `dir`',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
examples: [
|
|
77
|
+
{
|
|
78
|
+
label: 'A new app',
|
|
79
|
+
code: "await themeEditPreviewApp('theme-app')",
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
command: 'experimental theme preview app',
|
|
83
|
+
related: ['themeEditPreviewAdd'],
|
|
84
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/** @file FunctionDoc for `themeEditPreviewList()` / `astryx experimental theme preview list`. */
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|