@prisma/composer-cli 0.39.0-dev.6 → 0.39.0-dev.8
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/app-converge-CVlo9uw2-BZDypKX6.mjs +88 -0
- package/dist/app-converge-CVlo9uw2-BZDypKX6.mjs.map +1 -0
- package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs +254 -0
- package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs.map +1 -0
- package/dist/{validate-environment-XwVDifWN-BtzIWXJF.mjs → deploy-Br1yvLe3.mjs} +205 -1011
- package/dist/deploy-Br1yvLe3.mjs.map +1 -0
- package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs +256 -0
- package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs.map +1 -0
- package/dist/dev-converge-worker.d.mts +1 -0
- package/dist/dev-converge-worker.mjs +143 -0
- package/dist/dev-converge-worker.mjs.map +1 -0
- package/dist/{dev-current-BT66YKUB-B5OGD2um.mjs → dev-current-ByY2RrbK-Cni2T65J.mjs} +12 -18
- package/dist/dev-current-ByY2RrbK-Cni2T65J.mjs.map +1 -0
- package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs +43 -0
- package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs.map +1 -0
- package/dist/{dist-BDdABTj4.mjs → dist-C0OGaDnj.mjs} +4 -3
- package/dist/{dist-BDdABTj4.mjs.map → dist-C0OGaDnj.mjs.map} +1 -1
- package/dist/errors-CVYwN2km.mjs +93 -0
- package/dist/errors-CVYwN2km.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-C67FX_2B-DcSZTLaS.mjs → execute-deploy-destroy-D1jnaYqU-L5pBQMUx.mjs} +245 -244
- package/dist/execute-deploy-destroy-D1jnaYqU-L5pBQMUx.mjs.map +1 -0
- package/dist/{execute-dev-CVjdm1y1-CgW8ONc3.mjs → execute-dev-BP0Shlpd-C6-D196L.mjs} +422 -166
- package/dist/execute-dev-BP0Shlpd-C6-D196L.mjs.map +1 -0
- package/dist/{execute-dev-current-D5ANAZnU-D6ogQwLQ.mjs → execute-dev-current-B792f_1m-7ZE6ulr0.mjs} +9 -6
- package/dist/{execute-dev-current-D5ANAZnU-D6ogQwLQ.mjs.map → execute-dev-current-B792f_1m-7ZE6ulr0.mjs.map} +1 -1
- package/dist/{family-D52hWFMF-Cj-y7XrD.d.mts → family-DfwviKFj-CS1L-EvS.d.mts} +172 -70
- package/dist/family-DfwviKFj-CS1L-EvS.d.mts.map +1 -0
- package/dist/family.d.mts +1 -1
- package/dist/family.mjs +87 -137
- package/dist/family.mjs.map +1 -1
- package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs +58 -0
- package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs.map +1 -0
- package/dist/{list-deployed-C7Vy_r81.mjs → list-deployed-bMQ8GJVV.mjs} +5 -4
- package/dist/{list-deployed-C7Vy_r81.mjs.map → list-deployed-bMQ8GJVV.mjs.map} +1 -1
- package/dist/local-target-CZzICh5R.mjs +34 -0
- package/dist/local-target-CZzICh5R.mjs.map +1 -0
- package/dist/preflight-transport-2d6iIchu-ArIJUY1L.mjs +56 -0
- package/dist/preflight-transport-2d6iIchu-ArIJUY1L.mjs.map +1 -0
- package/dist/{redaction-CjMYXtGp-CYefSG9A.mjs → redaction-DY6eDC12-BrK1aSN5.mjs} +17 -256
- package/dist/redaction-DY6eDC12-BrK1aSN5.mjs.map +1 -0
- package/dist/result-CttmabB6.mjs +91 -0
- package/dist/result-CttmabB6.mjs.map +1 -0
- package/dist/rolldown-runtime-C7HZzL1F.mjs +26 -0
- package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs +287 -0
- package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs.map +1 -0
- package/dist/testing.d.mts +2 -42
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +2 -5
- package/dist/testing.mjs.map +1 -1
- package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs +983 -0
- package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs.map +1 -0
- package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs +15 -0
- package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs.map +1 -0
- package/package.json +7 -7
- package/src/exports/dev-converge-worker.ts +2 -0
- package/src/exports/testing.ts +1 -4
- package/dist/app-configuration-file-Bbfq5PR3-CYdGtitc.mjs +0 -137
- package/dist/app-configuration-file-Bbfq5PR3-CYdGtitc.mjs.map +0 -1
- package/dist/dev-current-BT66YKUB-B5OGD2um.mjs.map +0 -1
- package/dist/dev-environment-name-6eEr5PW8-kDiScOL8.mjs +0 -71
- package/dist/dev-environment-name-6eEr5PW8-kDiScOL8.mjs.map +0 -1
- package/dist/execute-deploy-destroy-C67FX_2B-DcSZTLaS.mjs.map +0 -1
- package/dist/execute-dev-CVjdm1y1-CgW8ONc3.mjs.map +0 -1
- package/dist/family-D52hWFMF-Cj-y7XrD.d.mts.map +0 -1
- package/dist/generate-dev-stack-BEpqJ3AH-B7o7JyER.mjs +0 -100
- package/dist/generate-dev-stack-BEpqJ3AH-B7o7JyER.mjs.map +0 -1
- package/dist/redaction-CjMYXtGp-CYefSG9A.mjs.map +0 -1
- package/dist/result-DlBttLS8.mjs +0 -234
- package/dist/result-DlBttLS8.mjs.map +0 -1
- package/dist/run-alchemy-BlYyc4Oh-BnFv0AaY.mjs +0 -302
- package/dist/run-alchemy-BlYyc4Oh-BnFv0AaY.mjs.map +0 -1
- package/dist/validate-environment-XwVDifWN-BtzIWXJF.mjs.map +0 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { n as blindCast } from "./internal-error-Dfur7Zqt-B8J8e7ac.mjs";
|
|
2
|
+
import { l as Load, n as comparableProps, r as wrappedProviderError } from "./deploy-Br1yvLe3.mjs";
|
|
3
|
+
import { t as CliStructuredError } from "./errors-CVYwN2km.mjs";
|
|
4
|
+
import { t as resolveLocalTargets } from "./local-target-CZzICh5R.mjs";
|
|
5
|
+
import { isDeepStrictEqual } from "node:util";
|
|
6
|
+
import "effect/Effect";
|
|
7
|
+
import "node:worker_threads";
|
|
8
|
+
import "alchemy/Alchemist";
|
|
9
|
+
import "alchemy/Interaction";
|
|
10
|
+
import "alchemy/Util/LogRecord";
|
|
11
|
+
import "effect/Cause";
|
|
12
|
+
import "effect/Exit";
|
|
13
|
+
import "effect/Logger";
|
|
14
|
+
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-x89zb2MF.mjs
|
|
15
|
+
/**
|
|
16
|
+
* The process state a converge holds while it runs: the per-thread
|
|
17
|
+
* one-converge flag, the variables Alchemy reads from `process.env`, and the working
|
|
18
|
+
* directory. Shared by the converge on the main thread and by `prisma dev`,
|
|
19
|
+
* which holds it on the main thread for the life of its converge worker.
|
|
20
|
+
*/
|
|
21
|
+
/** One flag per thread, shared by every copy of this module, so two apps' installs in one host cannot converge at once. */
|
|
22
|
+
const RUNNING = Symbol.for("prisma.composer.converge.running");
|
|
23
|
+
const flag = blindCast(globalThis);
|
|
24
|
+
/** True while this thread runs a converge. */
|
|
25
|
+
function convergeRunning() {
|
|
26
|
+
return flag[RUNNING] === true;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Sets the process state Alchemy reads for the length of `run`, and restores
|
|
30
|
+
* it on every exit path: the variables in `env`, then the working directory.
|
|
31
|
+
* A directory that cannot be restored never leaves a variable behind and
|
|
32
|
+
* never changes what `run` returned.
|
|
33
|
+
*/
|
|
34
|
+
async function withProcessState(env, cwd, run) {
|
|
35
|
+
const previousEnv = Object.keys(env).map((name) => [name, process.env[name]]);
|
|
36
|
+
const previousCwd = process.cwd();
|
|
37
|
+
let changedDirectory = false;
|
|
38
|
+
try {
|
|
39
|
+
for (const [name, value] of Object.entries(env)) if (value === void 0) delete process.env[name];
|
|
40
|
+
else process.env[name] = value;
|
|
41
|
+
if (previousCwd !== cwd) {
|
|
42
|
+
process.chdir(cwd);
|
|
43
|
+
changedDirectory = true;
|
|
44
|
+
}
|
|
45
|
+
return await run();
|
|
46
|
+
} finally {
|
|
47
|
+
for (const [name, value] of previousEnv) if (value === void 0) delete process.env[name];
|
|
48
|
+
else process.env[name] = value;
|
|
49
|
+
if (changedDirectory) try {
|
|
50
|
+
process.chdir(previousCwd);
|
|
51
|
+
} catch {}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Runs `run` holding three things for its length: this thread's converge flag
|
|
56
|
+
* (on `globalThis`, so it guards this thread only), the process environment
|
|
57
|
+
* variables in `env`, and the process's working directory, changed to `cwd`.
|
|
58
|
+
* All three are restored on every exit path. `held: false` means another
|
|
59
|
+
* converge on this thread holds the flag, and nothing ran.
|
|
60
|
+
*/
|
|
61
|
+
async function holdingConvergeProcess(env, cwd, run) {
|
|
62
|
+
if (convergeRunning()) return { held: false };
|
|
63
|
+
flag[RUNNING] = true;
|
|
64
|
+
try {
|
|
65
|
+
return {
|
|
66
|
+
held: true,
|
|
67
|
+
value: await withProcessState(env, cwd, run)
|
|
68
|
+
};
|
|
69
|
+
} finally {
|
|
70
|
+
flag[RUNNING] = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function textOf(value) {
|
|
74
|
+
if (typeof value === "string") return value;
|
|
75
|
+
try {
|
|
76
|
+
const json = JSON.stringify(value);
|
|
77
|
+
if (json !== void 0) return json;
|
|
78
|
+
} catch {}
|
|
79
|
+
return String(value);
|
|
80
|
+
}
|
|
81
|
+
function isRecord$1(value) {
|
|
82
|
+
return typeof value === "object" && value !== null;
|
|
83
|
+
}
|
|
84
|
+
/** One error as a reason. A wrapped provider failure reports the error it wraps, and a structured error reports its code as its tag. */
|
|
85
|
+
function failureReasonOf(error) {
|
|
86
|
+
if (!isRecord$1(error)) return {
|
|
87
|
+
tag: "Unknown",
|
|
88
|
+
message: textOf(error)
|
|
89
|
+
};
|
|
90
|
+
const wrapped = wrappedProviderError(error);
|
|
91
|
+
if (wrapped !== void 0) return failureReasonOf(wrapped);
|
|
92
|
+
const message = typeof error["message"] === "string" ? error["message"] : void 0;
|
|
93
|
+
return {
|
|
94
|
+
tag: CliStructuredError.is(error) ? error.code : typeof error["_tag"] === "string" ? error["_tag"] : error instanceof Error ? error.name : "Unknown",
|
|
95
|
+
message: message ?? textOf(error)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-converge-messages-DML4rTz7.mjs
|
|
100
|
+
const readKey = (read) => JSON.stringify([
|
|
101
|
+
read.reader,
|
|
102
|
+
read.resource,
|
|
103
|
+
read.path
|
|
104
|
+
]);
|
|
105
|
+
function readsByResource(snapshot) {
|
|
106
|
+
const byResource = /* @__PURE__ */ new Map();
|
|
107
|
+
for (const read of snapshot.reads) {
|
|
108
|
+
const keys = byResource.get(read.resource) ?? /* @__PURE__ */ new Set();
|
|
109
|
+
keys.add(readKey(read));
|
|
110
|
+
byResource.set(read.resource, keys);
|
|
111
|
+
}
|
|
112
|
+
return byResource;
|
|
113
|
+
}
|
|
114
|
+
function propsAt(graph, address) {
|
|
115
|
+
const found = graph.nodes.find((entry) => entry.id === address)?.node;
|
|
116
|
+
return found?.kind === "resource" ? found.props : void 0;
|
|
117
|
+
}
|
|
118
|
+
function valueReadsSnapshot(graph) {
|
|
119
|
+
return {
|
|
120
|
+
reads: graph.valueReads.map(({ reader, resource, path }) => ({
|
|
121
|
+
reader,
|
|
122
|
+
resource,
|
|
123
|
+
path
|
|
124
|
+
})),
|
|
125
|
+
props: Object.fromEntries(graph.valueReads.map(({ resource }) => [resource, comparableProps(propsAt(graph, resource))]))
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const hasMemberNotIn = (keys, other) => [...keys].some((key) => !other.has(key));
|
|
129
|
+
function valueReadsChange(started, rebuilt) {
|
|
130
|
+
const before = readsByResource(started);
|
|
131
|
+
const after = readsByResource(rebuilt);
|
|
132
|
+
const added = [];
|
|
133
|
+
const removed = [];
|
|
134
|
+
const changed = [];
|
|
135
|
+
for (const address of /* @__PURE__ */ new Set([...before.keys(), ...after.keys()])) {
|
|
136
|
+
const was = before.get(address) ?? /* @__PURE__ */ new Set();
|
|
137
|
+
const is = after.get(address) ?? /* @__PURE__ */ new Set();
|
|
138
|
+
const gained = hasMemberNotIn(is, was);
|
|
139
|
+
const lost = hasMemberNotIn(was, is);
|
|
140
|
+
if (was.size > 0 && is.size > 0 && !isDeepStrictEqual(started.props[address], rebuilt.props[address]) || gained && lost) changed.push(address);
|
|
141
|
+
else if (gained) added.push(address);
|
|
142
|
+
else if (lost) removed.push(address);
|
|
143
|
+
}
|
|
144
|
+
if (added.length + removed.length + changed.length === 0) return void 0;
|
|
145
|
+
return {
|
|
146
|
+
added,
|
|
147
|
+
removed,
|
|
148
|
+
changed
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* One `prisma dev` converge as plain data, and the steps that run it: Load,
|
|
153
|
+
* `lower()` against the local target, then Alchemy's plan and apply. The
|
|
154
|
+
* default runs it in a new worker thread (`dev-converge-in-worker.ts`), so each
|
|
155
|
+
* converge imports the app's definition files as they are on disk.
|
|
156
|
+
*/
|
|
157
|
+
function cloneable(envelope) {
|
|
158
|
+
try {
|
|
159
|
+
return structuredClone(envelope);
|
|
160
|
+
} catch {
|
|
161
|
+
const { meta: _meta, ...rest } = envelope;
|
|
162
|
+
return rest;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/** `error` as a result: a structured error as its envelope, any other as a failed outcome. */
|
|
166
|
+
function thrownResult(error, appFiles = []) {
|
|
167
|
+
return CliStructuredError.is(error) ? {
|
|
168
|
+
kind: "error",
|
|
169
|
+
error: cloneable(error.toEnvelope()),
|
|
170
|
+
appFiles
|
|
171
|
+
} : {
|
|
172
|
+
kind: "outcome",
|
|
173
|
+
outcome: {
|
|
174
|
+
kind: "failed",
|
|
175
|
+
reasons: [failureReasonOf(error)]
|
|
176
|
+
},
|
|
177
|
+
appFiles
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function containersOf(job, resolved) {
|
|
181
|
+
const containers = /* @__PURE__ */ new Map();
|
|
182
|
+
for (const [id, text] of Object.entries(job.containers)) {
|
|
183
|
+
const descriptor = resolved.get(id);
|
|
184
|
+
if (descriptor !== void 0) containers.set(id, descriptor.container.deserialize(text));
|
|
185
|
+
}
|
|
186
|
+
return containers;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Lowers `app` against the local target and plans and applies it, as `job` describes. First it
|
|
190
|
+
* Loads the app as `lower()` will, and refuses to converge when its value reads differ from the
|
|
191
|
+
* ones the session started with.
|
|
192
|
+
*/
|
|
193
|
+
async function convergeDevJob(job, app, report, signal) {
|
|
194
|
+
try {
|
|
195
|
+
const graph = Load(app.root, {
|
|
196
|
+
id: job.name,
|
|
197
|
+
environment: { name: job.environment },
|
|
198
|
+
appConfigurationRead: job.appConfigurationRead
|
|
199
|
+
});
|
|
200
|
+
const change = valueReadsChange(job.valueReads, valueReadsSnapshot(graph));
|
|
201
|
+
if (change !== void 0) return {
|
|
202
|
+
kind: "value-reads-changed",
|
|
203
|
+
change,
|
|
204
|
+
appFiles: app.appFiles
|
|
205
|
+
};
|
|
206
|
+
const resolved = await resolveLocalTargets(app.config);
|
|
207
|
+
const containers = containersOf(job, resolved);
|
|
208
|
+
const stack = app.entry.lower(app.root, app.config, {
|
|
209
|
+
name: job.name,
|
|
210
|
+
environment: job.environment,
|
|
211
|
+
appConfigurationRead: job.appConfigurationRead,
|
|
212
|
+
firstProcessNodeAddresses: job.nodeAddresses,
|
|
213
|
+
bundles: { ...job.bundles },
|
|
214
|
+
unassembled: job.unassembled,
|
|
215
|
+
containers,
|
|
216
|
+
preflightPayloads: new Map(Object.entries(job.preflightPayloads)),
|
|
217
|
+
providers: app.entry.localTargetProviders(resolved, containers, job.devDir, job.plainVariableText, job.namedSecrets),
|
|
218
|
+
state: app.entry.devState()
|
|
219
|
+
});
|
|
220
|
+
return {
|
|
221
|
+
kind: "outcome",
|
|
222
|
+
outcome: await app.entry.converge({
|
|
223
|
+
operation: "deploy",
|
|
224
|
+
stack,
|
|
225
|
+
stage: job.environment,
|
|
226
|
+
cwd: job.cwd,
|
|
227
|
+
env: {},
|
|
228
|
+
signal,
|
|
229
|
+
onEvent: report.onEvent,
|
|
230
|
+
output: report.output
|
|
231
|
+
}),
|
|
232
|
+
appFiles: app.appFiles
|
|
233
|
+
};
|
|
234
|
+
} catch (error) {
|
|
235
|
+
return thrownResult(error, app.appFiles);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function isRecord(value) {
|
|
239
|
+
return typeof value === "object" && value !== null;
|
|
240
|
+
}
|
|
241
|
+
function isAbortMessage(value) {
|
|
242
|
+
return isRecord(value) && value["kind"] === "abort";
|
|
243
|
+
}
|
|
244
|
+
function isWorkerMessage(value) {
|
|
245
|
+
if (!isRecord(value)) return false;
|
|
246
|
+
switch (value["kind"]) {
|
|
247
|
+
case "event": return isRecord(value["event"]);
|
|
248
|
+
case "output": return typeof value["text"] === "string";
|
|
249
|
+
case "result": return isRecord(value["result"]) && typeof value["result"]["kind"] === "string";
|
|
250
|
+
default: return false;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
export { valueReadsSnapshot as a, thrownResult as i, isAbortMessage as n, holdingConvergeProcess as o, isWorkerMessage as r, convergeDevJob as t };
|
|
255
|
+
|
|
256
|
+
//# sourceMappingURL=dev-converge-messages-DML4rTz7-B6uxtpZG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-converge-messages-DML4rTz7-B6uxtpZG.mjs","names":["isRecord"],"sources":["../../../0-framework/3-tooling/cli/dist/converge-in-process-x89zb2MF.mjs","../../../0-framework/3-tooling/cli/dist/dev-converge-messages-DML4rTz7.mjs"],"sourcesContent":["import { wrappedProviderError } from \"@internal/core/deploy\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { isMainThread } from \"node:worker_threads\";\nimport * as Alchemist from \"alchemy/Alchemist\";\nimport * as Interaction from \"alchemy/Interaction\";\nimport { recordOf } from \"alchemy/Util/LogRecord\";\nimport * as Cause from \"effect/Cause\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Logger from \"effect/Logger\";\n//#region src/converge-process.ts\n/**\n* The process state a converge holds while it runs: the per-thread\n* one-converge flag, the variables Alchemy reads from `process.env`, and the working\n* directory. Shared by the converge on the main thread and by `prisma dev`,\n* which holds it on the main thread for the life of its converge worker.\n*/\n/** One flag per thread, shared by every copy of this module, so two apps' installs in one host cannot converge at once. */\nconst RUNNING = Symbol.for(\"prisma.composer.converge.running\");\nconst flag = blindCast(globalThis);\n/** True while this thread runs a converge. */\nfunction convergeRunning() {\n\treturn flag[RUNNING] === true;\n}\n/**\n* Sets the process state Alchemy reads for the length of `run`, and restores\n* it on every exit path: the variables in `env`, then the working directory.\n* A directory that cannot be restored never leaves a variable behind and\n* never changes what `run` returned.\n*/\nasync function withProcessState(env, cwd, run) {\n\tconst previousEnv = Object.keys(env).map((name) => [name, process.env[name]]);\n\tconst previousCwd = process.cwd();\n\tlet changedDirectory = false;\n\ttry {\n\t\tfor (const [name, value] of Object.entries(env)) if (value === void 0) delete process.env[name];\n\t\telse process.env[name] = value;\n\t\tif (previousCwd !== cwd) {\n\t\t\tprocess.chdir(cwd);\n\t\t\tchangedDirectory = true;\n\t\t}\n\t\treturn await run();\n\t} finally {\n\t\tfor (const [name, value] of previousEnv) if (value === void 0) delete process.env[name];\n\t\telse process.env[name] = value;\n\t\tif (changedDirectory) try {\n\t\t\tprocess.chdir(previousCwd);\n\t\t} catch {}\n\t}\n}\n/**\n* Runs `run` holding three things for its length: this thread's converge flag\n* (on `globalThis`, so it guards this thread only), the process environment\n* variables in `env`, and the process's working directory, changed to `cwd`.\n* All three are restored on every exit path. `held: false` means another\n* converge on this thread holds the flag, and nothing ran.\n*/\nasync function holdingConvergeProcess(env, cwd, run) {\n\tif (convergeRunning()) return { held: false };\n\tflag[RUNNING] = true;\n\ttry {\n\t\treturn {\n\t\t\theld: true,\n\t\t\tvalue: await withProcessState(env, cwd, run)\n\t\t};\n\t} finally {\n\t\tflag[RUNNING] = false;\n\t}\n}\n//#endregion\n//#region src/converge-in-process.ts\n/**\n* Runs a lowered stack's plan and apply in this process through Alchemy's\n* programmatic API (`alchemy/Alchemist`). Alchemy's typed events and log\n* lines come back as {@link ConvergeEvent}s, and what Alchemy writes to the\n* terminal itself goes to the request's `output`, so the caller renders\n* progress in its own format.\n*\n* Published as `@prisma/composer/internal/converge`: the CLI loads it from\n* the app's install, so it runs on the app's copy of alchemy and effect.\n*/\nconst FINISHED = /* @__PURE__ */ new Set([\n\t\"created\",\n\t\"updated\",\n\t\"adopted\",\n\t\"deleted\",\n\t\"orphaned\",\n\t\"replaced\",\n\t\"ran\",\n\t\"skipped\"\n]);\nfunction phaseOf(status) {\n\tif (status === \"pending\") return \"pending\";\n\tif (status === \"fail\") return \"failed\";\n\treturn FINISHED.has(status) ? \"done\" : \"running\";\n}\n/** Alchemy's typed event as a converge event; undefined for the events Composer does not show. */\nfunction toConvergeEvent(event) {\n\tswitch (event.type) {\n\t\tcase \"apply.resource.status\": return {\n\t\t\tkind: \"resource\",\n\t\t\tfqn: event.fqn,\n\t\t\tresourceType: event.resourceType,\n\t\t\tstatus: event.status,\n\t\t\tphase: phaseOf(event.status),\n\t\t\t...event.message === void 0 ? {} : { message: event.message }\n\t\t};\n\t\tcase \"apply.resource.note\": return {\n\t\t\tkind: \"log\",\n\t\t\tseverity: event.kind === void 0 ? \"info\" : \"verbose\",\n\t\t\ttext: `${event.fqn}: ${event.message}`\n\t\t};\n\t\tdefault: return;\n\t}\n}\nconst SEVERITY_OF = {\n\tinfo: \"info\",\n\twarn: \"warn\",\n\terror: \"warn\",\n\tfatal: \"warn\"\n};\n/** Alchemy's log lines at info and above, as Alchemy's console sink would print them. Typed events are left to `Alchemist.onEvent`. */\nfunction logEvents(emit) {\n\treturn Logger.make((options) => {\n\t\tconst record = recordOf(options);\n\t\tconst severity = SEVERITY_OF[record.level];\n\t\tif (severity === void 0) return;\n\t\tif (record.kind === \"log\") {\n\t\t\tconst fqn = record.attributes[\"fqn\"];\n\t\t\temit({\n\t\t\t\tkind: \"log\",\n\t\t\t\tseverity,\n\t\t\t\ttext: `${typeof fqn === \"string\" ? `${fqn}: ` : \"\"}${record.data.message}`\n\t\t\t});\n\t\t\tif (record.data.cause !== null) emit({\n\t\t\t\tkind: \"log\",\n\t\t\t\tseverity,\n\t\t\t\ttext: record.data.cause\n\t\t\t});\n\t\t} else if (record.kind === \"output\") emit({\n\t\t\tkind: \"log\",\n\t\t\tseverity: \"verbose\",\n\t\t\ttext: record.data.text\n\t\t});\n\t});\n}\nfunction textOf(value) {\n\tif (typeof value === \"string\") return value;\n\ttry {\n\t\tconst json = JSON.stringify(value);\n\t\tif (json !== void 0) return json;\n\t} catch {}\n\treturn String(value);\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/** One error as a reason. A wrapped provider failure reports the error it wraps, and a structured error reports its code as its tag. */\nfunction failureReasonOf(error) {\n\tif (!isRecord(error)) return {\n\t\ttag: \"Unknown\",\n\t\tmessage: textOf(error)\n\t};\n\tconst wrapped = wrappedProviderError(error);\n\tif (wrapped !== void 0) return failureReasonOf(wrapped);\n\tconst message = typeof error[\"message\"] === \"string\" ? error[\"message\"] : void 0;\n\treturn {\n\t\ttag: CliStructuredError.is(error) ? error.code : typeof error[\"_tag\"] === \"string\" ? error[\"_tag\"] : error instanceof Error ? error.name : \"Unknown\",\n\t\tmessage: message ?? textOf(error)\n\t};\n}\n/** The errors a converge failed with, one per distinct error, interruptions left out. */\nfunction failureReasons(cause) {\n\tconst reasons = cause.reasons.flatMap((reason) => {\n\t\tif (Cause.isInterruptReason(reason)) return [];\n\t\treturn [failureReasonOf(Cause.isFailReason(reason) ? reason.error : reason.defect)];\n\t});\n\tconst unique = new Map(reasons.map((reason) => [`${reason.tag}\\0${reason.message}`, reason]));\n\treturn unique.size > 0 ? [...unique.values()] : [{\n\t\ttag: \"Unknown\",\n\t\tmessage: Cause.pretty(cause)\n\t}];\n}\n/** A stream for Alchemy's terminal output that hands each write to `write`; it reports the terminal's size and colours as stderr does. */\nfunction writingTo(write) {\n\tconst stream = Object.create(process.stderr);\n\tstream.write = (chunk) => {\n\t\ttry {\n\t\t\twrite(typeof chunk === \"string\" ? chunk : Buffer.from(chunk).toString(\"utf8\"));\n\t\t} catch {}\n\t\treturn true;\n\t};\n\treturn stream;\n}\nfunction program(request, emit) {\n\tconst terminal = request.output === void 0 ? process.stderr : writingTo(request.output);\n\treturn Effect.gen(function* () {\n\t\tconst plan = yield* Alchemist.plan({\n\t\t\tstack: request.stack,\n\t\t\toperation: request.operation,\n\t\t\tstage: request.stage,\n\t\t\tupdateStateStore: true\n\t\t});\n\t\tyield* Alchemist.apply(plan);\n\t}).pipe(Alchemist.onEvent((event) => Effect.sync(() => {\n\t\tconst converted = toConvergeEvent(event);\n\t\tif (converted !== void 0) emit(converted);\n\t})), Effect.scoped, Effect.provide(Logger.layer([logEvents(emit)])), Effect.provide(Interaction.layerNonInteractive({\n\t\tstdout: terminal,\n\t\tstderr: terminal\n\t})), Effect.provide(Alchemist.layer()));\n}\n/**\n* Plans and applies `stack` in this process, as `alchemy deploy --yes` would.\n* The plan's scope, and the state-store lease it holds when the store has one, closes before this\n* returns, including when `signal` interrupts it. One converge runs at a time\n* per process, across every install of this module: a second call while one\n* runs is refused.\n*/\nconst convergeInProcess = async (request) => {\n\tif (convergeRunning()) return {\n\t\tkind: \"refused\",\n\t\treason: \"already-running\"\n\t};\n\tif (!isMainThread && process.cwd() !== request.cwd) return {\n\t\tkind: \"refused\",\n\t\treason: \"worker-thread\"\n\t};\n\tconst emit = (event) => {\n\t\ttry {\n\t\t\trequest.onEvent?.(event);\n\t\t} catch {}\n\t};\n\ttry {\n\t\tconst effect = program(request, emit);\n\t\tconst held = await holdingConvergeProcess(request.env, request.cwd, async () => {\n\t\t\tconst exit = await Effect.runPromiseExit(effect, request.signal === void 0 ? void 0 : { signal: request.signal });\n\t\t\tif (Exit.isSuccess(exit)) return { kind: \"applied\" };\n\t\t\tif (Cause.hasInterruptsOnly(exit.cause)) return { kind: \"interrupted\" };\n\t\t\treturn {\n\t\t\t\tkind: \"failed\",\n\t\t\t\treasons: failureReasons(exit.cause)\n\t\t\t};\n\t\t});\n\t\treturn held.held ? held.value : {\n\t\t\tkind: \"refused\",\n\t\t\treason: \"already-running\"\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tkind: \"failed\",\n\t\t\treasons: [failureReasonOf(error)]\n\t\t};\n\t}\n};\n//#endregion\nexport { failureReasonOf as n, holdingConvergeProcess as r, convergeInProcess as t };\n\n//# sourceMappingURL=converge-in-process-x89zb2MF.mjs.map","import { n as failureReasonOf } from \"./converge-in-process-x89zb2MF.mjs\";\nimport { Load } from \"@internal/core\";\nimport { comparableProps } from \"@internal/core/deploy\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport { resolveLocalTargets } from \"@internal/core/local-target\";\n//#region src/dev/value-reads-change.ts\nconst readKey = (read) => JSON.stringify([\n\tread.reader,\n\tread.resource,\n\tread.path\n]);\nfunction readsByResource(snapshot) {\n\tconst byResource = /* @__PURE__ */ new Map();\n\tfor (const read of snapshot.reads) {\n\t\tconst keys = byResource.get(read.resource) ?? /* @__PURE__ */ new Set();\n\t\tkeys.add(readKey(read));\n\t\tbyResource.set(read.resource, keys);\n\t}\n\treturn byResource;\n}\nfunction propsAt(graph, address) {\n\tconst found = graph.nodes.find((entry) => entry.id === address)?.node;\n\treturn found?.kind === \"resource\" ? found.props : void 0;\n}\nfunction valueReadsSnapshot(graph) {\n\treturn {\n\t\treads: graph.valueReads.map(({ reader, resource, path }) => ({\n\t\t\treader,\n\t\t\tresource,\n\t\t\tpath\n\t\t})),\n\t\tprops: Object.fromEntries(graph.valueReads.map(({ resource }) => [resource, comparableProps(propsAt(graph, resource))]))\n\t};\n}\nconst hasMemberNotIn = (keys, other) => [...keys].some((key) => !other.has(key));\nfunction valueReadsChange(started, rebuilt) {\n\tconst before = readsByResource(started);\n\tconst after = readsByResource(rebuilt);\n\tconst added = [];\n\tconst removed = [];\n\tconst changed = [];\n\tfor (const address of /* @__PURE__ */ new Set([...before.keys(), ...after.keys()])) {\n\t\tconst was = before.get(address) ?? /* @__PURE__ */ new Set();\n\t\tconst is = after.get(address) ?? /* @__PURE__ */ new Set();\n\t\tconst gained = hasMemberNotIn(is, was);\n\t\tconst lost = hasMemberNotIn(was, is);\n\t\tif (was.size > 0 && is.size > 0 && !isDeepStrictEqual(started.props[address], rebuilt.props[address]) || gained && lost) changed.push(address);\n\t\telse if (gained) added.push(address);\n\t\telse if (lost) removed.push(address);\n\t}\n\tif (added.length + removed.length + changed.length === 0) return void 0;\n\treturn {\n\t\tadded,\n\t\tremoved,\n\t\tchanged\n\t};\n}\n//#endregion\n//#region src/operations/dev-converge.ts\n/**\n* One `prisma dev` converge as plain data, and the steps that run it: Load,\n* `lower()` against the local target, then Alchemy's plan and apply. The\n* default runs it in a new worker thread (`dev-converge-in-worker.ts`), so each\n* converge imports the app's definition files as they are on disk.\n*/\nfunction cloneable(envelope) {\n\ttry {\n\t\treturn structuredClone(envelope);\n\t} catch {\n\t\tconst { meta: _meta, ...rest } = envelope;\n\t\treturn rest;\n\t}\n}\n/** `error` as a result: a structured error as its envelope, any other as a failed outcome. */\nfunction thrownResult(error, appFiles = []) {\n\treturn CliStructuredError.is(error) ? {\n\t\tkind: \"error\",\n\t\terror: cloneable(error.toEnvelope()),\n\t\tappFiles\n\t} : {\n\t\tkind: \"outcome\",\n\t\toutcome: {\n\t\t\tkind: \"failed\",\n\t\t\treasons: [failureReasonOf(error)]\n\t\t},\n\t\tappFiles\n\t};\n}\nfunction containersOf(job, resolved) {\n\tconst containers = /* @__PURE__ */ new Map();\n\tfor (const [id, text] of Object.entries(job.containers)) {\n\t\tconst descriptor = resolved.get(id);\n\t\tif (descriptor !== void 0) containers.set(id, descriptor.container.deserialize(text));\n\t}\n\treturn containers;\n}\n/**\n* Lowers `app` against the local target and plans and applies it, as `job` describes. First it\n* Loads the app as `lower()` will, and refuses to converge when its value reads differ from the\n* ones the session started with.\n*/\nasync function convergeDevJob(job, app, report, signal) {\n\ttry {\n\t\tconst graph = Load(app.root, {\n\t\t\tid: job.name,\n\t\t\tenvironment: { name: job.environment },\n\t\t\tappConfigurationRead: job.appConfigurationRead\n\t\t});\n\t\tconst change = valueReadsChange(job.valueReads, valueReadsSnapshot(graph));\n\t\tif (change !== void 0) return {\n\t\t\tkind: \"value-reads-changed\",\n\t\t\tchange,\n\t\t\tappFiles: app.appFiles\n\t\t};\n\t\tconst resolved = await resolveLocalTargets(app.config);\n\t\tconst containers = containersOf(job, resolved);\n\t\tconst stack = app.entry.lower(app.root, app.config, {\n\t\t\tname: job.name,\n\t\t\tenvironment: job.environment,\n\t\t\tappConfigurationRead: job.appConfigurationRead,\n\t\t\tfirstProcessNodeAddresses: job.nodeAddresses,\n\t\t\tbundles: { ...job.bundles },\n\t\t\tunassembled: job.unassembled,\n\t\t\tcontainers,\n\t\t\tpreflightPayloads: new Map(Object.entries(job.preflightPayloads)),\n\t\t\tproviders: app.entry.localTargetProviders(resolved, containers, job.devDir, job.plainVariableText, job.namedSecrets),\n\t\t\tstate: app.entry.devState()\n\t\t});\n\t\treturn {\n\t\t\tkind: \"outcome\",\n\t\t\toutcome: await app.entry.converge({\n\t\t\t\toperation: \"deploy\",\n\t\t\t\tstack,\n\t\t\t\tstage: job.environment,\n\t\t\t\tcwd: job.cwd,\n\t\t\t\tenv: {},\n\t\t\t\tsignal,\n\t\t\t\tonEvent: report.onEvent,\n\t\t\t\toutput: report.output\n\t\t\t}),\n\t\t\tappFiles: app.appFiles\n\t\t};\n\t} catch (error) {\n\t\treturn thrownResult(error, app.appFiles);\n\t}\n}\n//#endregion\n//#region src/operations/dev-converge-messages.ts\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction isAbortMessage(value) {\n\treturn isRecord(value) && value[\"kind\"] === \"abort\";\n}\nfunction isWorkerMessage(value) {\n\tif (!isRecord(value)) return false;\n\tswitch (value[\"kind\"]) {\n\t\tcase \"event\": return isRecord(value[\"event\"]);\n\t\tcase \"output\": return typeof value[\"text\"] === \"string\";\n\t\tcase \"result\": return isRecord(value[\"result\"]) && typeof value[\"result\"][\"kind\"] === \"string\";\n\t\tdefault: return false;\n\t}\n}\n//#endregion\nexport { valueReadsSnapshot as a, thrownResult as i, isWorkerMessage as n, convergeDevJob as r, isAbortMessage as t };\n\n//# sourceMappingURL=dev-converge-messages-DML4rTz7.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,UAAU,OAAO,IAAI,kCAAkC;AAC7D,MAAM,OAAO,UAAU,UAAU;;AAEjC,SAAS,kBAAkB;CAC1B,OAAO,KAAK,aAAa;AAC1B;;;;;;;AAOA,eAAe,iBAAiB,KAAK,KAAK,KAAK;CAC9C,MAAM,cAAc,OAAO,KAAK,GAAG,CAAC,CAAC,KAAK,SAAS,CAAC,MAAM,QAAQ,IAAI,KAAK,CAAC;CAC5E,MAAM,cAAc,QAAQ,IAAI;CAChC,IAAI,mBAAmB;CACvB,IAAI;EACH,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,GAAG,GAAG,IAAI,UAAU,KAAK,GAAG,OAAO,QAAQ,IAAI;OACrF,QAAQ,IAAI,QAAQ;EACzB,IAAI,gBAAgB,KAAK;GACxB,QAAQ,MAAM,GAAG;GACjB,mBAAmB;EACpB;EACA,OAAO,MAAM,IAAI;CAClB,UAAU;EACT,KAAK,MAAM,CAAC,MAAM,UAAU,aAAa,IAAI,UAAU,KAAK,GAAG,OAAO,QAA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"./composer-config-QKdY85G--CEXrb2Uc.mjs";
|
|
2
|
+
import { a as loadEntry, i as appFilesNamedBy, o as namesDirectoryWithIndex, s as registerEntryResolution } from "./deploy-Br1yvLe3.mjs";
|
|
3
|
+
import { t as CliStructuredError } from "./errors-CVYwN2km.mjs";
|
|
4
|
+
import { t as loadAppConvergeEntry } from "./app-converge-CVlo9uw2-BZDypKX6.mjs";
|
|
5
|
+
import { i as thrownResult, n as isAbortMessage, t as convergeDevJob } from "./dev-converge-messages-DML4rTz7-B6uxtpZG.mjs";
|
|
6
|
+
import { format } from "node:util";
|
|
7
|
+
import { pathToFileURL } from "node:url";
|
|
8
|
+
import { parentPort, workerData } from "node:worker_threads";
|
|
9
|
+
import { Writable } from "node:stream";
|
|
10
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-converge-worker.mjs
|
|
11
|
+
/**
|
|
12
|
+
* The worker thread one `prisma dev` converge runs in (`dev-converge-in-worker.ts`
|
|
13
|
+
* starts it). A new thread has its own module cache, so it imports the config
|
|
14
|
+
* and the app as they are on disk now. It receives a `DevConvergeJob` as its
|
|
15
|
+
* `workerData` and posts `WorkerMessage`s back.
|
|
16
|
+
*/
|
|
17
|
+
const port = parentPort;
|
|
18
|
+
if (port === null) throw new Error("dev-converge-worker runs only as a worker thread.");
|
|
19
|
+
const post = (message) => port.postMessage(message);
|
|
20
|
+
const output = (text) => post({
|
|
21
|
+
kind: "output",
|
|
22
|
+
text
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Methods that send only to an attached inspector and print nothing to the terminal, under Node or
|
|
26
|
+
* Bun. They keep their own behaviour: `console.createTask` returns a task whose `run` callers use.
|
|
27
|
+
*/
|
|
28
|
+
const INSPECTOR_ONLY = /* @__PURE__ */ new Set([
|
|
29
|
+
"context",
|
|
30
|
+
"createTask",
|
|
31
|
+
"profile",
|
|
32
|
+
"profileEnd",
|
|
33
|
+
"record",
|
|
34
|
+
"recordEnd",
|
|
35
|
+
"screenshot",
|
|
36
|
+
"timeStamp"
|
|
37
|
+
]);
|
|
38
|
+
/** Every function on `console` that can print, its own and inherited, except constructors. */
|
|
39
|
+
function printingConsoleFunctionNames() {
|
|
40
|
+
const names = /* @__PURE__ */ new Set();
|
|
41
|
+
for (let level = console; level !== null && level !== Object.prototype;) {
|
|
42
|
+
for (const name of Object.getOwnPropertyNames(level)) {
|
|
43
|
+
if (name === "constructor" || name === "Console" || INSPECTOR_ONLY.has(name)) continue;
|
|
44
|
+
if (typeof Reflect.get(console, name) === "function") names.add(name);
|
|
45
|
+
}
|
|
46
|
+
level = Object.getPrototypeOf(level);
|
|
47
|
+
}
|
|
48
|
+
return [...names];
|
|
49
|
+
}
|
|
50
|
+
const textOf = (chunk) => typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
|
|
51
|
+
/** Bun's `console.write`: each argument's bytes one after another, returning how many were written. */
|
|
52
|
+
function bunConsoleWrite(...args) {
|
|
53
|
+
const chunks = [];
|
|
54
|
+
try {
|
|
55
|
+
if (args.length === 0) throw writeArgumentError("ERR_STREAM_NULL_VALUES");
|
|
56
|
+
for (const arg of args) chunks.push(bytesOf(arg));
|
|
57
|
+
} finally {
|
|
58
|
+
if (chunks.length > 0) output(textOf(Buffer.concat(chunks)));
|
|
59
|
+
}
|
|
60
|
+
return chunks.reduce((total, chunk) => total + chunk.byteLength, 0);
|
|
61
|
+
}
|
|
62
|
+
function bytesOf(arg) {
|
|
63
|
+
if (typeof arg === "string") return Buffer.from(arg, "utf8");
|
|
64
|
+
if (arg instanceof ArrayBuffer) return new Uint8Array(arg);
|
|
65
|
+
if (ArrayBuffer.isView(arg)) return new Uint8Array(arg.buffer, arg.byteOffset, arg.byteLength);
|
|
66
|
+
throw writeArgumentError("ERR_INVALID_ARG_TYPE");
|
|
67
|
+
}
|
|
68
|
+
function writeArgumentError(code) {
|
|
69
|
+
return Object.assign(/* @__PURE__ */ new TypeError("write() expects a string, ArrayBufferView, or ArrayBuffer"), { code });
|
|
70
|
+
}
|
|
71
|
+
for (const stream of [process.stdout, process.stderr]) stream.write = (chunk) => {
|
|
72
|
+
output(textOf(chunk));
|
|
73
|
+
return true;
|
|
74
|
+
};
|
|
75
|
+
const sink = new Writable({ write(chunk, _encoding, done) {
|
|
76
|
+
output(textOf(chunk));
|
|
77
|
+
done();
|
|
78
|
+
} });
|
|
79
|
+
const replacement = new console.Console({
|
|
80
|
+
stdout: sink,
|
|
81
|
+
stderr: sink
|
|
82
|
+
});
|
|
83
|
+
const printed = (arg) => typeof arg === "string" || arg instanceof Uint8Array ? textOf(arg) : format(arg);
|
|
84
|
+
for (const name of printingConsoleFunctionNames()) {
|
|
85
|
+
const own = Reflect.get(replacement, name);
|
|
86
|
+
Reflect.set(console, name, name === "write" ? bunConsoleWrite : typeof own === "function" ? own.bind(replacement) : (...args) => output(args.map(printed).join(" ")));
|
|
87
|
+
}
|
|
88
|
+
if (typeof process.versions.bun === "string") process.on("warning", (warning) => output(`${warning.name}: ${warning.message}\n`));
|
|
89
|
+
registerEntryResolution();
|
|
90
|
+
const controller = new AbortController();
|
|
91
|
+
port.on("message", (message) => {
|
|
92
|
+
if (isAbortMessage(message)) controller.abort();
|
|
93
|
+
});
|
|
94
|
+
async function importConfig(file) {
|
|
95
|
+
const exported = (await import(pathToFileURL(file).href)).default;
|
|
96
|
+
const section = typeof exported === "object" && exported !== null && "composer" in exported ? exported.composer : void 0;
|
|
97
|
+
if (section === void 0) throw new Error(noComposerExportMessage(file));
|
|
98
|
+
const checked = checkComposerConfig(section, file);
|
|
99
|
+
if (!checked.ok) {
|
|
100
|
+
const [finding] = checked.findings;
|
|
101
|
+
throw new CliStructuredError(finding.code, finding.summary, {
|
|
102
|
+
...finding.why === void 0 ? {} : { why: finding.why },
|
|
103
|
+
fix: finding.fix
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return checked.value;
|
|
107
|
+
}
|
|
108
|
+
async function run(job) {
|
|
109
|
+
const recorded = /* @__PURE__ */ new Set();
|
|
110
|
+
try {
|
|
111
|
+
const config = await importConfig(job.configFile);
|
|
112
|
+
const { root, files } = await loadEntry(job.entry, job.cwd, void 0, recorded);
|
|
113
|
+
return await convergeDevJob(job, {
|
|
114
|
+
config,
|
|
115
|
+
root,
|
|
116
|
+
entry: await loadAppConvergeEntry(job.appDir),
|
|
117
|
+
appFiles: files
|
|
118
|
+
}, {
|
|
119
|
+
onEvent: (event) => post({
|
|
120
|
+
kind: "event",
|
|
121
|
+
event
|
|
122
|
+
}),
|
|
123
|
+
output
|
|
124
|
+
}, controller.signal);
|
|
125
|
+
} catch (error) {
|
|
126
|
+
const result = thrownResult(error, [...recorded, ...appFilesNamedBy(error)]);
|
|
127
|
+
return result.kind === "error" && process.versions.bun !== void 0 && namesDirectoryWithIndex(error) ? {
|
|
128
|
+
...result,
|
|
129
|
+
lookupKept: true
|
|
130
|
+
} : result;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
run(workerData).then((result) => {
|
|
134
|
+
post({
|
|
135
|
+
kind: "result",
|
|
136
|
+
result
|
|
137
|
+
});
|
|
138
|
+
process.exit(0);
|
|
139
|
+
});
|
|
140
|
+
//#endregion
|
|
141
|
+
export {};
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=dev-converge-worker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-converge-worker.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-converge-worker.mjs"],"sourcesContent":["import { i as noComposerExportMessage, t as checkComposerConfig } from \"./composer-config-QKdY85G-.mjs\";\nimport { i as registerEntryResolution, n as appFilesNamedBy, r as namesDirectoryWithIndex, t as loadEntry } from \"./load-entry-CEoVBdMj.mjs\";\nimport { t as loadAppConvergeEntry } from \"./app-converge-CVlo9uw2.mjs\";\nimport { i as thrownResult, r as convergeDevJob, t as isAbortMessage } from \"./dev-converge-messages-DML4rTz7.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { pathToFileURL } from \"node:url\";\nimport { format } from \"node:util\";\nimport { parentPort, workerData } from \"node:worker_threads\";\nimport { Writable } from \"node:stream\";\n//#region src/operations/dev-converge-worker.ts\n/**\n* The worker thread one `prisma dev` converge runs in (`dev-converge-in-worker.ts`\n* starts it). A new thread has its own module cache, so it imports the config\n* and the app as they are on disk now. It receives a `DevConvergeJob` as its\n* `workerData` and posts `WorkerMessage`s back.\n*/\nconst port = parentPort;\nif (port === null) throw new Error(\"dev-converge-worker runs only as a worker thread.\");\nconst post = (message) => port.postMessage(message);\nconst output = (text) => post({\n\tkind: \"output\",\n\ttext\n});\n/**\n* Methods that send only to an attached inspector and print nothing to the terminal, under Node or\n* Bun. They keep their own behaviour: `console.createTask` returns a task whose `run` callers use.\n*/\nconst INSPECTOR_ONLY = /* @__PURE__ */ new Set([\n\t\"context\",\n\t\"createTask\",\n\t\"profile\",\n\t\"profileEnd\",\n\t\"record\",\n\t\"recordEnd\",\n\t\"screenshot\",\n\t\"timeStamp\"\n]);\n/** Every function on `console` that can print, its own and inherited, except constructors. */\nfunction printingConsoleFunctionNames() {\n\tconst names = /* @__PURE__ */ new Set();\n\tfor (let level = console; level !== null && level !== Object.prototype;) {\n\t\tfor (const name of Object.getOwnPropertyNames(level)) {\n\t\t\tif (name === \"constructor\" || name === \"Console\" || INSPECTOR_ONLY.has(name)) continue;\n\t\t\tif (typeof Reflect.get(console, name) === \"function\") names.add(name);\n\t\t}\n\t\tlevel = Object.getPrototypeOf(level);\n\t}\n\treturn [...names];\n}\nconst textOf = (chunk) => typeof chunk === \"string\" ? chunk : Buffer.from(chunk).toString(\"utf8\");\n/** Bun's `console.write`: each argument's bytes one after another, returning how many were written. */\nfunction bunConsoleWrite(...args) {\n\tconst chunks = [];\n\ttry {\n\t\tif (args.length === 0) throw writeArgumentError(\"ERR_STREAM_NULL_VALUES\");\n\t\tfor (const arg of args) chunks.push(bytesOf(arg));\n\t} finally {\n\t\tif (chunks.length > 0) output(textOf(Buffer.concat(chunks)));\n\t}\n\treturn chunks.reduce((total, chunk) => total + chunk.byteLength, 0);\n}\nfunction bytesOf(arg) {\n\tif (typeof arg === \"string\") return Buffer.from(arg, \"utf8\");\n\tif (arg instanceof ArrayBuffer) return new Uint8Array(arg);\n\tif (ArrayBuffer.isView(arg)) return new Uint8Array(arg.buffer, arg.byteOffset, arg.byteLength);\n\tthrow writeArgumentError(\"ERR_INVALID_ARG_TYPE\");\n}\nfunction writeArgumentError(code) {\n\treturn Object.assign(/* @__PURE__ */ new TypeError(\"write() expects a string, ArrayBufferView, or ArrayBuffer\"), { code });\n}\nfor (const stream of [process.stdout, process.stderr]) stream.write = (chunk) => {\n\toutput(textOf(chunk));\n\treturn true;\n};\nconst sink = new Writable({ write(chunk, _encoding, done) {\n\toutput(textOf(chunk));\n\tdone();\n} });\nconst replacement = new console.Console({\n\tstdout: sink,\n\tstderr: sink\n});\nconst printed = (arg) => typeof arg === \"string\" || arg instanceof Uint8Array ? textOf(arg) : format(arg);\nfor (const name of printingConsoleFunctionNames()) {\n\tconst own = Reflect.get(replacement, name);\n\tReflect.set(console, name, name === \"write\" ? bunConsoleWrite : typeof own === \"function\" ? own.bind(replacement) : (...args) => output(args.map(printed).join(\" \")));\n}\nif (typeof process.versions.bun === \"string\") process.on(\"warning\", (warning) => output(`${warning.name}: ${warning.message}\\n`));\nregisterEntryResolution();\nconst controller = new AbortController();\nport.on(\"message\", (message) => {\n\tif (isAbortMessage(message)) controller.abort();\n});\nasync function importConfig(file) {\n\tconst exported = (await import(pathToFileURL(file).href)).default;\n\tconst section = typeof exported === \"object\" && exported !== null && \"composer\" in exported ? exported.composer : void 0;\n\tif (section === void 0) throw new Error(noComposerExportMessage(file));\n\tconst checked = checkComposerConfig(section, file);\n\tif (!checked.ok) {\n\t\tconst [finding] = checked.findings;\n\t\tthrow new CliStructuredError(finding.code, finding.summary, {\n\t\t\t...finding.why === void 0 ? {} : { why: finding.why },\n\t\t\tfix: finding.fix\n\t\t});\n\t}\n\treturn checked.value;\n}\nasync function run(job) {\n\tconst recorded = /* @__PURE__ */ new Set();\n\ttry {\n\t\tconst config = await importConfig(job.configFile);\n\t\tconst { root, files } = await loadEntry(job.entry, job.cwd, void 0, recorded);\n\t\treturn await convergeDevJob(job, {\n\t\t\tconfig,\n\t\t\troot,\n\t\t\tentry: await loadAppConvergeEntry(job.appDir),\n\t\t\tappFiles: files\n\t\t}, {\n\t\t\tonEvent: (event) => post({\n\t\t\t\tkind: \"event\",\n\t\t\t\tevent\n\t\t\t}),\n\t\t\toutput\n\t\t}, controller.signal);\n\t} catch (error) {\n\t\tconst result = thrownResult(error, [...recorded, ...appFilesNamedBy(error)]);\n\t\treturn result.kind === \"error\" && process.versions.bun !== void 0 && namesDirectoryWithIndex(error) ? {\n\t\t\t...result,\n\t\t\tlookupKept: true\n\t\t} : result;\n\t}\n}\nrun(workerData).then((result) => {\n\tpost({\n\t\tkind: \"result\",\n\t\tresult\n\t});\n\tprocess.exit(0);\n});\n//#endregion\nexport {};\n\n//# sourceMappingURL=dev-converge-worker.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,OAAO;AACb,IAAI,SAAS,MAAM,MAAM,IAAI,MAAM,mDAAmD;AACtF,MAAM,QAAQ,YAAY,KAAK,YAAY,OAAO;AAClD,MAAM,UAAU,SAAS,KAAK;CAC7B,MAAM;CACN;AACD,CAAC;;;;;AAKD,MAAM,iCAAiC,IAAI,IAAI;CAC9C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;;AAED,SAAS,+BAA+B;CACvC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,IAAI,QAAQ,SAAS,UAAU,QAAQ,UAAU,OAAO,YAAY;EACxE,KAAK,MAAM,QAAQ,OAAO,oBAAoB,KAAK,GAAG;GACrD,IAAI,SAAS,iBAAiB,SAAS,aAAa,eAAe,IAAI,IAAI,GAAG;GAC9E,IAAI,OAAO,QAAQ,IAAI,SAAS,IAAI,MAAM,YAAY,MAAM,IAAI,IAAI;EACrE;E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AU,IAAI,OAAO,IAAI,KAAK,KAAK,GAAG,QAAQ;EAC5E,OAAO,MAAM,eAAe,KAAK;GAChC;GACA;GACA,OAAO,MAAM,qBAAqB,IAAI,MAAM;GAC5C,UAAU;EACX,GAAG;GACF,UAAU,UAAU,KAAK;IACxB,MAAM;IACN;GACD,CAAC;GACD;EACD,GAAG,WAAW,MAAM;CACrB,SAAS,OAAO;EACf,MAAM,SAAS,aAAa,OAAO,CAAC,GAAG,UAAU,GAAG,gBAAgB,KAAK,CAAC,CAAC;EAC3E,OAAO,OAAO,SAAS,WAAW,QAAQ,SAAS,QAAQ,KAAK,KAAK,wBAAwB,KAAK,IAAI;GACrG,GAAG;GACH,YAAY;EACb,IAAI;CACL;AACD;AACA,IAAI,UAAU,CAAC,CAAC,MAAM,WAAW;CAChC,KAAK;EACJ,MAAM;EACN;CACD,CAAC;CACD,QAAQ,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Reads the execution diagnostics an engine-failure error carries in
|
|
5
|
-
* `meta.diagnostics`; undefined for every other failure.
|
|
6
|
-
*/
|
|
7
|
-
function executionDiagnostics(f) {
|
|
8
|
-
const diagnostics = f.meta?.["diagnostics"];
|
|
9
|
-
if (typeof diagnostics !== "object" || diagnostics === null) return void 0;
|
|
10
|
-
const candidate = blindCast(diagnostics);
|
|
11
|
-
if (candidate["exitCode"] !== void 0 && typeof candidate["exitCode"] !== "number" || candidate["signal"] !== void 0 && typeof candidate["signal"] !== "string" || typeof candidate["stackFilePath"] !== "string" || typeof candidate["reproduceCommand"] !== "string" || typeof candidate["cwd"] !== "string") return;
|
|
12
|
-
return blindCast(diagnostics);
|
|
13
|
-
}
|
|
1
|
+
import { t as CliStructuredError } from "./errors-CVYwN2km.mjs";
|
|
2
|
+
import { n as ok, t as notOk } from "./result-CttmabB6.mjs";
|
|
3
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-ByY2RrbK.mjs
|
|
14
4
|
/**
|
|
15
5
|
* Site-specific wrap for foreign extension/environment causes — passthrough
|
|
16
6
|
* when already structured; never a boundary fallback (base-type rule 6(ii)).
|
|
@@ -61,6 +51,10 @@ function requireContainerForEnvironment(action, extensionId, descriptor, instanc
|
|
|
61
51
|
const { running, runs } = RUN_OF[action];
|
|
62
52
|
throw new CliStructuredError("DEPS.EXTENSION_INCOMPATIBLE", `The extension ${extensionId} is older than the Composer running ${running}, so it would not resolve the environment ${environment}.`, { fix: `Install the same Composer version of ${extensionId} as the Composer that runs ${runs}.` });
|
|
63
53
|
}
|
|
54
|
+
/** A failed converge's reasons as text, one per line, without a tag the message already starts with. */
|
|
55
|
+
function convergeReasonsText(reasons) {
|
|
56
|
+
return reasons.map(({ tag, message }) => tag === "Error" || tag === "Unknown" || message.startsWith(tag) ? message : `${tag}: ${message}`).join("\n");
|
|
57
|
+
}
|
|
64
58
|
/** The environment `deploy` targets when none is named. */
|
|
65
59
|
const DEFAULT_DEPLOY_ENVIRONMENT = "production";
|
|
66
60
|
/** In-package variant threading the injection seam, which the family's
|
|
@@ -71,7 +65,7 @@ async function deployWithDeps(input, deps) {
|
|
|
71
65
|
const cwd = input.cwd ?? process.cwd();
|
|
72
66
|
let executor;
|
|
73
67
|
try {
|
|
74
|
-
executor = await import("./execute-deploy-destroy-
|
|
68
|
+
executor = await import("./execute-deploy-destroy-D1jnaYqU-L5pBQMUx.mjs");
|
|
75
69
|
} catch (error) {
|
|
76
70
|
return notOk(executorLoadFailure("deploy", error));
|
|
77
71
|
}
|
|
@@ -89,7 +83,7 @@ async function devWithDeps(input, deps) {
|
|
|
89
83
|
const cwd = input.cwd ?? process.cwd();
|
|
90
84
|
let executor;
|
|
91
85
|
try {
|
|
92
|
-
executor = await import("./execute-dev-
|
|
86
|
+
executor = await import("./execute-dev-BP0Shlpd-C6-D196L.mjs");
|
|
93
87
|
} catch (error) {
|
|
94
88
|
return notOk(executorLoadFailure("dev", error));
|
|
95
89
|
}
|
|
@@ -97,7 +91,7 @@ async function devWithDeps(input, deps) {
|
|
|
97
91
|
}
|
|
98
92
|
async function loadExecutor(operation) {
|
|
99
93
|
try {
|
|
100
|
-
return ok(await import("./execute-dev-current-
|
|
94
|
+
return ok(await import("./execute-dev-current-B792f_1m-7ZE6ulr0.mjs"));
|
|
101
95
|
} catch (error) {
|
|
102
96
|
return notOk(executorLoadFailure(operation, error));
|
|
103
97
|
}
|
|
@@ -115,6 +109,6 @@ async function devStop(input) {
|
|
|
115
109
|
return executor.value.executeDevStop(input, input.cwd ?? process.cwd());
|
|
116
110
|
}
|
|
117
111
|
//#endregion
|
|
118
|
-
export {
|
|
112
|
+
export { devUrl as a, toStructured as c, devStop as i, convergeReasonsText as n, devWithDeps as o, deployWithDeps as r, requireContainerForEnvironment as s, DEFAULT_DEPLOY_ENVIRONMENT as t };
|
|
119
113
|
|
|
120
|
-
//# sourceMappingURL=dev-current-
|
|
114
|
+
//# sourceMappingURL=dev-current-ByY2RrbK-Cni2T65J.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-current-ByY2RrbK-Cni2T65J.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-current-ByY2RrbK.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\nconst RUN_OF = {\n\tdeploy: {\n\t\trunning: \"this deploy\",\n\t\truns: \"the deploy\"\n\t},\n\tdestroy: {\n\t\trunning: \"this destroy\",\n\t\truns: \"the destroy\"\n\t},\n\tdev: {\n\t\trunning: \"`prisma dev`\",\n\t\truns: \"`prisma dev`\"\n\t}\n};\n/**\n* An extension older than this Composer stores the input it is given but\n* resolves from a key without `environment`, so it may read every name as\n* production, or, locally, put every environment in one copy. Its\n* `deserialize` rebuilds only the fields it knows, so the container the\n* Alchemy child rebuilds shows which environment it really resolved.\n* Refusing here keeps a mismatched install from deploying into, destroying\n* or running the wrong place.\n*/\nfunction requireContainerForEnvironment(action, extensionId, descriptor, instance, environment) {\n\tlet rebuiltEnvironment;\n\ttry {\n\t\trebuiltEnvironment = descriptor.deserialize(instance.serialize()).input.environment;\n\t} catch {\n\t\trebuiltEnvironment = void 0;\n\t}\n\tif (rebuiltEnvironment === environment) return;\n\tconst { running, runs } = RUN_OF[action];\n\tthrow new CliStructuredError(\"DEPS.EXTENSION_INCOMPATIBLE\", `The extension ${extensionId} is older than the Composer running ${running}, so it would not resolve the environment ${environment}.`, { fix: `Install the same Composer version of ${extensionId} as the Composer that runs ${runs}.` });\n}\n/** A failed converge's reasons as text, one per line, without a tag the message already starts with. */\nfunction convergeReasonsText(reasons) {\n\treturn reasons.map(({ tag, message }) => tag === \"Error\" || tag === \"Unknown\" || message.startsWith(tag) ? message : `${tag}: ${message}`).join(\"\\n\");\n}\n//#endregion\n//#region src/operations/deploy.ts\n/** The environment `deploy` targets when none is named. */\nconst DEFAULT_DEPLOY_ENVIRONMENT = \"production\";\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-D1jnaYqU.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-BP0Shlpd.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev-current.ts\nasync function loadExecutor(operation) {\n\ttry {\n\t\treturn ok(await import(\"./execute-dev-current-B792f_1m.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` runs locally in the environment. */\nasync function devUrl(input) {\n\tconst executor = await loadExecutor(\"dev url\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevUrl(input, input.cwd ?? process.cwd());\n}\n/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */\nasync function devStop(input) {\n\tconst executor = await loadExecutor(\"dev stop\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevStop(input, input.cwd ?? process.cwd());\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT as a, convergeReasonsText as c, requireContainerForEnvironment as d, toStructured as f, devWithDeps as i, executionDiagnostics as l, devUrl as n, deploy as o, dev as r, deployWithDeps as s, devStop as t, executorLoadFailure as u };\n\n//# sourceMappingURL=dev-current-ByY2RrbK.mjs.map"],"mappings":";;;;;;;AAmBA,SAAS,aAAa,MAAM,OAAO;CAClC,OAAO,mBAAmB,GAAG,KAAK,IAAI,QAAQ,IAAI,mBAAmB,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,EAAE,OAAO,MAAM,CAAC;AACpJ;;;AAGA,SAAS,oBAAoB,WAAW,OAAO;CAC9C,OAAO,IAAI,mBAAmB,4BAA4B,sBAAsB,UAAU,aAAa,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,KAAK;EAChK,KAAK,OAAO,UAAU;EACtB,KAAK;EACL,OAAO;CACR,CAAC;AACF;AACA,MAAM,SAAS;CACd,QAAQ;EACP,SAAS;EACT,MAAM;CACP;CACA,SAAS;EACR,SAAS;EACT,MAAM;CACP;CACA,KAAK;EACJ,SAAS;EACT,MAAM;CACP;AACD;;;;;;;;;;AAUA,SAAS,+BAA+B,QAAQ,aAAa,YAAY,UAAU,aAAa;CAC/F,IAAI;CACJ,IAAI;EACH,qBAAqB,WAAW,YAAY,SAAS,UAAU,CAAC,CAAC,CAAC,MAAM;CACzE,QA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ACnD;AACD;;AAEA,eAAe,OAAO,OAAO;CAC5B,MAAM,WAAW,MAAM,aAAa,SAAS;CAC7C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,cAAc,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACtE;;AAEA,eAAe,QAAQ,OAAO;CAC7B,MAAM,WAAW,MAAM,aAAa,UAAU;CAC9C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,eAAe,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACvE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { t as CliStructuredError } from "./errors-CVYwN2km.mjs";
|
|
2
|
+
import { n as DEV_ENVIRONMENT_NAME_FILE } from "./app-config-CErnR6NK-DnKH4Kqc.mjs";
|
|
3
|
+
import "./local-target-CZzICh5R.mjs";
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-environment-name-6eEr5PW8.mjs
|
|
7
|
+
/**
|
|
8
|
+
* Each environment's folder records the environment's exact name. On a
|
|
9
|
+
* case-insensitive filesystem `--environment Dev` would otherwise open the
|
|
10
|
+
* folder of `dev` and run, or `--fresh` delete, that copy.
|
|
11
|
+
*/
|
|
12
|
+
function recordedName(devDir) {
|
|
13
|
+
const file = path.join(devDir, DEV_ENVIRONMENT_NAME_FILE);
|
|
14
|
+
return fs.existsSync(file) ? fs.readFileSync(file, "utf8").trim() : void 0;
|
|
15
|
+
}
|
|
16
|
+
function nameMismatch(devDir, recorded, environment) {
|
|
17
|
+
return new CliStructuredError("DEV.ENVIRONMENT_NAME_MISMATCH", `The folder ${devDir} holds the local copy of the environment ${recorded}, not ${environment}.`, {
|
|
18
|
+
why: "On a case-insensitive filesystem, such as the default on macOS, environment names that differ only in case share one folder, so they cannot be separate local copies.",
|
|
19
|
+
fix: `Pass \`--environment ${recorded}\` for that copy, or pick a name that differs from ${recorded} by more than case.`,
|
|
20
|
+
meta: {
|
|
21
|
+
devDir,
|
|
22
|
+
recorded,
|
|
23
|
+
environment
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Fails when the folder records another environment's name; a folder with no name recorded passes. */
|
|
28
|
+
function requireDevEnvironmentName(devDir, environment) {
|
|
29
|
+
const recorded = recordedName(devDir);
|
|
30
|
+
if (recorded !== void 0 && recorded !== environment) throw nameMismatch(devDir, recorded, environment);
|
|
31
|
+
}
|
|
32
|
+
/** Records the environment's name in its folder on first use; fails when the folder records another name. */
|
|
33
|
+
function claimDevEnvironmentName(devDir, environment) {
|
|
34
|
+
const recorded = recordedName(devDir);
|
|
35
|
+
if (recorded === environment) return;
|
|
36
|
+
if (recorded !== void 0) throw nameMismatch(devDir, recorded, environment);
|
|
37
|
+
fs.mkdirSync(devDir, { recursive: true });
|
|
38
|
+
fs.writeFileSync(path.join(devDir, DEV_ENVIRONMENT_NAME_FILE), `${environment}\n`);
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { requireDevEnvironmentName as n, claimDevEnvironmentName as t };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=dev-environment-name-6eEr5PW8-CCY7WNWz.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-environment-name-6eEr5PW8-CCY7WNWz.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-environment-name-6eEr5PW8.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { DEV_ENVIRONMENT_NAME_FILE } from \"@internal/core/local-target\";\n//#region src/operations/dev-environment-name.ts\n/**\n* Each environment's folder records the environment's exact name. On a\n* case-insensitive filesystem `--environment Dev` would otherwise open the\n* folder of `dev` and run, or `--fresh` delete, that copy.\n*/\nfunction recordedName(devDir) {\n\tconst file = path.join(devDir, DEV_ENVIRONMENT_NAME_FILE);\n\treturn fs.existsSync(file) ? fs.readFileSync(file, \"utf8\").trim() : void 0;\n}\nfunction nameMismatch(devDir, recorded, environment) {\n\treturn new CliStructuredError(\"DEV.ENVIRONMENT_NAME_MISMATCH\", `The folder ${devDir} holds the local copy of the environment ${recorded}, not ${environment}.`, {\n\t\twhy: \"On a case-insensitive filesystem, such as the default on macOS, environment names that differ only in case share one folder, so they cannot be separate local copies.\",\n\t\tfix: `Pass \\`--environment ${recorded}\\` for that copy, or pick a name that differs from ${recorded} by more than case.`,\n\t\tmeta: {\n\t\t\tdevDir,\n\t\t\trecorded,\n\t\t\tenvironment\n\t\t}\n\t});\n}\n/** Fails when the folder records another environment's name; a folder with no name recorded passes. */\nfunction requireDevEnvironmentName(devDir, environment) {\n\tconst recorded = recordedName(devDir);\n\tif (recorded !== void 0 && recorded !== environment) throw nameMismatch(devDir, recorded, environment);\n}\n/** Records the environment's name in its folder on first use; fails when the folder records another name. */\nfunction claimDevEnvironmentName(devDir, environment) {\n\tconst recorded = recordedName(devDir);\n\tif (recorded === environment) return;\n\tif (recorded !== void 0) throw nameMismatch(devDir, recorded, environment);\n\tfs.mkdirSync(devDir, { recursive: true });\n\tfs.writeFileSync(path.join(devDir, DEV_ENVIRONMENT_NAME_FILE), `${environment}\\n`);\n}\n//#endregion\nexport { requireDevEnvironmentName as n, claimDevEnvironmentName as t };\n\n//# sourceMappingURL=dev-environment-name-6eEr5PW8.mjs.map"],"mappings":";;;;;;;;;;;AAUA,SAAS,aAAa,QAAQ;CAC7B,MAAM,OAAO,KAAK,KAAK,QAAQ,yBAAyB;CACxD,OAAO,GAAG,WAAW,IAAI,IAAI,GAAG,aAAa,MAAM,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK;AAC1E;AACA,SAAS,aAAa,QAAQ,UAAU,aAAa;CACpD,OAAO,IAAI,mBAAmB,iCAAiC,cAAc,OAAO,2CAA2C,SAAS,QAAQ,YAAY,IAAI;EAC/J,KAAK;EACL,KAAK,wBAAwB,SAAS,qDAAqD,SAAS;EACpG,MAAM;GACL;GACA;GACA;EACD;CACD,CAAC;AACF;;AAEA,SAAS,0BAA0B,QAAQ,aAAa;CACvD,MAAM,WAAW,aAAa,MAAM;CACpC,IAAI,aAAa,KAAK,KAAK,aAAa,aAAa,MAAM,aAAa,QAAQ,UAAU,WAAW;AACtG;;AAEA,SAAS,wBAAwB,QAAQ,aAAa;CACrD,MAAM,WAAW,aAAa,MAAM;CACpC,IAAI,aAAa,aAAa;CAC9B,IAAI,aAAa,KAAK,GAAG,MAAM,aAAa,QAAQ,UAAU,WAAW;CACzE,GAAG,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;CACxC,GAAG,cAAc,KAAK,KAAK,QAAQ,yBAAyB,GAAG,GAAG,YAAY,GAAG;AAClF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as __require, t as __commonJSMin } from "./rolldown-runtime-C7HZzL1F.mjs";
|
|
2
|
+
import { t as CliStructuredError } from "./errors-CVYwN2km.mjs";
|
|
3
|
+
import { n as ok, t as notOk } from "./result-CttmabB6.mjs";
|
|
3
4
|
import * as fs from "node:fs";
|
|
4
5
|
import * as path from "node:path";
|
|
5
6
|
import "node:url";
|
|
@@ -1788,4 +1789,4 @@ async function listEmulators(opts = {}) {
|
|
|
1788
1789
|
//#endregion
|
|
1789
1790
|
export { listEmulators };
|
|
1790
1791
|
|
|
1791
|
-
//# sourceMappingURL=dist-
|
|
1792
|
+
//# sourceMappingURL=dist-C0OGaDnj.mjs.map
|