@powerhousedao/ph-cli 4.1.0-dev.12 → 4.1.0-dev.120
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 +21 -4
- package/dist/src/cli.js +14 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/connect.d.ts +17 -6
- package/dist/src/commands/connect.d.ts.map +1 -1
- package/dist/src/commands/connect.js +56 -36
- package/dist/src/commands/connect.js.map +1 -1
- package/dist/src/commands/generate.d.ts +4 -4
- package/dist/src/commands/generate.d.ts.map +1 -1
- package/dist/src/commands/generate.js +6 -3
- package/dist/src/commands/generate.js.map +1 -1
- package/dist/src/commands/help.d.ts +1 -1
- package/dist/src/commands/help.d.ts.map +1 -1
- package/dist/src/commands/index.d.ts +11 -4
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +11 -29
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/inspect.d.ts +3 -3
- package/dist/src/commands/inspect.d.ts.map +1 -1
- package/dist/src/commands/install.d.ts +2 -3
- package/dist/src/commands/install.d.ts.map +1 -1
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/list.d.ts +2 -2
- package/dist/src/commands/list.d.ts.map +1 -1
- package/dist/src/commands/list.js +1 -1
- package/dist/src/commands/list.js.map +1 -1
- package/dist/src/commands/migrate.d.ts +3 -0
- package/dist/src/commands/migrate.d.ts.map +1 -0
- package/dist/src/commands/migrate.js +8 -0
- package/dist/src/commands/migrate.js.map +1 -0
- package/dist/src/commands/register-commands.d.ts +5 -0
- package/dist/src/commands/register-commands.d.ts.map +1 -0
- package/dist/src/commands/register-commands.js +28 -0
- package/dist/src/commands/register-commands.js.map +1 -0
- package/dist/src/commands/service.d.ts +2 -2
- package/dist/src/commands/service.d.ts.map +1 -1
- package/dist/src/commands/service.js.map +1 -1
- package/dist/src/commands/switchboard.d.ts +6 -6
- package/dist/src/commands/switchboard.d.ts.map +1 -1
- package/dist/src/commands/switchboard.js +16 -7
- package/dist/src/commands/switchboard.js.map +1 -1
- package/dist/src/commands/uninstall.d.ts +3 -3
- package/dist/src/commands/uninstall.d.ts.map +1 -1
- package/dist/src/commands/uninstall.js.map +1 -1
- package/dist/src/commands/vetra.d.ts +4 -3
- package/dist/src/commands/vetra.d.ts.map +1 -1
- package/dist/src/commands/vetra.js +11 -6
- package/dist/src/commands/vetra.js.map +1 -1
- package/dist/src/help.d.ts +6 -6
- package/dist/src/help.d.ts.map +1 -1
- package/dist/src/help.js +131 -61
- package/dist/src/help.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/services/connect.d.ts +1 -3
- package/dist/src/services/connect.d.ts.map +1 -1
- package/dist/src/services/connect.js +1 -15
- package/dist/src/services/connect.js.map +1 -1
- package/dist/src/services/generate.d.ts +8 -0
- package/dist/src/services/generate.d.ts.map +1 -1
- package/dist/src/services/generate.js +25 -4
- package/dist/src/services/generate.js.map +1 -1
- package/dist/src/services/migrate/migrate.d.ts +3 -0
- package/dist/src/services/migrate/migrate.d.ts.map +1 -0
- package/dist/src/services/migrate/migrate.js +282 -0
- package/dist/src/services/migrate/migrate.js.map +1 -0
- package/dist/src/services/migrate/migrations/templates/document-models.d.ts +2 -0
- package/dist/src/services/migrate/migrations/templates/document-models.d.ts.map +1 -0
- package/dist/src/services/migrate/migrations/templates/document-models.js +6 -0
- package/dist/src/services/migrate/migrations/templates/document-models.js.map +1 -0
- package/dist/src/services/migrate/migrations/templates/editors.d.ts +2 -0
- package/dist/src/services/migrate/migrations/templates/editors.d.ts.map +1 -0
- package/dist/src/services/migrate/migrations/templates/editors.js +6 -0
- package/dist/src/services/migrate/migrations/templates/editors.js.map +1 -0
- package/dist/src/services/migrate/migrations/templates/index.d.ts +2 -0
- package/dist/src/services/migrate/migrations/templates/index.d.ts.map +1 -0
- package/dist/src/services/migrate/migrations/templates/index.js +7 -0
- package/dist/src/services/migrate/migrations/templates/index.js.map +1 -0
- package/dist/src/services/migrate/migrations/templates/packageJson.d.ts +55 -0
- package/dist/src/services/migrate/migrations/templates/packageJson.d.ts.map +1 -0
- package/dist/src/services/migrate/migrations/templates/packageJson.js +55 -0
- package/dist/src/services/migrate/migrations/templates/packageJson.js.map +1 -0
- package/dist/src/services/migrate/migrations/templates/tsConfig.d.ts +2 -0
- package/dist/src/services/migrate/migrations/templates/tsConfig.d.ts.map +1 -0
- package/dist/src/services/migrate/migrations/templates/tsConfig.js +45 -0
- package/dist/src/services/migrate/migrations/templates/tsConfig.js.map +1 -0
- package/dist/src/services/switchboard.d.ts +37 -2
- package/dist/src/services/switchboard.d.ts.map +1 -1
- package/dist/src/services/switchboard.js +46 -8
- package/dist/src/services/switchboard.js.map +1 -1
- package/dist/src/services/vetra.d.ts +4 -6
- package/dist/src/services/vetra.d.ts.map +1 -1
- package/dist/src/services/vetra.js +128 -166
- package/dist/src/services/vetra.js.map +1 -1
- package/dist/src/utils/configure-vetra-github-url.d.ts +12 -0
- package/dist/src/utils/configure-vetra-github-url.d.ts.map +1 -0
- package/dist/src/utils/configure-vetra-github-url.js +230 -0
- package/dist/src/utils/configure-vetra-github-url.js.map +1 -0
- package/dist/src/utils.d.ts +11 -4
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +18 -14
- 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/test/utils.test.d.ts +2 -0
- package/dist/test/utils.test.d.ts.map +1 -0
- package/dist/test/utils.test.js +132 -0
- package/dist/test/utils.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +19 -21
- package/dist/package.json +0 -58
- package/dist/src/commands/dev.d.ts +0 -6
- package/dist/src/commands/dev.d.ts.map +0 -1
- package/dist/src/commands/dev.js +0 -25
- package/dist/src/commands/dev.js.map +0 -1
- package/dist/src/commands/reactor.d.ts +0 -9
- package/dist/src/commands/reactor.d.ts.map +0 -1
- package/dist/src/commands/reactor.js +0 -42
- package/dist/src/commands/reactor.js.map +0 -1
- package/dist/src/services/dev.d.ts +0 -10
- package/dist/src/services/dev.d.ts.map +0 -1
- package/dist/src/services/dev.js +0 -75
- package/dist/src/services/dev.js.map +0 -1
- package/dist/src/services/reactor.d.ts +0 -35
- package/dist/src/services/reactor.d.ts.map +0 -1
- package/dist/src/services/reactor.js +0 -92
- package/dist/src/services/reactor.js.map +0 -1
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/ph-cli",
|
|
3
|
-
"version": "4.1.0-dev.
|
|
3
|
+
"version": "4.1.0-dev.120",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -17,41 +17,39 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
|
+
"exports": "./dist/src/index.js",
|
|
21
|
+
"types": "./dist/src/index.d.ts",
|
|
20
22
|
"keywords": [],
|
|
21
23
|
"author": "",
|
|
22
24
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^
|
|
25
|
+
"@types/node": "^24.6.1",
|
|
24
26
|
"concurrently": "^9.1.2",
|
|
25
27
|
"copyfiles": "^2.4.1",
|
|
26
28
|
"nodemon": "^3.1.9",
|
|
27
|
-
"vitest": "^3.
|
|
29
|
+
"vitest": "^3.2.4",
|
|
30
|
+
"document-drive": "4.1.0-dev.120",
|
|
31
|
+
"document-model": "4.1.0-dev.120"
|
|
28
32
|
},
|
|
29
33
|
"dependencies": {
|
|
30
34
|
"colorette": "^2.0.20",
|
|
31
35
|
"commander": "^12.1.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"@powerhousedao/
|
|
36
|
-
"@powerhousedao/
|
|
37
|
-
"@powerhousedao/
|
|
38
|
-
"@powerhousedao/
|
|
39
|
-
"
|
|
40
|
-
"document-model": "4.1.0-dev.12"
|
|
36
|
+
"read-pkg": "^9.0.1",
|
|
37
|
+
"ts-morph": "^26.0.0",
|
|
38
|
+
"write-pkg": "^7.0.0",
|
|
39
|
+
"@powerhousedao/builder-tools": "4.1.0-dev.120",
|
|
40
|
+
"@powerhousedao/config": "4.1.0-dev.120",
|
|
41
|
+
"@powerhousedao/codegen": "4.1.0-dev.120",
|
|
42
|
+
"@powerhousedao/common": "4.1.0-dev.120",
|
|
43
|
+
"@powerhousedao/switchboard": "4.1.0-dev.120"
|
|
41
44
|
},
|
|
42
45
|
"scripts": {
|
|
46
|
+
"tsc": "tsc",
|
|
47
|
+
"lint": "eslint",
|
|
43
48
|
"generate-commands-md": "tsx scripts/generate-commands-md.ts",
|
|
44
49
|
"generate-version": "tsx scripts/generate-version.ts",
|
|
45
|
-
"
|
|
46
|
-
"postbuild": "npm run copy-scripts",
|
|
50
|
+
"build": "npm run generate-commands-md && npm run generate-version && tsc && npm run copy-scripts",
|
|
47
51
|
"copy-scripts": "copyfiles scripts/* dist/",
|
|
48
|
-
"
|
|
49
|
-
"dev": "concurrently -P 'pnpm -w run build:tsc --watch' 'nodemon --watch \"../..\" -e ts,tsx,js,json dist/src/cli.js -- {@}' --",
|
|
50
|
-
"lint": "eslint .",
|
|
51
|
-
"lint:nx": "eslint . --fix --quiet",
|
|
52
|
-
"lint:fix": "eslint --fix",
|
|
53
|
-
"clean": "rimraf dist",
|
|
54
|
-
"clean:node_modules": "rimraf node_modules",
|
|
52
|
+
"dev": "concurrently -P 'pnpm -w run tsc --watch' 'nodemon --watch \"../..\" -e ts,tsx,js,json dist/src/cli.js -- {@}' --",
|
|
55
53
|
"test": "vitest --run"
|
|
56
54
|
}
|
|
57
55
|
}
|
package/dist/package.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@powerhousedao/ph-cli",
|
|
3
|
-
"version": "4.1.0-dev.12",
|
|
4
|
-
"description": "",
|
|
5
|
-
"license": "AGPL-3.0-only",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/powerhouse-inc/powerhouse"
|
|
10
|
-
},
|
|
11
|
-
"publishConfig": {
|
|
12
|
-
"access": "public"
|
|
13
|
-
},
|
|
14
|
-
"bin": {
|
|
15
|
-
"ph-cli": "dist/src/cli.js"
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"generate-commands-md": "tsx scripts/generate-commands-md.ts",
|
|
22
|
-
"generate-version": "tsx scripts/generate-version.ts",
|
|
23
|
-
"prebuild": "npm run clean && npm run generate-commands-md && npm run generate-version",
|
|
24
|
-
"postbuild": "npm run copy-scripts",
|
|
25
|
-
"copy-scripts": "copyfiles scripts/* dist/",
|
|
26
|
-
"build": "tsc --build",
|
|
27
|
-
"dev": "concurrently -P 'pnpm -w run build:tsc --watch' 'nodemon --watch \"../..\" -e ts,tsx,js,json dist/src/cli.js -- {@}' --",
|
|
28
|
-
"prepublishOnly": "npm run build",
|
|
29
|
-
"lint": "eslint .",
|
|
30
|
-
"lint:nx": "eslint . --fix --quiet",
|
|
31
|
-
"lint:fix": "eslint --fix",
|
|
32
|
-
"clean": "rimraf dist",
|
|
33
|
-
"clean:node_modules": "rimraf node_modules",
|
|
34
|
-
"test": "vitest --run"
|
|
35
|
-
},
|
|
36
|
-
"keywords": [],
|
|
37
|
-
"author": "",
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@types/node": "^22.15.17",
|
|
40
|
-
"concurrently": "^9.1.2",
|
|
41
|
-
"copyfiles": "^2.4.1",
|
|
42
|
-
"nodemon": "^3.1.9",
|
|
43
|
-
"vitest": "^3.1.2"
|
|
44
|
-
},
|
|
45
|
-
"dependencies": {
|
|
46
|
-
"@powerhousedao/builder-tools": "workspace:*",
|
|
47
|
-
"@powerhousedao/codegen": "workspace:*",
|
|
48
|
-
"@powerhousedao/config": "workspace:*",
|
|
49
|
-
"@powerhousedao/connect": "workspace:*",
|
|
50
|
-
"@powerhousedao/reactor-local": "workspace:*",
|
|
51
|
-
"@powerhousedao/switchboard": "workspace:*",
|
|
52
|
-
"colorette": "^2.0.20",
|
|
53
|
-
"commander": "^12.1.0",
|
|
54
|
-
"document-drive": "workspace:*",
|
|
55
|
-
"document-model": "workspace:*",
|
|
56
|
-
"pm2": "^5.4.3"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type Command } from "commander";
|
|
2
|
-
import { type DevOptions } from "../services/dev.js";
|
|
3
|
-
import { type CommandActionType } from "../types.js";
|
|
4
|
-
export declare const dev: CommandActionType<[DevOptions]>;
|
|
5
|
-
export declare function devCommand(program: Command): void;
|
|
6
|
-
//# sourceMappingURL=dev.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD,eAAO,MAAM,GAAG,EAAE,iBAAiB,CAAC,CAAC,UAAU,CAAC,CAE/C,CAAC;AAEF,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,QAqB1C"}
|
package/dist/src/commands/dev.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { devHelp } from "../help.js";
|
|
2
|
-
import { setCustomHelp } from "../utils.js";
|
|
3
|
-
async function startDev(options) {
|
|
4
|
-
const Dev = await import("../services/dev.js");
|
|
5
|
-
const { startDev } = Dev;
|
|
6
|
-
return startDev(options);
|
|
7
|
-
}
|
|
8
|
-
export const dev = async (options) => {
|
|
9
|
-
return startDev(options);
|
|
10
|
-
};
|
|
11
|
-
export function devCommand(program) {
|
|
12
|
-
const cmd = program
|
|
13
|
-
.command("dev")
|
|
14
|
-
.description("Starts dev environment")
|
|
15
|
-
.option("--generate", "generate code when document model is updated")
|
|
16
|
-
.option("--switchboard-port <port>", "port to use for the switchboard")
|
|
17
|
-
.option("--https-key-file <HTTPS_KEY_FILE>", "path to the ssl key file")
|
|
18
|
-
.option("--https-cert-file <HTTPS_CERT_FILE>", "path to the ssl cert file")
|
|
19
|
-
.option("--config-file <configFile>", "Path to the powerhouse.config.js file")
|
|
20
|
-
.option("-w, --watch", "if the switchboard should watch for local changes to document models and processors");
|
|
21
|
-
// Use the setCustomHelp utility to apply custom help formatting
|
|
22
|
-
setCustomHelp(cmd, devHelp);
|
|
23
|
-
cmd.action(dev);
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=dev.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/commands/dev.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,KAAK,UAAU,QAAQ,CAAC,OAAmB;IACzC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC/C,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;IACzB,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,MAAM,GAAG,GAAoC,KAAK,EAAE,OAAO,EAAE,EAAE;IACpE,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,YAAY,EAAE,8CAA8C,CAAC;SACpE,MAAM,CAAC,2BAA2B,EAAE,iCAAiC,CAAC;SACtE,MAAM,CAAC,mCAAmC,EAAE,0BAA0B,CAAC;SACvE,MAAM,CAAC,qCAAqC,EAAE,2BAA2B,CAAC;SAC1E,MAAM,CACL,4BAA4B,EAC5B,uCAAuC,CACxC;SACA,MAAM,CACL,aAAa,EACb,qFAAqF,CACtF,CAAC;IAEJ,gEAAgE;IAChE,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE5B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,QAoC9C"}
|
|
@@ -1,42 +0,0 @@
|
|
|
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("--disable-default-drive", "disable automatic creation of the default 'powerhouse' drive")
|
|
23
|
-
.option("--packages <packages...>", "list of packages to be loaded, if defined then packages on config file are ignored")
|
|
24
|
-
.option("--remote-drives <urls>", "comma-separated remote drive URLs")
|
|
25
|
-
.option("--remote-drives-config <configFile>", "path to JSON file containing remote drive configurations")
|
|
26
|
-
.action(async (...args) => {
|
|
27
|
-
await switchboard(...args);
|
|
28
|
-
});
|
|
29
|
-
setCustomHelp(command, reactorHelp);
|
|
30
|
-
}
|
|
31
|
-
if (process.argv.at(2) === "spawn") {
|
|
32
|
-
const optionsArg = process.argv.at(3);
|
|
33
|
-
const options = optionsArg ? JSON.parse(optionsArg) : {};
|
|
34
|
-
startLocalSwitchboard(options)
|
|
35
|
-
.then((reactor) => {
|
|
36
|
-
process.send?.(`reactorUrl:${reactor.driveUrl}`);
|
|
37
|
-
})
|
|
38
|
-
.catch((e) => {
|
|
39
|
-
throw e;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=reactor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,yBAAyB,EACzB,8DAA8D,CAC/D;SACA,MAAM,CACL,0BAA0B,EAC1B,oFAAoF,CACrF;SACA,MAAM,CAAC,wBAAwB,EAAE,mCAAmC,CAAC;SACrE,MAAM,CACL,qCAAqC,EACrC,0DAA0D,CAC3D;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,OAAO,EAAE,EAAE;QAChB,OAAO,CAAC,IAAI,EAAE,CAAC,cAAc,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACpB,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type DevOptions = {
|
|
2
|
-
generate?: boolean;
|
|
3
|
-
watch?: boolean;
|
|
4
|
-
switchboardPort?: number;
|
|
5
|
-
configFile?: string;
|
|
6
|
-
httpsKeyFile?: string;
|
|
7
|
-
httpsCertFile?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function startDev({ generate, watch, switchboardPort, configFile, }: DevOptions): Promise<void>;
|
|
10
|
-
//# sourceMappingURL=dev.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/services/dev.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AA0EF,wBAAsB,QAAQ,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,eAA4C,EAC5C,UAAU,GACX,EAAE,UAAU,iBAcZ"}
|
package/dist/src/services/dev.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { blue, green, red } from "colorette";
|
|
2
|
-
import { fork } from "node:child_process";
|
|
3
|
-
import path, { dirname } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { getConfig } from "../utils.js";
|
|
6
|
-
import { DefaultReactorOptions } from "./reactor.js";
|
|
7
|
-
const __dirname = import.meta.dirname || dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
function spawnLocalSwitchboard(options) {
|
|
9
|
-
const child = fork(path.join(dirname(__dirname), "commands", "switchboard.js"), ["spawn", JSON.stringify(options)], { silent: true });
|
|
10
|
-
return new Promise((resolve) => {
|
|
11
|
-
child.on("message", (message) => {
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
13
|
-
const text = message.toString();
|
|
14
|
-
if (text.startsWith("driveUrl:")) {
|
|
15
|
-
const driveUrl = text.substring("driveUrl:".length);
|
|
16
|
-
resolve({ driveUrl });
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
child.stdout.on("data", (data) => {
|
|
20
|
-
const message = data.toString();
|
|
21
|
-
const lines = message.split("\n").filter((line) => line.trim().length);
|
|
22
|
-
for (const line of lines) {
|
|
23
|
-
process.stdout.write(blue(`[Switchboard]: ${line}\n`));
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
child.stderr.on("error", (data) => {
|
|
27
|
-
process.stderr.write(red(`[Switchboard]: ${data.toString()}`));
|
|
28
|
-
});
|
|
29
|
-
child.on("error", (err) => {
|
|
30
|
-
process.stderr.write(red(`[Switchboard]: ${err}`));
|
|
31
|
-
});
|
|
32
|
-
child.on("exit", (code) => {
|
|
33
|
-
console.log(`Switchboard process exited with code ${code}`);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async function spawnConnect(options, localReactorUrl) {
|
|
38
|
-
const child = fork(path.join(dirname(__dirname), "commands", "connect.js"), ["spawn", JSON.stringify(options ?? {})], {
|
|
39
|
-
silent: true,
|
|
40
|
-
env: {
|
|
41
|
-
...process.env,
|
|
42
|
-
// TODO add studio variables?
|
|
43
|
-
PH_CONNECT_DEFAULT_DRIVES_URL: localReactorUrl,
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
return new Promise((resolve) => {
|
|
47
|
-
child.stdout.on("data", (data) => {
|
|
48
|
-
resolve();
|
|
49
|
-
process.stdout.write(green(`[Connect]: ${data.toString()}`));
|
|
50
|
-
});
|
|
51
|
-
child.stderr.on("data", (data) => {
|
|
52
|
-
process.stderr.write(red(`[Connect]: ${data.toString()}`));
|
|
53
|
-
});
|
|
54
|
-
child.on("close", (code) => {
|
|
55
|
-
console.log(`Connect process exited with code ${code}`);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
export async function startDev({ generate, watch, switchboardPort = DefaultReactorOptions.port, configFile, }) {
|
|
60
|
-
try {
|
|
61
|
-
const baseConfig = getConfig(configFile);
|
|
62
|
-
const https = baseConfig.reactor?.https;
|
|
63
|
-
const { driveUrl } = await spawnLocalSwitchboard({
|
|
64
|
-
generate,
|
|
65
|
-
port: switchboardPort,
|
|
66
|
-
watch,
|
|
67
|
-
https,
|
|
68
|
-
});
|
|
69
|
-
await spawnConnect({ configFile }, driveUrl);
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
console.error(error);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=dev.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/services/dev.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAuC,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAuB,MAAM,cAAc,CAAC;AAE1E,MAAM,SAAS,GACb,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAWjE,SAAS,qBAAqB,CAAC,OAAwB;IACrD,MAAM,KAAK,GAAG,IAAI,CAChB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAC3D,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAClC,EAAE,MAAM,EAAE,IAAI,EAAE,CACiB,CAAC;IAEpC,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,EAAE;QACnD,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,gEAAgE;YAChE,MAAM,I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ACL,eAAe,GAAG,qBAAqB,CAAC,IAAI,EAC5C,UAAU,GACC;IACX,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC;QACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,qBAAqB,CAAC;YAC/C,QAAQ;YACR,IAAI,EAAE,eAAe;YACrB,KAAK;YACL,KAAK;SACN,CAAC,CAAC;QACH,MAAM,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type LocalReactor, type StartServerOptions } from "@powerhousedao/reactor-local";
|
|
2
|
-
export type ReactorOptions = StartServerOptions & {
|
|
3
|
-
configFile?: string;
|
|
4
|
-
generate?: boolean;
|
|
5
|
-
watch?: boolean;
|
|
6
|
-
dbPath?: string;
|
|
7
|
-
disableDefaultDrive?: boolean;
|
|
8
|
-
remoteDrives?: string;
|
|
9
|
-
remoteDrivesConfig?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const DefaultReactorOptions: {
|
|
12
|
-
dev: boolean;
|
|
13
|
-
port: number;
|
|
14
|
-
storage: {
|
|
15
|
-
type: "filesystem";
|
|
16
|
-
filesystemPath: string;
|
|
17
|
-
};
|
|
18
|
-
dbPath: string;
|
|
19
|
-
drive: {
|
|
20
|
-
id: string;
|
|
21
|
-
slug: string;
|
|
22
|
-
global: {
|
|
23
|
-
name: string;
|
|
24
|
-
icon: string;
|
|
25
|
-
};
|
|
26
|
-
local: {
|
|
27
|
-
availableOffline: true;
|
|
28
|
-
listeners: never[];
|
|
29
|
-
sharingType: string;
|
|
30
|
-
triggers: never[];
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export declare function startLocalReactor(reactorOptions: ReactorOptions): Promise<LocalReactor>;
|
|
35
|
-
//# sourceMappingURL=reactor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactor.d.ts","sourceRoot":"","sources":["../../../src/services/reactor.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAC;AAUtC,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;CAGjC,CAAC;AAgCF,wBAAsB,iBAAiB,CAAC,cAAc,EAAE,cAAc,yBA2BrE"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { generateFromFile } from "@powerhousedao/codegen";
|
|
2
|
-
import { getConfig } from "@powerhousedao/config/utils";
|
|
3
|
-
import { DefaultStartServerOptions, startServer, } from "@powerhousedao/reactor-local";
|
|
4
|
-
import { InternalTransmitter, } from "document-drive/server/listener/transmitter/internal";
|
|
5
|
-
import { readFileSync } from "node:fs";
|
|
6
|
-
export const DefaultReactorOptions = {
|
|
7
|
-
...DefaultStartServerOptions,
|
|
8
|
-
dev: true,
|
|
9
|
-
};
|
|
10
|
-
function parseRemoteDrives(remoteDrivesInput, configFile) {
|
|
11
|
-
let drives = [];
|
|
12
|
-
// Parse URLs from --remote-drives
|
|
13
|
-
if (remoteDrivesInput) {
|
|
14
|
-
drives = remoteDrivesInput
|
|
15
|
-
.split(",")
|
|
16
|
-
.map((url) => url.trim())
|
|
17
|
-
.filter((url) => url);
|
|
18
|
-
}
|
|
19
|
-
// Parse config file from --remote-drives-config
|
|
20
|
-
if (configFile) {
|
|
21
|
-
try {
|
|
22
|
-
const fileContent = readFileSync(configFile, "utf-8");
|
|
23
|
-
const configDrives = JSON.parse(fileContent);
|
|
24
|
-
drives = drives.concat(configDrives);
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
throw new Error(`Failed to read remote drives config file: ${error instanceof Error ? error.message : String(error)}`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return drives;
|
|
31
|
-
}
|
|
32
|
-
export async function startLocalReactor(reactorOptions) {
|
|
33
|
-
const baseConfig = getConfig(reactorOptions.configFile);
|
|
34
|
-
const options = {
|
|
35
|
-
...DefaultReactorOptions,
|
|
36
|
-
...reactorOptions,
|
|
37
|
-
};
|
|
38
|
-
const { https } = baseConfig.reactor ?? { https: false };
|
|
39
|
-
// Parse remote drives configuration
|
|
40
|
-
const remoteDrives = parseRemoteDrives(reactorOptions.remoteDrives, reactorOptions.remoteDrivesConfig);
|
|
41
|
-
const reactor = await startServer({
|
|
42
|
-
...options,
|
|
43
|
-
https,
|
|
44
|
-
logLevel: baseConfig.logLevel,
|
|
45
|
-
storage: baseConfig.reactor?.storage || options.storage,
|
|
46
|
-
remoteDrives,
|
|
47
|
-
});
|
|
48
|
-
if (options.generate) {
|
|
49
|
-
await addGenerateTransmitter(reactor, baseConfig);
|
|
50
|
-
}
|
|
51
|
-
return reactor;
|
|
52
|
-
}
|
|
53
|
-
// TODO: instead of doing this by hand, we should use the processor manager
|
|
54
|
-
async function addGenerateTransmitter(reactor, config) {
|
|
55
|
-
const processor = {
|
|
56
|
-
onStrands: async function (strands) {
|
|
57
|
-
const documentPaths = new Set();
|
|
58
|
-
for (const strand of strands) {
|
|
59
|
-
documentPaths.add(reactor.getDocumentPath(strand.driveId, strand.documentId));
|
|
60
|
-
}
|
|
61
|
-
for (const path of documentPaths) {
|
|
62
|
-
await generateFromFile(path, config);
|
|
63
|
-
}
|
|
64
|
-
return Promise.resolve();
|
|
65
|
-
},
|
|
66
|
-
onDisconnect: () => Promise.resolve(),
|
|
67
|
-
};
|
|
68
|
-
const listenerManager = reactor.server.listeners;
|
|
69
|
-
// todo: simplify
|
|
70
|
-
const listener = {
|
|
71
|
-
driveId: "powerhouse",
|
|
72
|
-
listenerId: "reactor-local-document-model-generator",
|
|
73
|
-
label: "reactor-local-document-model-generator",
|
|
74
|
-
filter: {
|
|
75
|
-
documentType: ["powerhouse/document-model"],
|
|
76
|
-
scope: ["global"],
|
|
77
|
-
branch: ["*"],
|
|
78
|
-
documentId: ["*"],
|
|
79
|
-
},
|
|
80
|
-
block: false,
|
|
81
|
-
system: false,
|
|
82
|
-
callInfo: {
|
|
83
|
-
data: "",
|
|
84
|
-
name: "reactor-local-document-model-generator",
|
|
85
|
-
transmitterType: "Internal",
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
const transmitter = new InternalTransmitter(reactor.server, processor);
|
|
89
|
-
listener.transmitter = transmitter;
|
|
90
|
-
await listenerManager.setListener(listener.driveId, listener);
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=reactor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactor.js","sourceRoot":"","sources":["../../../src/services/reactor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,WAAW,GAIZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,mBAAmB,GAEpB,MAAM,qDAAqD,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAYvC,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,yBAAy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