@mutmutco/installer-launcher 0.1.11 → 0.1.12
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/dist/launcher.js +26 -6
- package/dist/launcher.sea.cjs +26 -6
- package/package.json +2 -2
package/dist/launcher.js
CHANGED
|
@@ -412,7 +412,7 @@ function createInstallerRun(value, options = {}) {
|
|
|
412
412
|
product: declaration.product,
|
|
413
413
|
columns: options.columns,
|
|
414
414
|
env,
|
|
415
|
-
color: tty && options.color !== false && env.NO_COLOR === void 0
|
|
415
|
+
color: tty && options.color !== false && env.NO_COLOR === void 0 && env.TERM !== "dumb"
|
|
416
416
|
});
|
|
417
417
|
const errors = [];
|
|
418
418
|
const write = options.write ? (text, channel) => {
|
|
@@ -448,9 +448,13 @@ function createInstallerRun(value, options = {}) {
|
|
|
448
448
|
const start = () => {
|
|
449
449
|
if (started || finished) return;
|
|
450
450
|
started = true;
|
|
451
|
+
if (options.quiet) return;
|
|
451
452
|
const welcome = face.welcome();
|
|
452
453
|
if (tty) lines(welcome);
|
|
453
|
-
else if (welcome.length)
|
|
454
|
+
else if (welcome.length) {
|
|
455
|
+
const warm = options.operation === "install" ? face.identity.installWarm : face.identity.warm;
|
|
456
|
+
lines([`${face.identity.name} - Mutatis Mutandis`, warm.replaceAll("\u2014", "-").replaceAll("\u2026", "...")]);
|
|
457
|
+
}
|
|
454
458
|
};
|
|
455
459
|
const durable = (title, measure, kind) => {
|
|
456
460
|
spinner.stop();
|
|
@@ -480,12 +484,13 @@ function createInstallerRun(value, options = {}) {
|
|
|
480
484
|
const surface = declaration.surfaces.find((surface2) => surface2.id === facts.id);
|
|
481
485
|
if (!surface) throw new Error("installer run: undeclared surface");
|
|
482
486
|
start();
|
|
483
|
-
const versions = facts.to ? facts.from && facts.from !== facts.to ? ` ${facts.from} \u2192 ${facts.to}` : ` ${facts.to}` : "";
|
|
487
|
+
const versions = facts.to ? facts.from && facts.from !== facts.to ? ` ${facts.from} ${tty ? "\u2192" : "->"} ${facts.to}` : ` ${facts.to}` : "";
|
|
484
488
|
const status = { updated: options.dryRun ? "would update" : "updated", current: "already current", failed: "failed", skipped: "skipped", retry: "retrying", pending: "pending", kept: "kept" }[facts.state];
|
|
485
489
|
if (!status) throw new Error("installer run: unknown surface state");
|
|
486
|
-
const
|
|
490
|
+
const separator = tty ? "\xB7" : "-";
|
|
491
|
+
const activation = facts.state === "updated" && surface.activation ? ` ${separator} ${surface.activation}` : "";
|
|
487
492
|
const completed = ["updated", "current", "kept", "skipped"].includes(facts.state);
|
|
488
|
-
durable(`${facts.id}${versions}
|
|
493
|
+
durable(`${facts.id}${versions} ${separator} ${status}${activation}`, completed ? facts.seconds ?? null : null, facts.state === "failed" ? "fail" : facts.state === "updated" ? "ok" : "note");
|
|
489
494
|
if (facts.detail) run2.relay(facts.detail);
|
|
490
495
|
},
|
|
491
496
|
milestone({ step, state, ms }) {
|
|
@@ -512,6 +517,20 @@ function createInstallerRun(value, options = {}) {
|
|
|
512
517
|
`);
|
|
513
518
|
}
|
|
514
519
|
},
|
|
520
|
+
cancel() {
|
|
521
|
+
if (finished) return;
|
|
522
|
+
if (env.MM_INSTALLER_OUTCOME_FILE) writeInstallerOutcome(
|
|
523
|
+
env.MM_INSTALLER_OUTCOME_FILE,
|
|
524
|
+
{ total: 0, updated: 0, failed: 0, deferred: true, detail: "Operation cancelled." }
|
|
525
|
+
);
|
|
526
|
+
start();
|
|
527
|
+
spinner.stop();
|
|
528
|
+
finished = true;
|
|
529
|
+
if (!face.nested || !env.MM_INSTALLER_OUTCOME_FILE) {
|
|
530
|
+
lines(tty ? face.receipt(["Operation cancelled."], { ready: false }) : ["Operation cancelled."]);
|
|
531
|
+
}
|
|
532
|
+
if (tty) lines([face.signOff()]);
|
|
533
|
+
},
|
|
515
534
|
finish(facts) {
|
|
516
535
|
if (finished) return;
|
|
517
536
|
validateInstallerOutcome(facts);
|
|
@@ -519,6 +538,7 @@ function createInstallerRun(value, options = {}) {
|
|
|
519
538
|
start();
|
|
520
539
|
spinner.stop();
|
|
521
540
|
finished = true;
|
|
541
|
+
if (options.quiet && facts.updated === 0 && facts.failed === 0 && !facts.operationFailed) return;
|
|
522
542
|
const changed = !facts.version ? "No release target is available." : facts.dryRun ? `Would update ${facts.updated} of ${facts.total} surfaces to ${facts.version}.` : facts.installed ? `Installed ${facts.version} across ${facts.total} surfaces.` : `Updated ${facts.updated} of ${facts.total} surfaces to ${facts.version}.`;
|
|
523
543
|
const ready = facts.failed === 0 && !facts.dryRun && !facts.deferred && !facts.operationFailed && Boolean(facts.version);
|
|
524
544
|
const body = [
|
|
@@ -1269,7 +1289,7 @@ function wipeProductDir(dir) {
|
|
|
1269
1289
|
}
|
|
1270
1290
|
|
|
1271
1291
|
// src/index.ts
|
|
1272
|
-
var LAUNCHER_VERSION = true ? "0.1.
|
|
1292
|
+
var LAUNCHER_VERSION = true ? "0.1.12" : readVersionFromPackage();
|
|
1273
1293
|
function defaultPrint(message) {
|
|
1274
1294
|
process.stdout.write(`${message}
|
|
1275
1295
|
`);
|
package/dist/launcher.sea.cjs
CHANGED
|
@@ -443,7 +443,7 @@ function createInstallerRun(value, options = {}) {
|
|
|
443
443
|
product: declaration.product,
|
|
444
444
|
columns: options.columns,
|
|
445
445
|
env,
|
|
446
|
-
color: tty && options.color !== false && env.NO_COLOR === void 0
|
|
446
|
+
color: tty && options.color !== false && env.NO_COLOR === void 0 && env.TERM !== "dumb"
|
|
447
447
|
});
|
|
448
448
|
const errors = [];
|
|
449
449
|
const write = options.write ? (text, channel) => {
|
|
@@ -479,9 +479,13 @@ function createInstallerRun(value, options = {}) {
|
|
|
479
479
|
const start = () => {
|
|
480
480
|
if (started || finished) return;
|
|
481
481
|
started = true;
|
|
482
|
+
if (options.quiet) return;
|
|
482
483
|
const welcome = face.welcome();
|
|
483
484
|
if (tty) lines(welcome);
|
|
484
|
-
else if (welcome.length)
|
|
485
|
+
else if (welcome.length) {
|
|
486
|
+
const warm = options.operation === "install" ? face.identity.installWarm : face.identity.warm;
|
|
487
|
+
lines([`${face.identity.name} - Mutatis Mutandis`, warm.replaceAll("\u2014", "-").replaceAll("\u2026", "...")]);
|
|
488
|
+
}
|
|
485
489
|
};
|
|
486
490
|
const durable = (title, measure, kind) => {
|
|
487
491
|
spinner.stop();
|
|
@@ -511,12 +515,13 @@ function createInstallerRun(value, options = {}) {
|
|
|
511
515
|
const surface = declaration.surfaces.find((surface2) => surface2.id === facts.id);
|
|
512
516
|
if (!surface) throw new Error("installer run: undeclared surface");
|
|
513
517
|
start();
|
|
514
|
-
const versions = facts.to ? facts.from && facts.from !== facts.to ? ` ${facts.from} \u2192 ${facts.to}` : ` ${facts.to}` : "";
|
|
518
|
+
const versions = facts.to ? facts.from && facts.from !== facts.to ? ` ${facts.from} ${tty ? "\u2192" : "->"} ${facts.to}` : ` ${facts.to}` : "";
|
|
515
519
|
const status = { updated: options.dryRun ? "would update" : "updated", current: "already current", failed: "failed", skipped: "skipped", retry: "retrying", pending: "pending", kept: "kept" }[facts.state];
|
|
516
520
|
if (!status) throw new Error("installer run: unknown surface state");
|
|
517
|
-
const
|
|
521
|
+
const separator = tty ? "\xB7" : "-";
|
|
522
|
+
const activation = facts.state === "updated" && surface.activation ? ` ${separator} ${surface.activation}` : "";
|
|
518
523
|
const completed = ["updated", "current", "kept", "skipped"].includes(facts.state);
|
|
519
|
-
durable(`${facts.id}${versions}
|
|
524
|
+
durable(`${facts.id}${versions} ${separator} ${status}${activation}`, completed ? facts.seconds ?? null : null, facts.state === "failed" ? "fail" : facts.state === "updated" ? "ok" : "note");
|
|
520
525
|
if (facts.detail) run2.relay(facts.detail);
|
|
521
526
|
},
|
|
522
527
|
milestone({ step, state, ms }) {
|
|
@@ -543,6 +548,20 @@ function createInstallerRun(value, options = {}) {
|
|
|
543
548
|
`);
|
|
544
549
|
}
|
|
545
550
|
},
|
|
551
|
+
cancel() {
|
|
552
|
+
if (finished) return;
|
|
553
|
+
if (env.MM_INSTALLER_OUTCOME_FILE) writeInstallerOutcome(
|
|
554
|
+
env.MM_INSTALLER_OUTCOME_FILE,
|
|
555
|
+
{ total: 0, updated: 0, failed: 0, deferred: true, detail: "Operation cancelled." }
|
|
556
|
+
);
|
|
557
|
+
start();
|
|
558
|
+
spinner.stop();
|
|
559
|
+
finished = true;
|
|
560
|
+
if (!face.nested || !env.MM_INSTALLER_OUTCOME_FILE) {
|
|
561
|
+
lines(tty ? face.receipt(["Operation cancelled."], { ready: false }) : ["Operation cancelled."]);
|
|
562
|
+
}
|
|
563
|
+
if (tty) lines([face.signOff()]);
|
|
564
|
+
},
|
|
546
565
|
finish(facts) {
|
|
547
566
|
if (finished) return;
|
|
548
567
|
validateInstallerOutcome(facts);
|
|
@@ -550,6 +569,7 @@ function createInstallerRun(value, options = {}) {
|
|
|
550
569
|
start();
|
|
551
570
|
spinner.stop();
|
|
552
571
|
finished = true;
|
|
572
|
+
if (options.quiet && facts.updated === 0 && facts.failed === 0 && !facts.operationFailed) return;
|
|
553
573
|
const changed = !facts.version ? "No release target is available." : facts.dryRun ? `Would update ${facts.updated} of ${facts.total} surfaces to ${facts.version}.` : facts.installed ? `Installed ${facts.version} across ${facts.total} surfaces.` : `Updated ${facts.updated} of ${facts.total} surfaces to ${facts.version}.`;
|
|
554
574
|
const ready = facts.failed === 0 && !facts.dryRun && !facts.deferred && !facts.operationFailed && Boolean(facts.version);
|
|
555
575
|
const body = [
|
|
@@ -1301,7 +1321,7 @@ function wipeProductDir(dir) {
|
|
|
1301
1321
|
}
|
|
1302
1322
|
|
|
1303
1323
|
// src/index.ts
|
|
1304
|
-
var LAUNCHER_VERSION = true ? "0.1.
|
|
1324
|
+
var LAUNCHER_VERSION = true ? "0.1.12" : readVersionFromPackage();
|
|
1305
1325
|
function defaultPrint(message) {
|
|
1306
1326
|
process.stdout.write(`${message}
|
|
1307
1327
|
`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mutmutco/installer-launcher",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Single-executable (SEA) launcher: sign-in, gated payload fetch, self-update. One copy ships per product.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "node build.mjs",
|
|
27
|
-
"test": "vitest run",
|
|
27
|
+
"test": "vitest run --no-file-parallelism",
|
|
28
28
|
"typecheck": "tsc --noEmit"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|