@prisma/composer-cli 0.34.0 → 0.35.0-dev.2
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/{dev-current-vAfxVcnD-Drp6NbCc.mjs → dev-current-8HfFCN7C-C9CEq_7T.mjs} +9 -7
- package/dist/dev-current-8HfFCN7C-C9CEq_7T.mjs.map +1 -0
- package/dist/{dist-j4X7U5yA.mjs → dist-B9-nLeho.mjs} +10 -4
- package/dist/{dist-j4X7U5yA.mjs.map → dist-B9-nLeho.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-CdjqjHzw-BgnsJ75H.mjs → execute-deploy-destroy-DerNHILD-Bz6XZitd.mjs} +49 -35
- package/dist/execute-deploy-destroy-DerNHILD-Bz6XZitd.mjs.map +1 -0
- package/dist/{execute-dev-C75Y_wIa-lffN9oPi.mjs → execute-dev-D_JvTKjS-Bfdv-HU4.mjs} +166 -39
- package/dist/{execute-dev-C75Y_wIa-lffN9oPi.mjs.map → execute-dev-D_JvTKjS-Bfdv-HU4.mjs.map} +1 -1
- package/dist/{execute-dev-current-C0y1X-EE-DB7Q506a.mjs → execute-dev-current-BRJkR4Y1-DV2_N-Do.mjs} +10 -8
- package/dist/execute-dev-current-BRJkR4Y1-DV2_N-Do.mjs.map +1 -0
- package/dist/{family-BYcJFXg--DbwOABZy.d.mts → family-DBTO11ZA-CADtFQ_B.d.mts} +136 -50
- package/dist/family-DBTO11ZA-CADtFQ_B.d.mts.map +1 -0
- package/dist/family.d.mts +35 -4
- package/dist/family.d.mts.map +1 -1
- package/dist/family.mjs +191 -60
- package/dist/family.mjs.map +1 -1
- package/dist/{generate-dev-stack-DSBhURJV-Gv1jakWP.mjs → generate-dev-stack-CfneNj97-Yx3Z2-9u.mjs} +5 -3
- package/dist/generate-dev-stack-CfneNj97-Yx3Z2-9u.mjs.map +1 -0
- package/dist/list-deployed-Dba4D_0R.mjs +381 -0
- package/dist/list-deployed-Dba4D_0R.mjs.map +1 -0
- package/dist/{local-target-DZ6bu7Aj.mjs → local-target-CK8gvYV4.mjs} +2 -2
- package/dist/{local-target-DZ6bu7Aj.mjs.map → local-target-CK8gvYV4.mjs.map} +1 -1
- package/dist/{pipeline-Dpesfd2j-DKL3f1bj.mjs → pipeline-BmWt-Nhb-Bos4TFXR.mjs} +107 -24
- package/dist/pipeline-BmWt-Nhb-Bos4TFXR.mjs.map +1 -0
- package/dist/{composer-config-CY9fET8H-CgnpfWc2.mjs → run-alchemy-Dl_MWw4g-DaWV9tkH.mjs} +333 -310
- package/dist/run-alchemy-Dl_MWw4g-DaWV9tkH.mjs.map +1 -0
- package/dist/testing.d.mts +3 -1
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +5 -4
- package/dist/testing.mjs.map +1 -1
- package/dist/validate-environment-Y3kuF-NC-DvIK2JUY.mjs +16 -0
- package/dist/validate-environment-Y3kuF-NC-DvIK2JUY.mjs.map +1 -0
- package/package.json +9 -7
- package/src/exports/family.ts +8 -1
- package/src/family/deploy-list.ts +103 -0
- package/src/family/deployed-nodes.ts +55 -0
- package/src/family/list-deployed.ts +64 -0
- package/dist/composer-config-CY9fET8H-CgnpfWc2.mjs.map +0 -1
- package/dist/dev-current-vAfxVcnD-Drp6NbCc.mjs.map +0 -1
- package/dist/execute-deploy-destroy-CdjqjHzw-BgnsJ75H.mjs.map +0 -1
- package/dist/execute-dev-current-C0y1X-EE-DB7Q506a.mjs.map +0 -1
- package/dist/family-BYcJFXg--DbwOABZy.d.mts.map +0 -1
- package/dist/generate-dev-stack-DSBhURJV-Gv1jakWP.mjs.map +0 -1
- package/dist/pipeline-Dpesfd2j-DKL3f1bj.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
1
|
+
import { a as notOk, c as CliStructuredError, o as ok, u as blindCast } from "./run-alchemy-Dl_MWw4g-DaWV9tkH.mjs";
|
|
2
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-8HfFCN7C.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Reads the execution diagnostics an engine-failure error carries in
|
|
5
5
|
* `meta.diagnostics`; undefined for every other failure.
|
|
@@ -27,6 +27,8 @@ function executorLoadFailure(operation, error) {
|
|
|
27
27
|
cause: error
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
+
/** The environment `deploy` targets when none is named. */
|
|
31
|
+
const DEFAULT_DEPLOY_ENVIRONMENT = "production";
|
|
30
32
|
/** In-package variant threading the injection seam, which the family's
|
|
31
33
|
* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors
|
|
32
34
|
* internal types and is not part of the published surface. */
|
|
@@ -35,7 +37,7 @@ async function deployWithDeps(input, deps) {
|
|
|
35
37
|
const cwd = input.cwd ?? process.cwd();
|
|
36
38
|
let executor;
|
|
37
39
|
try {
|
|
38
|
-
executor = await import("./execute-deploy-destroy-
|
|
40
|
+
executor = await import("./execute-deploy-destroy-DerNHILD-Bz6XZitd.mjs");
|
|
39
41
|
} catch (error) {
|
|
40
42
|
return notOk(executorLoadFailure("deploy", error));
|
|
41
43
|
}
|
|
@@ -53,7 +55,7 @@ async function devWithDeps(input, deps) {
|
|
|
53
55
|
const cwd = input.cwd ?? process.cwd();
|
|
54
56
|
let executor;
|
|
55
57
|
try {
|
|
56
|
-
executor = await import("./execute-dev-
|
|
58
|
+
executor = await import("./execute-dev-D_JvTKjS-Bfdv-HU4.mjs");
|
|
57
59
|
} catch (error) {
|
|
58
60
|
return notOk(executorLoadFailure("dev", error));
|
|
59
61
|
}
|
|
@@ -61,7 +63,7 @@ async function devWithDeps(input, deps) {
|
|
|
61
63
|
}
|
|
62
64
|
async function loadExecutor(operation) {
|
|
63
65
|
try {
|
|
64
|
-
return ok(await import("./execute-dev-current-
|
|
66
|
+
return ok(await import("./execute-dev-current-BRJkR4Y1-DV2_N-Do.mjs"));
|
|
65
67
|
} catch (error) {
|
|
66
68
|
return notOk(executorLoadFailure(operation, error));
|
|
67
69
|
}
|
|
@@ -79,6 +81,6 @@ async function devStop(input) {
|
|
|
79
81
|
return executor.value.executeDevStop(input, input.cwd ?? process.cwd());
|
|
80
82
|
}
|
|
81
83
|
//#endregion
|
|
82
|
-
export {
|
|
84
|
+
export { devWithDeps as a, devUrl as i, deployWithDeps as n, executionDiagnostics as o, devStop as r, toStructured as s, DEFAULT_DEPLOY_ENVIRONMENT as t };
|
|
83
85
|
|
|
84
|
-
//# sourceMappingURL=dev-current-
|
|
86
|
+
//# sourceMappingURL=dev-current-8HfFCN7C-C9CEq_7T.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-current-8HfFCN7C-C9CEq_7T.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-current-8HfFCN7C.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}\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-DerNHILD.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-D_JvTKjS.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-BRJkR4Y1.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` of the directory's current app runs locally. */\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 directory's current app: 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, executionDiagnostics as c, devWithDeps as i, executorLoadFailure as l, devUrl as n, deploy as o, dev as r, deployWithDeps as s, devStop as t, toStructured as u };\n\n//# sourceMappingURL=dev-current-8HfFCN7C.mjs.map"],"mappings":";;;;;;AAQA,SAAS,qBAAqB,GAAG;CAChC,MAAM,cAAc,EAAE,OAAO;CAC7B,IAAI,OAAO,gBAAgB,YAAY,gBAAgB,MAAM,OAAO,KAAK;CACzE,MAAM,YAAY,UAAU,WAAW;CACvC,IAAI,UAAU,gBAAgB,KAAK,KAAK,OAAO,UAAU,gBAAgB,YAAY,UAAU,cAAc,KAAK,KAAK,OAAO,UAAU,cAAc,YAAY,OAAO,UAAU,qBAAqB,YAAY,OAAO,UAAU,wBAAwB,YAAY,OAAO,UAAU,WAAW,UAAU;CAC/S,OAAO,UAAU,WAAW;AAC7B;;;;;AAKA,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,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,MAAM,eAAe,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACvE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as notOk, c as CliStructuredError, o as ok } from "./run-alchemy-Dl_MWw4g-DaWV9tkH.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import * as path from "node:path";
|
|
@@ -1498,8 +1498,11 @@ const INSTANCE_STATUSES = /* @__PURE__ */ new Set([
|
|
|
1498
1498
|
function isStringRecord(value) {
|
|
1499
1499
|
return typeof value === "object" && value !== null && Object.values(value).every((v) => typeof v === "string");
|
|
1500
1500
|
}
|
|
1501
|
+
function isDeploymentCommand(value) {
|
|
1502
|
+
return typeof value === "object" && value !== null && "cwd" in value && typeof value.cwd === "string" && "argv" in value && Array.isArray(value.argv) && value.argv.every((arg) => typeof arg === "string");
|
|
1503
|
+
}
|
|
1501
1504
|
function isServiceInstanceInfo(value) {
|
|
1502
|
-
return typeof value === "object" && value !== null && "id" in value && typeof value.id === "string" && "labels" in value && isStringRecord(value.labels) && "port" in value && typeof value.port === "number" && "url" in value && typeof value.url === "string" && "status" in value && typeof value.status === "string" && INSTANCE_STATUSES.has(value.status) && "logPath" in value && typeof value.logPath === "string";
|
|
1505
|
+
return typeof value === "object" && value !== null && "id" in value && typeof value.id === "string" && "labels" in value && isStringRecord(value.labels) && "port" in value && typeof value.port === "number" && "url" in value && typeof value.url === "string" && "status" in value && typeof value.status === "string" && INSTANCE_STATUSES.has(value.status) && "logPath" in value && typeof value.logPath === "string" && (!("command" in value) || value.command === void 0 || isDeploymentCommand(value.command));
|
|
1503
1506
|
}
|
|
1504
1507
|
function isServiceInstanceInfoArray(value) {
|
|
1505
1508
|
return Array.isArray(value) && value.every(isServiceInstanceInfo);
|
|
@@ -1544,11 +1547,14 @@ function computeClient(opts = {}) {
|
|
|
1544
1547
|
return body;
|
|
1545
1548
|
},
|
|
1546
1549
|
async putDeployment(id, deployment) {
|
|
1547
|
-
await expectOk(await adminFetch(`${instancePath(baseUrl, id)}/deployment`, {
|
|
1550
|
+
const res = await expectOk(await adminFetch(`${instancePath(baseUrl, id)}/deployment`, {
|
|
1548
1551
|
method: "PUT",
|
|
1549
1552
|
headers: { "content-type": "application/json" },
|
|
1550
1553
|
body: JSON.stringify(deployment)
|
|
1551
1554
|
}));
|
|
1555
|
+
if (res.status === 204) return { started: false };
|
|
1556
|
+
const body = await res.json();
|
|
1557
|
+
return { started: typeof body === "object" && body !== null && "started" in body && body.started === true };
|
|
1552
1558
|
},
|
|
1553
1559
|
async *followLogs(id, signal, opts) {
|
|
1554
1560
|
const tail = opts?.tail !== void 0 ? `&tail=${String(Math.max(0, Math.trunc(opts.tail)))}` : "";
|
|
@@ -1785,4 +1791,4 @@ async function listEmulators(opts = {}) {
|
|
|
1785
1791
|
//#endregion
|
|
1786
1792
|
export { listEmulators };
|
|
1787
1793
|
|
|
1788
|
-
//# sourceMappingURL=dist-
|
|
1794
|
+
//# sourceMappingURL=dist-B9-nLeho.mjs.map
|