@powerhousedao/ph-cli 0.41.3 → 2.5.0-dev.1
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 +122 -18
- package/dist/package.json +13 -1
- package/dist/scripts/generate-commands-md.ts +84 -0
- package/dist/scripts/generate-version.ts +22 -0
- package/dist/scripts/manage-environment +190 -0
- package/dist/scripts/setup-environment +423 -0
- package/dist/scripts/setup-environment.ps1 +313 -0
- package/dist/scripts/setup.sh +24 -0
- package/dist/src/cli.js +17 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/connect.d.ts +1 -1
- package/dist/src/commands/connect.d.ts.map +1 -1
- package/dist/src/commands/connect.js +39 -9
- package/dist/src/commands/connect.js.map +1 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +3 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/install.d.ts +2 -1
- package/dist/src/commands/install.d.ts.map +1 -1
- package/dist/src/commands/install.js +39 -10
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/list.d.ts.map +1 -1
- package/dist/src/commands/list.js +2 -2
- package/dist/src/commands/list.js.map +1 -1
- package/dist/src/commands/reactor.d.ts +9 -0
- package/dist/src/commands/reactor.d.ts.map +1 -0
- package/dist/src/commands/reactor.js +39 -0
- package/dist/src/commands/reactor.js.map +1 -0
- package/dist/src/commands/service.d.ts +1 -1
- package/dist/src/commands/service.d.ts.map +1 -1
- package/dist/src/commands/service.js +48 -126
- package/dist/src/commands/service.js.map +1 -1
- package/dist/src/commands/switchboard.d.ts +5 -5
- package/dist/src/commands/switchboard.d.ts.map +1 -1
- package/dist/src/commands/switchboard.js +18 -12
- package/dist/src/commands/switchboard.js.map +1 -1
- package/dist/src/commands/uninstall.d.ts.map +1 -1
- package/dist/src/commands/uninstall.js +10 -1
- package/dist/src/commands/uninstall.js.map +1 -1
- package/dist/src/help.d.ts +15 -3
- package/dist/src/help.d.ts.map +1 -1
- package/dist/src/help.js +80 -15
- package/dist/src/help.js.map +1 -1
- package/dist/src/services/connect.js +1 -1
- package/dist/src/services/connect.js.map +1 -1
- package/dist/src/services/dev.d.ts.map +1 -1
- package/dist/src/services/dev.js +2 -2
- package/dist/src/services/dev.js.map +1 -1
- package/dist/src/services/generate.js +1 -1
- package/dist/src/services/generate.js.map +1 -1
- package/dist/src/services/inspect.d.ts.map +1 -1
- package/dist/src/services/inspect.js +3 -2
- package/dist/src/services/inspect.js.map +1 -1
- package/dist/src/services/reactor.d.ts +32 -0
- package/dist/src/services/reactor.d.ts.map +1 -0
- package/dist/src/services/reactor.js +66 -0
- package/dist/src/services/reactor.js.map +1 -0
- package/dist/src/services/switchboard.d.ts +2 -31
- package/dist/src/services/switchboard.d.ts.map +1 -1
- package/dist/src/services/switchboard.js +24 -58
- package/dist/src/services/switchboard.js.map +1 -1
- package/dist/src/utils.d.ts +11 -3
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +8 -7
- package/dist/src/utils.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/vitest.config.js +7 -0
- package/dist/vitest.config.js.map +1 -0
- package/package.json +20 -8
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type LocalReactor } from "@powerhousedao/reactor-local";
|
|
2
|
+
import { type Command } from "commander";
|
|
3
|
+
import { type ReactorOptions } from "../services/reactor.js";
|
|
4
|
+
import { type CommandActionType } from "../types.js";
|
|
5
|
+
export declare const switchboard: CommandActionType<[
|
|
6
|
+
ReactorOptions
|
|
7
|
+
], Promise<LocalReactor>>;
|
|
8
|
+
export declare function reactorCommand(program: Command): void;
|
|
9
|
+
//# sourceMappingURL=reactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactor.d.ts","sourceRoot":"","sources":["../../../src/commands/reactor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD,eAAO,MAAM,WAAW,EAAE,iBAAiB,CACzC;IAAC,cAAc;CAAC,EAChB,OAAO,CAAC,YAAY,CAAC,CAGtB,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QA2B9C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { reactorHelp } from "../help.js";
|
|
2
|
+
import { setCustomHelp } from "../utils.js";
|
|
3
|
+
async function startLocalSwitchboard(options) {
|
|
4
|
+
const Switchboard = await import("../services/reactor.js");
|
|
5
|
+
const { startLocalReactor } = Switchboard;
|
|
6
|
+
return startLocalReactor(options);
|
|
7
|
+
}
|
|
8
|
+
export const switchboard = async (options) => {
|
|
9
|
+
return startLocalSwitchboard(options);
|
|
10
|
+
};
|
|
11
|
+
export function reactorCommand(program) {
|
|
12
|
+
const command = program
|
|
13
|
+
.command("reactor")
|
|
14
|
+
.description("Starts local reactor")
|
|
15
|
+
.option("--port <PORT>", "port to host the api", "4001")
|
|
16
|
+
.option("--config-file <configFile>", "Path to the powerhouse.config.js file", "./powerhouse.config.json")
|
|
17
|
+
.option("--generate", "generate code when document model is updated")
|
|
18
|
+
.option("--db-path <DB_PATH>", "path to the database")
|
|
19
|
+
.option("--https-key-file <HTTPS_KEY_FILE>", "path to the ssl key file")
|
|
20
|
+
.option("--https-cert-file <HTTPS_CERT_FILE>", "path to the ssl cert file")
|
|
21
|
+
.option("-w, --watch", "if the reactor should watch for local changes to document models and processors")
|
|
22
|
+
.option("--packages <packages...>", "list of packages to be loaded, if defined then packages on config file are ignored")
|
|
23
|
+
.action(async (...args) => {
|
|
24
|
+
await switchboard(...args);
|
|
25
|
+
});
|
|
26
|
+
setCustomHelp(command, reactorHelp);
|
|
27
|
+
}
|
|
28
|
+
if (process.argv.at(2) === "spawn") {
|
|
29
|
+
const optionsArg = process.argv.at(3);
|
|
30
|
+
const options = optionsArg ? JSON.parse(optionsArg) : {};
|
|
31
|
+
startLocalSwitchboard(options)
|
|
32
|
+
.then((switchboard) => {
|
|
33
|
+
process.send?.(`driveUrl:${switchboard.driveUrl}`);
|
|
34
|
+
})
|
|
35
|
+
.catch((e) => {
|
|
36
|
+
throw e;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=reactor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactor.js","sourceRoot":"","sources":["../../../src/commands/reactor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,KAAK,UAAU,qBAAqB,CAAC,OAAuB;IAC1D,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAC3D,MAAM,EAAE,iBAAiB,EAAE,GAAG,WAAW,CAAC;IAC1C,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAGpB,KAAK,EAAE,OAAO,EAAE,EAAE;IACpB,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,sBAAsB,CAAC;SACnC,MAAM,CAAC,eAAe,EAAE,sBAAsB,EAAE,MAAM,CAAC;SACvD,MAAM,CACL,4BAA4B,EAC5B,uCAAuC,EACvC,0BAA0B,CAC3B;SACA,MAAM,CAAC,YAAY,EAAE,8CAA8C,CAAC;SACpE,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,CAAC;SACrD,MAAM,CAAC,mCAAmC,EAAE,0BAA0B,CAAC;SACvE,MAAM,CAAC,qCAAqC,EAAE,2BAA2B,CAAC;SAC1E,MAAM,CACL,aAAa,EACb,iFAAiF,CAClF;SACA,MAAM,CACL,0BAA0B,EAC1B,oFAAoF,CACrF;SACA,MAAM,CAAC,KAAK,EAAE,GAAG,IAAsB,EAAE,EAAE;QAC1C,MAAM,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEL,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACtC,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7E,qBAAqB,CAAC,OAAO,CAAC;SAC3B,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;QACpB,OAAO,CAAC,IAAI,EAAE,CAAC,YAAY,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACpB,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Command } from "commander";
|
|
2
2
|
import { type CommandActionType } from "../types.js";
|
|
3
|
-
export declare const manageService: CommandActionType<[string
|
|
3
|
+
export declare const manageService: CommandActionType<[string]>;
|
|
4
4
|
export declare function serviceCommand(program: Command): void;
|
|
5
5
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/commands/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/commands/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAMnD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAWrD,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAqErD,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QAQ9C"}
|
|
@@ -1,145 +1,67 @@
|
|
|
1
|
-
import { getConfig } from "@powerhousedao/config/powerhouse";
|
|
2
1
|
import { Argument } from "commander";
|
|
3
2
|
import { execSync } from "node:child_process";
|
|
3
|
+
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import pm2 from "pm2";
|
|
7
6
|
import { serviceHelp } from "../help.js";
|
|
8
7
|
import { setCustomHelp } from "../utils.js";
|
|
9
|
-
const actions = ["start", "stop", "status", "
|
|
10
|
-
const
|
|
11
|
-
let switchboardPort = 8442;
|
|
12
|
-
let connectPort = 8443;
|
|
13
|
-
export const manageService = async (action, service) => {
|
|
8
|
+
const actions = ["start", "stop", "status", "setup", "restart"];
|
|
9
|
+
export const manageService = async (action) => {
|
|
14
10
|
try {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const manageScriptPath = path.join(dirname, "..", "..", "scripts", "manage-environment");
|
|
13
|
+
const setupScriptPath = path.join(dirname, "..", "..", "scripts", "setup-environment");
|
|
14
|
+
// Read project name from package.json
|
|
15
|
+
const packageJsonPath = path.join(process.cwd(), "package.json");
|
|
16
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
17
|
+
const projectName = packageJson.name;
|
|
18
|
+
switch (action) {
|
|
19
|
+
case "start":
|
|
20
|
+
console.log("Starting environment...");
|
|
21
|
+
execSync(`bash ${manageScriptPath} ${projectName} start`, {
|
|
22
|
+
stdio: "inherit",
|
|
23
|
+
});
|
|
24
|
+
break;
|
|
25
|
+
case "stop":
|
|
26
|
+
console.log("Stopping environment...");
|
|
27
|
+
execSync(`bash ${manageScriptPath} ${projectName} stop`, {
|
|
28
|
+
stdio: "inherit",
|
|
29
|
+
});
|
|
30
|
+
break;
|
|
31
|
+
case "restart":
|
|
32
|
+
console.log("Restarting environment...");
|
|
33
|
+
execSync(`bash ${manageScriptPath} ${projectName} restart`, {
|
|
34
|
+
stdio: "inherit",
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
case "status":
|
|
38
|
+
console.log("Checking environment status...");
|
|
39
|
+
execSync(`bash ${manageScriptPath} ${projectName} status`, {
|
|
40
|
+
stdio: "inherit",
|
|
41
|
+
});
|
|
42
|
+
break;
|
|
43
|
+
case "setup":
|
|
44
|
+
console.log("Setting up environment...");
|
|
45
|
+
execSync(`bash ${setupScriptPath} "dev" ${projectName}`, {
|
|
46
|
+
stdio: "inherit",
|
|
47
|
+
});
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
console.log("Unknown action:", action);
|
|
51
|
+
process.exit(1);
|
|
18
52
|
}
|
|
19
|
-
if (config.studio?.port) {
|
|
20
|
-
connectPort = config.studio.port;
|
|
21
|
-
}
|
|
22
|
-
pm2.connect((err) => {
|
|
23
|
-
switch (action) {
|
|
24
|
-
case "start":
|
|
25
|
-
startServices(service);
|
|
26
|
-
break;
|
|
27
|
-
case "stop":
|
|
28
|
-
stopServices(service);
|
|
29
|
-
break;
|
|
30
|
-
case "startup":
|
|
31
|
-
startupServices();
|
|
32
|
-
break;
|
|
33
|
-
case "unstartup":
|
|
34
|
-
unstartupServices();
|
|
35
|
-
break;
|
|
36
|
-
default:
|
|
37
|
-
statusServices();
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
53
|
}
|
|
42
54
|
catch (error) {
|
|
43
|
-
console.error(error);
|
|
55
|
+
console.error("Error:", error);
|
|
56
|
+
process.exit(1);
|
|
44
57
|
}
|
|
45
58
|
};
|
|
46
59
|
export function serviceCommand(program) {
|
|
47
60
|
const command = program
|
|
48
61
|
.command("service")
|
|
49
|
-
.description("Manage services")
|
|
50
|
-
.addArgument(new Argument("action").choices(actions).default("
|
|
51
|
-
.addArgument(new Argument("service").choices(services).argOptional().default("all"))
|
|
62
|
+
.description("Manage environment services")
|
|
63
|
+
.addArgument(new Argument("action").choices(actions).default("status"))
|
|
52
64
|
.action(manageService);
|
|
53
65
|
setCustomHelp(command, serviceHelp);
|
|
54
66
|
}
|
|
55
|
-
function startServices(service) {
|
|
56
|
-
if (service === "switchboard" || service === "all") {
|
|
57
|
-
const switchboardOptions = {
|
|
58
|
-
name: "switchboard",
|
|
59
|
-
script: "npx ph-cli switchboard",
|
|
60
|
-
};
|
|
61
|
-
console.log("Starting Switchboard...");
|
|
62
|
-
pm2.start(switchboardOptions, (err) => {
|
|
63
|
-
if (err) {
|
|
64
|
-
console.log(err.name);
|
|
65
|
-
// throw new Error(err.message);
|
|
66
|
-
}
|
|
67
|
-
dumpServices();
|
|
68
|
-
});
|
|
69
|
-
console.log("Switchboard started");
|
|
70
|
-
}
|
|
71
|
-
if (service === "connect" || service === "all") {
|
|
72
|
-
const connectOptions = {
|
|
73
|
-
name: "connect",
|
|
74
|
-
script: "npx ph-cli connect",
|
|
75
|
-
args: ["--port", connectPort.toString()],
|
|
76
|
-
};
|
|
77
|
-
console.log("Starting connect...");
|
|
78
|
-
pm2.start(connectOptions, (err) => {
|
|
79
|
-
if (err) {
|
|
80
|
-
throw new Error(err.message);
|
|
81
|
-
}
|
|
82
|
-
dumpServices();
|
|
83
|
-
});
|
|
84
|
-
console.log("Connect started");
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function dumpServices() {
|
|
88
|
-
pm2.dump((err) => {
|
|
89
|
-
if (err) {
|
|
90
|
-
throw new Error(err.message);
|
|
91
|
-
}
|
|
92
|
-
statusServices();
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
function stopServices(service) {
|
|
96
|
-
if (service === "all" || service === "connect") {
|
|
97
|
-
pm2.stop("connect", (err) => {
|
|
98
|
-
if (err) {
|
|
99
|
-
throw new Error(err.message);
|
|
100
|
-
}
|
|
101
|
-
dumpServices();
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
if (service === "all" || service === "switchboard") {
|
|
105
|
-
pm2.stop("switchboard", (err) => {
|
|
106
|
-
if (err) {
|
|
107
|
-
throw new Error(err.message);
|
|
108
|
-
}
|
|
109
|
-
dumpServices();
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function statusServices() {
|
|
114
|
-
pm2.list((err, list) => {
|
|
115
|
-
const formattedList = list.map((item) => {
|
|
116
|
-
return {
|
|
117
|
-
id: item.pm_id,
|
|
118
|
-
name: item.name,
|
|
119
|
-
pid: item.pid,
|
|
120
|
-
uptime: item.pm2_env?.pm_uptime,
|
|
121
|
-
restarts: item.pm2_env?.unstable_restarts,
|
|
122
|
-
status: item.pm2_env?.status,
|
|
123
|
-
mem: item.monit?.memory,
|
|
124
|
-
cpu: item.monit?.cpu,
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
console.table(formattedList);
|
|
128
|
-
process.exit(0);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
function startupServices() {
|
|
132
|
-
const dirname = import.meta.dirname || path.dirname(fileURLToPath(import.meta.url));
|
|
133
|
-
const scriptPath = path.join(dirname, "..", "scripts", "service-startup.sh");
|
|
134
|
-
const result = execSync(`bash ${scriptPath}`).toString();
|
|
135
|
-
console.log(result);
|
|
136
|
-
process.exit(0);
|
|
137
|
-
}
|
|
138
|
-
function unstartupServices() {
|
|
139
|
-
const dirname = import.meta.dirname || path.dirname(fileURLToPath(import.meta.url));
|
|
140
|
-
const scriptPath = path.join(dirname, "..", "scripts", "service-unstartup.sh");
|
|
141
|
-
const result = execSync(`bash ${scriptPath}`).toString();
|
|
142
|
-
console.log(result);
|
|
143
|
-
process.exit(0);
|
|
144
|
-
}
|
|
145
67
|
//# sourceMappingURL=service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/commands/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/commands/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQ5C,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,aAAa,GAAgC,KAAK,EAAE,MAAM,EAAE,EAAE;IACzE,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7D,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAChC,OAAO,EACP,IAAI,EACJ,IAA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GAAG,CAAC,2BAA2B,CAAC,CAAC;gBACzC,QAAQ,CAAC,QAAQ,eAAe,UAAU,WAAW,EAAE,EAAE;oBACvD,KAAK,EAAE,SAAS;iBACjB,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;gBACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,6BAA6B,CAAC;SAC1C,WAAW,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACtE,MAAM,CAAC,aAAa,CAAC,CAAC;IAEzB,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SwitchboardReactor } from "@powerhousedao/switchboard/server";
|
|
2
2
|
import { type Command } from "commander";
|
|
3
|
-
import { type
|
|
3
|
+
import { type ReactorOptions } from "../services/reactor.js";
|
|
4
4
|
import { type CommandActionType } from "../types.js";
|
|
5
5
|
export declare const switchboard: CommandActionType<[
|
|
6
|
-
|
|
7
|
-
], Promise<
|
|
8
|
-
export declare function
|
|
6
|
+
ReactorOptions
|
|
7
|
+
], Promise<SwitchboardReactor>>;
|
|
8
|
+
export declare function switchboardCommand(program: Command): void;
|
|
9
9
|
//# sourceMappingURL=switchboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard.d.ts","sourceRoot":"","sources":["../../../src/commands/switchboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"switchboard.d.ts","sourceRoot":"","sources":["../../../src/commands/switchboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAwBrD,eAAO,MAAM,WAAW,EAAE,iBAAiB,CACzC;IAAC,cAAc;CAAC,EAChB,OAAO,CAAC,kBAAkB,CAAC,CAG5B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,QA4BlD"}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { switchboardHelp } from "../help.js";
|
|
2
2
|
import { setCustomHelp } from "../utils.js";
|
|
3
3
|
async function startLocalSwitchboard(options) {
|
|
4
|
+
console.log("Starting switchboard", options);
|
|
5
|
+
if (options.basePath) {
|
|
6
|
+
console.log(`Setting BASE_PATH to ${options.basePath}`);
|
|
7
|
+
process.env.BASE_PATH = options.basePath;
|
|
8
|
+
}
|
|
4
9
|
const Switchboard = await import("../services/switchboard.js");
|
|
5
|
-
const {
|
|
6
|
-
return
|
|
10
|
+
const { startSwitchboard } = Switchboard;
|
|
11
|
+
return startSwitchboard({
|
|
12
|
+
...options,
|
|
13
|
+
port: typeof options.port === "string" ? parseInt(options.port) : options.port,
|
|
14
|
+
});
|
|
7
15
|
}
|
|
8
16
|
export const switchboard = async (options) => {
|
|
9
|
-
return startLocalSwitchboard(options);
|
|
17
|
+
return await startLocalSwitchboard(options);
|
|
10
18
|
};
|
|
11
|
-
export function
|
|
19
|
+
export function switchboardCommand(program) {
|
|
12
20
|
const command = program
|
|
13
21
|
.command("switchboard")
|
|
14
|
-
.alias("reactor")
|
|
15
22
|
.description("Starts local switchboard")
|
|
16
23
|
.option("--port <PORT>", "port to host the api", "4001")
|
|
17
24
|
.option("--config-file <configFile>", "Path to the powerhouse.config.js file", "./powerhouse.config.json")
|
|
@@ -19,21 +26,20 @@ export function reactorCommand(program) {
|
|
|
19
26
|
.option("--db-path <DB_PATH>", "path to the database")
|
|
20
27
|
.option("--https-key-file <HTTPS_KEY_FILE>", "path to the ssl key file")
|
|
21
28
|
.option("--https-cert-file <HTTPS_CERT_FILE>", "path to the ssl cert file")
|
|
22
|
-
.option("-w, --watch", "if the reactor should watch for local changes to document models and processors")
|
|
23
29
|
.option("--packages <packages...>", "list of packages to be loaded, if defined then packages on config file are ignored")
|
|
30
|
+
.option("--base-path <basePath>", "base path for the API endpoints (sets the BASE_PATH environment variable)")
|
|
24
31
|
.action(async (...args) => {
|
|
25
|
-
await switchboard(...args);
|
|
32
|
+
const { defaultDriveUrl } = await switchboard(...args);
|
|
33
|
+
console.log(" ➜ Switchboard:", defaultDriveUrl);
|
|
26
34
|
});
|
|
27
35
|
setCustomHelp(command, switchboardHelp);
|
|
28
36
|
}
|
|
29
37
|
if (process.argv.at(2) === "spawn") {
|
|
30
38
|
const optionsArg = process.argv.at(3);
|
|
31
|
-
const options = optionsArg
|
|
32
|
-
? JSON.parse(optionsArg)
|
|
33
|
-
: {};
|
|
39
|
+
const options = optionsArg ? JSON.parse(optionsArg) : {};
|
|
34
40
|
startLocalSwitchboard(options)
|
|
35
|
-
.then((
|
|
36
|
-
process.send?.(`driveUrl:${
|
|
41
|
+
.then((reactor) => {
|
|
42
|
+
process.send?.(`driveUrl:${reactor.defaultDriveUrl}`);
|
|
37
43
|
})
|
|
38
44
|
.catch((e) => {
|
|
39
45
|
throw e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard.js","sourceRoot":"","sources":["../../../src/commands/switchboard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"switchboard.js","sourceRoot":"","sources":["../../../src/commands/switchboard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAM5C,KAAK,UAAU,qBAAqB,CAAC,OAA2B;IAC9D,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC7C,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,wBAAwB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;IAC3C,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAC/D,MAAM,EAAE,gBAAgB,EAAE,GAAG,WAAW,CAAC;IAEzC,OAAO,gBAAgB,CAAC;QACtB,GAAG,OAAO;QACV,IAAI,EACF,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI;KAC3E,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAGpB,KAAK,EAAE,OAAO,EAAE,EAAE;IACpB,OAAO,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,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 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/commands/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAGL,KAAK,cAAc,EAKpB,MAAM,aAAa,CAAC;AAErB,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,MAAM,EAAE,EACtB,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,OAAO,QAuBpB;AAED,eAAO,MAAM,SAAS,EAAE,iBAAiB,CACvC;IACE,MAAM,EAAE,GAAG,SAAS;IACpB;QACE,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;CACF,
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/commands/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAGL,KAAK,cAAc,EAKpB,MAAM,aAAa,CAAC;AAErB,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,MAAM,EAAE,EACtB,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,OAAO,QAuBpB;AAED,eAAO,MAAM,SAAS,EAAE,iBAAiB,CACvC;IACE,MAAM,EAAE,GAAG,SAAS;IACpB;QACE,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;CACF,CA8EF,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAmBhD"}
|
|
@@ -24,6 +24,15 @@ export const uninstall = (dependencies, options) => {
|
|
|
24
24
|
if (!dependencies || dependencies.length === 0) {
|
|
25
25
|
throw new Error("❌ Dependency name is required");
|
|
26
26
|
}
|
|
27
|
+
// Adapt dependencies to the format expected by updateConfigFile
|
|
28
|
+
const parsedDependencies = dependencies.map((dep) => ({
|
|
29
|
+
name: dep,
|
|
30
|
+
version: undefined,
|
|
31
|
+
full: dep,
|
|
32
|
+
}));
|
|
33
|
+
if (options.debug) {
|
|
34
|
+
console.log(">>> parsedDependencies", parsedDependencies);
|
|
35
|
+
}
|
|
27
36
|
if (options.packageManager &&
|
|
28
37
|
!SUPPORTED_PACKAGE_MANAGERS.includes(options.packageManager)) {
|
|
29
38
|
throw new Error("❌ Unsupported package manager. Supported package managers: npm, yarn, pnpm, bun");
|
|
@@ -59,7 +68,7 @@ export const uninstall = (dependencies, options) => {
|
|
|
59
68
|
}
|
|
60
69
|
try {
|
|
61
70
|
console.log("⚙️ Updating powerhouse config file...");
|
|
62
|
-
updateConfigFile(
|
|
71
|
+
updateConfigFile(parsedDependencies, projectInfo.path, "uninstall");
|
|
63
72
|
console.log("Config file updated successfully 🎉");
|
|
64
73
|
}
|
|
65
74
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../src/commands/uninstall.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,6BAA6B,EAC7B,cAAc,EAEd,eAAe,EACf,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,MAAM,U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C,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAChD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,WAAW,CAAC;SACpB,KAAK,CAAC,QAAQ,CAAC;SACf,WAAW,CAAC,mCAAmC,CAAC;SAChD,QAAQ,CAAC,mBAAmB,EAAE,qCAAqC,CAAC;SACpE,MAAM,CAAC,cAAc,EAAE,gCAAgC,CAAC;SACxD,MAAM,CAAC,SAAS,EAAE,sBAAsB,CAAC;SACzC,MAAM,CACL,iBAAiB,EACjB,2EAA2E,CAC5E;SACA,MAAM,CACL,oCAAoC,EACpC,8BAA8B,CAC/B;SACA,MAAM,CAAC,SAAS,CAAC,CAAC;IAErB,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/src/help.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Help text for the connect command
|
|
2
|
+
* Help text for the connect studio command
|
|
3
3
|
*/
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const connectStudioHelp = "\nCommand Overview:\n The connect command starts the Connect Studio, a development environment for building\n and testing Powerhouse applications. It provides a visual interface for working with \n your project.\n\n This command:\n 1. Starts a local Connect Studio server\n 2. Provides a web interface for development\n 3. Allows you to interact with your project components\n 4. Supports various configuration options for customization\n\nOptions:\n -p, --port <port> Port to run the server on. Default is 3000.\n \n -h, --host Expose the server to the network. By default, the server\n only accepts connections from localhost.\n \n --https Enable HTTPS for secure connections. You may need to provide\n certificate files for this option to work properly.\n \n --open Automatically open the browser window after starting the server.\n \n --config-file <path> Path to the powerhouse.config.js file. This allows you to\n customize the behavior of Connect Studio.\n\nExamples:\n $ ph connect # Start Connect Studio on default port 3000\n $ ph connect -p 8080 # Start on port 8080\n $ ph connect -h # Expose to network (not just localhost)\n $ ph connect --https # Enable HTTPS\n $ ph connect --open # Open browser automatically\n $ ph connect --config-file custom.config.js # Use custom configuration\n $ ph connect -p 8080 --open # Start on port 8080 and open browser\n";
|
|
5
|
+
/**
|
|
6
|
+
* Help text for the connect build command
|
|
7
|
+
*/
|
|
8
|
+
export declare const connectBuildHelp = "\nCommand Overview:\n The Connect build command creates a connect build with the project's local and external packages included.\n\nOptions:\n --project-root <path> The root directory of the project. Default is \"process.cwd()\".\n --assets-dir-name <name> The name of the assets directory. Default is \"assets\".\n --external-packages-file-name <name> The name of the external packages file. Default is \"external-packages.js\".\n --styles-file-name <name> The name of the styles file. Default is \"style.css\".\n --connect-path <path> The path to the Connect dist directory. Calls \"resolveConnect()\" if not provided.\n";
|
|
9
|
+
/**
|
|
10
|
+
* Help text for the connect preview command
|
|
11
|
+
*/
|
|
12
|
+
export declare const connectPreviewHelp = "\nCommand Overview:\n The Connect preview command previews a built Connect project.\n NOTE: You must run `ph connect build` first.\n\nOptions:\n --project-root <path> The root directory of the project. Default is \"process.cwd()\".\n --port <port> The port to run the server on. Default is 4173.\n --open Open the browser. Default is true.\n";
|
|
5
13
|
/**
|
|
6
14
|
* Help text for the generate command
|
|
7
15
|
*/
|
|
@@ -33,7 +41,11 @@ export declare const serviceHelp = "\nCommand Overview:\n The service command m
|
|
|
33
41
|
/**
|
|
34
42
|
* Help text for the switchboard command
|
|
35
43
|
*/
|
|
36
|
-
export declare const switchboardHelp = "\nCommand Overview:\n The switchboard command
|
|
44
|
+
export declare const switchboardHelp = "\nCommand Overview:\n The switchboard command starts a local Switchboard instance, which acts as the document\n processing engine for Powerhouse projects. It provides the infrastructure for document\n models, processors, and real-time updates.\n\n This command:\n 1. Starts a local switchboard server\n 2. Loads document models and processors\n 3. Provides an API for document operations\n 4. Enables real-time document processing\n\nOptions:\n --port <PORT> Port to host the API. Default is 4001.\n \n --config-file <path> Path to the powerhouse.config.js file. Default is \n './powerhouse.config.json'. This configures the switchboard behavior.\n \n --db-path <DB_PATH> Path to the database for storing document data.\n \n --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.\n \n --https-cert-file <path> Path to the SSL certificate file if using HTTPS.\n \n --packages <pkg...> List of packages to be loaded. If defined, packages specified\n in the config file are ignored.\n \n --base-path <path> Base path for the API endpoints. Sets the BASE_PATH environment \n variable used by the server to prefix all routes.\n\nExamples:\n $ ph switchboard # Start switchboard with default settings\n $ ph switchboard --port 5000 # Use custom port 5000\n $ ph switchboard --config-file custom.json # Use custom configuration file\n $ ph switchboard --packages pkg1 pkg2 # Load specific packages\n $ ph switchboard --base-path /switchboard # Set API base path to /switchboard\n";
|
|
45
|
+
/**
|
|
46
|
+
* Help text for the reactor command
|
|
47
|
+
*/
|
|
48
|
+
export declare const reactorHelp = "\nCommand Overview:\n The reactor command starts a local Switchboard instance,\n which acts as the document processing engine for Powerhouse projects. It provides\n the infrastructure for document models, processors, and real-time updates.\n\n This command:\n 1. Starts a local reactor server\n 2. Loads document models and processors\n 3. Provides an API for document operations\n 4. Supports real-time updates and code generation\n\nOptions:\n --port <PORT> Port to host the API. Default is 4001.\n \n --config-file <path> Path to the powerhouse.config.js file. Default is \n './powerhouse.config.json'. This configures the reactor behavior.\n \n --generate Generate code automatically when document models are updated.\n \n --db-path <DB_PATH> Path to the database for storing document data.\n \n --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.\n \n --https-cert-file <path> Path to the SSL certificate file if using HTTPS.\n \n -w, --watch Watch for local changes to document models and processors,\n and automatically update the reactor accordingly.\n \n --packages <pkg...> List of packages to be loaded. If defined, packages specified\n in the config file are ignored.\n\nExamples:\n $ ph reactor # Start reactor with default settings\n $ ph reactor --port 5000 # Use custom port 5000\n $ ph reactor --generate # Enable auto code generation\n $ ph reactor --watch # Watch for local file changes\n $ ph reactor --config-file custom.json # Use custom configuration file\n $ ph reactor --packages pkg1 pkg2 # Load specific packages\n";
|
|
37
49
|
/**
|
|
38
50
|
* Help text for the version command
|
|
39
51
|
*/
|
package/dist/src/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,itDAkC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,2nBAU5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,yXAS9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,kpGA0DxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+jEAsCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,4pEAwCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,ypCA2BpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,m7DAoCnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,miDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+mEAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,ixDAoC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,s6DAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,2kCA0BvB,CAAC"}
|