@prisma/composer 0.36.0 → 0.37.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.
- package/dist/{app-config-DNnd7Zu--BQ1vHaMK.d.mts → app-config-Bf_y5R7o-BEZAnKqM.d.mts} +46 -6
- package/dist/app-config-Bf_y5R7o-BEZAnKqM.d.mts.map +1 -0
- package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs +221 -0
- package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +1 -0
- package/dist/arktype.d.mts +20 -6
- package/dist/arktype.d.mts.map +1 -1
- package/dist/arktype.mjs +45 -6
- package/dist/arktype.mjs.map +1 -1
- package/dist/config-CDkq5Ayl.d.mts +1 -0
- package/dist/config-adapters-DG-uhGfv-Bt1M9f8b.mjs +47 -0
- package/dist/config-adapters-DG-uhGfv-Bt1M9f8b.mjs.map +1 -0
- package/dist/config.d.mts +16 -3
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +2 -1
- package/dist/control.d.mts +6 -174
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +4 -4
- package/dist/control.mjs.map +1 -1
- package/dist/deploy-CmiYExQA.mjs +373 -0
- package/dist/deploy-CmiYExQA.mjs.map +1 -0
- package/dist/deploy-DQyaIoNe.d.mts +2 -0
- package/dist/deploy.d.mts +4 -3
- package/dist/deploy.mjs +3 -364
- package/dist/{deployment-summary-CDHdLtnO-DrE7GsHq.mjs → deployment-summary-BiBkPWlB-CyC2pudN.mjs} +10 -23
- package/dist/deployment-summary-BiBkPWlB-CyC2pudN.mjs.map +1 -0
- package/dist/{deployment-summary-p88NV5m5-SaPCCX2C.d.mts → deployment-summary-p88NV5m5-BJOosgmI.d.mts} +3 -3
- package/dist/{deployment-summary-p88NV5m5-SaPCCX2C.d.mts.map → deployment-summary-p88NV5m5-BJOosgmI.d.mts.map} +1 -1
- package/dist/{secret-DoWGmN7m-DO5Brq1Y.mjs → describe-kind-Cpm_euxo-CkhlGJUL.mjs} +29 -2
- package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +1 -0
- package/dist/{dev-current-Brb4qugP-CG0_96FZ.mjs → dev-current-D0Kn6Mf4-DDWYu-3j.mjs} +5 -5
- package/dist/{dev-current-Brb4qugP-CG0_96FZ.mjs.map → dev-current-D0Kn6Mf4-DDWYu-3j.mjs.map} +1 -1
- package/dist/{dev-environment-name-6eEr5PW8-CGk1ijP7.mjs → dev-environment-name-6eEr5PW8-BwusWVKi.mjs} +3 -3
- package/dist/{dev-environment-name-6eEr5PW8-CGk1ijP7.mjs.map → dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map} +1 -1
- package/dist/{dist-DiYPSVUE.mjs → dist-BtzrklYG.mjs} +2 -2
- package/dist/{dist-DiYPSVUE.mjs.map → dist-BtzrklYG.mjs.map} +1 -1
- package/dist/{dist-CZ_yEZ7F.mjs → dist-C7SnNTD3.mjs} +11 -4
- package/dist/dist-C7SnNTD3.mjs.map +1 -0
- package/dist/errors-0e8IVwzi.mjs.map +1 -1
- package/dist/{execute-deploy-destroy-CNt-xpE7-CYaa3sYk.mjs → execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs} +60 -29
- package/dist/execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs.map +1 -0
- package/dist/{execute-dev-BUk-XWBJ-ZHX5A8cR.mjs → execute-dev-Bl-5Q-Av-DILne6iY.mjs} +99 -44
- package/dist/execute-dev-Bl-5Q-Av-DILne6iY.mjs.map +1 -0
- package/dist/{execute-dev-current-BdEqeKAB-BLUs2eQv.mjs → execute-dev-current-D3USgHJ4-CNQe5ADb.mjs} +6 -6
- package/dist/{execute-dev-current-BdEqeKAB-BLUs2eQv.mjs.map → execute-dev-current-D3USgHJ4-CNQe5ADb.mjs.map} +1 -1
- package/dist/{execute-log-aiHhujIh-C_aXmb6j.mjs → execute-log-Dm3DkQQP-BSjoy6Wd.mjs} +6 -6
- package/dist/{execute-log-aiHhujIh-C_aXmb6j.mjs.map → execute-log-Dm3DkQQP-BSjoy6Wd.mjs.map} +1 -1
- package/dist/{graph-MGOZJdDt-CyI8-9r7.mjs → graph-Bqr7PSGl-BM-M-TlO.mjs} +637 -199
- package/dist/graph-Bqr7PSGl-BM-M-TlO.mjs.map +1 -0
- package/dist/{graph-BzTSXnoQ-BvGVq0bm.d.mts → graph-DI1v3WKX-3g1lTRbh.d.mts} +8 -4
- package/dist/graph-DI1v3WKX-3g1lTRbh.d.mts.map +1 -0
- package/dist/{graph-types-DfsG9Rkg-D_ARjMo7.d.mts → graph-types-DRe9UUOp-C85Yr-sJ.d.mts} +253 -120
- package/dist/graph-types-DRe9UUOp-C85Yr-sJ.d.mts.map +1 -0
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-D89ftK2z.d.mts → index-DWQ6BSgm.d.mts} +3 -3
- package/dist/index-DWQ6BSgm.d.mts.map +1 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +4 -4
- package/dist/internal-app-configuration-file.d.mts +19 -0
- package/dist/internal-app-configuration-file.d.mts.map +1 -0
- package/dist/internal-app-configuration-file.mjs +2 -0
- package/dist/{local-target-DySKw61w.mjs → local-target-Dd8FJEb5.mjs} +5 -3
- package/dist/{local-target-DySKw61w.mjs.map → local-target-Dd8FJEb5.mjs.map} +1 -1
- package/dist/local-target.d.mts +2 -2
- package/dist/local-target.d.mts.map +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-BeiYsLuZ.d.mts → nextjs-DLyeRR7M-RtoHcY1c.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-BeiYsLuZ.d.mts.map → nextjs-DLyeRR7M-RtoHcY1c.d.mts.map} +1 -1
- package/dist/nextjs-control.d.mts +4 -4
- package/dist/nextjs-control.mjs +2 -2
- package/dist/nextjs.d.mts +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node-control.mjs +2 -2
- package/dist/node.d.mts +2 -2
- package/dist/pointer-CyQZZugO-D7k3vibs.d.mts +42 -0
- package/dist/pointer-CyQZZugO-D7k3vibs.d.mts.map +1 -0
- package/dist/redaction-Bf8FvTFH-BTsKD9B5.d.mts +183 -0
- package/dist/redaction-Bf8FvTFH-BTsKD9B5.d.mts.map +1 -0
- package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs +295 -0
- package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs.map +1 -0
- package/dist/report.d.mts +3 -3
- package/dist/report.mjs +1 -1
- package/dist/report.mjs.map +1 -1
- package/dist/{run-alchemy-Dl_MWw4g-BZaLckHp.mjs → run-alchemy-OS_ix5g0-DCvUYZ7T.mjs} +30 -12
- package/dist/run-alchemy-OS_ix5g0-DCvUYZ7T.mjs.map +1 -0
- package/dist/{run-report-CmBz2-xc-S50d4g5V.mjs → run-report-CmBz2-xc-Cc8rV1CX.mjs} +2 -2
- package/dist/{run-report-CmBz2-xc-S50d4g5V.mjs.map → run-report-CmBz2-xc-Cc8rV1CX.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 -2
- package/dist/testing.d.mts.map +1 -1
- package/dist/{validate-environment-CEhUSEg2-DmAtiQhe.mjs → validate-environment-D_dECxgO-B-gqpVEf.mjs} +113 -13
- package/dist/validate-environment-D_dECxgO-B-gqpVEf.mjs.map +1 -0
- package/dist/zod.d.mts +30 -0
- package/dist/zod.d.mts.map +1 -0
- package/dist/zod.mjs +39 -0
- package/dist/zod.mjs.map +1 -0
- package/package.json +31 -18
- package/skills/prisma-composer-core-concepts/SKILL.md +49 -23
- package/src/exports/config.ts +1 -0
- package/src/exports/internal-app-configuration-file.ts +1 -0
- package/src/exports/zod.ts +1 -0
- package/dist/app-config-DNnd7Zu--BQ1vHaMK.d.mts.map +0 -1
- package/dist/config-RKyUvtGC.d.mts +0 -1
- package/dist/deploy-RKyUvtGC.d.mts +0 -1
- package/dist/deploy.mjs.map +0 -1
- package/dist/deployment-summary-CDHdLtnO-DrE7GsHq.mjs.map +0 -1
- package/dist/dist-CZ_yEZ7F.mjs.map +0 -1
- package/dist/execute-deploy-destroy-CNt-xpE7-CYaa3sYk.mjs.map +0 -1
- package/dist/execute-dev-BUk-XWBJ-ZHX5A8cR.mjs.map +0 -1
- package/dist/graph-BzTSXnoQ-BvGVq0bm.d.mts.map +0 -1
- package/dist/graph-MGOZJdDt-CyI8-9r7.mjs.map +0 -1
- package/dist/graph-types-DfsG9Rkg-D_ARjMo7.d.mts.map +0 -1
- package/dist/index-D89ftK2z.d.mts.map +0 -1
- package/dist/run-alchemy-Dl_MWw4g-BZaLckHp.mjs.map +0 -1
- package/dist/secret-CHOw4LBU-C8yXoC9N.d.mts +0 -25
- package/dist/secret-CHOw4LBU-C8yXoC9N.d.mts.map +0 -1
- package/dist/secret-DoWGmN7m-DO5Brq1Y.mjs.map +0 -1
- package/dist/validate-environment-CEhUSEg2-DmAtiQhe.mjs.map +0 -1
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
+
import { t as describeKind } from "./describe-kind-Cpm_euxo-CkhlGJUL.mjs";
|
|
3
|
+
import { a as assertAppName, b as secretsKeys, c as isNode, t as Load } from "./graph-Bqr7PSGl-BM-M-TlO.mjs";
|
|
4
|
+
import { t as InternalError } from "./internal-error-Dfur7Zqt-D96dWHZK.mjs";
|
|
2
5
|
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
6
|
+
import "./dist-C7SnNTD3.mjs";
|
|
7
|
+
import { n as environmentVariables } from "./config-adapters-DG-uhGfv-Bt1M9f8b.mjs";
|
|
8
|
+
import "./deploy-CmiYExQA.mjs";
|
|
9
|
+
import { l as valuesUnderSecretsKeys, r as credentialLookingValues, t as SecretRedaction } from "./redaction-HnbkSFrK-BXRZ3B33.mjs";
|
|
5
10
|
import * as mod from "node:module";
|
|
11
|
+
import * as path$1 from "node:path";
|
|
6
12
|
import * as fs$1 from "node:fs";
|
|
7
13
|
import { existsSync } from "node:fs";
|
|
8
|
-
import * as path$1 from "node:path";
|
|
9
14
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
10
15
|
import { spawnSync } from "node:child_process";
|
|
11
|
-
//#region ../../0-framework/3-tooling/cli/dist/composer-config-
|
|
16
|
+
//#region ../../0-framework/3-tooling/cli/dist/composer-config-DO_iG0iR.mjs
|
|
12
17
|
/**
|
|
13
18
|
* What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.
|
|
14
19
|
* It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.
|
|
@@ -74,7 +79,9 @@ const stateInvalid = {
|
|
|
74
79
|
const SECTION_FIELDS = /* @__PURE__ */ new Set([
|
|
75
80
|
"entry",
|
|
76
81
|
"extensions",
|
|
77
|
-
"state"
|
|
82
|
+
"state",
|
|
83
|
+
"config",
|
|
84
|
+
"secrets"
|
|
78
85
|
]);
|
|
79
86
|
const entryInvalid = {
|
|
80
87
|
code: "CONFIG.FIELD_INVALID",
|
|
@@ -94,7 +101,7 @@ function unknownField(key) {
|
|
|
94
101
|
return {
|
|
95
102
|
code: "CONFIG.FIELD_UNKNOWN",
|
|
96
103
|
summary: `The \`composer\` section has no field \`${key}\`.`,
|
|
97
|
-
fix: key === "composer" ? "Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `entry`, `extensions` and `
|
|
104
|
+
fix: key === "composer" ? "Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `entry`, `extensions`, `state`, `config` and `secrets`." : `Remove \`${key}\`. The section takes only \`entry\`, \`extensions\`, \`state\`, \`config\` and \`secrets\`.`,
|
|
98
105
|
field: key
|
|
99
106
|
};
|
|
100
107
|
}
|
|
@@ -149,6 +156,24 @@ function checkExtensions(value) {
|
|
|
149
156
|
extensions
|
|
150
157
|
};
|
|
151
158
|
}
|
|
159
|
+
function isAdapterList(value) {
|
|
160
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "function");
|
|
161
|
+
}
|
|
162
|
+
function checkAdapters(list, value) {
|
|
163
|
+
if (value === void 0) return [];
|
|
164
|
+
if (!Array.isArray(value)) return [{
|
|
165
|
+
code: "CONFIG.FIELD_INVALID",
|
|
166
|
+
summary: `\`composer.${list}\` must be an array of adapters.`,
|
|
167
|
+
fix: `Set \`${list}\` to a list of adapters, e.g. \`${list}: [dotenv(), environmentVariables()]\`, imported from '@prisma/composer/config'.`,
|
|
168
|
+
field: list
|
|
169
|
+
}];
|
|
170
|
+
return value.flatMap((entry, index) => typeof entry === "function" ? [] : [{
|
|
171
|
+
code: "CONFIG.FIELD_INVALID",
|
|
172
|
+
summary: `\`composer.${list}[${index}]\` must be an adapter: a function that receives the environment and returns its values.`,
|
|
173
|
+
fix: "Put an adapter here, e.g. `dotenv()`.",
|
|
174
|
+
field: `${list}[${index}]`
|
|
175
|
+
}]);
|
|
176
|
+
}
|
|
152
177
|
function checkFields(section) {
|
|
153
178
|
if (Object.hasOwn(section, "configPath")) return {
|
|
154
179
|
ok: false,
|
|
@@ -172,13 +197,18 @@ function checkFields(section) {
|
|
|
172
197
|
const entry = section["entry"];
|
|
173
198
|
const entryValid = entry === void 0 || typeof entry === "string" && entry.length > 0;
|
|
174
199
|
if (!entryValid) findings.push(entryInvalid);
|
|
200
|
+
const config = section["config"];
|
|
201
|
+
const secrets = section["secrets"];
|
|
202
|
+
findings.push(...checkAdapters("config", config), ...checkAdapters("secrets", secrets));
|
|
175
203
|
const [first, ...rest] = findings;
|
|
176
|
-
if (first === void 0 && isStateDescriptor(state) && entryValid) return {
|
|
204
|
+
if (first === void 0 && isStateDescriptor(state) && entryValid && (config === void 0 || isAdapterList(config)) && (secrets === void 0 || isAdapterList(secrets))) return {
|
|
177
205
|
ok: true,
|
|
178
206
|
value: {
|
|
179
207
|
extensions: checked.extensions,
|
|
180
208
|
state,
|
|
181
|
-
...entry === void 0 ? {} : { entry }
|
|
209
|
+
...entry === void 0 ? {} : { entry },
|
|
210
|
+
...config === void 0 ? {} : { config },
|
|
211
|
+
...secrets === void 0 ? {} : { secrets }
|
|
182
212
|
}
|
|
183
213
|
};
|
|
184
214
|
return {
|
|
@@ -322,7 +352,64 @@ async function assembleServices(graph, config, cwd, run, onEvent, options = {})
|
|
|
322
352
|
};
|
|
323
353
|
}
|
|
324
354
|
//#endregion
|
|
325
|
-
//#region ../../0-framework/3-tooling/cli/dist/validate-environment-
|
|
355
|
+
//#region ../../0-framework/3-tooling/cli/dist/validate-environment-D_dECxgO.mjs
|
|
356
|
+
function adapterInvalid(list, index, input, summary, fix) {
|
|
357
|
+
return new CliStructuredError("CONFIG.ADAPTER_INVALID", summary, {
|
|
358
|
+
fix,
|
|
359
|
+
where: { path: input.configFile },
|
|
360
|
+
meta: { field: `${list}[${index}]` }
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function isValues(value) {
|
|
364
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
365
|
+
}
|
|
366
|
+
function isText(values) {
|
|
367
|
+
return Object.values(values).every((value) => typeof value === "string");
|
|
368
|
+
}
|
|
369
|
+
async function readAdapters(list, adapters, input) {
|
|
370
|
+
const adapterInput = Object.freeze({
|
|
371
|
+
environment: input.environment,
|
|
372
|
+
configDirectory: path$1.dirname(input.configFile)
|
|
373
|
+
});
|
|
374
|
+
const merged = Object.create(null);
|
|
375
|
+
for (const [index, adapter] of adapters.entries()) {
|
|
376
|
+
const field = `composer.${list}[${index}]`;
|
|
377
|
+
let values;
|
|
378
|
+
try {
|
|
379
|
+
values = await adapter(adapterInput);
|
|
380
|
+
} catch (thrown) {
|
|
381
|
+
throw new CliStructuredError("CONFIG.ADAPTER_FAILED", `\`${field}\` failed to read the values for the environment "${input.environment}".`, {
|
|
382
|
+
why: `It threw: ${thrown instanceof Error ? thrown.message : String(thrown)}`,
|
|
383
|
+
fix: `Fix the adapter, or remove it from \`composer.${list}\` in prisma.config.ts.`,
|
|
384
|
+
where: { path: input.configFile },
|
|
385
|
+
meta: { field: `${list}[${index}]` },
|
|
386
|
+
cause: thrown
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
if (typeof values === "function") throw adapterInvalid(list, index, input, `\`${field}\` returned a function, not an object of values.`, "An adapter factory was put in the list instead of the adapter it makes: write `dotenv()`, not `dotenv`.");
|
|
390
|
+
if (!isValues(values)) throw adapterInvalid(list, index, input, `\`${field}\` returned ${describeKind(values)}, not an object of values.`, "Return an object whose keys are the names of the values, e.g. `{ EMAIL_FROM: 'shop@example.com' }`.");
|
|
391
|
+
for (const [key, value] of Object.entries(values)) {
|
|
392
|
+
if (value === void 0) continue;
|
|
393
|
+
if (list === "secrets" && typeof value !== "string") throw adapterInvalid(list, index, input, `\`${field}\` returned ${describeKind(value)} for "${key}", but a secret is text.`, "Return the secret as a string. A platform variable holds text.");
|
|
394
|
+
merged[key] = value;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return Object.freeze(merged);
|
|
398
|
+
}
|
|
399
|
+
/** Calls the section's `config` adapters (default `[environmentVariables()]`) and merges what they return: the app configuration. */
|
|
400
|
+
function readAppConfiguration(section, input) {
|
|
401
|
+
return readAdapters("config", section.config ?? [environmentVariables()], input);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Calls the section's `secrets` adapters (default `[environmentVariables()]`) and merges what they
|
|
405
|
+
* return: the app secrets. Every value must be text. A value is a known secret only once the graph
|
|
406
|
+
* names it, so this adds none.
|
|
407
|
+
*/
|
|
408
|
+
async function readAppSecrets(section, input) {
|
|
409
|
+
const merged = await readAdapters("secrets", section.secrets ?? [environmentVariables()], input);
|
|
410
|
+
if (!isText(merged)) throw new InternalError("readAdapters admitted a secret that is not text");
|
|
411
|
+
return merged;
|
|
412
|
+
}
|
|
326
413
|
/**
|
|
327
414
|
* Synchronous Node resolve hook so that entry modules may import relative
|
|
328
415
|
* files using the specifier forms TypeScript accepts by default —
|
|
@@ -432,7 +519,7 @@ function explainJsxLoadError(error, entryPath) {
|
|
|
432
519
|
};
|
|
433
520
|
}
|
|
434
521
|
/**
|
|
435
|
-
* Pipeline step
|
|
522
|
+
* Pipeline step 2 (deploy-cli.md § The pipeline): import the entry module
|
|
436
523
|
* (resolved against cwd) and require its default export to be a node — a
|
|
437
524
|
* service or module, branded by core's factories. Whatever this module exports
|
|
438
525
|
* IS the application; nothing else marks a root (ADR-0003).
|
|
@@ -514,6 +601,7 @@ function validateRegistryCoverage(graph, config) {
|
|
|
514
601
|
* `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines
|
|
515
602
|
* cannot drift.
|
|
516
603
|
*/
|
|
604
|
+
const NO_SECRETS = Object.freeze({});
|
|
517
605
|
function configError(findings, file) {
|
|
518
606
|
const [first] = findings;
|
|
519
607
|
return new CliStructuredError(first.code, first.summary, {
|
|
@@ -590,11 +678,21 @@ async function runPipeline(entry, overrideName, environment, cwd, source, deps =
|
|
|
590
678
|
const entryModule = await loadEntry(resolved.path, cwd, resolved.fix);
|
|
591
679
|
const name = overrideName ?? entryModule.root.name;
|
|
592
680
|
if (name.length === 0) throw new CliStructuredError("COMPOSE.NAME_MISSING", "The root node has no name.", { fix: "Name it at authoring, or pass --name." });
|
|
681
|
+
const redaction = deps.redaction ?? new SecretRedaction(process.env);
|
|
682
|
+
const adapterInput = {
|
|
683
|
+
environment,
|
|
684
|
+
configFile: configSource.file
|
|
685
|
+
};
|
|
686
|
+
const secrets = deps.readSecrets === true ? await readAppSecrets(config, adapterInput) : NO_SECRETS;
|
|
687
|
+
const configuration = await readAppConfiguration(config, adapterInput);
|
|
688
|
+
redaction.addCredentialLookingValues(credentialLookingValues(configuration));
|
|
593
689
|
const graph = Load(entryModule.root, {
|
|
594
690
|
id: name,
|
|
595
|
-
environment: { name: environment }
|
|
691
|
+
environment: { name: environment },
|
|
692
|
+
configuration
|
|
596
693
|
});
|
|
597
694
|
if (graph.root.node.kind !== "module") throw new CliStructuredError("COMPOSE.ROOT_NOT_MODULE", "The deploy root must be a module.", { fix: "Wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); })." });
|
|
695
|
+
redaction.addKnownSecrets(valuesUnderSecretsKeys(configuration, secrets, secretsKeys(graph)));
|
|
598
696
|
validateRegistryCoverage(graph, config);
|
|
599
697
|
deps.onEvent?.({ kind: "loaded" });
|
|
600
698
|
let assembled;
|
|
@@ -609,7 +707,9 @@ async function runPipeline(entry, overrideName, environment, cwd, source, deps =
|
|
|
609
707
|
entryModule,
|
|
610
708
|
graph,
|
|
611
709
|
name,
|
|
612
|
-
assembled
|
|
710
|
+
assembled,
|
|
711
|
+
configuration,
|
|
712
|
+
secrets
|
|
613
713
|
};
|
|
614
714
|
}
|
|
615
715
|
/** Letters, digits, `-` and `_`, starting with a letter or digit: always a valid git ref, so no `git` is needed to check it. */
|
|
@@ -624,4 +724,4 @@ function validateEnvironmentName(environment, spawn = spawnSync) {
|
|
|
624
724
|
//#endregion
|
|
625
725
|
export { noComposerExportMessage as a, validateEnvironmentName as i, resolveAppIdentity as n, runPipeline as r, checkConfigSource as t };
|
|
626
726
|
|
|
627
|
-
//# sourceMappingURL=validate-environment-
|
|
727
|
+
//# sourceMappingURL=validate-environment-D_dECxgO-B-gqpVEf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-environment-D_dECxgO-B-gqpVEf.mjs","names":["fs","path","path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-DO_iG0iR.mjs","../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/3-tooling/cli/dist/validate-environment-D_dECxgO.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/composer-config.ts\n/**\n* What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.\n* It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.\n*/\nconst SECTION_FIX = \"Write `composer: composer({ entry: './module.ts', extensions: [...], state: ... })` in prisma.config.ts, with `import { defineConfig as composer } from '@prisma/composer/config'`.\";\nconst MOVE_TO_SECTION_FIX = `${SECTION_FIX} If the project has a prisma-composer.config.ts, move its extensions and state into that section and delete the file.`;\nconst SECTION_IS_THE_ONLY_SOURCE = \"Composer reads its configuration only from the `composer` section of prisma.config.ts.\";\nconst DESCRIPTOR_FIX = \"Use the descriptor the extension factory returns, unchanged, instead of building one by hand.\";\nconst RETIRED_FILE_NAMES = [\n\t\"ts\",\n\t\"mts\",\n\t\"mjs\",\n\t\"js\"\n].map((extension) => `prisma-composer.config.${extension}`);\nconst sectionMissing = {\n\tcode: \"CONFIG.SECTION_MISSING\",\n\tsummary: \"No loaded prisma.config.ts declares a `composer` section.\",\n\twhy: `${SECTION_IS_THE_ONLY_SOURCE} A prisma-composer.config.ts file is no longer read.`,\n\tfix: MOVE_TO_SECTION_FIX\n};\n/** What the generated stack file throws when the file it imports has no `composer` export. */\nfunction noComposerExportMessage(configFile) {\n\treturn `${configFile} declares no \\`composer\\` section. Pass the prisma.config.ts that declares it.`;\n}\nfunction configFileMissing(file) {\n\treturn {\n\t\tcode: \"CONFIG.FILE_MISSING\",\n\t\tsummary: `${file} does not exist.`,\n\t\tfix: \"Pass the path of the prisma.config.ts that declares the `composer` section.\",\n\t\twhere: file\n\t};\n}\n/** A prisma-composer.config.* beside the declaring file would otherwise be silently ignored. */\n/** The path with symlinks resolved; the path itself when it cannot be resolved, so the check never throws. */\nfunction realPath(file) {\n\ttry {\n\t\treturn fs.realpathSync(file);\n\t} catch {\n\t\treturn file;\n\t}\n}\nfunction retiredFileFinding(configFile) {\n\tconst directory = path.dirname(realPath(configFile));\n\tconst found = RETIRED_FILE_NAMES.map((name) => path.join(directory, name)).find((file) => fs.existsSync(file));\n\tif (found === void 0) return void 0;\n\treturn {\n\t\tcode: \"CONFIG.FILE_RETIRED\",\n\t\tsummary: `${found} is no longer read.`,\n\t\twhy: SECTION_IS_THE_ONLY_SOURCE,\n\t\tfix: MOVE_TO_SECTION_FIX,\n\t\twhere: found\n\t};\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isExtensionDescriptor(value) {\n\treturn isObject(value) && typeof value[\"id\"] === \"string\" && value[\"id\"].length > 0 && isObject(value[\"nodes\"]);\n}\nfunction isStateDescriptor(value) {\n\treturn isObject(value) && typeof value[\"extension\"] === \"string\" && typeof value[\"create\"] === \"function\";\n}\nconst stateInvalid = {\n\tcode: \"CONFIG.FIELD_INVALID\",\n\tsummary: \"`composer.state` must be a state descriptor with a string `extension` and a `create` function.\",\n\tfix: \"Set `state` to the state descriptor an extension provides, e.g. `state: prismaState()`.\",\n\tfield: \"state\"\n};\nconst SECTION_FIELDS = /* @__PURE__ */ new Set([\n\t\"entry\",\n\t\"extensions\",\n\t\"state\",\n\t\"config\",\n\t\"secrets\"\n]);\nconst entryInvalid = {\n\tcode: \"CONFIG.FIELD_INVALID\",\n\tsummary: \"`composer.entry` must be a non-empty string: the path to the module whose default export is the app.\",\n\tfix: \"Set `entry` to that module's path, relative to prisma.config.ts, e.g. `entry: './module.ts'`.\",\n\tfield: \"entry\"\n};\n/** Neither the section's `entry` nor an override names the module whose default export is the app. */\nconst entryMissing = {\n\tcode: \"CONFIG.ENTRY_MISSING\",\n\tsummary: \"No entry module is set, so there is no app to load.\",\n\twhy: \"The entry is the module whose default export is the app root, built with module(...).\",\n\tfix: \"Set `entry: './module.ts'` in the `composer` section of prisma.config.ts, or pass `--entry <path>` (the `entry` input when calling @prisma/composer/control).\",\n\tfield: \"entry\"\n};\nfunction unknownField(key) {\n\treturn {\n\t\tcode: \"CONFIG.FIELD_UNKNOWN\",\n\t\tsummary: `The \\`composer\\` section has no field \\`${key}\\`.`,\n\t\tfix: key === \"composer\" ? \"Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `entry`, `extensions`, `state`, `config` and `secrets`.\" : `Remove \\`${key}\\`. The section takes only \\`entry\\`, \\`extensions\\`, \\`state\\`, \\`config\\` and \\`secrets\\`.`,\n\t\tfield: key\n\t};\n}\nfunction checkExtensions(value) {\n\tif (!Array.isArray(value)) return {\n\t\textensions: [],\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: \"`composer.extensions` must be an array of extension descriptors.\",\n\t\t\tfix: \"Set `extensions` to the descriptors your extensions provide, e.g. `extensions: [nodeBuild()]`.\",\n\t\t\tfield: \"extensions\"\n\t\t}]\n\t};\n\tconst findings = [];\n\tconst extensions = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const [index, entry] of value.entries()) {\n\t\tconst field = `extensions[${index}]`;\n\t\tif (!isObject(entry)) {\n\t\t\tfindings.push({\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tsummary: `\\`composer.${field}\\` must be an extension descriptor object.`,\n\t\t\t\tfix: \"Put the descriptor an extension factory returns here, e.g. `nodeBuild()`, not the factory itself.\",\n\t\t\t\tfield\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst id = entry[\"id\"];\n\t\tif (typeof id !== \"string\" || id.length === 0) findings.push({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: `\\`composer.${field}.id\\` must be a non-empty string (the extension package name).`,\n\t\t\tfix: DESCRIPTOR_FIX,\n\t\t\tfield: `${field}.id`\n\t\t});\n\t\telse if (seen.has(id)) findings.push({\n\t\t\tcode: \"CONFIG.EXTENSION_DUPLICATE\",\n\t\t\tsummary: `Extension \"${id}\" is listed more than once in \\`composer.extensions\\`.`,\n\t\t\tfix: `Remove the repeated \"${id}\" entry from \\`extensions\\`.`,\n\t\t\tfield: `${field}.id`\n\t\t});\n\t\telse seen.add(id);\n\t\tif (!isObject(entry[\"nodes\"])) findings.push({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: `\\`composer.${field}.nodes\\` must be an object (the node-ID → control registry).`,\n\t\t\tfix: DESCRIPTOR_FIX,\n\t\t\tfield: `${field}.nodes`\n\t\t});\n\t\tif (isExtensionDescriptor(entry)) extensions.push(entry);\n\t}\n\treturn {\n\t\tfindings,\n\t\textensions\n\t};\n}\nfunction isAdapterList(value) {\n\treturn Array.isArray(value) && value.every((entry) => typeof entry === \"function\");\n}\nfunction checkAdapters(list, value) {\n\tif (value === void 0) return [];\n\tif (!Array.isArray(value)) return [{\n\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\tsummary: `\\`composer.${list}\\` must be an array of adapters.`,\n\t\tfix: `Set \\`${list}\\` to a list of adapters, e.g. \\`${list}: [dotenv(), environmentVariables()]\\`, imported from '@prisma/composer/config'.`,\n\t\tfield: list\n\t}];\n\treturn value.flatMap((entry, index) => typeof entry === \"function\" ? [] : [{\n\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\tsummary: `\\`composer.${list}[${index}]\\` must be an adapter: a function that receives the environment and returns its values.`,\n\t\tfix: \"Put an adapter here, e.g. `dotenv()`.\",\n\t\tfield: `${list}[${index}]`\n\t}]);\n}\nfunction checkFields(section) {\n\tif (Object.hasOwn(section, \"configPath\")) return {\n\t\tok: false,\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_RETIRED\",\n\t\t\tsummary: \"`composer.configPath` is no longer supported: prisma-composer.config.ts is no longer read.\",\n\t\t\twhy: SECTION_IS_THE_ONLY_SOURCE,\n\t\t\tfix: `Replace \\`configPath\\` with the section itself. ${MOVE_TO_SECTION_FIX}`,\n\t\t\tfield: \"configPath\"\n\t\t}]\n\t};\n\tif (Object.hasOwn(section, \"composer\")) return {\n\t\tok: false,\n\t\tfindings: [unknownField(\"composer\")]\n\t};\n\tconst findings = Object.keys(section).filter((key) => !SECTION_FIELDS.has(key)).map(unknownField);\n\tconst checked = checkExtensions(section[\"extensions\"]);\n\tfindings.push(...checked.findings);\n\tconst state = section[\"state\"];\n\tif (!isStateDescriptor(state)) findings.push(stateInvalid);\n\tconst entry = section[\"entry\"];\n\tconst entryValid = entry === void 0 || typeof entry === \"string\" && entry.length > 0;\n\tif (!entryValid) findings.push(entryInvalid);\n\tconst config = section[\"config\"];\n\tconst secrets = section[\"secrets\"];\n\tfindings.push(...checkAdapters(\"config\", config), ...checkAdapters(\"secrets\", secrets));\n\tconst [first, ...rest] = findings;\n\tif (first === void 0 && isStateDescriptor(state) && entryValid && (config === void 0 || isAdapterList(config)) && (secrets === void 0 || isAdapterList(secrets))) return {\n\t\tok: true,\n\t\tvalue: {\n\t\t\textensions: checked.extensions,\n\t\t\tstate,\n\t\t\t...entry === void 0 ? {} : { entry },\n\t\t\t...config === void 0 ? {} : { config },\n\t\t\t...secrets === void 0 ? {} : { secrets }\n\t\t}\n\t};\n\treturn {\n\t\tok: false,\n\t\tfindings: [first ?? stateInvalid, ...rest]\n\t};\n}\n/**\n* Checks the fields that identify each descriptor and returns the descriptors as the config file's own objects.\n* Never throws: a section's values are user code, and a throwing getter or Proxy trap becomes a finding.\n*/\nfunction checkComposerSection(raw) {\n\tif (!isObject(raw)) return {\n\t\tok: false,\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: \"The `composer` section of prisma.config.ts must be an object.\",\n\t\t\tfix: SECTION_FIX\n\t\t}]\n\t};\n\ttry {\n\t\treturn checkFields({ ...raw });\n\t} catch (cause) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tfindings: [{\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tsummary: \"The `composer` section of prisma.config.ts could not be read.\",\n\t\t\t\twhy: `Reading it threw: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\tfix: SECTION_FIX\n\t\t\t}]\n\t\t};\n\t}\n}\n/**\n* The whole check, shared by the section validator and the programmatic operations so both report the same findings in the same order: the retired file beside the declaring `configFile` (resolved through symlinks), then every field finding.\n*/\nfunction checkComposerConfig(raw, configFile) {\n\tconst retired = retiredFileFinding(configFile);\n\tconst checked = checkComposerSection(raw);\n\tif (retired === void 0) return checked;\n\treturn {\n\t\tok: false,\n\t\tfindings: checked.ok ? [retired] : [retired, ...checked.findings]\n\t};\n}\n//#endregion\nexport { sectionMissing as a, noComposerExportMessage as i, configFileMissing as n, entryMissing as r, checkComposerConfig as t };\n\n//# sourceMappingURL=composer-config-DO_iG0iR.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/assemble-error.ts\n/**\n* A user-facing assembly failure, structured at origin (base-type rule 6):\n* a `CliStructuredError` whose code names which way assembly went wrong.\n* This package's second consumer is the programmatic deploy API, not just\n* the CLI — hosts branch on `error.code`, the CLI renders the envelope.\n*/\nvar AssembleError = class extends CliStructuredError {\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t}\n};\n//#endregion\n//#region src/assemble-services.ts\n/**\n* The registry route for one service's build: extension by\n* `build.extension`, node descriptor by `build.type`, kind must be \"build\".\n* The CLI's coverage validation reports the same misses earlier with the\n* config fix; these errors are the backstop for programmatic callers.\n*/\nfunction buildDescriptorAssemble(config, node, address, cwd, report) {\n\tconst { extension, type } = node.build;\n\tconst extensionDescriptor = config.extensions.find((candidate) => candidate.id === extension);\n\tif (extensionDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by service \"${node.name}\"'s build).`, { fix: \"Add it to `extensions` in the `composer` section of prisma.config.ts.\" });\n\tconst nodeDescriptor = extensionDescriptor.nodes[type];\n\tif (nodeDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for build type \"${type}\".`, { why: `Known types: ${Object.keys(extensionDescriptor.nodes).join(\", \")}.` });\n\tif (nodeDescriptor.kind !== \"build\") throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for type \"${type}\" is a \"${nodeDescriptor.kind}\" descriptor.`, { why: \"Assembling a service build needs a \\\"build\\\" descriptor.\" });\n\treturn nodeDescriptor.assemble({\n\t\tbuild: node.build,\n\t\taddress,\n\t\tcwd,\n\t\treport\n\t});\n}\n/**\n* The dev server a service's build descriptor declares, or `undefined` when it\n* declares none — including when the registry route misses, which the\n* assemble that follows reports with its own pinned error.\n*/\nasync function buildDescriptorServe(config, node, address) {\n\tconst { extension, type } = node.build;\n\tconst nodeDescriptor = config.extensions.find((candidate) => candidate.id === extension)?.nodes[type];\n\tif (nodeDescriptor?.kind !== \"build\" || nodeDescriptor.serve === void 0) return void 0;\n\ttry {\n\t\treturn await nodeDescriptor.serve({\n\t\t\tbuild: node.build,\n\t\t\taddress\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) throw error;\n\t\tthrow new CliStructuredError(\"DEV.DEV_SERVER_UNAVAILABLE\", `service \"${address}\" cannot run its dev server: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tmeta: { address },\n\t\t\tcause: error\n\t\t});\n\t}\n}\nasync function assembleServices(graph, config, cwd, run, onEvent, options = {}) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd, report) => buildDescriptorAssemble(config, node, address, nodeCwd, report));\n\tconst serviceNodes = graph.nodes.filter((n) => n.node.kind === \"service\");\n\tif (serviceNodes.length === 0) throw new AssembleError(\"ASSEMBLE.SERVICE_MISSING\", \"The loaded graph has no service to assemble.\");\n\tconst bundles = {};\n\tconst devServers = {};\n\tfor (const { id, node } of serviceNodes) {\n\t\tif (options.devServers === true) {\n\t\t\tconst server = await buildDescriptorServe(config, node, id);\n\t\t\tif (server !== void 0) {\n\t\t\t\tdevServers[id] = server;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tonEvent?.({\n\t\t\tkind: \"service-started\",\n\t\t\taddress: id\n\t\t});\n\t\tconst data = {};\n\t\tlet artifact;\n\t\ttry {\n\t\t\tartifact = await runAssembler(node, id, cwd, (reported) => Object.assign(data, reported));\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) throw error;\n\t\t\tthrow new AssembleError(\"ASSEMBLE.BUILD_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tmeta: { address: id },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\tbundles[id] = artifact;\n\t\tonEvent?.({\n\t\t\tkind: \"service-assembled\",\n\t\t\taddress: id,\n\t\t\tdata\n\t\t});\n\t}\n\treturn {\n\t\tbundles,\n\t\tdevServers\n\t};\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","import { n as environmentVariables } from \"./config-adapters-DG-uhGfv.mjs\";\nimport { n as configFileMissing, r as entryMissing, t as checkComposerConfig } from \"./composer-config-DO_iG0iR.mjs\";\nimport { i as credentialLookingValues, n as SecretRedaction, u as valuesUnderSecretsKeys } from \"./redaction-HnbkSFrK.mjs\";\nimport * as mod from \"node:module\";\nimport * as fs from \"node:fs\";\nimport { existsSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport { assembleServices } from \"@internal/assemble\";\nimport { Load, assertAppName, isNode } from \"@internal/core\";\nimport { secretsKeys } from \"@internal/core/deploy\";\nimport { CliStructuredError, InternalError, describeKind } from \"@internal/foundation/errors\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { spawnSync } from \"node:child_process\";\n//#region src/app-configuration.ts\nfunction adapterInvalid(list, index, input, summary, fix) {\n\treturn new CliStructuredError(\"CONFIG.ADAPTER_INVALID\", summary, {\n\t\tfix,\n\t\twhere: { path: input.configFile },\n\t\tmeta: { field: `${list}[${index}]` }\n\t});\n}\nfunction isValues(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isText(values) {\n\treturn Object.values(values).every((value) => typeof value === \"string\");\n}\nasync function readAdapters(list, adapters, input) {\n\tconst adapterInput = Object.freeze({\n\t\tenvironment: input.environment,\n\t\tconfigDirectory: path.dirname(input.configFile)\n\t});\n\tconst merged = Object.create(null);\n\tfor (const [index, adapter] of adapters.entries()) {\n\t\tconst field = `composer.${list}[${index}]`;\n\t\tlet values;\n\t\ttry {\n\t\t\tvalues = await adapter(adapterInput);\n\t\t} catch (thrown) {\n\t\t\tthrow new CliStructuredError(\"CONFIG.ADAPTER_FAILED\", `\\`${field}\\` failed to read the values for the environment \"${input.environment}\".`, {\n\t\t\t\twhy: `It threw: ${thrown instanceof Error ? thrown.message : String(thrown)}`,\n\t\t\t\tfix: `Fix the adapter, or remove it from \\`composer.${list}\\` in prisma.config.ts.`,\n\t\t\t\twhere: { path: input.configFile },\n\t\t\t\tmeta: { field: `${list}[${index}]` },\n\t\t\t\tcause: thrown\n\t\t\t});\n\t\t}\n\t\tif (typeof values === \"function\") throw adapterInvalid(list, index, input, `\\`${field}\\` returned a function, not an object of values.`, \"An adapter factory was put in the list instead of the adapter it makes: write `dotenv()`, not `dotenv`.\");\n\t\tif (!isValues(values)) throw adapterInvalid(list, index, input, `\\`${field}\\` returned ${describeKind(values)}, not an object of values.`, \"Return an object whose keys are the names of the values, e.g. `{ EMAIL_FROM: 'shop@example.com' }`.\");\n\t\tfor (const [key, value] of Object.entries(values)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tif (list === \"secrets\" && typeof value !== \"string\") throw adapterInvalid(list, index, input, `\\`${field}\\` returned ${describeKind(value)} for \"${key}\", but a secret is text.`, \"Return the secret as a string. A platform variable holds text.\");\n\t\t\tmerged[key] = value;\n\t\t}\n\t}\n\treturn Object.freeze(merged);\n}\n/** Calls the section's `config` adapters (default `[environmentVariables()]`) and merges what they return: the app configuration. */\nfunction readAppConfiguration(section, input) {\n\treturn readAdapters(\"config\", section.config ?? [environmentVariables()], input);\n}\n/**\n* Calls the section's `secrets` adapters (default `[environmentVariables()]`) and merges what they\n* return: the app secrets. Every value must be text. A value is a known secret only once the graph\n* names it, so this adds none.\n*/\nasync function readAppSecrets(section, input) {\n\tconst merged = await readAdapters(\"secrets\", section.secrets ?? [environmentVariables()], input);\n\tif (!isText(merged)) throw new InternalError(\"readAdapters admitted a secret that is not text\");\n\treturn merged;\n}\n//#endregion\n//#region src/entry-resolution.ts\n/**\n* Synchronous Node resolve hook so that entry modules may import relative\n* files using the specifier forms TypeScript accepts by default —\n* extensionless `./service` and `./service.js` for a `.ts` source file —\n* without requiring `allowImportingTsExtensions` in every consumer's tsconfig.\n*\n* Resolution only; uses TypeScript's own documented mapping: for a specifier\n* Node could not resolve, strip any JS-family extension and probe the\n* corresponding TypeScript source; first candidate that exists on disk wins.\n* Format-specific rules: `.mjs` → `.mts`; `.cjs` → `.cts`; `.js` and\n* extensionless → `.ts`, `.mts`, `.tsx`, then `./index.ts`. Bare and package\n* specifiers are never touched. Existing `./x.ts` imports keep working —\n* Node resolves them before the hook fires (ADR-0005: no transform, no\n* guessing, deterministic TypeScript rule).\n*\n* Bun resolves `./x.js` and `./x` to `x.ts` natively, so the hook is a\n* no-op under Bun. Nothing is registered there.\n*/\nlet registered = false;\n/**\n* Registers the resolve hook once (idempotent). Call at the start of\n* `loadEntry` so every module in the entry graph benefits, including those\n* imported lazily after the entry itself loads.\n*/\nfunction registerEntryResolution() {\n\tif (registered || typeof process.versions.bun === \"string\") return;\n\tif (typeof mod.registerHooks !== \"function\") return;\n\tregistered = true;\n\tmod.registerHooks({ resolve(specifier, context, nextResolve) {\n\t\ttry {\n\t\t\treturn nextResolve(specifier, context);\n\t\t} catch (error) {\n\t\t\tif (!isRelativeSpecifier(specifier) || context.parentURL === void 0 || !isModuleNotFoundError(error)) throw error;\n\t\t\tfor (const candidate of sourceCandidates(new URL(specifier, context.parentURL))) if (existsSync(fileURLToPath(candidate))) return nextResolve(candidate.href, context);\n\t\t\tthrow error;\n\t\t}\n\t} });\n}\n/**\n* TypeScript's extension mapping: for a JS-family or extensionless URL,\n* produce the source candidates to probe. Format-specific: `.mjs` maps only\n* to `.mts`; `.cjs` maps only to `.cts`; `.js` and extensionless probe\n* `.ts`, `.mts`, `.tsx` (keeping `.tsx` so the JSX diagnostic fires), then\n* `./index.ts`.\n*/\nfunction sourceCandidates(resolved) {\n\tconst href = resolved.href;\n\tif (href.endsWith(\".mjs\")) {\n\t\tconst base = href.slice(0, -4);\n\t\treturn [new URL(`${base}.mts`)];\n\t}\n\tif (href.endsWith(\".cjs\")) {\n\t\tconst base = href.slice(0, -4);\n\t\treturn [new URL(`${base}.cts`)];\n\t}\n\tconst base = href.endsWith(\".js\") ? href.slice(0, -3) : href;\n\treturn [\n\t\tnew URL(`${base}.ts`),\n\t\tnew URL(`${base}.mts`),\n\t\tnew URL(`${base}.tsx`),\n\t\tnew URL(`${base}/index.ts`)\n\t];\n}\nfunction isRelativeSpecifier(specifier) {\n\treturn specifier.startsWith(\"./\") || specifier.startsWith(\"../\");\n}\nfunction isModuleNotFoundError(error) {\n\tif (!(error instanceof Error)) return false;\n\tif (!(\"code\" in error)) return false;\n\treturn error.code === \"ERR_MODULE_NOT_FOUND\";\n}\n//#endregion\n//#region src/jsx-load-error.ts\n/**\n* `loadEntry` imports a user's topology with the host runtime's own module\n* loader — under node (the CLI's shebang runtime), that loader strips\n* TypeScript types but has no JSX transform (ADR-0005: the framework\n* doesn't bundle or transform the app's code; deploy loading is no\n* exception). A `.tsx`/`.jsx` file anywhere in the topology's import graph\n* dies with node's raw `ERR_UNKNOWN_FILE_EXTENSION`, which names the file\n* but not the cause or the fix. This turns that one case into structured\n* error parts (summary/why/fix) that do — every other load failure (syntax\n* errors, missing files, non-JSX unknown extensions) is untouched.\n*/\nconst UNKNOWN_EXTENSION_CODE = \"ERR_UNKNOWN_FILE_EXTENSION\";\nconst JSX_EXTENSIONS = [\".tsx\", \".jsx\"];\nfunction errorCode(error) {\n\treturn \"code\" in error && typeof error.code === \"string\" ? error.code : void 0;\n}\nfunction unknownExtensionPath(error) {\n\tif (!(error instanceof Error)) return void 0;\n\tif (errorCode(error) !== UNKNOWN_EXTENSION_CODE) return void 0;\n\treturn /Unknown file extension \"\\.\\w+\" for (.+)$/.exec(error.message)?.[1];\n}\n/**\n* Returns structured error parts when `error` is node's\n* `ERR_UNKNOWN_FILE_EXTENSION` for a `.tsx`/`.jsx` file — `undefined` for\n* every other error (including unknown-extension failures for some other\n* extension), so the caller can fall through to its normal rethrow.\n*/\nfunction explainJsxLoadError(error, entryPath) {\n\tconst offendingPath = unknownExtensionPath(error);\n\tif (offendingPath === void 0) return void 0;\n\tif (!JSX_EXTENSIONS.some((ext) => offendingPath.endsWith(ext))) return void 0;\n\treturn {\n\t\tsummary: `\"${offendingPath}\" can't be loaded.`,\n\t\twhy: `deploy loads \"${entryPath}\"'s topology with node's own module loader, which strips TypeScript types but has no JSX transform — so a .tsx/.jsx file can't sit anywhere in that import graph.`,\n\t\tfix: \"Precompile that file in your own build (transform the JSX away, keep the real npm packages external) and import the compiled output instead of the raw .tsx/.jsx — see examples/email/scripts/build.ts in the prisma/composer repo for a worked example.\"\n\t};\n}\n//#endregion\n//#region src/load-entry.ts\n/**\n* Pipeline step 2 (deploy-cli.md § The pipeline): import the entry module\n* (resolved against cwd) and require its default export to be a node — a\n* service or module, branded by core's factories. Whatever this module exports\n* IS the application; nothing else marks a root (ADR-0003).\n*/\n/** `unloadableFix`, when given, says where the path came from, so a wrong path names its source. */\nasync function loadEntry(entryArg, cwd, unloadableFix) {\n\tregisterEntryResolution();\n\tconst resolvedPath = path.resolve(cwd, entryArg);\n\tlet mod;\n\ttry {\n\t\tmod = await import(pathToFileURL(resolvedPath).href);\n\t} catch (error) {\n\t\tconst explained = explainJsxLoadError(error, resolvedPath);\n\t\tif (explained !== void 0) throw new CliStructuredError(\"COMPOSE.ENTRY_UNLOADABLE\", explained.summary, {\n\t\t\twhy: explained.why,\n\t\t\tfix: explained.fix,\n\t\t\twhere: { path: resolvedPath },\n\t\t\tcause: error\n\t\t});\n\t\tthrow new CliStructuredError(\"COMPOSE.ENTRY_UNLOADABLE\", `Failed to import entry module \"${resolvedPath}\": ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\t...unloadableFix === void 0 ? {} : { fix: unloadableFix },\n\t\t\twhere: { path: resolvedPath },\n\t\t\tcause: error\n\t\t});\n\t}\n\tconst root = blindCast(mod).default;\n\tif (!isNode(root) || root.kind === \"dependency\" || root.kind === \"resource\") throw new CliStructuredError(\"COMPOSE.ENTRY_EXPORT_INVALID\", `Entry module \"${resolvedPath}\" must default-export a node (a service or a module).`, {\n\t\tfix: \"Construct it with service() or module() from @prisma/composer.\",\n\t\twhere: { path: resolvedPath }\n\t});\n\treturn {\n\t\tpath: resolvedPath,\n\t\troot: blindCast(root)\n\t};\n}\n//#endregion\n//#region src/validate-coverage.ts\nfunction lookup(extensions, extension, type, expectedKind, what) {\n\tconst ext = extensions.get(extension);\n\tif (ext === void 0) throw new CliStructuredError(\"CONFIG.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by ${what}).`, {\n\t\tfix: \"Add it to `extensions` in the `composer` section of prisma.config.ts (import its /control entry and list its descriptor).\",\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tconst descriptor = ext.nodes[type];\n\tif (descriptor === void 0) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for node type \"${type}\" (needed by ${what}).`, {\n\t\twhy: `Known types: ${Object.keys(ext.nodes).join(\", \")}.`,\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tif (descriptor.kind !== expectedKind) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${descriptor.kind}\" descriptor — ${what} needs a \"${expectedKind}\" descriptor.`, { meta: {\n\t\textension,\n\t\ttype,\n\t\tkind: descriptor.kind\n\t} });\n}\n/** Throws a structured CONFIG.* error on the first uncovered `(extension, type)`; silent when the config covers the whole graph. */\nfunction validateRegistryCoverage(graph, config) {\n\tconst extensions = new Map(config.extensions.map((descriptor) => [descriptor.id, descriptor]));\n\tfor (const { id, node } of graph.nodes) {\n\t\tif (node.kind === \"resource\") {\n\t\t\tlookup(extensions, node.extension, node.type, \"resource\", `resource node \"${id}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (node.kind !== \"service\") continue;\n\t\tlookup(extensions, node.extension, node.type, \"service\", `service node \"${id}\"`);\n\t\tlookup(extensions, node.build.extension, node.build.type, \"build\", `service node \"${id}\"'s build descriptor`);\n\t}\n}\n//#endregion\n//#region src/pipeline.ts\n/**\n* The shared prefix of `deploy`/`destroy`/`dev` (deploy-cli.md § The\n* pipeline; local-dev spec § 6): entry load, Load,\n* registry coverage validation, name resolution, assemble. Deploy and dev\n* diverge after this — deploy resolves containers/preflight/stack file\n* against the hosted providers, dev against the local ones — so everything\n* up to and including assemble lives here once, consumed verbatim by both\n* `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines\n* cannot drift.\n*/\nconst NO_SECRETS = Object.freeze({});\nfunction configError(findings, file) {\n\tconst [first] = findings;\n\treturn new CliStructuredError(first.code, first.summary, {\n\t\t...first.why === void 0 ? {} : { why: first.why },\n\t\tfix: first.fix,\n\t\twhere: { path: first.where ?? file },\n\t\tmeta: {\n\t\t\t...first.field === void 0 ? {} : { field: first.field },\n\t\t\tfindings\n\t\t}\n\t});\n}\n/**\n* Refuses a caller's config with the same findings, in the same order, as the CLI's section validator.\n* The error is the first finding and carries all of them in `meta.findings`. Returns the config with `file` resolved against `cwd`.\n*/\nfunction checkConfigSource(source, cwd) {\n\tconst file = path.resolve(cwd, source.file);\n\tif (!fs.existsSync(file)) throw configError([configFileMissing(file)], file);\n\tconst checked = checkComposerConfig(source.value, file);\n\tif (!checked.ok) throw configError(checked.findings, file);\n\treturn {\n\t\tvalue: checked.value,\n\t\tfile\n\t};\n}\n/**\n* Resolves the entry module. An override (`--entry`, or an operation's `entry` input) resolves\n* against `cwd`; the section's `entry` resolves against the directory of the file that declares it,\n* as the CLI engine resolves path fields in prisma.config.ts.\n*/\nfunction resolveEntryPath(override, source, cwd) {\n\tif (override !== void 0) return {\n\t\tpath: path.resolve(cwd, override),\n\t\tfix: `Check the \\`--entry\\` path (the \\`entry\\` input when calling @prisma/composer/control) \"${override}\". It is relative to the current directory, ${cwd}.`\n\t};\n\tconst configured = source.value.entry;\n\tif (configured === void 0) throw configError([entryMissing], source.file);\n\treturn {\n\t\tpath: path.resolve(path.dirname(source.file), configured),\n\t\tfix: `Check \\`entry: \"${configured}\"\\` in ${source.file}. It is relative to that file's directory.`\n\t};\n}\n/**\n* The pipeline's front — entry load and name resolution —\n* WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its\n* config and resolved name) to reach the already-running local instance; it\n* neither builds nor provisions, so it must not require the user's built\n* output the way the full pipeline does.\n*/\nasync function resolveAppIdentity(entry, overrideName, cwd, config) {\n\tconst checked = checkConfigSource(config, cwd);\n\tconst { value } = checked;\n\tconst resolved = resolveEntryPath(entry, checked, cwd);\n\tconst entryModule = await loadEntry(resolved.path, cwd, resolved.fix);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\tassertAppName(name);\n\treturn {\n\t\tconfig: value,\n\t\tname\n\t};\n}\n/**\n* Runs entry load, name resolution, Load, registry coverage, and assemble — steps 1–5 of `run()`. `onAssembleError`, when\n* given, lets a caller decorate an assemble failure with command-specific\n* guidance (destroy's \"build first\" hint) without this shared step knowing\n* about any one command.\n*/\nasync function runPipeline(entry, overrideName, environment, cwd, source, deps = {}, onAssembleError) {\n\tconst configSource = checkConfigSource(source, cwd);\n\tconst config = configSource.value;\n\tconst resolved = resolveEntryPath(entry, configSource, cwd);\n\tconst entryModule = await loadEntry(resolved.path, cwd, resolved.fix);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\tconst redaction = deps.redaction ?? new SecretRedaction(process.env);\n\tconst adapterInput = {\n\t\tenvironment,\n\t\tconfigFile: configSource.file\n\t};\n\tconst secrets = deps.readSecrets === true ? await readAppSecrets(config, adapterInput) : NO_SECRETS;\n\tconst configuration = await readAppConfiguration(config, adapterInput);\n\tredaction.addCredentialLookingValues(credentialLookingValues(configuration));\n\tconst graph = Load(entryModule.root, {\n\t\tid: name,\n\t\tenvironment: { name: environment },\n\t\tconfiguration\n\t});\n\tif (graph.root.node.kind !== \"module\") throw new CliStructuredError(\"COMPOSE.ROOT_NOT_MODULE\", \"The deploy root must be a module.\", { fix: \"Wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); }).\" });\n\tredaction.addKnownSecrets(valuesUnderSecretsKeys(configuration, secrets, secretsKeys(graph)));\n\tvalidateRegistryCoverage(graph, config);\n\tdeps.onEvent?.({ kind: \"loaded\" });\n\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler, deps.onEvent, { devServers: deps.devServers === true });\n\t} catch (error) {\n\t\tif (onAssembleError !== void 0 && error instanceof Error) throw onAssembleError(error);\n\t\tthrow error;\n\t}\n\treturn {\n\t\tconfigSource,\n\t\tentryModule,\n\t\tgraph,\n\t\tname,\n\t\tassembled,\n\t\tconfiguration,\n\t\tsecrets\n\t};\n}\n//#endregion\n//#region src/validate-environment.ts\n/** Letters, digits, `-` and `_`, starting with a letter or digit: always a valid git ref, so no `git` is needed to check it. */\nconst PLAIN_ENVIRONMENT_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;\n/** An environment name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateEnvironmentName(environment, spawn = spawnSync) {\n\tif (PLAIN_ENVIRONMENT_NAME.test(environment)) return;\n\tconst result = spawn(\"git\", [\"check-ref-format\", `refs/heads/${environment}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliStructuredError(\"DEPLOY.ENVIRONMENT_UNVALIDATABLE\", `git is required to validate --environment \"${environment}\" (git check-ref-format): ${result.error.message}.`, { cause: result.error });\n\tif (result.status !== 0) throw new CliStructuredError(\"DEPLOY.ENVIRONMENT_INVALID\", `Invalid --environment \"${environment}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${environment}\").`);\n}\n//#endregion\nexport { runPipeline as i, checkConfigSource as n, resolveAppIdentity as r, validateEnvironmentName as t };\n\n//# sourceMappingURL=validate-environment-D_dECxgO.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,MAAM,cAAc;AACpB,MAAM,sBAAsB,GAAG,YAAY;AAC3C,MAAM,6BAA6B;AACnC,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;AACD,CAAC,CAAC,KAAK,cAAc,0BAA0B,WAAW;;AAQ1D,SAAS,wBAAwB,YAAY;CAC5C,OAAO,GAAG,WAAW;AACtB;AACA,SAAS,kBAAkB,MAAM;CAChC,OAAO;EACN,MAAM;EACN,SAAS,GAAG,KAAK;EACjB,KAAK;EACL,OAAO;CACR;AACD;;;AAGA,SAAS,SAAS,MAAM;CACvB,IAAI;EACH,OAAOA,KAAG,aAAa,IAAI;CAC5B,QAAQ;EACP,OAAO;CACR;AACD;AACA,SAAS,mBAAmB,YAAY;CACvC,MAAM,YAAYC,OAAK,QAAQ,SAAS,UAAU,CAAC;CACnD,MAAM,QAAQ,mBAAmB,KAAK,SAASA,OAAK,KAAK,WAAW,IAAI,CAAC,CAAC,CAAC,MAAM,SAASD,KAAG,WAAW,IAAI,CAAC;CAC7G,IAAI,UAAU,KAAK,GAAG,OAAO,KAAK;CAClC,OAAO;EACN,MAAM;EACN,SAAS,GAAG,MAAM;EAClB,KAAK;EACL,KAAK;EACL,OAAO;CACR;AACD;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC3E;AACA,SAAS,sBAAsB,OAAO;CACrC,OAAO,SAAS,KAAK,KAAK,OAAO,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;CAC5F,yBAAyB,OAAO,MAAM;CACtC,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;CACjC,IAAI;CACJ,IAAI;EACH,YAAY,MAAM,iBAAiB,OAAO,QAAQ,KAAK,KAAK,cAAc,KAAK,SAAS,EAAE,YAAY,KAAK,eAAe,KAAK,CAAC;CACjI,SAAS,OAAO;EACf,IAAI,oBAAoB,KAAK,KAAK,iBAAiB,OAAO,MAAM,gBAAgB,KAAK;EACrF,MAAM;CACP;CACA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD;;AAIA,MAAM,yBAAyB;;AAE/B,SAAS,wBAAwB,aAAa,QAAQ,WAAW;CAChE,IAAI,uBAAuB,KAAK,WAAW,GAAG;CAC9C,MAAM,SAAS,MAAM,OAAO,CAAC,oBAAoB,cAAc,aAAa,GAAG,EAAE,OAAO,SAAS,CAAC;CAClG,IAAI,OAAO,OAAO,MAAM,IAAI,mBAAmB,oCAAoC,8CAA8C,YAAY,4BAA4B,OAAO,MAAM,QAAQ,IAAI,EAAE,OAAO,OAAO,MAAM,CAAC;CACzN,IAAI,OAAO,WAAW,GAAG,MAAM,IAAI,mBAAmB,8BAA8B,0BAA0B,YAAY,6EAA6E,YAAY,IAAI;AACxN"}
|
package/dist/zod.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { a as SecretString, t as Pointer } from "./pointer-CyQZZugO-D7k3vibs.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region ../../0-framework/0-foundation/foundation/dist/zod.d.mts
|
|
4
|
+
//#region src/zod.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* A schema leaf that accepts only a redacting `SecretString` box or a secret
|
|
7
|
+
* pointer, so `input().<field>.expose()` type-checks and binding a plain
|
|
8
|
+
* literal there fails the deploy (ADR-0042). Its error names the refused
|
|
9
|
+
* value's kind, never the value.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* input: z.object({ signingKey: secretString() })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare const secretString: () => z.ZodCustom<SecretString | Pointer<SecretString>, SecretString | Pointer<SecretString>>;
|
|
16
|
+
/**
|
|
17
|
+
* Wraps the schema of one leaf field so the field also accepts a plain
|
|
18
|
+
* pointer, which stands for a value known only at boot. The field's input type
|
|
19
|
+
* is `In | Pointer<In>` and its output type `Out | Pointer<In>`, where `In` and
|
|
20
|
+
* `Out` are `inner`'s. A value that is not a pointer gets `inner`'s error.
|
|
21
|
+
* Wrap a leaf, never an object schema.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* input: z.object({ from: field(z.string()), port: field(z.string().transform(Number)) })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function field<S extends z.ZodType>(inner: S): z.ZodType<z.output<S> | Pointer<z.input<S>>, z.input<S> | Pointer<z.input<S>>>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { field, secretString };
|
|
30
|
+
//# sourceMappingURL=zod.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/zod.d.mts"],"mappings":";;;;;;;;;;;;;;cAcc,oBAAoB,EAAE,UAAU,eAAe,QAAQ,eAAe,eAAe,QAAQ;;;;;;;;;;;;iBAY1F,MAAM,UAAU,EAAE,SAAS,OAAO,IAAI,EAAE,QAAQ,EAAE,OAAO,KAAK,QAAQ,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,QAAQ,EAAE,MAAM"}
|
package/dist/zod.mjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
+
import { a as isPlainPointer, o as isSecretPointer, r as isSecretString, t as describeKind } from "./describe-kind-Cpm_euxo-CkhlGJUL.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region ../../0-framework/0-foundation/foundation/dist/zod.mjs
|
|
5
|
+
/**
|
|
6
|
+
* Zod spellings of the framework's schema leaves. Opt-in: the framework
|
|
7
|
+
* accepts any Standard Schema library (ADR-0042) and nothing outside this
|
|
8
|
+
* module imports zod, so an app that uses ArkType never loads it.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* A schema leaf that accepts only a redacting `SecretString` box or a secret
|
|
12
|
+
* pointer, so `input().<field>.expose()` type-checks and binding a plain
|
|
13
|
+
* literal there fails the deploy (ADR-0042). Its error names the refused
|
|
14
|
+
* value's kind, never the value.
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* input: z.object({ signingKey: secretString() })
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
const secretString = () => z.custom((value) => isSecretString(value) || isSecretPointer(value), { error: (issue) => `must be a SecretString box — bind this field to a secret (was ${isPlainPointer(issue.input) ? "a value known only at boot that is not a secret" : describeKind(issue.input)})` });
|
|
21
|
+
/**
|
|
22
|
+
* Wraps the schema of one leaf field so the field also accepts a plain
|
|
23
|
+
* pointer, which stands for a value known only at boot. The field's input type
|
|
24
|
+
* is `In | Pointer<In>` and its output type `Out | Pointer<In>`, where `In` and
|
|
25
|
+
* `Out` are `inner`'s. A value that is not a pointer gets `inner`'s error.
|
|
26
|
+
* Wrap a leaf, never an object schema.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* input: z.object({ from: field(z.string()), port: field(z.string().transform(Number)) })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function field(inner) {
|
|
33
|
+
const pointer = z.custom((value) => isPlainPointer(value));
|
|
34
|
+
return blindCast(z.union([inner, pointer], { error: (issue) => issue.code === "invalid_union" ? issue.errors[0]?.[0]?.message : void 0 }));
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { field, secretString };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=zod.mjs.map
|
package/dist/zod.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/zod.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as describeKind } from \"./describe-kind-Cpm_euxo.mjs\";\nimport { n as isSecretString } from \"./secret-DoWGmN7m.mjs\";\nimport { n as isPlainPointer, r as isSecretPointer } from \"./pointer-Cw3E-nrh.mjs\";\nimport { z } from \"zod\";\n//#region src/zod.ts\n/**\n* Zod spellings of the framework's schema leaves. Opt-in: the framework\n* accepts any Standard Schema library (ADR-0042) and nothing outside this\n* module imports zod, so an app that uses ArkType never loads it.\n*/\n/**\n* A schema leaf that accepts only a redacting `SecretString` box or a secret\n* pointer, so `input().<field>.expose()` type-checks and binding a plain\n* literal there fails the deploy (ADR-0042). Its error names the refused\n* value's kind, never the value.\n*\n* ```ts\n* input: z.object({ signingKey: secretString() })\n* ```\n*/\nconst secretString = () => z.custom((value) => isSecretString(value) || isSecretPointer(value), { error: (issue) => `must be a SecretString box — bind this field to a secret (was ${isPlainPointer(issue.input) ? \"a value known only at boot that is not a secret\" : describeKind(issue.input)})` });\n/**\n* Wraps the schema of one leaf field so the field also accepts a plain\n* pointer, which stands for a value known only at boot. The field's input type\n* is `In | Pointer<In>` and its output type `Out | Pointer<In>`, where `In` and\n* `Out` are `inner`'s. A value that is not a pointer gets `inner`'s error.\n* Wrap a leaf, never an object schema.\n*\n* ```ts\n* input: z.object({ from: field(z.string()), port: field(z.string().transform(Number)) })\n* ```\n*/\nfunction field(inner) {\n\tconst pointer = z.custom((value) => isPlainPointer(value));\n\treturn blindCast(z.union([inner, pointer], { error: (issue) => issue.code === \"invalid_union\" ? issue.errors[0]?.[0]?.message : void 0 }));\n}\n//#endregion\nexport { field, secretString };\n\n//# sourceMappingURL=zod.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAM,qBAAqB,EAAE,QAAQ,UAAU,eAAe,KAAK,KAAK,gBAAgB,KAAK,GAAG,EAAE,QAAQ,UAAU,iEAAiE,eAAe,MAAM,KAAK,IAAI,oDAAoD,aAAa,MAAM,KAAK,EAAE,GAAG,CAAC;;;;;;;;;;;;AAYrS,SAAS,MAAM,OAAO;CACrB,MAAM,UAAU,EAAE,QAAQ,UAAU,eAAe,KAAK,CAAC;CACzD,OAAO,UAAU,EAAE,MAAM,CAAC,OAAO,OAAO,GAAG,EAAE,QAAQ,UAAU,MAAM,SAAS,kBAAkB,MAAM,OAAO,EAAE,GAAG,EAAE,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;AAC1I"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/composer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0-dev.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Prisma Composer — build a Prisma App by composing Modules. Core authoring, deploy pipeline, and the service-rpc/http/node/nextjs authoring surfaces. The command family the `prisma` CLI mounts lives in @prisma/composer-cli.",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.mjs",
|
|
8
8
|
"./config": "./dist/config.mjs",
|
|
9
|
+
"./internal/app-configuration-file": "./dist/internal-app-configuration-file.mjs",
|
|
9
10
|
"./control": "./dist/control.mjs",
|
|
10
11
|
"./deploy": "./dist/deploy.mjs",
|
|
11
12
|
"./local-target": "./dist/local-target.mjs",
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
"./casts": "./dist/casts.mjs",
|
|
15
16
|
"./assertions": "./dist/assertions.mjs",
|
|
16
17
|
"./arktype": "./dist/arktype.mjs",
|
|
18
|
+
"./zod": "./dist/zod.mjs",
|
|
17
19
|
"./service-rpc": "./dist/service-rpc.mjs",
|
|
18
20
|
"./http": "./dist/http.mjs",
|
|
19
21
|
"./node": "./dist/node.mjs",
|
|
@@ -28,31 +30,42 @@
|
|
|
28
30
|
"skills"
|
|
29
31
|
],
|
|
30
32
|
"dependencies": {
|
|
31
|
-
"@effect/sql-d1": "4.0.3",
|
|
32
|
-
"@effect/sql-sqlite-do": "4.0.3",
|
|
33
|
-
"@effect/vitest": "4.0.3",
|
|
34
33
|
"@standard-schema/spec": "^1.1.0",
|
|
35
|
-
"alchemy": "2.0.0-beta.
|
|
36
|
-
"arktype": "^2.2.3",
|
|
34
|
+
"alchemy": "2.0.0-beta.84",
|
|
37
35
|
"cross-spawn": "^7.0.6",
|
|
38
|
-
"
|
|
36
|
+
"dotenv-flow": "4.1.0",
|
|
37
|
+
"effect": "4.0.5",
|
|
39
38
|
"esbuild": "^0.28.1",
|
|
40
39
|
"@prisma/management-api-sdk": "^1.80.0"
|
|
41
40
|
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"arktype": "^2.2.3",
|
|
43
|
+
"zod": "^4.4.3"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"arktype": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"zod": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
42
53
|
"devDependencies": {
|
|
43
|
-
"@internal/assemble": "0.
|
|
44
|
-
"@internal/cli": "0.
|
|
45
|
-
"@internal/core": "0.
|
|
46
|
-
"@internal/foundation": "0.
|
|
47
|
-
"@internal/http": "0.
|
|
48
|
-
"@internal/lowering": "0.
|
|
49
|
-
"@internal/nextjs": "0.
|
|
50
|
-
"@internal/node": "0.
|
|
51
|
-
"@internal/service-rpc": "0.
|
|
52
|
-
"@internal/tsdown-config": "0.
|
|
54
|
+
"@internal/assemble": "0.37.0-dev.1",
|
|
55
|
+
"@internal/cli": "0.37.0-dev.1",
|
|
56
|
+
"@internal/core": "0.37.0-dev.1",
|
|
57
|
+
"@internal/foundation": "0.37.0-dev.1",
|
|
58
|
+
"@internal/http": "0.37.0-dev.1",
|
|
59
|
+
"@internal/lowering": "0.37.0-dev.1",
|
|
60
|
+
"@internal/nextjs": "0.37.0-dev.1",
|
|
61
|
+
"@internal/node": "0.37.0-dev.1",
|
|
62
|
+
"@internal/service-rpc": "0.37.0-dev.1",
|
|
63
|
+
"@internal/tsdown-config": "0.37.0-dev.1",
|
|
53
64
|
"@types/node": "^26.0.1",
|
|
54
65
|
"tsdown": "^0.22.7",
|
|
55
|
-
"typescript": "^6.0.3"
|
|
66
|
+
"typescript": "^6.0.3",
|
|
67
|
+
"arktype": "^2.2.3",
|
|
68
|
+
"zod": "^4.4.3"
|
|
56
69
|
},
|
|
57
70
|
"license": "Apache-2.0",
|
|
58
71
|
"repository": {
|