@astryxdesign/cli 0.7.15-canary.gf890983 → 0.7.15
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 +353 -3
- package/api/doctor/_adapter.d.mts +2 -1
- package/api/doctor/_adapter.mjs +6 -1
- package/api/doctor/doctor.mjs +2 -2
- 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/theme/_adapter.d.mts +37 -5
- package/api/theme/_adapter.mjs +363 -50
- package/api/theme/_fork.d.mts +90 -0
- package/api/theme/_fork.mjs +246 -0
- package/api/theme/build/build.d.mts +25 -1
- package/api/theme/build/build.mjs +352 -41
- 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.mjs +10 -3
- 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 +2 -2
- package/api/theme/themeRemove.doc.mjs +5 -2
- package/api/theme/themeTemplate.doc.mjs +2 -2
- package/api/theme/themeUse.doc.mjs +8 -2
- package/api/theme-edit/_adapter.mjs +157 -36
- package/api/theme-edit/_catalog.d.mts +1 -6
- package/api/theme-edit/_catalog.mjs +5 -268
- package/api/theme-edit/_check.d.mts +3 -1
- package/api/theme-edit/_check.mjs +733 -308
- package/api/theme-edit/_color.d.mts +19 -0
- package/api/theme-edit/_color.mjs +277 -33
- package/api/theme-edit/_compiler.d.mts +1 -0
- package/api/theme-edit/_compiler.mjs +25 -0
- package/api/theme-edit/_context.d.mts +2 -0
- package/api/theme-edit/_context.mjs +83 -9
- package/api/theme-edit/_css.d.mts +84 -0
- package/api/theme-edit/_css.mjs +700 -0
- package/api/theme-edit/_edit.mjs +370 -85
- package/api/theme-edit/_how-commands.d.mts +5 -0
- package/api/theme-edit/_how-commands.mjs +20 -13
- package/api/theme-edit/_how-question.d.mts +29 -0
- package/api/theme-edit/_how-question.mjs +1573 -182
- package/api/theme-edit/_how.mjs +306 -22
- package/api/theme-edit/_overview.mjs +2 -7
- package/api/theme-edit/_palette.d.mts +27 -5
- package/api/theme-edit/_palette.mjs +231 -97
- package/api/theme-edit/_parts.d.mts +42 -10
- package/api/theme-edit/_parts.mjs +224 -69
- package/api/theme-edit/_preview-app.d.mts +8 -0
- package/api/theme-edit/_preview-app.mjs +549 -96
- package/api/theme-edit/_preview.d.mts +7 -16
- package/api/theme-edit/_preview.mjs +77 -84
- package/api/theme-edit/_project.d.mts +20 -1
- package/api/theme-edit/_project.mjs +43 -13
- package/api/theme-edit/_settings.d.mts +96 -20
- package/api/theme-edit/_settings.mjs +646 -141
- package/api/theme-edit/_tables.d.mts +18 -12
- package/api/theme-edit/_tables.mjs +144 -147
- package/api/theme-edit/theme-edit.type.d.mts +10 -1
- package/api/theme-edit/theme-edit.type.mjs +3 -1
- 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/themeEditSet.doc.mjs +1 -1
- package/api/theme-edit/themeEditUndo.doc.mjs +1 -1
- package/assets/docs/tree/publishing.doc.mjs +1 -0
- package/assets/docs.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/experimental/index.mjs +10 -10
- package/clients/cli/commands/experimental/theme.mjs +22 -3
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-new.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/integration.mjs +8 -0
- 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 +325 -48
- package/clients/cli/index.mjs +18 -3
- package/clients/cli/lib/cli-error.mjs +118 -3
- package/clients/cli/manifest.generated.json +1 -1
- 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/template-needs.d.mts +13 -0
- package/foundation/discovery/template-needs.mjs +30 -15
- package/foundation/discovery/theme-discovery.mjs +14 -2
- package/foundation/discovery/theme-imports.d.mts +16 -0
- package/foundation/discovery/theme-imports.mjs +30 -2
- package/foundation/doc-compiler/import.mjs +10 -4
- package/foundation/fs/gather-cache.mjs +82 -23
- package/foundation/fs/jiti-cache.d.mts +21 -0
- package/foundation/fs/jiti-cache.mjs +66 -0
- package/foundation/fs/module-loader.mjs +7 -2
- 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/may-have-integrations.d.mts +8 -0
- package/foundation/integrations/may-have-integrations.mjs +47 -0
- package/foundation/release/cache.d.mts +21 -2
- package/foundation/release/cache.mjs +48 -8
- package/foundation/release/folder-lock.d.mts +7 -0
- package/foundation/release/folder-lock.mjs +60 -26
- 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 +4 -4
- package/package.json +6 -6
- package/api/theme-edit/_css-properties.d.mts +0 -10
- package/api/theme-edit/_css-properties.mjs +0 -556
|
@@ -100,6 +100,12 @@ export function withoutBadValues(data: ThemeData): {
|
|
|
100
100
|
data: ThemeData;
|
|
101
101
|
dropped: Setting[];
|
|
102
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* What is wrong with a setting's value, or null.
|
|
105
|
+
* @param {any} s
|
|
106
|
+
* @returns {string | null}
|
|
107
|
+
*/
|
|
108
|
+
export function valueProblem(s: any): string | null;
|
|
103
109
|
/** One line for a setting. @param {Setting} s */
|
|
104
110
|
export function describe(s: Setting): string;
|
|
105
111
|
/**
|
|
@@ -138,6 +144,25 @@ export function fontOf(value: string): {
|
|
|
138
144
|
* @param {boolean} [spaced]
|
|
139
145
|
*/
|
|
140
146
|
export function cssFamily(name: string, spaced?: boolean): string;
|
|
147
|
+
/**
|
|
148
|
+
* Whether a generated module is as the editor wrote it: true, false for a
|
|
149
|
+
* hand edit, null for a module with no hash (an earlier editor's).
|
|
150
|
+
* @param {string} text
|
|
151
|
+
* @returns {boolean | null}
|
|
152
|
+
*/
|
|
153
|
+
export function moduleUnedited(text: string): boolean | null;
|
|
154
|
+
/**
|
|
155
|
+
* The palette stops each token reads in a generated settings module, as
|
|
156
|
+
* written there (`palette.accent.light[85]`, with ` + 'aa'` for a
|
|
157
|
+
* see-through one): `[light, dark]` per token.
|
|
158
|
+
* @param {string} source
|
|
159
|
+
* @returns {Record<string, Record<'light' | 'dark', {family: string, stop: number, alpha?: string}>>}
|
|
160
|
+
*/
|
|
161
|
+
export function stopsIn(source: string): Record<string, Record<"light" | "dark", {
|
|
162
|
+
family: string;
|
|
163
|
+
stop: number;
|
|
164
|
+
alpha?: string;
|
|
165
|
+
}>>;
|
|
141
166
|
/**
|
|
142
167
|
* The settings, as a `defineTheme` object.
|
|
143
168
|
* @param {Ctx} ctx
|
|
@@ -222,6 +247,12 @@ export function contrastProblems(ctx: Ctx, data: ThemeData, res: {
|
|
|
222
247
|
light: Record<string, string>;
|
|
223
248
|
dark: Record<string, string>;
|
|
224
249
|
}): Promise<string[]>;
|
|
250
|
+
/**
|
|
251
|
+
* Whether parsed settings have the shape the editor reads: an object with a
|
|
252
|
+
* list of settings.
|
|
253
|
+
* @param {any} data
|
|
254
|
+
*/
|
|
255
|
+
export function settingsShapeOk(data: any): boolean;
|
|
225
256
|
/**
|
|
226
257
|
* The value the base theme itself gives a part's property where a setting
|
|
227
258
|
* applies (its variant and state), as the build keys part styles; null
|
|
@@ -240,6 +271,47 @@ export function baseComponent(base: {
|
|
|
240
271
|
when?: string;
|
|
241
272
|
state?: string;
|
|
242
273
|
}): string | null;
|
|
274
|
+
/**
|
|
275
|
+
* The focus state a part's own styles key on: a part whose styled element
|
|
276
|
+
* is a wrapper (a text input's box) shows focus only through
|
|
277
|
+
* `focus-within`; null when it keys on none.
|
|
278
|
+
* @param {Ctx} ctx
|
|
279
|
+
* @param {string} part
|
|
280
|
+
* @returns {string | null}
|
|
281
|
+
*/
|
|
282
|
+
export function focusStateOf(ctx: Ctx, part: string): string | null;
|
|
283
|
+
/**
|
|
284
|
+
* The radius token a part's resting corners read. A part the census saw
|
|
285
|
+
* closed (a menu, a popover) has none recorded: a container or menu reads
|
|
286
|
+
* the container radius, like every Core surface; any other part reads the
|
|
287
|
+
* element radius.
|
|
288
|
+
* @param {Ctx} ctx
|
|
289
|
+
* @param {string} part
|
|
290
|
+
* @param {string} [when]
|
|
291
|
+
* @returns {string}
|
|
292
|
+
*/
|
|
293
|
+
export function radiusTokenOf(ctx: Ctx, part: string, when?: string): string;
|
|
294
|
+
/**
|
|
295
|
+
* Remove a `new` marker from a theme folder whose settings are whole: the
|
|
296
|
+
* `new` that left it made the theme, and nothing is left to finish.
|
|
297
|
+
* @param {string} dir
|
|
298
|
+
*/
|
|
299
|
+
export function clearNewMarker(dir: string): void;
|
|
300
|
+
/**
|
|
301
|
+
* The pseudo key a state writes in a part's styles. Core marks a disabled
|
|
302
|
+
* button, link, tab or menu item with aria-disabled (it stays focusable),
|
|
303
|
+
* and its own styles match both forms: so does the theme.
|
|
304
|
+
* @param {string} state
|
|
305
|
+
* @returns {string}
|
|
306
|
+
*/
|
|
307
|
+
export function stateKey(state: string): string;
|
|
308
|
+
/**
|
|
309
|
+
* The whole-theme radius tokens a generated settings module writes, or null
|
|
310
|
+
* when it writes none.
|
|
311
|
+
* @param {string} source
|
|
312
|
+
* @returns {Record<string, string> | null}
|
|
313
|
+
*/
|
|
314
|
+
export function radiiIn(source: string): Record<string, string> | null;
|
|
243
315
|
/**
|
|
244
316
|
* The radius, in px, the build writes for a radius token at a corners value
|
|
245
317
|
* (a rung, or a size). The derived radii keep the base theme's own
|
|
@@ -256,6 +328,12 @@ export function baseComponent(base: {
|
|
|
256
328
|
export function radiusAt(base: {
|
|
257
329
|
light: Record<string, string>;
|
|
258
330
|
}, value: string, token: string): number;
|
|
331
|
+
/**
|
|
332
|
+
* Whether a file is a module the editor generated (its first line is the
|
|
333
|
+
* editor's header).
|
|
334
|
+
* @param {string} file
|
|
335
|
+
*/
|
|
336
|
+
export function madeByEditor(file: string): boolean;
|
|
259
337
|
/**
|
|
260
338
|
* Refuse a link anywhere the editor reads or writes a theme: `themes/`, the
|
|
261
339
|
* theme folder, and every file and folder in it. The editor writes the
|
|
@@ -270,15 +348,6 @@ export function refuseLinks(cwd: string, slug: string): void;
|
|
|
270
348
|
* @param {ThemeData} data
|
|
271
349
|
*/
|
|
272
350
|
export function settingsStamp(data: ThemeData): string;
|
|
273
|
-
/**
|
|
274
|
-
* Whether the theme's build was made, whole, from these settings by this
|
|
275
|
-
* CLI (a command stopped mid-build, or settings edited by hand, leave it
|
|
276
|
-
* behind).
|
|
277
|
-
* @param {string} cwd
|
|
278
|
-
* @param {string} slug
|
|
279
|
-
* @param {ThemeData} data
|
|
280
|
-
*/
|
|
281
|
-
export function buildCurrent(cwd: string, slug: string, data: ThemeData): boolean;
|
|
282
351
|
/**
|
|
283
352
|
* Why the theme's build does not match its settings, in words, or null when
|
|
284
353
|
* it does: a file missing, another CLI version, settings changed since the
|
|
@@ -289,12 +358,6 @@ export function buildCurrent(cwd: string, slug: string, data: ThemeData): boolea
|
|
|
289
358
|
* @returns {string | null}
|
|
290
359
|
*/
|
|
291
360
|
export function staleBuild(cwd: string, slug: string, data: ThemeData): string | null;
|
|
292
|
-
/**
|
|
293
|
-
* Write a file whole: a new file beside it, renamed into place.
|
|
294
|
-
* @param {string} file
|
|
295
|
-
* @param {string} text
|
|
296
|
-
*/
|
|
297
|
-
export function writeAtomic(file: string, text: string): void;
|
|
298
361
|
/**
|
|
299
362
|
* A theme's undo history: the settings text before each change, oldest
|
|
300
363
|
* first, and how many damaged steps were dropped. Every step after the
|
|
@@ -313,12 +376,14 @@ export function readHistory(file: string): {
|
|
|
313
376
|
* @param {Ctx} ctx
|
|
314
377
|
* @param {string} slug
|
|
315
378
|
* @param {ThemeData} data
|
|
316
|
-
* @param {{history: boolean, historyAfter?: string[]}} options
|
|
317
|
-
* `historyAfter`: the history to write with the change (a step back pops it)
|
|
379
|
+
* @param {{history: boolean, historyAfter?: string[], radii?: Record<string, string> | null}} options
|
|
380
|
+
* `historyAfter`: the history to write with the change (a step back pops it);
|
|
381
|
+
* `radii`: the whole-theme radii the step being restored was built with
|
|
318
382
|
*/
|
|
319
|
-
export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history, historyAfter }: {
|
|
383
|
+
export function commitTheme(ctx: Ctx, slug: string, data: ThemeData, { history, historyAfter, radii }: {
|
|
320
384
|
history: boolean;
|
|
321
385
|
historyAfter?: string[];
|
|
386
|
+
radii?: Record<string, string> | null;
|
|
322
387
|
}): Promise<{
|
|
323
388
|
changed: string[];
|
|
324
389
|
res: Record<"light" | "dark", Record<string, string>>;
|
|
@@ -333,13 +398,16 @@ export function fontPackages(ctx: Ctx, data: ThemeData): {
|
|
|
333
398
|
pkg: string;
|
|
334
399
|
family: string;
|
|
335
400
|
installed: boolean;
|
|
401
|
+
of: Setting;
|
|
336
402
|
}[];
|
|
337
|
-
/** @typedef {{project: import('./_project.mjs').ThemeProject, C: import('./_compiler.mjs').Compiler, unchecked?: string | null, uncheckedCode?: string | null, wrote?: Map<string, string | null>, base?: {light: Record<string, string>, dark: Record<string, string>, components?: Record<string, any>}}} Ctx */
|
|
403
|
+
/** @typedef {{project: import('./_project.mjs').ThemeProject, C: import('./_compiler.mjs').Compiler, unchecked?: string | null, uncheckedCode?: string | null, wrote?: Map<string, string | null>, base?: {light: Record<string, string>, dark: Record<string, string>, components?: Record<string, any>}, keepStops?: Record<string, Record<'light' | 'dark', {family: string, stop: number, alpha?: string}>> | null, keepRadii?: Record<string, string> | null}} Ctx */
|
|
338
404
|
/** @typedef {import('./_parts.mjs').PaintSide} PaintSide */
|
|
339
405
|
/** @typedef {import('./_parts.mjs').TextPair} TextPair */
|
|
340
406
|
/** What a theme name may be, in words. */
|
|
341
|
-
export const NAME_RULE: "lowercase letters, digits and dashes, starting with a letter, 64 characters at most";
|
|
407
|
+
export const NAME_RULE: "lowercase letters, digits and dashes, starting with a letter, 64 characters at most, and not a name Windows reserves (con, prn, aux, nul, com1-com9, lpt1-lpt9)";
|
|
342
408
|
export function slugOk(s: string): boolean;
|
|
409
|
+
export function windowsReserved(s: string): boolean;
|
|
410
|
+
export function slugFor(name: unknown): string;
|
|
343
411
|
export function kebab(s: string): string;
|
|
344
412
|
export function camel(s: string): string;
|
|
345
413
|
export function shown(cwd: string, f: string): string;
|
|
@@ -347,6 +415,8 @@ export function keyOf(s: Setting): string;
|
|
|
347
415
|
export function cornerPx(v: string): number;
|
|
348
416
|
export function textPx(v: string): number;
|
|
349
417
|
export function themeSource(slug: string): string;
|
|
418
|
+
/** The file a `new` keeps beside the files it writes until it is done. */
|
|
419
|
+
export const NEW_MARKER: ".astryx-new.json";
|
|
350
420
|
/**
|
|
351
421
|
* The files the editor writes for a theme, after `<slug>.`: the only ones a
|
|
352
422
|
* change reads, hashes or puts back, and the only ones a stopped `new`
|
|
@@ -413,6 +483,12 @@ export type Ctx = {
|
|
|
413
483
|
dark: Record<string, string>;
|
|
414
484
|
components?: Record<string, any>;
|
|
415
485
|
};
|
|
486
|
+
keepStops?: Record<string, Record<"light" | "dark", {
|
|
487
|
+
family: string;
|
|
488
|
+
stop: number;
|
|
489
|
+
alpha?: string;
|
|
490
|
+
}>> | null;
|
|
491
|
+
keepRadii?: Record<string, string> | null;
|
|
416
492
|
};
|
|
417
493
|
export type PaintSide = import("./_parts.mjs").PaintSide;
|
|
418
494
|
export type TextPair = import("./_parts.mjs").TextPair;
|