@prisma/composer 0.28.0-dev.2 → 0.28.0-dev.4
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/control.d.mts +1 -1
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +3 -3
- package/dist/control.mjs.map +1 -1
- package/dist/{dev-D5mgw4vL-ChhDjyGs.mjs → dev-B512jpX2-DsJoYKHE.mjs} +4 -4
- package/dist/{dev-D5mgw4vL-ChhDjyGs.mjs.map → dev-B512jpX2-DsJoYKHE.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-1Nn5Pz26-Bgbc4ZpD.mjs → execute-deploy-destroy-Bdzq1chG-D7xwo2CH.mjs} +24 -22
- package/dist/execute-deploy-destroy-Bdzq1chG-D7xwo2CH.mjs.map +1 -0
- package/dist/{execute-dev-BnKUgJhb-DOden3PU.mjs → execute-dev-6Peq7g1_-B1-kpm4n.mjs} +25 -31
- package/dist/execute-dev-6Peq7g1_-B1-kpm4n.mjs.map +1 -0
- package/dist/{execute-log-COAVD35o-DSphbVHe.mjs → execute-log-D377Dx_F-DWV0k_qs.mjs} +4 -4
- package/dist/{execute-log-COAVD35o-DSphbVHe.mjs.map → execute-log-D377Dx_F-DWV0k_qs.mjs.map} +1 -1
- package/dist/{local-target-B4xoiDAV.mjs → local-target-BUZG9uLx.mjs} +7 -2
- package/dist/local-target-BUZG9uLx.mjs.map +1 -0
- package/dist/local-target.d.mts +4 -2
- package/dist/local-target.d.mts.map +1 -1
- package/dist/local-target.mjs +2 -2
- package/dist/node-control.mjs +47 -28
- package/dist/node-control.mjs.map +1 -1
- package/dist/node.d.mts +14 -1
- package/dist/node.d.mts.map +1 -1
- package/dist/node.mjs +2 -1
- package/dist/node.mjs.map +1 -1
- package/dist/run-alchemy-CTw3BXKq-CN1gfeNJ.mjs +218 -0
- package/dist/run-alchemy-CTw3BXKq-CN1gfeNJ.mjs.map +1 -0
- package/package.json +10 -10
- package/skills/prisma-composer-core-concepts/SKILL.md +41 -24
- package/dist/execute-deploy-destroy-1Nn5Pz26-Bgbc4ZpD.mjs.map +0 -1
- package/dist/execute-dev-BnKUgJhb-DOden3PU.mjs.map +0 -1
- package/dist/local-target-B4xoiDAV.mjs.map +0 -1
- package/dist/run-alchemy-BEvB2sYQ-Cy2fhbcu.mjs +0 -99
- package/dist/run-alchemy-BEvB2sYQ-Cy2fhbcu.mjs.map +0 -1
package/dist/node.d.mts
CHANGED
|
@@ -6,9 +6,19 @@ import "./index-DeocL1di.mjs";
|
|
|
6
6
|
interface NodeBuildAdapter extends BuildAdapter {
|
|
7
7
|
readonly type: 'node';
|
|
8
8
|
readonly dir?: string;
|
|
9
|
+
/** Whether the build inlined its packages (`'bundled'`, the default) or left them for deploy to stage from `node_modules` (`'external'`). */
|
|
10
|
+
readonly dependencies?: NodeDependencies;
|
|
9
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* How the build treats installed packages, in bundler terms (esbuild's and
|
|
14
|
+
* Rollup's `external`, Vite's `ssr.external`). `'bundled'`: the build inlined
|
|
15
|
+
* them, so deploy copies exactly what was built. `'external'`: the build left
|
|
16
|
+
* them as imports, so deploy traces `entry` and stages the installed packages
|
|
17
|
+
* it imports.
|
|
18
|
+
*/
|
|
19
|
+
type NodeDependencies = 'bundled' | 'external';
|
|
10
20
|
/** The two forms an author may write. `dir?: never` on the single-file branch is what makes them exclusive: with `dir`, `entry` is required and names a file inside it. */
|
|
11
|
-
type NodeBuildOptions = {
|
|
21
|
+
type NodeBuildOptions = ({
|
|
12
22
|
module: string;
|
|
13
23
|
entry: string;
|
|
14
24
|
dir?: never;
|
|
@@ -16,6 +26,9 @@ type NodeBuildOptions = {
|
|
|
16
26
|
module: string;
|
|
17
27
|
dir: string;
|
|
18
28
|
entry: string;
|
|
29
|
+
}) & {
|
|
30
|
+
/** `'bundled'` (default) ships exactly what was built. `'external'` also stages the installed packages `entry` imports. */
|
|
31
|
+
dependencies?: NodeDependencies;
|
|
19
32
|
};
|
|
20
33
|
declare const nodeBuild: (opts: NodeBuildOptions) => NodeBuildAdapter;
|
|
21
34
|
//#endregion
|
package/dist/node.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.mts","names":[],"sources":["../../../0-framework/2-authoring/node/dist/index.d.mts"],"mappings":";;;;;UAGU,yBAAyB;WACxB;WACA
|
|
1
|
+
{"version":3,"file":"node.d.mts","names":[],"sources":["../../../0-framework/2-authoring/node/dist/index.d.mts"],"mappings":";;;;;UAGU,yBAAyB;WACxB;WACA;;WAEA,eAAe;;;;;;;;;KASrB;;KAEA;EACH;EACA;EACA;;EAEA;EACA;EACA;;;EAGA,eAAe;;cAEH,YAAY,MAAM,qBAAqB"}
|
package/dist/node.mjs
CHANGED
|
@@ -4,7 +4,8 @@ const nodeBuild = (opts) => ({
|
|
|
4
4
|
type: "node",
|
|
5
5
|
module: opts.module,
|
|
6
6
|
entry: opts.entry,
|
|
7
|
-
...opts.dir === void 0 ? {} : { dir: opts.dir }
|
|
7
|
+
...opts.dir === void 0 ? {} : { dir: opts.dir },
|
|
8
|
+
...opts.dependencies === void 0 ? {} : { dependencies: opts.dependencies }
|
|
8
9
|
});
|
|
9
10
|
//#endregion
|
|
10
11
|
export { nodeBuild as default };
|
package/dist/node.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.mjs","names":[],"sources":["../../../0-framework/2-authoring/node/dist/index.mjs"],"sourcesContent":["//#region src/node.ts\nconst nodeBuild = (opts) => ({\n\textension: \"@prisma/composer/node\",\n\ttype: \"node\",\n\tmodule: opts.module,\n\tentry: opts.entry,\n\t...opts.dir === void 0 ? {} : { dir: opts.dir }\n});\n//#endregion\nexport { nodeBuild as default };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";AACA,MAAM,aAAa,UAAU;CAC5B,WAAW;CACX,MAAM;CACN,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,GAAG,KAAK,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"node.mjs","names":[],"sources":["../../../0-framework/2-authoring/node/dist/index.mjs"],"sourcesContent":["//#region src/node.ts\nconst nodeBuild = (opts) => ({\n\textension: \"@prisma/composer/node\",\n\ttype: \"node\",\n\tmodule: opts.module,\n\tentry: opts.entry,\n\t...opts.dir === void 0 ? {} : { dir: opts.dir },\n\t...opts.dependencies === void 0 ? {} : { dependencies: opts.dependencies }\n});\n//#endregion\nexport { nodeBuild as default };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";AACA,MAAM,aAAa,UAAU;CAC5B,WAAW;CACX,MAAM;CACN,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,GAAG,KAAK,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI;CAC9C,GAAG,KAAK,iBAAiB,KAAK,IAAI,CAAC,IAAI,EAAE,cAAc,KAAK,aAAa;AAC1E"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import * as fs$1 from "node:fs";
|
|
4
|
+
import * as path$1 from "node:path";
|
|
5
|
+
import spawn from "cross-spawn";
|
|
6
|
+
//#region ../../0-framework/3-tooling/cli/dist/run-alchemy-CTw3BXKq.mjs
|
|
7
|
+
/**
|
|
8
|
+
* Which Alchemy CLI runs a generated stack file: the `alchemy` that
|
|
9
|
+
* `@prisma/composer` depends on, found from the app the way the stack file's
|
|
10
|
+
* own `@prisma/composer/...` imports are. The CLI and the stack code then
|
|
11
|
+
* come from one install, so the child loads one copy of `alchemy`.
|
|
12
|
+
*
|
|
13
|
+
* Node's resolver finds `@prisma/composer` from the app. It cannot find
|
|
14
|
+
* `alchemy` from there: alchemy exports neither its `package.json` nor its
|
|
15
|
+
* bin, and has no `require` condition. Bun has no `module.findPackageJSON`.
|
|
16
|
+
* So the last step is Node's own lookup written out: each `node_modules`
|
|
17
|
+
* above `@prisma/composer`'s real location, nearest first.
|
|
18
|
+
*/
|
|
19
|
+
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.";
|
|
20
|
+
function binMissing(message) {
|
|
21
|
+
return new CliStructuredError("DEPLOY.ALCHEMY_BIN_MISSING", message, { fix: FIX });
|
|
22
|
+
}
|
|
23
|
+
function composerPackageDir(appDir) {
|
|
24
|
+
try {
|
|
25
|
+
const manifest = createRequire(path$1.join(appDir, "package.json")).resolve("@prisma/composer/package.json");
|
|
26
|
+
return path$1.dirname(fs$1.realpathSync(manifest));
|
|
27
|
+
} catch {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function alchemyPackageDirAbove(dir) {
|
|
32
|
+
for (let current = dir;; current = path$1.dirname(current)) {
|
|
33
|
+
const candidate = path$1.join(current, "node_modules", "alchemy");
|
|
34
|
+
if (fs$1.existsSync(path$1.join(candidate, "package.json"))) return candidate;
|
|
35
|
+
if (path$1.dirname(current) === current) return void 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function readPackageJson(packageDir) {
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(fs$1.readFileSync(path$1.join(packageDir, "package.json"), "utf8"));
|
|
41
|
+
} catch {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function binOf(packageDir) {
|
|
46
|
+
const manifest = readPackageJson(packageDir);
|
|
47
|
+
if (typeof manifest !== "object" || manifest === null || !("bin" in manifest)) return void 0;
|
|
48
|
+
const bin = manifest.bin;
|
|
49
|
+
const relative = typeof bin === "string" ? bin : typeof bin === "object" && bin !== null && "alchemy" in bin ? bin.alchemy : void 0;
|
|
50
|
+
if (typeof relative !== "string") return void 0;
|
|
51
|
+
const entry = path$1.join(packageDir, relative);
|
|
52
|
+
return fs$1.existsSync(entry) ? entry : void 0;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The JavaScript file `alchemy`'s `bin` names, for the app in `appDir`.
|
|
56
|
+
* Raises DEPLOY.ALCHEMY_BIN_MISSING when the app does not resolve
|
|
57
|
+
* `@prisma/composer` or no usable `alchemy` is installed beside it.
|
|
58
|
+
*/
|
|
59
|
+
function resolveAlchemyBin(appDir) {
|
|
60
|
+
const composerDir = composerPackageDir(appDir);
|
|
61
|
+
if (composerDir === void 0) throw binMissing(`Could not resolve @prisma/composer from "${appDir}".`);
|
|
62
|
+
const alchemyDir = alchemyPackageDirAbove(composerDir);
|
|
63
|
+
const entry = alchemyDir === void 0 ? void 0 : binOf(alchemyDir);
|
|
64
|
+
if (entry === void 0) throw binMissing(`Could not resolve the bin of the \`alchemy\` package @prisma/composer depends on, from "${composerDir}".`);
|
|
65
|
+
return entry;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Pipeline step 7 (deploy-cli.md § The pipeline; design-notes.md's "Driving
|
|
69
|
+
* Alchemy" call): hand the terminal to the generated stack file.
|
|
70
|
+
*
|
|
71
|
+
* Runs the bin of the `alchemy` the app's `@prisma/composer` depends on
|
|
72
|
+
* (`resolveAlchemyBin`), started with Node (`nodeExecutable`). Never a
|
|
73
|
+
* `node_modules/.bin` link, which pnpm creates only for an app's direct
|
|
74
|
+
* dependencies.
|
|
75
|
+
*
|
|
76
|
+
* This module composes the invocation; it does not decide how the child is
|
|
77
|
+
* started. Under the CLI the engine starts it (`ctx.spawn`), which is what
|
|
78
|
+
* makes Ctrl-C reach the child natively and keeps signal policy in one place.
|
|
79
|
+
* `spawnAlchemy` is the default for programmatic hosts driving
|
|
80
|
+
* `@prisma/composer/control`, which have no engine to borrow.
|
|
81
|
+
*/
|
|
82
|
+
function currentRuntime() {
|
|
83
|
+
return {
|
|
84
|
+
bun: process.versions.bun !== void 0,
|
|
85
|
+
execPath: process.execPath,
|
|
86
|
+
env: process.env,
|
|
87
|
+
platform: process.platform,
|
|
88
|
+
exists: fs$1.existsSync
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function envValue(env, name) {
|
|
92
|
+
return Object.entries(env).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];
|
|
93
|
+
}
|
|
94
|
+
/** The file names `node` may have in a PATH directory: PATHEXT's extensions on Windows. */
|
|
95
|
+
function nodeFileNames(runtime) {
|
|
96
|
+
if (runtime.platform !== "win32") return ["node"];
|
|
97
|
+
return (envValue(runtime.env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").filter((extension) => extension.length > 0).map((extension) => `node${extension}`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The Node that starts Alchemy's launcher: this process's own runtime under
|
|
101
|
+
* Node, and the first `node` on PATH under Bun. Alchemy's launcher may still
|
|
102
|
+
* move itself to Bun when the package-manager environment says Bun invoked
|
|
103
|
+
* it (`bunx`, `bun run`), so the runtime Alchemy ends up on follows how
|
|
104
|
+
* `prisma` was invoked.
|
|
105
|
+
*/
|
|
106
|
+
function nodeExecutable(runtime = currentRuntime()) {
|
|
107
|
+
if (!runtime.bun) return runtime.execPath;
|
|
108
|
+
const paths = runtime.platform === "win32" ? path$1.win32 : path$1.posix;
|
|
109
|
+
const names = nodeFileNames(runtime);
|
|
110
|
+
for (const rawDir of (envValue(runtime.env, "PATH") ?? "").split(paths.delimiter)) {
|
|
111
|
+
const dir = rawDir.replace(/^"(.*)"$/, "$1");
|
|
112
|
+
if (dir.length === 0) continue;
|
|
113
|
+
for (const name of names) {
|
|
114
|
+
const candidate = paths.join(dir, name);
|
|
115
|
+
if (runtime.exists(candidate)) return candidate;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
throw new CliStructuredError("DEPLOY.NODE_MISSING", "Composer starts Alchemy with Node, and no `node` was found on PATH.", { fix: "Install Node 22.18 or newer and put it on PATH, or run `prisma` under Node." });
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Resolves the invocation against this machine — the step every adapter takes
|
|
122
|
+
* and no caller should. Runs alchemy's JavaScript entry with Node, so no shell
|
|
123
|
+
* shim is involved on any platform. Raises DEPLOY.ALCHEMY_BIN_MISSING when
|
|
124
|
+
* Composer's alchemy cannot be resolved, and DEPLOY.NODE_MISSING when no Node
|
|
125
|
+
* can run it.
|
|
126
|
+
*/
|
|
127
|
+
function alchemyCommandLine(invocation, alchemyBin = resolveAlchemyBin(invocation.cwd), node = nodeExecutable()) {
|
|
128
|
+
return {
|
|
129
|
+
command: node,
|
|
130
|
+
args: [
|
|
131
|
+
alchemyBin,
|
|
132
|
+
invocation.action,
|
|
133
|
+
invocation.stackFileRelativePath,
|
|
134
|
+
"--yes",
|
|
135
|
+
"--stage",
|
|
136
|
+
invocation.stage
|
|
137
|
+
],
|
|
138
|
+
cwd: invocation.cwd,
|
|
139
|
+
env: invocation.env
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */
|
|
143
|
+
function alchemyInvocation(input) {
|
|
144
|
+
return {
|
|
145
|
+
action: input.command,
|
|
146
|
+
stackFileRelativePath: input.stackFileRelativePath,
|
|
147
|
+
cwd: input.cwd,
|
|
148
|
+
stage: input.stage,
|
|
149
|
+
env: {
|
|
150
|
+
...input.containerEnv,
|
|
151
|
+
...input.preflightEnv,
|
|
152
|
+
...input.env
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The default runner for hosts with no engine: inherited stdio, the caller's
|
|
158
|
+
* own process group, and the child's status returned verbatim. It does not
|
|
159
|
+
* collapse a signal into an exit code — that collapse is what made a
|
|
160
|
+
* Ctrl-C'd deploy report itself as a failure.
|
|
161
|
+
*/
|
|
162
|
+
const spawnAlchemy = async (invocation) => {
|
|
163
|
+
const commandLine = alchemyCommandLine(invocation);
|
|
164
|
+
return {
|
|
165
|
+
...await spawnCommandLine(commandLine),
|
|
166
|
+
commandLine
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* One argument as the platform's shell reads it literally: single quotes for
|
|
171
|
+
* POSIX shells, double quotes for cmd.exe. cmd.exe expands `%VAR%` inside
|
|
172
|
+
* double quotes, and strips or expands `!` when delayed expansion is on; no
|
|
173
|
+
* quoting prevents either, so an argument containing them is not fully
|
|
174
|
+
* literal there.
|
|
175
|
+
*/
|
|
176
|
+
function shellArg(arg, platform) {
|
|
177
|
+
if (platform === "win32") return /^[\w@+=:,./\\~-]+$/.test(arg) ? arg : `"${arg.replaceAll("\"", "\"\"")}"`;
|
|
178
|
+
return /^[\w@%+=:,./-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", "'\\''")}'`;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The command a user runs from the invocation's directory to repeat a
|
|
182
|
+
* converge: the command line the adapter started, or, from an adapter that
|
|
183
|
+
* does not report one, `alchemy` with the same arguments.
|
|
184
|
+
*/
|
|
185
|
+
function reproduceCommand(invocation, outcome, platform = process.platform) {
|
|
186
|
+
return (outcome?.commandLine === void 0 ? [
|
|
187
|
+
"alchemy",
|
|
188
|
+
invocation.action,
|
|
189
|
+
invocation.stackFileRelativePath,
|
|
190
|
+
"--yes",
|
|
191
|
+
"--stage",
|
|
192
|
+
invocation.stage
|
|
193
|
+
] : [outcome.commandLine.command, ...outcome.commandLine.args]).map((arg) => shellArg(arg, platform)).join(" ");
|
|
194
|
+
}
|
|
195
|
+
/** Starts a resolved command line with inherited stdio and returns how it ended. */
|
|
196
|
+
function spawnCommandLine(line) {
|
|
197
|
+
return new Promise((resolve, reject) => {
|
|
198
|
+
const child = spawn(line.command, [...line.args], {
|
|
199
|
+
cwd: line.cwd,
|
|
200
|
+
stdio: "inherit",
|
|
201
|
+
env: {
|
|
202
|
+
...process.env,
|
|
203
|
+
...line.env
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
child.on("error", reject);
|
|
207
|
+
child.on("close", (exitCode, signal) => {
|
|
208
|
+
resolve({
|
|
209
|
+
exitCode,
|
|
210
|
+
signal
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
export { reproduceCommand as n, spawnAlchemy as r, alchemyInvocation as t };
|
|
217
|
+
|
|
218
|
+
//# sourceMappingURL=run-alchemy-CTw3BXKq-CN1gfeNJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-alchemy-CTw3BXKq-CN1gfeNJ.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/run-alchemy-CTw3BXKq.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\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 7 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): hand the terminal to the generated stack file.\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.\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 22.18 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};\n}\n/**\n* The default runner for hosts with no engine: inherited stdio, 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),\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 inherited stdio and returns how it ended. */\nfunction spawnCommandLine(line) {\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: \"inherit\",\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\tchild.on(\"error\", reject);\n\t\tchild.on(\"close\", (exitCode, signal) => {\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-CTw3BXKq.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,MAAM;AACZ,SAAS,WAAW,SAAS;CAC5B,OAAO,IAAI,mBAAmB,8BAA8B,SAAS,EAAE,KAAK,IAAI,CAAC;AAClF;AACA,SAAS,mBAAmB,QAAQ;CACnC,IAAI;EACH,MAAM,WAAW,cAAcA,OAAK,KAAK,QAAQ,cAAc,CAAC,CAAC,CAAC,QAAQ,+BAA+B;EACzG,OAAOA,OAAK,QAAQC,KAAG,aAAa,QAAQ,CAAC;CAC9C,QAAQ;EACP;C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|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/composer",
|
|
3
|
-
"version": "0.28.0-dev.
|
|
3
|
+
"version": "0.28.0-dev.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Prisma Composer — build a Prisma App by composing Modules. Core authoring, deploy pipeline, and the service-rpc/node/nextjs authoring surfaces. The command family the `prisma` CLI mounts lives in @prisma/composer-cli.",
|
|
6
6
|
"exports": {
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"@prisma/management-api-sdk": "^1.80.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@internal/assemble": "0.28.0-dev.
|
|
43
|
-
"@internal/cli": "0.28.0-dev.
|
|
44
|
-
"@internal/core": "0.28.0-dev.
|
|
45
|
-
"@internal/foundation": "0.28.0-dev.
|
|
46
|
-
"@internal/lowering": "0.28.0-dev.
|
|
47
|
-
"@internal/nextjs": "0.28.0-dev.
|
|
48
|
-
"@internal/node": "0.28.0-dev.
|
|
49
|
-
"@internal/service-rpc": "0.28.0-dev.
|
|
50
|
-
"@internal/tsdown-config": "0.28.0-dev.
|
|
42
|
+
"@internal/assemble": "0.28.0-dev.4",
|
|
43
|
+
"@internal/cli": "0.28.0-dev.4",
|
|
44
|
+
"@internal/core": "0.28.0-dev.4",
|
|
45
|
+
"@internal/foundation": "0.28.0-dev.4",
|
|
46
|
+
"@internal/lowering": "0.28.0-dev.4",
|
|
47
|
+
"@internal/nextjs": "0.28.0-dev.4",
|
|
48
|
+
"@internal/node": "0.28.0-dev.4",
|
|
49
|
+
"@internal/service-rpc": "0.28.0-dev.4",
|
|
50
|
+
"@internal/tsdown-config": "0.28.0-dev.4",
|
|
51
51
|
"@types/node": "^26.0.1",
|
|
52
52
|
"tsdown": "^0.22.7",
|
|
53
53
|
"typescript": "^6.0.3"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: prisma-composer-core-concepts
|
|
3
3
|
metadata:
|
|
4
4
|
library: "@prisma/composer"
|
|
5
|
-
library_version: "0.28.0-dev.
|
|
5
|
+
library_version: "0.28.0-dev.4"
|
|
6
6
|
version: 2026.9.1
|
|
7
7
|
description: >-
|
|
8
8
|
Use when deploying or managing an app that uses Prisma Composer
|
|
@@ -195,11 +195,12 @@ be reimplemented:
|
|
|
195
195
|
|
|
196
196
|
## Builds are yours
|
|
197
197
|
|
|
198
|
-
You build, the framework assembles. For a plain server process, `entry`
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
deploy. Rules that
|
|
198
|
+
You build, the framework assembles. For a plain server process, `entry`
|
|
199
|
+
points at the ESM file your build produced. By default
|
|
200
|
+
(`dependencies: 'bundled'`) deploy copies exactly that and never ships
|
|
201
|
+
`node_modules`, so everything except runtime built-ins (`bun`, `bun:*`,
|
|
202
|
+
`node:*`) must be inlined, or it fails at boot, not at deploy. Rules that
|
|
203
|
+
bite:
|
|
203
204
|
|
|
204
205
|
1. **Two services in one package means two separate builds**, one per entry.
|
|
205
206
|
A single multi-entry build splits shared code into a chunk neither output
|
|
@@ -209,12 +210,19 @@ deploy. Rules that bite:
|
|
|
209
210
|
copied verbatim, so the server must resolve siblings against
|
|
210
211
|
`import.meta.url`, not the working directory. The tree must contain no
|
|
211
212
|
symlinks: the packager rejects them, names the link, and assembly fails.
|
|
212
|
-
3. **
|
|
213
|
+
3. **A build that leaves packages external sets `dependencies: 'external'`**
|
|
214
|
+
(either form). Deploy then traces `entry` and stages the installed
|
|
215
|
+
packages it imports, which can take minutes on a large build. Astro's Node
|
|
216
|
+
adapter, SvelteKit's `adapter-node` and React Router's server build leave
|
|
217
|
+
packages external by default. The default, `'bundled'`, copies exactly
|
|
218
|
+
what was built. A service that fails to start with
|
|
219
|
+
`Cannot find package 'x'` needs `x` bundled, or `dependencies: 'external'`.
|
|
220
|
+
4. **Next.js**: `next build` with `output: 'standalone'` is the whole build;
|
|
213
221
|
`nextjs({ module, appDir })` names the app root. Any page or action that
|
|
214
222
|
calls `load()` needs `export const dynamic = 'force-dynamic'`, because
|
|
215
223
|
the runtime environment doesn't exist at build time and Next ignores
|
|
216
224
|
runtime env for prerendered routes.
|
|
217
|
-
|
|
225
|
+
5. **Always build before `deploy` or `dev`.** Neither builds for you.
|
|
218
226
|
|
|
219
227
|
Deploy configuration is the `composer` section of `prisma.config.ts`, and
|
|
220
228
|
nothing else. It registers extensions (`prismaCloud()`, `nodeBuild()`,
|
|
@@ -243,8 +251,10 @@ refused, never silently ignored: `CONFIG.SECTION_MISSING` when no loaded
|
|
|
243
251
|
`prisma.config.ts` declares a `composer` section, `CONFIG.FIELD_RETIRED` when
|
|
244
252
|
the section still has `configPath`, `CONFIG.FILE_RETIRED` when a
|
|
245
253
|
`prisma-composer.config.*` sits next to the declaring `prisma.config.ts`; all
|
|
246
|
-
three under the CLI's `CLI.CONFIG_SECTION_INVALID`.
|
|
247
|
-
|
|
254
|
+
three under the CLI's `CLI.CONFIG_SECTION_INVALID`. `SECTION_MISSING` is fixed by
|
|
255
|
+
adding the `composer` section to `prisma.config.ts`. `FIELD_RETIRED` and
|
|
256
|
+
`FILE_RETIRED` are fixed by moving the old file's `extensions` and `state` into
|
|
257
|
+
the section, then removing `configPath` or deleting the old file.
|
|
248
258
|
`@prisma/composer-cli/family` no longer exports `ComposerSection`; the
|
|
249
259
|
section's type is `PrismaAppConfig` from `@prisma/composer/config`.
|
|
250
260
|
|
|
@@ -302,17 +312,21 @@ identity: `prisma auth login` stores a session on a developer machine, and
|
|
|
302
312
|
a destroy script, never use that session: `deploy` and `destroy` read
|
|
303
313
|
`PRISMA_SERVICE_TOKEN` and `PRISMA_WORKSPACE_ID` from the environment (both
|
|
304
314
|
in the workspace's Console settings); `dev` and `log` read neither. The
|
|
305
|
-
`prisma` bin starts under Node;
|
|
306
|
-
|
|
315
|
+
`prisma` bin starts under Node; use `pnpm prisma …` or `npx prisma …` by
|
|
316
|
+
default. Composer starts Alchemy with Node, but Alchemy's launcher moves to
|
|
317
|
+
Bun under `bunx` or `bun run`: `bunx prisma` gives Node then Bun,
|
|
318
|
+
`bunx --bun prisma` Bun then Bun. When the modules `module.ts` imports use
|
|
319
|
+
Bun APIs, `bun node_modules/prisma/dist/prisma.js deploy module.ts` from a
|
|
320
|
+
shell runs `prisma` under Bun with Alchemy on Node.
|
|
307
321
|
|
|
308
322
|
**Progress.** `prisma deploy` prints each step as it starts and finishes, with
|
|
309
323
|
its duration (`✔ assemble web (3m 42s)`), and ends with the real total
|
|
310
324
|
(`Deployed <app> to <stage> in 5m 25s.`). Steps: load config and app, one
|
|
311
325
|
assemble per service, connect to project and branch, check environment
|
|
312
326
|
variables, plan and apply (one step: alchemy does both in one process), record
|
|
313
|
-
result. A slow assemble is usually a Node service with
|
|
314
|
-
runtime dependencies are being traced. In json mode (`--json`, or stdout not
|
|
315
|
-
|
|
327
|
+
result. A slow assemble is usually a Node service with
|
|
328
|
+
`dependencies: 'external'`, whose runtime dependencies are being traced. In json mode (`--json`, or stdout not a
|
|
329
|
+
terminal) each step is a `step-started`/`step-finished` line whose `data`
|
|
316
330
|
holds `durationMs` plus whatever the build adapter or deploy target reported;
|
|
317
331
|
those extra fields vary, so don't parse them as a stable format. The
|
|
318
332
|
`deploy` operation's `onEvent` receives the same steps, and its result's
|
|
@@ -343,10 +357,11 @@ never-deployed stage fails rather than standing one up.
|
|
|
343
357
|
|
|
344
358
|
**The engine underneath is alchemy.** Convergence is executed by [alchemy](https://alchemy.run), a third-party infrastructure-as-code engine that arrives as an ordinary, exactly-pinned npm dependency of `@prisma/composer` (2.0.0-beta.78 at this library version). Your code never imports or configures it; consult alchemy's own docs for the engine itself. What matters operationally:
|
|
345
359
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
installation is
|
|
360
|
+
Composer runs the alchemy package installed beside the app's
|
|
361
|
+
`@prisma/composer` and starts it with Node (the first `node` on PATH when `prisma` runs
|
|
362
|
+
under Bun; `DEPLOY.NODE_MISSING` if none), so the app needs no direct
|
|
363
|
+
`alchemy` dependency and no `.bin` link. No global Alchemy installation is
|
|
364
|
+
needed.
|
|
350
365
|
|
|
351
366
|
1. The deploy and destroy operations write the pipeline's results to a generated, gitignored
|
|
352
367
|
stack file at `.prisma-composer/alchemy.run.ts`, then run the alchemy CLI
|
|
@@ -356,8 +371,9 @@ installation is needed.
|
|
|
356
371
|
`fromEnv()`, so nothing sensitive lands on disk, and it is regenerated
|
|
357
372
|
every run: output, not configuration, never edited.
|
|
358
373
|
2. Failures are bisectable through that file. A failing deploy names its
|
|
359
|
-
path
|
|
360
|
-
|
|
374
|
+
path and prints a reproduce command: Node running the bin of the `alchemy`
|
|
375
|
+
Composer depends on, with `deploy .prisma-composer/alchemy.run.ts --yes
|
|
376
|
+
--stage <stage>`. Running it directly separates "the framework computed the wrong thing" from "the engine or
|
|
361
377
|
platform rejected the right thing". An engine failure surfaces as
|
|
362
378
|
`DEPLOY.ENGINE_FAILED` carrying the exit code, the engine's own error
|
|
363
379
|
lines (credentials redacted, capped at 1000 characters) and that reproduce
|
|
@@ -519,9 +535,10 @@ today the blocks above plus your own Modules are the whole set, so verify a
|
|
|
519
535
|
`Schema.TaggedError is not a function`). The extensions in the `composer`
|
|
520
536
|
section import alchemy, and the app, or one of its dependencies, pins a
|
|
521
537
|
different `effect` that the package manager hoisted over Composer's pin. Match the app's own
|
|
522
|
-
`effect` to `@prisma/composer`'s exact pin, or force it
|
|
523
|
-
`"overrides": { "effect": "<pin>" }` in
|
|
524
|
-
`
|
|
538
|
+
`effect` to `@prisma/composer`'s exact pin, or force it, then reinstall:
|
|
539
|
+
npm: `"overrides": { "effect": "<pin>" }` in `package.json`; pnpm 11+:
|
|
540
|
+
an `overrides:` block in `pnpm-workspace.yaml`; pnpm 10 and earlier:
|
|
541
|
+
`pnpm.overrides` in `package.json`; Yarn: `resolutions` in `package.json`. A plain Composer
|
|
525
542
|
app never hits this: the public packages pin every `effect`-family
|
|
526
543
|
package alchemy would float.
|
|
527
544
|
2. **A deployed `/rpc/<method>` returns `401` to anything but a wired
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execute-deploy-destroy-1Nn5Pz26-Bgbc4ZpD.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-1Nn5Pz26.mjs"],"sourcesContent":["import { a as readEngineFailureCause, i as readDeploymentSummary, r as engineFailureFilePath, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-37e6WEuh.mjs\";\nimport { s as toStructured } from \"./dev-D5mgw4vL.mjs\";\nimport { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from \"./run-report-C2o98uD-.mjs\";\nimport { n as alchemyInvocation, r as spawnAlchemy } from \"./run-alchemy-BEvB2sYQ.mjs\";\nimport { r as noComposerExportMessage } from \"./composer-config-CY9fET8H.mjs\";\nimport { n as runPipeline } from \"./pipeline-B-vJNch3.mjs\";\nimport * as fs from \"node:fs\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\nimport { randomUUID } from \"node:crypto\";\nimport { containerEnv, preflightEnv, preflightEnvVarName } from \"@internal/core/config\";\nimport { spawnSync } from \"node:child_process\";\n//#region src/generate-stack.ts\n/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */\nconst GENERATED_DIR = \".prisma-composer\";\nconst GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/alchemy.run.ts` to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tlines.push(\" report: report.deploymentReport,\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the stack module's source (tests assert on it without touching disk) — uses `//` headers, not a block comment, since a cwd path with a star-slash could close one early. */\nfunction renderStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst configImport = relativeImportSpecifier(generatedDir, input.configFile);\n\treturn `// Generated by Composer's deploy and destroy operations — overwritten on every\n// run; do not edit by hand. Runnable from ${quote(input.cwd)} WITH the env the\n// CLI passes its child (the PRISMA_COMPOSER_CONTAINER_*/_PREFLIGHT_* vars —\n// without them lower() refuses because no container is resolved):\n//\n// alchemy deploy ${GENERATED_DIR}/${GENERATED_FILE}\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\nimport { lower } from '@prisma/composer/deploy';\nimport * as report from '@prisma/composer/report';\nimport prismaConfig from ${quote(configImport)};\nimport app from ${quote(appImport)};\n\nconst config = prismaConfig.composer;\nif (config === undefined) {\n throw new Error(${quote(noComposerExportMessage(input.configFile))});\n}\n\n// The app's own @prisma/composer may predate the failure recorder.\nreport.captureEngineFailure?.();\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the stack file, returning its absolute path. */\nfunction writeStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderStackFile(input));\n\treturn filePath;\n}\nconst GENERATED_STACK_RELATIVE_PATH = path.join(GENERATED_DIR, GENERATED_FILE);\n//#endregion\n//#region src/validate-stage.ts\n/** A stage name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateStageName(stage) {\n\tconst result = spawnSync(\"git\", [\"check-ref-format\", `refs/heads/${stage}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliStructuredError(\"DEPLOY.STAGE_UNVALIDATABLE\", `git is required to validate --stage \"${stage}\" (git check-ref-format): ${result.error.message}.`, { cause: result.error });\n\tif (result.status !== 0) throw new CliStructuredError(\"DEPLOY.STAGE_INVALID\", `Invalid --stage \"${stage}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${stage}\").`);\n}\n//#endregion\n//#region src/operations/execute-deploy-destroy.ts\n/**\n* The deploy/destroy executor — main.ts's pipeline orchestration with argv,\n* console, and exit codes removed: typed inputs in, structured results out.\n* Reached only by lazy import from deploy.ts/destroy.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nconst ALCHEMY_STATE_DIR = \".alchemy\";\n/** Destroy guardrail (moved from main.ts): true when `<cwd>/.alchemy` is missing or empty — likely wrong directory or nothing deployed yet. */\nfunction hasNoLocalDeployState(cwd) {\n\tconst stateDir = path.join(cwd, ALCHEMY_STATE_DIR);\n\treturn !(fs.existsSync(stateDir) && fs.readdirSync(stateDir).length > 0);\n}\n/**\n* Times each deploy step for the host's `onEvent`. A step still open when the\n* run fails is closed as failed, innermost first. A host `onEvent` that throws\n* is the host's bug and cannot fail the deploy.\n*/\nfunction deploySteps(onEvent) {\n\tconst open = /* @__PURE__ */ new Map();\n\tconst keyOf = (step) => step.name === \"assemble-service\" ? `${step.name}:${step.address}` : step.name;\n\tconst emit = (event) => {\n\t\ttry {\n\t\t\tonEvent?.(event);\n\t\t} catch {}\n\t};\n\tconst finish = (step, outcome, data) => {\n\t\tconst entry = open.get(keyOf(step));\n\t\tif (entry === void 0) return;\n\t\topen.delete(keyOf(step));\n\t\tconst durationMs = Math.round(performance.now() - entry.startedAt);\n\t\temit({\n\t\t\tkind: \"step-finished\",\n\t\t\tstep,\n\t\t\toutcome,\n\t\t\tdurationMs,\n\t\t\tdata\n\t\t});\n\t};\n\treturn {\n\t\tstart(step) {\n\t\t\topen.set(keyOf(step), {\n\t\t\t\tstep,\n\t\t\t\tstartedAt: performance.now()\n\t\t\t});\n\t\t\temit({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep\n\t\t\t});\n\t\t},\n\t\tfinish(step, data) {\n\t\t\tfinish(step, \"ok\", data);\n\t\t},\n\t\tfail(step) {\n\t\t\tfinish(step, \"failed\");\n\t\t},\n\t\tfailOpen() {\n\t\t\tfor (const { step } of [...open.values()].reverse()) finish(step, \"failed\");\n\t\t}\n\t};\n}\nasync function executeDeploy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"deploy\", {\n\t\tentry: input.entry,\n\t\tconfig: input.config,\n\t\tname: input.name,\n\t\tstage: input.stage,\n\t\tcwd,\n\t\tonEvent: void 0,\n\t\tdeps,\n\t\treportId: input.reportId,\n\t\treportPath: resolveRunReportPath(input.reportPath, process.env[RUN_REPORT_FILE_ENV], cwd),\n\t\tsteps: deploySteps(input.onEvent)\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn ok({ summary: outcome.value });\n}\nasync function executeDestroy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"destroy\", {\n\t\tentry: input.entry,\n\t\tconfig: input.config,\n\t\tname: input.name,\n\t\tstage: input.target.kind === \"stage\" ? input.target.stage : void 0,\n\t\tcwd,\n\t\tonEvent: input.onEvent,\n\t\tdeps,\n\t\treportId: void 0,\n\t\treportPath: void 0,\n\t\tsteps: deploySteps(void 0)\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn okVoid();\n}\n/**\n* Opens a session per extension that declares a reporter. A `begin` that\n* throws costs that extension its reporting and nothing else — the deploy\n* has not started, and refusing to run it because an observer failed would\n* invert the relationship.\n*/\nasync function beginReporters(extensions, context) {\n\treturn (await Promise.all(extensions.map(async (extension) => {\n\t\tif (extension.reporter === void 0) return void 0;\n\t\ttry {\n\t\t\tconst reporter = await extension.reporter.begin(context);\n\t\t\treturn reporter === void 0 ? void 0 : {\n\t\t\t\textensionId: extension.id,\n\t\t\t\treporter\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not start deploy reporting for ${extension.id}: ${detail}`);\n\t\t\treturn;\n\t\t}\n\t}))).filter((entry) => entry !== void 0);\n}\n/** Hands each session its own extension's resolved container, so it can attach the run to what that container names. */\nasync function attachReporters(reporters, containers) {\n\tawait Promise.all(reporters.map(async ({ extensionId, reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.attach({ container: containers.get(extensionId) });\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not attach this deploy to its project for ${extensionId}: ${detail}`);\n\t\t}\n\t}));\n}\n/** Every session's contribution to the alchemy child's environment, so reporting that happens inside the apply can find the run. */\nfunction reporterChildEnv(reporters) {\n\tconst env = {};\n\tfor (const { extensionId, reporter } of reporters) try {\n\t\tObject.assign(env, reporter.childEnv());\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not pass deploy reporting into the apply for ${extensionId}: ${detail}`);\n\t}\n\treturn env;\n}\n/** `failingStep` is capped at 500 by the platform and `errorMessage` at 5000; truncating here keeps a long message from costing the whole report. */\nfunction truncate(value, limit) {\n\treturn value.length <= limit ? value : `${value.slice(0, limit - 1)}…`;\n}\n/** An interrupted converge (the engine settled a Ctrl-C) — reported as `cancelled`, never as `failed`. */\nfunction wasInterrupted(failure) {\n\treturn typeof failure.meta?.[\"signal\"] === \"string\";\n}\n/**\n* Ends every reporting session, whatever the run did. Sessions never reject\n* by contract, but a buggy one must not turn a converged deploy into a\n* failure — so this swallows anyway, and reports each session independently\n* so one bad implementation cannot silence another.\n*/\nasync function finishReporters(reporters, outcome) {\n\tconst entities = outcome.summary?.nodes.flatMap((node) => node.entities) ?? [];\n\tawait Promise.all(reporters.map(async ({ reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.finish({\n\t\t\t\tok: outcome.ok,\n\t\t\t\tcancelled: outcome.cancelled,\n\t\t\t\tfailingStep: outcome.code === void 0 ? void 0 : truncate(outcome.code, 500),\n\t\t\t\terrorMessage: outcome.message === void 0 ? void 0 : truncate(outcome.message, 5e3),\n\t\t\t\tentities\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not report this deploy's outcome: ${detail}`);\n\t\t}\n\t}));\n}\n/**\n* Owns the reporting sessions around the pipeline: the inner run opens them\n* once it knows which extensions are configured, and this closes them on\n* every exit path — a returned failure, a success, or a thrown defect — as\n* the `record` step, which also writes the run report.\n* Nothing here can change what the pipeline returns.\n*/\nasync function runStackPipeline(action, opts) {\n\tconst reporters = [];\n\tlet outcome;\n\ttry {\n\t\toutcome = await runStackPipelineInner(action, opts, reporters);\n\t} catch (error) {\n\t\topts.steps.failOpen();\n\t\topts.steps.start({ name: \"record\" });\n\t\tawait finishReporters(reporters, {\n\t\t\tok: false,\n\t\t\tcancelled: false,\n\t\t\tcode: \"DEPLOY.UNEXPECTED\",\n\t\t\tmessage: error instanceof Error ? error.message : String(error)\n\t\t});\n\t\topts.steps.finish({ name: \"record\" });\n\t\tthrow error;\n\t}\n\tif (!outcome.ok) opts.steps.failOpen();\n\topts.steps.start({ name: \"record\" });\n\tawait finishReporters(reporters, outcome.ok ? {\n\t\tok: true,\n\t\tcancelled: false,\n\t\tsummary: outcome.value\n\t} : {\n\t\tok: false,\n\t\tcancelled: wasInterrupted(outcome.failure),\n\t\tcode: outcome.failure.code,\n\t\tmessage: outcome.failure.message\n\t});\n\tif (opts.reportPath === void 0 || writeRunReport(opts.reportPath, toRunReport({\n\t\tsummary: outcome.ok ? outcome.value : void 0,\n\t\tstage: opts.stage,\n\t\tfailure: outcome.ok ? void 0 : {\n\t\t\tcode: outcome.failure.code,\n\t\t\tmessage: outcome.failure.message\n\t\t}\n\t}))) opts.steps.finish({ name: \"record\" });\n\telse opts.steps.fail({ name: \"record\" });\n\treturn outcome;\n}\n/** The pipeline both actions share: validate, resolve containers, preflight,\n* write the stack file, run alchemy against it, then the destroy-only\n* teardown/removal suffix. The value is only ever a summary for deploy. */\nasync function runStackPipelineInner(action, opts, reporters) {\n\tconst { entry, config: composerConfig, name, stage, cwd, onEvent, deps, steps } = opts;\n\tsteps.start({ name: \"prepare\" });\n\tif (stage !== void 0) try {\n\t\tvalidateStageName(stage);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (action === \"destroy\" && hasNoLocalDeployState(cwd)) onEvent?.({\n\t\tkind: \"no-local-deploy-state\",\n\t\tcwd\n\t});\n\tlet pipeline;\n\tlet containers;\n\tlet alchemyStage;\n\tconst preflightPayloads = /* @__PURE__ */ new Map();\n\tlet preflightTransportEnv = {};\n\ttry {\n\t\tpipeline = await runPipeline(entry, name, cwd, composerConfig, {\n\t\t\trunAssembler: deps.runAssembler,\n\t\t\tonEvent: (event) => {\n\t\t\t\tswitch (event.kind) {\n\t\t\t\t\tcase \"loaded\":\n\t\t\t\t\t\tsteps.finish({ name: \"prepare\" });\n\t\t\t\t\t\tsteps.start({ name: \"assemble\" });\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"service-started\":\n\t\t\t\t\t\tsteps.start({\n\t\t\t\t\t\t\tname: \"assemble-service\",\n\t\t\t\t\t\t\taddress: event.address\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"service-assembled\":\n\t\t\t\t\t\tsteps.finish({\n\t\t\t\t\t\t\tname: \"assemble-service\",\n\t\t\t\t\t\t\taddress: event.address\n\t\t\t\t\t\t}, event.data);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}, action === \"destroy\" ? (error) => new CliStructuredError(\"DEPLOY.BUILD_REQUIRED\", error.message, {\n\t\t\twhy: \"destroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first.\",\n\t\t\tfix: \"Run the build, then retry the destroy.\",\n\t\t\tcause: error\n\t\t}) : void 0);\n\t\tsteps.finish({ name: \"assemble\" });\n\t\tconst { graph, name: resolvedName } = pipeline;\n\t\tconst config = pipeline.configSource.value;\n\t\tsteps.start({ name: \"connect\" });\n\t\tif (action === \"deploy\") reporters.push(...await beginReporters(config.extensions, {\n\t\t\tappName: resolvedName,\n\t\t\tgraph,\n\t\t\tstage,\n\t\t\tcwd,\n\t\t\treportId: opts.reportId,\n\t\t\tcredentials: deps.credentials\n\t\t}));\n\t\tcontainers = /* @__PURE__ */ new Map();\n\t\tfor (const extension of config.extensions) {\n\t\t\tif (extension.container === void 0) continue;\n\t\t\ttry {\n\t\t\t\tif (action === \"deploy\") containers.set(extension.id, await extension.container.ensure({\n\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\tstage\n\t\t\t\t}, deps.credentials));\n\t\t\t\telse {\n\t\t\t\t\tconst instance = await extension.container.locate({\n\t\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\t\tstage\n\t\t\t\t\t}, deps.credentials);\n\t\t\t\t\tif (instance === void 0) throw new CliStructuredError(\"DEPLOY.TARGET_NOT_FOUND\", `Nothing deployed for ${resolvedName}${stage !== void 0 ? `/${stage}` : \"\"}.`, { fix: \"Deploy it first.\" });\n\t\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_FAILED\", error);\n\t\t\t}\n\t\t}\n\t\tawait attachReporters(reporters, containers);\n\t\tconst pinnedStage = containers.get(config.state.extension)?.alchemyStage ?? stage;\n\t\tif (pinnedStage === void 0) throw new CliStructuredError(\"DEPLOY.SCOPE_MISSING\", \"The configured deploy target supplied no deploy scope (its container defines no alchemyStage), so Alchemy has no stage to run under.\", { fix: action === \"deploy\" ? \"Pass --stage <name> to choose the deploy scope explicitly.\" : \"Destroying production needs a target whose container supplies the production deploy scope.\" });\n\t\talchemyStage = pinnedStage;\n\t\tsteps.finish({ name: \"connect\" });\n\t\tif (action === \"deploy\") {\n\t\t\tsteps.start({ name: \"preflight\" });\n\t\t\tconst counts = {};\n\t\t\tconst report = (reported) => {\n\t\t\t\tfor (const [key, value] of Object.entries(reported)) counts[key] = (counts[key] ?? 0) + value;\n\t\t\t};\n\t\t\tfor (const extension of config.extensions) {\n\t\t\t\tif (extension.preflight === void 0) continue;\n\t\t\t\ttry {\n\t\t\t\t\tconst payload = await extension.preflight({\n\t\t\t\t\t\tgraph,\n\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\tstage,\n\t\t\t\t\t\tcredentials: deps.credentials,\n\t\t\t\t\t\treport\n\t\t\t\t\t});\n\t\t\t\t\tif (payload !== void 0) preflightPayloads.set(extension.id, payload);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow toStructured(\"DEPLOY.PREFLIGHT_FAILED\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tpreflightTransportEnv = preflightEnv(preflightPayloads);\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.PREFLIGHT_FAILED\", error);\n\t\t\t}\n\t\t\tsteps.finish({ name: \"preflight\" }, counts);\n\t\t}\n\t\tfor (const extension of config.extensions) preflightTransportEnv[preflightEnvVarName(extension.id)] ??= \"\";\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tlet stackPath;\n\tconst resultFilePath = path.join(cwd, \".prisma-composer\", `deployment-result-${String(process.pid)}-${randomUUID()}.json`);\n\ttry {\n\t\ttry {\n\t\t\tstackPath = writeStackFile({\n\t\t\t\tentryPath: pipeline.entryModule.path,\n\t\t\t\tcwd,\n\t\t\t\tconfigFile: pipeline.configSource.file,\n\t\t\t\tname: pipeline.name,\n\t\t\t\tassembled: pipeline.assembled\n\t\t\t});\n\t\t} catch (error) {\n\t\t\treturn notOk(toStructured(\"DEPLOY.STACK_WRITE_FAILED\", error));\n\t\t}\n\t\tconst reproduceCommand = `alchemy ${action} ${GENERATED_STACK_RELATIVE_PATH} --yes --stage ${alchemyStage}`;\n\t\tsteps.start({ name: \"apply\" });\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await (deps.alchemy ?? spawnAlchemy)(alchemyInvocation({\n\t\t\t\tcommand: action,\n\t\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\t\tcwd,\n\t\t\t\tstage: alchemyStage,\n\t\t\t\tcontainerEnv: containerEnv(containers),\n\t\t\t\tpreflightEnv: preflightTransportEnv,\n\t\t\t\tenv: {\n\t\t\t\t\t...reporterChildEnv(reporters),\n\t\t\t\t\t[DEPLOYMENT_RESULT_FILE_ENV]: resultFilePath\n\t\t\t\t}\n\t\t\t}));\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\tmeta: { diagnostics: {\n\t\t\t\t\texitCode: void 0,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand,\n\t\t\t\t\tcwd\n\t\t\t\t} }\n\t\t\t}));\n\t\t}\n\t\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} was interrupted by ${outcome.signal}.`, { meta: {\n\t\t\tsignal: outcome.signal,\n\t\t\tdiagnostics: {\n\t\t\t\texitCode: void 0,\n\t\t\t\tsignal: outcome.signal,\n\t\t\t\tstackFilePath: stackPath,\n\t\t\t\treproduceCommand,\n\t\t\t\tcwd\n\t\t\t}\n\t\t} }));\n\t\tconst status = outcome.exitCode ?? 1;\n\t\tif (status !== 0) {\n\t\t\tconst engineCause = readEngineFailureCause(resultFilePath);\n\t\t\tconst withCause = (sentence) => engineCause === void 0 ? sentence : `${sentence}\\n${engineCause}`;\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", withCause(`alchemy ${action} exited with status ${status}.`), { meta: {\n\t\t\t\texitCode: status,\n\t\t\t\t...engineCause !== void 0 ? { engineCause } : {},\n\t\t\t\tdiagnostics: {\n\t\t\t\t\texitCode: status,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand,\n\t\t\t\t\tcwd\n\t\t\t\t}\n\t\t\t} }));\n\t\t}\n\t\tsteps.finish({ name: \"apply\" });\n\t\ttry {\n\t\t\tif (action === \"destroy\") {\n\t\t\t\tfor (const extension of pipeline.configSource.value.extensions) {\n\t\t\t\t\tif (extension.teardown === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.teardown({\n\t\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\t\tstage\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.TEARDOWN_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const extension of pipeline.configSource.value.extensions) {\n\t\t\t\t\tif (extension.container === void 0) continue;\n\t\t\t\t\tconst instance = containers.get(extension.id);\n\t\t\t\t\tif (instance === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.container.remove(instance, deps.credentials);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_REMOVE_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\tthrow error;\n\t\t}\n\t\tif (action === \"deploy\") return ok(readDeploymentSummary(resultFilePath));\n\t\treturn ok(void 0);\n\t} finally {\n\t\ttry {\n\t\t\tfs.rmSync(resultFilePath, { force: true });\n\t\t\tfs.rmSync(engineFailureFilePath(resultFilePath), { force: true });\n\t\t} catch {}\n\t}\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-1Nn5Pz26.mjs.map"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;;AAEvB,SAAS,wBAAwB,cAAc,QAAQ;CACtD,MAAM,MAAMA,OAAK,SAAS,cAAc,MAAM,CAAC,CAAC,MAAMA,OAAK,GAAG,CAAC,CAAC,KAAK,GAAG;CACxE,OAAO,IAAI,WAAW,GAAG,IAAI,MAAM,KAAK;AACzC;AACA,SAAS,MAAM,OAAO;CACrB,OAAO,KAAK,UAAU,KAAK;AAC5B;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO,UAAU,MAAM,OAAO,GAAG,EAAE,WAAW,MAAM,OAAO,KAAK,EAAE;AACnE;AACA,SAAS,cAAc,OAAO;CAC7B,MAAM,QAAQ,CAAC;CACf,MAAM,KAAK,WAAW,MAAM,MAAM,IAAI,EAAE,EAAE;CAC1C,MAAM,KAAK,cAAc;CACzB,KAAK,MAAM,CAAC,IAAI,WAAW,OAAO,QAAQ,MAAM,UAAU,OAAO,GAAG,MAAM,KAAK,OAAO,MAAM,EAAE,EAAE,IAAI,aAAa,MAAM,EAAE,EAAE;CAC3H,MAAM,KAAK,MAAM;CACjB,MAAM,KAAK,oCAAoC;CAC/C,OAAO,MAAM,KAAK,IAAI;AACvB;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,eAAeA,OAAK,KAAK,MAAM,KAAK,aAAa;CACvD,MAAM,YAAY,wBAAwB,cAAc,MAAM,SAAS;CACvE,MAAM,eAAe,wBAAwB,cAAc,MAAM,UAAU;CAC3E,OAAO;6CACqC,MAAM,MAAM,GAAG,EAAE;;;;sBAIxC,cAAc,GAAG,eAAe;;;;;2BAK3B,MAAM,YAAY,EAAE;kBAC7B,MAA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