@powerhousedao/ph-cli 6.2.3-dev.9 → 6.2.3-staging.0
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-CTvPQFMi.mjs +4 -0
- package/dist/build-sO3PcZxl.mjs +166 -0
- package/dist/build-sO3PcZxl.mjs.map +1 -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 +261 -85
- package/dist/cli.mjs.map +1 -1
- package/dist/connect-build-BMaR9w4G.mjs +153 -0
- package/dist/connect-build-BMaR9w4G.mjs.map +1 -0
- package/dist/{connect-config-BWGiW3IB.mjs → connect-config-_kiSMsbG.mjs} +19 -12
- package/dist/connect-config-_kiSMsbG.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-C5WTHsqu.mjs +28 -0
- package/dist/generate-piece-action-C5WTHsqu.mjs.map +1 -0
- package/dist/generate-piece-trigger-DR10CPOG.mjs +29 -0
- package/dist/generate-piece-trigger-DR10CPOG.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-B6QBYDNX.mjs} +4 -4
- package/dist/{migrate-jGKfE02L.mjs.map → migrate-B6QBYDNX.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-CJMoMzWx.mjs → switchboard-CgVB4U76.mjs} +17 -5
- package/dist/switchboard-CgVB4U76.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-nHCI3pha.mjs +4 -0
- package/dist/{switchboard-reset-BcQXlcVf.mjs → switchboard-reset-Ctegiqdm.mjs} +3 -3
- package/dist/{switchboard-reset-BcQXlcVf.mjs.map → switchboard-reset-Ctegiqdm.mjs.map} +1 -1
- 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-s8gWslse.mjs} +62 -14
- package/dist/vetra-s8gWslse.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.map +0 -1
- package/dist/switchboard-iRFugh8I.mjs +0 -4
- package/dist/vetra-DkF6EJMY.mjs.map +0 -1
|
@@ -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 { c as validateConnectKeyValue, i as wasFlagExplicitlyPassed, l as validateConnectPatch, n as buildConnectFlagPatch, o as normalizeKey, s as parseCliValue } 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]="69e6ceee-600a-53f7-8dcb-05415e6549dd")}catch(e){}}();
|
|
3
|
+
import { c as validateConnectKeyValue, i as wasFlagExplicitlyPassed, l as validateConnectPatch, n as buildConnectFlagPatch, o as normalizeKey, s as parseCliValue } from "./cli-connect-override-b4kKqgOZ.mjs";
|
|
4
|
+
import { ConfigLoader, JsonConfigAdapter, deepMerge, resolveSourceConnect } from "@powerhousedao/shared/connect";
|
|
4
5
|
import { existsSync } from "node:fs";
|
|
5
6
|
import { isAbsolute, join, resolve } from "node:path";
|
|
6
|
-
import { ConfigLoader, DEFAULT_CONNECT_CONFIG, JsonConfigAdapter, deepMerge } from "@powerhousedao/shared/connect";
|
|
7
7
|
import { stringToPath } from "remeda";
|
|
8
8
|
//#region src/utils/get-at-path.ts
|
|
9
9
|
/**
|
|
@@ -34,7 +34,8 @@ function resolveDistPath(cwd, distDirArg) {
|
|
|
34
34
|
const fromArg = distDirArg;
|
|
35
35
|
const fromEnv = process.env.PH_CONNECT_OUTDIR;
|
|
36
36
|
const dir = fromArg ?? fromEnv ?? DEFAULT_DIST_SUBPATH;
|
|
37
|
-
|
|
37
|
+
const abs = isAbsolute(dir) ? dir : resolve(cwd, dir);
|
|
38
|
+
return join(abs, SOURCE_FILE);
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
41
|
* Read the source file's raw bytes (no merge with defaults). Returns an empty
|
|
@@ -56,12 +57,16 @@ async function writeSourceRaw(path, next) {
|
|
|
56
57
|
}
|
|
57
58
|
/**
|
|
58
59
|
* Build the merged "effective" connect block for list/get mode: defaults <
|
|
59
|
-
* source.connect. Doesn't go through env or dist — list
|
|
60
|
-
* source declares + defaults, which is what the next
|
|
61
|
-
* baseline (before env seeds + CLI overrides).
|
|
60
|
+
* source.workflows < source.connect. Doesn't go through env or dist — list
|
|
61
|
+
* mode shows what the source declares + defaults, which is what the next
|
|
62
|
+
* build will produce as a baseline (before env seeds + CLI overrides).
|
|
62
63
|
*/
|
|
63
64
|
function effectiveConnect(source) {
|
|
64
|
-
|
|
65
|
+
const sourceConnect = source.connect && typeof source.connect === "object" && !Array.isArray(source.connect) ? source.connect : {};
|
|
66
|
+
return resolveSourceConnect({
|
|
67
|
+
connect: sourceConnect,
|
|
68
|
+
workflows: source.workflows
|
|
69
|
+
});
|
|
65
70
|
}
|
|
66
71
|
function printJson(value) {
|
|
67
72
|
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
@@ -82,6 +87,7 @@ function argsToFlagInput(args) {
|
|
|
82
87
|
renownSwitchboardUrl: args.renownSwitchboardUrl,
|
|
83
88
|
allowAddDrive: args.allowAddDrive,
|
|
84
89
|
externalPackages: args.externalPackages,
|
|
90
|
+
workflows: args.workflows,
|
|
85
91
|
remoteDrivesEnabled: args.remoteDrivesEnabled,
|
|
86
92
|
remoteDrivesAllowAdd: args.remoteDrivesAllowAdd,
|
|
87
93
|
remoteDrivesAllowDelete: args.remoteDrivesAllowDelete,
|
|
@@ -99,7 +105,7 @@ function argsToFlagInput(args) {
|
|
|
99
105
|
};
|
|
100
106
|
}
|
|
101
107
|
/**
|
|
102
|
-
* Whether any field flag (any of the
|
|
108
|
+
* Whether any field flag (any of the 20) was passed. Distinguishes the
|
|
103
109
|
* single-field-set mode from list mode when neither `--get` nor `--json` is
|
|
104
110
|
* present.
|
|
105
111
|
*/
|
|
@@ -167,7 +173,8 @@ async function runConnectConfig(args) {
|
|
|
167
173
|
patch = connectOnly;
|
|
168
174
|
} else patch = buildConnectFlagPatch(flagInput);
|
|
169
175
|
if (Object.keys(patch).length === 0 && topLevelRegistry === void 0) throw new Error("ph connect config: nothing to set. Pass at least one field flag (e.g. --renown-url <url>) or --json with a non-empty payload.");
|
|
170
|
-
const
|
|
176
|
+
const currentConnect = source.connect && typeof source.connect === "object" && !Array.isArray(source.connect) ? source.connect : {};
|
|
177
|
+
const nextConnect = deepMerge(currentConnect, patch);
|
|
171
178
|
const nextSource = {
|
|
172
179
|
...source,
|
|
173
180
|
connect: nextConnect
|
|
@@ -185,5 +192,5 @@ async function runConnectConfig(args) {
|
|
|
185
192
|
//#endregion
|
|
186
193
|
export { runConnectConfig };
|
|
187
194
|
|
|
188
|
-
//# sourceMappingURL=connect-config-
|
|
189
|
-
//# debugId=
|
|
195
|
+
//# sourceMappingURL=connect-config-_kiSMsbG.mjs.map
|
|
196
|
+
//# debugId=69e6ceee-600a-53f7-8dcb-05415e6549dd
|
|
@@ -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,14 +1,17 @@
|
|
|
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]="cce7218b-e89e-588d-a399-69d6e61f607e")}catch(e){}}();
|
|
3
3
|
import { getConnectBaseViteConfig } from "@powerhousedao/builder-tools";
|
|
4
4
|
import { mergeConfig, preview } from "vite";
|
|
5
5
|
//#region src/services/connect-preview.ts
|
|
6
6
|
async function runConnectPreview(args) {
|
|
7
7
|
const { outDir, port, host, open, cors, strictPort, printUrls, bindCLIShortcuts } = args;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const mode = "production";
|
|
9
|
+
const dirname = process.cwd();
|
|
10
|
+
const baseConfig = getConnectBaseViteConfig({
|
|
11
|
+
mode,
|
|
12
|
+
dirname
|
|
13
|
+
});
|
|
14
|
+
const config = mergeConfig(baseConfig, {
|
|
12
15
|
build: { outDir },
|
|
13
16
|
preview: {
|
|
14
17
|
cors,
|
|
@@ -17,12 +20,13 @@ async function runConnectPreview(args) {
|
|
|
17
20
|
host,
|
|
18
21
|
open
|
|
19
22
|
}
|
|
20
|
-
})
|
|
23
|
+
});
|
|
24
|
+
const server = await preview(config);
|
|
21
25
|
if (printUrls) server.printUrls();
|
|
22
26
|
if (bindCLIShortcuts) server.bindCLIShortcuts({ print: true });
|
|
23
27
|
}
|
|
24
28
|
//#endregion
|
|
25
29
|
export { runConnectPreview };
|
|
26
30
|
|
|
27
|
-
//# sourceMappingURL=connect-preview-
|
|
28
|
-
//# debugId=
|
|
31
|
+
//# sourceMappingURL=connect-preview-CzDqR-JN.mjs.map
|
|
32
|
+
//# debugId=cce7218b-e89e-588d-a399-69d6e61f607e
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-preview-
|
|
1
|
+
{"version":3,"file":"connect-preview-CzDqR-JN.mjs","sources":["../src/services/connect-preview.ts"],"sourcesContent":["import { getConnectBaseViteConfig } from \"@powerhousedao/builder-tools\";\nimport type { InlineConfig } from \"vite\";\nimport { mergeConfig, preview } from \"vite\";\nimport type { ConnectPreviewArgs } from \"../types.js\";\n\nexport async function runConnectPreview(args: ConnectPreviewArgs) {\n const {\n outDir,\n port,\n host,\n open,\n cors,\n strictPort,\n printUrls,\n bindCLIShortcuts,\n } = args;\n\n const mode = \"production\";\n\n const dirname = process.cwd();\n\n const baseConfig = getConnectBaseViteConfig({\n mode,\n dirname,\n });\n\n const previewConfig: InlineConfig = {\n build: {\n outDir,\n },\n preview: {\n cors,\n port,\n strictPort,\n host,\n open,\n },\n };\n\n const config = mergeConfig(baseConfig, previewConfig);\n\n const server = await preview(config);\n\n if (printUrls) server.printUrls();\n if (bindCLIShortcuts) server.bindCLIShortcuts({ print: true });\n}\n"],"names":[],"mappings":";;;;;AAKA,eAAsB,kBAAkB,MAA0B;CAChE,MAAM,EACJ,QACA,MACA,MACA,MACA,MACA,YACA,WACA,qBACE;CAEJ,MAAM,OAAO;CAEb,MAAM,UAAU,QAAQ,IAAI;CAE5B,MAAM,aAAa,yBAAyB;EAC1C;EACA;CACF,CAAC;CAeD,MAAM,SAAS,YAAY,YAAY;EAZrC,OAAO,EACL,OACF;EACA,SAAS;GACP;GACA;GACA;GACA;GACA;EACF;CAGiD,CAAC;CAEpD,MAAM,SAAS,MAAM,QAAQ,MAAM;CAEnC,IAAI,WAAW,OAAO,UAAU;CAChC,IAAI,kBAAkB,OAAO,iBAAiB,EAAE,OAAO,KAAK,CAAC;AAC/D","debug_id":"cce7218b-e89e-588d-a399-69d6e61f607e"}
|
|
@@ -1,16 +1,20 @@
|
|
|
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
|
|
7
7
|
async function runConnectStudio(args, customLogger, callerOverride) {
|
|
8
8
|
const { port, host, open, cors, strictPort, printUrls, bindCLIShortcuts } = args;
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const mode = "development";
|
|
10
|
+
const dirname = process.cwd();
|
|
11
|
+
const cliConnectOverride = buildStudioConnectOverride(args, callerOverride);
|
|
12
|
+
const baseConfig = getConnectBaseViteConfig({
|
|
13
|
+
mode,
|
|
14
|
+
dirname,
|
|
15
|
+
cliConnectOverride
|
|
16
|
+
});
|
|
17
|
+
const config = mergeConfig(baseConfig, {
|
|
14
18
|
server: {
|
|
15
19
|
port,
|
|
16
20
|
host,
|
|
@@ -19,7 +23,8 @@ async function runConnectStudio(args, customLogger, callerOverride) {
|
|
|
19
23
|
strictPort
|
|
20
24
|
},
|
|
21
25
|
customLogger
|
|
22
|
-
})
|
|
26
|
+
});
|
|
27
|
+
const server = await createServer(config);
|
|
23
28
|
await server.listen();
|
|
24
29
|
if (printUrls) server.printUrls();
|
|
25
30
|
if (bindCLIShortcuts) server.bindCLIShortcuts({ print: true });
|
|
@@ -27,5 +32,5 @@ async function runConnectStudio(args, customLogger, callerOverride) {
|
|
|
27
32
|
//#endregion
|
|
28
33
|
export { runConnectStudio as t };
|
|
29
34
|
|
|
30
|
-
//# sourceMappingURL=connect-studio-
|
|
31
|
-
//# 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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { t as runConnectStudio } from "./connect-studio-_-O1-oef.mjs";
|
|
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]="04e35c3d-c3bc-5333-a236-d6f30a73226b")}catch(e){}}();
|
|
4
|
+
//# debugId=04e35c3d-c3bc-5333-a236-d6f30a73226b
|
|
@@ -1,5 +1,5 @@
|
|
|
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]="7e4199eb-15f3-561d-9772-143c4781e317")}catch(e){}}();
|
|
3
3
|
import { generateAll } from "@powerhousedao/codegen";
|
|
4
4
|
import { buildTsMorphProject } from "@powerhousedao/codegen/utils";
|
|
5
5
|
import { extractAllDocuments, saveSpec } from "@powerhousedao/vetra/codegen";
|
|
@@ -26,5 +26,5 @@ async function startGenerateAll(args, projectDir) {
|
|
|
26
26
|
//#endregion
|
|
27
27
|
export { startGenerateAll };
|
|
28
28
|
|
|
29
|
-
//# sourceMappingURL=generate-all-
|
|
30
|
-
//# debugId=
|
|
29
|
+
//# sourceMappingURL=generate-all-CIwP-3aa.mjs.map
|
|
30
|
+
//# debugId=7e4199eb-15f3-561d-9772-143c4781e317
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-all-
|
|
1
|
+
{"version":3,"file":"generate-all-CIwP-3aa.mjs","sources":["../src/services/generate-all.ts"],"sourcesContent":["import { generateAll } from \"@powerhousedao/codegen\";\nimport { buildTsMorphProject } from \"@powerhousedao/codegen/utils\";\nimport { extractAllDocuments, saveSpec } from \"@powerhousedao/vetra/codegen\";\n\nexport async function startGenerateAll(\n args: { extract?: boolean },\n projectDir: string,\n) {\n const project = buildTsMorphProject(projectDir);\n if (args.extract) {\n const all = extractAllDocuments(project);\n for (const doc of [\n ...all.documentModels,\n ...all.editors,\n ...all.processors,\n ...all.subgraphs,\n ...all.apps,\n ]) {\n const path = await saveSpec(doc, projectDir);\n console.log(`Wrote ${path}`);\n }\n return;\n }\n await generateAll(project);\n await project.save();\n}\n"],"names":[],"mappings":";;;;;;AAIA,eAAsB,iBACpB,MACA,YACA;CACA,MAAM,UAAU,oBAAoB,UAAU;CAC9C,IAAI,KAAK,SAAS;EAChB,MAAM,MAAM,oBAAoB,OAAO;EACvC,KAAK,MAAM,OAAO;GAChB,GAAG,IAAI;GACP,GAAG,IAAI;GACP,GAAG,IAAI;GACP,GAAG,IAAI;GACP,GAAG,IAAI;EACT,GAAG;GACD,MAAM,OAAO,MAAM,SAAS,KAAK,UAAU;GAC3C,QAAQ,IAAI,SAAS,MAAM;EAC7B;EACA;CACF;CACA,MAAM,YAAY,OAAO;CACzB,MAAM,QAAQ,KAAK;AACrB","debug_id":"7e4199eb-15f3-561d-9772-143c4781e317"}
|
|
@@ -1,5 +1,5 @@
|
|
|
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]="613319d0-0df7-5cc6-87c6-4630f1ae1bd6")}catch(e){}}();
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
4
|
import { generateAllApps, generateApp } from "@powerhousedao/codegen";
|
|
5
5
|
import { buildTsMorphProject, getAppMetadata } from "@powerhousedao/codegen/utils";
|
|
@@ -18,8 +18,10 @@ async function startGenerateApp(args, projectDir) {
|
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
if (all) await generateAllApps(project);
|
|
21
|
-
else if (document)
|
|
22
|
-
|
|
21
|
+
else if (document) {
|
|
22
|
+
const doc = await getDocument(document);
|
|
23
|
+
await generateAppFromDocument(doc, project);
|
|
24
|
+
} else if (name) await generateApp({
|
|
23
25
|
appName: name,
|
|
24
26
|
allowedDocumentTypes,
|
|
25
27
|
isDragAndDropEnabled: !disableDragAndDrop
|
|
@@ -44,5 +46,5 @@ async function startGenerateApp(args, projectDir) {
|
|
|
44
46
|
//#endregion
|
|
45
47
|
export { startGenerateApp };
|
|
46
48
|
|
|
47
|
-
//# sourceMappingURL=generate-app-
|
|
48
|
-
//# debugId=
|
|
49
|
+
//# sourceMappingURL=generate-app-BTs1u-9l.mjs.map
|
|
50
|
+
//# debugId=613319d0-0df7-5cc6-87c6-4630f1ae1bd6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-app-
|
|
1
|
+
{"version":3,"file":"generate-app-BTs1u-9l.mjs","sources":["../src/services/generate-app.ts"],"sourcesContent":["import { generateAllApps, generateApp } from \"@powerhousedao/codegen\";\nimport {\n buildTsMorphProject,\n getAppMetadata,\n} from \"@powerhousedao/codegen/utils\";\nimport {\n extractAppDocuments,\n generateAppFromDocument,\n getDocument,\n saveSpec,\n} from \"@powerhousedao/vetra/codegen\";\nimport type { AppModuleDocument } from \"@powerhousedao/vetra/document-models/app-module\";\nimport { dirname } from \"node:path\";\nimport type { GenerateAppArgs } from \"../types.js\";\n\nexport async function startGenerateApp(\n args: GenerateAppArgs,\n projectDir: string,\n) {\n const {\n name,\n allowedDocumentTypes = [],\n disableDragAndDrop,\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 = extractAppDocuments(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 generateAllApps(project);\n } else if (document) {\n const doc = (await getDocument(document)) as AppModuleDocument;\n await generateAppFromDocument(doc, project);\n } else if (name) {\n await generateApp(\n {\n appName: name,\n allowedDocumentTypes,\n isDragAndDropEnabled: !disableDragAndDrop,\n },\n project,\n );\n } else if (dir) {\n const appMetadata = getAppMetadata(project, dirname(dir));\n if (!appMetadata) {\n throw new Error(`Failed to get data for app in dir \"${dir}\"`);\n }\n const {\n name: appName,\n id: appId,\n dirName: appDirName,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n } = appMetadata;\n\n await generateApp(\n {\n appName,\n appId,\n appDirName,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n },\n project,\n );\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}\n"],"names":[],"mappings":";;;;;;;AAeA,eAAsB,iBACpB,MACA,YACA;CACA,MAAM,EACJ,MACA,uBAAuB,CAAC,GACxB,oBACA,UACA,KACA,KACA,SACA,UACE;CACJ,IAAI,OACF,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEtB,MAAM,UAAU,oBAAoB,UAAU;CAC9C,IAAI,SAAS;EACX,MAAM,OAAO,oBAAoB,OAAO;EACxC,KAAK,MAAM,OAAO,MAAM;GACtB,MAAM,OAAO,MAAM,SAAS,KAAK,UAAU;GAC3C,QAAQ,IAAI,SAAS,MAAM;EAC7B;EACA;CACF;CACA,IAAI,KACF,MAAM,gBAAgB,OAAO;MACxB,IAAI,UAAU;EACnB,MAAM,MAAO,MAAM,YAAY,QAAQ;EACvC,MAAM,wBAAwB,KAAK,OAAO;CAC5C,OAAO,IAAI,MACT,MAAM,YACJ;EACE,SAAS;EACT;EACA,sBAAsB,CAAC;CACzB,GACA,OACF;MACK,IAAI,KAAK;EACd,MAAM,cAAc,eAAe,SAAS,QAAQ,GAAG,CAAC;EACxD,IAAI,CAAC,aACH,MAAM,IAAI,MAAM,sCAAsC,IAAI,EAAE;EAE9D,MAAM,EACJ,MAAM,SACN,IAAI,OACJ,SAAS,YACT,sBACA,yBACE;EAEJ,MAAM,YACJ;GACE;GACA;GACA;GACA;GACA;EACF,GACA,OACF;CACF,OAAO;EACL,QAAQ,IACN,uEACF;EACA;CACF;CACA,MAAM,QAAQ,KAAK;AACrB","debug_id":"613319d0-0df7-5cc6-87c6-4630f1ae1bd6"}
|
|
@@ -1,5 +1,5 @@
|
|
|
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]="52f5688d-6e33-5a44-a55b-802d5da44b75")}catch(e){}}();
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { generateAllDocumentModels, generateDocumentModel, loadDocumentModel } from "@powerhousedao/codegen";
|
|
5
5
|
import { buildTsMorphProject } from "@powerhousedao/codegen/utils";
|
|
@@ -18,10 +18,20 @@ async function startGenerateDocumentModel(args, projectDir) {
|
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
if (all) await generateAllDocumentModels(project);
|
|
21
|
-
else if (document)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
else if (document) {
|
|
22
|
+
if (document.endsWith(".phd")) {
|
|
23
|
+
const doc = await getDocument(document);
|
|
24
|
+
await generateDocumentModelFromDocument(doc, project);
|
|
25
|
+
} else {
|
|
26
|
+
const state = await loadDocumentModel(document);
|
|
27
|
+
await generateDocumentModel(state, project);
|
|
28
|
+
}
|
|
29
|
+
} else if (dir) {
|
|
30
|
+
const documentModelFileName = `${dirname(dir)}.json`;
|
|
31
|
+
const documentModelFilePath = join(dir, documentModelFileName);
|
|
32
|
+
const state = await loadDocumentModel(documentModelFilePath);
|
|
33
|
+
await generateDocumentModel(state, project);
|
|
34
|
+
} else {
|
|
25
35
|
console.log("Please specify one of `document`, `dir`, `all`, or `extract`.");
|
|
26
36
|
return;
|
|
27
37
|
}
|
|
@@ -30,5 +40,5 @@ async function startGenerateDocumentModel(args, projectDir) {
|
|
|
30
40
|
//#endregion
|
|
31
41
|
export { startGenerateDocumentModel };
|
|
32
42
|
|
|
33
|
-
//# sourceMappingURL=generate-document-model-
|
|
34
|
-
//# debugId=
|
|
43
|
+
//# sourceMappingURL=generate-document-model-DhDQ_06X.mjs.map
|
|
44
|
+
//# debugId=52f5688d-6e33-5a44-a55b-802d5da44b75
|
package/dist/{generate-document-model-BJXyODfm.mjs.map → generate-document-model-DhDQ_06X.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-document-model-
|
|
1
|
+
{"version":3,"file":"generate-document-model-DhDQ_06X.mjs","sources":["../src/services/generate-document-model.ts"],"sourcesContent":["import {\n generateAllDocumentModels,\n generateDocumentModel,\n loadDocumentModel,\n} from \"@powerhousedao/codegen\";\nimport { buildTsMorphProject } from \"@powerhousedao/codegen/utils\";\nimport {\n extractDocumentModelDocuments,\n generateDocumentModelFromDocument,\n getDocument,\n saveSpec,\n} from \"@powerhousedao/vetra/codegen\";\nimport type { DocumentModelDocument } from \"@powerhousedao/shared/document-model\";\nimport { dirname, join } from \"node:path\";\nimport type { GenerateDocumentModelArgs } from \"../types.js\";\n\nexport async function startGenerateDocumentModel(\n args: GenerateDocumentModelArgs,\n projectDir: string,\n) {\n const { 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 = extractDocumentModelDocuments(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 generateAllDocumentModels(project);\n } else if (document) {\n if (document.endsWith(\".phd\")) {\n const doc = (await getDocument(document)) as DocumentModelDocument;\n await generateDocumentModelFromDocument(doc, project);\n } else {\n const state = await loadDocumentModel(document);\n await generateDocumentModel(state, project);\n }\n } else if (dir) {\n const documentModelDirName = dirname(dir);\n const documentModelFileName = `${documentModelDirName}.json`;\n const documentModelFilePath = join(dir, documentModelFileName);\n const state = await loadDocumentModel(documentModelFilePath);\n await generateDocumentModel(state, project);\n } else {\n console.log(\n \"Please specify one of `document`, `dir`, `all`, or `extract`.\",\n );\n return;\n }\n await project.save();\n}\n"],"names":[],"mappings":";;;;;;;AAgBA,eAAsB,2BACpB,MACA,YACA;CACA,MAAM,EAAE,UAAU,KAAK,KAAK,SAAS,UAAU;CAC/C,IAAI,OACF,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEtB,MAAM,UAAU,oBAAoB,UAAU;CAC9C,IAAI,SAAS;EACX,MAAM,OAAO,8BAA8B,OAAO;EAClD,KAAK,MAAM,OAAO,MAAM;GACtB,MAAM,OAAO,MAAM,SAAS,KAAK,UAAU;GAC3C,QAAQ,IAAI,SAAS,MAAM;EAC7B;EACA;CACF;CACA,IAAI,KACF,MAAM,0BAA0B,OAAO;MAClC,IAAI,UAAU;EACnB,IAAI,SAAS,SAAS,MAAM,GAAG;GAC7B,MAAM,MAAO,MAAM,YAAY,QAAQ;GACvC,MAAM,kCAAkC,KAAK,OAAO;EACtD,OAAO;GACL,MAAM,QAAQ,MAAM,kBAAkB,QAAQ;GAC9C,MAAM,sBAAsB,OAAO,OAAO;EAC5C;CACF,OAAO,IAAI,KAAK;EAEd,MAAM,wBAAwB,GADD,QAAQ,GACe,EAAE;EACtD,MAAM,wBAAwB,KAAK,KAAK,qBAAqB;EAC7D,MAAM,QAAQ,MAAM,kBAAkB,qBAAqB;EAC3D,MAAM,sBAAsB,OAAO,OAAO;CAC5C,OAAO;EACL,QAAQ,IACN,+DACF;EACA;CACF;CACA,MAAM,QAAQ,KAAK;AACrB","debug_id":"52f5688d-6e33-5a44-a55b-802d5da44b75"}
|
|
@@ -1,5 +1,5 @@
|
|
|
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]="b204b504-9786-5632-91d5-eaabb22de195")}catch(e){}}();
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
4
|
import { generateAllEditors, generateEditor } from "@powerhousedao/codegen";
|
|
5
5
|
import { buildTsMorphProject, getEditorMetadata } from "@powerhousedao/codegen/utils";
|
|
@@ -18,8 +18,10 @@ async function startGenerateEditor(args, projectDir) {
|
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
if (all) await generateAllEditors(project);
|
|
21
|
-
else if (document)
|
|
22
|
-
|
|
21
|
+
else if (document) {
|
|
22
|
+
const doc = await getDocument(document);
|
|
23
|
+
await generateEditorFromDocument(doc, project);
|
|
24
|
+
} else if (name) {
|
|
23
25
|
if (!documentType) throw new Error("Please specify a document type for the new editor to generate.");
|
|
24
26
|
await generateEditor({
|
|
25
27
|
editorName: name,
|
|
@@ -44,5 +46,5 @@ async function startGenerateEditor(args, projectDir) {
|
|
|
44
46
|
//#endregion
|
|
45
47
|
export { startGenerateEditor };
|
|
46
48
|
|
|
47
|
-
//# sourceMappingURL=generate-editor-
|
|
48
|
-
//# debugId=
|
|
49
|
+
//# sourceMappingURL=generate-editor-CW7Do69u.mjs.map
|
|
50
|
+
//# debugId=b204b504-9786-5632-91d5-eaabb22de195
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-editor-
|
|
1
|
+
{"version":3,"file":"generate-editor-CW7Do69u.mjs","sources":["../src/services/generate-editor.ts"],"sourcesContent":["import { generateAllEditors, generateEditor } from \"@powerhousedao/codegen\";\nimport {\n buildTsMorphProject,\n getEditorMetadata,\n} from \"@powerhousedao/codegen/utils\";\nimport {\n extractEditorDocuments,\n generateEditorFromDocument,\n getDocument,\n saveSpec,\n} from \"@powerhousedao/vetra/codegen\";\nimport type { DocumentEditorDocument } from \"@powerhousedao/vetra/document-models/document-editor\";\nimport { dirname } from \"node:path\";\nimport type { GenerateEditorArgs } from \"../types.js\";\n\nexport async function startGenerateEditor(\n args: GenerateEditorArgs,\n projectDir: string,\n) {\n const { name, documentType, 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 = extractEditorDocuments(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 generateAllEditors(project);\n } else if (document) {\n const doc = (await getDocument(document)) as DocumentEditorDocument;\n await generateEditorFromDocument(doc, project);\n } else if (name) {\n if (!documentType) {\n throw new Error(\n \"Please specify a document type for the new editor to generate.\",\n );\n }\n await generateEditor(\n { editorName: name, documentTypes: [documentType] },\n project,\n );\n } else if (dir) {\n const editorArgs = getEditorMetadata(project, dirname(dir));\n if (!editorArgs) {\n throw new Error(`Failed to get data for editor in dir \"${dir}\"`);\n }\n const {\n name: editorName,\n id: editorId,\n dirName: editorDirName,\n documentTypes,\n } = editorArgs;\n await generateEditor(\n {\n editorName,\n editorId,\n editorDirName,\n documentTypes,\n },\n project,\n );\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}\n"],"names":[],"mappings":";;;;;;;AAeA,eAAsB,oBACpB,MACA,YACA;CACA,MAAM,EAAE,MAAM,cAAc,UAAU,KAAK,KAAK,SAAS,UAAU;CACnE,IAAI,OACF,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEtB,MAAM,UAAU,oBAAoB,UAAU;CAC9C,IAAI,SAAS;EACX,MAAM,OAAO,uBAAuB,OAAO;EAC3C,KAAK,MAAM,OAAO,MAAM;GACtB,MAAM,OAAO,MAAM,SAAS,KAAK,UAAU;GAC3C,QAAQ,IAAI,SAAS,MAAM;EAC7B;EACA;CACF;CACA,IAAI,KACF,MAAM,mBAAmB,OAAO;MAC3B,IAAI,UAAU;EACnB,MAAM,MAAO,MAAM,YAAY,QAAQ;EACvC,MAAM,2BAA2B,KAAK,OAAO;CAC/C,OAAO,IAAI,MAAM;EACf,IAAI,CAAC,cACH,MAAM,IAAI,MACR,gEACF;EAEF,MAAM,eACJ;GAAE,YAAY;GAAM,eAAe,CAAC,YAAY;EAAE,GAClD,OACF;CACF,OAAO,IAAI,KAAK;EACd,MAAM,aAAa,kBAAkB,SAAS,QAAQ,GAAG,CAAC;EAC1D,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,yCAAyC,IAAI,EAAE;EAEjE,MAAM,EACJ,MAAM,YACN,IAAI,UACJ,SAAS,eACT,kBACE;EACJ,MAAM,eACJ;GACE;GACA;GACA;GACA;EACF,GACA,OACF;CACF,OAAO;EACL,QAAQ,IACN,uEACF;EACA;CACF;CACA,MAAM,QAAQ,KAAK;AACrB","debug_id":"b204b504-9786-5632-91d5-eaabb22de195"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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]="8b015725-4996-50bb-890c-e6cf4750fe5e")}catch(e){}}();
|
|
3
|
+
import { t as installAddedDependencies } from "./install-added-dependencies-DVSbzler.mjs";
|
|
4
|
+
import { basename } from "node:path";
|
|
5
|
+
import { readPackage } from "read-pkg";
|
|
6
|
+
import { detectFeatures, generateAllPieces, generatePiece, syncFeatureDependencies } from "@powerhousedao/codegen";
|
|
7
|
+
import { buildTsMorphProject, readPiecesList } from "@powerhousedao/codegen/utils";
|
|
8
|
+
import { derivePieceId } from "@powerhousedao/codegen/name-builders";
|
|
9
|
+
import { kebabCase } from "change-case";
|
|
10
|
+
import enquirer from "enquirer";
|
|
11
|
+
//#region src/services/generate-piece.ts
|
|
12
|
+
async function resolvePieceId(v) {
|
|
13
|
+
if (v.id) return v.id;
|
|
14
|
+
const pkg = await readPackage({
|
|
15
|
+
cwd: v.projectDir,
|
|
16
|
+
normalize: false
|
|
17
|
+
});
|
|
18
|
+
const { id, needsConfirmation } = derivePieceId({
|
|
19
|
+
packageName: pkg.name ?? "",
|
|
20
|
+
slug: kebabCase(v.pieceName),
|
|
21
|
+
hasOtherPieces: readPiecesList(v.project).length > 0
|
|
22
|
+
});
|
|
23
|
+
if (!needsConfirmation || !process.stdin.isTTY) return id;
|
|
24
|
+
const { prompt } = enquirer;
|
|
25
|
+
return (await prompt([{
|
|
26
|
+
type: "input",
|
|
27
|
+
name: "pieceId",
|
|
28
|
+
message: "What id should this piece have? A workflow step names it as its pieceName.",
|
|
29
|
+
initial: id,
|
|
30
|
+
required: true
|
|
31
|
+
}])).pieceId || id;
|
|
32
|
+
}
|
|
33
|
+
async function startGeneratePiece(args, projectDir) {
|
|
34
|
+
const { namePositional, name: nameOption, id, auth, description, dir, all, debug } = args;
|
|
35
|
+
if (debug) console.log({ args });
|
|
36
|
+
const project = buildTsMorphProject(projectDir);
|
|
37
|
+
const name = namePositional ?? nameOption;
|
|
38
|
+
if (all) await generateAllPieces(project);
|
|
39
|
+
else if (dir) await generateAllPieces(project, basename(dir.replace(/\/+$/, "")));
|
|
40
|
+
else if (name) {
|
|
41
|
+
const pieceId = await resolvePieceId({
|
|
42
|
+
project,
|
|
43
|
+
projectDir,
|
|
44
|
+
pieceName: name,
|
|
45
|
+
id
|
|
46
|
+
});
|
|
47
|
+
await generatePiece({
|
|
48
|
+
pieceName: name,
|
|
49
|
+
pieceId,
|
|
50
|
+
auth,
|
|
51
|
+
description
|
|
52
|
+
}, project);
|
|
53
|
+
} else {
|
|
54
|
+
console.log("Please specify one of `name`, `dir`, or `all`.");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
await project.save();
|
|
58
|
+
const added = await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
59
|
+
await installAddedDependencies(added, projectDir, args.skipInstall);
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { startGeneratePiece };
|
|
63
|
+
|
|
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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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]="5a77c310-3860-5275-b99c-231487fb6bf6")}catch(e){}}();
|
|
3
|
+
import { t as installAddedDependencies } from "./install-added-dependencies-DVSbzler.mjs";
|
|
4
|
+
import { detectFeatures, generatePieceAction, syncFeatureDependencies } from "@powerhousedao/codegen";
|
|
5
|
+
import { buildTsMorphProject } from "@powerhousedao/codegen/utils";
|
|
6
|
+
//#region src/services/generate-piece-action.ts
|
|
7
|
+
async function startGeneratePieceAction(args, projectDir) {
|
|
8
|
+
const { namePositional, name: nameOption, piece, debug } = args;
|
|
9
|
+
if (debug) console.log({ args });
|
|
10
|
+
const actionName = namePositional ?? nameOption;
|
|
11
|
+
if (!actionName) {
|
|
12
|
+
console.log("Please specify the name of the action to generate.");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const project = buildTsMorphProject(projectDir);
|
|
16
|
+
await generatePieceAction({
|
|
17
|
+
pieceDir: piece,
|
|
18
|
+
actionName
|
|
19
|
+
}, project);
|
|
20
|
+
await project.save();
|
|
21
|
+
const added = await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
22
|
+
await installAddedDependencies(added, projectDir, args.skipInstall);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { startGeneratePieceAction };
|
|
26
|
+
|
|
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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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]="8425cd42-69a1-5c64-a003-d5c5ed622abd")}catch(e){}}();
|
|
3
|
+
import { t as installAddedDependencies } from "./install-added-dependencies-DVSbzler.mjs";
|
|
4
|
+
import { detectFeatures, generatePieceTrigger, syncFeatureDependencies } from "@powerhousedao/codegen";
|
|
5
|
+
import { buildTsMorphProject } from "@powerhousedao/codegen/utils";
|
|
6
|
+
//#region src/services/generate-piece-trigger.ts
|
|
7
|
+
async function startGeneratePieceTrigger(args, projectDir) {
|
|
8
|
+
const { namePositional, name: nameOption, piece, strategy, debug } = args;
|
|
9
|
+
if (debug) console.log({ args });
|
|
10
|
+
const triggerName = namePositional ?? nameOption;
|
|
11
|
+
if (!triggerName) {
|
|
12
|
+
console.log("Please specify the name of the trigger to generate.");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const project = buildTsMorphProject(projectDir);
|
|
16
|
+
await generatePieceTrigger({
|
|
17
|
+
pieceDir: piece,
|
|
18
|
+
triggerName,
|
|
19
|
+
strategy
|
|
20
|
+
}, project);
|
|
21
|
+
await project.save();
|
|
22
|
+
const added = await syncFeatureDependencies(detectFeatures(projectDir), projectDir);
|
|
23
|
+
await installAddedDependencies(added, projectDir, args.skipInstall);
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { startGeneratePieceTrigger };
|
|
27
|
+
|
|
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"}
|