@prisma/composer-cli 0.39.0-dev.7 → 0.39.0-dev.9

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.
Files changed (72) hide show
  1. package/dist/app-converge-C6Zrg2xM-DX-tW6C3.mjs +88 -0
  2. package/dist/app-converge-C6Zrg2xM-DX-tW6C3.mjs.map +1 -0
  3. package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs +254 -0
  4. package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs.map +1 -0
  5. package/dist/{validate-environment-XwVDifWN-BdYUHyVF.mjs → deploy-Br1yvLe3.mjs} +204 -1010
  6. package/dist/deploy-Br1yvLe3.mjs.map +1 -0
  7. package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs +256 -0
  8. package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs.map +1 -0
  9. package/dist/dev-converge-worker.d.mts +1 -0
  10. package/dist/dev-converge-worker.mjs +143 -0
  11. package/dist/dev-converge-worker.mjs.map +1 -0
  12. package/dist/{dev-current-gQnmjB4V-DrQ4Zzbl.mjs → dev-current-EqQbrtj5-DieSnSVx.mjs} +12 -18
  13. package/dist/dev-current-EqQbrtj5-DieSnSVx.mjs.map +1 -0
  14. package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs +43 -0
  15. package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs.map +1 -0
  16. package/dist/{dist-CRSv_9L8.mjs → dist-C0OGaDnj.mjs} +4 -3
  17. package/dist/{dist-CRSv_9L8.mjs.map → dist-C0OGaDnj.mjs.map} +1 -1
  18. package/dist/errors-CVYwN2km.mjs +93 -0
  19. package/dist/errors-CVYwN2km.mjs.map +1 -0
  20. package/dist/{execute-deploy-destroy-DKbsBkqK-D8pniqZg.mjs → execute-deploy-destroy-DKEmb8WI-DcgNdw4b.mjs} +245 -244
  21. package/dist/execute-deploy-destroy-DKEmb8WI-DcgNdw4b.mjs.map +1 -0
  22. package/dist/{execute-dev-DVCWURmI-D91UZq1o.mjs → execute-dev-C42niIFY-Dh_7dJ5W.mjs} +422 -166
  23. package/dist/execute-dev-C42niIFY-Dh_7dJ5W.mjs.map +1 -0
  24. package/dist/{execute-dev-current-Dt_9srY2-D8mAcSv4.mjs → execute-dev-current-AVT4zQ8F--qMLJobM.mjs} +9 -6
  25. package/dist/{execute-dev-current-Dt_9srY2-D8mAcSv4.mjs.map → execute-dev-current-AVT4zQ8F--qMLJobM.mjs.map} +1 -1
  26. package/dist/{family-D52hWFMF-FfSJ5SN2.d.mts → family-DfwviKFj-CS1L-EvS.d.mts} +171 -69
  27. package/dist/family-DfwviKFj-CS1L-EvS.d.mts.map +1 -0
  28. package/dist/family.d.mts +1 -1
  29. package/dist/family.mjs +87 -137
  30. package/dist/family.mjs.map +1 -1
  31. package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs +58 -0
  32. package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs.map +1 -0
  33. package/dist/{list-deployed-CIaiiV_l.mjs → list-deployed-C1cwFHrb.mjs} +5 -4
  34. package/dist/{list-deployed-CIaiiV_l.mjs.map → list-deployed-C1cwFHrb.mjs.map} +1 -1
  35. package/dist/local-target-CZzICh5R.mjs +34 -0
  36. package/dist/local-target-CZzICh5R.mjs.map +1 -0
  37. package/dist/preflight-transport-2d6iIchu-ArIJUY1L.mjs +56 -0
  38. package/dist/preflight-transport-2d6iIchu-ArIJUY1L.mjs.map +1 -0
  39. package/dist/{redaction-CjMYXtGp-CYefSG9A.mjs → redaction-DY6eDC12-BrK1aSN5.mjs} +17 -256
  40. package/dist/redaction-DY6eDC12-BrK1aSN5.mjs.map +1 -0
  41. package/dist/result-CttmabB6.mjs +91 -0
  42. package/dist/result-CttmabB6.mjs.map +1 -0
  43. package/dist/rolldown-runtime-C7HZzL1F.mjs +26 -0
  44. package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs +287 -0
  45. package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs.map +1 -0
  46. package/dist/testing.d.mts +2 -42
  47. package/dist/testing.d.mts.map +1 -1
  48. package/dist/testing.mjs +2 -5
  49. package/dist/testing.mjs.map +1 -1
  50. package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs +983 -0
  51. package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs.map +1 -0
  52. package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs +15 -0
  53. package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs.map +1 -0
  54. package/package.json +7 -7
  55. package/src/exports/dev-converge-worker.ts +2 -0
  56. package/src/exports/testing.ts +1 -4
  57. package/dist/app-configuration-file-Bbfq5PR3-CYdGtitc.mjs +0 -137
  58. package/dist/app-configuration-file-Bbfq5PR3-CYdGtitc.mjs.map +0 -1
  59. package/dist/dev-current-gQnmjB4V-DrQ4Zzbl.mjs.map +0 -1
  60. package/dist/dev-environment-name-6eEr5PW8-kDiScOL8.mjs +0 -71
  61. package/dist/dev-environment-name-6eEr5PW8-kDiScOL8.mjs.map +0 -1
  62. package/dist/execute-deploy-destroy-DKbsBkqK-D8pniqZg.mjs.map +0 -1
  63. package/dist/execute-dev-DVCWURmI-D91UZq1o.mjs.map +0 -1
  64. package/dist/family-D52hWFMF-FfSJ5SN2.d.mts.map +0 -1
  65. package/dist/generate-dev-stack-BEpqJ3AH-B7o7JyER.mjs +0 -100
  66. package/dist/generate-dev-stack-BEpqJ3AH-B7o7JyER.mjs.map +0 -1
  67. package/dist/redaction-CjMYXtGp-CYefSG9A.mjs.map +0 -1
  68. package/dist/result-DlBttLS8.mjs +0 -234
  69. package/dist/result-DlBttLS8.mjs.map +0 -1
  70. package/dist/run-alchemy-BlYyc4Oh-BnFv0AaY.mjs +0 -302
  71. package/dist/run-alchemy-BlYyc4Oh-BnFv0AaY.mjs.map +0 -1
  72. package/dist/validate-environment-XwVDifWN-BdYUHyVF.mjs.map +0 -1
@@ -1,302 +0,0 @@
1
- import { r as StreamRedactor } from "./redaction-CjMYXtGp-CYefSG9A.mjs";
2
- import { i as CliStructuredError } from "./result-DlBttLS8.mjs";
3
- import { createRequire } from "node:module";
4
- import * as fs from "node:fs";
5
- import * as path from "node:path";
6
- import spawn from "cross-spawn";
7
- //#region ../../0-framework/1-core/core/dist/preflight-transport-C7_3abXW.mjs
8
- /** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PRISMA_CLOUD': uppercased, every non-alphanumeric run replaced by one underscore. */
9
- function envVarSafeExtensionId(extensionId) {
10
- return extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, "_").replace(/^_+|_+$/g, "");
11
- }
12
- /** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_CONTAINER_PRISMA_COMPOSER_PRISMA_CLOUD' */
13
- function containerEnvVarName(extensionId) {
14
- return `PRISMA_COMPOSER_CONTAINER_${envVarSafeExtensionId(extensionId)}`;
15
- }
16
- function collisionError(a, b, varName) {
17
- return /* @__PURE__ */ new Error(`Extension ids "${a}" and "${b}" both map to the container transport variable "${varName}" — rename one of the extensions.`);
18
- }
19
- function emptySerializeError(extensionId) {
20
- return /* @__PURE__ */ new Error(`Extension "${extensionId}"'s container instance serialized to an empty string — ContainerInstance.serialize() must return a non-empty string.`);
21
- }
22
- /** The env entries the CLI sets on the alchemy process: `{ [containerEnvVarName(id)]: instance.serialize() }` for every resolved instance. */
23
- function containerEnv(instances) {
24
- const env = {};
25
- const ownerByVarName = /* @__PURE__ */ new Map();
26
- for (const [extensionId, instance] of instances) {
27
- const varName = containerEnvVarName(extensionId);
28
- const owner = ownerByVarName.get(varName);
29
- if (owner !== void 0) throw collisionError(owner, extensionId, varName);
30
- ownerByVarName.set(varName, extensionId);
31
- const serialized = instance.serialize();
32
- if (serialized.length === 0) throw emptySerializeError(extensionId);
33
- env[varName] = serialized;
34
- }
35
- return env;
36
- }
37
- /**
38
- * Carries an extension's preflight payload from the CLI process to the
39
- * alchemy child (which re-imports the config from scratch) — one env var per
40
- * extension, same channel as containers (container-transport.ts), filled by
41
- * whichever preflight the run executed: the deploy preflight or the local
42
- * target's dev preflight. The framework never reads the contents, so an
43
- * extension that implements both must tell its own payload kinds apart.
44
- * Payloads carry metadata only, never secret values: the child's environment
45
- * is not a secret store.
46
- */
47
- /** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PREFLIGHT_PRISMA_COMPOSER_PRISMA_CLOUD' */
48
- function preflightEnvVarName(extensionId) {
49
- return `PRISMA_COMPOSER_PREFLIGHT_${envVarSafeExtensionId(extensionId)}`;
50
- }
51
- /** The env entries the CLI sets on the alchemy process: `{ [preflightEnvVarName(id)]: payload }` for every extension whose preflight returned one. */
52
- function preflightEnv(payloads) {
53
- const env = {};
54
- const ownerByVarName = /* @__PURE__ */ new Map();
55
- for (const [extensionId, payload] of payloads) {
56
- if (payload.length === 0) continue;
57
- const varName = preflightEnvVarName(extensionId);
58
- const owner = ownerByVarName.get(varName);
59
- if (owner !== void 0) throw new Error(`Extension ids "${owner}" and "${extensionId}" both use the environment variable "${varName}". Rename one of the extensions.`);
60
- ownerByVarName.set(varName, extensionId);
61
- env[varName] = payload;
62
- }
63
- return env;
64
- }
65
- /** One reader as the deploy prints it, for example `read by service "shop.email", field "apiKey"`. */
66
- function platformVariableReaderText(reader) {
67
- switch (reader.kind) {
68
- case "field": return `read by service "${reader.service}", field "${reader.path === "" ? "(root)" : reader.path}"`;
69
- case "unread": return `named by resource "${reader.node}", read by no service`;
70
- }
71
- }
72
- //#endregion
73
- //#region ../../0-framework/3-tooling/cli/dist/run-alchemy-BlYyc4Oh.mjs
74
- /**
75
- * Which Alchemy CLI runs a generated stack file: the `alchemy` that
76
- * `@prisma/composer` depends on, found from the app the way the stack file's
77
- * own `@prisma/composer/...` imports are. The CLI and the stack code then
78
- * come from one install, so the child loads one copy of `alchemy`.
79
- *
80
- * Node's resolver finds `@prisma/composer` from the app. It cannot find
81
- * `alchemy` from there: alchemy exports neither its `package.json` nor its
82
- * bin, and has no `require` condition. Bun has no `module.findPackageJSON`.
83
- * So the last step is Node's own lookup written out: each `node_modules`
84
- * above `@prisma/composer`'s real location, nearest first.
85
- */
86
- const FIX = "Check that the app depends on @prisma/composer and that `alchemy`, which @prisma/composer depends on, is installed in a node_modules directory. Layouts without one, such as Yarn Plug'n'Play, are not supported.";
87
- function binMissing(message) {
88
- return new CliStructuredError("DEPLOY.ALCHEMY_BIN_MISSING", message, { fix: FIX });
89
- }
90
- function composerPackageDir(appDir) {
91
- try {
92
- const manifest = createRequire(path.join(appDir, "package.json")).resolve("@prisma/composer/package.json");
93
- return path.dirname(fs.realpathSync(manifest));
94
- } catch {
95
- return;
96
- }
97
- }
98
- function alchemyPackageDirAbove(dir) {
99
- for (let current = dir;; current = path.dirname(current)) {
100
- const candidate = path.join(current, "node_modules", "alchemy");
101
- if (fs.existsSync(path.join(candidate, "package.json"))) return candidate;
102
- if (path.dirname(current) === current) return void 0;
103
- }
104
- }
105
- function readPackageJson(packageDir) {
106
- try {
107
- return JSON.parse(fs.readFileSync(path.join(packageDir, "package.json"), "utf8"));
108
- } catch {
109
- return;
110
- }
111
- }
112
- function binOf(packageDir) {
113
- const manifest = readPackageJson(packageDir);
114
- if (typeof manifest !== "object" || manifest === null || !("bin" in manifest)) return void 0;
115
- const bin = manifest.bin;
116
- const relative = typeof bin === "string" ? bin : typeof bin === "object" && bin !== null && "alchemy" in bin ? bin.alchemy : void 0;
117
- if (typeof relative !== "string") return void 0;
118
- const entry = path.join(packageDir, relative);
119
- return fs.existsSync(entry) ? entry : void 0;
120
- }
121
- /**
122
- * The JavaScript file `alchemy`'s `bin` names, for the app in `appDir`.
123
- * Raises DEPLOY.ALCHEMY_BIN_MISSING when the app does not resolve
124
- * `@prisma/composer` or no usable `alchemy` is installed beside it.
125
- */
126
- function resolveAlchemyBin(appDir) {
127
- const composerDir = composerPackageDir(appDir);
128
- if (composerDir === void 0) throw binMissing(`Could not resolve @prisma/composer from "${appDir}".`);
129
- const alchemyDir = alchemyPackageDirAbove(composerDir);
130
- const entry = alchemyDir === void 0 ? void 0 : binOf(alchemyDir);
131
- if (entry === void 0) throw binMissing(`Could not resolve the bin of the \`alchemy\` package @prisma/composer depends on, from "${composerDir}".`);
132
- return entry;
133
- }
134
- /**
135
- * Pipeline step 9 (deploy-cli.md § The pipeline; design-notes.md's "Driving
136
- * Alchemy" call): run the generated stack file and, for programmatic hosts, pipe its
137
- * output through redaction.
138
- *
139
- * Runs the bin of the `alchemy` the app's `@prisma/composer` depends on
140
- * (`resolveAlchemyBin`), started with Node (`nodeExecutable`). Never a
141
- * `node_modules/.bin` link, which pnpm creates only for an app's direct
142
- * dependencies.
143
- *
144
- * This module composes the invocation; it does not decide how the child is
145
- * started. Under the CLI the engine starts it (`ctx.spawn`), which is what
146
- * makes Ctrl-C reach the child natively and keeps signal policy in one place.
147
- * `spawnAlchemy` is the default for programmatic hosts driving
148
- * `@prisma/composer/control`, which have no engine to borrow. Only
149
- * `spawnAlchemy` redacts the child's output; under the CLI the child gets the
150
- * terminal and its output is not redacted (ADR-0062).
151
- */
152
- function currentRuntime() {
153
- return {
154
- bun: process.versions.bun !== void 0,
155
- execPath: process.execPath,
156
- env: process.env,
157
- platform: process.platform,
158
- exists: fs.existsSync
159
- };
160
- }
161
- function envValue(env, name) {
162
- return Object.entries(env).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];
163
- }
164
- /** The file names `node` may have in a PATH directory: PATHEXT's extensions on Windows. */
165
- function nodeFileNames(runtime) {
166
- if (runtime.platform !== "win32") return ["node"];
167
- return (envValue(runtime.env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").filter((extension) => extension.length > 0).map((extension) => `node${extension}`);
168
- }
169
- /**
170
- * The Node that starts Alchemy's launcher: this process's own runtime under
171
- * Node, and the first `node` on PATH under Bun. Alchemy's launcher may still
172
- * move itself to Bun when the package-manager environment says Bun invoked
173
- * it (`bunx`, `bun run`), so the runtime Alchemy ends up on follows how
174
- * `prisma` was invoked.
175
- */
176
- function nodeExecutable(runtime = currentRuntime()) {
177
- if (!runtime.bun) return runtime.execPath;
178
- const paths = runtime.platform === "win32" ? path.win32 : path.posix;
179
- const names = nodeFileNames(runtime);
180
- for (const rawDir of (envValue(runtime.env, "PATH") ?? "").split(paths.delimiter)) {
181
- const dir = rawDir.replace(/^"(.*)"$/, "$1");
182
- if (dir.length === 0) continue;
183
- for (const name of names) {
184
- const candidate = paths.join(dir, name);
185
- if (runtime.exists(candidate)) return candidate;
186
- }
187
- }
188
- throw new CliStructuredError("DEPLOY.NODE_MISSING", "Composer starts Alchemy with Node, and no `node` was found on PATH.", { fix: "Install Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer, and put it on PATH, or run `prisma` under Node." });
189
- }
190
- /**
191
- * Resolves the invocation against this machine — the step every adapter takes
192
- * and no caller should. Runs alchemy's JavaScript entry with Node, so no shell
193
- * shim is involved on any platform. Raises DEPLOY.ALCHEMY_BIN_MISSING when
194
- * Composer's alchemy cannot be resolved, and DEPLOY.NODE_MISSING when no Node
195
- * can run it.
196
- */
197
- function alchemyCommandLine(invocation, alchemyBin = resolveAlchemyBin(invocation.cwd), node = nodeExecutable()) {
198
- return {
199
- command: node,
200
- args: [
201
- alchemyBin,
202
- invocation.action,
203
- invocation.stackFileRelativePath,
204
- "--yes",
205
- "--stage",
206
- invocation.stage
207
- ],
208
- cwd: invocation.cwd,
209
- env: invocation.env
210
- };
211
- }
212
- /** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */
213
- function alchemyInvocation(input) {
214
- return {
215
- action: input.command,
216
- stackFileRelativePath: input.stackFileRelativePath,
217
- cwd: input.cwd,
218
- stage: input.stage,
219
- env: {
220
- ...input.containerEnv,
221
- ...input.preflightEnv,
222
- ...input.env
223
- },
224
- redactedValues: input.redactedValues
225
- };
226
- }
227
- /**
228
- * The default runner for hosts with no engine: stdin inherited and output piped through redaction, the caller's
229
- * own process group, and the child's status returned verbatim. It does not
230
- * collapse a signal into an exit code — that collapse is what made a
231
- * Ctrl-C'd deploy report itself as a failure.
232
- */
233
- const spawnAlchemy = async (invocation) => {
234
- const commandLine = alchemyCommandLine(invocation);
235
- return {
236
- ...await spawnCommandLine(commandLine, invocation.redactedValues),
237
- commandLine
238
- };
239
- };
240
- /**
241
- * One argument as the platform's shell reads it literally: single quotes for
242
- * POSIX shells, double quotes for cmd.exe. cmd.exe expands `%VAR%` inside
243
- * double quotes, and strips or expands `!` when delayed expansion is on; no
244
- * quoting prevents either, so an argument containing them is not fully
245
- * literal there.
246
- */
247
- function shellArg(arg, platform) {
248
- if (platform === "win32") return /^[\w@+=:,./\\~-]+$/.test(arg) ? arg : `"${arg.replaceAll("\"", "\"\"")}"`;
249
- return /^[\w@%+=:,./-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", "'\\''")}'`;
250
- }
251
- /**
252
- * The command a user runs from the invocation's directory to repeat a
253
- * converge: the command line the adapter started, or, from an adapter that
254
- * does not report one, `alchemy` with the same arguments.
255
- */
256
- function reproduceCommand(invocation, outcome, platform = process.platform) {
257
- return (outcome?.commandLine === void 0 ? [
258
- "alchemy",
259
- invocation.action,
260
- invocation.stackFileRelativePath,
261
- "--yes",
262
- "--stage",
263
- invocation.stage
264
- ] : [outcome.commandLine.command, ...outcome.commandLine.args]).map((arg) => shellArg(arg, platform)).join(" ");
265
- }
266
- /** Starts a resolved command line with stdin inherited and its output piped through redaction, and returns how it ended. */
267
- function spawnCommandLine(line, redactedValues, outputs = process) {
268
- return new Promise((resolve, reject) => {
269
- const child = spawn(line.command, [...line.args], {
270
- cwd: line.cwd,
271
- stdio: [
272
- "inherit",
273
- "pipe",
274
- "pipe"
275
- ],
276
- env: {
277
- ...process.env,
278
- ...line.env
279
- }
280
- });
281
- const stdout = new StreamRedactor(redactedValues);
282
- const stderr = new StreamRedactor(redactedValues);
283
- const write = (stream, text) => {
284
- if (text.length > 0) stream.write(text);
285
- };
286
- child.stdout?.setEncoding("utf8").on("data", (chunk) => write(outputs.stdout, stdout.push(chunk)));
287
- child.stderr?.setEncoding("utf8").on("data", (chunk) => write(outputs.stderr, stderr.push(chunk)));
288
- child.on("error", reject);
289
- child.on("close", (exitCode, signal) => {
290
- write(outputs.stdout, stdout.end());
291
- write(outputs.stderr, stderr.end());
292
- resolve({
293
- exitCode,
294
- signal
295
- });
296
- });
297
- });
298
- }
299
- //#endregion
300
- export { containerEnv as a, preflightEnvVarName as c, spawnAlchemy as i, alchemyInvocation as n, platformVariableReaderText as o, reproduceCommand as r, preflightEnv as s, alchemyCommandLine as t };
301
-
302
- //# sourceMappingURL=run-alchemy-BlYyc4Oh-BnFv0AaY.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-alchemy-BlYyc4Oh-BnFv0AaY.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/preflight-transport-C7_3abXW.mjs","../../../0-framework/3-tooling/cli/dist/run-alchemy-BlYyc4Oh.mjs"],"sourcesContent":["//#region src/container-transport.ts\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PRISMA_CLOUD': uppercased, every non-alphanumeric run replaced by one underscore. */\nfunction envVarSafeExtensionId(extensionId) {\n\treturn extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, \"_\").replace(/^_+|_+$/g, \"\");\n}\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_CONTAINER_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction containerEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_CONTAINER_${envVarSafeExtensionId(extensionId)}`;\n}\nfunction collisionError(a, b, varName) {\n\treturn /* @__PURE__ */ new Error(`Extension ids \"${a}\" and \"${b}\" both map to the container transport variable \"${varName}\" — rename one of the extensions.`);\n}\nfunction emptySerializeError(extensionId) {\n\treturn /* @__PURE__ */ new Error(`Extension \"${extensionId}\"'s container instance serialized to an empty string — ContainerInstance.serialize() must return a non-empty string.`);\n}\n/** The env entries the CLI sets on the alchemy process: `{ [containerEnvVarName(id)]: instance.serialize() }` for every resolved instance. */\nfunction containerEnv(instances) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, instance] of instances) {\n\t\tconst varName = containerEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw collisionError(owner, extensionId, varName);\n\t\townerByVarName.set(varName, extensionId);\n\t\tconst serialized = instance.serialize();\n\t\tif (serialized.length === 0) throw emptySerializeError(extensionId);\n\t\tenv[varName] = serialized;\n\t}\n\treturn env;\n}\n/**\n* The alchemy-process side: for each extension with a container descriptor\n* whose var is present in `env`, call its deserialize. Absent var → no entry.\n*/\nfunction deserializeContainers(extensions, env) {\n\tconst instances = /* @__PURE__ */ new Map();\n\tfor (const extension of extensions) {\n\t\tconst descriptor = extension.container;\n\t\tif (descriptor === void 0) continue;\n\t\tconst serialized = env[containerEnvVarName(extension.id)];\n\t\tif (serialized === void 0) continue;\n\t\tinstances.set(extension.id, descriptor.deserialize(serialized));\n\t}\n\treturn instances;\n}\n//#endregion\n//#region src/preflight-transport.ts\n/**\n* Carries an extension's preflight payload from the CLI process to the\n* alchemy child (which re-imports the config from scratch) — one env var per\n* extension, same channel as containers (container-transport.ts), filled by\n* whichever preflight the run executed: the deploy preflight or the local\n* target's dev preflight. The framework never reads the contents, so an\n* extension that implements both must tell its own payload kinds apart.\n* Payloads carry metadata only, never secret values: the child's environment\n* is not a secret store.\n*/\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PREFLIGHT_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction preflightEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_PREFLIGHT_${envVarSafeExtensionId(extensionId)}`;\n}\n/** The env entries the CLI sets on the alchemy process: `{ [preflightEnvVarName(id)]: payload }` for every extension whose preflight returned one. */\nfunction preflightEnv(payloads) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, payload] of payloads) {\n\t\tif (payload.length === 0) continue;\n\t\tconst varName = preflightEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw new Error(`Extension ids \"${owner}\" and \"${extensionId}\" both use the environment variable \"${varName}\". Rename one of the extensions.`);\n\t\townerByVarName.set(varName, extensionId);\n\t\tenv[varName] = payload;\n\t}\n\treturn env;\n}\n/** The alchemy-process side: the payload this extension's own preflight wrote, or `undefined` when it wrote none (or when nothing ran a preflight at all). */\nfunction readPreflightPayload(extensionId, env) {\n\tconst payload = env[preflightEnvVarName(extensionId)];\n\treturn payload === void 0 || payload.length === 0 ? void 0 : payload;\n}\n/** One reader as the deploy prints it, for example `read by service \"shop.email\", field \"apiKey\"`. */\nfunction platformVariableReaderText(reader) {\n\tswitch (reader.kind) {\n\t\tcase \"field\": return `read by service \"${reader.service}\", field \"${reader.path === \"\" ? \"(root)\" : reader.path}\"`;\n\t\tcase \"unread\": return `named by resource \"${reader.node}\", read by no service`;\n\t}\n}\n//#endregion\nexport { containerEnv as a, readPreflightPayload as i, preflightEnv as n, containerEnvVarName as o, preflightEnvVarName as r, deserializeContainers as s, platformVariableReaderText as t };\n\n//# sourceMappingURL=preflight-transport-C7_3abXW.mjs.map","import { r as StreamRedactor } from \"./redaction-CjMYXtGp.mjs\";\nimport { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport spawn from \"cross-spawn\";\n//#region src/alchemy-bin.ts\n/**\n* Which Alchemy CLI runs a generated stack file: the `alchemy` that\n* `@prisma/composer` depends on, found from the app the way the stack file's\n* own `@prisma/composer/...` imports are. The CLI and the stack code then\n* come from one install, so the child loads one copy of `alchemy`.\n*\n* Node's resolver finds `@prisma/composer` from the app. It cannot find\n* `alchemy` from there: alchemy exports neither its `package.json` nor its\n* bin, and has no `require` condition. Bun has no `module.findPackageJSON`.\n* So the last step is Node's own lookup written out: each `node_modules`\n* above `@prisma/composer`'s real location, nearest first.\n*/\nconst FIX = \"Check that the app depends on @prisma/composer and that `alchemy`, which @prisma/composer depends on, is installed in a node_modules directory. Layouts without one, such as Yarn Plug'n'Play, are not supported.\";\nfunction binMissing(message) {\n\treturn new CliStructuredError(\"DEPLOY.ALCHEMY_BIN_MISSING\", message, { fix: FIX });\n}\nfunction composerPackageDir(appDir) {\n\ttry {\n\t\tconst manifest = createRequire(path.join(appDir, \"package.json\")).resolve(\"@prisma/composer/package.json\");\n\t\treturn path.dirname(fs.realpathSync(manifest));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction alchemyPackageDirAbove(dir) {\n\tfor (let current = dir;; current = path.dirname(current)) {\n\t\tconst candidate = path.join(current, \"node_modules\", \"alchemy\");\n\t\tif (fs.existsSync(path.join(candidate, \"package.json\"))) return candidate;\n\t\tif (path.dirname(current) === current) return void 0;\n\t}\n}\nfunction readPackageJson(packageDir) {\n\ttry {\n\t\treturn JSON.parse(fs.readFileSync(path.join(packageDir, \"package.json\"), \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction binOf(packageDir) {\n\tconst manifest = readPackageJson(packageDir);\n\tif (typeof manifest !== \"object\" || manifest === null || !(\"bin\" in manifest)) return void 0;\n\tconst bin = manifest.bin;\n\tconst relative = typeof bin === \"string\" ? bin : typeof bin === \"object\" && bin !== null && \"alchemy\" in bin ? bin.alchemy : void 0;\n\tif (typeof relative !== \"string\") return void 0;\n\tconst entry = path.join(packageDir, relative);\n\treturn fs.existsSync(entry) ? entry : void 0;\n}\n/**\n* The JavaScript file `alchemy`'s `bin` names, for the app in `appDir`.\n* Raises DEPLOY.ALCHEMY_BIN_MISSING when the app does not resolve\n* `@prisma/composer` or no usable `alchemy` is installed beside it.\n*/\nfunction resolveAlchemyBin(appDir) {\n\tconst composerDir = composerPackageDir(appDir);\n\tif (composerDir === void 0) throw binMissing(`Could not resolve @prisma/composer from \"${appDir}\".`);\n\tconst alchemyDir = alchemyPackageDirAbove(composerDir);\n\tconst entry = alchemyDir === void 0 ? void 0 : binOf(alchemyDir);\n\tif (entry === void 0) throw binMissing(`Could not resolve the bin of the \\`alchemy\\` package @prisma/composer depends on, from \"${composerDir}\".`);\n\treturn entry;\n}\n//#endregion\n//#region src/run-alchemy.ts\n/**\n* Pipeline step 9 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): run the generated stack file and, for programmatic hosts, pipe its\n* output through redaction.\n*\n* Runs the bin of the `alchemy` the app's `@prisma/composer` depends on\n* (`resolveAlchemyBin`), started with Node (`nodeExecutable`). Never a\n* `node_modules/.bin` link, which pnpm creates only for an app's direct\n* dependencies.\n*\n* This module composes the invocation; it does not decide how the child is\n* started. Under the CLI the engine starts it (`ctx.spawn`), which is what\n* makes Ctrl-C reach the child natively and keeps signal policy in one place.\n* `spawnAlchemy` is the default for programmatic hosts driving\n* `@prisma/composer/control`, which have no engine to borrow. Only\n* `spawnAlchemy` redacts the child's output; under the CLI the child gets the\n* terminal and its output is not redacted (ADR-0062).\n*/\nfunction currentRuntime() {\n\treturn {\n\t\tbun: process.versions.bun !== void 0,\n\t\texecPath: process.execPath,\n\t\tenv: process.env,\n\t\tplatform: process.platform,\n\t\texists: fs.existsSync\n\t};\n}\nfunction envValue(env, name) {\n\treturn Object.entries(env).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];\n}\n/** The file names `node` may have in a PATH directory: PATHEXT's extensions on Windows. */\nfunction nodeFileNames(runtime) {\n\tif (runtime.platform !== \"win32\") return [\"node\"];\n\treturn (envValue(runtime.env, \"PATHEXT\") ?? \".COM;.EXE;.BAT;.CMD\").split(\";\").filter((extension) => extension.length > 0).map((extension) => `node${extension}`);\n}\n/**\n* The Node that starts Alchemy's launcher: this process's own runtime under\n* Node, and the first `node` on PATH under Bun. Alchemy's launcher may still\n* move itself to Bun when the package-manager environment says Bun invoked\n* it (`bunx`, `bun run`), so the runtime Alchemy ends up on follows how\n* `prisma` was invoked.\n*/\nfunction nodeExecutable(runtime = currentRuntime()) {\n\tif (!runtime.bun) return runtime.execPath;\n\tconst paths = runtime.platform === \"win32\" ? path.win32 : path.posix;\n\tconst names = nodeFileNames(runtime);\n\tfor (const rawDir of (envValue(runtime.env, \"PATH\") ?? \"\").split(paths.delimiter)) {\n\t\tconst dir = rawDir.replace(/^\"(.*)\"$/, \"$1\");\n\t\tif (dir.length === 0) continue;\n\t\tfor (const name of names) {\n\t\t\tconst candidate = paths.join(dir, name);\n\t\t\tif (runtime.exists(candidate)) return candidate;\n\t\t}\n\t}\n\tthrow new CliStructuredError(\"DEPLOY.NODE_MISSING\", \"Composer starts Alchemy with Node, and no `node` was found on PATH.\", { fix: \"Install Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer, and put it on PATH, or run `prisma` under Node.\" });\n}\n/**\n* Resolves the invocation against this machine — the step every adapter takes\n* and no caller should. Runs alchemy's JavaScript entry with Node, so no shell\n* shim is involved on any platform. Raises DEPLOY.ALCHEMY_BIN_MISSING when\n* Composer's alchemy cannot be resolved, and DEPLOY.NODE_MISSING when no Node\n* can run it.\n*/\nfunction alchemyCommandLine(invocation, alchemyBin = resolveAlchemyBin(invocation.cwd), node = nodeExecutable()) {\n\treturn {\n\t\tcommand: node,\n\t\targs: [\n\t\t\talchemyBin,\n\t\t\tinvocation.action,\n\t\t\tinvocation.stackFileRelativePath,\n\t\t\t\"--yes\",\n\t\t\t\"--stage\",\n\t\t\tinvocation.stage\n\t\t],\n\t\tcwd: invocation.cwd,\n\t\tenv: invocation.env\n\t};\n}\n/** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */\nfunction alchemyInvocation(input) {\n\treturn {\n\t\taction: input.command,\n\t\tstackFileRelativePath: input.stackFileRelativePath,\n\t\tcwd: input.cwd,\n\t\tstage: input.stage,\n\t\tenv: {\n\t\t\t...input.containerEnv,\n\t\t\t...input.preflightEnv,\n\t\t\t...input.env\n\t\t},\n\t\tredactedValues: input.redactedValues\n\t};\n}\n/**\n* The default runner for hosts with no engine: stdin inherited and output piped through redaction, the caller's\n* own process group, and the child's status returned verbatim. It does not\n* collapse a signal into an exit code — that collapse is what made a\n* Ctrl-C'd deploy report itself as a failure.\n*/\nconst spawnAlchemy = async (invocation) => {\n\tconst commandLine = alchemyCommandLine(invocation);\n\treturn {\n\t\t...await spawnCommandLine(commandLine, invocation.redactedValues),\n\t\tcommandLine\n\t};\n};\n/**\n* One argument as the platform's shell reads it literally: single quotes for\n* POSIX shells, double quotes for cmd.exe. cmd.exe expands `%VAR%` inside\n* double quotes, and strips or expands `!` when delayed expansion is on; no\n* quoting prevents either, so an argument containing them is not fully\n* literal there.\n*/\nfunction shellArg(arg, platform) {\n\tif (platform === \"win32\") return /^[\\w@+=:,./\\\\~-]+$/.test(arg) ? arg : `\"${arg.replaceAll(\"\\\"\", \"\\\"\\\"\")}\"`;\n\treturn /^[\\w@%+=:,./-]+$/.test(arg) ? arg : `'${arg.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n/**\n* The command a user runs from the invocation's directory to repeat a\n* converge: the command line the adapter started, or, from an adapter that\n* does not report one, `alchemy` with the same arguments.\n*/\nfunction reproduceCommand(invocation, outcome, platform = process.platform) {\n\treturn (outcome?.commandLine === void 0 ? [\n\t\t\"alchemy\",\n\t\tinvocation.action,\n\t\tinvocation.stackFileRelativePath,\n\t\t\"--yes\",\n\t\t\"--stage\",\n\t\tinvocation.stage\n\t] : [outcome.commandLine.command, ...outcome.commandLine.args]).map((arg) => shellArg(arg, platform)).join(\" \");\n}\n/** Starts a resolved command line with stdin inherited and its output piped through redaction, and returns how it ended. */\nfunction spawnCommandLine(line, redactedValues, outputs = process) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(line.command, [...line.args], {\n\t\t\tcwd: line.cwd,\n\t\t\tstdio: [\n\t\t\t\t\"inherit\",\n\t\t\t\t\"pipe\",\n\t\t\t\t\"pipe\"\n\t\t\t],\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\t...line.env\n\t\t\t}\n\t\t});\n\t\tconst stdout = new StreamRedactor(redactedValues);\n\t\tconst stderr = new StreamRedactor(redactedValues);\n\t\tconst write = (stream, text) => {\n\t\t\tif (text.length > 0) stream.write(text);\n\t\t};\n\t\tchild.stdout?.setEncoding(\"utf8\").on(\"data\", (chunk) => write(outputs.stdout, stdout.push(chunk)));\n\t\tchild.stderr?.setEncoding(\"utf8\").on(\"data\", (chunk) => write(outputs.stderr, stderr.push(chunk)));\n\t\tchild.on(\"error\", reject);\n\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\twrite(outputs.stdout, stdout.end());\n\t\t\twrite(outputs.stderr, stderr.end());\n\t\t\tresolve({\n\t\t\t\texitCode,\n\t\t\t\tsignal\n\t\t\t});\n\t\t});\n\t});\n}\n//#endregion\nexport { spawnAlchemy as i, alchemyInvocation as n, reproduceCommand as r, alchemyCommandLine as t };\n\n//# sourceMappingURL=run-alchemy-BlYyc4Oh.mjs.map"],"mappings":";;;;;;;;AAEA,SAAS,sBAAsB,aAAa;CAC3C,OAAO,YAAY,YAAY,CAAC,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC,QAAQ,YAAY,EAAE;AACpF;;AAEA,SAAS,oBAAoB,aAAa;CACzC,OAAO,6BAA6B,sBAAsB,WAAW;AACtE;AACA,SAAS,eAAe,GAAG,GAAG,SAAS;CACtC,uBAAuB,IAAI,MAAM,kBAAkB,EAAE,SAAS,EAAE,kDAAkD,QAAQ,kCAAkC;AAC7J;AACA,SAAS,oBAAoB,aAAa;CACzC,uBAAuB,IAAI,MAAM,cAAc,YAAY,qHAAqH;AACjL;;AAEA,SAAS,aAAa,WAAW;CAChC,MAAM,MAAM,CAAC;CACb,MAAM,iCAAiC,IAAI,IAAI;CAC/C,KAAK,MAAM,CAAC,aAAa,aAAa,WAAW;EAChD,MAAM,UAAU,oBAAoB,WAAW;EAC/C,MAAM,QAAQ,eAAe,IAAI,OAAO;EACxC,IAAI,UAAU,KAAK,GAAG,MA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