@astryxdesign/cli 0.7.3 → 0.7.4-canary.3f6ea7d
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 +5 -5
- package/api/discover/_adapter.mjs +22 -10
- package/api/discover/_catalog-view.d.mts +2 -0
- package/api/discover/_catalog-view.mjs +1 -0
- package/api/discover/_catalog-view.test.mjs +1 -0
- package/api/discover/detail/detail.mjs +1 -0
- package/api/discover/detail/detail.test.mjs +3 -0
- package/api/discover/detail/doc/doc.mjs +5 -1
- package/api/discover/detail/doc/doc.test.mjs +1 -0
- package/api/discover/detail/item/item.mjs +2 -0
- package/api/discover/detail/item/item.test.mjs +2 -0
- package/api/discover/discover.doc.mjs +4 -4
- package/api/discover/discover.type.d.mts +20 -0
- package/api/discover/discover.type.mjs +5 -0
- package/api/discover/list/list.test.mjs +2 -0
- package/api/discover/search/search.d.mts +3 -2
- package/api/discover/search/search.mjs +26 -7
- package/api/discover/search/search.test.mjs +67 -0
- package/api/doctor/_adapter.d.mts +40 -0
- package/api/doctor/_adapter.mjs +171 -1
- package/api/doctor/built-checks.d.mts +85 -0
- package/api/doctor/built-checks.mjs +807 -0
- package/api/doctor/built-checks.test.mjs +502 -0
- package/api/doctor/doctor.d.mts +6 -5
- package/api/doctor/doctor.doc.mjs +10 -0
- package/api/doctor/doctor.mjs +18 -3
- package/api/doctor/doctor.type.d.mts +6 -0
- package/api/doctor/doctor.type.mjs +3 -0
- package/api/integration/pack-check.mjs +6 -1
- package/api/integration/pack-check.test.mjs +14 -0
- package/api/theme/palette/generate/generate.d.mts +8 -0
- package/api/theme/palette/generate/generate.mjs +38 -11
- package/api/theme/palette/generate/generate.test.mjs +83 -4
- package/api/theme/palette/generate/generator.d.mts +6 -0
- package/api/theme/palette/generate/generator.mjs +6 -0
- package/api/theme/theme.type.d.mts +12 -1
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs +1 -1
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +41 -0
- package/assets/templates/themes/gothic/gothicPalettes.generated.receipt.json +979 -0
- package/assets/templates/themes/gothic/gothicPalettes.generated.ts +271 -0
- package/assets/templates/themes/gothic/gothicTheme.ts +130 -160
- package/assets/templates/themes/gothic/palette.config.json +371 -0
- package/assets/templates/themes/stone/palette.config.json +262 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +51 -0
- package/assets/templates/themes/stone/stonePalettes.generated.receipt.json +840 -0
- package/assets/templates/themes/stone/stonePalettes.generated.ts +501 -0
- package/assets/templates/themes/stone/stoneTheme.ts +190 -207
- package/clients/cli/commands/discover.mjs +1 -1
- package/clients/cli/commands/discover.sources.test.mjs +6 -0
- package/clients/cli/commands/doctor.doc.mjs +12 -0
- package/clients/cli/commands/doctor.mjs +23 -8
- package/foundation/response/error-codes.test.mjs +9 -0
- package/foundation/response/response-types.doc.mjs +5 -5
- package/foundation/response/response-types.doc.test.mjs +29 -0
- package/package.json +9 -9
|
@@ -563,9 +563,14 @@ export function printIntegrationCheckResponse(response) {
|
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
|
|
566
|
-
/**
|
|
567
|
-
|
|
568
|
-
|
|
566
|
+
/**
|
|
567
|
+
* @param {import('commander').Command} program
|
|
568
|
+
* @param {{built?: string}} [options]
|
|
569
|
+
*/
|
|
570
|
+
async function runProjectDoctor(program, options = {}) {
|
|
571
|
+
const report = await runChecks(
|
|
572
|
+
options.built != null ? {built: options.built} : {},
|
|
573
|
+
);
|
|
569
574
|
if (program.opts().json) jsonOut({type: 'doctor', data: report});
|
|
570
575
|
else printHuman(report);
|
|
571
576
|
if (report.summary.fail > 0) process.exitCode = 1;
|
|
@@ -689,7 +694,7 @@ export function registerDoctor(program) {
|
|
|
689
694
|
action: async (options, invoked) => {
|
|
690
695
|
const word = unknownWord(invoked);
|
|
691
696
|
if (word != null) return unknownSubcommand(doctorCmd, 'doctor', word);
|
|
692
|
-
return runProjectDoctor(program);
|
|
697
|
+
return runProjectDoctor(program, options);
|
|
693
698
|
},
|
|
694
699
|
});
|
|
695
700
|
/** @type {import('commander').Command} */
|
|
@@ -704,20 +709,30 @@ export function registerDoctor(program) {
|
|
|
704
709
|
return NO_RESULT_SET;
|
|
705
710
|
},
|
|
706
711
|
});
|
|
712
|
+
// `--built` checks a project's build; an integration check has none.
|
|
713
|
+
const refuseBuilt = () =>
|
|
714
|
+
doctorCmd.opts().built != null
|
|
715
|
+
? cliError(
|
|
716
|
+
'`--built` checks a finished build and goes with `doctor` alone, not with a `doctor integration` check',
|
|
717
|
+
{code: ERROR_CODES.ERR_INVALID_OPTION},
|
|
718
|
+
)
|
|
719
|
+
: null;
|
|
707
720
|
defineCommand(integrationCmd, doctorIntegrationValidateCommand, {
|
|
708
721
|
fn: validateIntegrationFn,
|
|
709
|
-
action: async pkg => runIntegrationValidation(program, pkg),
|
|
722
|
+
action: async pkg => refuseBuilt() ?? runIntegrationValidation(program, pkg),
|
|
710
723
|
});
|
|
711
724
|
defineCommand(integrationCmd, doctorIntegrationTemplatesCommand, {
|
|
712
725
|
fn: integrationTemplateConflictsFn,
|
|
713
|
-
action: async pkg =>
|
|
726
|
+
action: async pkg =>
|
|
727
|
+
refuseBuilt() ?? runAuthoringCheck(program, pkg, 'templates'),
|
|
714
728
|
});
|
|
715
729
|
defineCommand(integrationCmd, doctorIntegrationComponentsCommand, {
|
|
716
730
|
fn: integrationComponentConflictsFn,
|
|
717
|
-
action: async pkg =>
|
|
731
|
+
action: async pkg =>
|
|
732
|
+
refuseBuilt() ?? runAuthoringCheck(program, pkg, 'components'),
|
|
718
733
|
});
|
|
719
734
|
defineCommand(integrationCmd, doctorIntegrationDocsCommand, {
|
|
720
735
|
fn: integrationDocConflictsFn,
|
|
721
|
-
action: async pkg => runAuthoringCheck(program, pkg, 'docs'),
|
|
736
|
+
action: async pkg => refuseBuilt() ?? runAuthoringCheck(program, pkg, 'docs'),
|
|
722
737
|
});
|
|
723
738
|
}
|
|
@@ -258,6 +258,15 @@ describe('error codes: human mode stays clean', () => {
|
|
|
258
258
|
expect(stdout).not.toContain('ERR_UNKNOWN_COMPONENT');
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
+
it('refuses --built with a doctor integration check', async () => {
|
|
262
|
+
const json = await runCli(['--json', 'doctor', '--built', 'dist', 'integration', 'validate']);
|
|
263
|
+
expect(json.status).toBe(1);
|
|
264
|
+
expect(JSON.parse(json.stdout)).toMatchObject({code: 'ERR_INVALID_OPTION'});
|
|
265
|
+
const text = await runCli(['doctor', '--built', 'dist', 'integration', 'docs']);
|
|
266
|
+
expect(text.status).toBe(1);
|
|
267
|
+
expect(text.stderr).toContain('goes with `doctor` alone');
|
|
268
|
+
});
|
|
269
|
+
|
|
261
270
|
it('unknown subcommand exits 1, with the code in JSON and not in text', async () => {
|
|
262
271
|
// A group that is not JSON-capable itself still answers an unknown
|
|
263
272
|
// subcommand in JSON, so a JSON caller learns the subcommands it has.
|
|
@@ -117,22 +117,22 @@ export const doc = {
|
|
|
117
117
|
{
|
|
118
118
|
value: 'discover.list',
|
|
119
119
|
description:
|
|
120
|
-
'What the project has, the integrations it loads and the official packages it declares, official packages first (name, category, components, version, a list per other kind they add, and latest when a source knows it); meta.available lists what the project could add, the official packages first, each with the command that adds it, and meta.sources reports each source, the official list last; when it lists no integration it carries meta.configured to tell "nothing configured" from "nothing discovered".',
|
|
120
|
+
'What the project has, the integrations it loads and the official packages it declares, official packages first (package, the npm package and always equal to name; name, category, components, version, a list per other kind they add, and latest when a source knows it); meta.available lists what the project could add, the official packages first, each with its package and the command that adds it, and meta.sources reports each source, the official list last; when it lists no integration it carries meta.configured to tell "nothing configured" from "nothing discovered".',
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
value: 'discover.detail',
|
|
124
124
|
description:
|
|
125
|
-
'One package, for an @scope/name or @scope/name@version query: what the shown version adds, whether the project has it, and, when a source knows the package, its versions, latest release, and the command that adds it.',
|
|
125
|
+
'One package, for an @scope/name or @scope/name@version query: its package (the npm package the result is about), what the shown version adds, whether the project has it, and, when a source knows the package, its versions, latest release, and the command that adds it.',
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
value: 'discover.detail.doc',
|
|
129
129
|
description:
|
|
130
|
-
'The validated ComponentDoc for one installed component, for an @scope/name/Component query.',
|
|
130
|
+
'The validated ComponentDoc for one installed component, for an @scope/name/Component query, plus package, the npm package that owns the component.',
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
value: 'discover.item',
|
|
134
134
|
description:
|
|
135
|
-
'One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package.',
|
|
135
|
+
'One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package. The envelope\'s package names the same package.',
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
value: 'discover.search',
|
|
@@ -272,7 +272,7 @@ export const doc = {
|
|
|
272
272
|
{
|
|
273
273
|
value: 'theme.palette.generate',
|
|
274
274
|
description:
|
|
275
|
-
'An author-reviewable OKLCH palette candidate,
|
|
275
|
+
'An author-reviewable OKLCH palette response: recipe (`astryx-oklch-v1`), status (`candidate`), familyCount, stopCount, modes, candidate (`TonalPaletteCandidate`), and generationReceipt. The generationReceipt contains schemaVersion (1), recipe, generatorVersion (`palette-generator-v1`), candidateFormatVersion (`palette-typescript-v1` or `palette-json-v1`), candidateSha256, optional preview, resolved request, and diagnostics. File-write fields are output, receipt, preview, written, and reason (`exists` or null).',
|
|
276
276
|
},
|
|
277
277
|
|
|
278
278
|
// upgrade
|
|
@@ -172,6 +172,35 @@ describe('response-types EnumDoc names every field', () => {
|
|
|
172
172
|
expectNamed('theme.targets', fieldsOf(res.data));
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
+
it('theme.palette.generate, including receipt provenance', async () => {
|
|
176
|
+
const cwd = fs.mkdtempSync(
|
|
177
|
+
path.join(os.tmpdir(), 'astryx-response-types-palette-'),
|
|
178
|
+
);
|
|
179
|
+
fs.writeFileSync(
|
|
180
|
+
path.join(cwd, 'palette.config.json'),
|
|
181
|
+
JSON.stringify({
|
|
182
|
+
modeStrategy: 'light-only',
|
|
183
|
+
stops: [20, 50, 80],
|
|
184
|
+
families: [{id: 'blue', seed: '#0074e2'}],
|
|
185
|
+
}),
|
|
186
|
+
);
|
|
187
|
+
const res = await data(
|
|
188
|
+
['theme', 'palette', 'generate', 'palette.config.json'],
|
|
189
|
+
cwd,
|
|
190
|
+
);
|
|
191
|
+
expect(res.type).toBe('theme.palette.generate');
|
|
192
|
+
expectNamed('theme.palette.generate', [
|
|
193
|
+
...Object.keys(res.data),
|
|
194
|
+
...Object.keys(res.data.generationReceipt),
|
|
195
|
+
]);
|
|
196
|
+
expect(describedAs('theme.palette.generate')).toMatch(
|
|
197
|
+
/generatorVersion.*palette-generator-v1/,
|
|
198
|
+
);
|
|
199
|
+
expect(describedAs('theme.palette.generate')).toMatch(
|
|
200
|
+
/candidateFormatVersion.*palette-typescript-v1.*palette-json-v1/,
|
|
201
|
+
);
|
|
202
|
+
});
|
|
203
|
+
|
|
175
204
|
it('gap-report.file, including each delivery', async () => {
|
|
176
205
|
const res = await data([
|
|
177
206
|
'gap-report',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4-canary.3f6ea7d",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
"zod": "^4.4.3"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
|
-
"@astryxdesign/charts": "
|
|
110
|
-
"@astryxdesign/core": "
|
|
111
|
-
"@astryxdesign/lab": "
|
|
112
|
-
"@astryxdesign/theme-neutral": "
|
|
109
|
+
"@astryxdesign/charts": "0.7.4-canary.3f6ea7d",
|
|
110
|
+
"@astryxdesign/core": "0.7.4-canary.3f6ea7d",
|
|
111
|
+
"@astryxdesign/lab": "0.7.4-canary.3f6ea7d",
|
|
112
|
+
"@astryxdesign/theme-neutral": "0.7.4-canary.3f6ea7d"
|
|
113
113
|
},
|
|
114
114
|
"peerDependenciesMeta": {
|
|
115
115
|
"@astryxdesign/charts": {
|
|
@@ -126,10 +126,10 @@
|
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
|
-
"@astryxdesign/charts": "
|
|
130
|
-
"@astryxdesign/core": "
|
|
131
|
-
"@astryxdesign/lab": "
|
|
132
|
-
"@astryxdesign/theme-neutral": "
|
|
129
|
+
"@astryxdesign/charts": "0.7.4-canary.3f6ea7d",
|
|
130
|
+
"@astryxdesign/core": "0.7.4-canary.3f6ea7d",
|
|
131
|
+
"@astryxdesign/lab": "0.7.4-canary.3f6ea7d",
|
|
132
|
+
"@astryxdesign/theme-neutral": "0.7.4-canary.3f6ea7d",
|
|
133
133
|
"@heroicons/react": "^2.2.0",
|
|
134
134
|
"@stylexjs/stylex": "^0.19.0",
|
|
135
135
|
"@types/babel__core": "^7.20.5",
|