@prisma/composer-cli 0.25.0-dev.5 → 0.26.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 (55) hide show
  1. package/dist/{result-D9vIrN7i.mjs → composer-config-CY9fET8H-KpGjlYgO.mjs} +89 -89
  2. package/dist/composer-config-CY9fET8H-KpGjlYgO.mjs.map +1 -0
  3. package/dist/{pipeline-DAYhea3J-uuBciVDS.mjs → container-transport-HcvNOGZL-CHqecFc7.mjs} +83 -71
  4. package/dist/container-transport-HcvNOGZL-CHqecFc7.mjs.map +1 -0
  5. package/dist/{execute-deploy-destroy-CF6DR7sA-jdelm-y5.mjs → execute-deploy-destroy-c0eko3AO-9npuGXd3.mjs} +70 -73
  6. package/dist/execute-deploy-destroy-c0eko3AO-9npuGXd3.mjs.map +1 -0
  7. package/dist/{execute-dev-DAIUT0es-DTdnJdOi.mjs → execute-dev-BICPaq1g-CSoZJuhB.mjs} +70 -9
  8. package/dist/execute-dev-BICPaq1g-CSoZJuhB.mjs.map +1 -0
  9. package/dist/{family-DB2Uf88c-DWEm0USb.d.mts → family-CgeZQdNg-gH8LuqqL.d.mts} +46 -140
  10. package/dist/family-CgeZQdNg-gH8LuqqL.d.mts.map +1 -0
  11. package/dist/family.d.mts +3 -28
  12. package/dist/family.d.mts.map +1 -1
  13. package/dist/family.mjs +12 -461
  14. package/dist/family.mjs.map +1 -1
  15. package/dist/{generate-dev-stack-CPpjJdTG-W0N0YgsI.mjs → generate-dev-stack-BUadNY_w-DF_lHVaP.mjs} +4 -4
  16. package/dist/{generate-dev-stack-CPpjJdTG-W0N0YgsI.mjs.map → generate-dev-stack-BUadNY_w-DF_lHVaP.mjs.map} +1 -1
  17. package/dist/run-alchemy-BEvB2sYQ-BgV2deuO.mjs +154 -0
  18. package/dist/run-alchemy-BEvB2sYQ-BgV2deuO.mjs.map +1 -0
  19. package/dist/testing.d.mts +10 -24
  20. package/dist/testing.d.mts.map +1 -1
  21. package/dist/testing.mjs +17 -46
  22. package/dist/testing.mjs.map +1 -1
  23. package/package.json +5 -8
  24. package/src/exports/testing.ts +2 -2
  25. package/dist/bin.mjs +0 -987
  26. package/dist/bin.mjs.map +0 -1
  27. package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs +0 -34
  28. package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs.map +0 -1
  29. package/dist/execute-deploy-destroy-CF6DR7sA-DGs5poBA.mjs +0 -556
  30. package/dist/execute-deploy-destroy-CF6DR7sA-DGs5poBA.mjs.map +0 -1
  31. package/dist/execute-deploy-destroy-CF6DR7sA-jdelm-y5.mjs.map +0 -1
  32. package/dist/execute-dev-DAIUT0es-CVW9TfgX.mjs +0 -2060
  33. package/dist/execute-dev-DAIUT0es-CVW9TfgX.mjs.map +0 -1
  34. package/dist/execute-dev-DAIUT0es-DTdnJdOi.mjs.map +0 -1
  35. package/dist/execute-log-PLs9-Qn3-BUBx5KmY.mjs +0 -155
  36. package/dist/execute-log-PLs9-Qn3-BUBx5KmY.mjs.map +0 -1
  37. package/dist/execute-log-PLs9-Qn3-D8DRuvDr.mjs +0 -154
  38. package/dist/execute-log-PLs9-Qn3-D8DRuvDr.mjs.map +0 -1
  39. package/dist/family-DB2Uf88c-DWEm0USb.d.mts.map +0 -1
  40. package/dist/local-target-B9cBl_6r.mjs +0 -68
  41. package/dist/local-target-B9cBl_6r.mjs.map +0 -1
  42. package/dist/local-target-P4-n1Ovh.mjs +0 -68
  43. package/dist/local-target-P4-n1Ovh.mjs.map +0 -1
  44. package/dist/pipeline-DAYhea3J-BEnHHWp8.mjs +0 -979
  45. package/dist/pipeline-DAYhea3J-BEnHHWp8.mjs.map +0 -1
  46. package/dist/pipeline-DAYhea3J-uuBciVDS.mjs.map +0 -1
  47. package/dist/result-D9vIrN7i.mjs.map +0 -1
  48. package/dist/result-SF9LFOuR.mjs +0 -461
  49. package/dist/result-SF9LFOuR.mjs.map +0 -1
  50. package/dist/run-alchemy-pANK8XNX-CqXC1tbs.mjs +0 -99
  51. package/dist/run-alchemy-pANK8XNX-CqXC1tbs.mjs.map +0 -1
  52. package/dist/run-alchemy-pANK8XNX-T_pHNDBo.mjs +0 -99
  53. package/dist/run-alchemy-pANK8XNX-T_pHNDBo.mjs.map +0 -1
  54. package/dist/shared-BAIiDgXa-DYP7EOSk.mjs +0 -33
  55. package/dist/shared-BAIiDgXa-DYP7EOSk.mjs.map +0 -1
package/dist/testing.mjs CHANGED
@@ -1,10 +1,12 @@
1
- import { c as CliStructuredError, n as ok, r as okVoid, t as notOk } from "./result-D9vIrN7i.mjs";
2
- import { n as renderDevStackFile } from "./generate-dev-stack-CPpjJdTG-W0N0YgsI.mjs";
1
+ import { a as CliStructuredError, o as notOk, s as ok } from "./composer-config-CY9fET8H-KpGjlYgO.mjs";
2
+ import { n as renderDevStackFile } from "./generate-dev-stack-BUadNY_w-DF_lHVaP.mjs";
3
3
  //#region ../../0-framework/3-tooling/cli/dist/testing.mjs
4
4
  /**
5
- * The published control-API double (`@prisma/composer/testing`): the four
6
- * control operations with their real signatures and Result shapes, backed by
7
- * fixtures instead of alchemy, containers, or a network.
5
+ * The published operations double (`@prisma/composer-cli/testing`): the two
6
+ * operations the command family calls, `deploy` and `dev`, with their real
7
+ * signatures and Result shapes, backed by fixtures instead of alchemy,
8
+ * containers, or a network. It does not cover `destroy` and `log`, which no
9
+ * command calls.
8
10
  *
9
11
  * Hosts that mount composer's command family — prisma-cli above all — test
10
12
  * against this instead of the real operations, so their suites never spawn a
@@ -13,8 +15,7 @@ import { n as renderDevStackFile } from "./generate-dev-stack-CPpjJdTG-W0N0YgsI.
13
15
  * defined as `typeof deployWithDeps` (etc.) of the REAL operations, and the
14
16
  * double is declared against it, so a drift in any real signature fails
15
17
  * `tsc --noEmit` right here. Every import of implementation modules is
16
- * type-only and erases
17
- * at build — the built `testing` chunk must contain no path to the real
18
+ * type-only and erases at build — the built `testing` chunk must contain no path to the real
18
19
  * control implementation, which scripts/check-family-static-graph.mjs proves
19
20
  * against the packed tarball.
20
21
  */
@@ -40,13 +41,6 @@ function devSessionDouble(input, endpoints) {
40
41
  }
41
42
  };
42
43
  }
43
- async function* replayLines(lines, address, signal) {
44
- for (const line of lines) {
45
- if (signal?.aborted === true) return;
46
- if (address !== void 0 && line.service !== address) continue;
47
- yield line;
48
- }
49
- }
50
44
  /**
51
45
  * Runs the caller's converge adapter, when it supplied one, against a
52
46
  * synthetic invocation — no alchemy bin is resolved and no real child is
@@ -59,19 +53,19 @@ async function* replayLines(lines, address, signal) {
59
53
  * behind it — is genuinely exercised. Returns undefined when no adapter was
60
54
  * injected, leaving the fixture result untouched.
61
55
  */
62
- async function runConverge(action, deps, cwd) {
56
+ async function runConverge(deps, cwd) {
63
57
  if (deps.alchemy === void 0) return void 0;
64
58
  const stackFilePath = ".prisma-composer/alchemy.run.ts";
65
- const reproduceCommand = `alchemy ${action} ${stackFilePath} --yes --stage test`;
59
+ const reproduceCommand = `alchemy deploy ${stackFilePath} --yes --stage test`;
66
60
  const workingDirectory = cwd ?? ".";
67
61
  const outcome = await deps.alchemy({
68
- action,
62
+ action: "deploy",
69
63
  stackFileRelativePath: stackFilePath,
70
64
  cwd: workingDirectory,
71
65
  stage: "test",
72
66
  env: {}
73
67
  });
74
- if (outcome.signal !== null) return notOk(new CliStructuredError("DEPLOY.ENGINE_FAILED", `alchemy ${action} was interrupted by ${outcome.signal}.`, { meta: {
68
+ if (outcome.signal !== null) return notOk(new CliStructuredError("DEPLOY.ENGINE_FAILED", `alchemy deploy was interrupted by ${outcome.signal}.`, { meta: {
75
69
  signal: outcome.signal,
76
70
  diagnostics: {
77
71
  exitCode: void 0,
@@ -83,7 +77,7 @@ async function runConverge(action, deps, cwd) {
83
77
  } }));
84
78
  const status = outcome.exitCode ?? 1;
85
79
  if (status === 0) return void 0;
86
- return notOk(new CliStructuredError("DEPLOY.ENGINE_FAILED", `alchemy ${action} exited with status ${status}.`, { meta: {
80
+ return notOk(new CliStructuredError("DEPLOY.ENGINE_FAILED", `alchemy deploy exited with status ${status}.`, { meta: {
87
81
  exitCode: status,
88
82
  diagnostics: {
89
83
  exitCode: status,
@@ -93,22 +87,16 @@ async function runConverge(action, deps, cwd) {
93
87
  }
94
88
  } }));
95
89
  }
96
- function createControlDouble(fixtures = {}) {
90
+ function createOperationsDouble(fixtures = {}) {
97
91
  const deployCalls = [];
98
- const destroyCalls = [];
99
92
  const devCalls = [];
100
- const logCalls = [];
101
93
  const deps = {
102
94
  deploy: [],
103
- destroy: [],
104
- dev: [],
105
- log: []
95
+ dev: []
106
96
  };
107
97
  const calls = {
108
98
  deploy: deployCalls,
109
- destroy: destroyCalls,
110
99
  dev: devCalls,
111
- log: logCalls,
112
100
  deps
113
101
  };
114
102
  return {
@@ -116,37 +104,20 @@ function createControlDouble(fixtures = {}) {
116
104
  deploy: async (input, operationDeps) => {
117
105
  calls.deploy.push(input);
118
106
  deps.deploy.push(operationDeps);
119
- const converge = await runConverge("deploy", operationDeps, input.cwd);
107
+ const converge = await runConverge(operationDeps, input.cwd);
120
108
  if (converge !== void 0) return converge;
121
109
  return fixtures.deploy ?? ok({ summary: void 0 });
122
110
  },
123
- destroy: async (input, operationDeps) => {
124
- calls.destroy.push(input);
125
- deps.destroy.push(operationDeps);
126
- for (const event of fixtures.destroyEvents ?? []) input.onEvent?.(event);
127
- const converge = await runConverge("destroy", operationDeps, input.cwd);
128
- if (converge !== void 0) return converge;
129
- return fixtures.destroy ?? okVoid();
130
- },
131
111
  dev: async (input, operationDeps) => {
132
112
  calls.dev.push(input);
133
113
  deps.dev.push(operationDeps);
134
114
  return fixtures.dev ?? ok(devSessionDouble(input, fixtures.devEndpoints ?? []));
135
- },
136
- log: async (input, logDeps) => {
137
- calls.log.push(input);
138
- deps.log.push(logDeps);
139
- return fixtures.log ?? ok({
140
- appName: fixtures.logAppName ?? "app",
141
- services: fixtures.logServices ?? [],
142
- lines: replayLines(fixtures.logLines ?? [], input.address, input.signal)
143
- });
144
115
  }
145
116
  },
146
117
  calls
147
118
  };
148
119
  }
149
120
  //#endregion
150
- export { createControlDouble, renderDevStackFile };
121
+ export { createOperationsDouble, renderDevStackFile };
151
122
 
152
123
  //# sourceMappingURL=testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/testing.mjs"],"sourcesContent":["import { n as renderDevStackFile } from \"./generate-dev-stack-CPpjJdTG.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\n//#region src/testing/control-double.ts\n/**\n* The published control-API double (`@prisma/composer/testing`): the four\n* control operations with their real signatures and Result shapes, backed by\n* fixtures instead of alchemy, containers, or a network.\n*\n* Hosts that mount composer's command family — prisma-cli above all — test\n* against this instead of the real operations, so their suites never spawn a\n* converge and their typecheck never needs the alchemy/effect constellation.\n* The conformance guarantee is carried by the types: `ComposerOperations` is\n* defined as `typeof deployWithDeps` (etc.) of the REAL operations, and the\n* double is declared against it, so a drift in any real signature fails\n* `tsc --noEmit` right here. Every import of implementation modules is\n* type-only and erases\n* at build — the built `testing` chunk must contain no path to the real\n* control implementation, which scripts/check-family-static-graph.mjs proves\n* against the packed tarball.\n*/\nfunction devSessionDouble(input, endpoints) {\n\tlet resolveClosed;\n\tconst closed = new Promise((resolve) => {\n\t\tresolveClosed = resolve;\n\t});\n\tlet stopped = false;\n\tinput.onEvent?.({\n\t\tkind: \"ready\",\n\t\tendpoints\n\t});\n\treturn {\n\t\tendpoints,\n\t\tclosed,\n\t\tstop: async () => {\n\t\t\tif (stopped) return;\n\t\t\tstopped = true;\n\t\t\tinput.onEvent?.({ kind: \"stopping\" });\n\t\t\tinput.onEvent?.({ kind: \"stopped\" });\n\t\t\tresolveClosed();\n\t\t}\n\t};\n}\nasync function* replayLines(lines, address, signal) {\n\tfor (const line of lines) {\n\t\tif (signal?.aborted === true) return;\n\t\tif (address !== void 0 && line.service !== address) continue;\n\t\tyield line;\n\t}\n}\n/**\n* Runs the caller's converge adapter, when it supplied one, against a\n* synthetic invocation — no alchemy bin is resolved and no real child is\n* started; the adapter decides what the child does.\n*\n* This is what makes a host's tests cover the settlement rules rather than\n* just the grammar: a scripted fake child that exits non-zero, or is killed\n* by a signal, produces the same failure shape the real executor produces, so\n* the handler's settlement — and the engine's own child-status settlement\n* behind it — is genuinely exercised. Returns undefined when no adapter was\n* injected, leaving the fixture result untouched.\n*/\nasync function runConverge(action, deps, cwd) {\n\tif (deps.alchemy === void 0) return void 0;\n\tconst stackFilePath = \".prisma-composer/alchemy.run.ts\";\n\tconst reproduceCommand = `alchemy ${action} ${stackFilePath} --yes --stage test`;\n\tconst workingDirectory = cwd ?? \".\";\n\tconst outcome = await deps.alchemy({\n\t\taction,\n\t\tstackFileRelativePath: stackFilePath,\n\t\tcwd: workingDirectory,\n\t\tstage: \"test\",\n\t\tenv: {}\n\t});\n\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} was interrupted by ${outcome.signal}.`, { meta: {\n\t\tsignal: outcome.signal,\n\t\tdiagnostics: {\n\t\t\texitCode: void 0,\n\t\t\tsignal: outcome.signal,\n\t\t\tstackFilePath,\n\t\t\treproduceCommand,\n\t\t\tcwd: workingDirectory\n\t\t}\n\t} }));\n\tconst status = outcome.exitCode ?? 1;\n\tif (status === 0) return void 0;\n\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} exited with status ${status}.`, { meta: {\n\t\texitCode: status,\n\t\tdiagnostics: {\n\t\t\texitCode: status,\n\t\t\tstackFilePath,\n\t\t\treproduceCommand,\n\t\t\tcwd: workingDirectory\n\t\t}\n\t} }));\n}\nfunction createControlDouble(fixtures = {}) {\n\tconst deployCalls = [];\n\tconst destroyCalls = [];\n\tconst devCalls = [];\n\tconst logCalls = [];\n\tconst deps = {\n\t\tdeploy: [],\n\t\tdestroy: [],\n\t\tdev: [],\n\t\tlog: []\n\t};\n\tconst calls = {\n\t\tdeploy: deployCalls,\n\t\tdestroy: destroyCalls,\n\t\tdev: devCalls,\n\t\tlog: logCalls,\n\t\tdeps\n\t};\n\treturn {\n\t\toperations: {\n\t\t\tdeploy: async (input, operationDeps) => {\n\t\t\t\tcalls.deploy.push(input);\n\t\t\t\tdeps.deploy.push(operationDeps);\n\t\t\t\tconst converge = await runConverge(\"deploy\", operationDeps, input.cwd);\n\t\t\t\tif (converge !== void 0) return converge;\n\t\t\t\treturn fixtures.deploy ?? ok({ summary: void 0 });\n\t\t\t},\n\t\t\tdestroy: async (input, operationDeps) => {\n\t\t\t\tcalls.destroy.push(input);\n\t\t\t\tdeps.destroy.push(operationDeps);\n\t\t\t\tfor (const event of fixtures.destroyEvents ?? []) input.onEvent?.(event);\n\t\t\t\tconst converge = await runConverge(\"destroy\", operationDeps, input.cwd);\n\t\t\t\tif (converge !== void 0) return converge;\n\t\t\t\treturn fixtures.destroy ?? okVoid();\n\t\t\t},\n\t\t\tdev: async (input, operationDeps) => {\n\t\t\t\tcalls.dev.push(input);\n\t\t\t\tdeps.dev.push(operationDeps);\n\t\t\t\treturn fixtures.dev ?? ok(devSessionDouble(input, fixtures.devEndpoints ?? []));\n\t\t\t},\n\t\t\tlog: async (input, logDeps) => {\n\t\t\t\tcalls.log.push(input);\n\t\t\t\tdeps.log.push(logDeps);\n\t\t\t\treturn fixtures.log ?? ok({\n\t\t\t\t\tappName: fixtures.logAppName ?? \"app\",\n\t\t\t\t\tservices: fixtures.logServices ?? [],\n\t\t\t\t\tlines: replayLines(fixtures.logLines ?? [], input.address, input.signal)\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tcalls\n\t};\n}\n//#endregion\nexport { createControlDouble, renderDevStackFile };\n\n//# sourceMappingURL=testing.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,iBAAiB,OAAO,WAAW;CAC3C,IAAI;CACJ,MAAM,SAAS,IAAI,SAAS,YAAY;EACvC,gBA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,SAAS,MAAM,MAAM;IACxE,CAAC;GACF;EACD;EACA;CACD;AACD"}
1
+ {"version":3,"file":"testing.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/testing.mjs"],"sourcesContent":["import { n as renderDevStackFile } from \"./generate-dev-stack-BUadNY_w.mjs\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/testing/operations-double.ts\n/**\n* The published operations double (`@prisma/composer-cli/testing`): the two\n* operations the command family calls, `deploy` and `dev`, with their real\n* signatures and Result shapes, backed by fixtures instead of alchemy,\n* containers, or a network. It does not cover `destroy` and `log`, which no\n* command calls.\n*\n* Hosts that mount composer's command family — prisma-cli above all — test\n* against this instead of the real operations, so their suites never spawn a\n* converge and their typecheck never needs the alchemy/effect constellation.\n* The conformance guarantee is carried by the types: `ComposerOperations` is\n* defined as `typeof deployWithDeps` (etc.) of the REAL operations, and the\n* double is declared against it, so a drift in any real signature fails\n* `tsc --noEmit` right here. Every import of implementation modules is\n* type-only and erases at build — the built `testing` chunk must contain no path to the real\n* control implementation, which scripts/check-family-static-graph.mjs proves\n* against the packed tarball.\n*/\nfunction devSessionDouble(input, endpoints) {\n\tlet resolveClosed;\n\tconst closed = new Promise((resolve) => {\n\t\tresolveClosed = resolve;\n\t});\n\tlet stopped = false;\n\tinput.onEvent?.({\n\t\tkind: \"ready\",\n\t\tendpoints\n\t});\n\treturn {\n\t\tendpoints,\n\t\tclosed,\n\t\tstop: async () => {\n\t\t\tif (stopped) return;\n\t\t\tstopped = true;\n\t\t\tinput.onEvent?.({ kind: \"stopping\" });\n\t\t\tinput.onEvent?.({ kind: \"stopped\" });\n\t\t\tresolveClosed();\n\t\t}\n\t};\n}\n/**\n* Runs the caller's converge adapter, when it supplied one, against a\n* synthetic invocation — no alchemy bin is resolved and no real child is\n* started; the adapter decides what the child does.\n*\n* This is what makes a host's tests cover the settlement rules rather than\n* just the grammar: a scripted fake child that exits non-zero, or is killed\n* by a signal, produces the same failure shape the real executor produces, so\n* the handler's settlement — and the engine's own child-status settlement\n* behind it — is genuinely exercised. Returns undefined when no adapter was\n* injected, leaving the fixture result untouched.\n*/\nasync function runConverge(deps, cwd) {\n\tif (deps.alchemy === void 0) return void 0;\n\tconst stackFilePath = \".prisma-composer/alchemy.run.ts\";\n\tconst reproduceCommand = `alchemy deploy ${stackFilePath} --yes --stage test`;\n\tconst workingDirectory = cwd ?? \".\";\n\tconst outcome = await deps.alchemy({\n\t\taction: \"deploy\",\n\t\tstackFileRelativePath: stackFilePath,\n\t\tcwd: workingDirectory,\n\t\tstage: \"test\",\n\t\tenv: {}\n\t});\n\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy deploy was interrupted by ${outcome.signal}.`, { meta: {\n\t\tsignal: outcome.signal,\n\t\tdiagnostics: {\n\t\t\texitCode: void 0,\n\t\t\tsignal: outcome.signal,\n\t\t\tstackFilePath,\n\t\t\treproduceCommand,\n\t\t\tcwd: workingDirectory\n\t\t}\n\t} }));\n\tconst status = outcome.exitCode ?? 1;\n\tif (status === 0) return void 0;\n\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy deploy exited with status ${status}.`, { meta: {\n\t\texitCode: status,\n\t\tdiagnostics: {\n\t\t\texitCode: status,\n\t\t\tstackFilePath,\n\t\t\treproduceCommand,\n\t\t\tcwd: workingDirectory\n\t\t}\n\t} }));\n}\nfunction createOperationsDouble(fixtures = {}) {\n\tconst deployCalls = [];\n\tconst devCalls = [];\n\tconst deps = {\n\t\tdeploy: [],\n\t\tdev: []\n\t};\n\tconst calls = {\n\t\tdeploy: deployCalls,\n\t\tdev: devCalls,\n\t\tdeps\n\t};\n\treturn {\n\t\toperations: {\n\t\t\tdeploy: async (input, operationDeps) => {\n\t\t\t\tcalls.deploy.push(input);\n\t\t\t\tdeps.deploy.push(operationDeps);\n\t\t\t\tconst converge = await runConverge(operationDeps, input.cwd);\n\t\t\t\tif (converge !== void 0) return converge;\n\t\t\t\treturn fixtures.deploy ?? ok({ summary: void 0 });\n\t\t\t},\n\t\t\tdev: async (input, operationDeps) => {\n\t\t\t\tcalls.dev.push(input);\n\t\t\t\tdeps.dev.push(operationDeps);\n\t\t\t\treturn fixtures.dev ?? ok(devSessionDouble(input, fixtures.devEndpoints ?? []));\n\t\t\t}\n\t\t},\n\t\tcalls\n\t};\n}\n//#endregion\nexport { createOperationsDouble, renderDevStackFile };\n\n//# sourceMappingURL=testing.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,iBAAiB,OAAO,WAAW;CAC3C,IAAI;CACJ,MAAM,SAAS,IAAI,SAAS,YAAY;EACvC,gBAAgB;CACjB,CAAC;CACD,IAAI,UAAU;CACd,MAAM,UAAU;EACf,MAAM;EACN;CACD,CAAC;CACD,OAAO;EACN;EACA;EACA,MAAM,YAAY;GACjB,IAAI,SAAS;GACb,UAAU;GACV,MAAM,UAAU,EAAE,MAAM,WAAW,CAAC;GACpC,MAAM,UAAU,EAAE,MAAM,UAAU,CAAC;GACnC,cAAc;EACf;CACD;AACD;;;;;;;;;;;;;AAaA,eAAe,YAAY,MAAM,KAAK;CACrC,IAAI,KAAK,YAAY,KAAK,GAAG,OAAO,KAAK;CACzC,MAAM,gBAAgB;CACtB,MAAM,mBAAmB,kBAAkB,cAAc;CACzD,MAAM,mBAAmB,OAAO;CAChC,MAAM,UAAU,MAAM,KAAK,QAAQ;EAClC,QAAQ;EACR,uBAAuB;EACvB,KAAK;EACL,OAAO;EACP,KAAK,CAAC;CACP,CAAC;CACD,IAAI,QAAQ,WAAW,MAAM,OAAO,MAAM,IAAI,mBAAmB,wBAAwB,qCAAqC,QAAQ,OAAO,IAAI,EAAE,MAAM;EACxJ,QAAQ,QAAQ;EAChB,aAAa;GACZ,UAAU,KAAK;GACf,QAAQ,QAAQ;GAChB;GACA;GACA,KAAK;EACN;CACD,EAAE,CAAC,CAAC;CACJ,MAAM,SAAS,QAAQ,YAAY;CACnC,IAAI,WAAW,GAAG,OAAO,KAAK;CAC9B,OAAO,MAAM,IAAI,mBAAmB,wBAAwB,qCAAqC,OAAO,IAAI,EAAE,MAAM;EACnH,UAAU;EACV,aAAa;GACZ,UAAU;GACV;GACA;GACA,KAAK;EACN;CACD,EAAE,CAAC,CAAC;AACL;AACA,SAAS,uBAAuB,WAAW,CAAC,GAAG;CAC9C,MAAM,cAAc,CAAC;CACrB,MAAM,WAAW,CAAC;CAClB,MAAM,OAAO;EACZ,QAAQ,CAAC;EACT,KAAK,CAAC;CACP;CACA,MAAM,QAAQ;EACb,QAAQ;EACR,KAAK;EACL;CACD;CACA,OAAO;EACN,YAAY;GACX,QAAQ,OAAO,OAAO,kBAAkB;IACvC,MAAM,OAAO,KAAK,KAAK;IACvB,KAAK,OAAO,KAAK,aAAa;IAC9B,MAAM,WAAW,MAAM,YAAY,eAAe,MAAM,GAAG;IAC3D,IAAI,aAAa,KAAK,GAAG,OAAO;IAChC,OAAO,SAAS,UAAU,GAAG,EAAE,SAAS,KAAK,EAAE,CAAC;GACjD;GACA,KAAK,OAAO,OAAO,kBAAkB;IACpC,MAAM,IAAI,KAAK,KAAK;IACpB,KAAK,IAAI,KAAK,aAAa;IAC3B,OAAO,SAAS,OAAO,GAAG,iBAAiB,OAAO,SAAS,gBAAgB,CAAC,CAAC,CAAC;GAC/E;EACD;EACA;CACD;AACD"}
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@prisma/composer-cli",
3
- "version": "0.25.0-dev.5",
3
+ "version": "0.26.0-dev.1",
4
4
  "type": "module",
5
- "description": "Prisma Composer's command family and the `prisma-composer` CLI.",
6
- "bin": {
7
- "prisma-composer": "./dist/bin.mjs"
8
- },
5
+ "description": "Prisma Composer's command family, which the `prisma` CLI mounts as `deploy` and `dev`.",
9
6
  "exports": {
10
7
  "./family": "./dist/family.mjs",
11
8
  "./testing": "./dist/testing.mjs",
@@ -16,7 +13,7 @@
16
13
  "src"
17
14
  ],
18
15
  "dependencies": {
19
- "@prisma/composer": "0.25.0-dev.5",
16
+ "@prisma/composer": "0.26.0-dev.1",
20
17
  "alchemy": "2.0.0-beta.78",
21
18
  "cross-spawn": "^7.0.6",
22
19
  "effect": "4.0.0-rc.115",
@@ -26,8 +23,8 @@
26
23
  "@prisma/cli-engine": "0.6.2"
27
24
  },
28
25
  "devDependencies": {
29
- "@internal/cli": "0.25.0-dev.5",
30
- "@internal/tsdown-config": "0.25.0-dev.5",
26
+ "@internal/cli": "0.26.0-dev.1",
27
+ "@internal/tsdown-config": "0.26.0-dev.1",
31
28
  "@prisma/cli-engine": "0.6.2",
32
29
  "@types/node": "^26.0.1",
33
30
  "tsdown": "^0.22.7",
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Public surface (the `./testing` subpath): `createControlDouble`, the
3
- * fixture-backed double of the control API, for hosts that test how they
2
+ * Public surface (the `./testing` subpath): `createOperationsDouble`, the
3
+ * fixture-backed double of the operations the command family calls, for hosts that test how they
4
4
  * mount the command family without running real deploys; and
5
5
  * `renderDevStackFile`, the dev stack file `dev` writes, for tests that drive
6
6
  * Alchemy directly.