kasy-cli 1.28.0 → 1.29.0
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/lib/commands/new.js +9 -3
- package/lib/utils/checks.js +22 -1
- package/package.json +1 -1
package/lib/commands/new.js
CHANGED
|
@@ -606,20 +606,26 @@ async function runNew(directory, { language: langHint = null, backend: backendHi
|
|
|
606
606
|
const tr = createTranslator(language);
|
|
607
607
|
const cancel = () => onCancel(tr);
|
|
608
608
|
|
|
609
|
+
// Show the brand right away so the first thing the user sees is the logo, not
|
|
610
|
+
// a couple of silent seconds while we probe the toolchain below.
|
|
611
|
+
printBanner(tr);
|
|
612
|
+
|
|
609
613
|
// ── 1b. Version check — warn if outdated, let user decide ───────────────
|
|
610
614
|
if (!yes) {
|
|
611
615
|
await warnIfOutdatedBeforeNew(tr);
|
|
612
616
|
}
|
|
613
617
|
|
|
614
618
|
// ── 2. Environment checks (non-blocking — only warnings) ────────────────
|
|
619
|
+
// quiet:true keeps it to a single short "Checking environment…" line (no
|
|
620
|
+
// per-tool detail). It only gets noisy if a tool is actually missing and has
|
|
621
|
+
// to be installed — exactly when the user wants to know.
|
|
615
622
|
const envChecks = [...getBaseChecks(), ...getPlatformChecks()];
|
|
616
|
-
await runChecks(envChecks, tr('new.checks.environment'), {
|
|
623
|
+
await runChecks(envChecks, tr('new.checks.environment.checking'), {
|
|
617
624
|
t: tr,
|
|
618
625
|
quiet: true,
|
|
626
|
+
doneLabel: tr('new.checks.environment.done'),
|
|
619
627
|
});
|
|
620
628
|
|
|
621
|
-
printBanner(tr);
|
|
622
|
-
|
|
623
629
|
ui.intro(kleur.bold(tr('new.subtitle2')));
|
|
624
630
|
|
|
625
631
|
// Whether an explicit target directory was provided by the user
|
package/lib/utils/checks.js
CHANGED
|
@@ -378,6 +378,15 @@ async function runChecks(checks, title, options = {}) {
|
|
|
378
378
|
// (doctor) shows every step. Either way, failures are handled below.
|
|
379
379
|
const quiet = options.quiet === true;
|
|
380
380
|
const stepper = quiet ? null : ui.makeTimedStepper();
|
|
381
|
+
// In quiet mode we'd otherwise probe the toolchain in total silence, leaving
|
|
382
|
+
// the user staring at a couple of dead seconds. Show ONE short spinner with
|
|
383
|
+
// the phase title (no per-tool detail). It hands off to an install spinner if
|
|
384
|
+
// a tool is missing, or clears with `doneLabel` once everything passes.
|
|
385
|
+
let phaseSpinner = null;
|
|
386
|
+
if (quiet && title && process.stdout.isTTY) {
|
|
387
|
+
phaseSpinner = ui.spinner();
|
|
388
|
+
phaseSpinner.start(title);
|
|
389
|
+
}
|
|
381
390
|
const results = [];
|
|
382
391
|
|
|
383
392
|
for (const check of checks) {
|
|
@@ -390,6 +399,8 @@ async function runChecks(checks, title, options = {}) {
|
|
|
390
399
|
onInstalling: (c) => {
|
|
391
400
|
const msg = c.tryInstallMessageKey ? t(c.tryInstallMessageKey) : t('setup.installingNamed', { name: c.name });
|
|
392
401
|
if (stepper) { stepper.update(msg); return; }
|
|
402
|
+
// Hand the line off from the phase spinner to this install's own spinner.
|
|
403
|
+
if (phaseSpinner) { phaseSpinner.stop(title); phaseSpinner = null; }
|
|
393
404
|
installSpinner = ui.timedSpinner();
|
|
394
405
|
installSpinner.start(msg);
|
|
395
406
|
},
|
|
@@ -410,7 +421,17 @@ async function runChecks(checks, title, options = {}) {
|
|
|
410
421
|
if (result.ok) installSpinner.stop(result.version ? `${result.name} — ${result.version}` : result.name);
|
|
411
422
|
else installSpinner.error(t('checks.missing', { name: result.name }));
|
|
412
423
|
}
|
|
413
|
-
// quiet + passed without installing →
|
|
424
|
+
// quiet + passed without installing → the phase spinner stays running.
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// Close the phase line. If everything passed, show the friendly done label;
|
|
428
|
+
// if something failed, stop neutrally and let the recovery/failure output
|
|
429
|
+
// below explain it. Stopping here (before the prompts) avoids a spinner
|
|
430
|
+
// animating underneath an interactive question.
|
|
431
|
+
if (phaseSpinner) {
|
|
432
|
+
const allOk = results.every((r) => r.ok);
|
|
433
|
+
phaseSpinner.stop(allOk ? (options.doneLabel || title) : title);
|
|
434
|
+
phaseSpinner = null;
|
|
414
435
|
}
|
|
415
436
|
|
|
416
437
|
const failures = results.filter((r) => !r.ok);
|