@astryxdesign/cli 0.7.15 → 0.7.16-canary.g22213fd
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 +6 -4
- package/api/build/_adapter.d.mts +10 -0
- package/api/build/_adapter.mjs +24 -0
- package/api/build/blocks/blocks.d.mts +1 -0
- package/api/build/blocks/blocks.mjs +18 -1
- package/api/build/kit/shell.weights.json +1 -0
- package/api/build/kit/shellcall.d.mts +26 -0
- package/api/build/kit/shellcall.mjs +87 -0
- package/api/build/kit/start.mjs +67 -4
- package/api/build/kit/weights.d.mts +15 -0
- package/api/build/kit/weights.mjs +27 -0
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/api/component/_adapter.d.mts +1 -1
- package/api/component/_adapter.mjs +28 -1
- package/api/doctor/_adapter.d.mts +38 -2
- package/api/doctor/_adapter.mjs +76 -1
- package/api/doctor/built-checks.mjs +1 -1
- package/api/doctor/doctor.d.mts +26 -0
- package/api/doctor/doctor.doc.mjs +1 -1
- package/api/doctor/doctor.mjs +156 -11
- package/api/doctor/theme-checks.mjs +163 -18
- package/api/icon/_adapter.d.mts +7 -3
- package/api/icon/_adapter.mjs +12 -3
- package/api/icon/icon.type.d.mts +15 -0
- package/api/icon/icon.type.mjs +10 -3
- package/api/icon/iconUse.doc.mjs +19 -5
- package/api/icon/list/list.mjs +7 -1
- package/api/icon/use/use.d.mts +8 -5
- package/api/icon/use/use.mjs +95 -13
- package/api/init/run/run.mjs +1 -0
- package/api/integration/add-contribution.mjs +3 -3
- package/api/integration/pack-check.mjs +14 -8
- package/api/integration/validate-integration.mjs +1 -1
- package/api/search/_adapter.mjs +15 -16
- package/api/search/_entries.d.mts +2 -1
- package/api/search/_entries.mjs +28 -1
- package/api/swizzle/_moduleGraph.mjs +1 -1
- package/api/template/template.type.d.mts +6 -2
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.d.mts +5 -2
- package/api/theme/_adapter.mjs +59 -14
- package/api/theme/_fork.mjs +1 -1
- package/api/theme/build/build.d.mts +120 -32
- package/api/theme/build/build.mjs +471 -111
- package/api/theme/eject/eject.mjs +22 -1
- package/api/theme/generateTonalPalette.doc.mjs +2 -2
- package/api/theme/palette/generate/generator.mjs +141 -2
- package/api/theme/template/template.d.mts +19 -0
- package/api/theme/template/template.mjs +102 -25
- package/api/theme/theme.type.d.mts +44 -1
- package/api/theme/theme.type.mjs +23 -1
- package/api/theme/themeBuild.doc.mjs +4 -4
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +9 -3
- package/api/theme-edit/_adapter.d.mts +33 -2
- package/api/theme-edit/_adapter.mjs +276 -41
- package/api/theme-edit/_check.d.mts +93 -4
- package/api/theme-edit/_check.mjs +1712 -223
- package/api/theme-edit/_color.d.mts +2 -8
- package/api/theme-edit/_color.mjs +292 -219
- package/api/theme-edit/_compiler.d.mts +1 -0
- package/api/theme-edit/_compiler.mjs +20 -1
- package/api/theme-edit/_context.d.mts +31 -1
- package/api/theme-edit/_context.mjs +445 -41
- package/api/theme-edit/_css.d.mts +60 -1
- package/api/theme-edit/_css.mjs +404 -28
- package/api/theme-edit/_edit.d.mts +25 -0
- package/api/theme-edit/_edit.mjs +1620 -154
- package/api/theme-edit/_how-commands.d.mts +11 -26
- package/api/theme-edit/_how-commands.mjs +30 -2
- package/api/theme-edit/_how-question.d.mts +15 -0
- package/api/theme-edit/_how-question.mjs +1469 -194
- package/api/theme-edit/_how.mjs +144 -30
- package/api/theme-edit/_marks.d.mts +13 -0
- package/api/theme-edit/_marks.mjs +15 -0
- package/api/theme-edit/_overview.mjs +2 -0
- package/api/theme-edit/_palette.d.mts +38 -0
- package/api/theme-edit/_palette.mjs +306 -73
- package/api/theme-edit/_parts.d.mts +33 -0
- package/api/theme-edit/_parts.mjs +138 -9
- package/api/theme-edit/_png.d.mts +18 -0
- package/api/theme-edit/_png.mjs +95 -14
- package/api/theme-edit/_preview-app.d.mts +55 -1
- package/api/theme-edit/_preview-app.mjs +1552 -101
- package/api/theme-edit/_preview.d.mts +71 -3
- package/api/theme-edit/_preview.mjs +565 -35
- package/api/theme-edit/_project.d.mts +15 -0
- package/api/theme-edit/_project.mjs +68 -13
- package/api/theme-edit/_settings.d.mts +299 -5
- package/api/theme-edit/_settings.mjs +2806 -158
- package/api/theme-edit/_tables.d.mts +24 -0
- package/api/theme-edit/_tables.mjs +212 -150
- package/api/theme-edit/_vet.d.mts +42 -0
- package/api/theme-edit/_vet.mjs +144 -0
- package/api/theme-edit/theme-edit.type.d.mts +31 -2
- package/api/theme-edit/theme-edit.type.mjs +10 -2
- package/api/theme-edit/themeEditNew.doc.mjs +1 -1
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
- package/api/theme-edit/themeEditShow.doc.mjs +11 -3
- package/api/upgrade/registry/registry.mjs +6 -1
- package/assets/codemods/parse.mjs +2 -2
- package/assets/docs/author-a-theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.zh.mjs +4 -3
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +63 -8
- package/assets/docs/tree/single-component.doc.mjs +11 -2
- package/assets/docs/tree/tokens-and-setup.doc.mjs +39 -3
- package/assets/docs.generated.json +2 -2
- package/assets/preview-app/next.config.mjs +7 -1
- package/assets/preview-app/package.json +1 -0
- package/assets/preview-app/src/app/globals.css +1 -0
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.doc.mjs +21 -0
- package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.tsx +62 -0
- package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.tsx +53 -0
- package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.tsx +33 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +20 -2
- package/assets/templates/pages/dashboard/page.tsx +1 -1
- package/assets/templates/themes/neutral/neutralPalettes.generated.receipt.json +2 -0
- package/authoring/config/config.doc.mjs +8 -0
- package/authoring/config/parse.d.mts +1 -0
- package/authoring/config/parse.mjs +12 -0
- package/authoring/config/type.ts +8 -0
- package/authoring/doctypes/_schema.d.mts +52 -5
- package/authoring/doctypes/_schema.mjs +62 -7
- package/authoring/doctypes/base/type.ts +10 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/function/function.doc.mjs +6 -0
- package/authoring/doctypes/function/type.ts +3 -0
- package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +3 -3
- package/authoring/doctypes/legacy.mjs +5 -1
- package/authoring/index.d.ts +1 -0
- package/authoring/shadcn/source-variants.d.mts +1 -1
- package/authoring/shadcn/source-variants.mjs +32 -10
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/doctor.doc.mjs +2 -2
- package/clients/cli/commands/experimental/icon.mjs +61 -6
- package/clients/cli/commands/experimental/theme.mjs +244 -45
- package/clients/cli/commands/experimental-icon-use.doc.mjs +12 -5
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +3 -3
- 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 +1 -1
- 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-template.doc.mjs +2 -2
- package/clients/cli/commands/theme-build.doc.mjs +2 -2
- package/clients/cli/commands/theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/theme-template.doc.mjs +3 -1
- package/clients/cli/commands/theme.doc.mjs +7 -2
- package/clients/cli/commands/theme.mjs +222 -55
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +7 -4
- package/clients/cli/index.mjs +25 -5
- package/clients/cli/lib/cli-error.mjs +9 -3
- package/clients/cli/lib/component-format.mjs +27 -9
- package/clients/cli/lib/json-shim.mjs +72 -2
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +49 -0
- package/foundation/agent-docs/agent-docs-target.d.mts +2 -6
- package/foundation/agent-docs/agent-docs-target.mjs +9 -17
- package/foundation/agent-docs/agent-docs.mjs +4 -3
- package/foundation/config/config-writer.d.mts +23 -0
- package/foundation/config/config-writer.mjs +152 -58
- package/foundation/config/project.mjs +103 -16
- package/foundation/discovery/component-discovery.mjs +11 -22
- package/foundation/discovery/icon-set-checks.mjs +164 -48
- package/foundation/discovery/icon-set-discovery.d.mts +38 -5
- package/foundation/discovery/icon-set-discovery.mjs +50 -6
- package/foundation/discovery/icon-set-theme-maps.d.mts +59 -0
- package/foundation/discovery/icon-set-theme-maps.mjs +95 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -3
- package/foundation/discovery/icon-set-writer.mjs +58 -17
- package/foundation/discovery/module-exports.mjs +1 -15
- package/foundation/discovery/template-adapter.mjs +44 -19
- package/foundation/discovery/template-icons.d.mts +27 -10
- package/foundation/discovery/template-icons.mjs +142 -26
- package/foundation/discovery/template-source-tree.mjs +3 -16
- package/foundation/discovery/theme-discovery.d.mts +30 -1
- package/foundation/discovery/theme-discovery.mjs +109 -50
- package/foundation/fs/exact-codec.d.mts +35 -0
- package/foundation/fs/exact-codec.mjs +148 -0
- package/foundation/fs/gather-cache.d.mts +15 -5
- package/foundation/fs/gather-cache.mjs +129 -31
- package/foundation/fs/paths.d.mts +39 -0
- package/foundation/fs/paths.mjs +44 -11
- package/foundation/fs/read-record.mjs +11 -1
- package/foundation/integrations/autolink.d.mts +4 -2
- package/foundation/integrations/autolink.mjs +4 -2
- package/foundation/integrations/cli-requirement.d.mts +16 -5
- package/foundation/integrations/cli-requirement.mjs +27 -6
- package/foundation/integrations/contribution-fixes.mjs +1 -16
- package/foundation/integrations/may-have-integrations.mjs +7 -3
- package/foundation/integrations/missing-dependency.d.mts +9 -0
- package/foundation/integrations/missing-dependency.mjs +100 -0
- package/foundation/integrations/public-imports.mjs +1 -1
- package/foundation/render/embedded-imports.mjs +1 -1
- package/foundation/render/host-exit.d.mts +8 -0
- package/foundation/render/host-exit.mjs +11 -0
- package/foundation/render/page-host.mjs +56 -10
- package/foundation/render/page-worker.mjs +14 -0
- package/foundation/render/render-page.mjs +37 -2
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.d.ts +1 -0
- package/foundation/response/error-codes.doc.mjs +5 -0
- package/foundation/response/error-codes.mjs +3 -0
- package/foundation/response/json.d.mts +15 -0
- package/foundation/response/json.mjs +52 -1
- package/foundation/response/response-types.doc.mjs +1 -1
- package/foundation/runtime/lazy-dependencies.d.mts +14 -0
- package/foundation/runtime/lazy-dependencies.mjs +82 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +7 -6
|
@@ -30,6 +30,24 @@ function targetKey(target) {
|
|
|
30
30
|
return target.className.replace(/^astryx-/, '');
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Render one doc example as an optional heading and a code block. A setup
|
|
35
|
+
* example says so in its heading, because it does not run on its own.
|
|
36
|
+
* @param {import('@astryxdesign/cli/authoring').ComponentExampleDoc} ex
|
|
37
|
+
* @param {string} hashes - heading level, e.g. '###'
|
|
38
|
+
* @returns {string[]}
|
|
39
|
+
*/
|
|
40
|
+
function formatExample(ex, hashes) {
|
|
41
|
+
const lines = [];
|
|
42
|
+
if (ex.kind === 'setup') {
|
|
43
|
+
lines.push(`${hashes} ${ex.label ?? 'Setup'} (setup, code only)\n`);
|
|
44
|
+
} else if (ex.label) {
|
|
45
|
+
lines.push(`${hashes} ${ex.label}\n`);
|
|
46
|
+
}
|
|
47
|
+
lines.push('```tsx\n' + ex.code + '\n```\n');
|
|
48
|
+
return lines;
|
|
49
|
+
}
|
|
50
|
+
|
|
33
51
|
/** @param {string} name @returns {string} */
|
|
34
52
|
function dataAttrForName(name) {
|
|
35
53
|
return `data-${name.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()}`;
|
|
@@ -306,8 +324,7 @@ export function formatFull(docs, options = {}) {
|
|
|
306
324
|
sections.push(...formatSubComponent(comp));
|
|
307
325
|
if (comp.examples?.length) {
|
|
308
326
|
for (const ex of comp.examples) {
|
|
309
|
-
|
|
310
|
-
sections.push('```tsx\n' + ex.code + '\n```\n');
|
|
327
|
+
sections.push(...formatExample(ex, '####'));
|
|
311
328
|
}
|
|
312
329
|
}
|
|
313
330
|
}
|
|
@@ -316,8 +333,7 @@ export function formatFull(docs, options = {}) {
|
|
|
316
333
|
if (docs.examples?.length) {
|
|
317
334
|
sections.push('## Examples\n');
|
|
318
335
|
for (const ex of docs.examples) {
|
|
319
|
-
|
|
320
|
-
sections.push('```tsx\n' + ex.code + '\n```\n');
|
|
336
|
+
sections.push(...formatExample(ex, '###'));
|
|
321
337
|
}
|
|
322
338
|
}
|
|
323
339
|
|
|
@@ -515,8 +531,7 @@ export function formatCompact(docs, componentName, importHint) {
|
|
|
515
531
|
if (examples.length) {
|
|
516
532
|
sections.push('## Usage\n');
|
|
517
533
|
for (const ex of examples) {
|
|
518
|
-
|
|
519
|
-
sections.push('```tsx\n' + ex.code + '\n```\n');
|
|
534
|
+
sections.push(...formatExample(ex, '###'));
|
|
520
535
|
}
|
|
521
536
|
}
|
|
522
537
|
|
|
@@ -703,9 +718,12 @@ export function formatBrief(docs, componentName, importHint, options = {}) {
|
|
|
703
718
|
output.push(` ${otherProps.join(', ')}`);
|
|
704
719
|
}
|
|
705
720
|
|
|
706
|
-
// First code example
|
|
707
|
-
|
|
708
|
-
|
|
721
|
+
// First code example; a setup example does not show the component in use.
|
|
722
|
+
const usageExample =
|
|
723
|
+
examples.find((/** @type {any} */ ex) => ex.kind !== 'setup') ??
|
|
724
|
+
examples[0];
|
|
725
|
+
if (usageExample) {
|
|
726
|
+
const code = usageExample.code;
|
|
709
727
|
const codeLine =
|
|
710
728
|
code
|
|
711
729
|
.split('\n')
|
|
@@ -45,6 +45,7 @@ import {API_VERSION, isJsonMode, toErrorEnvelope} from '../../../foundation/resp
|
|
|
45
45
|
import {answeredBy} from '../../../foundation/release/run-context.mjs';
|
|
46
46
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
47
47
|
import {setCommand, setOutcome, recordHelp} from '../../../foundation/debug/index.mjs';
|
|
48
|
+
import {getCliInvocation} from '../../../foundation/env/package-manager.mjs';
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* Fully-qualified name of a command relative to the root program, e.g.
|
|
@@ -290,14 +291,75 @@ const REJECTED_COMMAND = Symbol.for('astryx.jsonShim.rejectedCommand');
|
|
|
290
291
|
* @returns {import('../../../foundation/response/base').Suggestion[] | undefined}
|
|
291
292
|
*/
|
|
292
293
|
function usageSuggestion(err, code) {
|
|
293
|
-
if (code !== 'commander.optionMissingArgument') return undefined;
|
|
294
294
|
const cmd = /** @type {any} */ (err)?.[REJECTED_COMMAND];
|
|
295
295
|
if (!cmd) return undefined;
|
|
296
296
|
const parts = [];
|
|
297
297
|
for (let node = cmd; node; node = node.parent) parts.unshift(node.name());
|
|
298
|
+
// The theme editor names what is missing with its usage and its help, as
|
|
299
|
+
// the project runs the CLI.
|
|
300
|
+
if (
|
|
301
|
+
code === 'commander.missingArgument' &&
|
|
302
|
+
parts.slice(1, 4).join(' ') === 'experimental theme editor'
|
|
303
|
+
)
|
|
304
|
+
return editorMissingSuggestions(cmd);
|
|
305
|
+
if (code !== 'commander.optionMissingArgument') return undefined;
|
|
298
306
|
return [{name: `${parts.join(' ')} ${cmd.usage()}`.trim(), reason: 'usage'}];
|
|
299
307
|
}
|
|
300
308
|
|
|
309
|
+
/**
|
|
310
|
+
* The theme editor's message for a missing argument: what the command takes
|
|
311
|
+
* and the words it was given, in order.
|
|
312
|
+
* @param {unknown} err
|
|
313
|
+
* @param {string} message Commander's message
|
|
314
|
+
*/
|
|
315
|
+
function editorMissingMessage(err, message) {
|
|
316
|
+
const cmd = /** @type {any} */ (err)?.[REJECTED_COMMAND];
|
|
317
|
+
const wants = (cmd?.registeredArguments ?? [])
|
|
318
|
+
.filter((/** @type {any} */ a) => a.required)
|
|
319
|
+
.map((/** @type {any} */ a) => a.name());
|
|
320
|
+
return editorMissingArgument(
|
|
321
|
+
cmd,
|
|
322
|
+
wants,
|
|
323
|
+
/'([^']+)'/.exec(message)?.[1],
|
|
324
|
+
).message;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* The theme editor's usage and help suggestions for a missing argument, as
|
|
329
|
+
* the project runs the CLI.
|
|
330
|
+
* @param {any} cmd
|
|
331
|
+
* @returns {Array<{name: string, reason: string}>}
|
|
332
|
+
*/
|
|
333
|
+
function editorMissingSuggestions(cmd) {
|
|
334
|
+
const parts = [];
|
|
335
|
+
for (let node = cmd; node; node = node.parent) parts.unshift(node.name());
|
|
336
|
+
const words = parts.slice(1).join(' ');
|
|
337
|
+
const invocation = getCliInvocation(process.cwd());
|
|
338
|
+
return [
|
|
339
|
+
{name: `${invocation} ${words} ${cmd.usage()}`.trim(), reason: 'usage'},
|
|
340
|
+
{name: `${invocation} ${words} --help`, reason: 'what each argument is'},
|
|
341
|
+
];
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* The theme editor's missing-argument report: what the command takes, the
|
|
346
|
+
* words it was given and what each was read as, and its usage and help.
|
|
347
|
+
* The parser's error uses it, and so does a command that checks its own
|
|
348
|
+
* arguments (set, whose value may come inside a pasted declaration).
|
|
349
|
+
* @param {any} cmd the Commander command
|
|
350
|
+
* @param {string[]} wants the argument names it takes, in order
|
|
351
|
+
* @param {string | undefined} missing the argument that is missing
|
|
352
|
+
* @returns {{message: string, suggestions: Array<{name: string, reason: string}>}}
|
|
353
|
+
*/
|
|
354
|
+
export function editorMissingArgument(cmd, wants, missing) {
|
|
355
|
+
const given = /** @type {string[]} */ (cmd?.args ?? []);
|
|
356
|
+
const shown = wants.map(w => `<${w}>`);
|
|
357
|
+
return {
|
|
358
|
+
message: `${cmd.name()} takes ${shown.join(' ')}, and ${given.length ? `was given ${given.length} (${given.join(' ')}), read as ${shown.slice(0, given.length).join(' ')}` : 'was given none'}: ${missing ? `<${missing}>` : 'an argument'} is missing.`,
|
|
359
|
+
suggestions: editorMissingSuggestions(cmd),
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
301
363
|
/** Marks a command whose `command`/`addCommand` already self-install the shim. */
|
|
302
364
|
const SELF_INSTALLING = Symbol.for('astryx.jsonShim.selfInstalling');
|
|
303
365
|
|
|
@@ -469,8 +531,14 @@ export function handleCommanderError(err) {
|
|
|
469
531
|
|
|
470
532
|
// Real error paths. Strip Commander's "error: " prefix once: in the envelope
|
|
471
533
|
// the key is already `error`, and in text mode the Astryx prefix replaces it.
|
|
472
|
-
const cleaned = message.replace(/^error:\s*/i, '');
|
|
473
534
|
const suggestions = usageSuggestion(err, code);
|
|
535
|
+
// In the theme editor a missing argument names what was given: in
|
|
536
|
+
// `set corners small` the first word is read as the theme, so "value" alone
|
|
537
|
+
// would name the wrong thing.
|
|
538
|
+
const cleaned =
|
|
539
|
+
suggestions?.length === 2
|
|
540
|
+
? editorMissingMessage(err, message)
|
|
541
|
+
: message.replace(/^error:\s*/i, '');
|
|
474
542
|
if (jsonActive()) {
|
|
475
543
|
emitJsonError(
|
|
476
544
|
cleaned,
|
|
@@ -482,6 +550,8 @@ export function handleCommanderError(err) {
|
|
|
482
550
|
// same as every other CLI error — the `Error: …` line cliError prints.
|
|
483
551
|
process.stderr.write(`Error: ${cleaned}\n`);
|
|
484
552
|
if (suggestions) process.stderr.write(`Usage: ${suggestions[0].name}\n`);
|
|
553
|
+
if (suggestions?.[1])
|
|
554
|
+
process.stderr.write(`Run: ${suggestions[1].name}\n`);
|
|
485
555
|
}
|
|
486
556
|
process.exit(exitCode || 1);
|
|
487
557
|
}
|