@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
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @typedef {object} HowTheme
|
|
18
18
|
* @property {string} slug
|
|
19
19
|
* @property {boolean} exists - false when the app has no theme: the commands name {@link EXAMPLE_THEME} and the answer starts with `new`.
|
|
20
|
+
* @property {string | null} previewDamage - why the in-app preview's record is damaged and how to fix it, or null.
|
|
20
21
|
* @property {string[]} themes - Every theme the editor made in the app.
|
|
21
22
|
* @property {string | null} note - Which theme the commands are for when the app has several, or that it has none.
|
|
22
23
|
* @property {'named' | 'only' | 'last-changed' | 'none'} chosenBy - How the theme was picked.
|
|
@@ -83,6 +84,10 @@ export type HowTheme = {
|
|
|
83
84
|
* - false when the app has no theme: the commands name {@link EXAMPLE_THEME} and the answer starts with `new`.
|
|
84
85
|
*/
|
|
85
86
|
exists: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* - why the in-app preview's record is damaged and how to fix it, or null.
|
|
89
|
+
*/
|
|
90
|
+
previewDamage: string | null;
|
|
86
91
|
/**
|
|
87
92
|
* - Every theme the editor made in the app.
|
|
88
93
|
*/
|
|
@@ -43,6 +43,7 @@ export const EXAMPLE_THEME = 'my-theme';
|
|
|
43
43
|
* @typedef {object} HowTheme
|
|
44
44
|
* @property {string} slug
|
|
45
45
|
* @property {boolean} exists - false when the app has no theme: the commands name {@link EXAMPLE_THEME} and the answer starts with `new`.
|
|
46
|
+
* @property {string | null} previewDamage - why the in-app preview's record is damaged and how to fix it, or null.
|
|
46
47
|
* @property {string[]} themes - Every theme the editor made in the app.
|
|
47
48
|
* @property {string | null} note - Which theme the commands are for when the app has several, or that it has none.
|
|
48
49
|
* @property {'named' | 'only' | 'last-changed' | 'none'} chosenBy - How the theme was picked.
|
|
@@ -119,26 +120,32 @@ export async function howTheme(ctx, cwd, name) {
|
|
|
119
120
|
x => x.thing !== 'font' || x.on === 'heading',
|
|
120
121
|
),
|
|
121
122
|
};
|
|
123
|
+
const withBody = compileTheme(
|
|
124
|
+
ctx,
|
|
125
|
+
{
|
|
126
|
+
...fontless,
|
|
127
|
+
settings: [
|
|
128
|
+
...fontless.settings,
|
|
129
|
+
{thing: 'font', value: 'courier', on: 'body', source: 'dial'},
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
base,
|
|
133
|
+
).typography;
|
|
134
|
+
// The editor writes the base theme's heading font beside a body font of
|
|
135
|
+
// its own; only a build that writes none leaves headings to Core.
|
|
122
136
|
const bodyFontReachesHeadings =
|
|
137
|
+
!withBody?.heading &&
|
|
123
138
|
headingOf(compileTheme(ctx, fontless, base).typography) !==
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
...fontless,
|
|
129
|
-
settings: [
|
|
130
|
-
...fontless.settings,
|
|
131
|
-
{thing: 'font', value: 'courier', on: 'body', source: 'dial'},
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
base,
|
|
135
|
-
).typography,
|
|
136
|
-
);
|
|
139
|
+
headingOf(withBody);
|
|
140
|
+
// A damaged preview record refuses every preview command, so an answer
|
|
141
|
+
// names its fix instead of a preview command.
|
|
142
|
+
const {previewRecordProblem} = await import('./_preview-app.mjs');
|
|
137
143
|
return {
|
|
138
144
|
slug,
|
|
139
145
|
exists,
|
|
140
146
|
themes,
|
|
141
147
|
note,
|
|
148
|
+
previewDamage: previewRecordProblem(cwd),
|
|
142
149
|
chosenBy: name
|
|
143
150
|
? 'named'
|
|
144
151
|
: !themes.length
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A CSS property the clause names, with its value kept whole ("caret-color
|
|
6
|
+
* #2563eb", "transition: background-color 150ms ease", "border-radius 12px
|
|
7
|
+
* 12px 0 0"). The value runs to the end of the clause or the part it is
|
|
8
|
+
* for, and is the longest start of it the property's grammar accepts.
|
|
9
|
+
* Plain words that are also properties ("color", "padding") count only
|
|
10
|
+
* with a colon; the aspect words read those.
|
|
11
|
+
* @param {string} text
|
|
12
|
+
* @returns {{prop: string, value: string, bad?: string} | null}
|
|
13
|
+
*/
|
|
14
|
+
export function namedProperty(text: string): {
|
|
15
|
+
prop: string;
|
|
16
|
+
value: string;
|
|
17
|
+
bad?: string;
|
|
18
|
+
} | null;
|
|
4
19
|
/**
|
|
5
20
|
* Answer a plain-words question with drafts of commands.
|
|
6
21
|
* @param {import('./_settings.mjs').Ctx} ctx
|
|
@@ -47,6 +62,14 @@ export type Clause = {
|
|
|
47
62
|
* - family names the clause writes in quotes
|
|
48
63
|
*/
|
|
49
64
|
quoted?: string[] | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* - a CSS property the clause names, with its value as typed
|
|
67
|
+
*/
|
|
68
|
+
named: {
|
|
69
|
+
prop: string;
|
|
70
|
+
value: string;
|
|
71
|
+
bad?: string;
|
|
72
|
+
} | null;
|
|
50
73
|
};
|
|
51
74
|
export type Step = import("./_how-commands.mjs").Step;
|
|
52
75
|
/**
|
|
@@ -59,3 +82,9 @@ export type Draft = {
|
|
|
59
82
|
sequence?: boolean;
|
|
60
83
|
lookup?: string;
|
|
61
84
|
};
|
|
85
|
+
export type PartRef = {
|
|
86
|
+
on: string;
|
|
87
|
+
when?: string;
|
|
88
|
+
role?: string;
|
|
89
|
+
level?: string;
|
|
90
|
+
};
|