@nice-code/commander 0.96.0 → 0.97.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/build/cli.cjs +34 -4
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +34 -5
- package/build/cli.mjs.map +1 -1
- package/build/client/assets/index-BEawHnvQ.css +1 -0
- package/build/client/assets/index-eogxmN5c.js +23 -0
- package/build/client/assets/index-eogxmN5c.js.map +1 -0
- package/build/client/index.html +2 -2
- package/build/{main-DrNJc_xN.mjs → main-BBH2T2OI.mjs} +20 -3
- package/build/main-BBH2T2OI.mjs.map +1 -0
- package/build/{main-BBRM0ZOp.cjs → main-Xo-6rWk6.cjs} +19 -2
- package/build/main-Xo-6rWk6.cjs.map +1 -0
- package/package.json +6 -6
- package/build/client/assets/index-B71o2DG0.js +0 -23
- package/build/client/assets/index-B71o2DG0.js.map +0 -1
- package/build/client/assets/index-p81Nnav2.css +0 -1
- package/build/main-BBRM0ZOp.cjs.map +0 -1
- package/build/main-DrNJc_xN.mjs.map +0 -1
package/build/cli.cjs
CHANGED
|
@@ -444,6 +444,29 @@ function withDependencies(processes, ids) {
|
|
|
444
444
|
return closed;
|
|
445
445
|
}
|
|
446
446
|
/**
|
|
447
|
+
* What stopping `direct` AND its dependencies may take down. A dependency is kept when a live
|
|
448
|
+
* process outside the stop set still needs it — and keeping one keeps what IT needs, hence the
|
|
449
|
+
* loop. Dependencies that simply are not running are not reported either way.
|
|
450
|
+
*/
|
|
451
|
+
function stopSetWithDependencies(processes, direct, isLive) {
|
|
452
|
+
const stop = withDependencies(processes, direct);
|
|
453
|
+
const kept = [];
|
|
454
|
+
for (let changed = true; changed;) {
|
|
455
|
+
changed = false;
|
|
456
|
+
const needed = withDependencies(processes, processes.filter((proc) => !stop.has(proc.id) && isLive(proc.id)).map((proc) => proc.id));
|
|
457
|
+
for (const id of [...stop]) {
|
|
458
|
+
if (direct.includes(id) || !needed.has(id)) continue;
|
|
459
|
+
stop.delete(id);
|
|
460
|
+
if (isLive(id)) kept.push(id);
|
|
461
|
+
changed = true;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return {
|
|
465
|
+
stop: orderByDependency(processes, stop),
|
|
466
|
+
kept
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
447
470
|
* Resolve CLI/UI selection terms against the model. An empty `terms` is the caller's problem
|
|
448
471
|
* (bare `up` consults `defaultSelection` before ever reaching here).
|
|
449
472
|
*/
|
|
@@ -24097,11 +24120,17 @@ function checkEnvReport(value) {
|
|
|
24097
24120
|
warnings
|
|
24098
24121
|
};
|
|
24099
24122
|
}
|
|
24100
|
-
function
|
|
24123
|
+
function checkStop(value) {
|
|
24101
24124
|
const record = asRecord(value);
|
|
24102
24125
|
if (record == null) return "expected an object";
|
|
24103
24126
|
const ids = asIdList(record["ids"]);
|
|
24104
|
-
|
|
24127
|
+
if (ids == null) return "ids: expected an array of process ids";
|
|
24128
|
+
const withDependencies = record["withDependencies"];
|
|
24129
|
+
if (withDependencies != null && typeof withDependencies !== "boolean") return "withDependencies: expected a boolean";
|
|
24130
|
+
return withDependencies === true ? {
|
|
24131
|
+
ids,
|
|
24132
|
+
withDependencies
|
|
24133
|
+
} : { ids };
|
|
24105
24134
|
}
|
|
24106
24135
|
function checkRunSuite(value) {
|
|
24107
24136
|
const record = asRecord(value);
|
|
@@ -24242,7 +24271,7 @@ const commanderControlDomain = createActionRootDomain({ domain: "commander" }).c
|
|
|
24242
24271
|
actions: {
|
|
24243
24272
|
ports: actionSchema().input({ schema: handSchema(checkPortsInput) }).output({ schema: handSchema(checkPortsReport) }),
|
|
24244
24273
|
start: actionSchema().input({ schema: handSchema(checkStart) }).output({ schema: handSchema(checkReport) }),
|
|
24245
|
-
stop: actionSchema().input({ schema: handSchema(
|
|
24274
|
+
stop: actionSchema().input({ schema: handSchema(checkStop) }).output({ schema: handSchema(checkReport) }),
|
|
24246
24275
|
restart: actionSchema().input({ schema: handSchema(checkStart) }).output({ schema: handSchema(checkReport) }),
|
|
24247
24276
|
runSuite: actionSchema().input({ schema: handSchema(checkRunSuite) }).output({ schema: handSchema(checkRunSuiteReport) }),
|
|
24248
24277
|
saveFilter: actionSchema().input({ schema: handSchema(checkSaveFilter) }).output({ schema: handSchema(checkOk) }),
|
|
@@ -26420,7 +26449,7 @@ async function withTimeout(ctx, run) {
|
|
|
26420
26449
|
async function main() {
|
|
26421
26450
|
const argv = process.argv.slice(2);
|
|
26422
26451
|
if (argv[0] === "daemon") {
|
|
26423
|
-
const { runCommanderDaemon } = await Promise.resolve().then(() => require("./main-
|
|
26452
|
+
const { runCommanderDaemon } = await Promise.resolve().then(() => require("./main-Xo-6rWk6.cjs"));
|
|
26424
26453
|
return runCommanderDaemon(argv.slice(1));
|
|
26425
26454
|
}
|
|
26426
26455
|
const parsed = parseCliArgs(argv);
|
|
@@ -26505,6 +26534,7 @@ exports.resolveCommanderDataDir = resolveCommanderDataDir;
|
|
|
26505
26534
|
exports.runTaskPool = runTaskPool;
|
|
26506
26535
|
exports.savedFilterId = savedFilterId;
|
|
26507
26536
|
exports.serveChannel = serveChannel;
|
|
26537
|
+
exports.stopSetWithDependencies = stopSetWithDependencies;
|
|
26508
26538
|
exports.validateCommanderConfig = validateCommanderConfig;
|
|
26509
26539
|
exports.withDependencies = withDependencies;
|
|
26510
26540
|
exports.writeInstanceRecord = writeInstanceRecord;
|