@prisma/composer-cli 0.25.0 → 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 (56) hide show
  1. package/dist/composer-config-CY9fET8H-KpGjlYgO.mjs +432 -0
  2. package/dist/composer-config-CY9fET8H-KpGjlYgO.mjs.map +1 -0
  3. package/dist/{pipeline-C7gNjMzJ-CMqZQxqM.mjs → container-transport-HcvNOGZL-CHqecFc7.mjs} +109 -322
  4. package/dist/container-transport-HcvNOGZL-CHqecFc7.mjs.map +1 -0
  5. package/dist/{execute-deploy-destroy-CvKCwVkD-B3vcxYJF.mjs → execute-deploy-destroy-c0eko3AO-9npuGXd3.mjs} +108 -85
  6. package/dist/execute-deploy-destroy-c0eko3AO-9npuGXd3.mjs.map +1 -0
  7. package/dist/{execute-dev-BLCK5wF7-CuzMSK7T.mjs → execute-dev-BICPaq1g-CSoZJuhB.mjs} +162 -132
  8. package/dist/execute-dev-BICPaq1g-CSoZJuhB.mjs.map +1 -0
  9. package/dist/{family-B1RaH4f8-ChoTnv3A.d.mts → family-CgeZQdNg-gH8LuqqL.d.mts} +136 -172
  10. package/dist/family-CgeZQdNg-gH8LuqqL.d.mts.map +1 -0
  11. package/dist/family.d.mts +4 -39
  12. package/dist/family.d.mts.map +1 -1
  13. package/dist/family.mjs +49 -551
  14. package/dist/family.mjs.map +1 -1
  15. package/dist/generate-dev-stack-BUadNY_w-DF_lHVaP.mjs +87 -0
  16. package/dist/generate-dev-stack-BUadNY_w-DF_lHVaP.mjs.map +1 -0
  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 +24 -24
  20. package/dist/testing.d.mts.map +1 -1
  21. package/dist/testing.mjs +17 -45
  22. package/dist/testing.mjs.map +1 -1
  23. package/package.json +7 -11
  24. package/src/exports/testing.ts +5 -3
  25. package/dist/bin.mjs +0 -1040
  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-CvKCwVkD-B3vcxYJF.mjs.map +0 -1
  30. package/dist/execute-deploy-destroy-CvKCwVkD-DCufHnkW.mjs +0 -528
  31. package/dist/execute-deploy-destroy-CvKCwVkD-DCufHnkW.mjs.map +0 -1
  32. package/dist/execute-dev-BLCK5wF7-B-fG_E31.mjs +0 -2011
  33. package/dist/execute-dev-BLCK5wF7-B-fG_E31.mjs.map +0 -1
  34. package/dist/execute-dev-BLCK5wF7-CuzMSK7T.mjs.map +0 -1
  35. package/dist/execute-log-B_zCJ17b-BrLUt7vo.mjs +0 -157
  36. package/dist/execute-log-B_zCJ17b-BrLUt7vo.mjs.map +0 -1
  37. package/dist/execute-log-B_zCJ17b-C4a0uxJj.mjs +0 -158
  38. package/dist/execute-log-B_zCJ17b-C4a0uxJj.mjs.map +0 -1
  39. package/dist/family-B1RaH4f8-ChoTnv3A.d.mts.map +0 -1
  40. package/dist/local-target-BOGjATc2.mjs +0 -68
  41. package/dist/local-target-BOGjATc2.mjs.map +0 -1
  42. package/dist/local-target-hoEGqgVA.mjs +0 -68
  43. package/dist/local-target-hoEGqgVA.mjs.map +0 -1
  44. package/dist/pipeline-C7gNjMzJ-CMqZQxqM.mjs.map +0 -1
  45. package/dist/pipeline-C7gNjMzJ-CixaMvnR.mjs +0 -1205
  46. package/dist/pipeline-C7gNjMzJ-CixaMvnR.mjs.map +0 -1
  47. package/dist/result-B874OKwb.mjs +0 -383
  48. package/dist/result-B874OKwb.mjs.map +0 -1
  49. package/dist/result-sR7PBi61.mjs +0 -229
  50. package/dist/result-sR7PBi61.mjs.map +0 -1
  51. package/dist/run-alchemy-pANK8XNX-BH1wC0r6.mjs +0 -99
  52. package/dist/run-alchemy-pANK8XNX-BH1wC0r6.mjs.map +0 -1
  53. package/dist/run-alchemy-pANK8XNX-XcCQncKN.mjs +0 -99
  54. package/dist/run-alchemy-pANK8XNX-XcCQncKN.mjs.map +0 -1
  55. package/dist/shared-BTnATsqm-BH4axbJg.mjs +0 -158
  56. package/dist/shared-BTnATsqm-BH4axbJg.mjs.map +0 -1
package/dist/testing.mjs CHANGED
@@ -1,9 +1,12 @@
1
- import { i as CliStructuredError, n as ok, r as okVoid, t as notOk } from "./result-sR7PBi61.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";
2
3
  //#region ../../0-framework/3-tooling/cli/dist/testing.mjs
3
4
  /**
4
- * The published control-API double (`@prisma/composer/testing`): the four
5
- * control operations with their real signatures and Result shapes, backed by
6
- * 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.
7
10
  *
8
11
  * Hosts that mount composer's command family — prisma-cli above all — test
9
12
  * against this instead of the real operations, so their suites never spawn a
@@ -12,8 +15,7 @@ import { i as CliStructuredError, n as ok, r as okVoid, t as notOk } from "./res
12
15
  * defined as `typeof deployWithDeps` (etc.) of the REAL operations, and the
13
16
  * double is declared against it, so a drift in any real signature fails
14
17
  * `tsc --noEmit` right here. Every import of implementation modules is
15
- * type-only and erases
16
- * 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
17
19
  * control implementation, which scripts/check-family-static-graph.mjs proves
18
20
  * against the packed tarball.
19
21
  */
@@ -39,13 +41,6 @@ function devSessionDouble(input, endpoints) {
39
41
  }
40
42
  };
41
43
  }
42
- async function* replayLines(lines, address, signal) {
43
- for (const line of lines) {
44
- if (signal?.aborted === true) return;
45
- if (address !== void 0 && line.service !== address) continue;
46
- yield line;
47
- }
48
- }
49
44
  /**
50
45
  * Runs the caller's converge adapter, when it supplied one, against a
51
46
  * synthetic invocation — no alchemy bin is resolved and no real child is
@@ -58,19 +53,19 @@ async function* replayLines(lines, address, signal) {
58
53
  * behind it — is genuinely exercised. Returns undefined when no adapter was
59
54
  * injected, leaving the fixture result untouched.
60
55
  */
61
- async function runConverge(action, deps, cwd) {
56
+ async function runConverge(deps, cwd) {
62
57
  if (deps.alchemy === void 0) return void 0;
63
58
  const stackFilePath = ".prisma-composer/alchemy.run.ts";
64
- const reproduceCommand = `alchemy ${action} ${stackFilePath} --yes --stage test`;
59
+ const reproduceCommand = `alchemy deploy ${stackFilePath} --yes --stage test`;
65
60
  const workingDirectory = cwd ?? ".";
66
61
  const outcome = await deps.alchemy({
67
- action,
62
+ action: "deploy",
68
63
  stackFileRelativePath: stackFilePath,
69
64
  cwd: workingDirectory,
70
65
  stage: "test",
71
66
  env: {}
72
67
  });
73
- 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: {
74
69
  signal: outcome.signal,
75
70
  diagnostics: {
76
71
  exitCode: void 0,
@@ -82,7 +77,7 @@ async function runConverge(action, deps, cwd) {
82
77
  } }));
83
78
  const status = outcome.exitCode ?? 1;
84
79
  if (status === 0) return void 0;
85
- 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: {
86
81
  exitCode: status,
87
82
  diagnostics: {
88
83
  exitCode: status,
@@ -92,22 +87,16 @@ async function runConverge(action, deps, cwd) {
92
87
  }
93
88
  } }));
94
89
  }
95
- function createControlDouble(fixtures = {}) {
90
+ function createOperationsDouble(fixtures = {}) {
96
91
  const deployCalls = [];
97
- const destroyCalls = [];
98
92
  const devCalls = [];
99
- const logCalls = [];
100
93
  const deps = {
101
94
  deploy: [],
102
- destroy: [],
103
- dev: [],
104
- log: []
95
+ dev: []
105
96
  };
106
97
  const calls = {
107
98
  deploy: deployCalls,
108
- destroy: destroyCalls,
109
99
  dev: devCalls,
110
- log: logCalls,
111
100
  deps
112
101
  };
113
102
  return {
@@ -115,37 +104,20 @@ function createControlDouble(fixtures = {}) {
115
104
  deploy: async (input, operationDeps) => {
116
105
  calls.deploy.push(input);
117
106
  deps.deploy.push(operationDeps);
118
- const converge = await runConverge("deploy", operationDeps, input.cwd);
107
+ const converge = await runConverge(operationDeps, input.cwd);
119
108
  if (converge !== void 0) return converge;
120
109
  return fixtures.deploy ?? ok({ summary: void 0 });
121
110
  },
122
- destroy: async (input, operationDeps) => {
123
- calls.destroy.push(input);
124
- deps.destroy.push(operationDeps);
125
- for (const event of fixtures.destroyEvents ?? []) input.onEvent?.(event);
126
- const converge = await runConverge("destroy", operationDeps, input.cwd);
127
- if (converge !== void 0) return converge;
128
- return fixtures.destroy ?? okVoid();
129
- },
130
111
  dev: async (input, operationDeps) => {
131
112
  calls.dev.push(input);
132
113
  deps.dev.push(operationDeps);
133
114
  return fixtures.dev ?? ok(devSessionDouble(input, fixtures.devEndpoints ?? []));
134
- },
135
- log: async (input, logDeps) => {
136
- calls.log.push(input);
137
- deps.log.push(logDeps);
138
- return fixtures.log ?? ok({
139
- appName: fixtures.logAppName ?? "app",
140
- services: fixtures.logServices ?? [],
141
- lines: replayLines(fixtures.logLines ?? [], input.address, input.signal)
142
- });
143
115
  }
144
116
  },
145
117
  calls
146
118
  };
147
119
  }
148
120
  //#endregion
149
- export { createControlDouble };
121
+ export { createOperationsDouble, renderDevStackFile };
150
122
 
151
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 { 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 };\n\n//# sourceMappingURL=testing.mjs.map"],"mappings":"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"}
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",
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,20 +13,19 @@
16
13
  "src"
17
14
  ],
18
15
  "dependencies": {
19
- "@prisma/composer": "0.25.0",
16
+ "@prisma/composer": "0.26.0-dev.1",
20
17
  "alchemy": "2.0.0-beta.78",
21
- "c12": "^3.3.4",
22
18
  "cross-spawn": "^7.0.6",
23
19
  "effect": "4.0.0-rc.115",
24
20
  "esbuild": "^0.28.1"
25
21
  },
26
22
  "peerDependencies": {
27
- "@prisma/cli-engine": "0.6.1"
23
+ "@prisma/cli-engine": "0.6.2"
28
24
  },
29
25
  "devDependencies": {
30
- "@internal/cli": "0.25.0",
31
- "@internal/tsdown-config": "0.25.0",
32
- "@prisma/cli-engine": "0.6.1",
26
+ "@internal/cli": "0.26.0-dev.1",
27
+ "@internal/tsdown-config": "0.26.0-dev.1",
28
+ "@prisma/cli-engine": "0.6.2",
33
29
  "@types/node": "^26.0.1",
34
30
  "tsdown": "^0.22.7",
35
31
  "typescript": "^6.0.3"
@@ -1,6 +1,8 @@
1
1
  /**
2
- * Public surface (the `./testing` subpath): `createControlDouble`, the
3
- * fixture-backed double of the control API, for hosts that test how they
4
- * mount the command family without running real deploys.
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
+ * mount the command family without running real deploys; and
5
+ * `renderDevStackFile`, the dev stack file `dev` writes, for tests that drive
6
+ * Alchemy directly.
5
7
  */
6
8
  export * from '@internal/cli/testing';