@phreshos/cli 0.1.40 → 0.1.41
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/control/endpoint.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {} from "commander";
|
|
1
|
+
import { Option } from "commander";
|
|
2
2
|
import { commandContract } from "../command-contract.js";
|
|
3
3
|
import { clientOverrideOptions, endpointOptions, outputOptions } from "./options.js";
|
|
4
4
|
import { bounded, clientLaunch, connected, endpoint, endpointView, integer, output, payload, requireProcess, wait } from "./shared.js";
|
|
@@ -38,6 +38,20 @@ export default function endpointCommands(root, connect) {
|
|
|
38
38
|
await process.server.waitReady(timeout(options.timeout));
|
|
39
39
|
output(await endpointView(process, "server"), options.compact);
|
|
40
40
|
}));
|
|
41
|
+
outputOptions(endpointOptions(endpoints.command("waitLifecycle")
|
|
42
|
+
.alias("wait-lifecycle")
|
|
43
|
+
.description("wait for one lifecycle transition of an exact Endpoint")
|
|
44
|
+
.addOption(new Option("--event <event>", "Endpoint lifecycle event")
|
|
45
|
+
.choices(["start", "stop"])
|
|
46
|
+
.makeOptionMandatory())
|
|
47
|
+
.option("--timeout <milliseconds>", "maximum wait in milliseconds", integer)))
|
|
48
|
+
.action(async (options) => withEndpoint(connect, options, async (process, name) => {
|
|
49
|
+
await wait(endpoint(process, name).lifecycle, options.event, timeout(options.timeout));
|
|
50
|
+
output({
|
|
51
|
+
scope: `endpoint:${process.identity}:${name}:lifecycle`,
|
|
52
|
+
event: options.event
|
|
53
|
+
}, options.compact);
|
|
54
|
+
}));
|
|
41
55
|
outputOptions(endpointOptions(endpoints.command("ask")
|
|
42
56
|
.description("ask a Server event and return its answer")
|
|
43
57
|
.requiredOption("--event <event>", "event name")
|
package/dist/control/process.js
CHANGED
|
@@ -49,7 +49,7 @@ export default function processCommands(root, connect) {
|
|
|
49
49
|
outputOptions(process.command("wait")
|
|
50
50
|
.description("wait for one Process lifecycle event")
|
|
51
51
|
.addOption(new Option("--event <event>", "Process lifecycle event")
|
|
52
|
-
.choices(["
|
|
52
|
+
.choices(["create", "exit"])
|
|
53
53
|
.makeOptionMandatory())
|
|
54
54
|
.option("--process <identity>", "scope the event to one Process")
|
|
55
55
|
.option("--program <identity>", "scope the event to one Program")
|
|
@@ -75,14 +75,6 @@ export default function processCommands(root, connect) {
|
|
|
75
75
|
async function eventView(event, message, scoped) {
|
|
76
76
|
if (event === "create")
|
|
77
77
|
return processView(message);
|
|
78
|
-
if (event === "endpointStart" || event === "endpointStop") {
|
|
79
|
-
const endpoint = message;
|
|
80
|
-
const process = await endpoint.process();
|
|
81
|
-
return {
|
|
82
|
-
process: process.identity,
|
|
83
|
-
endpoint: endpoint === process.server ? "server" : "client"
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
78
|
const exit = message;
|
|
87
79
|
const process = exit.process ?? scoped;
|
|
88
80
|
return {
|
package/dist/control/program.js
CHANGED
|
@@ -48,15 +48,19 @@ export default function programCommands(root, connect) {
|
|
|
48
48
|
output({
|
|
49
49
|
scope: options.program ? `program:${options.program}` : "program",
|
|
50
50
|
event: options.event,
|
|
51
|
-
payload: await eventView(options.event, message)
|
|
51
|
+
payload: await eventView(options.event, message, options.program ? target : undefined)
|
|
52
52
|
}, options.compact);
|
|
53
53
|
}));
|
|
54
54
|
}
|
|
55
|
-
async function eventView(event, message) {
|
|
55
|
+
async function eventView(event, message, scoped) {
|
|
56
56
|
if (event === "uninstall") {
|
|
57
|
+
if (scoped)
|
|
58
|
+
return { program: await programView(scoped), everything: message === true };
|
|
57
59
|
const value = message;
|
|
58
|
-
return { program: await programView(value.program),
|
|
60
|
+
return { program: await programView(value.program), everything: value.everything };
|
|
59
61
|
}
|
|
62
|
+
if (scoped)
|
|
63
|
+
return programView(scoped);
|
|
60
64
|
return programView(message);
|
|
61
65
|
}
|
|
62
66
|
function timeout(value) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phreshos/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.41",
|
|
5
5
|
"description": "The Phresh command-line interface for Program projects and system management.",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.10"
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"packageManager": "bun@1.3.14",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@clack/prompts": "^1.7.0",
|
|
52
|
-
"@phreshos/core": "^0.1.
|
|
53
|
-
"@phreshos/node": "^0.1.
|
|
52
|
+
"@phreshos/core": "^0.1.27",
|
|
53
|
+
"@phreshos/node": "^0.1.6",
|
|
54
54
|
"adm-zip": "^0.6.0",
|
|
55
55
|
"commander": "^15.0.0",
|
|
56
56
|
"picocolors": "^1.1.1"
|