@astryxdesign/cli 0.7.14 → 0.7.15-canary.g06b7e61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/README.md +63 -63
- package/api/build/_adapter.d.mts +4 -0
- package/api/build/_adapter.mjs +28 -2
- package/api/build/blocks/blocks.d.mts +10 -1
- package/api/build/blocks/blocks.mjs +84 -7
- package/api/build/build.mjs +6 -1
- package/api/build/tree.d.mts +4 -0
- package/api/build/tree.mjs +9 -2
- package/api/doctor/_adapter.d.mts +3 -1
- package/api/doctor/_adapter.mjs +14 -1
- package/api/doctor/_authoring-audit.d.mts +42 -0
- package/api/doctor/_authoring-audit.mjs +106 -0
- package/api/doctor/doctor.d.mts +7 -0
- package/api/doctor/doctor.mjs +24 -39
- package/api/doctor/theme-checks.mjs +56 -21
- package/api/integration/add-helpers.mjs +5 -0
- package/api/integration/add-theme.mjs +15 -110
- package/api/integration/validate-integration.mjs +17 -3
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/search/_adapter.mjs +124 -3
- package/api/search/_candidate-score.mjs +63 -9
- package/api/search/_entries.d.mts +10 -0
- package/api/search/_entries.mjs +68 -1
- package/api/search/_gather-templates.d.mts +11 -0
- package/api/search/_gather-templates.mjs +22 -2
- package/api/search/_words.mjs +26 -6
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/theme/_adapter.d.mts +37 -5
- package/api/theme/_adapter.mjs +381 -57
- package/api/theme/_fork.d.mts +90 -0
- package/api/theme/_fork.mjs +246 -0
- package/api/theme/build/build.d.mts +40 -2
- package/api/theme/build/build.mjs +477 -66
- package/api/theme/eject/eject.mjs +36 -15
- package/api/theme/list/list.mjs +3 -6
- package/api/theme/palette/generate/generator.d.mts +13 -0
- package/api/theme/palette/generate/generator.mjs +32 -2
- package/api/theme/targets/targets.d.mts +8 -0
- package/api/theme/targets/targets.mjs +24 -4
- package/api/theme/template/template.mjs +48 -2
- package/api/theme/theme.type.d.mts +8 -0
- package/api/theme/theme.type.mjs +5 -1
- package/api/theme/themeBuild.doc.mjs +7 -4
- package/api/theme/themeEject.doc.mjs +3 -3
- package/api/theme/themeRemove.doc.mjs +5 -2
- package/api/theme/themeTargets.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +2 -2
- package/api/theme/themeUse.doc.mjs +8 -2
- package/api/theme-edit/_adapter.d.mts +46 -3
- package/api/theme-edit/_adapter.mjs +496 -112
- package/api/theme-edit/_catalog.d.mts +1 -6
- package/api/theme-edit/_catalog.mjs +5 -268
- package/api/theme-edit/_check.d.mts +9 -4
- package/api/theme-edit/_check.mjs +1232 -229
- package/api/theme-edit/_color.d.mts +19 -0
- package/api/theme-edit/_color.mjs +280 -34
- package/api/theme-edit/_compiler.d.mts +3 -1
- package/api/theme-edit/_compiler.mjs +52 -13
- package/api/theme-edit/_context.d.mts +4 -1
- package/api/theme-edit/_context.mjs +126 -13
- package/api/theme-edit/_css.d.mts +84 -0
- package/api/theme-edit/_css.mjs +700 -0
- package/api/theme-edit/_edit.d.mts +9 -3
- package/api/theme-edit/_edit.mjs +806 -103
- package/api/theme-edit/_how-commands.d.mts +38 -7
- package/api/theme-edit/_how-commands.mjs +64 -45
- package/api/theme-edit/_how-question.d.mts +33 -0
- package/api/theme-edit/_how-question.mjs +2553 -381
- package/api/theme-edit/_how.mjs +402 -31
- package/api/theme-edit/_overview.mjs +2 -7
- package/api/theme-edit/_palette.d.mts +60 -13
- package/api/theme-edit/_palette.mjs +826 -295
- package/api/theme-edit/_parts.d.mts +42 -10
- package/api/theme-edit/_parts.mjs +280 -69
- package/api/theme-edit/_png.d.mts +4 -4
- package/api/theme-edit/_png.mjs +4 -2
- package/api/theme-edit/_preview-app.d.mts +14 -0
- package/api/theme-edit/_preview-app.mjs +1675 -235
- package/api/theme-edit/_preview.d.mts +7 -16
- package/api/theme-edit/_preview.mjs +79 -86
- package/api/theme-edit/_project.d.mts +32 -2
- package/api/theme-edit/_project.mjs +80 -19
- package/api/theme-edit/_settings.d.mts +199 -52
- package/api/theme-edit/_settings.mjs +1422 -217
- package/api/theme-edit/_tables.d.mts +19 -6
- package/api/theme-edit/_tables.mjs +150 -92
- package/api/theme-edit/theme-edit.type.d.mts +20 -1
- package/api/theme-edit/theme-edit.type.mjs +6 -3
- package/api/theme-edit/themeEditHow.doc.mjs +6 -0
- package/api/theme-edit/themeEditNew.doc.mjs +1 -1
- package/api/theme-edit/themeEditPreviewAdd.doc.mjs +1 -1
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
- package/api/theme-edit/themeEditPreviewList.doc.mjs +2 -2
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +5 -1
- package/api/theme-edit/themeEditSet.doc.mjs +1 -1
- package/api/theme-edit/themeEditUndo.doc.mjs +1 -1
- package/api/upgrade/_adapter.d.mts +1 -0
- package/assets/codemods/run-codemod.mjs +61 -0
- package/assets/codemods/runner.mjs +5 -4
- package/assets/codemods/transforms/v0.0.14/rename-status-variants.mjs +3 -0
- package/assets/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +5 -1
- package/assets/codemods/transforms/v0.6.4/migrate-native-picker-to-presentation.mjs +3 -0
- package/assets/codemods/transforms/v0.7.0/migrate-deprecated-theme-surface.mjs +4 -0
- package/assets/codemods/transforms/v0.7.0/rename-empty-search-results-text.mjs +17 -12
- package/assets/codemods/transforms/v0.7.2/migrate-list-edge-compensation-to-edge.mjs +3 -0
- package/assets/codemods/transforms/v0.7.5/migrate-codeblock-tokenizer-to-language.mjs +3 -0
- package/assets/codemods/transforms/v0.7.8/promote-tokenizer-presentation.mjs +3 -0
- package/assets/docs/tree/calendars.doc.mjs +1 -3
- package/assets/docs/tree/checks.doc.mjs +22 -1
- package/assets/docs/tree/publishing.doc.mjs +1 -0
- package/assets/docs/tree/tokens-and-setup.doc.mjs +39 -3
- package/assets/docs.generated.json +2 -1
- package/assets/preview-app/next.config.mjs +7 -1
- package/assets/self-audit.generated.json +1 -0
- package/assets/templates/blocks/components/Theme/useThemeNameHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Theme/useThemeNameHookUsage.tsx +31 -0
- package/assets/templates/components.generated.json +1 -1
- package/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +8 -0
- package/authoring/integration/schema.mjs +1 -0
- package/authoring/integration/type.ts +9 -0
- package/clients/cli/bin/astryx.mjs +19 -15
- package/clients/cli/build-id.generated.json +1 -0
- package/clients/cli/commands/ensure-core-built.mjs +12 -5
- package/clients/cli/commands/experimental/index.mjs +10 -10
- package/clients/cli/commands/experimental/theme.mjs +200 -81
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -2
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-template.doc.mjs +4 -3
- package/clients/cli/commands/integration.mjs +8 -0
- package/clients/cli/commands/manifest.mjs +5 -2
- package/clients/cli/commands/theme-build.doc.mjs +2 -2
- package/clients/cli/commands/theme-list.doc.mjs +1 -1
- package/clients/cli/commands/theme-template.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +439 -66
- package/clients/cli/index.mjs +27 -6
- package/clients/cli/lib/cli-error.mjs +118 -3
- package/clients/cli/lib/manifest.mjs +37 -0
- package/clients/cli/lib/resolve-theme.mjs +2 -1
- package/clients/cli/manifest.generated.json +1 -0
- package/foundation/config/project.mjs +34 -8
- package/foundation/config/theme-state.d.mts +16 -0
- package/foundation/config/theme-state.mjs +84 -13
- package/foundation/discovery/module-exports.mjs +16 -2
- package/foundation/discovery/stored-self-audit.d.mts +31 -0
- package/foundation/discovery/stored-self-audit.mjs +119 -0
- package/foundation/discovery/template-adapter.d.mts +48 -2
- package/foundation/discovery/template-adapter.mjs +51 -19
- package/foundation/discovery/template-needs.d.mts +19 -0
- package/foundation/discovery/template-needs.mjs +50 -16
- package/foundation/discovery/template-source-tree.d.mts +7 -0
- package/foundation/discovery/template-source-tree.mjs +15 -0
- package/foundation/discovery/theme-discovery.d.mts +2 -1
- package/foundation/discovery/theme-discovery.mjs +16 -10
- package/foundation/discovery/theme-imports.d.mts +16 -0
- package/foundation/discovery/theme-imports.mjs +30 -2
- package/foundation/discovery/theme-module-extensions.d.mts +18 -0
- package/foundation/discovery/theme-module-extensions.mjs +30 -0
- package/foundation/doc-compiler/import.mjs +22 -15
- package/foundation/doc-compiler/stored-docs.d.mts +18 -12
- package/foundation/doc-compiler/stored-docs.mjs +52 -19
- package/foundation/env/private-dir.d.mts +17 -0
- package/foundation/env/private-dir.mjs +42 -0
- package/foundation/fs/gather-cache.d.mts +108 -0
- package/foundation/fs/gather-cache.mjs +783 -0
- package/foundation/fs/jiti-cache.d.mts +21 -0
- package/foundation/fs/jiti-cache.mjs +66 -0
- package/foundation/fs/module-loader.mjs +14 -3
- package/foundation/fs/read-record.d.mts +31 -1
- package/foundation/fs/read-record.mjs +100 -7
- package/foundation/integrations/autolink.d.mts +1 -24
- package/foundation/integrations/autolink.mjs +7 -60
- package/foundation/integrations/declared-dependencies.d.mts +27 -0
- package/foundation/integrations/declared-dependencies.mjs +73 -0
- package/foundation/integrations/integrations.d.mts +8 -0
- package/foundation/integrations/integrations.mjs +4 -0
- package/foundation/integrations/may-have-integrations.d.mts +8 -0
- package/foundation/integrations/may-have-integrations.mjs +47 -0
- package/foundation/integrations/validate-contributions.d.mts +62 -1
- package/foundation/integrations/validate-contributions.mjs +476 -40
- package/foundation/release/cache.d.mts +32 -4
- package/foundation/release/cache.mjs +105 -16
- package/foundation/release/folder-lock.d.mts +28 -0
- package/foundation/release/folder-lock.mjs +205 -0
- package/foundation/release/lock-lease.d.mts +2 -1
- package/foundation/release/lock-lease.mjs +7 -2
- package/foundation/response/error-codes.doc.mjs +1 -1
- package/foundation/response/response-types.doc.mjs +5 -5
- package/package.json +8 -6
- package/api/theme-edit/_css-properties.d.mts +0 -10
- package/api/theme-edit/_css-properties.mjs +0 -556
|
@@ -9,6 +9,23 @@
|
|
|
9
9
|
* @param {string | Buffer} text
|
|
10
10
|
*/
|
|
11
11
|
export function writeWhole(file: string, text: string | Buffer): void;
|
|
12
|
+
/**
|
|
13
|
+
* A command stopped long enough for another to take its lock (Ctrl-Z, a
|
|
14
|
+
* sleeping computer, a debugger) writes nothing more: refuse. Called right
|
|
15
|
+
* before each write.
|
|
16
|
+
*/
|
|
17
|
+
export function refuseIfLockLost(): void;
|
|
18
|
+
/** Whether this command still holds its lock (true outside a lock). */
|
|
19
|
+
export function lockHeld(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Remove `dir` when it is empty; with `deep`, the empty folders under it
|
|
22
|
+
* first. A folder with a file in it stays.
|
|
23
|
+
* @param {string} dir
|
|
24
|
+
* @param {{deep?: boolean}} [opts]
|
|
25
|
+
*/
|
|
26
|
+
export function removeEmptyFolder(dir: string, opts?: {
|
|
27
|
+
deep?: boolean;
|
|
28
|
+
}): void;
|
|
12
29
|
/**
|
|
13
30
|
* A temp file beside `file` for a whole write, named so only the editor
|
|
14
31
|
* makes such names: `.<name>.astryx-<pid>-<random>.tmp`. The write that
|
|
@@ -32,16 +49,13 @@ export function paletteFiles(slug: string): {
|
|
|
32
49
|
*/
|
|
33
50
|
export function seedOf(value: string): string | null;
|
|
34
51
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* selected palette stops, read from the installed package. Without the
|
|
39
|
-
* package, the same official stops of a plain gray ramp from the
|
|
40
|
-
* generator. Null when neither can be read.
|
|
41
|
-
* @param {Mode} m
|
|
42
|
-
* @returns {number | null}
|
|
52
|
+
* The modes a theme has: one for a one-mode theme, else light and dark.
|
|
53
|
+
* @param {{mode?: string}} data
|
|
54
|
+
* @returns {Mode[]}
|
|
43
55
|
*/
|
|
44
|
-
export function
|
|
56
|
+
export function modesOf(data: {
|
|
57
|
+
mode?: string;
|
|
58
|
+
}): Mode[];
|
|
45
59
|
/**
|
|
46
60
|
* The palette config a theme's settings ask for (see {@link planPalette}),
|
|
47
61
|
* or null when it would hold no family.
|
|
@@ -83,10 +97,13 @@ export function syncPalette(cwd: string, slug: string, data: {
|
|
|
83
97
|
dark: Record<string, string>;
|
|
84
98
|
}): string[];
|
|
85
99
|
/**
|
|
86
|
-
* Whether a theme's palette file was edited by hand
|
|
87
|
-
* receipt,
|
|
88
|
-
*
|
|
89
|
-
*
|
|
100
|
+
* Whether a theme's palette file was edited by hand. Its bytes match its
|
|
101
|
+
* receipt, or its colors (read as data, so formatting, a BOM or semicolons
|
|
102
|
+
* never count) are the ones the generator gives for the request it came
|
|
103
|
+
* from: the receipt's, else the config the editor wrote. Without a receipt
|
|
104
|
+
* and with a config edited by hand since, the request is unknown; then the
|
|
105
|
+
* file counts as the editor's when it holds every shade the theme ships
|
|
106
|
+
* (the selected-stops file) unchanged. False when there is no palette file.
|
|
90
107
|
* @param {string} cwd
|
|
91
108
|
* @param {string} slug
|
|
92
109
|
*/
|
|
@@ -133,6 +150,13 @@ export function paletteMapping(cwd: string, slug: string, data: import("./_setti
|
|
|
133
150
|
light: Record<string, string>;
|
|
134
151
|
dark: Record<string, string>;
|
|
135
152
|
}, tokenDefaults: Record<string, unknown>): PaletteMapping | null;
|
|
153
|
+
/**
|
|
154
|
+
* The color dial whose generated colors a token belongs to, or null: an
|
|
155
|
+
* exact setting of it changes what that dial's mapping picks around it.
|
|
156
|
+
* @param {string} token
|
|
157
|
+
* @returns {string | null}
|
|
158
|
+
*/
|
|
159
|
+
export function paletteDialOf(token: string): string | null;
|
|
136
160
|
/**
|
|
137
161
|
* Where each token starts, for `how`: `token: light stop L, dark stop D`.
|
|
138
162
|
* @param {string} dial
|
|
@@ -175,6 +199,7 @@ export function paletteNotes(pal: PaletteMapping | null, dial: string, slug: str
|
|
|
175
199
|
* @property {number} needs
|
|
176
200
|
* @property {boolean} pass
|
|
177
201
|
* @property {string} [note] - The whole sentence to report, when the check is not a plain stop move.
|
|
202
|
+
* @property {string[]} [dials] - The color dials whose notes report it, when its token belongs to none of them.
|
|
178
203
|
*/
|
|
179
204
|
/**
|
|
180
205
|
* The palette mapping of a theme.
|
|
@@ -186,14 +211,28 @@ export function paletteNotes(pal: PaletteMapping | null, dial: string, slug: str
|
|
|
186
211
|
* @property {number} vibrancy - The generator's vibrancy, 0 to 100.
|
|
187
212
|
* @property {Record<string, Partial<Record<Mode, string>>>} exact - Main tokens the theme sets exactly, the value per mode: the dial's fill gives way to them.
|
|
188
213
|
* @property {string[]} notes - What the config writer kept or replaced of a hand edit.
|
|
214
|
+
* @property {Record<string, Partial<Record<Mode, StopRef>>> | null} lift - Lifted secondary text per background token of LIFT_PARTS (the accent tint, the neutral track), per mode, from the neutral color; null without one.
|
|
189
215
|
*/
|
|
190
216
|
/** The color dials. Each one is a palette family of the same id. */
|
|
191
217
|
export const PALETTE_DIALS: string[];
|
|
192
218
|
/** The generator's vibrancy when the theme sets none. */
|
|
193
219
|
export const VIBRANCY_DEFAULT: 50;
|
|
194
220
|
export function paletteToken(dial: string): string;
|
|
221
|
+
/**
|
|
222
|
+
* The parts whose secondary text the official neutral theme lifts, with
|
|
223
|
+
* the block it lifts it in and what the text sits on: the accent tint,
|
|
224
|
+
* except under segmented-control labels, which sit on the translucent
|
|
225
|
+
* neutral track (`--color-neutral`).
|
|
226
|
+
*/
|
|
227
|
+
export const LIFT_PARTS: [string, string, string][];
|
|
195
228
|
export function paletteImport(slug: string): string;
|
|
196
229
|
export function isGraySeed(seed: string | null): boolean;
|
|
230
|
+
/**
|
|
231
|
+
* The first line of the empty palette module the preview writes for a
|
|
232
|
+
* Colors page it keeps (changed by hand) once the theme has no colors, so
|
|
233
|
+
* the app still builds. The editor replaces it freely.
|
|
234
|
+
*/
|
|
235
|
+
export const PALETTE_STAND_IN: "// A stand-in for a preview page that imports this file: the theme has no generated colors.";
|
|
197
236
|
/** Every token a color dial can point at a generated shade. */
|
|
198
237
|
export const PALETTE_TOKENS: Set<string>;
|
|
199
238
|
/**
|
|
@@ -261,6 +300,10 @@ export type ContrastCheck = {
|
|
|
261
300
|
* - The whole sentence to report, when the check is not a plain stop move.
|
|
262
301
|
*/
|
|
263
302
|
note?: string | undefined;
|
|
303
|
+
/**
|
|
304
|
+
* - The color dials whose notes report it, when its token belongs to none of them.
|
|
305
|
+
*/
|
|
306
|
+
dials?: string[] | undefined;
|
|
264
307
|
};
|
|
265
308
|
/**
|
|
266
309
|
* The palette mapping of a theme.
|
|
@@ -291,4 +334,8 @@ export type PaletteMapping = {
|
|
|
291
334
|
* - What the config writer kept or replaced of a hand edit.
|
|
292
335
|
*/
|
|
293
336
|
notes: string[];
|
|
337
|
+
/**
|
|
338
|
+
* - Lifted secondary text per background token of LIFT_PARTS (the accent tint, the neutral track), per mode, from the neutral color; null without one.
|
|
339
|
+
*/
|
|
340
|
+
lift: Record<string, Partial<Record<Mode, StopRef>>> | null;
|
|
294
341
|
};
|