@prisma/composer 0.39.0-dev.12 → 0.39.0-dev.14
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-DriAu5RU-C8hYpR38.d.mts → app-config-Dhypzb6a-C3Kb0XtS.d.mts} +35 -63
- package/dist/app-config-Dhypzb6a-C3Kb0XtS.d.mts.map +1 -0
- package/dist/{app-converge-DkTFs-ih-CAr2feEu.mjs → app-converge-DFWYhyDb-BFaMPem0.mjs} +5 -5
- package/dist/app-converge-DFWYhyDb-BFaMPem0.mjs.map +1 -0
- package/dist/config-D615fYD5.d.mts +1 -0
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +12 -2
- package/dist/config.mjs.map +1 -0
- package/dist/control.d.mts +236 -16
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +5 -5
- package/dist/control.mjs.map +1 -1
- package/dist/{converge-in-process-x89zb2MF-Dvj-J8xo.mjs → converge-in-process-CfeblFN9-B1KvX1Fa.mjs} +4 -4
- package/dist/{converge-in-process-x89zb2MF-Dvj-J8xo.mjs.map → converge-in-process-CfeblFN9-B1KvX1Fa.mjs.map} +1 -1
- package/dist/{converge-in-process-CTomEXaD-BnDylZP8.d.mts → converge-in-process-DZRf9uYm-Ohjvy0s_.d.mts} +6 -6
- package/dist/{converge-in-process-CTomEXaD-BnDylZP8.d.mts.map → converge-in-process-DZRf9uYm-Ohjvy0s_.d.mts.map} +1 -1
- package/dist/{deploy-DHgEJDpg.d.mts → deploy-CncPyRbo.d.mts} +4 -4
- package/dist/{deploy-DHgEJDpg.d.mts.map → deploy-CncPyRbo.d.mts.map} +1 -1
- package/dist/{deploy-CSU0kr4j.mjs → deploy-DPX4IXzF.mjs} +15 -43
- package/dist/deploy-DPX4IXzF.mjs.map +1 -0
- package/dist/deploy.d.mts +4 -4
- package/dist/deploy.mjs +3 -3
- package/dist/{dev-converge-messages-DML4rTz7-C_EAB5M_.mjs → dev-converge-messages-CElmPylA-BenEozC3.mjs} +7 -7
- package/dist/dev-converge-messages-CElmPylA-BenEozC3.mjs.map +1 -0
- package/dist/dev-converge-worker.mjs +3 -3
- package/dist/dev-converge-worker.mjs.map +1 -1
- package/dist/{dev-current-C7rT6Yxw-yJ1ORrSC.mjs → dev-current-DFRg3-my-qixpmg6C.mjs} +8 -19
- package/dist/dev-current-DFRg3-my-qixpmg6C.mjs.map +1 -0
- package/dist/{dist-Cf_mZHaH.mjs → dist-Bw5O9TDx.mjs} +2 -2
- package/dist/{dist-Cf_mZHaH.mjs.map → dist-Bw5O9TDx.mjs.map} +1 -1
- package/dist/execute-deploy-destroy-CC5eDvWh-bRklcWAk.mjs +476 -0
- package/dist/execute-deploy-destroy-CC5eDvWh-bRklcWAk.mjs.map +1 -0
- package/dist/{execute-dev-BtSLDMkv-DAXRcK9h.mjs → execute-dev-_8rBPdcp-BrGpYVIu.mjs} +11 -15
- package/dist/execute-dev-_8rBPdcp-BrGpYVIu.mjs.map +1 -0
- package/dist/{execute-dev-current-LEdiAZSw-CwM41ylY.mjs → execute-dev-current-DbcTJmtG-DEZK2Oqn.mjs} +4 -4
- package/dist/{execute-dev-current-LEdiAZSw-CwM41ylY.mjs.map → execute-dev-current-DbcTJmtG-DEZK2Oqn.mjs.map} +1 -1
- package/dist/{execute-log-CzzB35KD-BBHeeC1M.mjs → execute-log-CcNIxcQt-jpflVo9o.mjs} +4 -4
- package/dist/{execute-log-CzzB35KD-BBHeeC1M.mjs.map → execute-log-CcNIxcQt-jpflVo9o.mjs.map} +1 -1
- package/dist/{graph-D2WMLL43-CeiC5wdy.mjs → graph-BYo1OEqk-D5AtX8q4.mjs} +5 -5
- package/dist/graph-BYo1OEqk-D5AtX8q4.mjs.map +1 -0
- package/dist/{graph-CUYXjK8S-BzL-mhjq.d.mts → graph-CRFQxH8r-CI1p78T8.d.mts} +3 -3
- package/dist/graph-CRFQxH8r-CI1p78T8.d.mts.map +1 -0
- package/dist/{graph-types-D4PrtP-l-B0uuchTl.d.mts → graph-types-BeNeqIt4-LGyYX_Sm.d.mts} +9 -10
- package/dist/{graph-types-D4PrtP-l-B0uuchTl.d.mts.map → graph-types-BeNeqIt4-LGyYX_Sm.d.mts.map} +1 -1
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-D8chHe55.d.mts → index-DOJMK47O.d.mts} +3 -3
- package/dist/{index-D8chHe55.d.mts.map → index-DOJMK47O.d.mts.map} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/internal-converge.d.mts +4 -4
- package/dist/internal-converge.mjs +2 -2
- package/dist/{load-entry-CEoVBdMj-CHOz7jKf.mjs → load-entry-CEoVBdMj-L1mXTtEO.mjs} +5 -5
- package/dist/load-entry-CEoVBdMj-L1mXTtEO.mjs.map +1 -0
- package/dist/{local-target-7KRsLMDO.d.mts → local-target-DZFvgvVK.d.mts} +2 -2
- package/dist/{local-target-7KRsLMDO.d.mts.map → local-target-DZFvgvVK.d.mts.map} +1 -1
- package/dist/local-target.d.mts +2 -2
- package/dist/{nextjs-DLyeRR7M-CzUbvPaJ.d.mts → nextjs-DLyeRR7M-C2z32CtL.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-CzUbvPaJ.d.mts.map → nextjs-DLyeRR7M-C2z32CtL.d.mts.map} +1 -1
- package/dist/nextjs-control.d.mts +4 -4
- package/dist/nextjs.d.mts +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node.d.mts +2 -2
- package/dist/{run-report-CmBz2-xc-Cc8rV1CX.mjs → run-report-HI2JqCSO-BWPG--nb.mjs} +5 -7
- package/dist/run-report-HI2JqCSO-BWPG--nb.mjs.map +1 -0
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/steps-Det-FSAL-DRvo57Lf.mjs +174 -0
- package/dist/steps-Det-FSAL-DRvo57Lf.mjs.map +1 -0
- package/dist/testing.d.mts +1 -1
- package/dist/{validate-environment-DCZiNSlR-C7lv0cH1.mjs → validate-environment-BevPErw8-BDbXIt8U.mjs} +331 -9
- package/dist/validate-environment-BevPErw8-BDbXIt8U.mjs.map +1 -0
- package/package.json +11 -14
- package/skills/prisma-composer-core-concepts/SKILL.md +6 -23
- package/dist/app-config-DriAu5RU-C8hYpR38.d.mts.map +0 -1
- package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs +0 -186
- package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map +0 -1
- package/dist/app-converge-DkTFs-ih-CAr2feEu.mjs.map +0 -1
- package/dist/config-Bpi8QVLB.d.mts +0 -1
- package/dist/deploy-CSU0kr4j.mjs.map +0 -1
- package/dist/deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts +0 -33
- package/dist/deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts.map +0 -1
- package/dist/deployment-summary-CVJZn2v0-Dz-gX1rp.mjs +0 -153
- package/dist/deployment-summary-CVJZn2v0-Dz-gX1rp.mjs.map +0 -1
- package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs.map +0 -1
- package/dist/dev-current-C7rT6Yxw-yJ1ORrSC.mjs.map +0 -1
- package/dist/execute-deploy-destroy-C-aK5jh--D-AjLWc2.mjs +0 -855
- package/dist/execute-deploy-destroy-C-aK5jh--D-AjLWc2.mjs.map +0 -1
- package/dist/execute-dev-BtSLDMkv-DAXRcK9h.mjs.map +0 -1
- package/dist/graph-CUYXjK8S-BzL-mhjq.d.mts.map +0 -1
- package/dist/graph-D2WMLL43-CeiC5wdy.mjs.map +0 -1
- package/dist/internal-app-configuration-file.d.mts +0 -16
- package/dist/internal-app-configuration-file.d.mts.map +0 -1
- package/dist/internal-app-configuration-file.mjs +0 -2
- package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs.map +0 -1
- package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs +0 -90
- package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs.map +0 -1
- package/dist/redaction-DY6eDC12-W-FzW7_r.mjs +0 -339
- package/dist/redaction-DY6eDC12-W-FzW7_r.mjs.map +0 -1
- package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts +0 -232
- package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts.map +0 -1
- package/dist/report.d.mts +0 -19
- package/dist/report.d.mts.map +0 -1
- package/dist/report.mjs +0 -97
- package/dist/report.mjs.map +0 -1
- package/dist/run-report-CmBz2-xc-Cc8rV1CX.mjs.map +0 -1
- package/dist/steps-BZXNqW6U-C_ME2VLd.mjs +0 -112
- package/dist/steps-BZXNqW6U-C_ME2VLd.mjs.map +0 -1
- package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs.map +0 -1
- package/src/exports/internal-app-configuration-file.ts +0 -1
- package/src/exports/report.ts +0 -1
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-current-
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/redaction-msB1S2rG.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-B6d98iUl.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;;;;;UAIU,GAAG;WACF;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAKQ,MAAM;WACL;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KAQZ,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;;UCfxB;;WAEC,OAAO;;WAEP;;;;;UAKD;WACC;WACA,mBAAmB;;UAEpB;WACC;WACA,gBAAgB;;WAEhB,UAAU;;;;;;UAoHX;WACC;WACA;;WAEA;;;;;KAqCN;WACM;;WAEA;WACA;;WAEA;;WAEA;WACA;;WAEA;;;KAGN,UAAU;WACJ;WACA,MAAM;;WAEN;WACA;;WAEA;;WAEA;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Q,OAAO,eAAe,QAAQ,aAAe;;;UAG5D;WACC;WACA;;KAEN;;;WAGM;WACA;;;;;WAKA;WACA;;UAED;;;;;WAKC,QAAQ;;WAER;WACA;;WAEA;;WAEA;;WAEA;WACA;;WAEA,SAAS;WACT,YAAY,OAAO;;UAEpB;;WAEC;;;WAGA,mBAAmB;;WAEnB,OAAO,cAAc;;iBAEf,IAAI,OAAO,WAAW,QAAQ,OAAS,aAAa;;;;cAIvD;;cAEA;UACJ;;WAEC;WACA;;;;;;;UAOD;WACC;WACA;;WAEA;WACA;WACA,gBAAgB;WAChB,SAAS"}
|
package/dist/control.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
|
|
2
|
-
import { a as devUrl, i as devStop,
|
|
3
|
-
import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-
|
|
2
|
+
import { a as devUrl, i as devStop, l as notOk, n as deploy, o as executorLoadFailure, r as dev } from "./dev-current-DFRg3-my-qixpmg6C.mjs";
|
|
3
|
+
import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-HI2JqCSO-BWPG--nb.mjs";
|
|
4
4
|
//#region ../../0-framework/3-tooling/cli/dist/control.mjs
|
|
5
5
|
/**
|
|
6
6
|
* The programmatic `destroy` operation (`@prisma/composer/control`): typed
|
|
@@ -21,7 +21,7 @@ async function destroyWithDeps(input, deps) {
|
|
|
21
21
|
const cwd = input.cwd ?? process.cwd();
|
|
22
22
|
let executor;
|
|
23
23
|
try {
|
|
24
|
-
executor = await import("./execute-deploy-destroy-
|
|
24
|
+
executor = await import("./execute-deploy-destroy-CC5eDvWh-bRklcWAk.mjs");
|
|
25
25
|
} catch (error) {
|
|
26
26
|
return notOk(executorLoadFailure("destroy", error));
|
|
27
27
|
}
|
|
@@ -43,13 +43,13 @@ async function logWithDeps(input, deps) {
|
|
|
43
43
|
const cwd = input.cwd ?? process.cwd();
|
|
44
44
|
let executor;
|
|
45
45
|
try {
|
|
46
|
-
executor = await import("./execute-log-
|
|
46
|
+
executor = await import("./execute-log-CcNIxcQt-jpflVo9o.mjs");
|
|
47
47
|
} catch (error) {
|
|
48
48
|
return notOk(executorLoadFailure("log", error));
|
|
49
49
|
}
|
|
50
50
|
return executor.executeLog(input, deps, cwd);
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
|
-
export { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl,
|
|
53
|
+
export { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl, log };
|
|
54
54
|
|
|
55
55
|
//# sourceMappingURL=control.mjs.map
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import { l as
|
|
1
|
+
{"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import { l as executorLoadFailure, n as devUrl, o as deploy, r as dev, t as devStop } from \"./dev-current-DFRg3-my.mjs\";\nimport { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from \"./run-report-HI2JqCSO.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/destroy.ts\n/**\n* The programmatic `destroy` operation (`@prisma/composer/control`): typed\n* input, structured result, no argv, no console, no process.exit. No CLI\n* command wraps it. The executor\n* loads lazily, so importing this module executes nothing; an executor that\n* fails to load comes back as a structured failure, never a throw out of\n* the host.\n*/\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tif (typeof input.environment !== \"string\" || input.environment.length === 0) return notOk(environmentRequired());\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-CC5eDvWh.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\nfunction environmentRequired() {\n\treturn new CliStructuredError(\"DEPLOY.ENVIRONMENT_REQUIRED\", \"destroy needs the name of the environment to destroy.\", {\n\t\twhy: \"Destroy never defaults to production, so a call without a name has no target.\",\n\t\tfix: \"Pass `environment`, for example `destroy({ environment: 'staging', config })`.\"\n\t});\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-CcNIxcQt.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl, log };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,WAAW,GAAG,OAAO,MAAM,oBAAoB,CAAC;CAC/G,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;AACA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,+BAA+B,yDAAyD;EACrH,KAAK;EACL,KAAK;CACN,CAAC;AACF;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C"}
|
package/dist/{converge-in-process-x89zb2MF-Dvj-J8xo.mjs → converge-in-process-CfeblFN9-B1KvX1Fa.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
2
|
import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { p as wrappedProviderError } from "./deploy-DPX4IXzF.mjs";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
5
|
import { isMainThread } from "node:worker_threads";
|
|
6
6
|
import * as Alchemist from "alchemy/Alchemist";
|
|
@@ -9,7 +9,7 @@ import { recordOf } from "alchemy/Util/LogRecord";
|
|
|
9
9
|
import * as Cause from "effect/Cause";
|
|
10
10
|
import * as Exit from "effect/Exit";
|
|
11
11
|
import * as Logger from "effect/Logger";
|
|
12
|
-
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-
|
|
12
|
+
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-CfeblFN9.mjs
|
|
13
13
|
/**
|
|
14
14
|
* The process state a converge holds while it runs: the per-thread
|
|
15
15
|
* one-converge flag, the variables Alchemy reads from `process.env`, and the working
|
|
@@ -210,7 +210,7 @@ function program(request, emit) {
|
|
|
210
210
|
})), Effect.provide(Alchemist.layer()));
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
213
|
-
* Plans and applies `stack` in this process, as `alchemy deploy --yes` would.
|
|
213
|
+
* Plans and applies `stack` in this process, as `alchemy deploy --yes` or `alchemy destroy --yes` would.
|
|
214
214
|
* The plan's scope, and the state-store lease it holds when the store has one, closes before this
|
|
215
215
|
* returns, including when `signal` interrupts it. One converge runs at a time
|
|
216
216
|
* per process, across every install of this module: a second call while one
|
|
@@ -255,4 +255,4 @@ const convergeInProcess = async (request) => {
|
|
|
255
255
|
//#endregion
|
|
256
256
|
export { failureReasonOf as n, holdingConvergeProcess as r, convergeInProcess as t };
|
|
257
257
|
|
|
258
|
-
//# sourceMappingURL=converge-in-process-
|
|
258
|
+
//# sourceMappingURL=converge-in-process-CfeblFN9-B1KvX1Fa.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converge-in-process-x89zb2MF-Dvj-J8xo.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/converge-in-process-x89zb2MF.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"],"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,QAAQ,IAAI;OAC7E,QAAQ,IAAI,QAAQ;EACzB,IAAI,kBAAkB,IAAI;GACzB,QAAQ,MAAM,WAAW;EAC1B,QAAQ,CAAC;CACV;AACD;;;;;;;;AAQA,eAAe,uBAAuB,KAAK,KAAK,KAAK;CACpD,IAAI,gBAAgB,GAAG,OAAO,EAAE,MAAM,MAAM;CAC5C,KAAK,WAAW;CAChB,IAAI;EACH,OAAO;GACN,MAAM;GACN,OAAO,MAAM,iBAAiB,KAAK,KAAK,GAAG;EAC5C;CACD,UAAU;EACT,KAAK,WAAW;CACjB;AACD;;;;;;;;;;;AAaA,MAAM,2BAA2B,IAAI,IAAI;CACxC;CACA;CACA;CACA;CACA;CACA;CACA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AAI,KAAK,UAAU,IAAI,GAAG,OAAO,EAAE,MAAM,UAAU;GACnD,IAAI,MAAM,kBAAkB,KAAK,KAAK,GAAG,OAAO,EAAE,MAAM,cAAc;GACtE,OAAO;IACN,MAAM;IACN,SAAS,eAAe,KAAK,KAAK;GACnC;EACD,CAAC;EACD,OAAO,KAAK,OAAO,KAAK,QAAQ;GAC/B,MAAM;GACN,QAAQ;EACT;CACD,SAAS,OAAO;EACf,OAAO;GACN,MAAM;GACN,SAAS,CAAC,gBAAgB,KAAK,CAAC;EACjC;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"converge-in-process-CfeblFN9-B1KvX1Fa.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/converge-in-process-CfeblFN9.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` or `alchemy destroy --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-CfeblFN9.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,UAAU,OAAO,IAAI,kCAAkC;AAC7D,MAAM,OAAO,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OAAO,KAAK,QAAQ;GAC/B,MAAM;GACN,QAAQ;EACT;CACD,SAAS,OAAO;EACf,OAAO;GACN,MAAM;GACN,SAAS,CAAC,gBAAgB,KAAK,CAAC;EACjC;CACD;AACD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./deploy-
|
|
1
|
+
import { ht as lower } from "./app-config-Dhypzb6a-C3Kb0XtS.mjs";
|
|
2
|
+
import "./deploy-CncPyRbo.mjs";
|
|
3
3
|
import "alchemy/Alchemist";
|
|
4
4
|
import "effect/Cause";
|
|
5
|
-
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-
|
|
5
|
+
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-DZRf9uYm.d.mts
|
|
6
6
|
//#region src/converge-in-process.d.ts
|
|
7
7
|
/** What `lower()` returns: the stack value `Alchemist.plan` takes. */
|
|
8
8
|
type LoweredStack = ReturnType<typeof lower>;
|
|
@@ -22,7 +22,7 @@ type ConvergeEvent = {
|
|
|
22
22
|
readonly text: string;
|
|
23
23
|
};
|
|
24
24
|
interface ConvergeRequest {
|
|
25
|
-
readonly operation: 'deploy';
|
|
25
|
+
readonly operation: 'deploy' | 'destroy';
|
|
26
26
|
readonly stack: LoweredStack;
|
|
27
27
|
readonly stage: string;
|
|
28
28
|
/** The directory Alchemy runs in: where it reads `.env` and keeps `.alchemy`. */
|
|
@@ -55,7 +55,7 @@ type ConvergeOutcome = {
|
|
|
55
55
|
/** Plans and applies a lowered stack. The deploy executor's default is {@link convergeInProcess}. */
|
|
56
56
|
type Converge = (request: ConvergeRequest) => Promise<ConvergeOutcome>;
|
|
57
57
|
/**
|
|
58
|
-
* Plans and applies `stack` in this process, as `alchemy deploy --yes` would.
|
|
58
|
+
* Plans and applies `stack` in this process, as `alchemy deploy --yes` or `alchemy destroy --yes` would.
|
|
59
59
|
* The plan's scope, and the state-store lease it holds when the store has one, closes before this
|
|
60
60
|
* returns, including when `signal` interrupts it. One converge runs at a time
|
|
61
61
|
* per process, across every install of this module: a second call while one
|
|
@@ -64,4 +64,4 @@ type Converge = (request: ConvergeRequest) => Promise<ConvergeOutcome>;
|
|
|
64
64
|
declare const convergeInProcess: Converge;
|
|
65
65
|
//#endregion
|
|
66
66
|
export { ConvergeRequest as a, ConvergeOutcome as i, ConvergeEvent as n, LoweredStack as o, ConvergeFailureReason as r, convergeInProcess as s, Converge as t };
|
|
67
|
-
//# sourceMappingURL=converge-in-process-
|
|
67
|
+
//# sourceMappingURL=converge-in-process-DZRf9uYm-Ohjvy0s_.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converge-in-process-
|
|
1
|
+
{"version":3,"file":"converge-in-process-DZRf9uYm-Ohjvy0s_.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/converge-in-process-DZRf9uYm.d.mts"],"mappings":";;;;;;;KAKK,eAAe,kBAAkB;;KAEjC;KACA;WACM;WACA;WACA;;WAEA;WACA,OAAO;WACP;;WAEA;WACA;WACA;;UAED;WACC;WACA,OAAO;WACP;;WAEA;;WAEA,KAAK,SAAS;WACd,SAAS;WACT,YAAY,OAAO;;WAEnB,WAAW;;;UAGZ;WACC;WACA;;KAEN;WACM;;WAEA;;WAEA;WACA,kBAAkB;;;;WAIlB;WACA;;;KAGN,YAAY,SAAS,oBAAoB,QAAQ;;;;;;;;cAQxC,mBAAmB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./graph-types-
|
|
2
|
-
import "./graph-
|
|
3
|
-
import "./app-config-
|
|
1
|
+
import "./graph-types-BeNeqIt4-LGyYX_Sm.mjs";
|
|
2
|
+
import "./graph-CRFQxH8r-CI1p78T8.mjs";
|
|
3
|
+
import "./app-config-Dhypzb6a-C3Kb0XtS.mjs";
|
|
4
4
|
import * as Provider from "alchemy/Provider";
|
|
5
5
|
//#region ../../0-framework/1-core/core/dist/deploy.d.mts
|
|
6
6
|
//#region src/comparable-props.d.ts
|
|
@@ -29,4 +29,4 @@ declare function wrappedProviderError(error: unknown): unknown;
|
|
|
29
29
|
declare const ROOT_INPUT_UNREAD_ERROR = "RootInputUnreadError";
|
|
30
30
|
//#endregion
|
|
31
31
|
export { wrappedProviderError as i, comparableProps as n, toProviderError as r, ROOT_INPUT_UNREAD_ERROR as t };
|
|
32
|
-
//# sourceMappingURL=deploy-
|
|
32
|
+
//# sourceMappingURL=deploy-CncPyRbo.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-
|
|
1
|
+
{"version":3,"file":"deploy-CncPyRbo.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/deploy.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;iBAkBiB,gBAAgB;;;;iBAIhB,gBAAgB,iBAAiB,SAAS;;iBAE1C,qBAAqB;;;;cAIxB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
2
|
import { i as POINTER } from "./describe-kind-Cpm_euxo-DsSPENQa.mjs";
|
|
3
|
-
import { O as slotsOf, _ as isValueResource, b as originOf, g as isValue, n as Load, p as isPlainObject, y as nodeAddresses } from "./graph-
|
|
4
|
-
import { r as deserializeContainers, s as readPreflightPayload } from "./preflight-transport-2d6iIchu-B-v7Di6I.mjs";
|
|
3
|
+
import { O as slotsOf, _ as isValueResource, b as originOf, g as isValue, n as Load, p as isPlainObject, y as nodeAddresses } from "./graph-BYo1OEqk-D5AtX8q4.mjs";
|
|
5
4
|
import * as Alchemy from "alchemy";
|
|
6
5
|
import * as Effect from "effect/Effect";
|
|
7
6
|
import * as Layer from "effect/Layer";
|
|
@@ -66,7 +65,7 @@ var LowerError = class extends Error {
|
|
|
66
65
|
this.name = "LowerError";
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
|
-
/** The `name` of the error `lower()` fails with when it builds a graph whose node addresses differ from `
|
|
68
|
+
/** The `name` of the error `lower()` fails with when it builds a graph whose node addresses differ from `preparedNodeAddresses`. */
|
|
70
69
|
const GRAPH_CHANGED_ERROR = "GraphChangedError";
|
|
71
70
|
var GraphChangedError = class extends LowerError {
|
|
72
71
|
constructor(message) {
|
|
@@ -74,12 +73,12 @@ var GraphChangedError = class extends LowerError {
|
|
|
74
73
|
this.name = GRAPH_CHANGED_ERROR;
|
|
75
74
|
}
|
|
76
75
|
};
|
|
77
|
-
function assertSameNodeAddresses(built,
|
|
78
|
-
const onlyBuilt = built.filter((address) => !
|
|
79
|
-
const
|
|
80
|
-
if (onlyBuilt.length === 0 &&
|
|
76
|
+
function assertSameNodeAddresses(built, prepared) {
|
|
77
|
+
const onlyBuilt = built.filter((address) => !prepared.includes(address));
|
|
78
|
+
const onlyPrepared = prepared.filter((address) => !built.includes(address));
|
|
79
|
+
if (onlyBuilt.length === 0 && onlyPrepared.length === 0) return;
|
|
81
80
|
const list = (addresses) => addresses.length === 0 ? "none" : addresses.map((address) => `"${address}"`).join(", ");
|
|
82
|
-
throw new GraphChangedError(`lower() built a different graph from the
|
|
81
|
+
throw new GraphChangedError(`lower() built a different graph from the graph the caller prepared. Only in the graph lower() built: ${list(onlyBuilt)}. Only in the graph the caller prepared: ${list(onlyPrepared)}. A module body must build the same graph every time; one that reads the process environment, a file or the clock can build a different one.`);
|
|
83
82
|
}
|
|
84
83
|
/** A service's own param: its binding, else its `default`, else absent when optional. A `provision` need (ADR-0031) is filled per edge in `buildConfig`, never here. */
|
|
85
84
|
function resolveParam(node, serviceId, name, param, bound) {
|
|
@@ -273,9 +272,10 @@ function lowering(root, config, opts) {
|
|
|
273
272
|
...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {},
|
|
274
273
|
...opts.appConfigurationRead !== void 0 ? { appConfigurationRead: opts.appConfigurationRead } : {}
|
|
275
274
|
});
|
|
276
|
-
if (opts.
|
|
275
|
+
if (opts.preparedNodeAddresses !== void 0) assertSameNodeAddresses(nodeAddresses(graph), opts.preparedNodeAddresses);
|
|
277
276
|
const extensions = yield* extensionsById(config);
|
|
278
|
-
const { containers, preflightPayloads
|
|
277
|
+
const { containers, preflightPayloads } = opts;
|
|
278
|
+
const findings = opts.findings ?? { unset: [] };
|
|
279
279
|
const preflightOf = (extensionId) => preflightPayloads.get(extensionId);
|
|
280
280
|
const lowered = /* @__PURE__ */ new Map();
|
|
281
281
|
const entries = [];
|
|
@@ -408,45 +408,17 @@ function lowering(root, config, opts) {
|
|
|
408
408
|
}
|
|
409
409
|
}));
|
|
410
410
|
}
|
|
411
|
-
/** The containers and preflight payloads a host wrote into the environment of a stack file it runs as a child. */
|
|
412
|
-
function transportedLowerInputs(config) {
|
|
413
|
-
const env = process.env;
|
|
414
|
-
const preflightPayloads = /* @__PURE__ */ new Map();
|
|
415
|
-
for (const { id } of config.extensions) {
|
|
416
|
-
const payload = readPreflightPayload(id, env);
|
|
417
|
-
if (payload !== void 0) preflightPayloads.set(id, payload);
|
|
418
|
-
}
|
|
419
|
-
return {
|
|
420
|
-
containers: deserializeContainers(config.extensions, env),
|
|
421
|
-
preflightPayloads
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
function lowerInputs(config, opts) {
|
|
425
|
-
const { containers, preflightPayloads } = opts;
|
|
426
|
-
const findings = opts.findings ?? { unset: [] };
|
|
427
|
-
if (containers !== void 0 && preflightPayloads !== void 0) return {
|
|
428
|
-
containers,
|
|
429
|
-
preflightPayloads,
|
|
430
|
-
findings
|
|
431
|
-
};
|
|
432
|
-
if (containers === void 0 && preflightPayloads === void 0) return {
|
|
433
|
-
...transportedLowerInputs(config),
|
|
434
|
-
findings
|
|
435
|
-
};
|
|
436
|
-
const missing = containers === void 0 ? "containers" : "preflightPayloads";
|
|
437
|
-
throw new Error(`lower() was passed ${missing === "containers" ? "preflightPayloads" : "containers"} without ${missing}. Pass both, or neither to read both from the environment.`);
|
|
438
|
-
}
|
|
439
411
|
/**
|
|
440
412
|
* The whole-stack wrapper: Load → route each node through the config's
|
|
441
|
-
* extension registries → an Alchemy Stack, which
|
|
442
|
-
* `Alchemist.plan
|
|
413
|
+
* extension registries → an Alchemy Stack, which the operations hand to
|
|
414
|
+
* `Alchemist.plan`.
|
|
443
415
|
*/
|
|
444
416
|
function lower(root, config, opts) {
|
|
445
417
|
const stackEffect = blindCast(Effect.orDie(lowering(root, config, opts)));
|
|
446
418
|
const providers = opts.providers ?? mergedProviders(config, opts.credentials);
|
|
447
419
|
return Alchemy.Stack(opts.name, {
|
|
448
420
|
providers,
|
|
449
|
-
state: resolveStateLayer(opts, config,
|
|
421
|
+
state: resolveStateLayer(opts, config, opts.containers)
|
|
450
422
|
}, stackEffect);
|
|
451
423
|
}
|
|
452
424
|
const PROVIDER_FAILURE_TAG = "ProviderFailure";
|
|
@@ -468,6 +440,6 @@ function wrappedProviderError(error) {
|
|
|
468
440
|
return Predicate.isTagged(error, PROVIDER_FAILURE_TAG) && "cause" in error ? error.cause : void 0;
|
|
469
441
|
}
|
|
470
442
|
//#endregion
|
|
471
|
-
export { connectionInputs as a, lower as c, resolveStateLayer as d, toProviderError as f, comparableProps as i, lowering as l,
|
|
443
|
+
export { connectionInputs as a, lower as c, resolveStateLayer as d, toProviderError as f, comparableProps as i, lowering as l, LowerError as n, deploymentResult as o, wrappedProviderError as p, buildConfig as r, joinDeployment as s, GRAPH_CHANGED_ERROR as t, mergedProviders as u };
|
|
472
444
|
|
|
473
|
-
//# sourceMappingURL=deploy-
|
|
445
|
+
//# sourceMappingURL=deploy-DPX4IXzF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-DPX4IXzF.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/deploy.mjs"],"sourcesContent":["import { C as isPlainObject, T as originOf, a as ROOT_INPUT_UNREAD_ERROR, i as secretsKeys, m as isValueResource, r as nodeAddresses, t as Load, w as isValue, x as slotsOf } from \"./graph-BYo1OEqk.mjs\";\nimport { POINTER } from \"@internal/foundation/pointer\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport * as Alchemy from \"alchemy\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Data from \"effect/Data\";\nimport * as Predicate from \"effect/Predicate\";\n//#region src/comparable-props.ts\n/**\n* Resource props as plain data that `structuredClone` copies unchanged, so two props compare by\n* content with `isDeepStrictEqual` even after one crossed a thread. Every object or array is\n* tagged by what it was, so no two different props give the same data:\n*\n* - a `Value` is described by what core knows of it: a source by its kind, pointer kind, label,\n* secrets key and payload; any other value only as derived, with the kind of its origin;\n* - a `Date`, `RegExp`, `Map` or `Set` keeps its content;\n* - an instance of another class keeps its class name and own enumerable fields;\n* - a function or symbol becomes its text;\n* - a reference back to an object that contains it becomes a cycle marker.\n*/\nfunction comparableProps(props) {\n\treturn asData(props, /* @__PURE__ */ new Set());\n}\nfunction asData(value, containing) {\n\tif (typeof value === \"function\") return { function: String(value) };\n\tif (typeof value === \"symbol\") return { symbol: String(value) };\n\tif (typeof value !== \"object\" || value === null) return value;\n\tif (containing.has(value)) return { cycle: true };\n\tcontaining.add(value);\n\ttry {\n\t\treturn objectAsData(value, (inner) => asData(inner, containing));\n\t} finally {\n\t\tcontaining.delete(value);\n\t}\n}\nfunction objectAsData(value, inner) {\n\tif (isValue(value)) {\n\t\tconst origin = originOf(value);\n\t\tif (origin.kind !== \"source\") return { value: { derived: origin.kind } };\n\t\treturn { value: {\n\t\t\tsourceKind: origin.sourceKind,\n\t\t\tpointer: Reflect.get(value, POINTER),\n\t\t\tlabel: origin.label,\n\t\t\tsecretsKey: origin.sourceKind === \"secret\" ? origin.secretsKey : void 0,\n\t\t\tpayload: inner(Reflect.get(value, \"payload\"))\n\t\t} };\n\t}\n\tif (Array.isArray(value)) return { array: value.map(inner) };\n\tif (value instanceof Date) return { date: value.getTime() };\n\tif (value instanceof RegExp) return { regexp: String(value) };\n\tif (value instanceof Map) return { map: [...value].map(([key, entry]) => [inner(key), inner(entry)]) };\n\tif (value instanceof Set) return { set: [...value].map(inner) };\n\tconst fields = Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, inner(entry)]));\n\tif (isPlainObject(value)) return { object: fields };\n\treturn {\n\t\tinstance: value.constructor?.name,\n\t\tfields\n\t};\n}\n//#endregion\n//#region src/control/deploy.ts\n/** Routes each graph node to its extension descriptor (by node.extension/type) and runs provision → serialize → package → deploy in dependency order. */\nvar LowerError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"LowerError\";\n\t}\n};\n/** The `name` of the error `lower()` fails with when it builds a graph whose node addresses differ from `preparedNodeAddresses`. */\nconst GRAPH_CHANGED_ERROR = \"GraphChangedError\";\nvar GraphChangedError = class extends LowerError {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = GRAPH_CHANGED_ERROR;\n\t}\n};\nfunction assertSameNodeAddresses(built, prepared) {\n\tconst onlyBuilt = built.filter((address) => !prepared.includes(address));\n\tconst onlyPrepared = prepared.filter((address) => !built.includes(address));\n\tif (onlyBuilt.length === 0 && onlyPrepared.length === 0) return;\n\tconst list = (addresses) => addresses.length === 0 ? \"none\" : addresses.map((address) => `\"${address}\"`).join(\", \");\n\tthrow new GraphChangedError(`lower() built a different graph from the graph the caller prepared. Only in the graph lower() built: ${list(onlyBuilt)}. Only in the graph the caller prepared: ${list(onlyPrepared)}. A module body must build the same graph every time; one that reads the process environment, a file or the clock can build a different one.`);\n}\n/** A service's own param: its binding, else its `default`, else absent when optional. A `provision` need (ADR-0031) is filled per edge in `buildConfig`, never here. */\nfunction resolveParam(node, serviceId, name, param, bound) {\n\tif (bound !== void 0) {\n\t\tif (param.provision !== void 0) throw new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") is bound at provision and also declares a framework provision need (\"${String(param.provision.brand)}\"). Remove the binding or the \\`provision\\` facet.`);\n\t\tconst result = param.schema[\"~standard\"].validate(bound);\n\t\tif (result instanceof Promise) throw new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") uses an async Standard Schema — a provision-time literal value requires a synchronous validator.`);\n\t\tif (result.issues !== void 0) {\n\t\t\tconst messages = result.issues.map((issue) => issue.message).join(\"; \");\n\t\t\tthrow new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") received an invalid provision-time value: ${messages}`);\n\t\t}\n\t\treturn result.value;\n\t}\n\tif (param.default !== void 0) return param.default;\n\tif (param.optional === true) return void 0;\n\tthrow new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") has no default, is not optional, and was not bound at provision — bind it on its provision() call with a literal value or a value the deploy has, or give it a default.`);\n}\n/**\n* Assembles a service's typed Config. Connection params come from the\n* dependency edge's lowered outputs — or, for a param carrying a `provision`\n* need (ADR-0031), from `provisioned` (keyed by edge id): the framework mints\n* it, the producer hands nothing over. The service's own params resolve via\n* `resolveParam` (provision-time binding, then default, then loud\n* unbound-required failure).\n*\n* This is also where the connection contract is enforced: a producer that fails to\n* supply a required param its consumer's connection declares fails the deploy\n* here, naming the edge, rather than reaching the consumer as `undefined`.\n*/\nfunction buildConfig(node, id, graph, lowered, provisioned) {\n\tconst inputs = slotConnectionParams(node, id, graph, lowered, provisioned);\n\tconst boundParams = new Map(graph.params.filter((binding) => binding.serviceAddress === id).map((b) => [b.slot, b.binding]));\n\tconst service = {};\n\tfor (const [name, param] of Object.entries(node.params)) {\n\t\tconst value = resolveParam(node, id, name, param, boundParams.get(name));\n\t\tif (value !== void 0) service[name] = value;\n\t}\n\treturn {\n\t\tservice,\n\t\tinputs\n\t};\n}\n/**\n* The connection params of each of a service's or resource's dependency\n* slots, resolved against the producer's lowered outputs or the minted\n* `provisioned` value, with the connection contract enforced (see `buildConfig`).\n*/\nfunction connectionInputs(ctx) {\n\treturn slotConnectionParams(ctx.node, ctx.id, ctx.graph, ctx.lowered, ctx.provisioned);\n}\nfunction slotConnectionParams(node, id, graph, lowered, provisioned) {\n\tconst inputs = {};\n\tfor (const [inputName, inputNode] of Object.entries(node.inputs)) {\n\t\tconst edge = graph.edges.find((e) => e.to === id && e.input === inputName && e.kind === \"dependency\");\n\t\tconst producedOutputs = edge !== void 0 ? lowered.get(edge.from) ?? {} : {};\n\t\tconst values = {};\n\t\tfor (const [name, param] of Object.entries(inputNode.connection.params)) {\n\t\t\tif (param.provision !== void 0) {\n\t\t\t\tvalues[name] = provisioned.get(`${id}.${inputName}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = producedOutputs[name];\n\t\t\tif (value === void 0 && param.optional !== true && edge !== void 0) throw new LowerError(`Connection input \"${id}.${inputName}\" declares param \"${name}\", but its producer \"${edge.from}\" did not supply it — the producer's outputs carry [${Object.keys(producedOutputs).join(\", \") || \"nothing\"}]. Add \"${name}\" to the outputs the producer returns from its lowering, or declare the param optional on the connection.`);\n\t\t\tvalues[name] = value;\n\t\t}\n\t\tinputs[inputName] = values;\n\t}\n\treturn inputs;\n}\n/**\n* Joins resolved report entries back to their graph nodes — the last step of a\n* deploy report, run inside the Action with apply's resolved values.\n*\n* The entries cross Alchemy's action-input boundary, so they carry addresses\n* and plain entities only; the graph is held by closure on this side. That\n* split is why this join exists at all, and it is what keeps functions and\n* Standard Schemas (which a node carries, and which the plan's input hash\n* would have to serialize) out of the input.\n*\n* Skips an address the graph no longer holds: entries are data, the graph is\n* truth.\n*/\nfunction joinDeployment(graph, entries) {\n\tconst nodes = [];\n\tfor (const entry of entries) {\n\t\tconst node = graph.nodes.find((n) => n.id === entry.address)?.node;\n\t\tif (node === void 0 || node.kind !== \"service\" && node.kind !== \"resource\") continue;\n\t\tnodes.push({\n\t\t\taddress: entry.address,\n\t\t\tnode,\n\t\t\tentities: entry.entities\n\t\t});\n\t}\n\treturn nodes;\n}\n/** The deploy report: every deployed node joined with its graph node, and the deploy preflight's findings. */\nfunction deploymentResult(app, graph, entries, findings) {\n\treturn {\n\t\tapp,\n\t\tnodes: joinDeployment(graph, entries),\n\t\tfindings\n\t};\n}\nfunction missingBundleError(id) {\n\treturn new LowerError(`No bundle provided for service \"${id}\" (opts.bundles[\"${id}\"] is required).`);\n}\n/** The message `prisma dev` structures as `DEV.DEV_SERVER_UNSUPPORTED` (ADR-0056). */\nfunction noReserveError(id, extension, type) {\n\treturn new LowerError(`service \"${id}\" runs a dev server but its descriptor (${extension}/${type}) has no \\`reserve\\` step`);\n}\nfunction unassembledWithBundleError(address) {\n\treturn new LowerError(`\"${address}\" is listed in opts.unassembled and also has a bundle in opts.bundles — a service is either assembled or not.`);\n}\nfunction unassembledNotServiceError(address) {\n\treturn new LowerError(`\"${address}\" is listed in opts.unassembled but is not a service in the graph.`);\n}\nfunction duplicateExtensionError(id) {\n\treturn new LowerError(`Extension \"${id}\" is listed more than once in \\`extensions\\` — each extension id must be unique.`);\n}\n/** Registries as extension id → descriptor. Fails on a duplicate id — the CLI validates config, but lowering() is the programmatic escape hatch that doesn't. */\nfunction extensionsById(config) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (const extension of config.extensions) {\n\t\tif (map.has(extension.id)) return Effect.fail(duplicateExtensionError(extension.id));\n\t\tmap.set(extension.id, extension);\n\t}\n\treturn Effect.succeed(map);\n}\nfunction unknownExtensionError(extension, id) {\n\treturn new LowerError(`No extension \"${extension}\" is configured (needed by node \"${id}\") — add it to \\`extensions\\` in the \\`composer\\` section of prisma.config.ts (import its /control entry and list its descriptor).`);\n}\nfunction unknownNodeTypeError(extension, type) {\n\treturn new LowerError(`Extension \"${extension.id}\" has no descriptor for node type \"${type}\" (known: ${Object.keys(extension.nodes).join(\", \")}).`);\n}\n/** A provisioned param's need brand isn't registered by the consumer's extension (ADR-0031). */\nfunction unknownProvisionerError(extension, brand, edgeId) {\n\tconst known = extension.provisions !== void 0 && extension.provisions.size > 0 ? Array.from(extension.provisions.keys(), String).join(\", \") : \"(none registered)\";\n\treturn new LowerError(`Extension \"${extension.id}\" has no provisioner for need \"${String(brand)}\" (needed by edge \"${edgeId}\") (known: ${known}).`);\n}\n/** A provisioned edge whose consumer and provider nodes belong to different extensions (ADR-0031). */\nfunction crossExtensionProvisionError(edgeId) {\n\treturn new LowerError(`Provisioned edge \"${edgeId}\" spans two extensions — cross-extension provisioned edges aren't supported yet.`);\n}\n/**\n* More than one provisioned param on one connection (ADR-0031). One edge mints\n* ONE value, keyed by edge id, so a second need on the same connection would\n* silently receive the first's value under the first's brand.\n*/\nfunction multipleProvisionedParamsError(edgeId, names) {\n\treturn new LowerError(`Connection input \"${edgeId}\" declares more than one provisioned param (${names.join(\", \")}) — only one provisioned param per connection is supported.`);\n}\nfunction wrongKindError(extension, type, expected, got) {\n\treturn new LowerError(`Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${got}\" descriptor — this node needs a \"${expected}\" descriptor.`);\n}\n/** Looks up one node's descriptor: extension by `node.extension`, then descriptor by `node.type`, then the kind check. */\nfunction descriptorFor(extensions, node, id) {\n\tconst extension = extensions.get(node.extension);\n\tif (extension === void 0) return Effect.fail(unknownExtensionError(node.extension, id));\n\tconst descriptor = extension.nodes[node.type];\n\tif (descriptor === void 0) return Effect.fail(unknownNodeTypeError(extension, node.type));\n\tif (descriptor.kind !== node.kind) return Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));\n\treturn Effect.succeed(descriptor);\n}\n/**\n* The state-layer precedence a deploy resolves to: an explicit opts.state\n* always wins; failing that, the config's own (required) state descriptor,\n* created with its owning extension's resolved container (`undefined` when\n* that extension declared none). A pure function so the precedence is\n* testable without booting Alchemy.\n*/\nfunction resolveStateLayer(opts, config, containers) {\n\treturn opts.state ?? config.state.create(containers.get(config.state.extension), opts.credentials);\n}\n/**\n* All configured extensions' providers merged, config array order — an\n* extension without `providers` is skipped; no used-extensions-only\n* filtering (ADR-0017's pinned providers rule).\n*/\nfunction mergedProviders(config, credentials) {\n\tconst [first, ...rest] = config.extensions.flatMap((extension) => extension.providers !== void 0 ? [extension.providers({ credentials })] : []);\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n/**\n* Composable form for mixed stacks: hand-wired Alchemy resources alongside Prisma App nodes in one stack effect.\n* Fails with LowerError or whatever an extension's lowering raises — the error type is open.\n*/\nfunction lowering(root, config, opts) {\n\treturn blindCast(Effect.gen(function* () {\n\t\tconst graph = Load(root, {\n\t\t\tid: opts.name,\n\t\t\t...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {},\n\t\t\t...opts.appConfigurationRead !== void 0 ? { appConfigurationRead: opts.appConfigurationRead } : {}\n\t\t});\n\t\tif (opts.preparedNodeAddresses !== void 0) assertSameNodeAddresses(nodeAddresses(graph), opts.preparedNodeAddresses);\n\t\tconst extensions = yield* extensionsById(config);\n\t\tconst { containers, preflightPayloads } = opts;\n\t\tconst findings = opts.findings ?? { unset: [] };\n\t\tconst preflightOf = (extensionId) => preflightPayloads.get(extensionId);\n\t\tconst lowered = /* @__PURE__ */ new Map();\n\t\tconst entries = [];\n\t\tconst provisioned = /* @__PURE__ */ new Map();\n\t\tconst applications = /* @__PURE__ */ new Map();\n\t\tfor (const descriptor of config.extensions) {\n\t\t\tif (descriptor.application === void 0) continue;\n\t\t\tconst appCtx = {\n\t\t\t\tid: graph.root.id,\n\t\t\t\taddress: \"\",\n\t\t\t\tnode: graph.root.node,\n\t\t\t\tgraph,\n\t\t\t\topts,\n\t\t\t\tapplication: void 0,\n\t\t\t\tcontainer: containers.get(descriptor.id),\n\t\t\t\tpreflight: preflightOf(descriptor.id),\n\t\t\t\tlowered,\n\t\t\t\tprovisioned\n\t\t\t};\n\t\t\tapplications.set(descriptor.id, yield* descriptor.application.provision(appCtx));\n\t\t}\n\t\tfor (const edge of graph.edges) {\n\t\t\tif (edge.kind !== \"dependency\") continue;\n\t\t\tconst consumer = graph.nodes.find((n) => n.id === edge.to)?.node;\n\t\t\tif (consumer === void 0 || consumer.kind !== \"service\" && consumer.kind !== \"resource\") continue;\n\t\t\tconst slot = slotsOf(consumer)[edge.input];\n\t\t\tif (slot === void 0) continue;\n\t\t\tconst provisionedParams = Object.entries(slot.connection.params).filter(([, param]) => param.provision !== void 0);\n\t\t\tif (provisionedParams.length === 0) continue;\n\t\t\tconst edgeId = `${edge.to}.${edge.input}`;\n\t\t\tif (provisionedParams.length > 1) return yield* Effect.fail(multipleProvisionedParamsError(edgeId, provisionedParams.map(([name]) => name)));\n\t\t\tconst need = provisionedParams[0]?.[1].provision;\n\t\t\tif (need === void 0) continue;\n\t\t\tconst provider = graph.nodes.find((n) => n.id === edge.from)?.node;\n\t\t\tif (provider === void 0 || provider.kind !== \"service\" && provider.kind !== \"resource\") continue;\n\t\t\tif (consumer.extension !== provider.extension) return yield* Effect.fail(crossExtensionProvisionError(edgeId));\n\t\t\tconst extension = extensions.get(consumer.extension);\n\t\t\tif (extension === void 0) return yield* Effect.fail(unknownExtensionError(consumer.extension, edge.to));\n\t\t\tconst provisioner = extension.provisions?.get(need.brand);\n\t\t\tif (provisioner === void 0) return yield* Effect.fail(unknownProvisionerError(extension, need.brand, edgeId));\n\t\t\tconst ref = yield* provisioner.provision({\n\t\t\t\tapp: graph.root.id,\n\t\t\t\tedgeId,\n\t\t\t\tconsumerAddress: edge.to,\n\t\t\t\tproviderAddress: edge.from,\n\t\t\t\tinput: edge.input,\n\t\t\t\tneed\n\t\t\t});\n\t\t\tprovisioned.set(edgeId, ref);\n\t\t}\n\t\tconst unassembled = new Set(opts.unassembled ?? []);\n\t\tfor (const address of unassembled) {\n\t\t\tif (address in opts.bundles) return yield* Effect.fail(unassembledWithBundleError(address));\n\t\t\tconst found = graph.nodes.find((n) => n.id === address);\n\t\t\tif (found === void 0 || found.node.kind !== \"service\") return yield* Effect.fail(unassembledNotServiceError(address));\n\t\t}\n\t\tconst services = /* @__PURE__ */ new Map();\n\t\tconst ctxFor = (id, node) => ({\n\t\t\tid,\n\t\t\taddress: id,\n\t\t\tnode,\n\t\t\tgraph,\n\t\t\topts,\n\t\t\tapplication: applications.get(node.extension),\n\t\t\tcontainer: containers.get(node.extension),\n\t\t\tpreflight: preflightOf(node.extension),\n\t\t\tlowered,\n\t\t\tprovisioned,\n\t\t\tservices\n\t\t});\n\t\tfor (const { id, node } of graph.nodes) {\n\t\t\tif (node.kind !== \"service\") continue;\n\t\t\tconst descriptor = yield* descriptorFor(extensions, node, id);\n\t\t\tif (descriptor.kind !== \"service\") continue;\n\t\t\tservices.set(id, yield* descriptor.provision(ctxFor(id, node)));\n\t\t}\n\t\tfor (const { id, node } of graph.nodes) {\n\t\t\tif (node.kind === \"module\") continue;\n\t\t\tif (node.kind === \"dependency\") continue;\n\t\t\tconst ctx = ctxFor(id, node);\n\t\t\tconst descriptor = yield* descriptorFor(extensions, node, id);\n\t\t\tif (descriptor.kind === \"resource\") {\n\t\t\t\tconst result = yield* descriptor(ctx);\n\t\t\t\tlowered.set(id, result.outputs);\n\t\t\t\tif (!isValueResource(node)) entries.push({\n\t\t\t\t\taddress: id,\n\t\t\t\t\tentities: result.entities\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (descriptor.kind !== \"service\") return yield* Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));\n\t\t\tconst service = node;\n\t\t\tconst provisionedNode = services.get(id);\n\t\t\tconst typedConfig = buildConfig(service, id, graph, lowered, provisioned);\n\t\t\tconst serialized = yield* descriptor.serialize(ctx, provisionedNode, typedConfig);\n\t\t\tif (unassembled.has(id)) {\n\t\t\t\tif (descriptor.reserve === void 0) return yield* Effect.fail(noReserveError(id, node.extension, node.type));\n\t\t\t\tconst result = yield* descriptor.reserve(ctx, provisionedNode, serialized);\n\t\t\t\tlowered.set(id, result.outputs);\n\t\t\t\tentries.push({\n\t\t\t\t\taddress: id,\n\t\t\t\t\tentities: result.entities\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bundle = opts.bundles[id];\n\t\t\tif (bundle === void 0) return yield* Effect.fail(missingBundleError(id));\n\t\t\tconst artifact = yield* descriptor.package(ctx, {\n\t\t\t\tassembled: {\n\t\t\t\t\tdir: bundle.dir,\n\t\t\t\t\tentry: bundle.entry\n\t\t\t\t},\n\t\t\t\taddress: id\n\t\t\t}, serialized);\n\t\t\tconst result = yield* descriptor.deploy(ctx, provisionedNode, artifact, serialized);\n\t\t\tlowered.set(id, result.outputs);\n\t\t\tentries.push({\n\t\t\t\taddress: id,\n\t\t\t\tentities: result.entities\n\t\t\t});\n\t\t}\n\t\tif (opts.report !== void 0) {\n\t\t\tconst report = opts.report;\n\t\t\tyield* Alchemy.Action(\"composer-deployment-report\", (input) => Effect.sync(() => {\n\t\t\t\treport(deploymentResult(opts.name, graph, input.entries, findings));\n\t\t\t}))({\n\t\t\t\tnonce: Date.now(),\n\t\t\t\tentries\n\t\t\t});\n\t\t}\n\t}));\n}\n/**\n* The whole-stack wrapper: Load → route each node through the config's\n* extension registries → an Alchemy Stack, which the operations hand to\n* `Alchemist.plan`.\n*/\nfunction lower(root, config, opts) {\n\tconst stackEffect = blindCast(Effect.orDie(lowering(root, config, opts)));\n\tconst providers = opts.providers ?? mergedProviders(config, opts.credentials);\n\treturn Alchemy.Stack(opts.name, {\n\t\tproviders,\n\t\tstate: resolveStateLayer(opts, config, opts.containers)\n\t}, stackEffect);\n}\n//#endregion\n//#region src/control/provider-error.ts\nconst PROVIDER_FAILURE_TAG = \"ProviderFailure\";\n/** A provider operation failed with an error that carries no `_tag` of its own; `cause` is that error. */\nvar ProviderFailure = class extends Data.TaggedError(PROVIDER_FAILURE_TAG) {};\nfunction isProviderError(cause) {\n\treturn Predicate.hasProperty(cause, \"_tag\") && typeof cause._tag === \"string\";\n}\n/** What a provider operation threw, as the error Alchemy's lifecycle methods fail with: an error with a `_tag` as it is, anything else wrapped in a `ProviderFailure`. */\nfunction toProviderError(cause) {\n\tif (isProviderError(cause)) return cause;\n\treturn new ProviderFailure({\n\t\tmessage: cause instanceof Error ? cause.message : String(cause),\n\t\tcause\n\t});\n}\n/** The original error of a provider failure `toProviderError` wrapped, or `undefined` for any other error. */\nfunction wrappedProviderError(error) {\n\treturn Predicate.isTagged(error, PROVIDER_FAILURE_TAG) && \"cause\" in error ? error.cause : void 0;\n}\n//#endregion\nexport { GRAPH_CHANGED_ERROR, LowerError, ROOT_INPUT_UNREAD_ERROR, buildConfig, comparableProps, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys, toProviderError, wrappedProviderError };\n\n//# sourceMappingURL=deploy.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,gBAAgB,OAAO;CAC/B,OAAO,OAAO,uBAAuB,IAAI,IAAI,CAAC;AAC/C;AACA,SAAS,OAAO,OAAO,YAAY;CAClC,IAAI,OAAO,UAAU,YAAY,OAAO,EAAE,UAAU,OAAO,KAAK,EAAE;CAClE,IAAI,OAAO,UAAU,UAAU,OAAO,EAAE,QAAQ,OAAO,KAAK,EAAE;CAC9D,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,IAAI,WAAW,IAAI,KAAK,GAAG,OAAO,EAAE,OAAO,KAAK;CAChD,WAAW,IAAI,KAAK;CACpB,IAAI;EACH,OAAO,aAAa,QAAQ,UAAU,OAAO,OAAO,UAAU,CAAC;CAChE,UAAU;EACT,WAAW,OAAO,KAAK;CACxB;AACD;AACA,SAAS,aAAa,OAAO,OAAO;CACnC,IAAI,QAAQ,KAAK,GAAG;EACnB,MAAM,SAAS,SAAS,KAAK;EAC7B,IAAI,OAAO,SAAS,UAAU,OAAO,EAAE,OAAO,EAAE,SAAS,OAAO,KAAK,EAAE;EACvE,OAAO,EAAE,OAAO;GACf,YAAY,OAAO;GACnB,SAAS,QAAQ,IAAI,OAAO,OAAO;GACnC,OAAO,OAAO;GACd,YAAY,OAAO,eAAe,WAAW,OAAO,aAAa,KAAK;GACtE,SAAS,MAAM,QAAQ,IAAI,OAAO,SAAS,CAAC;EAC7C,EAAE;CACH;CACA,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,MAAM,IAAI,KAAK,EAAE;CAC3D,IAAI,iBAAiB,MAAM,OAAO,EAAE,M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AC,CAAC;IACH,OAAO,KAAK,IAAI;IAChB;GACD,CAAC;EACF;CACD,CAAC,CAAC;AACH;;;;;;AAMA,SAAS,MAAM,MAAM,QAAQ,MAAM;CAClC,MAAM,cAAc,UAAU,OAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,CAAC,CAAC;CACxE,MAAM,YAAY,KAAK,aAAa,gBAAgB,QAAQ,KAAK,WAAW;CAC5E,OAAO,QAAQ,MAAM,KAAK,MAAM;EAC/B;EACA,OAAO,kBAAkB,MAAM,QAAQ,KAAK,UAAU;CACvD,GAAG,WAAW;AACf;AAGA,MAAM,uBAAuB;;AAE7B,IAAI,kBAAkB,cAAc,KAAK,YAAY,oBAAoB,CAAC,CAAC,CAAC;AAC5E,SAAS,gBAAgB,OAAO;CAC/B,OAAO,UAAU,YAAY,OAAO,MAAM,KAAK,OAAO,MAAM,SAAS;AACtE;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,gBAAgB,KAAK,GAAG,OAAO;CACnC,OAAO,IAAI,gBAAgB;EAC1B,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAC9D;CACD,CAAC;AACF;;AAEA,SAAS,qBAAqB,OAAO;CACpC,OAAO,UAAU,SAAS,OAAO,oBAAoB,KAAK,WAAW,QAAQ,MAAM,QAAQ,KAAK;AACjG"}
|
package/dist/deploy.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as secretsKeys, r as nodeAddresses } from "./graph-
|
|
2
|
-
import {
|
|
3
|
-
import { i as wrappedProviderError, n as comparableProps, r as toProviderError, t as ROOT_INPUT_UNREAD_ERROR } from "./deploy-
|
|
4
|
-
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, GRAPH_CHANGED_ERROR, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ROOT_INPUT_UNREAD_ERROR, ServeInput, ServiceLowering, buildConfig, comparableProps, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys, toProviderError,
|
|
1
|
+
import { i as secretsKeys, r as nodeAddresses } from "./graph-CRFQxH8r-CI1p78T8.mjs";
|
|
2
|
+
import { F as LowerError, H as PackageInput, I as LowerOptions, L as LoweredResult, P as LowerContext, R as Lowering, S as GRAPH_CHANGED_ERROR, V as Outputs, X as ProvisionEdge, Z as ProvisionerDescriptor, _ as DeployedNode, _t as mergedProviders, a as Artifact, b as DevServer, ct as buildConfig, dt as deploymentResult, g as DeployedEntity, gt as lowering, ht as lower, i as ApplicationDescriptor, it as ServiceLowering, lt as connectionInputs, mt as joinDeployment, o as AssembleInput, rt as ServeInput, s as Bundle, t as AlchemyStateLayer, v as DeploymentResult, yt as resolveStateLayer } from "./app-config-Dhypzb6a-C3Kb0XtS.mjs";
|
|
3
|
+
import { i as wrappedProviderError, n as comparableProps, r as toProviderError, t as ROOT_INPUT_UNREAD_ERROR } from "./deploy-CncPyRbo.mjs";
|
|
4
|
+
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, GRAPH_CHANGED_ERROR, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ROOT_INPUT_UNREAD_ERROR, ServeInput, ServiceLowering, buildConfig, comparableProps, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys, toProviderError, wrappedProviderError };
|
package/dist/deploy.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { E as secretsKeys, a as ROOT_INPUT_UNREAD_ERROR, y as nodeAddresses } from "./graph-
|
|
2
|
-
import { a as connectionInputs, c as lower, d as resolveStateLayer, f as toProviderError, i as comparableProps, l as lowering,
|
|
3
|
-
export { GRAPH_CHANGED_ERROR, LowerError, ROOT_INPUT_UNREAD_ERROR, buildConfig, comparableProps, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys, toProviderError,
|
|
1
|
+
import { E as secretsKeys, a as ROOT_INPUT_UNREAD_ERROR, y as nodeAddresses } from "./graph-BYo1OEqk-D5AtX8q4.mjs";
|
|
2
|
+
import { a as connectionInputs, c as lower, d as resolveStateLayer, f as toProviderError, i as comparableProps, l as lowering, n as LowerError, o as deploymentResult, p as wrappedProviderError, r as buildConfig, s as joinDeployment, t as GRAPH_CHANGED_ERROR, u as mergedProviders } from "./deploy-DPX4IXzF.mjs";
|
|
3
|
+
export { GRAPH_CHANGED_ERROR, LowerError, ROOT_INPUT_UNREAD_ERROR, buildConfig, comparableProps, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys, toProviderError, wrappedProviderError };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as Load } from "./graph-
|
|
1
|
+
import { n as Load } from "./graph-BYo1OEqk-D5AtX8q4.mjs";
|
|
2
2
|
import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
|
|
3
|
-
import "./dist-
|
|
4
|
-
import { i as comparableProps } from "./deploy-
|
|
5
|
-
import { n as failureReasonOf } from "./converge-in-process-
|
|
3
|
+
import "./dist-Bw5O9TDx.mjs";
|
|
4
|
+
import { i as comparableProps } from "./deploy-DPX4IXzF.mjs";
|
|
5
|
+
import { n as failureReasonOf } from "./converge-in-process-CfeblFN9-B1KvX1Fa.mjs";
|
|
6
6
|
import { r as resolveLocalTargets } from "./local-target-DhU1vaxd.mjs";
|
|
7
7
|
import { isDeepStrictEqual } from "node:util";
|
|
8
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-converge-messages-
|
|
8
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-converge-messages-CElmPylA.mjs
|
|
9
9
|
const readKey = (read) => JSON.stringify([
|
|
10
10
|
read.reader,
|
|
11
11
|
read.resource,
|
|
@@ -118,7 +118,7 @@ async function convergeDevJob(job, app, report, signal) {
|
|
|
118
118
|
name: job.name,
|
|
119
119
|
environment: job.environment,
|
|
120
120
|
appConfigurationRead: job.appConfigurationRead,
|
|
121
|
-
|
|
121
|
+
preparedNodeAddresses: job.nodeAddresses,
|
|
122
122
|
bundles: { ...job.bundles },
|
|
123
123
|
unassembled: job.unassembled,
|
|
124
124
|
containers,
|
|
@@ -162,4 +162,4 @@ function isWorkerMessage(value) {
|
|
|
162
162
|
//#endregion
|
|
163
163
|
export { valueReadsSnapshot as a, thrownResult as i, isAbortMessage as n, isWorkerMessage as r, convergeDevJob as t };
|
|
164
164
|
|
|
165
|
-
//# sourceMappingURL=dev-converge-messages-
|
|
165
|
+
//# sourceMappingURL=dev-converge-messages-CElmPylA-BenEozC3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-converge-messages-CElmPylA-BenEozC3.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-converge-messages-CElmPylA.mjs"],"sourcesContent":["import { n as failureReasonOf } from \"./converge-in-process-CfeblFN9.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\tpreparedNodeAddresses: 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-CElmPylA.mjs.map"],"mappings":";;;;;;;;AAOA,MAAM,WAAW,SAAS,KAAK,UAAU;CACxC,KAAK;CACL,KAAK;CACL,KAAK;AACN,CAAC;AACD,SAAS,gBAAgB,UAAU;CAClC,MAAM,6BAA6B,IAAI,IAAI;CAC3C,KAAK,MAAM,QAAQ,SAAS,OAAO;EAClC,MAAM,OAAO,WAAW,IAAI,KAAK,QAAQ,qBAAqB,IAAI,IAAI;EACtE,KAAK,IAAI,QAAQ,IAAI,CAAC;EACtB,WAAW,IAAI,KAAK,UAAU,IAAI;CACnC;CACA,OAAO;AACR;AACA,SAAS,QAAQ,OAAO,SAAS;CAChC,MAAM,QAAQ,MAAM,MAAM,MAAM,UAAU,MAAM,OAAO,OAAO,CAAC,EAAE;CACjE,OAAO,OAAO,SAAS,aAAa,MAAM,QAAQ,KAAK;AACxD;AACA,SAAS,mBAAmB,OAAO;CAClC,OAAO;EACN,OAAO,MAAM,WAAW,KAAK,EAAE,QAAQ,UAA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AO,IAAI,MAAM,SAAS;EAC3B,CAAC;EACD,OAAO;GACN,MAAM;GACN,SAAS,MAAM,IAAI,MAAM,SAAS;IACjC,WAAW;IACX;IACA,OAAO,IAAI;IACX,KAAK,IAAI;IACT,KAAK,CAAC;IACN;IACA,SAAS,OAAO;IAChB,QAAQ,OAAO;GAChB,CAAC;GACD,UAAU,IAAI;EACf;CACD,SAAS,OAAO;EACf,OAAO,aAAa,OAAO,IAAI,QAAQ;CACxC;AACD;AAGA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU;AAC/C;AACA,SAAS,eAAe,OAAO;CAC9B,OAAO,SAAS,KAAK,KAAK,MAAM,YAAY;AAC7C;AACA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,CAAC,SAAS,KAAK,GAAG,OAAO;CAC7B,QAAQ,MAAM,SAAd;EACC,KAAK,SAAS,OAAO,SAAS,MAAM,QAAQ;EAC5C,KAAK,UAAU,OAAO,OAAO,MAAM,YAAY;EAC/C,KAAK,UAAU,OAAO,SAAS,MAAM,SAAS,KAAK,OAAO,MAAM,SAAS,CAAC,YAAY;EACtF,SAAS,OAAO;CACjB;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
|
|
2
|
-
import { a as checkComposerConfig, c as noComposerExportMessage, i as registerEntryResolution, n as loadEntry, r as namesDirectoryWithIndex, t as appFilesNamedBy } from "./load-entry-CEoVBdMj-
|
|
3
|
-
import { t as loadAppConvergeEntry } from "./app-converge-
|
|
4
|
-
import { i as thrownResult, n as isAbortMessage, t as convergeDevJob } from "./dev-converge-messages-
|
|
2
|
+
import { a as checkComposerConfig, c as noComposerExportMessage, i as registerEntryResolution, n as loadEntry, r as namesDirectoryWithIndex, t as appFilesNamedBy } from "./load-entry-CEoVBdMj-L1mXTtEO.mjs";
|
|
3
|
+
import { t as loadAppConvergeEntry } from "./app-converge-DFWYhyDb-BFaMPem0.mjs";
|
|
4
|
+
import { i as thrownResult, n as isAbortMessage, t as convergeDevJob } from "./dev-converge-messages-CElmPylA-BenEozC3.mjs";
|
|
5
5
|
import { parentPort, workerData } from "node:worker_threads";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import { format } from "node:util";
|
|
@@ -1 +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-
|
|
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-aL0W4HPG.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-DFWYhyDb.mjs\";\nimport { i as thrownResult, r as convergeDevJob, t as isAbortMessage } from \"./dev-converge-messages-CElmPylA.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;EACA,QAAQ,OAAO,eAAe,KAAK;CACpC;CACA,OAAO,CAAC,GAAG,KAAK;AACjB;AACA,MAAM,UAAU,UAAU,OAAO,UAAU,WAAW,QAAQ,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,MAAM;;AAEhG,SAAS,gBAAgB,GAAG,MAAM;CACjC,MAAM,SAAS,CAAC;CAChB,IAAI;EACH,IAAI,KAAK,WAAW,GAAG,MAAM,mBAAmB,wBAAwB;EACxE,KAAK,MAAM,OAAO,MAAM,OAAO,KAAK,QAAQ,GAAG,CAAC;CACjD,UAAU;EACT,IAAI,OAAO,SAAS,GAAG,OAAO,OAAO,OAAO,OAAO,MAAM,CAAC,CAAC;CAC5D;CACA,OAAO,OAAO,QAAQ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