@prisma/composer 0.6.0-dev.18 → 0.6.0-dev.19
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-aIrriqVU-D6lJHzh2.d.mts → app-config-aIrriqVU-Dpj1RqnY.d.mts} +3 -2
- package/dist/app-config-aIrriqVU-Dpj1RqnY.d.mts.map +1 -0
- package/dist/config-BeBRB-6m.d.mts +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/control.d.mts +219 -3
- package/dist/control.d.mts.map +1 -0
- package/dist/control.mjs +69 -1
- package/dist/control.mjs.map +1 -0
- package/dist/deploy-BeBRB-6m.d.mts +1 -0
- package/dist/deploy.d.mts +2 -2
- package/dist/deploy.mjs +1 -1
- package/dist/{dist-C0dNEgS-.mjs → dist-C5rZnr4n.mjs} +2 -2
- package/dist/{dist-C0dNEgS-.mjs.map → dist-C5rZnr4n.mjs.map} +1 -1
- package/dist/{errors-DkXcnjPx.mjs → errors-0e8IVwzi.mjs} +2 -3
- package/dist/{errors-DkXcnjPx.mjs.map → errors-0e8IVwzi.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-DfVJUICu-AMM8CwgV.mjs → execute-deploy-destroy-DfVJUICu-Dbgn1GR_.mjs} +5 -6
- package/dist/{execute-deploy-destroy-DfVJUICu-AMM8CwgV.mjs.map → execute-deploy-destroy-DfVJUICu-Dbgn1GR_.mjs.map} +1 -1
- package/dist/{execute-dev-BMTFWfFc-BoKbcFVF.mjs → execute-dev-BMTFWfFc-CGDFqR4w.mjs} +6 -7
- package/dist/{execute-dev-BMTFWfFc-BoKbcFVF.mjs.map → execute-dev-BMTFWfFc-CGDFqR4w.mjs.map} +1 -1
- package/dist/{execute-log-Cay9hlKW-B0tmRtrY.mjs → execute-log-Cay9hlKW-ChlIv192.mjs} +5 -6
- package/dist/{execute-log-Cay9hlKW-DrMeVOXq.mjs.map → execute-log-Cay9hlKW-ChlIv192.mjs.map} +1 -1
- package/dist/{graph-BJgUfGB0-7fmubS_y.mjs → graph-BJgUfGB0-kvgFzT4q.mjs} +2 -2
- package/dist/{graph-BJgUfGB0-7fmubS_y.mjs.map → graph-BJgUfGB0-kvgFzT4q.mjs.map} +1 -1
- package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts +18 -0
- package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts.map +1 -0
- package/dist/{graph-DqklX5Sf-CdNH3lA7.d.mts → graph-types-N6brq1zY-1VMNwtkJ.d.mts} +2 -17
- package/dist/graph-types-N6brq1zY-1VMNwtkJ.d.mts.map +1 -0
- package/dist/{index-DuF5iI3i.d.mts → index-DryPyF9U.d.mts} +3 -2
- package/dist/index-DryPyF9U.d.mts.map +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +2 -2
- package/dist/{local-target-D3u_wuNF.mjs → local-target-DnA2E8IN.mjs} +2 -2
- package/dist/{local-target-D3u_wuNF.mjs.map → local-target-DnA2E8IN.mjs.map} +1 -1
- package/dist/local-target.d.mts +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-BfUbLXwr.d.mts → nextjs-DLyeRR7M-DZODs9tk.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-BfUbLXwr.d.mts.map → nextjs-DLyeRR7M-DZODs9tk.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/{pipeline-AoW8zq4I-DM74ygtH.mjs → pipeline-AoW8zq4I-CUon5KZH.mjs} +5 -5
- package/dist/{pipeline-AoW8zq4I-DM74ygtH.mjs.map → pipeline-AoW8zq4I-CUon5KZH.mjs.map} +1 -1
- package/dist/report.d.mts +2 -2
- package/dist/{log-DfT2hHqi-CDp9nfI5.mjs → result-CY_TB7bn.mjs} +84 -63
- package/dist/result-CY_TB7bn.mjs.map +1 -0
- package/dist/{run-alchemy-D44OZlyB-DA7s331N.mjs → run-alchemy-D44OZlyB-gVq_0gf4.mjs} +3 -3
- package/dist/{run-alchemy-D44OZlyB-DA7s331N.mjs.map → run-alchemy-D44OZlyB-gVq_0gf4.mjs.map} +1 -1
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/testing.d.mts +2 -54
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +1 -150
- package/dist/testing.mjs.map +1 -1
- package/package.json +11 -16
- package/src/exports/testing.ts +5 -1
- package/dist/app-config-aIrriqVU-D6lJHzh2.d.mts.map +0 -1
- package/dist/bin.mjs +0 -1344
- package/dist/bin.mjs.map +0 -1
- package/dist/config-CL7Jbve2.d.mts +0 -1
- package/dist/container-transport-DKmKg5JQ-CoY4XPma.mjs +0 -30
- package/dist/container-transport-DKmKg5JQ-CoY4XPma.mjs.map +0 -1
- package/dist/deploy-CL7Jbve2.d.mts +0 -1
- package/dist/execute-deploy-destroy-DfVJUICu-quUQ08T8.mjs +0 -316
- package/dist/execute-deploy-destroy-DfVJUICu-quUQ08T8.mjs.map +0 -1
- package/dist/execute-dev-BMTFWfFc-B1whS-Rr.mjs +0 -2011
- package/dist/execute-dev-BMTFWfFc-B1whS-Rr.mjs.map +0 -1
- package/dist/execute-log-Cay9hlKW-B0tmRtrY.mjs.map +0 -1
- package/dist/execute-log-Cay9hlKW-DrMeVOXq.mjs +0 -157
- package/dist/family-DkH0si4D-Uov_MuHV.d.mts +0 -27
- package/dist/family-DkH0si4D-Uov_MuHV.d.mts.map +0 -1
- package/dist/family.d.mts +0 -53
- package/dist/family.d.mts.map +0 -1
- package/dist/family.mjs +0 -1226
- package/dist/family.mjs.map +0 -1
- package/dist/graph-DqklX5Sf-CdNH3lA7.d.mts.map +0 -1
- package/dist/index-DuF5iI3i.d.mts.map +0 -1
- package/dist/local-target-H0IWu_FM.mjs +0 -68
- package/dist/local-target-H0IWu_FM.mjs.map +0 -1
- package/dist/log-DRnnWupy-9jbzL64M.d.mts +0 -324
- package/dist/log-DRnnWupy-9jbzL64M.d.mts.map +0 -1
- package/dist/log-DfT2hHqi-CDp9nfI5.mjs.map +0 -1
- package/dist/pipeline-AoW8zq4I-C6Qe0VaZ.mjs +0 -976
- package/dist/pipeline-AoW8zq4I-C6Qe0VaZ.mjs.map +0 -1
- package/dist/result-B4XjxVK6.mjs +0 -384
- package/dist/result-B4XjxVK6.mjs.map +0 -1
- package/dist/result-wonf1deB.mjs +0 -92
- package/dist/result-wonf1deB.mjs.map +0 -1
- package/dist/run-alchemy-D44OZlyB-DeDTFsB6.mjs +0 -93
- package/dist/run-alchemy-D44OZlyB-DeDTFsB6.mjs.map +0 -1
- package/src/exports/family.ts +0 -14
package/dist/testing.mjs
CHANGED
|
@@ -1,153 +1,4 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
-
import { t as CliStructuredError } from "./errors-DkXcnjPx.mjs";
|
|
3
|
-
import { n as ok, r as okVoid, t as notOk } from "./result-wonf1deB.mjs";
|
|
4
|
-
//#region ../../0-framework/3-tooling/cli/dist/testing.mjs
|
|
5
|
-
/**
|
|
6
|
-
* The published control-API double (`@prisma/composer/testing`): the four
|
|
7
|
-
* control operations with their real signatures and Result shapes, backed by
|
|
8
|
-
* fixtures instead of alchemy, containers, or a network.
|
|
9
|
-
*
|
|
10
|
-
* Hosts that mount composer's command family — prisma-cli above all — test
|
|
11
|
-
* against this instead of the real operations, so their suites never spawn a
|
|
12
|
-
* converge and their typecheck never needs the alchemy/effect constellation.
|
|
13
|
-
* The conformance guarantee is carried by the types: `ComposerOperations` is
|
|
14
|
-
* defined as `typeof deployWithDeps` (etc.) of the REAL operations, and the
|
|
15
|
-
* double is declared against it, so a drift in any real signature fails
|
|
16
|
-
* `tsc --noEmit` right here. Every import of implementation modules is
|
|
17
|
-
* type-only and erases
|
|
18
|
-
* at build — the built `testing` chunk must contain no path to the real
|
|
19
|
-
* control implementation, which scripts/check-family-static-graph.mjs proves
|
|
20
|
-
* against the packed tarball.
|
|
21
|
-
*/
|
|
22
|
-
function devSessionDouble(input, endpoints) {
|
|
23
|
-
let resolveClosed;
|
|
24
|
-
const closed = new Promise((resolve) => {
|
|
25
|
-
resolveClosed = resolve;
|
|
26
|
-
});
|
|
27
|
-
let stopped = false;
|
|
28
|
-
input.onEvent?.({
|
|
29
|
-
kind: "ready",
|
|
30
|
-
endpoints
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
endpoints,
|
|
34
|
-
closed,
|
|
35
|
-
stop: async () => {
|
|
36
|
-
if (stopped) return;
|
|
37
|
-
stopped = true;
|
|
38
|
-
input.onEvent?.({ kind: "stopping" });
|
|
39
|
-
input.onEvent?.({ kind: "stopped" });
|
|
40
|
-
resolveClosed();
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
async function* replayLines(lines, address, signal) {
|
|
45
|
-
for (const line of lines) {
|
|
46
|
-
if (signal?.aborted === true) return;
|
|
47
|
-
if (address !== void 0 && line.service !== address) continue;
|
|
48
|
-
yield line;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Runs the caller's converge adapter, when it supplied one, against a
|
|
53
|
-
* synthetic invocation — no alchemy bin is resolved and no real child is
|
|
54
|
-
* started; the adapter decides what the child does.
|
|
55
|
-
*
|
|
56
|
-
* This is what makes a host's tests cover the settlement rules rather than
|
|
57
|
-
* just the grammar: a scripted fake child that exits non-zero, or is killed
|
|
58
|
-
* by a signal, produces the same failure shape the real executor produces, so
|
|
59
|
-
* the handler's settlement — and the engine's own child-status settlement
|
|
60
|
-
* behind it — is genuinely exercised. Returns undefined when no adapter was
|
|
61
|
-
* injected, leaving the fixture result untouched.
|
|
62
|
-
*/
|
|
63
|
-
async function runConverge(action, deps, cwd) {
|
|
64
|
-
if (deps.alchemy === void 0) return void 0;
|
|
65
|
-
const stackFilePath = ".prisma-composer/alchemy.run.ts";
|
|
66
|
-
const reproduceCommand = `alchemy ${action} ${stackFilePath} --yes --stage test`;
|
|
67
|
-
const workingDirectory = cwd ?? ".";
|
|
68
|
-
const outcome = await deps.alchemy({
|
|
69
|
-
action,
|
|
70
|
-
stackFileRelativePath: stackFilePath,
|
|
71
|
-
cwd: workingDirectory,
|
|
72
|
-
stage: "test",
|
|
73
|
-
env: {}
|
|
74
|
-
});
|
|
75
|
-
if (outcome.signal !== null) return notOk(new CliStructuredError("DEPLOY.ENGINE_FAILED", `alchemy ${action} was interrupted by ${outcome.signal}.`, { meta: {
|
|
76
|
-
signal: outcome.signal,
|
|
77
|
-
diagnostics: {
|
|
78
|
-
exitCode: void 0,
|
|
79
|
-
signal: outcome.signal,
|
|
80
|
-
stackFilePath,
|
|
81
|
-
reproduceCommand,
|
|
82
|
-
cwd: workingDirectory
|
|
83
|
-
}
|
|
84
|
-
} }));
|
|
85
|
-
const status = outcome.exitCode ?? 1;
|
|
86
|
-
if (status === 0) return void 0;
|
|
87
|
-
return notOk(new CliStructuredError("DEPLOY.ENGINE_FAILED", `alchemy ${action} exited with status ${status}.`, { meta: {
|
|
88
|
-
exitCode: status,
|
|
89
|
-
diagnostics: {
|
|
90
|
-
exitCode: status,
|
|
91
|
-
stackFilePath,
|
|
92
|
-
reproduceCommand,
|
|
93
|
-
cwd: workingDirectory
|
|
94
|
-
}
|
|
95
|
-
} }));
|
|
96
|
-
}
|
|
97
|
-
function createControlDouble(fixtures = {}) {
|
|
98
|
-
const deployCalls = [];
|
|
99
|
-
const destroyCalls = [];
|
|
100
|
-
const devCalls = [];
|
|
101
|
-
const logCalls = [];
|
|
102
|
-
const deps = {
|
|
103
|
-
deploy: [],
|
|
104
|
-
destroy: [],
|
|
105
|
-
dev: [],
|
|
106
|
-
log: []
|
|
107
|
-
};
|
|
108
|
-
const calls = {
|
|
109
|
-
deploy: deployCalls,
|
|
110
|
-
destroy: destroyCalls,
|
|
111
|
-
dev: devCalls,
|
|
112
|
-
log: logCalls,
|
|
113
|
-
deps
|
|
114
|
-
};
|
|
115
|
-
return {
|
|
116
|
-
operations: {
|
|
117
|
-
deploy: async (input, operationDeps) => {
|
|
118
|
-
calls.deploy.push(input);
|
|
119
|
-
deps.deploy.push(operationDeps);
|
|
120
|
-
const converge = await runConverge("deploy", operationDeps, input.cwd);
|
|
121
|
-
if (converge !== void 0) return converge;
|
|
122
|
-
return fixtures.deploy ?? ok({ summary: void 0 });
|
|
123
|
-
},
|
|
124
|
-
destroy: async (input, operationDeps) => {
|
|
125
|
-
calls.destroy.push(input);
|
|
126
|
-
deps.destroy.push(operationDeps);
|
|
127
|
-
for (const event of fixtures.destroyEvents ?? []) input.onEvent?.(event);
|
|
128
|
-
const converge = await runConverge("destroy", operationDeps, input.cwd);
|
|
129
|
-
if (converge !== void 0) return converge;
|
|
130
|
-
return fixtures.destroy ?? okVoid();
|
|
131
|
-
},
|
|
132
|
-
dev: async (input, operationDeps) => {
|
|
133
|
-
calls.dev.push(input);
|
|
134
|
-
deps.dev.push(operationDeps);
|
|
135
|
-
return fixtures.dev ?? ok(devSessionDouble(input, fixtures.devEndpoints ?? []));
|
|
136
|
-
},
|
|
137
|
-
log: async (input, logDeps) => {
|
|
138
|
-
calls.log.push(input);
|
|
139
|
-
deps.log.push(logDeps);
|
|
140
|
-
return fixtures.log ?? ok({
|
|
141
|
-
appName: fixtures.logAppName ?? "app",
|
|
142
|
-
services: fixtures.logServices ?? [],
|
|
143
|
-
lines: replayLines(fixtures.logLines ?? [], input.address, input.signal)
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
calls
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
2
|
//#region ../../0-framework/1-core/core/dist/testing.mjs
|
|
152
3
|
/**
|
|
153
4
|
* The unit-test seam (testing.md § Unit): `mockService` replaces a service
|
|
@@ -181,6 +32,6 @@ function mockService(service, overrides) {
|
|
|
181
32
|
});
|
|
182
33
|
}
|
|
183
34
|
//#endregion
|
|
184
|
-
export {
|
|
35
|
+
export { mockService };
|
|
185
36
|
|
|
186
37
|
//# sourceMappingURL=testing.mjs.map
|
package/dist/testing.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/testing.mjs","../../../0-framework/1-core/core/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","import { blindCast } from \"@internal/foundation/casts\";\n//#region src/testing.ts\n/**\n* The unit-test seam (testing.md § Unit): `mockService` replaces a service\n* node's `load()` and `input()` output so any code that pulls dependencies or\n* input through them — a page, a server action, a helper — runs against typed\n* doubles with no server and no environment. Target-agnostic: every service\n* node has `load()`/`input()`. It does no module mocking; wiring the\n* substitution into a test runner (`vi.mock`, `mock.module`) stays in the test.\n* The integration seam (`bootstrapService`) is target-specific and lives in the\n* target's own testing entry (e.g. `@prisma/composer-prisma-cloud/testing`).\n*/\n/**\n* Returns a service node whose `load()` yields the dependency doubles and\n* `input()` the given input object — everything else about the node (its\n* deps, input schema, build, expose) is unchanged. The input double is NOT\n* validated: the test supplies the typed, already-validated shape directly.\n* `run()` is not meaningful on a mock (there is no boot, no environment) and\n* throws if called.\n*/\nfunction mockService(service, overrides) {\n\tconst entries = Object.entries(overrides);\n\tconst deps = blindCast(Object.fromEntries(entries.filter(([name]) => name in service.inputs)));\n\tconst input = blindCast(entries.find(([name]) => name === \"input\")?.[1]);\n\treturn Object.freeze({\n\t\t...service,\n\t\trun() {\n\t\t\tthrow new Error(`mockService(): \"${service.name}\" is a load()/input()-only mock — it has no run() (no boot, no environment).`);\n\t\t},\n\t\tload: () => deps,\n\t\tinput: () => input\n\t});\n}\n//#endregion\nexport { mockService };\n\n//# sourceMappingURL=testing.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,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;AACA,gBAAgB,YAAY,OAAO,SAAS,QAAQ;CACnD,KAAK,MAAM,QAAQ,OAAO;EACzB,IAAI,QAAQ,YAAY,MAAM;EAC9B,IAAI,YAAY,KAAK,KAAK,KAAK,YAAY,SAAS;EACpD,MAAM;CACP;AACD;;;;;;;;;;;;;AAaA,eAAe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AAa;CACd,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"testing.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/testing.mjs"],"sourcesContent":["import { blindCast } from \"@internal/foundation/casts\";\n//#region src/testing.ts\n/**\n* The unit-test seam (testing.md § Unit): `mockService` replaces a service\n* node's `load()` and `input()` output so any code that pulls dependencies or\n* input through them — a page, a server action, a helper — runs against typed\n* doubles with no server and no environment. Target-agnostic: every service\n* node has `load()`/`input()`. It does no module mocking; wiring the\n* substitution into a test runner (`vi.mock`, `mock.module`) stays in the test.\n* The integration seam (`bootstrapService`) is target-specific and lives in the\n* target's own testing entry (e.g. `@prisma/composer-prisma-cloud/testing`).\n*/\n/**\n* Returns a service node whose `load()` yields the dependency doubles and\n* `input()` the given input object — everything else about the node (its\n* deps, input schema, build, expose) is unchanged. The input double is NOT\n* validated: the test supplies the typed, already-validated shape directly.\n* `run()` is not meaningful on a mock (there is no boot, no environment) and\n* throws if called.\n*/\nfunction mockService(service, overrides) {\n\tconst entries = Object.entries(overrides);\n\tconst deps = blindCast(Object.fromEntries(entries.filter(([name]) => name in service.inputs)));\n\tconst input = blindCast(entries.find(([name]) => name === \"input\")?.[1]);\n\treturn Object.freeze({\n\t\t...service,\n\t\trun() {\n\t\t\tthrow new Error(`mockService(): \"${service.name}\" is a load()/input()-only mock — it has no run() (no boot, no environment).`);\n\t\t},\n\t\tload: () => deps,\n\t\tinput: () => input\n\t});\n}\n//#endregion\nexport { mockService };\n\n//# sourceMappingURL=testing.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,YAAY,SAAS,WAAW;CACxC,MAAM,UAAU,OAAO,QAAQ,SAAS;CACxC,MAAM,OAAO,UAAU,OAAO,YAAY,QAAQ,QAAQ,CAAC,UAAU,QAAQ,QAAQ,MAAM,CAAC,CAAC;CAC7F,MAAM,QAAQ,UAAU,QAAQ,MAAM,CAAC,UAAU,SAAS,OAAO,CAAC,GAAG,EAAE;CACvE,OAAO,OAAO,OAAO;EACpB,GAAG;EACH,MAAM;GACL,MAAM,IAAI,MAAM,mBAAmB,QAAQ,KAAK,6EAA6E;EAC9H;EACA,YAAY;EACZ,aAAa;CACd,CAAC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/composer",
|
|
3
|
-
"version": "0.6.0-dev.
|
|
3
|
+
"version": "0.6.0-dev.19",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Prisma Composer — build a Prisma App by composing Modules. Core authoring, deploy pipeline,
|
|
6
|
-
"bin": {
|
|
7
|
-
"prisma-composer": "./dist/bin.mjs"
|
|
8
|
-
},
|
|
5
|
+
"description": "Prisma Composer — build a Prisma App by composing Modules. Core authoring, deploy pipeline, and the service-rpc/node/nextjs authoring surfaces. The `prisma-composer` CLI lives in @prisma/composer-cli.",
|
|
9
6
|
"exports": {
|
|
10
7
|
".": "./dist/index.mjs",
|
|
11
8
|
"./config": "./dist/config.mjs",
|
|
12
9
|
"./control": "./dist/control.mjs",
|
|
13
|
-
"./family": "./dist/family.mjs",
|
|
14
10
|
"./deploy": "./dist/deploy.mjs",
|
|
15
11
|
"./local-target": "./dist/local-target.mjs",
|
|
16
12
|
"./report": "./dist/report.mjs",
|
|
@@ -30,7 +26,6 @@
|
|
|
30
26
|
"src"
|
|
31
27
|
],
|
|
32
28
|
"dependencies": {
|
|
33
|
-
"@prisma/cli-engine": "0.0.9",
|
|
34
29
|
"@standard-schema/spec": "^1.1.0",
|
|
35
30
|
"alchemy": "2.0.0-beta.67",
|
|
36
31
|
"arktype": "^2.2.3",
|
|
@@ -41,15 +36,15 @@
|
|
|
41
36
|
},
|
|
42
37
|
"devDependencies": {
|
|
43
38
|
"@effect/vitest": "4.0.0-beta.103",
|
|
44
|
-
"@internal/assemble": "0.6.0-dev.
|
|
45
|
-
"@internal/cli": "0.6.0-dev.
|
|
46
|
-
"@internal/core": "0.6.0-dev.
|
|
47
|
-
"@internal/foundation": "0.6.0-dev.
|
|
48
|
-
"@internal/lowering": "0.6.0-dev.
|
|
49
|
-
"@internal/nextjs": "0.6.0-dev.
|
|
50
|
-
"@internal/node": "0.6.0-dev.
|
|
51
|
-
"@internal/service-rpc": "0.6.0-dev.
|
|
52
|
-
"@internal/tsdown-config": "0.6.0-dev.
|
|
39
|
+
"@internal/assemble": "0.6.0-dev.19",
|
|
40
|
+
"@internal/cli": "0.6.0-dev.19",
|
|
41
|
+
"@internal/core": "0.6.0-dev.19",
|
|
42
|
+
"@internal/foundation": "0.6.0-dev.19",
|
|
43
|
+
"@internal/lowering": "0.6.0-dev.19",
|
|
44
|
+
"@internal/nextjs": "0.6.0-dev.19",
|
|
45
|
+
"@internal/node": "0.6.0-dev.19",
|
|
46
|
+
"@internal/service-rpc": "0.6.0-dev.19",
|
|
47
|
+
"@internal/tsdown-config": "0.6.0-dev.19",
|
|
53
48
|
"@types/node": "^26.0.1",
|
|
54
49
|
"tsdown": "^0.22.7",
|
|
55
50
|
"typescript": "^6.0.3"
|
package/src/exports/testing.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Public surface (the `./testing` subpath): `mockService`, the application
|
|
3
|
+
* unit-test seam for composed services. The command family's control double
|
|
4
|
+
* lives in `@prisma/composer-cli/testing`.
|
|
5
|
+
*/
|
|
2
6
|
export * from '@internal/core/testing';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-config-aIrriqVU-D6lJHzh2.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-aIrriqVU.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;UAmBU;;WAEC;;WAEA;;;;;;;UAOD;WACC,OAAO;;WAEP;;EAET;;;;;;;;;;;;;;;UAeQ,qBAAqB;;WAEpB;;WAEA,SAAS;;;;;;;;;;;;UAYV,oBAAoB,UAAU,oBAAoB,mBAAmB;;EAE7E,OAAO,OAAO,sBAA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