@powerhousedao/ph-cli 6.2.3-dev.30 → 6.2.3-dev.31
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/build-CTvPQFMi.mjs +4 -0
- package/dist/{build-D0PTejWA.mjs → build-sO3PcZxl.mjs} +4 -4
- package/dist/{build-D0PTejWA.mjs.map → build-sO3PcZxl.mjs.map} +1 -1
- package/dist/{cli-connect-override-Bo7L7mwc.mjs → cli-connect-override-b4kKqgOZ.mjs} +19 -21
- package/dist/cli-connect-override-b4kKqgOZ.mjs.map +1 -0
- package/dist/cli.mjs +36 -29
- package/dist/cli.mjs.map +1 -1
- package/dist/{connect-build-BVDpTJnS.mjs → connect-build-BMaR9w4G.mjs} +5 -5
- package/dist/{connect-build-BVDpTJnS.mjs.map → connect-build-BMaR9w4G.mjs.map} +1 -1
- package/dist/{connect-config-C70IXUh6.mjs → connect-config-_kiSMsbG.mjs} +12 -9
- package/dist/connect-config-_kiSMsbG.mjs.map +1 -0
- package/dist/{connect-studio-BDkYXCvz.mjs → connect-studio-_-O1-oef.mjs} +4 -4
- package/dist/{connect-studio-BDkYXCvz.mjs.map → connect-studio-_-O1-oef.mjs.map} +1 -1
- package/dist/{connect-studio-r_ikfhOR.mjs → connect-studio-f3K1qPWd.mjs} +3 -3
- package/dist/{generate-piece-BHBXK1_P.mjs → generate-piece-QTt-ddt2.mjs} +8 -7
- package/dist/generate-piece-QTt-ddt2.mjs.map +1 -0
- package/dist/{generate-piece-action-Byk-BmYt.mjs → generate-piece-action-C5WTHsqu.mjs} +6 -4
- package/dist/generate-piece-action-C5WTHsqu.mjs.map +1 -0
- package/dist/{generate-piece-trigger-CmPqKZej.mjs → generate-piece-trigger-DR10CPOG.mjs} +6 -4
- package/dist/generate-piece-trigger-DR10CPOG.mjs.map +1 -0
- package/dist/{generate-processor-FprZJIKD.mjs → generate-processor-DBtTkgo5.mjs} +6 -4
- package/dist/generate-processor-DBtTkgo5.mjs.map +1 -0
- package/dist/{generate-subgraph-DNwL9vDs.mjs → generate-subgraph-Dm27O59o.mjs} +6 -4
- package/dist/generate-subgraph-Dm27O59o.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-ORExpVlJ.mjs → migrate-B6QBYDNX.mjs} +4 -4
- package/dist/{migrate-ORExpVlJ.mjs.map → migrate-B6QBYDNX.mjs.map} +1 -1
- package/dist/{switchboard-B8CCCZCB.mjs → switchboard-CgVB4U76.mjs} +12 -4
- package/dist/switchboard-CgVB4U76.mjs.map +1 -0
- package/dist/switchboard-nHCI3pha.mjs +4 -0
- package/dist/{vetra-DhhT9bQB.mjs → vetra-s8gWslse.mjs} +50 -15
- package/dist/vetra-s8gWslse.mjs.map +1 -0
- package/package.json +11 -11
- package/dist/build-BolXfpNU.mjs +0 -4
- package/dist/cli-connect-override-Bo7L7mwc.mjs.map +0 -1
- package/dist/connect-config-C70IXUh6.mjs.map +0 -1
- package/dist/generate-piece-BHBXK1_P.mjs.map +0 -1
- package/dist/generate-piece-action-Byk-BmYt.mjs.map +0 -1
- package/dist/generate-piece-trigger-CmPqKZej.mjs.map +0 -1
- package/dist/generate-processor-FprZJIKD.mjs.map +0 -1
- package/dist/generate-subgraph-DNwL9vDs.mjs.map +0 -1
- package/dist/switchboard-B8CCCZCB.mjs.map +0 -1
- package/dist/switchboard-C5AOMSKA.mjs +0 -4
- package/dist/vetra-DhhT9bQB.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-config-_kiSMsbG.mjs","sources":["../src/utils/get-at-path.ts","../src/services/connect-config.ts"],"sourcesContent":["/**\n * Walk a parsed path (e.g. from remeda's `stringToPath`) through a runtime-\n * typed object, returning the value or `undefined` if any segment is\n * missing.\n *\n * Remeda's `prop` is overload-typed for compile-time literal paths and\n * doesn't accept a runtime path array via spread, so we walk inline for\n * the dynamic-path case used by `ph connect config --get`.\n */\nexport function getAtPath(\n obj: unknown,\n parts: ReadonlyArray<string | number>,\n): unknown {\n let cur: unknown = obj;\n for (const key of parts) {\n if (cur === null || typeof cur !== \"object\") return undefined;\n cur = (cur as Record<string, unknown>)[String(key)];\n }\n return cur;\n}\n","// `ph connect config` — read or update Connect's runtime configuration.\n//\n// Mode dispatch (exactly one mode per invocation; mutex enforced below):\n//\n// ph connect config → list mode (print effective merged config)\n// ph connect config <key> → get mode (positional)\n// ph connect config --get <dotted.path> → get mode (flag form, equivalent)\n// ph connect config <key> <value> → set mode (positional, dual-write source + dist)\n// ph connect config --<field> <value> → set mode (flag form)\n// ph connect config --json '{...}' → bulk-set mode (dual-write)\n//\n// Dual-write semantics for set / bulk-set:\n// - Source `powerhouse.config.json` (project root) gets the connect.* patch\n// deep-merged into `connect.*`. `--packages-registry` lands at the\n// top-level `packageRegistryUrl` field (project-wide setting, also read\n// by `ph install` / `ph publish` / Switchboard).\n// - Dist `powerhouse.config.json` (default `.ph/connect-build/dist/`) gets\n// the same connect.* patch deep-merged in, and the same top-level\n// `packageRegistryUrl` if set. The runtime schema mirrors the source\n// schema, so the field lives at the same path in both files.\n//\n// The dist write is skipped silently if the dist file doesn't exist — that's\n// the \"config-only-before-first-build\" workflow, not an error.\n//\n// Field flags + the 4 commonArgs flags (base, log-level, default-drives-url,\n// drive-preserve-strategy) come from the same source as `ph connect build`'s\n// flags, so the two commands share identical CLI surfaces. The 4 commonArgs\n// flags carry cmd-ts defaults; we gate them through `wasFlagExplicitlyPassed`\n// for the same reason `buildCliConnectOverride` does — to avoid leaking\n// default values into a write the user didn't request.\n\nimport type {\n PHConnectRuntimeConfig,\n PowerhouseConfig,\n} from \"@powerhousedao/shared/clis\";\nimport {\n ConfigLoader,\n JsonConfigAdapter,\n deepMerge,\n resolveSourceConnect,\n} from \"@powerhousedao/shared/connect\";\nimport { existsSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { stringToPath } from \"remeda\";\nimport type { ConnectConfigArgs } from \"../types.js\";\nimport {\n buildConnectFlagPatch,\n wasFlagExplicitlyPassed,\n type ConnectFlagInput,\n} from \"../utils/cli-connect-override.js\";\nimport {\n normalizeKey,\n parseCliValue,\n validateConnectKeyValue,\n validateConnectPatch,\n} from \"../utils/connect-config-validation.js\";\nimport { getAtPath } from \"../utils/get-at-path.js\";\n\ntype ConnectPartial = Partial<PHConnectRuntimeConfig>;\n\nconst SOURCE_FILE = \"powerhouse.config.json\";\nconst DEFAULT_DIST_SUBPATH = \".ph/connect-build/dist\";\n\nfunction resolveSourcePath(cwd: string): string {\n return join(cwd, SOURCE_FILE);\n}\n\nfunction resolveDistPath(cwd: string, distDirArg: string | undefined): string {\n const fromArg = distDirArg;\n const fromEnv = process.env.PH_CONNECT_OUTDIR;\n const dir = fromArg ?? fromEnv ?? DEFAULT_DIST_SUBPATH;\n const abs = isAbsolute(dir) ? dir : resolve(cwd, dir);\n return join(abs, SOURCE_FILE);\n}\n\n/**\n * Read the source file's raw bytes (no merge with defaults). Returns an empty\n * object stub when the file doesn't exist — the operator can config their way\n * to a complete file before ever running `ph connect build`.\n */\nasync function readSourceRaw(path: string): Promise<Record<string, unknown>> {\n if (!existsSync(path)) return {};\n const adapter = new JsonConfigAdapter({ path });\n const raw = await adapter.read();\n return raw && typeof raw === \"object\" && !Array.isArray(raw)\n ? (raw as Record<string, unknown>)\n : {};\n}\n\nasync function writeSourceRaw(\n path: string,\n next: Record<string, unknown>,\n): Promise<void> {\n const adapter = new JsonConfigAdapter({ path });\n // ConfigShape requires a `connect` key; ensure it's present.\n const shape = {\n ...next,\n connect: (next.connect as PHConnectRuntimeConfig | undefined) ?? {},\n };\n await adapter.write(shape);\n}\n\n/**\n * Build the merged \"effective\" connect block for list/get mode: defaults <\n * source.workflows < source.connect. Doesn't go through env or dist — list\n * mode shows what the source declares + defaults, which is what the next\n * build will produce as a baseline (before env seeds + CLI overrides).\n */\nfunction effectiveConnect(\n source: Record<string, unknown>,\n): PHConnectRuntimeConfig {\n const sourceConnect =\n source.connect &&\n typeof source.connect === \"object\" &&\n !Array.isArray(source.connect)\n ? (source.connect as ConnectPartial)\n : {};\n return resolveSourceConnect({\n connect: sourceConnect,\n workflows: source.workflows as PowerhouseConfig[\"workflows\"],\n });\n}\n\nfunction printJson(value: unknown): void {\n process.stdout.write(`${JSON.stringify(value, null, 2)}\\n`);\n}\n\n/**\n * Translate the parsed `ph connect config` args into the structural\n * `ConnectFlagInput` consumed by `buildConnectFlagPatch`. Common-args flags\n * with cmd-ts defaults are gated through `wasFlagExplicitlyPassed` so the\n * defaults don't leak into a write the user didn't request. `--base` is\n * not translated here — it's rejected up front by `runConnectConfig`.\n */\nfunction argsToFlagInput(args: ConnectConfigArgs): ConnectFlagInput {\n return {\n renownUrl: args.renownUrl,\n renownNetworkId: args.renownNetworkId,\n renownChainId: args.renownChainId,\n renownNamespace: args.renownNamespace,\n renownSwitchboardUrl: args.renownSwitchboardUrl,\n allowAddDrive: args.allowAddDrive,\n externalPackages: args.externalPackages,\n workflows: args.workflows,\n remoteDrivesEnabled: args.remoteDrivesEnabled,\n remoteDrivesAllowAdd: args.remoteDrivesAllowAdd,\n remoteDrivesAllowDelete: args.remoteDrivesAllowDelete,\n localDrivesEnabled: args.localDrivesEnabled,\n localDrivesAllowAdd: args.localDrivesAllowAdd,\n localDrivesAllowDelete: args.localDrivesAllowDelete,\n appName: args.appName,\n homeBackground: args.homeBackground,\n sentryDsn: args.sentryDsn,\n sentryEnv: args.sentryEnv,\n sentryTracingEnabled: args.sentryTracingEnabled,\n logLevel: wasFlagExplicitlyPassed(\"log-level\") ? args.logLevel : undefined,\n defaultDrivesUrl: wasFlagExplicitlyPassed(\"default-drives-url\")\n ? args.defaultDrivesUrl\n : undefined,\n drivesPreserveStrategy: wasFlagExplicitlyPassed(\"drive-preserve-strategy\")\n ? args.drivesPreserveStrategy\n : undefined,\n };\n}\n\n/**\n * Whether any field flag (any of the 20) was passed. Distinguishes the\n * single-field-set mode from list mode when neither `--get` nor `--json` is\n * present.\n */\nfunction hasAnyFieldFlag(input: ConnectFlagInput): boolean {\n // Object.values doesn't include json (which isn't in ConnectFlagInput here).\n // Cast to a generic record so the `!== undefined` predicate is type-aware:\n // ConnectFlagInput's optional properties narrow `v` in a way TS thinks\n // excludes `undefined`, even though at runtime any of them can be unset.\n return Object.values(input as Record<string, unknown>).some(\n (v) => v !== undefined,\n );\n}\n\nexport async function runConnectConfig(args: ConnectConfigArgs): Promise<void> {\n // `--base` is a build-time field (baked into the Vite bundle's asset URLs\n // and the nginx config template), so writing it post-build leaves the\n // layers disagreeing and the SPA's assets 404. The flag stays declared so\n // cmd-ts parses it; we reject explicit use here with an actionable error.\n if (wasFlagExplicitlyPassed(\"base\")) {\n throw new Error(\n \"ph connect config: --base is a build-time field; run `ph connect build --base <value>` and redeploy the container (or restart with PH_CONNECT_BASE_PATH=<value> set in the environment).\",\n );\n }\n\n const cwd = process.cwd();\n const sourcePath = resolveSourcePath(cwd);\n const distPath = resolveDistPath(cwd, args.distDir);\n\n const flagInput = argsToFlagInput(args);\n const hasGet = args.get !== undefined;\n const hasJson = args.json !== undefined;\n const hasFieldFlag = hasAnyFieldFlag(flagInput);\n // `--packages-registry` is a top-level field, not part of the connect-flag\n // patch. Track it separately so the set-mode write puts it in the right\n // place and the mutex counts it as a \"field flag\".\n const explicitRegistry = args.packagesRegistry;\n const hasExplicitRegistry = explicitRegistry !== undefined;\n // Positional pair: 1 positional = get, 2 = set. cmd-ts assigns the first\n // positional to `keyPositional` and the second to `valuePositional`, so a\n // standalone <value> isn't representable here.\n const hasPositionalKey = args.keyPositional !== undefined;\n const hasPositionalValue = args.valuePositional !== undefined;\n const hasPositional = hasPositionalKey;\n\n // Mutex: positional / --get / --json / (any field flag OR\n // --packages-registry) are mutually exclusive. Exactly one mode (or none →\n // list) per call. Counting positional as a single mode regardless of arity:\n // a `<key>` alone is a get, `<key> <value>` is a set, both occupy the same\n // \"positional mode\" slot vs. the other forms.\n const modeCount = [\n hasPositional,\n hasGet,\n hasJson,\n hasFieldFlag || hasExplicitRegistry,\n ].filter(Boolean).length;\n if (modeCount > 1) {\n throw new Error(\n \"ph connect config: positional <key>/<value>, --get, --json, and individual field flags are mutually exclusive. Use one mode per invocation.\",\n );\n }\n\n const source = await readSourceRaw(sourcePath);\n\n // List mode.\n if (modeCount === 0) {\n printJson(effectiveConnect(source));\n return;\n }\n\n // Get mode (either positional `<key>` alone or `--get <key>`).\n if (hasGet || (hasPositional && !hasPositionalValue)) {\n const rawKey = hasGet ? args.get! : args.keyPositional!;\n const sourceLabel = hasGet ? \"--get\" : \"<key>\";\n const normalized = normalizeKey(rawKey);\n if (!normalized) {\n throw new Error(\n `ph connect config ${sourceLabel}: key cannot be empty. Pass a dotted path inside connect.* (e.g. connect.renown.url).`,\n );\n }\n // `packageRegistryUrl` is a top-level field — look it up on the raw\n // source object, not inside `effectiveConnect`.\n if (normalized === \"packageRegistryUrl\") {\n const value = source.packageRegistryUrl;\n if (value === undefined) {\n throw new Error(\n `ph connect config ${sourceLabel}: no value at key \"${normalized}\". Run \\`ph connect config\\` (no args) to see the available paths.`,\n );\n }\n printJson(value);\n return;\n }\n const value = getAtPath(effectiveConnect(source), stringToPath(normalized));\n if (value === undefined) {\n throw new Error(\n `ph connect config ${sourceLabel}: no value at key \"${normalized}\". Run \\`ph connect config\\` (no args) to see the available paths.`,\n );\n }\n printJson(value);\n return;\n }\n\n // Set / bulk-set mode. Build the connect-side patch from positional\n // `<key> <value>` (Ajv-validated against the schema at that path), --json\n // (Ajv-validated as a partial connect.* blob), or individual field flags\n // (shape guaranteed by cmd-ts type coercion). `--packages-registry` is a\n // top-level field; if positional `<key>` is `packageRegistryUrl` or --json\n // carries it, route that to the top-level write.\n let topLevelRegistry: string | undefined = explicitRegistry;\n let patch: ConnectPartial;\n if (hasPositional && hasPositionalValue) {\n const normalized = normalizeKey(args.keyPositional!);\n if (!normalized) {\n throw new Error(\n \"ph connect config <key>: key cannot be empty. Pass a dotted path inside connect.* (e.g. connect.renown.url).\",\n );\n }\n // Top-level: positional `packageRegistryUrl <value>` writes the top-level\n // field instead of a connect.* path.\n if (normalized === \"packageRegistryUrl\") {\n const parsed = parseCliValue(args.valuePositional!);\n if (typeof parsed !== \"string\") {\n throw new Error(\n `ph connect config: packageRegistryUrl must be a string (got ${typeof parsed}).`,\n );\n }\n topLevelRegistry = parsed;\n patch = {};\n } else {\n patch = validateConnectKeyValue(\n normalized,\n args.valuePositional!,\n ) as ConnectPartial;\n }\n } else if (hasJson) {\n const validated = validateConnectPatch(args.json!) as Record<\n string,\n unknown\n >;\n if (typeof validated.packageRegistryUrl === \"string\") {\n topLevelRegistry = topLevelRegistry ?? validated.packageRegistryUrl;\n }\n const connectOnly = { ...validated };\n delete connectOnly.packageRegistryUrl;\n patch = connectOnly as ConnectPartial;\n } else {\n patch = buildConnectFlagPatch(flagInput) as ConnectPartial;\n }\n\n if (Object.keys(patch).length === 0 && topLevelRegistry === undefined) {\n throw new Error(\n \"ph connect config: nothing to set. Pass at least one field flag (e.g. --renown-url <url>) or --json with a non-empty payload.\",\n );\n }\n\n // Build the next source: top-level packageRegistryUrl (if set) +\n // connect.* deep-merge.\n const currentConnect =\n source.connect &&\n typeof source.connect === \"object\" &&\n !Array.isArray(source.connect)\n ? (source.connect as PHConnectRuntimeConfig)\n : ({} as PHConnectRuntimeConfig);\n const nextConnect = deepMerge(\n currentConnect,\n patch as PHConnectRuntimeConfig,\n );\n const nextSource: Record<string, unknown> = {\n ...source,\n connect: nextConnect,\n };\n if (topLevelRegistry !== undefined) {\n nextSource.packageRegistryUrl = topLevelRegistry;\n }\n\n await writeSourceRaw(sourcePath, nextSource);\n\n // Dual-write to dist if it exists. Same shape as source: connect.* block\n // is deep-merged; top-level `packageRegistryUrl` is set in place.\n if (existsSync(distPath)) {\n const distLoader = new ConfigLoader(\n new JsonConfigAdapter({ path: distPath }),\n );\n const distPatch: Record<string, unknown> = { connect: patch };\n if (topLevelRegistry !== undefined) {\n distPatch.packageRegistryUrl = topLevelRegistry;\n }\n await distLoader.write(distPatch);\n }\n\n process.stdout.write(\n `ph connect config: wrote ${sourcePath}${existsSync(distPath) ? ` and ${distPath}` : \"\"}\\n`,\n );\n}\n"],"names":[],"mappings":"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","debug_id":"69e6ceee-600a-53f7-8dcb-05415e6549dd"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!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
|
-
import { r as buildStudioConnectOverride } from "./cli-connect-override-
|
|
2
|
+
!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]="8c6c1a6c-3781-513f-afa0-ab9d74da54d0")}catch(e){}}();
|
|
3
|
+
import { r as buildStudioConnectOverride } from "./cli-connect-override-b4kKqgOZ.mjs";
|
|
4
4
|
import { getConnectBaseViteConfig } from "@powerhousedao/builder-tools";
|
|
5
5
|
import { createServer, mergeConfig } from "vite";
|
|
6
6
|
//#region src/services/connect-studio.ts
|
|
@@ -32,5 +32,5 @@ async function runConnectStudio(args, customLogger, callerOverride) {
|
|
|
32
32
|
//#endregion
|
|
33
33
|
export { runConnectStudio as t };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=connect-studio-
|
|
36
|
-
//# debugId=
|
|
35
|
+
//# sourceMappingURL=connect-studio-_-O1-oef.mjs.map
|
|
36
|
+
//# debugId=8c6c1a6c-3781-513f-afa0-ab9d74da54d0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-studio-
|
|
1
|
+
{"version":3,"file":"connect-studio-_-O1-oef.mjs","sources":["../src/services/connect-studio.ts"],"sourcesContent":["import { getConnectBaseViteConfig } from \"@powerhousedao/builder-tools\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type { InlineConfig, Logger } from \"vite\";\nimport { createServer, mergeConfig } from \"vite\";\nimport type { ConnectStudioArgs } from \"../types.js\";\nimport { buildStudioConnectOverride } from \"../utils/cli-connect-override.js\";\n\nexport async function runConnectStudio(\n args: ConnectStudioArgs,\n customLogger?: Logger,\n callerOverride?: PHConnectRuntimeConfig,\n) {\n const { port, host, open, cors, strictPort, printUrls, bindCLIShortcuts } =\n args;\n const mode = \"development\";\n\n const dirname = process.cwd();\n\n const cliConnectOverride = buildStudioConnectOverride(args, callerOverride);\n\n const baseConfig = getConnectBaseViteConfig({\n mode,\n dirname,\n cliConnectOverride,\n });\n\n const devServerConfig: InlineConfig = {\n server: { port, host, open, cors, strictPort },\n customLogger,\n };\n\n const config = mergeConfig(baseConfig, devServerConfig);\n\n const server = await createServer(config);\n\n await server.listen();\n\n if (printUrls) server.printUrls();\n if (bindCLIShortcuts) server.bindCLIShortcuts({ print: true });\n}\n"],"names":[],"mappings":";;;;;;AAOA,eAAsB,iBACpB,MACA,cACA,gBACA;CACA,MAAM,EAAE,MAAM,MAAM,MAAM,MAAM,YAAY,WAAW,qBACrD;CACF,MAAM,OAAO;CAEb,MAAM,UAAU,QAAQ,IAAI;CAE5B,MAAM,qBAAqB,2BAA2B,MAAM,cAAc;CAE1E,MAAM,aAAa,yBAAyB;EAC1C;EACA;EACA;CACF,CAAC;CAOD,MAAM,SAAS,YAAY,YAAY;EAJrC,QAAQ;GAAE;GAAM;GAAM;GAAM;GAAM;EAAW;EAC7C;CAGmD,CAAC;CAEtD,MAAM,SAAS,MAAM,aAAa,MAAM;CAExC,MAAM,OAAO,OAAO;CAEpB,IAAI,WAAW,OAAO,UAAU;CAChC,IAAI,kBAAkB,OAAO,iBAAiB,EAAE,OAAO,KAAK,CAAC;AAC/D","debug_id":"8c6c1a6c-3781-513f-afa0-ab9d74da54d0"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as runConnectStudio } from "./connect-studio-
|
|
1
|
+
import { t as runConnectStudio } from "./connect-studio-_-O1-oef.mjs";
|
|
2
2
|
export { runConnectStudio };
|
|
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]="
|
|
4
|
-
//# debugId=
|
|
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]="04e35c3d-c3bc-5333-a236-d6f30a73226b")}catch(e){}}();
|
|
4
|
+
//# debugId=04e35c3d-c3bc-5333-a236-d6f30a73226b
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="8b015725-4996-50bb-890c-e6cf4750fe5e")}catch(e){}}();
|
|
3
|
+
import { t as installAddedDependencies } from "./install-added-dependencies-DVSbzler.mjs";
|
|
3
4
|
import { basename } from "node:path";
|
|
4
5
|
import { readPackage } from "read-pkg";
|
|
5
6
|
import { detectFeatures, generateAllPieces, generatePiece, syncFeatureDependencies } from "@powerhousedao/codegen";
|
|
@@ -24,13 +25,13 @@ async function resolvePieceId(v) {
|
|
|
24
25
|
return (await prompt([{
|
|
25
26
|
type: "input",
|
|
26
27
|
name: "pieceId",
|
|
27
|
-
message: "What id should this piece have? A
|
|
28
|
+
message: "What id should this piece have? A workflow step names it as its pieceName.",
|
|
28
29
|
initial: id,
|
|
29
30
|
required: true
|
|
30
31
|
}])).pieceId || id;
|
|
31
32
|
}
|
|
32
33
|
async function startGeneratePiece(args, projectDir) {
|
|
33
|
-
const { namePositional, name: nameOption, id,
|
|
34
|
+
const { namePositional, name: nameOption, id, auth, description, dir, all, debug } = args;
|
|
34
35
|
if (debug) console.log({ args });
|
|
35
36
|
const project = buildTsMorphProject(projectDir);
|
|
36
37
|
const name = namePositional ?? nameOption;
|
|
@@ -46,7 +47,6 @@ async function startGeneratePiece(args, projectDir) {
|
|
|
46
47
|
await generatePiece({
|
|
47
48
|
pieceName: name,
|
|
48
49
|
pieceId,
|
|
49
|
-
pieceVersion,
|
|
50
50
|
auth,
|
|
51
51
|
description
|
|
52
52
|
}, project);
|
|
@@ -55,10 +55,11 @@ async function startGeneratePiece(args, projectDir) {
|
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
await project.save();
|
|
58
|
-
await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
58
|
+
const added = await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
59
|
+
await installAddedDependencies(added, projectDir, args.skipInstall);
|
|
59
60
|
}
|
|
60
61
|
//#endregion
|
|
61
62
|
export { startGeneratePiece };
|
|
62
63
|
|
|
63
|
-
//# sourceMappingURL=generate-piece-
|
|
64
|
-
//# debugId=
|
|
64
|
+
//# sourceMappingURL=generate-piece-QTt-ddt2.mjs.map
|
|
65
|
+
//# debugId=8b015725-4996-50bb-890c-e6cf4750fe5e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-piece-QTt-ddt2.mjs","sources":["../src/services/generate-piece.ts"],"sourcesContent":["import {\n detectFeatures,\n generateAllPieces,\n generatePiece,\n syncFeatureDependencies,\n} from \"@powerhousedao/codegen\";\nimport { derivePieceId } from \"@powerhousedao/codegen/name-builders\";\nimport {\n buildTsMorphProject,\n readPiecesList,\n} from \"@powerhousedao/codegen/utils\";\nimport { kebabCase } from \"change-case\";\nimport enquirer from \"enquirer\";\nimport { basename } from \"node:path\";\nimport { readPackage } from \"read-pkg\";\nimport type { Project } from \"ts-morph\";\nimport type { GeneratePieceArgs } from \"../types.js\";\nimport { installAddedDependencies } from \"../utils/install-added-dependencies.js\";\n\n// The id a block type will name, asked for only where deriving one would claim\n// a namespace nobody owns; CI, with no TTY, takes the derived value.\nasync function resolvePieceId(v: {\n project: Project;\n projectDir: string;\n pieceName: string;\n id?: string;\n}): Promise<string> {\n if (v.id) return v.id;\n const pkg = await readPackage({ cwd: v.projectDir, normalize: false });\n const { id, needsConfirmation } = derivePieceId({\n packageName: pkg.name ?? \"\",\n slug: kebabCase(v.pieceName),\n hasOtherPieces: readPiecesList(v.project).length > 0,\n });\n if (!needsConfirmation || !process.stdin.isTTY) return id;\n const { prompt } = enquirer;\n const result = await prompt<{ pieceId: string }>([\n {\n type: \"input\",\n name: \"pieceId\",\n message:\n \"What id should this piece have? A workflow step names it as its pieceName.\",\n initial: id,\n required: true,\n },\n ]);\n return result.pieceId || id;\n}\n\nexport async function startGeneratePiece(\n args: GeneratePieceArgs,\n projectDir: string,\n) {\n const {\n namePositional,\n name: nameOption,\n id,\n auth,\n description,\n dir,\n all,\n debug,\n } = args;\n if (debug) {\n console.log({ args });\n }\n const project = buildTsMorphProject(projectDir);\n const name = namePositional ?? nameOption;\n if (all) {\n await generateAllPieces(project);\n } else if (dir) {\n await generateAllPieces(project, basename(dir.replace(/\\/+$/, \"\")));\n } else if (name) {\n const pieceId = await resolvePieceId({\n project,\n projectDir,\n pieceName: name,\n id,\n });\n await generatePiece(\n { pieceName: name, pieceId, auth, description },\n project,\n );\n } else {\n console.log(\"Please specify one of `name`, `dir`, or `all`.\");\n return;\n }\n await project.save();\n const added = await syncFeatureDependencies(\n detectFeatures(projectDir),\n projectDir,\n );\n await installAddedDependencies(added, projectDir, args.skipInstall);\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA,eAAe,eAAe,GAKV;CAClB,IAAI,EAAE,IAAI,OAAO,EAAE;CACnB,MAAM,MAAM,MAAM,YAAY;EAAE,KAAK,EAAE;EAAY,WAAW;CAAM,CAAC;CACrE,MAAM,EAAE,IAAI,sBAAsB,cAAc;EAC9C,aAAa,IAAI,QAAQ;EACzB,MAAM,UAAU,EAAE,SAAS;EAC3B,gBAAgB,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS;CACrD,CAAC;CACD,IAAI,CAAC,qBAAqB,CAAC,QAAQ,MAAM,OAAO,OAAO;CACvD,MAAM,EAAE,WAAW;CAWnB,QAAO,MAVc,OAA4B,CAC/C;EACE,MAAM;EACN,MAAM;EACN,SACE;EACF,SAAS;EACT,UAAU;CACZ,CACF,CAAC,EAAA,CACa,WAAW;AAC3B;AAEA,eAAsB,mBACpB,MACA,YACA;CACA,MAAM,EACJ,gBACA,MAAM,YACN,IACA,MACA,aACA,KACA,KACA,UACE;CACJ,IAAI,OACF,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEtB,MAAM,UAAU,oBAAoB,UAAU;CAC9C,MAAM,OAAO,kBAAkB;CAC/B,IAAI,KACF,MAAM,kBAAkB,OAAO;MAC1B,IAAI,KACT,MAAM,kBAAkB,SAAS,SAAS,IAAI,QAAQ,QAAQ,EAAE,CAAC,CAAC;MAC7D,IAAI,MAAM;EACf,MAAM,UAAU,MAAM,eAAe;GACnC;GACA;GACA,WAAW;GACX;EACF,CAAC;EACD,MAAM,cACJ;GAAE,WAAW;GAAM;GAAS;GAAM;EAAY,GAC9C,OACF;CACF,OAAO;EACL,QAAQ,IAAI,gDAAgD;EAC5D;CACF;CACA,MAAM,QAAQ,KAAK;CACnB,MAAM,QAAQ,MAAM,wBAClB,eAAe,UAAU,GACzB,UACF;CACA,MAAM,yBAAyB,OAAO,YAAY,KAAK,WAAW;AACpE","debug_id":"8b015725-4996-50bb-890c-e6cf4750fe5e"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="5a77c310-3860-5275-b99c-231487fb6bf6")}catch(e){}}();
|
|
3
|
+
import { t as installAddedDependencies } from "./install-added-dependencies-DVSbzler.mjs";
|
|
3
4
|
import { detectFeatures, generatePieceAction, syncFeatureDependencies } from "@powerhousedao/codegen";
|
|
4
5
|
import { buildTsMorphProject } from "@powerhousedao/codegen/utils";
|
|
5
6
|
//#region src/services/generate-piece-action.ts
|
|
@@ -17,10 +18,11 @@ async function startGeneratePieceAction(args, projectDir) {
|
|
|
17
18
|
actionName
|
|
18
19
|
}, project);
|
|
19
20
|
await project.save();
|
|
20
|
-
await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
21
|
+
const added = await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
22
|
+
await installAddedDependencies(added, projectDir, args.skipInstall);
|
|
21
23
|
}
|
|
22
24
|
//#endregion
|
|
23
25
|
export { startGeneratePieceAction };
|
|
24
26
|
|
|
25
|
-
//# sourceMappingURL=generate-piece-action-
|
|
26
|
-
//# debugId=
|
|
27
|
+
//# sourceMappingURL=generate-piece-action-C5WTHsqu.mjs.map
|
|
28
|
+
//# debugId=5a77c310-3860-5275-b99c-231487fb6bf6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-piece-action-C5WTHsqu.mjs","sources":["../src/services/generate-piece-action.ts"],"sourcesContent":["import {\n detectFeatures,\n generatePieceAction,\n syncFeatureDependencies,\n} from \"@powerhousedao/codegen\";\nimport { buildTsMorphProject } from \"@powerhousedao/codegen/utils\";\nimport type { GeneratePieceActionArgs } from \"../types.js\";\nimport { installAddedDependencies } from \"../utils/install-added-dependencies.js\";\n\nexport async function startGeneratePieceAction(\n args: GeneratePieceActionArgs,\n projectDir: string,\n) {\n const { namePositional, name: nameOption, piece, debug } = args;\n if (debug) {\n console.log({ args });\n }\n const actionName = namePositional ?? nameOption;\n if (!actionName) {\n console.log(\"Please specify the name of the action to generate.\");\n return;\n }\n const project = buildTsMorphProject(projectDir);\n await generatePieceAction({ pieceDir: piece, actionName }, project);\n await project.save();\n const added = await syncFeatureDependencies(\n detectFeatures(projectDir),\n projectDir,\n );\n await installAddedDependencies(added, projectDir, args.skipInstall);\n}\n"],"names":[],"mappings":";;;;;;AASA,eAAsB,yBACpB,MACA,YACA;CACA,MAAM,EAAE,gBAAgB,MAAM,YAAY,OAAO,UAAU;CAC3D,IAAI,OACF,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEtB,MAAM,aAAa,kBAAkB;CACrC,IAAI,CAAC,YAAY;EACf,QAAQ,IAAI,oDAAoD;EAChE;CACF;CACA,MAAM,UAAU,oBAAoB,UAAU;CAC9C,MAAM,oBAAoB;EAAE,UAAU;EAAO;CAAW,GAAG,OAAO;CAClE,MAAM,QAAQ,KAAK;CACnB,MAAM,QAAQ,MAAM,wBAClB,eAAe,UAAU,GACzB,UACF;CACA,MAAM,yBAAyB,OAAO,YAAY,KAAK,WAAW;AACpE","debug_id":"5a77c310-3860-5275-b99c-231487fb6bf6"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="8425cd42-69a1-5c64-a003-d5c5ed622abd")}catch(e){}}();
|
|
3
|
+
import { t as installAddedDependencies } from "./install-added-dependencies-DVSbzler.mjs";
|
|
3
4
|
import { detectFeatures, generatePieceTrigger, syncFeatureDependencies } from "@powerhousedao/codegen";
|
|
4
5
|
import { buildTsMorphProject } from "@powerhousedao/codegen/utils";
|
|
5
6
|
//#region src/services/generate-piece-trigger.ts
|
|
@@ -18,10 +19,11 @@ async function startGeneratePieceTrigger(args, projectDir) {
|
|
|
18
19
|
strategy
|
|
19
20
|
}, project);
|
|
20
21
|
await project.save();
|
|
21
|
-
await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
22
|
+
const added = await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
23
|
+
await installAddedDependencies(added, projectDir, args.skipInstall);
|
|
22
24
|
}
|
|
23
25
|
//#endregion
|
|
24
26
|
export { startGeneratePieceTrigger };
|
|
25
27
|
|
|
26
|
-
//# sourceMappingURL=generate-piece-trigger-
|
|
27
|
-
//# debugId=
|
|
28
|
+
//# sourceMappingURL=generate-piece-trigger-DR10CPOG.mjs.map
|
|
29
|
+
//# debugId=8425cd42-69a1-5c64-a003-d5c5ed622abd
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-piece-trigger-DR10CPOG.mjs","sources":["../src/services/generate-piece-trigger.ts"],"sourcesContent":["import {\n detectFeatures,\n generatePieceTrigger,\n syncFeatureDependencies,\n} from \"@powerhousedao/codegen\";\nimport { buildTsMorphProject } from \"@powerhousedao/codegen/utils\";\nimport type { GeneratePieceTriggerArgs } from \"../types.js\";\nimport { installAddedDependencies } from \"../utils/install-added-dependencies.js\";\n\nexport async function startGeneratePieceTrigger(\n args: GeneratePieceTriggerArgs,\n projectDir: string,\n) {\n const { namePositional, name: nameOption, piece, strategy, debug } = args;\n if (debug) {\n console.log({ args });\n }\n const triggerName = namePositional ?? nameOption;\n if (!triggerName) {\n console.log(\"Please specify the name of the trigger to generate.\");\n return;\n }\n const project = buildTsMorphProject(projectDir);\n await generatePieceTrigger(\n { pieceDir: piece, triggerName, strategy },\n project,\n );\n await project.save();\n const added = await syncFeatureDependencies(\n detectFeatures(projectDir),\n projectDir,\n );\n await installAddedDependencies(added, projectDir, args.skipInstall);\n}\n"],"names":[],"mappings":";;;;;;AASA,eAAsB,0BACpB,MACA,YACA;CACA,MAAM,EAAE,gBAAgB,MAAM,YAAY,OAAO,UAAU,UAAU;CACrE,IAAI,OACF,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEtB,MAAM,cAAc,kBAAkB;CACtC,IAAI,CAAC,aAAa;EAChB,QAAQ,IAAI,qDAAqD;EACjE;CACF;CACA,MAAM,UAAU,oBAAoB,UAAU;CAC9C,MAAM,qBACJ;EAAE,UAAU;EAAO;EAAa;CAAS,GACzC,OACF;CACA,MAAM,QAAQ,KAAK;CACnB,MAAM,QAAQ,MAAM,wBAClB,eAAe,UAAU,GACzB,UACF;CACA,MAAM,yBAAyB,OAAO,YAAY,KAAK,WAAW;AACpE","debug_id":"8425cd42-69a1-5c64-a003-d5c5ed622abd"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="4c9267c1-f9f5-5d39-a420-380970da035c")}catch(e){}}();
|
|
3
|
+
import { t as installAddedDependencies } from "./install-added-dependencies-DVSbzler.mjs";
|
|
3
4
|
import { dirname } from "node:path";
|
|
4
5
|
import { detectFeatures, generateAllProcessors, generateProcessor, syncFeatureDependencies } from "@powerhousedao/codegen";
|
|
5
6
|
import { buildTsMorphProject, getProcessorMetadata } from "@powerhousedao/codegen/utils";
|
|
@@ -36,10 +37,11 @@ async function startGenerateProcessor(args, projectDir) {
|
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
await project.save();
|
|
39
|
-
await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
40
|
+
const added = await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
41
|
+
await installAddedDependencies(added, projectDir, args.skipInstall);
|
|
40
42
|
}
|
|
41
43
|
//#endregion
|
|
42
44
|
export { startGenerateProcessor };
|
|
43
45
|
|
|
44
|
-
//# sourceMappingURL=generate-processor-
|
|
45
|
-
//# debugId=
|
|
46
|
+
//# sourceMappingURL=generate-processor-DBtTkgo5.mjs.map
|
|
47
|
+
//# debugId=4c9267c1-f9f5-5d39-a420-380970da035c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-processor-DBtTkgo5.mjs","sources":["../src/services/generate-processor.ts"],"sourcesContent":["import {\n detectFeatures,\n generateAllProcessors,\n generateProcessor,\n syncFeatureDependencies,\n} from \"@powerhousedao/codegen\";\nimport {\n buildTsMorphProject,\n getProcessorMetadata,\n} from \"@powerhousedao/codegen/utils\";\nimport {\n extractProcessorDocuments,\n generateProcessorFromDocument,\n getDocument,\n saveSpec,\n} from \"@powerhousedao/vetra/codegen\";\nimport type { ProcessorModuleDocument } from \"@powerhousedao/vetra/document-models/processor-module\";\nimport { dirname } from \"node:path\";\nimport type { GenerateProcessorArgs } from \"../types.js\";\nimport { installAddedDependencies } from \"../utils/install-added-dependencies.js\";\n\nexport async function startGenerateProcessor(\n args: GenerateProcessorArgs,\n projectDir: string,\n) {\n const {\n name: processorName,\n type: processorType,\n apps: processorApps,\n documentTypes,\n document,\n dir,\n all,\n extract,\n debug,\n } = args;\n if (debug) {\n console.log({ args });\n }\n const project = buildTsMorphProject(projectDir);\n if (extract) {\n const docs = extractProcessorDocuments(project);\n for (const doc of docs) {\n const path = await saveSpec(doc, projectDir);\n console.log(`Wrote ${path}`);\n }\n return;\n }\n if (all) {\n await generateAllProcessors(project);\n } else if (document) {\n const doc = (await getDocument(document)) as ProcessorModuleDocument;\n await generateProcessorFromDocument(doc, project);\n } else if (processorName) {\n await generateProcessor(\n {\n processorName,\n processorApps,\n processorType,\n documentTypes,\n },\n project,\n );\n } else if (dir) {\n const processorDirName = dirname(dir);\n const processorArgs = getProcessorMetadata(project, processorDirName);\n await generateProcessor(processorArgs, project);\n } else {\n console.log(\n \"Please specify one of `name`, `document`, `dir`, `all`, or `extract`.\",\n );\n return;\n }\n await project.save();\n const added = await syncFeatureDependencies(\n detectFeatures(projectDir),\n projectDir,\n );\n await installAddedDependencies(added, projectDir, args.skipInstall);\n}\n"],"names":[],"mappings":";;;;;;;;AAqBA,eAAsB,uBACpB,MACA,YACA;CACA,MAAM,EACJ,MAAM,eACN,MAAM,eACN,MAAM,eACN,eACA,UACA,KACA,KACA,SACA,UACE;CACJ,IAAI,OACF,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEtB,MAAM,UAAU,oBAAoB,UAAU;CAC9C,IAAI,SAAS;EACX,MAAM,OAAO,0BAA0B,OAAO;EAC9C,KAAK,MAAM,OAAO,MAAM;GACtB,MAAM,OAAO,MAAM,SAAS,KAAK,UAAU;GAC3C,QAAQ,IAAI,SAAS,MAAM;EAC7B;EACA;CACF;CACA,IAAI,KACF,MAAM,sBAAsB,OAAO;MAC9B,IAAI,UAAU;EACnB,MAAM,MAAO,MAAM,YAAY,QAAQ;EACvC,MAAM,8BAA8B,KAAK,OAAO;CAClD,OAAO,IAAI,eACT,MAAM,kBACJ;EACE;EACA;EACA;EACA;CACF,GACA,OACF;MACK,IAAI,KAAK;EACd,MAAM,mBAAmB,QAAQ,GAAG;EACpC,MAAM,gBAAgB,qBAAqB,SAAS,gBAAgB;EACpE,MAAM,kBAAkB,eAAe,OAAO;CAChD,OAAO;EACL,QAAQ,IACN,uEACF;EACA;CACF;CACA,MAAM,QAAQ,KAAK;CACnB,MAAM,QAAQ,MAAM,wBAClB,eAAe,UAAU,GACzB,UACF;CACA,MAAM,yBAAyB,OAAO,YAAY,KAAK,WAAW;AACpE","debug_id":"4c9267c1-f9f5-5d39-a420-380970da035c"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="e6f7e480-790a-5892-8662-eb9ba2632ed4")}catch(e){}}();
|
|
3
|
+
import { t as installAddedDependencies } from "./install-added-dependencies-DVSbzler.mjs";
|
|
3
4
|
import { dirname } from "node:path";
|
|
4
5
|
import { detectFeatures, generateAllSubgraphs, generateSubgraph, syncFeatureDependencies } from "@powerhousedao/codegen";
|
|
5
6
|
import { buildTsMorphProject, getSubgraphMetadata } from "@powerhousedao/codegen/utils";
|
|
@@ -31,10 +32,11 @@ async function startGenerateSubgraph(args, projectDir) {
|
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
await project.save();
|
|
34
|
-
await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
35
|
+
const added = await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
36
|
+
await installAddedDependencies(added, projectDir, args.skipInstall);
|
|
35
37
|
}
|
|
36
38
|
//#endregion
|
|
37
39
|
export { startGenerateSubgraph };
|
|
38
40
|
|
|
39
|
-
//# sourceMappingURL=generate-subgraph-
|
|
40
|
-
//# debugId=
|
|
41
|
+
//# sourceMappingURL=generate-subgraph-Dm27O59o.mjs.map
|
|
42
|
+
//# debugId=e6f7e480-790a-5892-8662-eb9ba2632ed4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-subgraph-Dm27O59o.mjs","sources":["../src/services/generate-subgraph.ts"],"sourcesContent":["import {\n detectFeatures,\n generateAllSubgraphs,\n generateSubgraph,\n syncFeatureDependencies,\n} from \"@powerhousedao/codegen\";\nimport {\n buildTsMorphProject,\n getSubgraphMetadata,\n} from \"@powerhousedao/codegen/utils\";\nimport {\n extractSubgraphDocuments,\n generateSubgraphFromDocument,\n getDocument,\n saveSpec,\n} from \"@powerhousedao/vetra/codegen\";\nimport type { SubgraphModuleDocument } from \"@powerhousedao/vetra/document-models/subgraph-module\";\nimport { dirname } from \"node:path\";\nimport type { GenerateSubgraphArgs } from \"../types.js\";\nimport { installAddedDependencies } from \"../utils/install-added-dependencies.js\";\n\nexport async function startGenerateSubgraph(\n args: GenerateSubgraphArgs,\n projectDir: string,\n) {\n const { name, document, dir, all, extract, debug } = args;\n if (debug) {\n console.log({ args });\n }\n const project = buildTsMorphProject(projectDir);\n if (extract) {\n const docs = extractSubgraphDocuments(project);\n for (const doc of docs) {\n const path = await saveSpec(doc, projectDir);\n console.log(`Wrote ${path}`);\n }\n return;\n }\n if (all) {\n await generateAllSubgraphs(project);\n } else if (document) {\n const doc = (await getDocument(document)) as SubgraphModuleDocument;\n await generateSubgraphFromDocument(doc, project);\n } else if (name) {\n await generateSubgraph(name, project);\n } else if (dir) {\n const { subgraphName } = getSubgraphMetadata(project, dirname(dir));\n if (!subgraphName) {\n throw new Error(`Failed to get data for subgraph in dir \"${dir}\"`);\n }\n await generateSubgraph(subgraphName, project);\n } else {\n console.log(\n \"Please specify one of `name`, `document`, `dir`, `all`, or `extract`.\",\n );\n return;\n }\n await project.save();\n const added = await syncFeatureDependencies(\n detectFeatures(projectDir),\n projectDir,\n );\n await installAddedDependencies(added, projectDir, args.skipInstall);\n}\n"],"names":[],"mappings":";;;;;;;;AAqBA,eAAsB,sBACpB,MACA,YACA;CACA,MAAM,EAAE,MAAM,UAAU,KAAK,KAAK,SAAS,UAAU;CACrD,IAAI,OACF,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEtB,MAAM,UAAU,oBAAoB,UAAU;CAC9C,IAAI,SAAS;EACX,MAAM,OAAO,yBAAyB,OAAO;EAC7C,KAAK,MAAM,OAAO,MAAM;GACtB,MAAM,OAAO,MAAM,SAAS,KAAK,UAAU;GAC3C,QAAQ,IAAI,SAAS,MAAM;EAC7B;EACA;CACF;CACA,IAAI,KACF,MAAM,qBAAqB,OAAO;MAC7B,IAAI,UAAU;EACnB,MAAM,MAAO,MAAM,YAAY,QAAQ;EACvC,MAAM,6BAA6B,KAAK,OAAO;CACjD,OAAO,IAAI,MACT,MAAM,iBAAiB,MAAM,OAAO;MAC/B,IAAI,KAAK;EACd,MAAM,EAAE,iBAAiB,oBAAoB,SAAS,QAAQ,GAAG,CAAC;EAClE,IAAI,CAAC,cACH,MAAM,IAAI,MAAM,2CAA2C,IAAI,EAAE;EAEnE,MAAM,iBAAiB,cAAc,OAAO;CAC9C,OAAO;EACL,QAAQ,IACN,uEACF;EACA;CACF;CACA,MAAM,QAAQ,KAAK;CACnB,MAAM,QAAQ,MAAM,wBAClB,eAAe,UAAU,GACzB,UACF;CACA,MAAM,yBAAyB,OAAO,YAAY,KAAK,WAAW;AACpE","debug_id":"e6f7e480-790a-5892-8662-eb9ba2632ed4"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
!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]="94ff9d9a-8051-5d68-9574-45469dd39a97")}catch(e){}}();
|
|
3
|
+
import { boolean, flag, optional } from "cmd-ts";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { detect, resolveCommand } from "package-manager-detector";
|
|
6
|
+
//#region src/utils/install-added-dependencies.ts
|
|
7
|
+
const skipInstallArgs = { skipInstall: flag({
|
|
8
|
+
type: optional(boolean),
|
|
9
|
+
long: "skip-install",
|
|
10
|
+
description: "Don't install the dependencies the command adds to package.json"
|
|
11
|
+
}) };
|
|
12
|
+
async function installAddedDependencies(added, projectDir, skipInstall) {
|
|
13
|
+
if (added.length === 0) return;
|
|
14
|
+
const agent = (await detect({ cwd: projectDir }))?.agent ?? "npm";
|
|
15
|
+
const resolved = resolveCommand(agent, "install", []);
|
|
16
|
+
if (!resolved) return;
|
|
17
|
+
const printed = [resolved.command, ...resolved.args].join(" ");
|
|
18
|
+
if (skipInstall) {
|
|
19
|
+
console.log(`Run \`${printed}\` to install them.`);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(`Installing with \`${printed}\`...`);
|
|
23
|
+
if (spawnSync(resolved.command, resolved.args, {
|
|
24
|
+
cwd: projectDir,
|
|
25
|
+
stdio: "inherit",
|
|
26
|
+
shell: process.platform === "win32"
|
|
27
|
+
}).status !== 0) console.warn(`Install failed. Run \`${printed}\` in ${projectDir} to install them.`);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { skipInstallArgs as n, installAddedDependencies as t };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=install-added-dependencies-DVSbzler.mjs.map
|
|
33
|
+
//# debugId=94ff9d9a-8051-5d68-9574-45469dd39a97
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-added-dependencies-DVSbzler.mjs","sources":["../src/utils/install-added-dependencies.ts"],"sourcesContent":["import { boolean, flag, optional } from \"cmd-ts\";\nimport { spawnSync } from \"node:child_process\";\nimport { detect, resolveCommand } from \"package-manager-detector\";\n\nexport const skipInstallArgs = {\n skipInstall: flag({\n type: optional(boolean),\n long: \"skip-install\",\n description:\n \"Don't install the dependencies the command adds to package.json\",\n }),\n};\n\n// Installs what a generate command just added to package.json. A failed\n// install doesn't fail the command: the files are written, so say what to run.\nexport async function installAddedDependencies(\n added: readonly string[],\n projectDir: string,\n skipInstall?: boolean,\n) {\n if (added.length === 0) return;\n const agent = (await detect({ cwd: projectDir }))?.agent ?? \"npm\";\n const resolved = resolveCommand(agent, \"install\", []);\n if (!resolved) return;\n const printed = [resolved.command, ...resolved.args].join(\" \");\n if (skipInstall) {\n console.log(`Run \\`${printed}\\` to install them.`);\n return;\n }\n console.log(`Installing with \\`${printed}\\`...`);\n const result = spawnSync(resolved.command, resolved.args, {\n cwd: projectDir,\n stdio: \"inherit\",\n shell: process.platform === \"win32\",\n });\n if (result.status !== 0) {\n console.warn(\n `Install failed. Run \\`${printed}\\` in ${projectDir} to install them.`,\n );\n }\n}\n"],"names":[],"mappings":";;;;;;AAIA,MAAa,kBAAkB,EAC7B,aAAa,KAAK;CAChB,MAAM,SAAS,OAAO;CACtB,MAAM;CACN,aACE;AACJ,CAAC,EACH;AAIA,eAAsB,yBACpB,OACA,YACA,aACA;CACA,IAAI,MAAM,WAAW,GAAG;CACxB,MAAM,SAAS,MAAM,OAAO,EAAE,KAAK,WAAW,CAAC,EAAA,EAAI,SAAS;CAC5D,MAAM,WAAW,eAAe,OAAO,WAAW,CAAC,CAAC;CACpD,IAAI,CAAC,UAAU;CACf,MAAM,UAAU,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,CAAC,CAAC,KAAK,GAAG;CAC7D,IAAI,aAAa;EACf,QAAQ,IAAI,SAAS,QAAQ,oBAAoB;EACjD;CACF;CACA,QAAQ,IAAI,qBAAqB,QAAQ,MAAM;CAM/C,IALe,UAAU,SAAS,SAAS,SAAS,MAAM;EACxD,KAAK;EACL,OAAO;EACP,OAAO,QAAQ,aAAa;CAC9B,CACS,CAAC,CAAC,WAAW,GACpB,QAAQ,KACN,yBAAyB,QAAQ,QAAQ,WAAW,kBACtD;AAEJ","debug_id":"94ff9d9a-8051-5d68-9574-45469dd39a97"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="11a86cb2-334f-5f8e-a429-21073582abb3")}catch(e){}}();
|
|
3
3
|
import { execSync } from "node:child_process";
|
|
4
|
+
import { detect, resolveCommand } from "package-manager-detector";
|
|
4
5
|
import { readFileSync } from "node:fs";
|
|
5
6
|
import { dirname, join } from "node:path";
|
|
6
|
-
import { detect, resolveCommand } from "package-manager-detector";
|
|
7
7
|
import { fetchPackageVersionFromNpmRegistry, injectPnpmAllowBuilds } from "@powerhousedao/shared/clis";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
//#region src/services/migrate.ts
|
|
@@ -79,5 +79,5 @@ async function startMigrate({ versionPositional, version, force, debug }) {
|
|
|
79
79
|
//#endregion
|
|
80
80
|
export { startMigrate };
|
|
81
81
|
|
|
82
|
-
//# sourceMappingURL=migrate-
|
|
83
|
-
//# debugId=
|
|
82
|
+
//# sourceMappingURL=migrate-B6QBYDNX.mjs.map
|
|
83
|
+
//# debugId=11a86cb2-334f-5f8e-a429-21073582abb3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-
|
|
1
|
+
{"version":3,"file":"migrate-B6QBYDNX.mjs","sources":["../src/services/migrate.ts"],"sourcesContent":["import {\n fetchPackageVersionFromNpmRegistry,\n injectPnpmAllowBuilds,\n} from \"@powerhousedao/shared/clis\";\nimport { execSync } from \"node:child_process\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { detect, resolveCommand } from \"package-manager-detector\";\nimport type { MigrateArgs } from \"../types.js\";\n\nfunction getBundledPhCliVersion(): string | undefined {\n let dir = dirname(fileURLToPath(import.meta.url));\n for (let i = 0; i < 5; i++) {\n try {\n const pkg = JSON.parse(\n readFileSync(join(dir, \"package.json\"), \"utf8\"),\n ) as { name?: string; version?: string };\n if (pkg.name === \"@powerhousedao/ph-cli\") return pkg.version;\n } catch {\n // keep walking\n }\n dir = dirname(dir);\n }\n}\n\nexport function resolveCodegenVersion(\n codegenMod: Record<string, unknown>,\n): string | undefined {\n const getter = codegenMod.getCodegenVersion;\n if (typeof getter === \"function\") {\n const v = (getter as () => unknown)();\n if (typeof v === \"string\") return v;\n }\n return undefined;\n}\n\nexport function assertCodegenMatchesBundled(args: {\n codegenVersion: string | undefined;\n bundledVersion: string | undefined;\n force: boolean;\n}): void {\n const { codegenVersion, bundledVersion, force } = args;\n if (force) return;\n if (!codegenVersion) {\n throw new Error(\n `@powerhousedao/codegen is older than this ph-cli expects (no version export). ` +\n `Reinstall ph-cli to bring a matching codegen, or re-run with --force.`,\n );\n }\n if (bundledVersion && codegenVersion !== bundledVersion) {\n throw new Error(\n `@powerhousedao/codegen@${codegenVersion} does not match ph-cli@${bundledVersion}. ` +\n `Reinstall to align versions, or re-run with --force.`,\n );\n }\n}\n\nexport async function startMigrate({\n versionPositional,\n version,\n force,\n debug,\n}: MigrateArgs) {\n const requested = versionPositional ?? version;\n if (debug) console.log(`[migrate] requested version: ${requested}`);\n\n let targetVersion: string | undefined;\n try {\n targetVersion = await fetchPackageVersionFromNpmRegistry(\n `@powerhousedao/ph-cli@${requested}`,\n );\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n if (!force) {\n throw new Error(\n `Failed to resolve \"${requested}\" from the npm registry: ${reason}\\nRe-run with --force to migrate using the installed version.`,\n { cause: error },\n );\n }\n if (debug) {\n console.log(\n `[migrate] failed to resolve target version, --force is set, falling back to bundled codegen: ${reason}`,\n );\n }\n }\n\n const bundledVersion = getBundledPhCliVersion();\n if (debug) {\n console.log(\n `[migrate] resolved target version: ${targetVersion ?? \"(unknown)\"}`,\n );\n console.log(\n `[migrate] current ph-cli version: ${bundledVersion ?? \"(unknown)\"}`,\n );\n }\n\n if (!targetVersion || force || targetVersion === bundledVersion) {\n if (debug) console.log(`[migrate] running migrate from bundled codegen`);\n const codegenMod = await import(\"@powerhousedao/codegen\");\n const codegenVersion = resolveCodegenVersion(\n codegenMod as unknown as Record<string, unknown>,\n );\n assertCodegenMatchesBundled({\n codegenVersion,\n bundledVersion,\n force: Boolean(force),\n });\n console.log(\n `Running migrate with @powerhousedao/codegen@${codegenVersion ?? \"unknown\"}`,\n );\n await codegenMod.migrate(targetVersion ?? requested);\n return;\n }\n\n const agent = (await detect())?.agent ?? \"npm\";\n const resolved = resolveCommand(agent, \"execute\", [\n `@powerhousedao/ph-cli@${targetVersion}`,\n \"migrate\",\n \"--version\",\n targetVersion,\n ...(debug ? [\"--debug\"] : []),\n ]);\n if (!resolved) {\n throw new Error(\n `Failed to resolve execute command for package manager \"${agent}\".`,\n );\n }\n\n injectPnpmAllowBuilds(agent, resolved);\n\n const command = `${resolved.command} ${resolved.args.join(\" \")}`;\n if (debug) {\n console.log(`[migrate] detected package manager: ${agent}`);\n console.log(`[migrate] re-executing: ${command}`);\n }\n execSync(command, { stdio: \"inherit\" });\n}\n"],"names":[],"mappings":";;;;;;;;;AAWA,SAAS,yBAA6C;CACpD,IAAI,MAAM,QAAQ,cAAc,YAAY,GAAG,CAAC;CAChD,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;EAC1B,IAAI;GACF,MAAM,MAAM,KAAK,MACf,aAAa,KAAK,KAAK,cAAc,GAAG,MAAM,CAChD;GACA,IAAI,IAAI,SAAS,yBAAyB,OAAO,IAAI;EACvD,QAAQ,CAER;EACA,MAAM,QAAQ,GAAG;CACnB;AACF;AAEA,SAAgB,sBACd,YACoB;CACpB,MAAM,SAAS,WAAW;CAC1B,IAAI,OAAO,WAAW,YAAY;EAChC,MAAM,IAAK,OAAyB;EACpC,IAAI,OAAO,MAAM,UAAU,OAAO;CACpC;AAEF;AAEA,SAAgB,4BAA4B,MAInC;CACP,MAAM,EAAE,gBAAgB,gBAAgB,UAAU;CAClD,IAAI,OAAO;CACX,IAAI,CAAC,gBACH,MAAM,IAAI,MACR,qJAEF;CAEF,IAAI,kBAAkB,mBAAmB,gBACvC,MAAM,IAAI,MACR,0BAA0B,eAAe,yBAAyB,eAAe,uDAEnF;AAEJ;AAEA,eAAsB,aAAa,EACjC,mBACA,SACA,OACA,SACc;CACd,MAAM,YAAY,qBAAqB;CACvC,IAAI,OAAO,QAAQ,IAAI,gCAAgC,WAAW;CAElE,IAAI;CACJ,IAAI;EACF,gBAAgB,MAAM,mCACpB,yBAAyB,WAC3B;CACF,SAAS,OAAO;EACd,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACpE,IAAI,CAAC,OACH,MAAM,IAAI,MACR,sBAAsB,UAAU,2BAA2B,OAAO,gEAClE,EAAE,OAAO,MAAM,CACjB;EAEF,IAAI,OACF,QAAQ,IACN,gGAAgG,QAClG;CAEJ;CAEA,MAAM,iBAAiB,uBAAuB;CAC9C,IAAI,OAAO;EACT,QAAQ,IACN,sCAAsC,iBAAiB,aACzD;EACA,QAAQ,IACN,qCAAqC,kBAAkB,aACzD;CACF;CAEA,IAAI,CAAC,iBAAiB,SAAS,kBAAkB,gBAAgB;EAC/D,IAAI,OAAO,QAAQ,IAAI,gDAAgD;EACvE,MAAM,aAAa,MAAM,OAAO;EAChC,MAAM,iBAAiB,sBACrB,UACF;EACA,4BAA4B;GAC1B;GACA;GACA,OAAO,QAAQ,KAAK;EACtB,CAAC;EACD,QAAQ,IACN,+CAA+C,kBAAkB,WACnE;EACA,MAAM,WAAW,QAAQ,iBAAiB,SAAS;EACnD;CACF;CAEA,MAAM,SAAS,MAAM,OAAO,EAAA,EAAI,SAAS;CACzC,MAAM,WAAW,eAAe,OAAO,WAAW;EAChD,yBAAyB;EACzB;EACA;EACA;EACA,GAAI,QAAQ,CAAC,SAAS,IAAI,CAAC;CAC7B,CAAC;CACD,IAAI,CAAC,UACH,MAAM,IAAI,MACR,0DAA0D,MAAM,GAClE;CAGF,sBAAsB,OAAO,QAAQ;CAErC,MAAM,UAAU,GAAG,SAAS,QAAQ,GAAG,SAAS,KAAK,KAAK,GAAG;CAC7D,IAAI,OAAO;EACT,QAAQ,IAAI,uCAAuC,OAAO;EAC1D,QAAQ,IAAI,2BAA2B,SAAS;CAClD;CACA,SAAS,SAAS,EAAE,OAAO,UAAU,CAAC;AACxC","debug_id":"11a86cb2-334f-5f8e-a429-21073582abb3"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="e51b80bc-6b99-5160-8676-10829ab96d29")}catch(e){}}();
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { startSwitchboard } from "@powerhousedao/switchboard/server";
|
|
5
5
|
//#region src/services/switchboard.ts
|
|
6
|
+
const EGRESS_ALLOW_ENV = "PH_WORKFLOWS_EGRESS_ALLOW_ADDRESSES";
|
|
7
|
+
const LOCALHOST_ADDRESSES = ["127.0.0.1/32", "::1/128"];
|
|
8
|
+
function allowLocalhostEgress(env = process.env) {
|
|
9
|
+
const current = (env[EGRESS_ALLOW_ENV] ?? "").split(",").map((entry) => entry.trim()).filter((entry) => entry !== "");
|
|
10
|
+
const missing = LOCALHOST_ADDRESSES.filter((address) => !current.includes(address));
|
|
11
|
+
if (missing.length > 0) env[EGRESS_ALLOW_ENV] = [...current, ...missing].join(",");
|
|
12
|
+
}
|
|
6
13
|
const defaultSwitchboardOptions = {
|
|
7
14
|
port: 4001,
|
|
8
15
|
dbPath: path.join(process.cwd(), ".ph/read-model.db"),
|
|
@@ -45,6 +52,7 @@ function getDefaultVetraSwitchboardOptions(vetraDriveId) {
|
|
|
45
52
|
}
|
|
46
53
|
async function startSwitchboard$1(options, logger) {
|
|
47
54
|
const { packages: packagesString, remoteDrives, useVetraDrive, vetraDriveId, useIdentity, keypairPath, requireIdentity, ...serverOptions } = options;
|
|
55
|
+
if (useVetraDrive || serverOptions.dev) allowLocalhostEgress();
|
|
48
56
|
const defaultOptions = useVetraDrive ? getDefaultVetraSwitchboardOptions(vetraDriveId) : defaultSwitchboardOptions;
|
|
49
57
|
const identity = useIdentity || keypairPath || requireIdentity ? {
|
|
50
58
|
keypairPath,
|
|
@@ -73,7 +81,7 @@ async function startSwitchboard$1(options, logger) {
|
|
|
73
81
|
});
|
|
74
82
|
}
|
|
75
83
|
//#endregion
|
|
76
|
-
export { startSwitchboard$1 as
|
|
84
|
+
export { defaultSwitchboardOptions as n, startSwitchboard$1 as r, allowLocalhostEgress as t };
|
|
77
85
|
|
|
78
|
-
//# sourceMappingURL=switchboard-
|
|
79
|
-
//# debugId=
|
|
86
|
+
//# sourceMappingURL=switchboard-CgVB4U76.mjs.map
|
|
87
|
+
//# debugId=e51b80bc-6b99-5160-8676-10829ab96d29
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switchboard-CgVB4U76.mjs","sources":["../src/services/switchboard.ts"],"sourcesContent":["import type {\n IdentityOptions,\n StartServerOptions,\n} from \"@powerhousedao/switchboard/server\";\nimport { startSwitchboard as startSwitchboardServer } from \"@powerhousedao/switchboard/server\";\nimport type { ILogger } from \"document-model\";\nimport path from \"node:path\";\nimport type { SwitchboardArgs } from \"../types.js\";\n\nconst EGRESS_ALLOW_ENV = \"PH_WORKFLOWS_EGRESS_ALLOW_ADDRESSES\";\nconst LOCALHOST_ADDRESSES = [\"127.0.0.1/32\", \"::1/128\"];\n\n// Lets pieces reach services on this machine, keeping any addresses already set\nexport function allowLocalhostEgress(env: NodeJS.ProcessEnv = process.env) {\n const current = (env[EGRESS_ALLOW_ENV] ?? \"\")\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry !== \"\");\n const missing = LOCALHOST_ADDRESSES.filter(\n (address) => !current.includes(address),\n );\n if (missing.length > 0)\n env[EGRESS_ALLOW_ENV] = [...current, ...missing].join(\",\");\n}\n\nexport const defaultSwitchboardOptions = {\n port: 4001,\n dbPath: path.join(process.cwd(), \".ph/read-model.db\"),\n drive: {\n id: \"powerhouse\",\n slug: \"powerhouse\",\n global: {\n name: \"Powerhouse\",\n icon: \"https://ipfs.io/ipfs/QmcaTDBYn8X2psGaXe7iQ6qd8q6oqHLgxvMX9yXf7f9uP7\",\n },\n local: {\n availableOffline: true,\n listeners: [],\n sharingType: \"public\",\n triggers: [],\n },\n },\n mcp: true,\n} satisfies StartServerOptions;\n\nfunction getDefaultVetraSwitchboardOptions(\n vetraDriveId: string,\n): Partial<StartServerOptions> {\n return {\n port: 4001,\n dbPath: path.join(process.cwd(), \".ph/read-model.db\"),\n drive: {\n id: vetraDriveId,\n slug: vetraDriveId,\n global: {\n name: \"Vetra\",\n icon: \"https://azure-elderly-tortoise-212.mypinata.cloud/ipfs/bafkreibf2xokjqqtomqjd2w2xxmmhvogq4262csevclxh6sbrjgmjfre5u\",\n },\n preferredEditor: \"vetra-drive-app\",\n local: {\n availableOffline: true,\n listeners: [],\n sharingType: \"public\",\n triggers: [],\n },\n },\n };\n}\n\nexport async function startSwitchboard(\n options: SwitchboardArgs & {\n strictPort?: boolean;\n processorConfig?: Map<string, unknown>;\n },\n logger?: ILogger,\n) {\n const {\n packages: packagesString,\n remoteDrives,\n useVetraDrive,\n vetraDriveId,\n useIdentity,\n keypairPath,\n requireIdentity,\n ...serverOptions\n } = options;\n\n // Vetra and dev mode run against local services\n if (useVetraDrive || serverOptions.dev) allowLocalhostEgress();\n\n // Choose the appropriate default configuration\n const defaultOptions = useVetraDrive\n ? getDefaultVetraSwitchboardOptions(vetraDriveId)\n : defaultSwitchboardOptions;\n\n // Build identity options if enabled\n const identity: IdentityOptions | undefined =\n useIdentity || keypairPath || requireIdentity\n ? {\n keypairPath,\n requireExisting: requireIdentity,\n }\n : undefined;\n\n const packages = packagesString?.split(\",\");\n\n // Only include the default drive if no remote drives are provided\n const finalOptions =\n remoteDrives.length > 0\n ? {\n ...defaultOptions,\n drive: undefined, // Don't create default drive when syncing with remote\n ...serverOptions,\n remoteDrives,\n identity,\n packages,\n logger,\n }\n : {\n ...defaultOptions,\n ...serverOptions,\n remoteDrives,\n identity,\n packages,\n logger,\n };\n\n const reactor = await startSwitchboardServer({\n ...finalOptions,\n fatalErrorShutdown: true,\n });\n\n return reactor;\n}\n"],"names":["startSwitchboard","startSwitchboardServer"],"mappings":";;;;;AASA,MAAM,mBAAmB;AACzB,MAAM,sBAAsB,CAAC,gBAAgB,SAAS;AAGtD,SAAgB,qBAAqB,MAAyB,QAAQ,KAAK;CACzE,MAAM,WAAW,IAAI,qBAAqB,GAAA,CACvC,MAAM,GAAG,CAAC,CACV,KAAK,UAAU,MAAM,KAAK,CAAC,CAAC,CAC5B,QAAQ,UAAU,UAAU,EAAE;CACjC,MAAM,UAAU,oBAAoB,QACjC,YAAY,CAAC,QAAQ,SAAS,OAAO,CACxC;CACA,IAAI,QAAQ,SAAS,GACnB,IAAI,oBAAoB,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,KAAK,GAAG;AAC7D;AAEA,MAAa,4BAA4B;CACvC,MAAM;CACN,QAAQ,KAAK,KAAK,QAAQ,IAAI,GAAG,mBAAmB;CACpD,OAAO;EACL,IAAI;EACJ,MAAM;EACN,QAAQ;GACN,MAAM;GACN,MAAM;EACR;EACA,OAAO;GACL,kBAAkB;GAClB,WAAW,CAAC;GACZ,aAAa;GACb,UAAU,CAAC;EACb;CACF;CACA,KAAK;AACP;AAEA,SAAS,kCACP,cAC6B;CAC7B,OAAO;EACL,MAAM;EACN,QAAQ,KAAK,KAAK,QAAQ,IAAI,GAAG,mBAAmB;EACpD,OAAO;GACL,IAAI;GACJ,MAAM;GACN,QAAQ;IACN,MAAM;IACN,MAAM;GACR;GACA,iBAAiB;GACjB,OAAO;IACL,kBAAkB;IAClB,WAAW,CAAC;IACZ,aAAa;IACb,UAAU,CAAC;GACb;EACF;CACF;AACF;AAEA,eAAsBA,mBACpB,SAIA,QACA;CACA,MAAM,EACJ,UAAU,gBACV,cACA,eACA,cACA,aACA,aACA,iBACA,GAAG,kBACD;CAGJ,IAAI,iBAAiB,cAAc,KAAK,qBAAqB;CAG7D,MAAM,iBAAiB,gBACnB,kCAAkC,YAAY,IAC9C;CAGJ,MAAM,WACJ,eAAe,eAAe,kBAC1B;EACE;EACA,iBAAiB;CACnB,IACA,KAAA;CAEN,MAAM,WAAW,gBAAgB,MAAM,GAAG;CAG1C,MAAM,eACJ,aAAa,SAAS,IAClB;EACE,GAAG;EACH,OAAO,KAAA;EACP,GAAG;EACH;EACA;EACA;EACA;CACF,IACA;EACE,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;CACF;CAON,OAAO,MALeC,iBAAuB;EAC3C,GAAG;EACH,oBAAoB;CACtB,CAAC;AAGH","debug_id":"e51b80bc-6b99-5160-8676-10829ab96d29"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { r as startSwitchboard } from "./switchboard-CgVB4U76.mjs";
|
|
2
|
+
export { startSwitchboard };
|
|
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]="f0827f22-fe33-5d14-8b83-a9058398d286")}catch(e){}}();
|
|
4
|
+
//# debugId=f0827f22-fe33-5d14-8b83-a9058398d286
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
!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
|
-
import { a as parseDefaultDrivesUrl, i as wasFlagExplicitlyPassed, u as mergeDefaultDrives } from "./cli-connect-override-
|
|
4
|
-
import { t as runConnectStudio } from "./connect-studio-
|
|
2
|
+
!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]="953f4fdd-ce21-5feb-99b6-777f904fd309")}catch(e){}}();
|
|
3
|
+
import { a as parseDefaultDrivesUrl, i as wasFlagExplicitlyPassed, u as mergeDefaultDrives } from "./cli-connect-override-b4kKqgOZ.mjs";
|
|
4
|
+
import { t as runConnectStudio } from "./connect-studio-_-O1-oef.mjs";
|
|
5
5
|
import { a as generateProjectDriveId } from "./utils-CvmDmCVd.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { r as startSwitchboard$1 } from "./switchboard-CgVB4U76.mjs";
|
|
7
7
|
import { execSync } from "node:child_process";
|
|
8
8
|
import { blue, green, red, yellow } from "colorette";
|
|
9
9
|
import fs from "node:fs";
|
|
@@ -410,6 +410,23 @@ async function startVetraPreviewDrive(reactor, port, verbose) {
|
|
|
410
410
|
if (verbose) console.log(blue(`Vetra Switchboard: Preview drive: ${driveUrl}`));
|
|
411
411
|
return driveUrl;
|
|
412
412
|
}
|
|
413
|
+
async function startVetraWorkflowsDrive(reactor, port, verbose) {
|
|
414
|
+
const workflowsDrive = {
|
|
415
|
+
id: generateProjectDriveId("workflows"),
|
|
416
|
+
slug: "workflows",
|
|
417
|
+
global: { name: "Workflows" },
|
|
418
|
+
preferredEditor: "workflow-studio",
|
|
419
|
+
local: {
|
|
420
|
+
availableOffline: true,
|
|
421
|
+
listeners: [],
|
|
422
|
+
sharingType: "public",
|
|
423
|
+
triggers: []
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
const driveUrl = await addDefaultDrive(reactor, workflowsDrive, port);
|
|
427
|
+
if (verbose) console.log(blue(`Vetra Switchboard: Workflows drive: ${driveUrl}`));
|
|
428
|
+
return driveUrl;
|
|
429
|
+
}
|
|
413
430
|
async function startLocalVetraSwitchboard(args, logger) {
|
|
414
431
|
const { connectPort, switchboardPort, dev, packages, disableLocalPackages, debug, httpsKeyFile, httpsCertFile, remoteDrive, interactive, watch, verbose } = args;
|
|
415
432
|
const remoteDrives = remoteDrive ? [remoteDrive] : [];
|
|
@@ -455,6 +472,12 @@ async function startLocalVetraSwitchboard(args, logger) {
|
|
|
455
472
|
} catch (error) {
|
|
456
473
|
console.error(error);
|
|
457
474
|
}
|
|
475
|
+
let workflowsDriveUrl = null;
|
|
476
|
+
if (switchboard.workflowsEnabled) try {
|
|
477
|
+
workflowsDriveUrl = await startVetraWorkflowsDrive(switchboard.reactor, actualSwitchboardPort, verbose);
|
|
478
|
+
} catch (error) {
|
|
479
|
+
console.error(error);
|
|
480
|
+
}
|
|
458
481
|
if (verbose) {
|
|
459
482
|
console.log(blue(`Vetra Switchboard: Started successfully`));
|
|
460
483
|
if (remoteDrive) console.log(blue(`Vetra Switchboard: Syncing with remote drive: ${remoteDrive}`));
|
|
@@ -463,10 +486,12 @@ async function startLocalVetraSwitchboard(args, logger) {
|
|
|
463
486
|
console.log(blue(`Vetra Switchboard: http://localhost:${actualSwitchboardPort}/graphql`));
|
|
464
487
|
console.log(blue(` ➜ Drive URL: ${switchboard.defaultDriveUrl}`));
|
|
465
488
|
if (previewDriveUrl) console.log(blue(` ➜ Preview Drive URL: ${previewDriveUrl}`));
|
|
489
|
+
if (workflowsDriveUrl) console.log(blue(` ➜ Workflows Drive URL: ${workflowsDriveUrl}`));
|
|
466
490
|
}
|
|
467
491
|
return {
|
|
468
492
|
driveUrl: switchboard.defaultDriveUrl || "",
|
|
469
493
|
previewDriveUrl,
|
|
494
|
+
workflowsDriveUrl,
|
|
470
495
|
switchboardPort: actualSwitchboardPort
|
|
471
496
|
};
|
|
472
497
|
} catch (error) {
|
|
@@ -512,6 +537,7 @@ async function startVetra(args) {
|
|
|
512
537
|
}, switchboardLogger);
|
|
513
538
|
const driveUrl = switchboardResult.driveUrl || remoteDrive || "";
|
|
514
539
|
const previewDriveUrl = switchboardResult.previewDriveUrl;
|
|
540
|
+
const workflowsDriveUrl = switchboardResult.workflowsDriveUrl;
|
|
515
541
|
const actualSwitchboardPort = switchboardResult.switchboardPort;
|
|
516
542
|
writeVetraRuntime(projectDir, {
|
|
517
543
|
pid: process.pid,
|
|
@@ -543,15 +569,24 @@ async function startVetra(args) {
|
|
|
543
569
|
const publicBase = args.drivesPublicBase;
|
|
544
570
|
const browserDriveUrl = publicBase ? rebaseDriveUrl(driveUrl, publicBase) : driveUrl;
|
|
545
571
|
const browserPreviewDriveUrl = previewDriveUrl && publicBase ? rebaseDriveUrl(previewDriveUrl, publicBase) : previewDriveUrl;
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
572
|
+
const browserWorkflowsDriveUrl = workflowsDriveUrl && publicBase ? rebaseDriveUrl(workflowsDriveUrl, publicBase) : workflowsDriveUrl;
|
|
573
|
+
const vetraDriveEntries = [
|
|
574
|
+
...browserDriveUrl ? [{
|
|
575
|
+
url: browserDriveUrl,
|
|
576
|
+
name: null,
|
|
577
|
+
icon: null
|
|
578
|
+
}] : [],
|
|
579
|
+
...browserPreviewDriveUrl ? [{
|
|
580
|
+
url: browserPreviewDriveUrl,
|
|
581
|
+
name: null,
|
|
582
|
+
icon: null
|
|
583
|
+
}] : [],
|
|
584
|
+
...browserWorkflowsDriveUrl ? [{
|
|
585
|
+
url: browserWorkflowsDriveUrl,
|
|
586
|
+
name: null,
|
|
587
|
+
icon: null
|
|
588
|
+
}] : []
|
|
589
|
+
];
|
|
555
590
|
const configuredDefaultDrives = getConfig(join(projectDir, "powerhouse.config.json")).connect?.drives?.defaultDrives ?? [];
|
|
556
591
|
const resolvedDefaultDrives = mergeDefaultDrives(vetraDriveEntries, configuredDefaultDrives);
|
|
557
592
|
if (verbose) {
|
|
@@ -588,5 +623,5 @@ async function startVetra(args) {
|
|
|
588
623
|
//#endregion
|
|
589
624
|
export { startVetra };
|
|
590
625
|
|
|
591
|
-
//# sourceMappingURL=vetra-
|
|
592
|
-
//# debugId=
|
|
626
|
+
//# sourceMappingURL=vetra-s8gWslse.mjs.map
|
|
627
|
+
//# debugId=953f4fdd-ce21-5feb-99b6-777f904fd309
|