@prisma/composer-cli 0.35.0-dev.3 → 0.35.0-dev.5
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-config-CErnR6NK-6QjHJ7q5.mjs +32 -0
- package/dist/app-config-CErnR6NK-6QjHJ7q5.mjs.map +1 -0
- package/dist/{container-transport-HcvNOGZL-CIoZc7Rs.mjs → config-DiZaanS3.mjs} +32 -2
- package/dist/config-DiZaanS3.mjs.map +1 -0
- package/dist/{dev-current-8HfFCN7C-C9CEq_7T.mjs → dev-current-DMzFQ3va-BFke9qY1.mjs} +42 -8
- package/dist/dev-current-DMzFQ3va-BFke9qY1.mjs.map +1 -0
- package/dist/dev-environment-name-6eEr5PW8-lIZmJjfr.mjs +71 -0
- package/dist/dev-environment-name-6eEr5PW8-lIZmJjfr.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-DerNHILD-Bz6XZitd.mjs → execute-deploy-destroy-C13H3wl--Bm77oUoX.mjs} +5 -51
- package/dist/execute-deploy-destroy-C13H3wl--Bm77oUoX.mjs.map +1 -0
- package/dist/{execute-dev-D_JvTKjS-Bfdv-HU4.mjs → execute-dev-C_SQ02a6-DWWK9eHb.mjs} +43 -21
- package/dist/execute-dev-C_SQ02a6-DWWK9eHb.mjs.map +1 -0
- package/dist/{execute-dev-current-BRJkR4Y1-DV2_N-Do.mjs → execute-dev-current-BlIyvq-Q-C4sNMnwc.mjs} +70 -34
- package/dist/execute-dev-current-BlIyvq-Q-C4sNMnwc.mjs.map +1 -0
- package/dist/{family-DBTO11ZA-CADtFQ_B.d.mts → family-B2JZ8O7U-UyY_0Kcx.d.mts} +34 -18
- package/dist/{family-DBTO11ZA-CADtFQ_B.d.mts.map → family-B2JZ8O7U-UyY_0Kcx.d.mts.map} +1 -1
- package/dist/family.d.mts +1 -1
- package/dist/family.mjs +74 -30
- package/dist/family.mjs.map +1 -1
- package/dist/{generate-dev-stack-CfneNj97-Yx3Z2-9u.mjs → generate-dev-stack-C-1HoAgz-CqAVoJrq.mjs} +17 -13
- package/dist/generate-dev-stack-C-1HoAgz-CqAVoJrq.mjs.map +1 -0
- package/dist/{list-deployed-D-wPr7fN.mjs → list-deployed-CsSy2Xse.mjs} +3 -4
- package/dist/{list-deployed-D-wPr7fN.mjs.map → list-deployed-CsSy2Xse.mjs.map} +1 -1
- package/dist/testing.d.mts +3 -1
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +2 -1
- package/dist/testing.mjs.map +1 -1
- package/dist/{pipeline-BmWt-Nhb-Bos4TFXR.mjs → validate-environment-ymM9O00_-PUgv-1i7.mjs} +13 -3
- package/dist/validate-environment-ymM9O00_-PUgv-1i7.mjs.map +1 -0
- package/package.json +7 -7
- package/src/family/emulator-list.ts +7 -4
- package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs.map +0 -1
- package/dist/dev-current-8HfFCN7C-C9CEq_7T.mjs.map +0 -1
- package/dist/execute-deploy-destroy-DerNHILD-Bz6XZitd.mjs.map +0 -1
- package/dist/execute-dev-D_JvTKjS-Bfdv-HU4.mjs.map +0 -1
- package/dist/execute-dev-current-BRJkR4Y1-DV2_N-Do.mjs.map +0 -1
- package/dist/generate-dev-stack-CfneNj97-Yx3Z2-9u.mjs.map +0 -1
- package/dist/local-target-CK8gvYV4.mjs +0 -48
- package/dist/local-target-CK8gvYV4.mjs.map +0 -1
- package/dist/pipeline-BmWt-Nhb-Bos4TFXR.mjs.map +0 -1
- package/dist/validate-environment-Y3kuF-NC-DvIK2JUY.mjs +0 -16
- package/dist/validate-environment-Y3kuF-NC-DvIK2JUY.mjs.map +0 -1
package/dist/{execute-dev-current-BRJkR4Y1-DV2_N-Do.mjs → execute-dev-current-BlIyvq-Q-C4sNMnwc.mjs}
RENAMED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { a as notOk, c as CliStructuredError, l as InternalError, o as ok } from "./run-alchemy-Dl_MWw4g-DaWV9tkH.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
2
|
+
import { c as toStructured } from "./dev-current-DMzFQ3va-BFke9qY1.mjs";
|
|
3
|
+
import { n as devEnvironmentDir } from "./app-config-CErnR6NK-6QjHJ7q5.mjs";
|
|
4
|
+
import { i as validateEnvironmentName, n as resolveAppIdentity, t as checkConfigSource } from "./validate-environment-ymM9O00_-PUgv-1i7.mjs";
|
|
5
|
+
import { n as requireDevEnvironmentName, r as resolveLocalTargets } from "./dev-environment-name-6eEr5PW8-lIZmJjfr.mjs";
|
|
5
6
|
import * as path from "node:path";
|
|
6
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-dev-current-
|
|
7
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-dev-current-BlIyvq-Q.mjs
|
|
7
8
|
/**
|
|
8
9
|
* The `devUrl` and `devStop` executor: config → each extension's local
|
|
9
|
-
* target → the app
|
|
10
|
-
* lazy import from dev-current.ts —
|
|
11
|
-
* descriptors, whose graphs reach
|
|
10
|
+
* target → the app's local copy in the environment, read from that
|
|
11
|
+
* environment's dev state. Reached only by lazy import from dev-current.ts —
|
|
12
|
+
* resolving the local targets loads their descriptors, whose graphs reach
|
|
13
|
+
* alchemy's provider tree.
|
|
12
14
|
*/
|
|
13
|
-
const RUN_DEV = "Run `prisma dev` in this directory.";
|
|
14
15
|
function platformUnsupported() {
|
|
15
16
|
return new CliStructuredError("DEV.PLATFORM_UNSUPPORTED", "local dev is not supported on Windows yet.");
|
|
16
17
|
}
|
|
18
|
+
/** The `prisma dev` command that runs `environment`. */
|
|
19
|
+
function runDev(environment) {
|
|
20
|
+
return environment === "dev" ? "`prisma dev`" : `\`prisma dev --environment ${environment}\``;
|
|
21
|
+
}
|
|
17
22
|
/** A call into an extension's local target; its failures that carry no code are the emulator's. */
|
|
18
23
|
async function fromTarget(call) {
|
|
19
24
|
try {
|
|
@@ -22,47 +27,69 @@ async function fromTarget(call) {
|
|
|
22
27
|
throw toStructured("DEV.EMULATOR_FAILED", error);
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
|
-
/** Every extension's record of the app
|
|
26
|
-
async function currentApps(
|
|
27
|
-
const {
|
|
28
|
-
const
|
|
30
|
+
/** Every extension's record of the app in the environment; fails when none recorded it. */
|
|
31
|
+
async function currentApps(copy, cwd) {
|
|
32
|
+
const { app, environment } = copy;
|
|
33
|
+
const { value } = checkConfigSource(copy.config, cwd);
|
|
34
|
+
const devDir = path.join(cwd, devEnvironmentDir(environment));
|
|
35
|
+
requireDevEnvironmentName(devDir, environment);
|
|
29
36
|
const apps = [];
|
|
30
37
|
for (const target of (await resolveLocalTargets(value)).values()) {
|
|
31
|
-
const current = await fromTarget(async () => target.current?.({
|
|
38
|
+
const current = await fromTarget(async () => target.current?.({
|
|
39
|
+
devDir,
|
|
40
|
+
app,
|
|
41
|
+
environment
|
|
42
|
+
}));
|
|
32
43
|
if (current !== void 0) apps.push(current);
|
|
33
44
|
}
|
|
34
|
-
if (apps.length === 0) throw new CliStructuredError("DEV.NOT_STARTED_HERE", `\`prisma dev\` has not run in ${cwd}.`, {
|
|
35
|
-
why: `The local services, databases and buckets of an app are recorded in ${devDir} when \`prisma dev\` runs
|
|
36
|
-
fix:
|
|
37
|
-
meta: {
|
|
45
|
+
if (apps.length === 0) throw new CliStructuredError("DEV.NOT_STARTED_HERE", `\`prisma dev\` has not run ${app} in the environment ${environment} in ${cwd}.`, {
|
|
46
|
+
why: `The local services, databases and buckets of an app are recorded in ${devDir} when \`prisma dev\` runs it in the environment ${environment}, and ${app} has no such record.`,
|
|
47
|
+
fix: `Run ${runDev(environment)} for ${app} in this directory.`,
|
|
48
|
+
meta: {
|
|
49
|
+
cwd,
|
|
50
|
+
app,
|
|
51
|
+
environment
|
|
52
|
+
}
|
|
38
53
|
});
|
|
39
54
|
return apps;
|
|
40
55
|
}
|
|
56
|
+
/** The app a full address starts with: `shop.api` belongs to `shop`. */
|
|
57
|
+
function appOfAddress(address) {
|
|
58
|
+
const dot = address.indexOf(".");
|
|
59
|
+
return dot === -1 ? address : address.slice(0, dot);
|
|
60
|
+
}
|
|
41
61
|
async function locate(input, cwd) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
62
|
+
const environment = input.environment ?? "dev";
|
|
63
|
+
validateEnvironmentName(environment);
|
|
64
|
+
const app = appOfAddress(input.address);
|
|
65
|
+
const apps = await currentApps({
|
|
66
|
+
config: input.config,
|
|
67
|
+
app,
|
|
68
|
+
environment
|
|
69
|
+
}, cwd);
|
|
70
|
+
const recorded = apps.find((candidate) => candidate.addresses.includes(input.address));
|
|
71
|
+
if (recorded === void 0) {
|
|
45
72
|
const known = apps.flatMap((candidate) => candidate.addresses).sort();
|
|
46
|
-
throw new CliStructuredError("DEV.ADDRESS_UNKNOWN", `"${
|
|
47
|
-
why: `The addresses recorded for
|
|
48
|
-
fix: "Pass one of those addresses. A nested node has a dotted address, such as `catalog.database`.",
|
|
73
|
+
throw new CliStructuredError("DEV.ADDRESS_UNKNOWN", `"${app}" has no node at "${input.address}" in the environment ${environment}.`, {
|
|
74
|
+
why: `The addresses recorded for ${app} in the environment ${environment} are: ${known.join(", ")}.`,
|
|
75
|
+
fix: "Pass one of those addresses. A nested node has a dotted address, such as `shop.catalog.database`.",
|
|
49
76
|
meta: {
|
|
50
77
|
address: input.address,
|
|
51
78
|
known
|
|
52
79
|
}
|
|
53
80
|
});
|
|
54
81
|
}
|
|
55
|
-
const location = await fromTarget(() =>
|
|
82
|
+
const location = await fromTarget(() => recorded.locate(input.address));
|
|
56
83
|
if (location === void 0) throw new InternalError(`the local target recorded "${input.address}" but cannot locate it`);
|
|
57
84
|
if (location.emulator === "not-running") throw new CliStructuredError("DEV.EMULATOR_UNREACHABLE", `The local ${location.kind} emulator that runs "${input.address}" is not running.`, {
|
|
58
85
|
why: "The local emulators run your services, databases and buckets on this machine; `prisma dev` starts the ones an app needs.",
|
|
59
|
-
fix:
|
|
86
|
+
fix: `Run ${runDev(environment)} in this directory.`,
|
|
60
87
|
meta: {
|
|
61
88
|
address: input.address,
|
|
62
89
|
kind: location.kind
|
|
63
90
|
}
|
|
64
91
|
});
|
|
65
|
-
if (location.condition !== "running") throw notRunning(input.address, location);
|
|
92
|
+
if (location.condition !== "running") throw notRunning(input.address, environment, location);
|
|
66
93
|
if (location.url === void 0) throw new InternalError(`the local target reports "${input.address}" running with no URL`);
|
|
67
94
|
const runs = location.command !== void 0 ? "dev-server" : location.kind === "service" ? "artifact" : void 0;
|
|
68
95
|
return {
|
|
@@ -73,7 +100,8 @@ async function locate(input, cwd) {
|
|
|
73
100
|
...runs !== void 0 ? { runs } : {}
|
|
74
101
|
};
|
|
75
102
|
}
|
|
76
|
-
function notRunning(address, location) {
|
|
103
|
+
function notRunning(address, environment, location) {
|
|
104
|
+
const rerun = `Run ${runDev(environment)} in this directory.`;
|
|
77
105
|
const { kind, state, condition, logPath } = location;
|
|
78
106
|
const meta = {
|
|
79
107
|
address,
|
|
@@ -89,12 +117,12 @@ function notRunning(address, location) {
|
|
|
89
117
|
});
|
|
90
118
|
if (condition === "missing") return new CliStructuredError("DEV.NOT_RUNNING", message, {
|
|
91
119
|
why: "The local emulator no longer has it, for example because a Composer upgrade discarded the emulator’s state.",
|
|
92
|
-
fix: `${
|
|
120
|
+
fix: `${rerun} It creates the ${kind} again, empty.`,
|
|
93
121
|
meta
|
|
94
122
|
});
|
|
95
123
|
return new CliStructuredError("DEV.NOT_RUNNING", `The ${kind} "${address}" is stopped.`, {
|
|
96
|
-
why: "`prisma dev stop
|
|
97
|
-
fix:
|
|
124
|
+
why: "`prisma dev stop` and `prisma dev` ending both stop an app's services and database servers, and a stopped node has no URL that answers.",
|
|
125
|
+
fix: rerun,
|
|
98
126
|
meta
|
|
99
127
|
});
|
|
100
128
|
}
|
|
@@ -110,11 +138,19 @@ async function executeDevUrl(input, cwd) {
|
|
|
110
138
|
async function executeDevStop(input, cwd) {
|
|
111
139
|
if (process.platform === "win32") return notOk(platformUnsupported());
|
|
112
140
|
try {
|
|
113
|
-
const
|
|
141
|
+
const environment = input.environment ?? "dev";
|
|
142
|
+
validateEnvironmentName(environment);
|
|
143
|
+
const { name: app } = await resolveAppIdentity(input.entry, input.name, cwd, input.config);
|
|
144
|
+
const apps = await currentApps({
|
|
145
|
+
config: input.config,
|
|
146
|
+
app,
|
|
147
|
+
environment
|
|
148
|
+
}, cwd);
|
|
114
149
|
const stopped = [];
|
|
115
|
-
for (const
|
|
150
|
+
for (const recorded of apps) stopped.push(...await fromTarget(() => recorded.stop()));
|
|
116
151
|
return ok({
|
|
117
|
-
app
|
|
152
|
+
app,
|
|
153
|
+
environment,
|
|
118
154
|
stopped
|
|
119
155
|
});
|
|
120
156
|
} catch (error) {
|
|
@@ -125,4 +161,4 @@ async function executeDevStop(input, cwd) {
|
|
|
125
161
|
//#endregion
|
|
126
162
|
export { executeDevStop, executeDevUrl };
|
|
127
163
|
|
|
128
|
-
//# sourceMappingURL=execute-dev-current-
|
|
164
|
+
//# sourceMappingURL=execute-dev-current-BlIyvq-Q-C4sNMnwc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-dev-current-BlIyvq-Q-C4sNMnwc.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/execute-dev-current-BlIyvq-Q.mjs"],"sourcesContent":["import { n as checkConfigSource, r as resolveAppIdentity, t as validateEnvironmentName } from \"./validate-environment-ymM9O00_.mjs\";\nimport { d as toStructured } from \"./dev-current-DMzFQ3va.mjs\";\nimport { n as requireDevEnvironmentName } from \"./dev-environment-name-6eEr5PW8.mjs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError, InternalError } from \"@internal/foundation/errors\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { devEnvironmentDir, resolveLocalTargets } from \"@internal/core/local-target\";\n//#region src/operations/execute-dev-current.ts\n/**\n* The `devUrl` and `devStop` executor: config → each extension's local\n* target → the app's local copy in the environment, read from that\n* environment's dev state. Reached only by lazy import from dev-current.ts —\n* resolving the local targets loads their descriptors, whose graphs reach\n* alchemy's provider tree.\n*/\nfunction platformUnsupported() {\n\treturn new CliStructuredError(\"DEV.PLATFORM_UNSUPPORTED\", \"local dev is not supported on Windows yet.\");\n}\n/** The `prisma dev` command that runs `environment`. */\nfunction runDev(environment) {\n\treturn environment === \"dev\" ? \"`prisma dev`\" : `\\`prisma dev --environment ${environment}\\``;\n}\n/** A call into an extension's local target; its failures that carry no code are the emulator's. */\nasync function fromTarget(call) {\n\ttry {\n\t\treturn await call();\n\t} catch (error) {\n\t\tthrow toStructured(\"DEV.EMULATOR_FAILED\", error);\n\t}\n}\n/** Every extension's record of the app in the environment; fails when none recorded it. */\nasync function currentApps(copy, cwd) {\n\tconst { app, environment } = copy;\n\tconst { value } = checkConfigSource(copy.config, cwd);\n\tconst devDir = path.join(cwd, devEnvironmentDir(environment));\n\trequireDevEnvironmentName(devDir, environment);\n\tconst apps = [];\n\tfor (const target of (await resolveLocalTargets(value)).values()) {\n\t\tconst current = await fromTarget(async () => target.current?.({\n\t\t\tdevDir,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}));\n\t\tif (current !== void 0) apps.push(current);\n\t}\n\tif (apps.length === 0) throw new CliStructuredError(\"DEV.NOT_STARTED_HERE\", `\\`prisma dev\\` has not run ${app} in the environment ${environment} in ${cwd}.`, {\n\t\twhy: `The local services, databases and buckets of an app are recorded in ${devDir} when \\`prisma dev\\` runs it in the environment ${environment}, and ${app} has no such record.`,\n\t\tfix: `Run ${runDev(environment)} for ${app} in this directory.`,\n\t\tmeta: {\n\t\t\tcwd,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}\n\t});\n\treturn apps;\n}\n/** The app a full address starts with: `shop.api` belongs to `shop`. */\nfunction appOfAddress(address) {\n\tconst dot = address.indexOf(\".\");\n\treturn dot === -1 ? address : address.slice(0, dot);\n}\nasync function locate(input, cwd) {\n\tconst environment = input.environment ?? \"dev\";\n\tvalidateEnvironmentName(environment);\n\tconst app = appOfAddress(input.address);\n\tconst apps = await currentApps({\n\t\tconfig: input.config,\n\t\tapp,\n\t\tenvironment\n\t}, cwd);\n\tconst recorded = apps.find((candidate) => candidate.addresses.includes(input.address));\n\tif (recorded === void 0) {\n\t\tconst known = apps.flatMap((candidate) => candidate.addresses).sort();\n\t\tthrow new CliStructuredError(\"DEV.ADDRESS_UNKNOWN\", `\"${app}\" has no node at \"${input.address}\" in the environment ${environment}.`, {\n\t\t\twhy: `The addresses recorded for ${app} in the environment ${environment} are: ${known.join(\", \")}.`,\n\t\t\tfix: \"Pass one of those addresses. A nested node has a dotted address, such as `shop.catalog.database`.\",\n\t\t\tmeta: {\n\t\t\t\taddress: input.address,\n\t\t\t\tknown\n\t\t\t}\n\t\t});\n\t}\n\tconst location = await fromTarget(() => recorded.locate(input.address));\n\tif (location === void 0) throw new InternalError(`the local target recorded \"${input.address}\" but cannot locate it`);\n\tif (location.emulator === \"not-running\") throw new CliStructuredError(\"DEV.EMULATOR_UNREACHABLE\", `The local ${location.kind} emulator that runs \"${input.address}\" is not running.`, {\n\t\twhy: \"The local emulators run your services, databases and buckets on this machine; `prisma dev` starts the ones an app needs.\",\n\t\tfix: `Run ${runDev(environment)} in this directory.`,\n\t\tmeta: {\n\t\t\taddress: input.address,\n\t\t\tkind: location.kind\n\t\t}\n\t});\n\tif (location.condition !== \"running\") throw notRunning(input.address, environment, location);\n\tif (location.url === void 0) throw new InternalError(`the local target reports \"${input.address}\" running with no URL`);\n\tconst runs = location.command !== void 0 ? \"dev-server\" : location.kind === \"service\" ? \"artifact\" : void 0;\n\treturn {\n\t\taddress: input.address,\n\t\tkind: location.kind,\n\t\turl: location.url,\n\t\tstate: location.state,\n\t\t...runs !== void 0 ? { runs } : {}\n\t};\n}\nfunction notRunning(address, environment, location) {\n\tconst rerun = `Run ${runDev(environment)} in this directory.`;\n\tconst { kind, state, condition, logPath } = location;\n\tconst meta = {\n\t\taddress,\n\t\tkind,\n\t\tstate,\n\t\t...logPath === void 0 ? {} : { logPath }\n\t};\n\tconst message = `The ${kind} \"${address}\" is not running (${state}).`;\n\tif (condition === \"crashing\") return new CliStructuredError(\"DEV.NOT_RUNNING\", message, {\n\t\twhy: \"It exited after it started, and it is being restarted or was held after repeated crashes.\",\n\t\tfix: logPath === void 0 ? \"Read its output in the `prisma dev` terminal, fix the cause, and rebuild.\" : `Read its log at ${logPath}, fix the cause, and rebuild.`,\n\t\tmeta\n\t});\n\tif (condition === \"missing\") return new CliStructuredError(\"DEV.NOT_RUNNING\", message, {\n\t\twhy: \"The local emulator no longer has it, for example because a Composer upgrade discarded the emulator’s state.\",\n\t\tfix: `${rerun} It creates the ${kind} again, empty.`,\n\t\tmeta\n\t});\n\treturn new CliStructuredError(\"DEV.NOT_RUNNING\", `The ${kind} \"${address}\" is stopped.`, {\n\t\twhy: \"`prisma dev stop` and `prisma dev` ending both stop an app's services and database servers, and a stopped node has no URL that answers.\",\n\t\tfix: rerun,\n\t\tmeta\n\t});\n}\nasync function executeDevUrl(input, cwd) {\n\tif (process.platform === \"win32\") return notOk(platformUnsupported());\n\ttry {\n\t\treturn ok(await locate(input, cwd));\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\nasync function executeDevStop(input, cwd) {\n\tif (process.platform === \"win32\") return notOk(platformUnsupported());\n\ttry {\n\t\tconst environment = input.environment ?? \"dev\";\n\t\tvalidateEnvironmentName(environment);\n\t\tconst { name: app } = await resolveAppIdentity(input.entry, input.name, cwd, input.config);\n\t\tconst apps = await currentApps({\n\t\t\tconfig: input.config,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}, cwd);\n\t\tconst stopped = [];\n\t\tfor (const recorded of apps) stopped.push(...await fromTarget(() => recorded.stop()));\n\t\treturn ok({\n\t\t\tapp,\n\t\t\tenvironment,\n\t\t\tstopped\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n//#endregion\nexport { executeDevStop, executeDevU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AG;EACN,MAAM,UAAU,CAAC;EACjB,KAAK,MAAM,YAAY,MAAM,QAAQ,KAAK,GAAG,MAAM,iBAAiB,SAAS,KAAK,CAAC,CAAC;EACpF,OAAO,GAAG;GACT;GACA;GACA;EACD,CAAC;CACF,SAAS,OAAO;EACf,IAAI,mBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,MAAM;CACP;AACD"}
|
|
@@ -595,7 +595,7 @@ interface Graph {
|
|
|
595
595
|
readonly params: readonly ParamBinding[];
|
|
596
596
|
}
|
|
597
597
|
//#endregion
|
|
598
|
-
//#region ../../0-framework/1-core/core/dist/app-config-
|
|
598
|
+
//#region ../../0-framework/1-core/core/dist/app-config-XA11xusE.d.mts
|
|
599
599
|
//#region src/container-transport.d.ts
|
|
600
600
|
/**
|
|
601
601
|
* Carries resolved containers from the CLI process into the alchemy process
|
|
@@ -1104,8 +1104,8 @@ interface LocalTargetDescriptor {
|
|
|
1104
1104
|
providers(input: LocalTargetProvidersInput): Layer.Layer<never>;
|
|
1105
1105
|
/** A stable local identity — resolved without any platform call. */
|
|
1106
1106
|
readonly container: ContainerDescriptor;
|
|
1107
|
-
/** Value sourcing (secrets/env-params) — runs where deploy's preflight runs. */
|
|
1108
|
-
preflight?(input: PreflightInput): Promise<
|
|
1107
|
+
/** Value sourcing (secrets/env-params) — runs where deploy's preflight runs. What it returns reaches the alchemy process the same way deploy's preflight payload does. */
|
|
1108
|
+
preflight?(input: PreflightInput): Promise<PreflightPayload>;
|
|
1109
1109
|
/** Ensure the emulator daemons this topology's node kinds need are running, plus any per-node emulator state that must exist before converge (idempotent; daemons persist across sessions). */
|
|
1110
1110
|
emulators?(input: LocalTargetEmulatorsInput): Promise<void>;
|
|
1111
1111
|
/** The dev session's view of the running app. Core renders it and never learns an emulator's API. */
|
|
@@ -1113,18 +1113,20 @@ interface LocalTargetDescriptor {
|
|
|
1113
1113
|
/** `--fresh`: remove every local trace of the dev instance — emulator instances, state, data. */
|
|
1114
1114
|
teardown?(input: TeardownInput): Promise<void>;
|
|
1115
1115
|
/**
|
|
1116
|
-
* The
|
|
1117
|
-
* directory alone — no entry, no graph, no container — so a
|
|
1118
|
-
* find or stop a running app without running the pipeline.
|
|
1119
|
-
* this extension recorded nothing there.
|
|
1116
|
+
* The local copy of an app in one environment, read from the environment's
|
|
1117
|
+
* dev state directory alone — no entry, no graph, no container — so a
|
|
1118
|
+
* command can find or stop a running app without running the pipeline.
|
|
1119
|
+
* Undefined when this extension recorded nothing for the app there.
|
|
1120
1120
|
*/
|
|
1121
1121
|
current?(input: LocalTargetCurrentInput): Promise<LocalTargetCurrentApp | undefined>;
|
|
1122
1122
|
}
|
|
1123
1123
|
interface LocalTargetCurrentInput {
|
|
1124
|
-
/** Absolute path of the dev state directory (
|
|
1124
|
+
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1125
1125
|
readonly devDir: string;
|
|
1126
|
+
readonly app: string;
|
|
1127
|
+
readonly environment: string;
|
|
1126
1128
|
}
|
|
1127
|
-
/** The
|
|
1129
|
+
/** The local copy of an app in one environment, as one extension recorded it. */
|
|
1128
1130
|
interface LocalTargetCurrentApp {
|
|
1129
1131
|
readonly app: string;
|
|
1130
1132
|
/** Every node address recorded for the app. */
|
|
@@ -1168,18 +1170,19 @@ interface LocalNodeStopped {
|
|
|
1168
1170
|
interface LocalTargetProvidersInput {
|
|
1169
1171
|
/** This extension's resolved local-target container (its `input.appName` is the emulator app namespace). */
|
|
1170
1172
|
readonly container: ContainerInstance | undefined;
|
|
1171
|
-
/** Absolute path of the dev state directory (
|
|
1173
|
+
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1172
1174
|
readonly devDir: string;
|
|
1173
1175
|
}
|
|
1174
1176
|
interface LocalTargetEmulatorsInput {
|
|
1175
1177
|
/** The loaded application graph — inspected for which node kinds need an emulator. */
|
|
1176
1178
|
readonly graph: Graph;
|
|
1177
1179
|
readonly container: ContainerInstance | undefined;
|
|
1178
|
-
/** Absolute path of the dev state directory (
|
|
1180
|
+
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1179
1181
|
readonly devDir: string;
|
|
1180
1182
|
}
|
|
1181
1183
|
interface LocalTargetAttachInput {
|
|
1182
1184
|
readonly container: ContainerInstance | undefined;
|
|
1185
|
+
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1183
1186
|
readonly devDir: string;
|
|
1184
1187
|
}
|
|
1185
1188
|
interface LocalTargetAttachment {
|
|
@@ -1309,7 +1312,7 @@ interface NotOk<F> {
|
|
|
1309
1312
|
*/
|
|
1310
1313
|
type Result$1<T, F> = Ok<T> | NotOk<F>;
|
|
1311
1314
|
//#endregion
|
|
1312
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
1315
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-CcIkmpk0.d.mts
|
|
1313
1316
|
//#region src/dev/watch.d.ts
|
|
1314
1317
|
interface WatchTarget {
|
|
1315
1318
|
readonly address: string;
|
|
@@ -1551,6 +1554,9 @@ interface DevInput {
|
|
|
1551
1554
|
/** The entry module, resolved against `cwd`. Overrides the `entry` in `config`; without either the operation fails with `CONFIG.ENTRY_MISSING`. */
|
|
1552
1555
|
readonly entry?: string | undefined;
|
|
1553
1556
|
readonly name?: string | undefined;
|
|
1557
|
+
/** The environment to run as: a complete local copy of the app with its own services, databases and buckets. Defaults to `dev`. */
|
|
1558
|
+
readonly environment?: string | undefined;
|
|
1559
|
+
/** Deletes the environment's local copy of the app, and its data, before starting. Other environments are untouched. */
|
|
1554
1560
|
readonly fresh?: boolean | undefined;
|
|
1555
1561
|
/**
|
|
1556
1562
|
* Return once every service answers and leave the app running, with no
|
|
@@ -1582,8 +1588,10 @@ declare function devWithDeps(input: DevInput, deps: OperationDeps): Promise<Resu
|
|
|
1582
1588
|
interface DevUrlInput {
|
|
1583
1589
|
/** Composer's configuration: the `composer` section of `prisma.config.ts` and that file. It names the extensions whose local targets recorded the app. */
|
|
1584
1590
|
readonly config: ComposerConfigSource;
|
|
1585
|
-
/** A node's dotted address
|
|
1591
|
+
/** A node's full dotted address, starting with the app name, such as `shop.gateway`. The app is read from it. */
|
|
1586
1592
|
readonly address: string;
|
|
1593
|
+
/** The environment whose local copy to read. Defaults to `dev`. */
|
|
1594
|
+
readonly environment?: string | undefined;
|
|
1587
1595
|
/** The directory `prisma dev` ran from. Defaults to the process's working directory. */
|
|
1588
1596
|
readonly cwd?: string | undefined;
|
|
1589
1597
|
}
|
|
@@ -1600,24 +1608,32 @@ interface DevUrl {
|
|
|
1600
1608
|
}
|
|
1601
1609
|
interface DevStopInput {
|
|
1602
1610
|
readonly config: ComposerConfigSource;
|
|
1611
|
+
/** The entry module, resolved against `cwd`. Overrides the `entry` in `config`; the app is its root's name. */
|
|
1612
|
+
readonly entry?: string | undefined;
|
|
1613
|
+
/** The app to stop, in place of the entry root's name. */
|
|
1614
|
+
readonly name?: string | undefined;
|
|
1615
|
+
/** The environment whose local copy to stop. Defaults to `dev`. */
|
|
1616
|
+
readonly environment?: string | undefined;
|
|
1603
1617
|
/** The directory `prisma dev` ran from. Defaults to the process's working directory. */
|
|
1604
1618
|
readonly cwd?: string | undefined;
|
|
1605
1619
|
}
|
|
1606
1620
|
interface DevStopped {
|
|
1607
|
-
/** The app that was stopped
|
|
1621
|
+
/** The app that was stopped. */
|
|
1608
1622
|
readonly app: string;
|
|
1623
|
+
/** The environment whose local copy was stopped. */
|
|
1624
|
+
readonly environment: string;
|
|
1609
1625
|
/** Each node whose process or server was stopped. Data and ports are kept. */
|
|
1610
1626
|
readonly stopped: readonly {
|
|
1611
1627
|
readonly address: string;
|
|
1612
1628
|
readonly kind: string;
|
|
1613
1629
|
}[];
|
|
1614
1630
|
}
|
|
1615
|
-
/** Where the node at `input.address`
|
|
1631
|
+
/** Where the node at `input.address` runs locally in the environment. */
|
|
1616
1632
|
declare function devUrl(input: DevUrlInput): Promise<Result$1<DevUrl, CliStructuredError>>;
|
|
1617
|
-
/** Stops the
|
|
1633
|
+
/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */
|
|
1618
1634
|
declare function devStop(input: DevStopInput): Promise<Result$1<DevStopped, CliStructuredError>>;
|
|
1619
1635
|
//#endregion
|
|
1620
|
-
//#region ../../0-framework/3-tooling/cli/dist/family-
|
|
1636
|
+
//#region ../../0-framework/3-tooling/cli/dist/family-B2JZ8O7U.d.mts
|
|
1621
1637
|
//#region src/family/family.d.ts
|
|
1622
1638
|
/**
|
|
1623
1639
|
* The control-plane operations the family's handlers call. These are the
|
|
@@ -1644,4 +1660,4 @@ interface CreateComposerFamilyOptions {
|
|
|
1644
1660
|
}
|
|
1645
1661
|
//#endregion
|
|
1646
1662
|
export { Result$1 as _, DeployEvent as a, CliStructuredError as b, DevEvent as c, DevStopInput as d, DevStopped as f, ServiceEndpoint as g, OperationDeps as h, DEFAULT_DEPLOY_ENVIRONMENT as i, DevInput as l, DevUrlInput as m, CreateComposerFamilyOptions as n, DeployInput as o, DevUrl as p, realOperations as r, DeploySuccess as s, ComposerOperations as t, DevSession as u, AssembledServices as v, ComposerConfigSource as y };
|
|
1647
|
-
//# sourceMappingURL=family-
|
|
1663
|
+
//# sourceMappingURL=family-B2JZ8O7U-UyY_0Kcx.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"family-
|
|
1
|
+
{"version":3,"file":"family-B2JZ8O7U-UyY_0Kcx.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/errors.d.mts","../../../../node_modules/@standard-schema/spec/dist/index.d.ts","../../../0-framework/1-core/core/dist/graph-types-Cegbwb_X.d.mts","../../../0-framework/1-core/core/dist/app-config-XA11xusE.d.mts","../../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts","../../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts","../../../0-framework/3-tooling/assemble/dist/index.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-CcIkmpk0.d.mts","../../../0-framework/3-tooling/cli/dist/family-B2JZ8O7U.d.mts"],"x_google_ignoreList":[1],"mappings":";;;;;;;UACU,wBAAwB;WACvB;WACA;WACA;WACA;aACE;aACA;;WAEF;WACA,OAAO;WACP;;;;;;;;UAwBD;WACC;WACA;WACA;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;;;;;;;;;;;;cAoBG,2BAA2B,iBAAiB;WAC/C;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA;aACA;eACE;eACA;;aAEF,OAAO;aACP;aACA;;;;;EAKX,cAAc;;;;;SAKP,GAAG,iBAAiB,SAAS;;;;;UCjG5B,gBAAgB,iBAAiB,SAAS;;WAEvC,aAAa,gBAAgB,MAAM,OAAO;;kBAErC;;YAEJ,MAAM,iBAAiB,SAAS;;aAE7B;;aAEA;;aAEA,QAAQ,MAAM,OAAO;;;YAGxB,MAAM,iBAAiB,SAAS;;aAE7B,OAAO;;aAEP,QAAQ;;;OAGhB,WAAW,eAAe,mBAAmB,YAAY;;OAEzD,YAAY,eAAe,mBAAmB,YAAY;;;UAGzD,iBAAiB,iBAAiB,SAAS;;WAExC,aAAa,iBAAiB,MAAM,OAAO;;kBAEtC;;YAEJ,MAAM,iBAAiB,SAAS,eAAe,gBAAgB,MAAM,OAAO;;aAEzE,WAAW,gBAAgB,UAAU,iBAAiB,wBAAwB,OAAO,UAAU,QAAQ,OAAO;;;OAGtH,OAAO,UAAU,cAAc,UAAU;;YAEpC,cAAc;;aAEX,OAAO;;aAEP;;YAEH;;aAEG,iBAAiB;;;YAGpB;;aAEG,QAAQ,cAAc;;;YAGzB;;aAEG;;aAEA,OAAO,cAAc,cAAc;;;YAGtC;;aAEG,KAAK;;;YAGR,MAAM,iBAAiB,SAAS,eAAe,gBAAgB,MAAM,OAAO;;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WAER;;WAEA;;WAEA;;UAED;WACC;;WAEA;;WAEA;;WAEA;;WAEA;;UAED;WACC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAED;;WAEC;;WAEA;;WAEA;aACE;aACA;;;;iBAII,OAAO,OAAO,cAAc,QAAQ,SAAO,QAAQ;;iBAEnD,QAAQ,OAAO,eAAe,QAAQ,SAAO,YAAY;;;;;;;;;;;;UCtVhE;WACC,eAAe;WACf,YAAY;WACZ,eAAe;WACf,gBAAgB;;cAEb,gBAAgB;UACpB;;WAEC,aAAa;;WAEb,WAAW;;WAEX,qBAAqB"}
|
package/dist/family.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as Result, b as CliStructuredError$1, i as DEFAULT_DEPLOY_ENVIRONMENT, n as CreateComposerFamilyOptions$1, r as realOperations, t as ComposerOperations, y as ComposerConfigSource } from "./family-
|
|
1
|
+
import { _ as Result, b as CliStructuredError$1, i as DEFAULT_DEPLOY_ENVIRONMENT, n as CreateComposerFamilyOptions$1, r as realOperations, t as ComposerOperations, y as ComposerConfigSource } from "./family-B2JZ8O7U-UyY_0Kcx.mjs";
|
|
2
2
|
import { CommandFamily, ConfigSection, ManagementApiClient } from "@prisma/cli-engine";
|
|
3
3
|
import { CliStructuredError } from "@prisma/cli-engine/protocol";
|
|
4
4
|
import "effect/Layer";
|
package/dist/family.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as checkComposerConfig, h as sectionMissing, t as alchemyCommandLine } from "./run-alchemy-Dl_MWw4g-DaWV9tkH.mjs";
|
|
2
|
-
import { a as devWithDeps, i as devUrl, n as deployWithDeps, o as executionDiagnostics, r as devStop, t as DEFAULT_DEPLOY_ENVIRONMENT } from "./dev-current-
|
|
2
|
+
import { a as devWithDeps, i as devUrl, n as deployWithDeps, o as executionDiagnostics, r as devStop, t as DEFAULT_DEPLOY_ENVIRONMENT } from "./dev-current-DMzFQ3va-BFke9qY1.mjs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, positional } from "@prisma/cli-engine";
|
|
5
5
|
import { CliStructuredError, notOk, ok } from "@prisma/cli-engine/protocol";
|
|
@@ -517,8 +517,9 @@ Generated stack file: ${event.stackFilePath}\nRun \`${event.reproduceCommand}\`
|
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
519
|
/** A detached session owns nothing to stop, so a Ctrl-C before it was ready stops the app the way `prisma dev stop` does. */
|
|
520
|
-
async function stopDetachedApp(operations, ctx) {
|
|
520
|
+
async function stopDetachedApp(operations, app, ctx) {
|
|
521
521
|
const stopped = await operations.devStop({
|
|
522
|
+
...app,
|
|
522
523
|
config: ctx.config,
|
|
523
524
|
cwd: ctx.cwd
|
|
524
525
|
});
|
|
@@ -532,10 +533,11 @@ async function stopDetachedApp(operations, ctx) {
|
|
|
532
533
|
const createDevCommand = (operations) => defineSessionCommand({
|
|
533
534
|
help: {
|
|
534
535
|
summary: "Bring up the application whose root node is the entry module's default export, entirely on this machine.",
|
|
535
|
-
description: "Runs credential-free and watches the app for changes, reconverging on every edit. A service whose build adapter declares a dev server (Next.js's `next dev`, or the `dev` command written on node()) runs that instead of its build, and its output is shown here, prefixed with its address. A node is one service, database or bucket in the app. Each node runs on a local emulator: a program on this machine that stands in for Prisma Cloud and runs services, databases or S3-compatible buckets. A node's address is its path from the app name, with dots between names (shop.catalog.database).
|
|
536
|
+
description: "Runs credential-free and watches the app for changes, reconverging on every edit. A service whose build adapter declares a dev server (Next.js's `next dev`, or the `dev` command written on node()) runs that instead of its build, and its output is shown here, prefixed with its address. A node is one service, database or bucket in the app. Each node runs on a local emulator: a program on this machine that stands in for Prisma Cloud and runs services, databases or S3-compatible buckets. A node's address is its path from the app name, with dots between names (shop.catalog.database). Each environment is a complete local copy of the app, with its own services, databases, buckets and ports; the default is dev, and copies of other environments run alongside it. Where each node runs is recorded in this directory: `prisma dev url` works from here while `prisma dev` runs, and `prisma dev stop` also works after `prisma dev` was killed. Ending `prisma dev` stops its services and database servers; data and ports are kept. With --detach it returns once every service answers and leaves the app running without watching for changes, until `prisma dev stop`.",
|
|
536
537
|
examples: [
|
|
537
538
|
"{bin} dev",
|
|
538
539
|
"{bin} dev --fresh",
|
|
540
|
+
"{bin} dev --environment test --fresh",
|
|
539
541
|
"{bin} dev --detach",
|
|
540
542
|
"{bin} dev --entry other-module.ts"
|
|
541
543
|
]
|
|
@@ -549,7 +551,12 @@ const createDevCommand = (operations) => defineSessionCommand({
|
|
|
549
551
|
brief: "Run the app under this name instead of the name its root module declares. A different name gets its own local services, databases and buckets (default: the root module's name).",
|
|
550
552
|
placeholder: "name"
|
|
551
553
|
}),
|
|
552
|
-
|
|
554
|
+
environment: flag.string({
|
|
555
|
+
brief: "The environment to run as. Each environment is a separate local copy of the app, so a second one, such as test, runs alongside dev and leaves its data alone.",
|
|
556
|
+
placeholder: "name",
|
|
557
|
+
default: "dev"
|
|
558
|
+
}),
|
|
559
|
+
fresh: flag.boolean({ brief: "Delete this app's local services, databases and buckets in the environment, and their data, before starting. Other environments are untouched." }),
|
|
553
560
|
detach: flag.boolean({ brief: "Return once every service answers and leave the app running without watching for changes. Use it in scripts, agents and CI. `prisma dev stop` stops the app." })
|
|
554
561
|
} },
|
|
555
562
|
needs: { config: composerSection },
|
|
@@ -560,6 +567,7 @@ const createDevCommand = (operations) => defineSessionCommand({
|
|
|
560
567
|
entry: args.flags.entry,
|
|
561
568
|
config: ctx.config,
|
|
562
569
|
name: args.flags.name,
|
|
570
|
+
environment: args.flags.environment,
|
|
563
571
|
fresh: args.flags.fresh,
|
|
564
572
|
detach: args.flags.detach,
|
|
565
573
|
cwd: ctx.cwd,
|
|
@@ -567,7 +575,11 @@ const createDevCommand = (operations) => defineSessionCommand({
|
|
|
567
575
|
}, { alchemy: coalescedConverge(alchemy) });
|
|
568
576
|
if (!result.ok) return settleConvergeFailure(result.failure, ctx);
|
|
569
577
|
if (args.flags.detach) {
|
|
570
|
-
if (ctx.signal.aborted) await stopDetachedApp(operations,
|
|
578
|
+
if (ctx.signal.aborted) await stopDetachedApp(operations, {
|
|
579
|
+
entry: args.flags.entry,
|
|
580
|
+
name: args.flags.name,
|
|
581
|
+
environment: args.flags.environment
|
|
582
|
+
}, ctx);
|
|
571
583
|
return ok(void 0);
|
|
572
584
|
}
|
|
573
585
|
await stopRequested(ctx.signal);
|
|
@@ -576,34 +588,51 @@ const createDevCommand = (operations) => defineSessionCommand({
|
|
|
576
588
|
}
|
|
577
589
|
});
|
|
578
590
|
/**
|
|
579
|
-
* `dev stop` — stops the app
|
|
580
|
-
*
|
|
581
|
-
*
|
|
591
|
+
* `dev stop` — stops the app's local copy in one environment, as ending
|
|
592
|
+
* `prisma dev` would: its service processes and database servers. For an
|
|
593
|
+
* app whose `prisma dev` was killed without the chance to stop it.
|
|
582
594
|
*/
|
|
583
595
|
const createDevStopCommand = (operations) => defineCommand({
|
|
584
596
|
help: {
|
|
585
|
-
summary: "Stop the app
|
|
586
|
-
description: "Ending `prisma dev` with Ctrl-C does the same. Run this when `prisma dev` was killed without a chance to stop the app, or before deleting the directory. The emulators keep running; other directories may be using them.",
|
|
587
|
-
examples: ["{bin} dev stop"]
|
|
597
|
+
summary: "Stop the app's local copy in an environment: its service processes and local database servers. Data and ports are kept for the next `prisma dev`.",
|
|
598
|
+
description: "The app is the root module of the entry, or --name, as for `prisma dev`, and the environment is dev unless --environment names another. Other apps and environments keep running. Ending `prisma dev` with Ctrl-C does the same. Run this when `prisma dev` was killed without a chance to stop the app, or before deleting the directory. The emulators keep running; other directories may be using them.",
|
|
599
|
+
examples: ["{bin} dev stop", "{bin} dev stop --environment test"]
|
|
588
600
|
},
|
|
589
|
-
args: {
|
|
601
|
+
args: { flags: {
|
|
602
|
+
entry: flag.string({
|
|
603
|
+
brief: "The file whose default export is the application root module. Overrides `entry` in the `composer` section of prisma.config.ts.",
|
|
604
|
+
placeholder: "path"
|
|
605
|
+
}),
|
|
606
|
+
name: flag.string({
|
|
607
|
+
brief: "Stop the app run under this name instead of the root module's name.",
|
|
608
|
+
placeholder: "name"
|
|
609
|
+
}),
|
|
610
|
+
environment: flag.string({
|
|
611
|
+
brief: "The environment whose local copy to stop.",
|
|
612
|
+
placeholder: "name",
|
|
613
|
+
default: "dev"
|
|
614
|
+
})
|
|
615
|
+
} },
|
|
590
616
|
needs: { config: composerSection },
|
|
591
|
-
handler: async (
|
|
617
|
+
handler: async (args, ctx) => {
|
|
592
618
|
const result = await operations.devStop({
|
|
593
619
|
config: ctx.config,
|
|
620
|
+
entry: args.flags.entry,
|
|
621
|
+
name: args.flags.name,
|
|
622
|
+
environment: args.flags.environment,
|
|
594
623
|
cwd: ctx.cwd
|
|
595
624
|
});
|
|
596
625
|
if (!result.ok) return notOk(toEngineError(result.failure));
|
|
597
|
-
const { app, stopped } = result.value;
|
|
626
|
+
const { app, environment, stopped } = result.value;
|
|
598
627
|
return ok(ctx.present({ data: result.value }, {
|
|
599
628
|
human: (ui) => stopped.length === 0 ? [{
|
|
600
629
|
kind: "summary",
|
|
601
630
|
status: "info",
|
|
602
|
-
text: `Nothing of ${ui.emphasize(app)} was running.`
|
|
631
|
+
text: `Nothing of ${ui.emphasize(app)} was running in the environment ${environment}.`
|
|
603
632
|
}] : [{
|
|
604
633
|
kind: "summary",
|
|
605
634
|
status: "ok",
|
|
606
|
-
text: `Stopped ${ui.emphasize(app)}. Its data and ports are kept for the next \`prisma dev\`.`
|
|
635
|
+
text: `Stopped ${ui.emphasize(app)} in the environment ${environment}. Its data and ports are kept for the next \`prisma dev\`.`
|
|
607
636
|
}, {
|
|
608
637
|
kind: "table",
|
|
609
638
|
columns: ["Address", "Kind"],
|
|
@@ -616,25 +645,37 @@ const createDevStopCommand = (operations) => defineCommand({
|
|
|
616
645
|
}
|
|
617
646
|
});
|
|
618
647
|
/**
|
|
619
|
-
* `dev url <address>` — where a node
|
|
620
|
-
* directory answers locally. A data command: the
|
|
621
|
-
* `$(prisma dev url gateway)` is the URL alone.
|
|
648
|
+
* `dev url <address>` — where a node that `prisma dev` runs from this
|
|
649
|
+
* directory answers locally, in the environment named. A data command: the
|
|
650
|
+
* URL is its stdout line, so `$(prisma dev url shop.gateway)` is the URL alone.
|
|
622
651
|
*/
|
|
623
652
|
const createDevUrlCommand = (operations) => defineCommand({
|
|
624
653
|
help: {
|
|
625
654
|
summary: "Print the local URL of a node (a service, database or bucket in your app) that `prisma dev` runs from this directory: a service's HTTP URL, a database's connection string, or a bucket's S3 address.",
|
|
626
|
-
description: "
|
|
627
|
-
examples: [
|
|
655
|
+
description: "The app is the first name of the address, and the environment is dev unless --environment names another. Reads what `prisma dev` recorded for that app and environment in this directory and starts nothing, so run it while `prisma dev` is running; a node that is not running is an error. The URL alone goes to stdout, so a script can use it directly: curl \"$(prisma dev url shop.gateway)\". With --json, stdout carries the full result instead.",
|
|
656
|
+
examples: [
|
|
657
|
+
"{bin} dev url shop.gateway",
|
|
658
|
+
"{bin} dev url shop.gateway --environment test",
|
|
659
|
+
"{bin} dev url shop.catalog.database --json"
|
|
660
|
+
]
|
|
661
|
+
},
|
|
662
|
+
args: {
|
|
663
|
+
positionals: { address: positional.string({
|
|
664
|
+
brief: "The node's address: the app name, then the names down to the node, with dots between them, such as shop.catalog.database.",
|
|
665
|
+
placeholder: "address"
|
|
666
|
+
}) },
|
|
667
|
+
flags: { environment: flag.string({
|
|
668
|
+
brief: "The environment whose local copy to read.",
|
|
669
|
+
placeholder: "name",
|
|
670
|
+
default: "dev"
|
|
671
|
+
}) }
|
|
628
672
|
},
|
|
629
|
-
args: { positionals: { address: positional.string({
|
|
630
|
-
brief: "The node's address: its name in the app, with dots for a nested node, such as catalog.database.",
|
|
631
|
-
placeholder: "address"
|
|
632
|
-
}) } },
|
|
633
673
|
needs: { config: composerSection },
|
|
634
674
|
handler: async (args, ctx) => {
|
|
635
675
|
const result = await operations.devUrl({
|
|
636
676
|
config: ctx.config,
|
|
637
677
|
address: args.positionals.address,
|
|
678
|
+
environment: args.flags.environment,
|
|
638
679
|
cwd: ctx.cwd
|
|
639
680
|
});
|
|
640
681
|
if (!result.ok) return notOk(toEngineError(result.failure));
|
|
@@ -716,7 +757,7 @@ function createComposerFamily$1(options = {}) {
|
|
|
716
757
|
* assembled into the family here, where both domains may be imported.
|
|
717
758
|
*/
|
|
718
759
|
/** Loaded on first use, so nothing of the Management API reads loads with the family. */
|
|
719
|
-
const listDeployed = async (input) => (await import("./list-deployed-
|
|
760
|
+
const listDeployed = async (input) => (await import("./list-deployed-CsSy2Xse.mjs")).listDeployed(input);
|
|
720
761
|
const createDeployListCommand = (list) => defineCommand({
|
|
721
762
|
help: {
|
|
722
763
|
summary: "List every node the app has deployed in an environment, with its platform ID and URL.",
|
|
@@ -801,12 +842,14 @@ const EMULATOR_NAMES = {
|
|
|
801
842
|
database: "Database emulator",
|
|
802
843
|
bucket: "Bucket emulator"
|
|
803
844
|
};
|
|
804
|
-
/** The node and
|
|
845
|
+
/** The node, directory and environment that started an instance, when Composer's labels say. */
|
|
805
846
|
function startedBy(labels) {
|
|
806
847
|
const address = labels["composer.address"];
|
|
807
848
|
const directory = labels["composer.directory"];
|
|
849
|
+
const environment = labels["composer.environment"];
|
|
808
850
|
if (address === void 0) return void 0;
|
|
809
|
-
|
|
851
|
+
const where = directory === void 0 ? address : `${address} in ${directory}`;
|
|
852
|
+
return environment === void 0 ? where : `${where} (${environment})`;
|
|
810
853
|
}
|
|
811
854
|
function labelOf(emulator, dim) {
|
|
812
855
|
const name = EMULATOR_NAMES[emulator.kind];
|
|
@@ -821,7 +864,7 @@ function statusOf(emulator) {
|
|
|
821
864
|
const createEmulatorListCommand = (list) => defineCommand({
|
|
822
865
|
help: {
|
|
823
866
|
summary: "List the local emulators on this machine — the programs `prisma dev` starts to run services, databases and S3-compatible buckets without Prisma Cloud — with every instance each one holds.",
|
|
824
|
-
description: "Needs no project: it shows every directory’s instances. An emulator that is not running is listed with no instances, and one that runs but cannot be listed is shown with the error. Each instance’s labels say which directory, app and
|
|
867
|
+
description: "Needs no project: it shows every directory’s instances. An emulator that is not running is listed with no instances, and one that runs but cannot be listed is shown with the error. Each instance’s labels say which directory, app, node and environment started it. A stopped instance keeps its port and data until it is deleted.",
|
|
825
868
|
examples: ["{bin} emulator list", "{bin} emulator list --json"]
|
|
826
869
|
},
|
|
827
870
|
args: {},
|
|
@@ -852,7 +895,8 @@ const createEmulatorListCommand = (list) => defineCommand({
|
|
|
852
895
|
instance.url,
|
|
853
896
|
instance.state,
|
|
854
897
|
instance.labels["composer.address"],
|
|
855
|
-
instance.labels["composer.directory"]
|
|
898
|
+
instance.labels["composer.directory"],
|
|
899
|
+
instance.labels["composer.environment"]
|
|
856
900
|
]))),
|
|
857
901
|
json: () => result.value,
|
|
858
902
|
next: () => []
|