@powerhousedao/ph-cli 6.2.3-dev.5 → 6.2.3-dev.50
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/{auth-AR3VxAIk.mjs → auth-BFUq7CvE.mjs} +3 -3
- package/dist/{auth-AR3VxAIk.mjs.map → auth-BFUq7CvE.mjs.map} +1 -1
- package/dist/auth-CNhbN5UM.mjs +4 -0
- package/dist/build-Di0SwHGs.mjs +166 -0
- package/dist/build-Di0SwHGs.mjs.map +1 -0
- package/dist/build-Dk9HoX9_.mjs +4 -0
- package/dist/{cli-connect-override-D3hh4aH_.mjs → cli-connect-override-b4kKqgOZ.mjs} +62 -27
- package/dist/cli-connect-override-b4kKqgOZ.mjs.map +1 -0
- package/dist/cli.d.mts +2 -1
- package/dist/cli.mjs +304 -89
- package/dist/cli.mjs.map +1 -1
- package/dist/connect-build-CJhbzYPL.mjs +218 -0
- package/dist/connect-build-CJhbzYPL.mjs.map +1 -0
- package/dist/{connect-config-BWGiW3IB.mjs → connect-config-DGfPEeP8.mjs} +19 -12
- package/dist/connect-config-DGfPEeP8.mjs.map +1 -0
- package/dist/{connect-preview-D7ypzFDc.mjs → connect-preview-CzDqR-JN.mjs} +12 -8
- package/dist/{connect-preview-D7ypzFDc.mjs.map → connect-preview-CzDqR-JN.mjs.map} +1 -1
- package/dist/{connect-studio-D6rfWCNB.mjs → connect-studio-_-O1-oef.mjs} +15 -10
- package/dist/{connect-studio-D6rfWCNB.mjs.map → connect-studio-_-O1-oef.mjs.map} +1 -1
- package/dist/connect-studio-f3K1qPWd.mjs +4 -0
- package/dist/{generate-all-DrT4ZxHX.mjs → generate-all-CIwP-3aa.mjs} +3 -3
- package/dist/{generate-all-DrT4ZxHX.mjs.map → generate-all-CIwP-3aa.mjs.map} +1 -1
- package/dist/{generate-app-DNNqA-H3.mjs → generate-app-BTs1u-9l.mjs} +7 -5
- package/dist/{generate-app-DNNqA-H3.mjs.map → generate-app-BTs1u-9l.mjs.map} +1 -1
- package/dist/{generate-document-model-BJXyODfm.mjs → generate-document-model-DhDQ_06X.mjs} +17 -7
- package/dist/{generate-document-model-BJXyODfm.mjs.map → generate-document-model-DhDQ_06X.mjs.map} +1 -1
- package/dist/{generate-editor-BejvaVVT.mjs → generate-editor-CW7Do69u.mjs} +7 -5
- package/dist/{generate-editor-BejvaVVT.mjs.map → generate-editor-CW7Do69u.mjs.map} +1 -1
- package/dist/generate-piece-QTt-ddt2.mjs +65 -0
- package/dist/generate-piece-QTt-ddt2.mjs.map +1 -0
- package/dist/generate-piece-action-DbxrzfKY.mjs +29 -0
- package/dist/generate-piece-action-DbxrzfKY.mjs.map +1 -0
- package/dist/generate-piece-trigger-CqVOcL9g.mjs +30 -0
- package/dist/generate-piece-trigger-CqVOcL9g.mjs.map +1 -0
- package/dist/{generate-processor-_WOx-mMe.mjs → generate-processor-DBtTkgo5.mjs} +15 -8
- package/dist/generate-processor-DBtTkgo5.mjs.map +1 -0
- package/dist/{generate-subgraph-BsHUstpl.mjs → generate-subgraph-Dm27O59o.mjs} +10 -6
- package/dist/generate-subgraph-Dm27O59o.mjs.map +1 -0
- package/dist/{init-BZP6gvYd.mjs → init-CIEMyAug.mjs} +4 -4
- package/dist/{init-BZP6gvYd.mjs.map → init-CIEMyAug.mjs.map} +1 -1
- package/dist/{inspect-DXjbQEV_.mjs → inspect-BpCB0TPo.mjs} +11 -4
- package/dist/inspect-BpCB0TPo.mjs.map +1 -0
- package/dist/install-added-dependencies-DVSbzler.mjs +33 -0
- package/dist/install-added-dependencies-DVSbzler.mjs.map +1 -0
- package/dist/{migrate-jGKfE02L.mjs → migrate-DK4HK7Dn.mjs} +4 -4
- package/dist/{migrate-jGKfE02L.mjs.map → migrate-DK4HK7Dn.mjs.map} +1 -1
- package/dist/{registry-auth-DxEWCJu2.mjs → registry-auth-Bm5AR-fB.mjs} +4 -4
- package/dist/{registry-auth-DxEWCJu2.mjs.map → registry-auth-Bm5AR-fB.mjs.map} +1 -1
- package/dist/scripts/generate-commands-docs.ts +8 -0
- package/dist/switchboard-KQaBlAda.mjs +131 -0
- package/dist/switchboard-KQaBlAda.mjs.map +1 -0
- package/dist/{switchboard-migrate-NQ7LHWSi.mjs → switchboard-migrate-7JQZM7-5.mjs} +5 -4
- package/dist/{switchboard-migrate-NQ7LHWSi.mjs.map → switchboard-migrate-7JQZM7-5.mjs.map} +1 -1
- package/dist/{switchboard-reset-BcQXlcVf.mjs → switchboard-reset-CX_Lzw3O.mjs} +4 -4
- package/dist/{switchboard-reset-BcQXlcVf.mjs.map → switchboard-reset-CX_Lzw3O.mjs.map} +1 -1
- package/dist/switchboard-yDRjakQT.mjs +4 -0
- package/dist/{utils-BzwczAW-.mjs → utils-C3c5YG6v.mjs} +3 -3
- package/dist/{utils-C4isxXSO.mjs → utils-CvmDmCVd.mjs} +3 -3
- package/dist/{utils-C4isxXSO.mjs.map → utils-CvmDmCVd.mjs.map} +1 -1
- package/dist/{vetra-DkF6EJMY.mjs → vetra-CPGUTtaF.mjs} +64 -16
- package/dist/vetra-CPGUTtaF.mjs.map +1 -0
- package/package.json +17 -16
- package/dist/auth-BNkN6kS9.mjs +0 -4
- package/dist/build-C-A5-ipO.mjs +0 -4
- package/dist/build-uQXq6_HU.mjs +0 -71
- package/dist/build-uQXq6_HU.mjs.map +0 -1
- package/dist/cli-connect-override-D3hh4aH_.mjs.map +0 -1
- package/dist/connect-build-WL4axo4z.mjs +0 -43
- package/dist/connect-build-WL4axo4z.mjs.map +0 -1
- package/dist/connect-config-BWGiW3IB.mjs.map +0 -1
- package/dist/connect-studio-BIQzyq5B.mjs +0 -5
- package/dist/generate-processor-_WOx-mMe.mjs.map +0 -1
- package/dist/generate-subgraph-BsHUstpl.mjs.map +0 -1
- package/dist/inspect-DXjbQEV_.mjs.map +0 -1
- package/dist/switchboard-CJMoMzWx.mjs +0 -75
- package/dist/switchboard-CJMoMzWx.mjs.map +0 -1
- package/dist/switchboard-iRFugh8I.mjs +0 -4
- package/dist/vetra-DkF6EJMY.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="658f151e-b897-505c-bd5b-5a4d9dd1d324")}catch(e){}}();
|
|
4
|
+
import { n as skipInstallArgs } from "./install-added-dependencies-DVSbzler.mjs";
|
|
4
5
|
import { initCliTelemetry } from "@powerhousedao/shared/clis/telemetry";
|
|
5
6
|
import { assertNodeVersion } from "@powerhousedao/shared/clis/utils";
|
|
6
|
-
import { boolean, command, flag, multioption, oneOf, option, optional, run, string, subcommands } from "cmd-ts";
|
|
7
|
+
import { boolean, command, extendType, flag, multioption, oneOf, option, optional, positional, run, string, subcommands } from "cmd-ts";
|
|
7
8
|
import { AGENTS, accessTokenArgs, buildArgs, connectBuildArgs, connectConfigArgs, connectPreviewArgs, connectStudioArgs, debugArgs, initArgs, inspectArgs, installArgs, listArgs, loginArgs, migrateArgs, phCliHelpCommands, publishArgs, registryLoginArgs, switchboardArgs, uninstallArgs, unpublishArgs, vetraArgs } from "@powerhousedao/shared/clis/args";
|
|
8
9
|
import { DEFAULT_EXPIRY_SECONDS } from "@powerhousedao/shared/clis/constants";
|
|
9
|
-
import
|
|
10
|
-
import path from "path";
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import path$1 from "path";
|
|
13
|
+
import { execSync } from "node:child_process";
|
|
11
14
|
import { PROCESSOR_APPS } from "@powerhousedao/shared/processors";
|
|
12
|
-
import { execSync } from "child_process";
|
|
13
|
-
import { execSync as execSync$1 } from "node:child_process";
|
|
15
|
+
import { execSync as execSync$1 } from "child_process";
|
|
14
16
|
import { createInterface } from "node:readline/promises";
|
|
15
17
|
import { bold, yellow } from "colorette";
|
|
16
18
|
//#region src/get-version.ts
|
|
17
19
|
function getVersion() {
|
|
18
|
-
return "6.2.3-dev.
|
|
20
|
+
return "6.2.3-dev.50";
|
|
19
21
|
}
|
|
20
22
|
//#endregion
|
|
21
23
|
//#region src/utils/constants.ts
|
|
22
24
|
const PH_CLI_DESCRIPTION = "The Powerhouse CLI (ph-cli) is a command-line interface tool that provides essential commands for managing Powerhouse projects. The tool and it's commands are fundamental for creating, building, and running Document Models as a builder in studio mode.";
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/commands/ph-cli-help.ts
|
|
27
|
+
const version$1 = getVersion();
|
|
23
28
|
const phCliHelp = subcommands({
|
|
24
29
|
name: "ph-cli",
|
|
25
30
|
description: PH_CLI_DESCRIPTION,
|
|
26
|
-
version:
|
|
31
|
+
version: version$1,
|
|
27
32
|
cmds: phCliHelpCommands
|
|
28
33
|
});
|
|
29
34
|
//#endregion
|
|
@@ -81,7 +86,7 @@ Notes:
|
|
|
81
86
|
handler: async (args) => {
|
|
82
87
|
if (args.debug) console.log(args);
|
|
83
88
|
const { generateAccessToken, parseExpiry, formatExpiry } = await import("@renown/sdk/node");
|
|
84
|
-
const { getRenown } = await import("./auth-
|
|
89
|
+
const { getRenown } = await import("./auth-CNhbN5UM.mjs");
|
|
85
90
|
const renown = await getRenown();
|
|
86
91
|
let expiresIn = DEFAULT_EXPIRY_SECONDS;
|
|
87
92
|
if (args.expiry) expiresIn = parseExpiry(args.expiry);
|
|
@@ -101,11 +106,25 @@ Notes:
|
|
|
101
106
|
//#region src/commands/build.ts
|
|
102
107
|
const build$1 = command({
|
|
103
108
|
name: "build",
|
|
109
|
+
description: `
|
|
110
|
+
Build a Powerhouse package for publishing: a browser bundle and a node bundle of its
|
|
111
|
+
document models, editors, subgraphs and processors, type declarations, and its stylesheet.
|
|
112
|
+
|
|
113
|
+
Pieces under pieces/ are built too, each into its own self-contained module under
|
|
114
|
+
dist/node/pieces/<name>, with a descriptor.json and package.json written beside it and
|
|
115
|
+
the piece listed in dist/powerhouse.manifest.json. A piece takes the package's version: an
|
|
116
|
+
entry in pieces/index.ts that declares version fails the build. A package that ships only
|
|
117
|
+
pieces is an ordinary package: it carries the same boilerplate, and every step above runs
|
|
118
|
+
for it too.
|
|
119
|
+
|
|
120
|
+
tsc runs first. If it reports type errors the build asks whether to go ahead, and stops
|
|
121
|
+
where it can't ask. --ignore-type-errors builds without asking; a package built that way
|
|
122
|
+
can load and still fail at runtime, so don't publish it.`,
|
|
104
123
|
args: buildArgs,
|
|
105
124
|
handler: async (args) => {
|
|
106
125
|
if (args.debug) console.log(args);
|
|
107
126
|
try {
|
|
108
|
-
const { runBuild } = await import("./build-
|
|
127
|
+
const { runBuild } = await import("./build-Dk9HoX9_.mjs");
|
|
109
128
|
await runBuild(args);
|
|
110
129
|
} catch (error) {
|
|
111
130
|
console.error(error);
|
|
@@ -113,13 +132,11 @@ const build$1 = command({
|
|
|
113
132
|
}
|
|
114
133
|
}
|
|
115
134
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
name: "studio",
|
|
122
|
-
description: `The studio command starts the Connect Studio, a development environment for building
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/commands/connect.ts
|
|
137
|
+
const studio = command({
|
|
138
|
+
name: "studio",
|
|
139
|
+
description: `The studio command starts the Connect Studio, a development environment for building
|
|
123
140
|
and testing Powerhouse applications. It provides a visual interface for working with
|
|
124
141
|
your project.
|
|
125
142
|
|
|
@@ -129,49 +146,51 @@ This command:
|
|
|
129
146
|
3. Allows you to interact with your project components
|
|
130
147
|
4. Supports various configuration options for customization
|
|
131
148
|
`,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
149
|
+
args: connectStudioArgs,
|
|
150
|
+
handler: async (args) => {
|
|
151
|
+
if (args.debug) console.log(args);
|
|
152
|
+
const { runConnectStudio } = await import("./connect-studio-f3K1qPWd.mjs");
|
|
153
|
+
await runConnectStudio(args);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
const build = command({
|
|
157
|
+
name: "build",
|
|
158
|
+
description: `The Connect build command creates a production build with the project's local and
|
|
142
159
|
external packages included.
|
|
143
160
|
|
|
144
161
|
Runtime-config overrides (all combinable — last wins on collision):
|
|
145
162
|
ph connect build Build with the current source config.
|
|
146
163
|
ph connect build <key> <value> Build with a positional override applied (e.g. ph connect build connect.renown.url https://renown.staging).
|
|
147
164
|
ph connect build --<field> <value> Build with a per-field flag override (e.g. --renown-url https://renown.staging).
|
|
148
|
-
ph connect build --json '{"
|
|
165
|
+
ph connect build --json '{"app":{"workflowsEnabled":true}}'
|
|
166
|
+
Build with a bulk override. The payload is the connect.* block
|
|
167
|
+
without the "connect" wrapper; unknown keys are rejected.
|
|
149
168
|
|
|
150
169
|
Build has no read mode; passing only <key> without <value> errors out (use \`ph connect config <key>\` to read).
|
|
151
170
|
`,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
171
|
+
args: connectBuildArgs,
|
|
172
|
+
handler: async (args) => {
|
|
173
|
+
if (args.debug) console.log(args);
|
|
174
|
+
const { runConnectBuild } = await import("./connect-build-CJhbzYPL.mjs");
|
|
175
|
+
await runConnectBuild(args);
|
|
176
|
+
process.exit(0);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
const preview = command({
|
|
180
|
+
name: "preview",
|
|
181
|
+
description: `The Connect preview command previews a built Connect project.
|
|
163
182
|
NOTE: You must run \`ph connect build\` first
|
|
164
183
|
`,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
184
|
+
args: connectPreviewArgs,
|
|
185
|
+
handler: async (args) => {
|
|
186
|
+
if (args.debug) console.log(args);
|
|
187
|
+
const { runConnectPreview } = await import("./connect-preview-CzDqR-JN.mjs");
|
|
188
|
+
await runConnectPreview(args);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
const config = command({
|
|
192
|
+
name: "config",
|
|
193
|
+
description: `Read or update Connect's runtime configuration (powerhouse.config.json).
|
|
175
194
|
|
|
176
195
|
Modes (mutually exclusive — positional, --get, --json, and field flags cannot be combined):
|
|
177
196
|
ph connect config List the effective connect.* block (defaults < source).
|
|
@@ -179,18 +198,28 @@ Modes (mutually exclusive — positional, --get, --json, and field flags cannot
|
|
|
179
198
|
ph connect config --get <dotted.path> Same as positional <key> (kept for backward compat).
|
|
180
199
|
ph connect config <key> <value> Set a single field and dual-write to source + dist (positional).
|
|
181
200
|
ph connect config --<field> <value> Set a single field via per-field flag (e.g. --renown-url https://renown.id).
|
|
182
|
-
ph connect config --json '{"
|
|
201
|
+
ph connect config --json '{"renown":{"url":"…"}}'
|
|
202
|
+
Bulk-set multiple fields and dual-write. The payload is the connect.*
|
|
203
|
+
block without the "connect" wrapper; unknown keys are rejected.
|
|
183
204
|
|
|
184
205
|
Writes go to:
|
|
185
206
|
- <project>/powerhouse.config.json (source — picked up by the next build)
|
|
186
207
|
- <dist-dir>/powerhouse.config.json (if it exists — the currently-served SPA picks it up on refresh)
|
|
187
208
|
`,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
209
|
+
args: connectConfigArgs,
|
|
210
|
+
handler: async (args) => {
|
|
211
|
+
const { runConnectConfig } = await import("./connect-config-DGfPEeP8.mjs");
|
|
212
|
+
await runConnectConfig(args);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
const connect = subcommands({
|
|
216
|
+
name: "connect",
|
|
217
|
+
description: `Powerhouse Connect commands. Use with \`studio\`, \`build\`, \`preview\`, or \`config\`. Defaults to \`studio\` if not specified.`,
|
|
218
|
+
cmds: {
|
|
219
|
+
studio,
|
|
220
|
+
build,
|
|
221
|
+
preview,
|
|
222
|
+
config
|
|
194
223
|
}
|
|
195
224
|
});
|
|
196
225
|
//#endregion
|
|
@@ -204,12 +233,40 @@ const generateAllCmd = command({
|
|
|
204
233
|
description: "Instead of generating code, write a spec for every module into specs/ (one-shot migration to documents-as-source-of-truth)"
|
|
205
234
|
}) },
|
|
206
235
|
handler: async (args) => {
|
|
207
|
-
const { startGenerateAll } = await import("./generate-all-
|
|
236
|
+
const { startGenerateAll } = await import("./generate-all-CIwP-3aa.mjs");
|
|
208
237
|
await startGenerateAll(args, process.cwd());
|
|
209
238
|
process.exit(0);
|
|
210
239
|
}
|
|
211
240
|
});
|
|
212
241
|
//#endregion
|
|
242
|
+
//#region src/utils/fs-args.ts
|
|
243
|
+
const ExistingPath = extendType(string, {
|
|
244
|
+
displayName: "path",
|
|
245
|
+
description: "An existing path",
|
|
246
|
+
from(str) {
|
|
247
|
+
const resolved = path.resolve(str);
|
|
248
|
+
if (!fs.existsSync(resolved)) return Promise.reject(/* @__PURE__ */ new Error("Path doesn't exist"));
|
|
249
|
+
return Promise.resolve(resolved);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
/** A directory, or the directory of a given file. */
|
|
253
|
+
const Directory = extendType(ExistingPath, {
|
|
254
|
+
displayName: "dir",
|
|
255
|
+
description: "A path to a directory or a file within a directory",
|
|
256
|
+
from(resolved) {
|
|
257
|
+
return Promise.resolve(fs.statSync(resolved).isDirectory() ? resolved : path.dirname(resolved));
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
/** An existing file. */
|
|
261
|
+
const File = extendType(ExistingPath, {
|
|
262
|
+
displayName: "file",
|
|
263
|
+
description: "A file in the file system",
|
|
264
|
+
from(resolved) {
|
|
265
|
+
if (!fs.statSync(resolved).isFile()) return Promise.reject(/* @__PURE__ */ new Error("Provided path is not a file"));
|
|
266
|
+
return Promise.resolve(resolved);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
//#endregion
|
|
213
270
|
//#region src/utils/comma-separated.ts
|
|
214
271
|
/** Splits comma-separated values so `-t "a,b"` means the same as `-t a -t b`
|
|
215
272
|
* instead of yielding the single value `"a,b"`, which matches nothing. */
|
|
@@ -267,7 +324,7 @@ const generateAppCmd = command({
|
|
|
267
324
|
...debugArgs
|
|
268
325
|
},
|
|
269
326
|
handler: async (args) => {
|
|
270
|
-
const { startGenerateApp } = await import("./generate-app-
|
|
327
|
+
const { startGenerateApp } = await import("./generate-app-BTs1u-9l.mjs");
|
|
271
328
|
await startGenerateApp(args, process.cwd());
|
|
272
329
|
process.exit(0);
|
|
273
330
|
}
|
|
@@ -303,7 +360,7 @@ const generateDocumentModelCmd = command({
|
|
|
303
360
|
...debugArgs
|
|
304
361
|
},
|
|
305
362
|
handler: async (args) => {
|
|
306
|
-
const { startGenerateDocumentModel } = await import("./generate-document-model-
|
|
363
|
+
const { startGenerateDocumentModel } = await import("./generate-document-model-DhDQ_06X.mjs");
|
|
307
364
|
await startGenerateDocumentModel(args, process.cwd());
|
|
308
365
|
process.exit(0);
|
|
309
366
|
}
|
|
@@ -350,7 +407,7 @@ const generateEditorCmd = command({
|
|
|
350
407
|
...debugArgs
|
|
351
408
|
},
|
|
352
409
|
handler: async (args) => {
|
|
353
|
-
const { startGenerateEditor } = await import("./generate-editor-
|
|
410
|
+
const { startGenerateEditor } = await import("./generate-editor-CW7Do69u.mjs");
|
|
354
411
|
await startGenerateEditor(args, process.cwd());
|
|
355
412
|
process.exit(0);
|
|
356
413
|
}
|
|
@@ -377,12 +434,150 @@ const generateMigrationFileCmd = command({
|
|
|
377
434
|
handler: async ({ migrationFile, schemaFile }) => {
|
|
378
435
|
const { generateDBSchema } = await import("@powerhousedao/codegen");
|
|
379
436
|
await generateDBSchema({
|
|
380
|
-
migrationFile: path.join(process.cwd(), migrationFile),
|
|
381
|
-
schemaFile: schemaFile ? path.join(process.cwd(), schemaFile) : void 0
|
|
437
|
+
migrationFile: path$1.join(process.cwd(), migrationFile),
|
|
438
|
+
schemaFile: schemaFile ? path$1.join(process.cwd(), schemaFile) : void 0
|
|
382
439
|
});
|
|
383
440
|
process.exit(0);
|
|
384
441
|
}
|
|
385
442
|
});
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/commands/generate-piece-action.ts
|
|
445
|
+
const generatePieceActionCmd = command({
|
|
446
|
+
name: "piece-action",
|
|
447
|
+
description: "Generate an action inside an existing piece",
|
|
448
|
+
args: {
|
|
449
|
+
namePositional: positional({
|
|
450
|
+
type: optional(string),
|
|
451
|
+
displayName: "name",
|
|
452
|
+
description: "The name of the action, e.g. get-record"
|
|
453
|
+
}),
|
|
454
|
+
name: option({
|
|
455
|
+
type: optional(string),
|
|
456
|
+
long: "name",
|
|
457
|
+
short: "n",
|
|
458
|
+
description: "The name of the action to generate"
|
|
459
|
+
}),
|
|
460
|
+
piece: option({
|
|
461
|
+
type: optional(string),
|
|
462
|
+
long: "piece",
|
|
463
|
+
short: "p",
|
|
464
|
+
description: "The piece directory under pieces/ to add the action to. Optional when the project ships exactly one piece."
|
|
465
|
+
}),
|
|
466
|
+
requireReactor: option({
|
|
467
|
+
type: optional(oneOf(["read", "write"])),
|
|
468
|
+
long: "require-reactor",
|
|
469
|
+
description: "Declare reactor access for the action: read, or write (which includes read). The action then gets context.reactor"
|
|
470
|
+
}),
|
|
471
|
+
...skipInstallArgs,
|
|
472
|
+
...debugArgs
|
|
473
|
+
},
|
|
474
|
+
handler: async (args) => {
|
|
475
|
+
const { startGeneratePieceAction } = await import("./generate-piece-action-DbxrzfKY.mjs");
|
|
476
|
+
await startGeneratePieceAction(args, process.cwd());
|
|
477
|
+
process.exit(0);
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region src/commands/generate-piece-trigger.ts
|
|
482
|
+
const generatePieceTriggerCmd = command({
|
|
483
|
+
name: "piece-trigger",
|
|
484
|
+
description: "Generate a trigger inside an existing piece",
|
|
485
|
+
args: {
|
|
486
|
+
namePositional: positional({
|
|
487
|
+
type: optional(string),
|
|
488
|
+
displayName: "name",
|
|
489
|
+
description: "The name of the trigger, e.g. new-record"
|
|
490
|
+
}),
|
|
491
|
+
name: option({
|
|
492
|
+
type: optional(string),
|
|
493
|
+
long: "name",
|
|
494
|
+
short: "n",
|
|
495
|
+
description: "The name of the trigger to generate"
|
|
496
|
+
}),
|
|
497
|
+
piece: option({
|
|
498
|
+
type: optional(string),
|
|
499
|
+
long: "piece",
|
|
500
|
+
short: "p",
|
|
501
|
+
description: "The piece directory under pieces/ to add the trigger to. Optional when the project ships exactly one piece."
|
|
502
|
+
}),
|
|
503
|
+
strategy: option({
|
|
504
|
+
type: oneOf(["polling", "webhook"]),
|
|
505
|
+
long: "strategy",
|
|
506
|
+
description: "How the trigger fires: polled on a schedule, or delivered to a webhook",
|
|
507
|
+
defaultValue: () => "polling",
|
|
508
|
+
defaultValueIsSerializable: true
|
|
509
|
+
}),
|
|
510
|
+
requireReactor: option({
|
|
511
|
+
type: optional(oneOf(["read", "write"])),
|
|
512
|
+
long: "require-reactor",
|
|
513
|
+
description: "Declare reactor access for the trigger: read, or write (which includes read). Its hooks then get context.reactor"
|
|
514
|
+
}),
|
|
515
|
+
...skipInstallArgs,
|
|
516
|
+
...debugArgs
|
|
517
|
+
},
|
|
518
|
+
handler: async (args) => {
|
|
519
|
+
const { startGeneratePieceTrigger } = await import("./generate-piece-trigger-CqVOcL9g.mjs");
|
|
520
|
+
await startGeneratePieceTrigger(args, process.cwd());
|
|
521
|
+
process.exit(0);
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region src/commands/generate-piece.ts
|
|
526
|
+
const generatePieceCmd = command({
|
|
527
|
+
name: "piece",
|
|
528
|
+
description: "Generate a piece: a connector whose actions and triggers a workflow can call",
|
|
529
|
+
args: {
|
|
530
|
+
namePositional: positional({
|
|
531
|
+
type: optional(string),
|
|
532
|
+
displayName: "name",
|
|
533
|
+
description: "The name of the piece to generate. Its directory is the kebab-case of this."
|
|
534
|
+
}),
|
|
535
|
+
name: option({
|
|
536
|
+
type: optional(string),
|
|
537
|
+
long: "name",
|
|
538
|
+
short: "n",
|
|
539
|
+
description: "The name of the piece to generate"
|
|
540
|
+
}),
|
|
541
|
+
id: option({
|
|
542
|
+
type: optional(string),
|
|
543
|
+
long: "id",
|
|
544
|
+
description: "The piece id, the pieceName a workflow step holds, e.g. @acme/piece-crm. Defaults to one derived from the package name."
|
|
545
|
+
}),
|
|
546
|
+
auth: option({
|
|
547
|
+
type: oneOf([
|
|
548
|
+
"none",
|
|
549
|
+
"secret",
|
|
550
|
+
"custom"
|
|
551
|
+
]),
|
|
552
|
+
long: "auth",
|
|
553
|
+
description: "The kind of connection the piece asks for",
|
|
554
|
+
defaultValue: () => "custom",
|
|
555
|
+
defaultValueIsSerializable: true
|
|
556
|
+
}),
|
|
557
|
+
description: option({
|
|
558
|
+
type: optional(string),
|
|
559
|
+
long: "description",
|
|
560
|
+
description: "One line describing what the piece connects to"
|
|
561
|
+
}),
|
|
562
|
+
dir: option({
|
|
563
|
+
type: optional(Directory),
|
|
564
|
+
long: "dir",
|
|
565
|
+
description: "Name of the directory of an existing piece to re-register"
|
|
566
|
+
}),
|
|
567
|
+
all: flag({
|
|
568
|
+
long: "all",
|
|
569
|
+
short: "a",
|
|
570
|
+
description: "Re-register every piece in pieces/: refresh the pieces list and the manifest, and prune what is gone"
|
|
571
|
+
}),
|
|
572
|
+
...skipInstallArgs,
|
|
573
|
+
...debugArgs
|
|
574
|
+
},
|
|
575
|
+
handler: async (args) => {
|
|
576
|
+
const { startGeneratePiece } = await import("./generate-piece-QTt-ddt2.mjs");
|
|
577
|
+
await startGeneratePiece(args, process.cwd());
|
|
578
|
+
process.exit(0);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
386
581
|
const generateProcessorCmd = command({
|
|
387
582
|
name: "processor",
|
|
388
583
|
description: "Generate a processor",
|
|
@@ -443,10 +638,11 @@ const generateProcessorCmd = command({
|
|
|
443
638
|
short: "x",
|
|
444
639
|
description: "Write a powerhouse/processor spec for each existing processor into specs/processors/"
|
|
445
640
|
}),
|
|
641
|
+
...skipInstallArgs,
|
|
446
642
|
...debugArgs
|
|
447
643
|
},
|
|
448
644
|
handler: async (args) => {
|
|
449
|
-
const { startGenerateProcessor } = await import("./generate-processor-
|
|
645
|
+
const { startGenerateProcessor } = await import("./generate-processor-DBtTkgo5.mjs");
|
|
450
646
|
await startGenerateProcessor(args, process.cwd());
|
|
451
647
|
process.exit(0);
|
|
452
648
|
}
|
|
@@ -484,10 +680,11 @@ const generateSubgraphCmd = command({
|
|
|
484
680
|
short: "x",
|
|
485
681
|
description: "Write a powerhouse/subgraph spec for each existing subgraph into specs/subgraphs/"
|
|
486
682
|
}),
|
|
683
|
+
...skipInstallArgs,
|
|
487
684
|
...debugArgs
|
|
488
685
|
},
|
|
489
686
|
handler: async (args) => {
|
|
490
|
-
const { startGenerateSubgraph } = await import("./generate-subgraph-
|
|
687
|
+
const { startGenerateSubgraph } = await import("./generate-subgraph-Dm27O59o.mjs");
|
|
491
688
|
await startGenerateSubgraph(args, process.cwd());
|
|
492
689
|
process.exit(0);
|
|
493
690
|
}
|
|
@@ -504,6 +701,9 @@ const generate = subcommands({
|
|
|
504
701
|
app: generateAppCmd,
|
|
505
702
|
processor: generateProcessorCmd,
|
|
506
703
|
subgraph: generateSubgraphCmd,
|
|
704
|
+
piece: generatePieceCmd,
|
|
705
|
+
"piece-action": generatePieceActionCmd,
|
|
706
|
+
"piece-trigger": generatePieceTriggerCmd,
|
|
507
707
|
"migration-file": generateMigrationFileCmd
|
|
508
708
|
}
|
|
509
709
|
});
|
|
@@ -515,7 +715,7 @@ const init = command({
|
|
|
515
715
|
args: initArgs,
|
|
516
716
|
handler: async (args) => {
|
|
517
717
|
if (args.debug) console.log({ args });
|
|
518
|
-
const { startInit } = await import("./init-
|
|
718
|
+
const { startInit } = await import("./init-CIEMyAug.mjs");
|
|
519
719
|
await startInit(args);
|
|
520
720
|
process.exit(0);
|
|
521
721
|
}
|
|
@@ -538,7 +738,7 @@ This command:
|
|
|
538
738
|
args: inspectArgs,
|
|
539
739
|
handler: async (args) => {
|
|
540
740
|
if (args.debug) console.log(args);
|
|
541
|
-
const { startInspect } = await import("./inspect-
|
|
741
|
+
const { startInspect } = await import("./inspect-BpCB0TPo.mjs");
|
|
542
742
|
startInspect(args);
|
|
543
743
|
process.exit(0);
|
|
544
744
|
}
|
|
@@ -607,7 +807,7 @@ Resolution order for the registry URL:
|
|
|
607
807
|
if (scopeRegistryArgs.length > 0) console.log(`Installing dependencies 📦 (routing ${Array.from(scopes).join(", ")} → ${registryUrl})...`);
|
|
608
808
|
else console.log("Installing dependencies 📦...");
|
|
609
809
|
console.log(`> ${installCommand}`);
|
|
610
|
-
execSync(installCommand, {
|
|
810
|
+
execSync$1(installCommand, {
|
|
611
811
|
stdio: "inherit",
|
|
612
812
|
cwd: projectPath
|
|
613
813
|
});
|
|
@@ -617,7 +817,7 @@ Resolution order for the registry URL:
|
|
|
617
817
|
throw error;
|
|
618
818
|
}
|
|
619
819
|
}
|
|
620
|
-
const { updateConfigFile, updateStylesFile } = await import("./utils-
|
|
820
|
+
const { updateConfigFile, updateStylesFile } = await import("./utils-C3c5YG6v.mjs");
|
|
621
821
|
try {
|
|
622
822
|
console.log("⚙️ Updating powerhouse config file...");
|
|
623
823
|
updateConfigFile(dependenciesWithVersions, projectPath, "install", args.local ? "local" : "registry", registryUrl, args.registry !== void 0);
|
|
@@ -691,7 +891,7 @@ This command:
|
|
|
691
891
|
args: loginArgs,
|
|
692
892
|
handler: async (args) => {
|
|
693
893
|
if (args.debug) console.log(args);
|
|
694
|
-
const { getRenown } = await import("./auth-
|
|
894
|
+
const { getRenown } = await import("./auth-CNhbN5UM.mjs");
|
|
695
895
|
const renown = await getRenown(args.renownUrl);
|
|
696
896
|
if (args.showDid) {
|
|
697
897
|
console.log(renown.did);
|
|
@@ -760,7 +960,7 @@ This command:
|
|
|
760
960
|
}
|
|
761
961
|
});
|
|
762
962
|
async function handleLogout() {
|
|
763
|
-
const { getRenown } = await import("./auth-
|
|
963
|
+
const { getRenown } = await import("./auth-CNhbN5UM.mjs");
|
|
764
964
|
const renown = await getRenown();
|
|
765
965
|
if (!renown.user) {
|
|
766
966
|
console.log("Not currently authenticated.");
|
|
@@ -794,7 +994,7 @@ const migrate = command({
|
|
|
794
994
|
description: "Run migrations",
|
|
795
995
|
handler: async (args) => {
|
|
796
996
|
if (args.debug) console.log(args);
|
|
797
|
-
const { startMigrate } = await import("./migrate-
|
|
997
|
+
const { startMigrate } = await import("./migrate-DK4HK7Dn.mjs");
|
|
798
998
|
await startMigrate(args);
|
|
799
999
|
process.exit(0);
|
|
800
1000
|
}
|
|
@@ -842,7 +1042,7 @@ This command:
|
|
|
842
1042
|
const { projectPath } = await getPowerhouseProjectInfo();
|
|
843
1043
|
if (!projectPath) throw new Error("Could not find project path.");
|
|
844
1044
|
const { checkNpmAuth, npmPublish, resolveRegistryUrl } = await import("@powerhousedao/shared/registry");
|
|
845
|
-
const { mintRegistryAuthToken } = await import("./registry-auth-
|
|
1045
|
+
const { mintRegistryAuthToken } = await import("./registry-auth-Bm5AR-fB.mjs");
|
|
846
1046
|
const registryUrl = resolveRegistryUrl({
|
|
847
1047
|
registry: args.registry,
|
|
848
1048
|
projectPath
|
|
@@ -932,7 +1132,7 @@ Usage:
|
|
|
932
1132
|
const projectPath = (await getPowerhouseProjectInfo().catch(() => null))?.projectPath ?? process.cwd();
|
|
933
1133
|
const [{ resolveRegistryUrl, writeRegistryAuthToken }, { mintRegistryAuthToken }, { parseExpiry, formatExpiry }] = await Promise.all([
|
|
934
1134
|
import("@powerhousedao/shared/registry"),
|
|
935
|
-
import("./registry-auth-
|
|
1135
|
+
import("./registry-auth-Bm5AR-fB.mjs"),
|
|
936
1136
|
import("@renown/sdk/node")
|
|
937
1137
|
]);
|
|
938
1138
|
const registryUrl = resolveRegistryUrl({
|
|
@@ -969,7 +1169,7 @@ This command:
|
|
|
969
1169
|
const { basePath, dbPath, migrate, migrateStatus, reset, yes } = args;
|
|
970
1170
|
if (basePath) process.env.BASE_PATH = basePath;
|
|
971
1171
|
if (reset) {
|
|
972
|
-
const { resetSwitchboardDatabase } = await import("./switchboard-reset-
|
|
1172
|
+
const { resetSwitchboardDatabase } = await import("./switchboard-reset-CX_Lzw3O.mjs");
|
|
973
1173
|
await resetSwitchboardDatabase({
|
|
974
1174
|
dbPath,
|
|
975
1175
|
yes
|
|
@@ -977,14 +1177,14 @@ This command:
|
|
|
977
1177
|
process.exit(0);
|
|
978
1178
|
}
|
|
979
1179
|
if (migrate || migrateStatus) {
|
|
980
|
-
const { runSwitchboardMigrations } = await import("./switchboard-migrate-
|
|
1180
|
+
const { runSwitchboardMigrations } = await import("./switchboard-migrate-7JQZM7-5.mjs");
|
|
981
1181
|
await runSwitchboardMigrations({
|
|
982
1182
|
dbPath,
|
|
983
1183
|
statusOnly: migrateStatus
|
|
984
1184
|
});
|
|
985
1185
|
process.exit(0);
|
|
986
1186
|
}
|
|
987
|
-
const { startSwitchboard } = await import("./switchboard-
|
|
1187
|
+
const { startSwitchboard } = await import("./switchboard-yDRjakQT.mjs");
|
|
988
1188
|
const { defaultDriveUrl, renown } = await startSwitchboard(args);
|
|
989
1189
|
console.log(" ➜ Switchboard:", defaultDriveUrl);
|
|
990
1190
|
if (renown) console.log(" ➜ Identity:", renown.did);
|
|
@@ -1021,7 +1221,8 @@ This command:
|
|
|
1021
1221
|
});
|
|
1022
1222
|
try {
|
|
1023
1223
|
console.log("Uninstalling dependencies 📦 ...");
|
|
1024
|
-
|
|
1224
|
+
const uninstallCommand = await getPowerhouseProjectUninstallCommand(packageManager, args.dependencies);
|
|
1225
|
+
execSync(uninstallCommand, {
|
|
1025
1226
|
stdio: "inherit",
|
|
1026
1227
|
cwd: projectPath
|
|
1027
1228
|
});
|
|
@@ -1030,7 +1231,7 @@ This command:
|
|
|
1030
1231
|
console.error("❌ Failed to uninstall dependencies");
|
|
1031
1232
|
throw error;
|
|
1032
1233
|
}
|
|
1033
|
-
const { removeStylesImports, updateConfigFile } = await import("./utils-
|
|
1234
|
+
const { removeStylesImports, updateConfigFile } = await import("./utils-C3c5YG6v.mjs");
|
|
1034
1235
|
try {
|
|
1035
1236
|
console.log("⚙️ Updating powerhouse config file...");
|
|
1036
1237
|
updateConfigFile(dependenciesWithVersions, projectPath, "uninstall");
|
|
@@ -1157,11 +1358,20 @@ This command:
|
|
|
1157
1358
|
1. Starts a Vetra Switchboard with a "Vetra" drive for document storage
|
|
1158
1359
|
2. Optionally connects to remote drives instead of creating a local drive
|
|
1159
1360
|
3. Starts Connect Studio pointing to the Switchboard for user interaction (unless disabled)
|
|
1160
|
-
4. Enables real-time updates, collaboration, and code generation
|
|
1361
|
+
4. Enables real-time updates, collaboration, and code generation
|
|
1362
|
+
|
|
1363
|
+
Default drives:
|
|
1364
|
+
Connect's default drives resolve to the Vetra drive (and the preview drive
|
|
1365
|
+
when using --watch), plus any drives configured under
|
|
1366
|
+
connect.drives.defaultDrives in powerhouse.config.json - de-duplicated by
|
|
1367
|
+
URL, so configuring project drives does not cost you the Vetra drive.
|
|
1368
|
+
An explicit --default-drives-url is appended to that list (de-duplicated);
|
|
1369
|
+
it never replaces the Vetra drive.
|
|
1370
|
+
`,
|
|
1161
1371
|
args: vetraArgs,
|
|
1162
1372
|
handler: async (args) => {
|
|
1163
1373
|
if (args.debug) console.log(args);
|
|
1164
|
-
const { startVetra } = await import("./vetra-
|
|
1374
|
+
const { startVetra } = await import("./vetra-CPGUTtaF.mjs");
|
|
1165
1375
|
await startVetra(args);
|
|
1166
1376
|
}
|
|
1167
1377
|
}),
|
|
@@ -1180,10 +1390,13 @@ This command:
|
|
|
1180
1390
|
install,
|
|
1181
1391
|
uninstall
|
|
1182
1392
|
};
|
|
1393
|
+
//#endregion
|
|
1394
|
+
//#region src/commands/ph-cli.ts
|
|
1395
|
+
const version = getVersion();
|
|
1183
1396
|
const phCli = subcommands({
|
|
1184
1397
|
name: "ph-cli",
|
|
1185
1398
|
description: PH_CLI_DESCRIPTION,
|
|
1186
|
-
version
|
|
1399
|
+
version,
|
|
1187
1400
|
cmds: phCliCommands
|
|
1188
1401
|
});
|
|
1189
1402
|
//#endregion
|
|
@@ -1231,7 +1444,7 @@ function printDbRecoveryHint(err) {
|
|
|
1231
1444
|
//#endregion
|
|
1232
1445
|
//#region src/cli.ts
|
|
1233
1446
|
let sentryClient = void 0;
|
|
1234
|
-
const COMMANDS_WITH_SUBCOMMANDS = new Set(["connect", "vetra"]);
|
|
1447
|
+
const COMMANDS_WITH_SUBCOMMANDS = /* @__PURE__ */ new Set(["connect", "vetra"]);
|
|
1235
1448
|
function detectPackageManager() {
|
|
1236
1449
|
const ua = process.env.npm_config_user_agent;
|
|
1237
1450
|
if (!ua) return void 0;
|
|
@@ -1263,12 +1476,14 @@ async function main() {
|
|
|
1263
1476
|
"build",
|
|
1264
1477
|
"preview",
|
|
1265
1478
|
"config"
|
|
1266
|
-
].includes(args[1]) && !isHelp)
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1479
|
+
].includes(args[1]) && !isHelp) {
|
|
1480
|
+
const argsWithDefaultConnectSubCommand = [
|
|
1481
|
+
"connect",
|
|
1482
|
+
"studio",
|
|
1483
|
+
...restArgs
|
|
1484
|
+
];
|
|
1485
|
+
await run(cli, argsWithDefaultConnectSubCommand);
|
|
1486
|
+
} else await run(cli, args);
|
|
1272
1487
|
}
|
|
1273
1488
|
await main().catch(async (error) => {
|
|
1274
1489
|
const isDebug = process.argv.slice(2).includes("--debug");
|
|
@@ -1284,4 +1499,4 @@ await main().catch(async (error) => {
|
|
|
1284
1499
|
export {};
|
|
1285
1500
|
|
|
1286
1501
|
//# sourceMappingURL=cli.mjs.map
|
|
1287
|
-
//# debugId=
|
|
1502
|
+
//# debugId=658f151e-b897-505c-bd5b-5a4d9dd1d324
|