@prisma/composer-cli 0.30.0 → 0.31.0-dev.1

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.
Files changed (34) hide show
  1. package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs +34 -0
  2. package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs.map +1 -0
  3. package/dist/{dev-CqS1W82b-BF0YJc6a.mjs → dev-current-Bm7Yrsmt-TadtLg5x.mjs} +24 -5
  4. package/dist/dev-current-Bm7Yrsmt-TadtLg5x.mjs.map +1 -0
  5. package/dist/dist-j4X7U5yA.mjs +1788 -0
  6. package/dist/dist-j4X7U5yA.mjs.map +1 -0
  7. package/dist/{execute-deploy-destroy-D4UdieU1-C1P6X7uK.mjs → execute-deploy-destroy-BK4R2qCX-DU6ITsO0.mjs} +5 -4
  8. package/dist/execute-deploy-destroy-BK4R2qCX-DU6ITsO0.mjs.map +1 -0
  9. package/dist/execute-dev-current-nYH8EiKK-BcP2HhlW.mjs +126 -0
  10. package/dist/execute-dev-current-nYH8EiKK-BcP2HhlW.mjs.map +1 -0
  11. package/dist/{execute-dev-BSPnsEv--SNELmzE_.mjs → execute-dev-qKlYePGn-B3UnMfa5.mjs} +50 -65
  12. package/dist/execute-dev-qKlYePGn-B3UnMfa5.mjs.map +1 -0
  13. package/dist/{family-Dt7BgpVf-YyjGLli3.d.mts → family-BIyR33Uq-BEqJM2Vx.d.mts} +131 -29
  14. package/dist/family-BIyR33Uq-BEqJM2Vx.d.mts.map +1 -0
  15. package/dist/family.d.mts +47 -3
  16. package/dist/family.d.mts.map +1 -1
  17. package/dist/family.mjs +210 -9
  18. package/dist/family.mjs.map +1 -1
  19. package/dist/local-target-DZ6bu7Aj.mjs +48 -0
  20. package/dist/local-target-DZ6bu7Aj.mjs.map +1 -0
  21. package/dist/{container-transport-HcvNOGZL-ClGmzBIO.mjs → pipeline-Dpesfd2j-DKL3f1bj.mjs} +17 -39
  22. package/dist/pipeline-Dpesfd2j-DKL3f1bj.mjs.map +1 -0
  23. package/dist/testing.d.mts +7 -1
  24. package/dist/testing.d.mts.map +1 -1
  25. package/dist/testing.mjs +23 -2
  26. package/dist/testing.mjs.map +1 -1
  27. package/package.json +9 -5
  28. package/src/exports/family.ts +29 -0
  29. package/src/family/emulator-list.ts +112 -0
  30. package/dist/container-transport-HcvNOGZL-ClGmzBIO.mjs.map +0 -1
  31. package/dist/dev-CqS1W82b-BF0YJc6a.mjs.map +0 -1
  32. package/dist/execute-deploy-destroy-D4UdieU1-C1P6X7uK.mjs.map +0 -1
  33. package/dist/execute-dev-BSPnsEv--SNELmzE_.mjs.map +0 -1
  34. package/dist/family-Dt7BgpVf-YyjGLli3.d.mts.map +0 -1
@@ -0,0 +1,34 @@
1
+ //#region ../../0-framework/1-core/core/dist/container-transport-HcvNOGZL.mjs
2
+ /** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PRISMA_CLOUD': uppercased, every non-alphanumeric run replaced by one underscore. */
3
+ function envVarSafeExtensionId(extensionId) {
4
+ return extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, "_").replace(/^_+|_+$/g, "");
5
+ }
6
+ /** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_CONTAINER_PRISMA_COMPOSER_PRISMA_CLOUD' */
7
+ function containerEnvVarName(extensionId) {
8
+ return `PRISMA_COMPOSER_CONTAINER_${envVarSafeExtensionId(extensionId)}`;
9
+ }
10
+ function collisionError(a, b, varName) {
11
+ return /* @__PURE__ */ new Error(`Extension ids "${a}" and "${b}" both map to the container transport variable "${varName}" — rename one of the extensions.`);
12
+ }
13
+ function emptySerializeError(extensionId) {
14
+ return /* @__PURE__ */ new Error(`Extension "${extensionId}"'s container instance serialized to an empty string — ContainerInstance.serialize() must return a non-empty string.`);
15
+ }
16
+ /** The env entries the CLI sets on the alchemy process: `{ [containerEnvVarName(id)]: instance.serialize() }` for every resolved instance. */
17
+ function containerEnv(instances) {
18
+ const env = {};
19
+ const ownerByVarName = /* @__PURE__ */ new Map();
20
+ for (const [extensionId, instance] of instances) {
21
+ const varName = containerEnvVarName(extensionId);
22
+ const owner = ownerByVarName.get(varName);
23
+ if (owner !== void 0) throw collisionError(owner, extensionId, varName);
24
+ ownerByVarName.set(varName, extensionId);
25
+ const serialized = instance.serialize();
26
+ if (serialized.length === 0) throw emptySerializeError(extensionId);
27
+ env[varName] = serialized;
28
+ }
29
+ return env;
30
+ }
31
+ //#endregion
32
+ export { envVarSafeExtensionId as n, containerEnv as t };
33
+
34
+ //# sourceMappingURL=container-transport-HcvNOGZL-CIoZc7Rs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-transport-HcvNOGZL-CIoZc7Rs.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/container-transport-HcvNOGZL.mjs"],"sourcesContent":["//#region src/container-transport.ts\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PRISMA_CLOUD': uppercased, every non-alphanumeric run replaced by one underscore. */\nfunction envVarSafeExtensionId(extensionId) {\n\treturn extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, \"_\").replace(/^_+|_+$/g, \"\");\n}\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_CONTAINER_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction containerEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_CONTAINER_${envVarSafeExtensionId(extensionId)}`;\n}\nfunction collisionError(a, b, varName) {\n\treturn /* @__PURE__ */ new Error(`Extension ids \"${a}\" and \"${b}\" both map to the container transport variable \"${varName}\" — rename one of the extensions.`);\n}\nfunction emptySerializeError(extensionId) {\n\treturn /* @__PURE__ */ new Error(`Extension \"${extensionId}\"'s container instance serialized to an empty string — ContainerInstance.serialize() must return a non-empty string.`);\n}\n/** The env entries the CLI sets on the alchemy process: `{ [containerEnvVarName(id)]: instance.serialize() }` for every resolved instance. */\nfunction containerEnv(instances) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, instance] of instances) {\n\t\tconst varName = containerEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw collisionError(owner, extensionId, varName);\n\t\townerByVarName.set(varName, extensionId);\n\t\tconst serialized = instance.serialize();\n\t\tif (serialized.length === 0) throw emptySerializeError(extensionId);\n\t\tenv[varName] = serialized;\n\t}\n\treturn env;\n}\n/**\n* The alchemy-process side: for each extension with a container descriptor\n* whose var is present in `env`, call its deserialize. Absent var → no entry.\n*/\nfunction deserializeContainers(extensions, env) {\n\tconst instances = /* @__PURE__ */ new Map();\n\tfor (const extension of extensions) {\n\t\tconst descriptor = extension.container;\n\t\tif (descriptor === void 0) continue;\n\t\tconst serialized = env[containerEnvVarName(extension.id)];\n\t\tif (serialized === void 0) continue;\n\t\tinstances.set(extension.id, descriptor.deserialize(serialized));\n\t}\n\treturn instances;\n}\n//#endregion\nexport { envVarSafeExtensionId as i, containerEnvVarName as n, deserializeContainers as r, containerEnv as t };\n\n//# sourceMappingURL=container-transport-HcvNOGZL.mjs.map"],"mappings":";;AAEA,SAAS,sBAAsB,aAAa;CAC3C,OAAO,YAAY,YAAY,CAAC,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC,QAAQ,YAAY,EAAE;AACpF;;AAEA,SAAS,oBAAoB,aAAa;CACzC,OAAO,6BAA6B,sBAAsB,WAAW;AACtE;AACA,SAAS,eAAe,GAAG,GAAG,SAAS;CACtC,uBAAuB,IAAI,MAAM,kBAAkB,EAAE,SAAS,EAAE,kDAAkD,QAAQ,kCAAkC;AAC7J;AACA,SAAS,oBAAoB,aAAa;CACzC,uBAAuB,IAAI,MAAM,cAAc,YAAY,qHAAqH;AACjL;;AAEA,SAAS,aAAa,WAAW;CAChC,MAAM,MAAM,CAAC;CACb,MAAM,iCAAiC,IAAI,IAAI;CAC/C,KAAK,MAAM,CAAC,aAAa,aAAa,WAAW;EAChD,MAAM,UAAU,oBAAoB,WAAW;EAC/C,MAAM,QAAQ,eAAe,IAAI,OAAO;EACxC,IAAI,UAAU,KAAK,GAAG,MAAM,eAAe,OAAO,aAAa,OAAO;EACtE,eAAe,IAAI,SAAS,WAAW;EACvC,MAAM,aAAa,SAAS,UAAU;EACtC,IAAI,WAAW,WAAW,GAAG,MAAM,oBAAoB,WAAW;EAClE,IAAI,WAAW;CAChB;CACA,OAAO;AACR"}
@@ -1,5 +1,5 @@
1
1
  import { d as ok, l as CliStructuredError, m as blindCast, u as notOk } from "./composer-config-CY9fET8H-CgnpfWc2.mjs";
2
- //#region ../../0-framework/3-tooling/cli/dist/dev-CqS1W82b.mjs
2
+ //#region ../../0-framework/3-tooling/cli/dist/dev-current-Bm7Yrsmt.mjs
3
3
  /**
4
4
  * Reads the execution diagnostics an engine-failure error carries in
5
5
  * `meta.diagnostics`; undefined for every other failure.
@@ -35,7 +35,7 @@ async function deployWithDeps(input, deps) {
35
35
  const cwd = input.cwd ?? process.cwd();
36
36
  let executor;
37
37
  try {
38
- executor = await import("./execute-deploy-destroy-D4UdieU1-C1P6X7uK.mjs");
38
+ executor = await import("./execute-deploy-destroy-BK4R2qCX-DU6ITsO0.mjs");
39
39
  } catch (error) {
40
40
  return notOk(executorLoadFailure("deploy", error));
41
41
  }
@@ -53,13 +53,32 @@ async function devWithDeps(input, deps) {
53
53
  const cwd = input.cwd ?? process.cwd();
54
54
  let executor;
55
55
  try {
56
- executor = await import("./execute-dev-BSPnsEv--SNELmzE_.mjs");
56
+ executor = await import("./execute-dev-qKlYePGn-B3UnMfa5.mjs");
57
57
  } catch (error) {
58
58
  return notOk(executorLoadFailure("dev", error));
59
59
  }
60
60
  return executor.executeDev(input, deps, cwd);
61
61
  }
62
+ async function loadExecutor(operation) {
63
+ try {
64
+ return ok(await import("./execute-dev-current-nYH8EiKK-BcP2HhlW.mjs"));
65
+ } catch (error) {
66
+ return notOk(executorLoadFailure(operation, error));
67
+ }
68
+ }
69
+ /** Where the node at `input.address` of the directory's current app runs locally. */
70
+ async function devUrl(input) {
71
+ const executor = await loadExecutor("dev url");
72
+ if (!executor.ok) return executor;
73
+ return executor.value.executeDevUrl(input, input.cwd ?? process.cwd());
74
+ }
75
+ /** Stops the directory's current app: its service processes and database servers. Data and ports stay. */
76
+ async function devStop(input) {
77
+ const executor = await loadExecutor("dev stop");
78
+ if (!executor.ok) return executor;
79
+ return executor.value.executeDevStop(input, input.cwd ?? process.cwd());
80
+ }
62
81
  //#endregion
63
- export { toStructured as i, devWithDeps as n, executionDiagnostics as r, deployWithDeps as t };
82
+ export { executionDiagnostics as a, devWithDeps as i, devStop as n, toStructured as o, devUrl as r, deployWithDeps as t };
64
83
 
65
- //# sourceMappingURL=dev-CqS1W82b-BF0YJc6a.mjs.map
84
+ //# sourceMappingURL=dev-current-Bm7Yrsmt-TadtLg5x.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-current-Bm7Yrsmt-TadtLg5x.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-current-Bm7Yrsmt.mjs"],"sourcesContent":["import { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-BK4R2qCX.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-qKlYePGn.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev-current.ts\nasync function loadExecutor(operation) {\n\ttry {\n\t\treturn ok(await import(\"./execute-dev-current-nYH8EiKK.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` of the directory's current app runs locally. */\nasync function devUrl(input) {\n\tconst executor = await loadExecutor(\"dev url\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevUrl(input, input.cwd ?? process.cwd());\n}\n/** Stops the directory's current app: its service processes and database servers. Data and ports stay. */\nasync function devStop(input) {\n\tconst executor = await loadExecutor(\"dev stop\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevStop(input, input.cwd ?? process.cwd());\n}\n//#endregion\nexport { deploy as a, executorLoadFailure as c, devWithDeps as i, toStructured as l, devUrl as n, deployWithDeps as o, dev as r, executionDiagnostics as s, devStop as t };\n\n//# sourceMappingURL=dev-current-Bm7Yrsmt.mjs.map"],"mappings":";;;;;;AAQA,SAAS,qBAAqB,GAAG;CAChC,MAAM,cAAc,EAAE,OAAO;CAC7B,IAAI,OAAO,gBAAgB,YAAY,gBAAgB,MAAM,OAAO,KAAK;CACzE,MAAM,YAAY,UAAU,WAAW;CACvC,IAAI,UAAU,gBAAgB,KAAK,KAAK,OAAO,UAAU,gBAAgB,YAAY,UAAU,cAAc,KAAK,KAAK,OAAO,UAAU,cAAc,YAAY,OAAO,UAAU,qBAAqB,YAAY,OAAO,UAAU,wBAAwB,YAAY,OAAO,UAAU,WAAW,UAAU;CAC/S,OAAO,UAAU,WAAW;AAC7B;;;;;AAKA,SAAS,aAAa,MAAM,OAAO;CAClC,OAAO,mBAAmB,GAAG,KAAK,IAAI,QAAQ,IAAI,mBAAmB,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,EAAE,OAAO,MAAM,CAAC;AACpJ;;;AAGA,SAAS,oBAAoB,WAAW,OAAO;CAC9C,OAAO,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