@prisma/composer 0.8.0 → 0.9.0
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/control.mjs +5 -5
- package/dist/control.mjs.map +1 -1
- package/dist/{execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs → execute-deploy-destroy-Bk5vwMOf-UJcBFrLl.mjs} +3 -3
- package/dist/{execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs.map → execute-deploy-destroy-Bk5vwMOf-UJcBFrLl.mjs.map} +1 -1
- package/dist/{execute-dev-BMTFWfFc-7MifQgpp.mjs → execute-dev-CM2xQ_pz-DDT2LDoL.mjs} +3 -3
- package/dist/{execute-dev-BMTFWfFc-7MifQgpp.mjs.map → execute-dev-CM2xQ_pz-DDT2LDoL.mjs.map} +1 -1
- package/dist/{execute-log-Cay9hlKW-BcvKPOW1.mjs → execute-log-CUbn7f2_-BISq4GK_.mjs} +3 -3
- package/dist/{execute-log-Cay9hlKW-BcvKPOW1.mjs.map → execute-log-CUbn7f2_-BISq4GK_.mjs.map} +1 -1
- package/dist/node-control.mjs +2 -2
- package/dist/node-control.mjs.map +1 -1
- package/dist/{pipeline-AoW8zq4I-Dg8xQ7nC.mjs → pipeline-CCuthvMX-xnm-w-ZV.mjs} +78 -4
- package/dist/pipeline-CCuthvMX-xnm-w-ZV.mjs.map +1 -0
- package/package.json +10 -10
- package/dist/pipeline-AoW8zq4I-Dg8xQ7nC.mjs.map +0 -1
|
@@ -3,11 +3,84 @@ import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
|
3
3
|
import { o as isNode, t as Load } from "./graph-BJgUfGB0-kvgFzT4q.mjs";
|
|
4
4
|
import "./dist-C5rZnr4n.mjs";
|
|
5
5
|
import { i as effectResolutionDiagnostic } from "./result-D95kAAek.mjs";
|
|
6
|
+
import * as mod from "node:module";
|
|
6
7
|
import * as fs$1 from "node:fs";
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
7
9
|
import * as path$1 from "node:path";
|
|
8
|
-
import { pathToFileURL } from "node:url";
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
11
|
import * as c12 from "c12";
|
|
10
|
-
//#region ../../0-framework/3-tooling/cli/dist/load-entry-
|
|
12
|
+
//#region ../../0-framework/3-tooling/cli/dist/load-entry-BjRb7YB3.mjs
|
|
13
|
+
/**
|
|
14
|
+
* Synchronous Node resolve hook so that entry modules may import relative
|
|
15
|
+
* files using the specifier forms TypeScript accepts by default —
|
|
16
|
+
* extensionless `./service` and `./service.js` for a `.ts` source file —
|
|
17
|
+
* without requiring `allowImportingTsExtensions` in every consumer's tsconfig.
|
|
18
|
+
*
|
|
19
|
+
* Resolution only; uses TypeScript's own documented mapping: for a specifier
|
|
20
|
+
* Node could not resolve, strip any JS-family extension and probe the
|
|
21
|
+
* corresponding TypeScript source; first candidate that exists on disk wins.
|
|
22
|
+
* Format-specific rules: `.mjs` → `.mts`; `.cjs` → `.cts`; `.js` and
|
|
23
|
+
* extensionless → `.ts`, `.mts`, `.tsx`, then `./index.ts`. Bare and package
|
|
24
|
+
* specifiers are never touched. Existing `./x.ts` imports keep working —
|
|
25
|
+
* Node resolves them before the hook fires (ADR-0005: no transform, no
|
|
26
|
+
* guessing, deterministic TypeScript rule).
|
|
27
|
+
*
|
|
28
|
+
* Bun resolves `./x.js` and `./x` to `x.ts` natively, so the hook is a
|
|
29
|
+
* no-op under Bun. Nothing is registered there.
|
|
30
|
+
*/
|
|
31
|
+
let registered = false;
|
|
32
|
+
/**
|
|
33
|
+
* Registers the resolve hook once (idempotent). Call at the start of
|
|
34
|
+
* `loadEntry` so every module in the entry graph benefits, including those
|
|
35
|
+
* imported lazily after the entry itself loads.
|
|
36
|
+
*/
|
|
37
|
+
function registerEntryResolution() {
|
|
38
|
+
if (registered || typeof process.versions.bun === "string") return;
|
|
39
|
+
if (typeof mod.registerHooks !== "function") return;
|
|
40
|
+
registered = true;
|
|
41
|
+
mod.registerHooks({ resolve(specifier, context, nextResolve) {
|
|
42
|
+
try {
|
|
43
|
+
return nextResolve(specifier, context);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if (!isRelativeSpecifier(specifier) || context.parentURL === void 0 || !isModuleNotFoundError(error)) throw error;
|
|
46
|
+
for (const candidate of sourceCandidates(new URL(specifier, context.parentURL))) if (existsSync(fileURLToPath(candidate))) return nextResolve(candidate.href, context);
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
} });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* TypeScript's extension mapping: for a JS-family or extensionless URL,
|
|
53
|
+
* produce the source candidates to probe. Format-specific: `.mjs` maps only
|
|
54
|
+
* to `.mts`; `.cjs` maps only to `.cts`; `.js` and extensionless probe
|
|
55
|
+
* `.ts`, `.mts`, `.tsx` (keeping `.tsx` so the JSX diagnostic fires), then
|
|
56
|
+
* `./index.ts`.
|
|
57
|
+
*/
|
|
58
|
+
function sourceCandidates(resolved) {
|
|
59
|
+
const href = resolved.href;
|
|
60
|
+
if (href.endsWith(".mjs")) {
|
|
61
|
+
const base = href.slice(0, -4);
|
|
62
|
+
return [new URL(`${base}.mts`)];
|
|
63
|
+
}
|
|
64
|
+
if (href.endsWith(".cjs")) {
|
|
65
|
+
const base = href.slice(0, -4);
|
|
66
|
+
return [new URL(`${base}.cts`)];
|
|
67
|
+
}
|
|
68
|
+
const base = href.endsWith(".js") ? href.slice(0, -3) : href;
|
|
69
|
+
return [
|
|
70
|
+
new URL(`${base}.ts`),
|
|
71
|
+
new URL(`${base}.mts`),
|
|
72
|
+
new URL(`${base}.tsx`),
|
|
73
|
+
new URL(`${base}/index.ts`)
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
function isRelativeSpecifier(specifier) {
|
|
77
|
+
return specifier.startsWith("./") || specifier.startsWith("../");
|
|
78
|
+
}
|
|
79
|
+
function isModuleNotFoundError(error) {
|
|
80
|
+
if (!(error instanceof Error)) return false;
|
|
81
|
+
if (!("code" in error)) return false;
|
|
82
|
+
return error.code === "ERR_MODULE_NOT_FOUND";
|
|
83
|
+
}
|
|
11
84
|
/**
|
|
12
85
|
* `loadEntry` imports a user's topology with the host runtime's own module
|
|
13
86
|
* loader — under node (the CLI's shebang runtime), that loader strips
|
|
@@ -52,6 +125,7 @@ function explainJsxLoadError(error, entryPath) {
|
|
|
52
125
|
* IS the application; nothing else marks a root (ADR-0003).
|
|
53
126
|
*/
|
|
54
127
|
async function loadEntry(entryArg, cwd) {
|
|
128
|
+
registerEntryResolution();
|
|
55
129
|
const resolvedPath = path$1.resolve(cwd, entryArg);
|
|
56
130
|
let mod;
|
|
57
131
|
try {
|
|
@@ -128,7 +202,7 @@ async function assembleServices(graph, config, cwd, run) {
|
|
|
128
202
|
return { bundles };
|
|
129
203
|
}
|
|
130
204
|
//#endregion
|
|
131
|
-
//#region ../../0-framework/3-tooling/cli/dist/pipeline-
|
|
205
|
+
//#region ../../0-framework/3-tooling/cli/dist/pipeline-CCuthvMX.mjs
|
|
132
206
|
/**
|
|
133
207
|
* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE
|
|
134
208
|
* file that imports control-plane code. Discovery is the standard walk-up
|
|
@@ -449,4 +523,4 @@ async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError)
|
|
|
449
523
|
//#endregion
|
|
450
524
|
export { runPipeline as n, resolveAppIdentity as t };
|
|
451
525
|
|
|
452
|
-
//# sourceMappingURL=pipeline-
|
|
526
|
+
//# sourceMappingURL=pipeline-CCuthvMX-xnm-w-ZV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline-CCuthvMX-xnm-w-ZV.mjs","names":["path","path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/load-entry-BjRb7YB3.mjs","../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/3-tooling/cli/dist/pipeline-CCuthvMX.mjs"],"sourcesContent":["import * as mod from \"node:module\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { existsSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { isNode } from \"@internal/core\";\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 1 (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*/\nasync function loadEntry(entryArg, cwd) {\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\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\nexport { loadEntry as t };\n\n//# sourceMappingURL=load-entry-BjRb7YB3.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) {\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 prisma-composer.config.ts's `extensions`.\" });\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});\n}\nasync function assembleServices(graph, config, cwd, run) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd) => buildDescriptorAssemble(config, node, address, nodeCwd));\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\tfor (const { id, node } of serviceNodes) try {\n\t\tbundles[id] = await runAssembler(node, id, cwd);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) throw error;\n\t\tthrow new AssembleError(\"ASSEMBLE.BUILD_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\tmeta: { address: id },\n\t\t\tcause: error\n\t\t});\n\t}\n\treturn { bundles };\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","import { i as effectResolutionDiagnostic } from \"./shared-BTnATsqm.mjs\";\nimport { t as loadEntry } from \"./load-entry-BjRb7YB3.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { Load } from \"@internal/core\";\nimport { assembleServices } from \"@internal/assemble\";\nimport * as c12 from \"c12\";\n//#region src/load-config.ts\n/**\n* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE\n* file that imports control-plane code. Discovery is the standard walk-up\n* from the deploy entry's directory (mirrors prisma-next's config-loader);\n* loading is c12 with that explicit path (rc/global/package.json lookups\n* disabled), so the config file's own static imports resolve from the app\n* root by whatever package manager runs — no specifier construction, no\n* anchoring.\n*\n* Two shapes of the same machinery:\n*\n* loadAppConfigDiagnostics — returns the evaluated value together with\n* EVERY problem found, and never throws. This is the shape the engine\n* command family consumes: the engine renders diagnostics itself and\n* decides per command whether a broken section is fatal, so a loader that\n* threw on the first bad field would both hide the rest and bypass that\n* rendering.\n*\n* loadAppConfig — the same load, throwing its first diagnostic. The\n* clipanion CLI still runs on it; it goes when clipanion does.\n*/\nconst CONFIG_FILENAME = \"prisma-composer.config.ts\";\n/** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */\nfunction findConfigPathForEntry(entryPath) {\n\tlet current = path.dirname(path.resolve(entryPath));\n\twhile (true) {\n\t\tconst candidate = path.join(current, CONFIG_FILENAME);\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(current);\n\t\tif (parent === current) return void 0;\n\t\tcurrent = parent;\n\t}\n}\nfunction missingConfigError(entryPath) {\n\tconst searchedFrom = path.dirname(path.resolve(entryPath));\n\treturn new CliStructuredError(\"CONFIG.FILE_MISSING\", `No ${CONFIG_FILENAME} found walking up from \"${searchedFrom}\".`, {\n\t\twhy: \"The deploy needs the app's config file.\",\n\t\tfix: \"Create one next to (or above) the entry, default-exporting defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.\",\n\t\twhere: { path: searchedFrom }\n\t});\n}\nfunction fieldError(field, requirement) {\n\treturn new CliStructuredError(\"CONFIG.FIELD_INVALID\", `${CONFIG_FILENAME}: \\`${field}\\` ${requirement}.`, {\n\t\tfix: \"See defineConfig() in '@prisma/composer/config'.\",\n\t\tmeta: { field }\n\t});\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Field-by-field validation of the loaded default export — deliberately no\n* schema library: each check is a structured error naming the offending field.\n*\n* Collects rather than throws, so one bad config reports every bad field\n* instead of only the first. The `extensions` and `state` checks are\n* independent, and within `extensions` each entry is judged on its own; a\n* field whose own shape check already failed is not probed further, because\n* anything derived from it would be noise rather than a second finding.\n*/\nfunction configShapeDiagnostics(loaded, configPath) {\n\tif (!isRecord(loaded) || Object.keys(loaded).length === 0) return [new CliStructuredError(\"CONFIG.EXPORT_INVALID\", `\"${configPath}\" exported no config.`, {\n\t\tfix: \"It must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.\",\n\t\twhere: { path: configPath }\n\t})];\n\tconst diagnostics = [];\n\tconst extensions = loaded[\"extensions\"];\n\tif (!Array.isArray(extensions)) diagnostics.push(fieldError(\"extensions\", \"must be an array\"));\n\telse {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const [index, entry] of extensions.entries()) {\n\t\t\tif (!isRecord(entry)) {\n\t\t\t\tdiagnostics.push(fieldError(`extensions[${index}]`, \"must be an extension descriptor object\"));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst id = entry[\"id\"];\n\t\t\tif (typeof id !== \"string\" || id.length === 0) diagnostics.push(fieldError(`extensions[${index}].id`, \"must be a non-empty string (the extension package name)\"));\n\t\t\telse if (seen.has(id)) diagnostics.push(new CliStructuredError(\"CONFIG.EXTENSION_DUPLICATE\", `${CONFIG_FILENAME}: extension \"${id}\" is listed more than once in \\`extensions\\`.`));\n\t\t\telse seen.add(id);\n\t\t\tif (!isRecord(entry[\"nodes\"])) diagnostics.push(fieldError(`extensions[${index}].nodes`, \"must be an object (the node-ID → control registry)\"));\n\t\t}\n\t}\n\tconst state = loaded[\"state\"];\n\tif (!isRecord(state) || typeof state[\"extension\"] !== \"string\" || typeof state[\"create\"] !== \"function\") diagnostics.push(fieldError(\"state\", \"must be a state descriptor (e.g. prismaState())\"));\n\treturn diagnostics;\n}\n/** The throwing form of configShapeDiagnostics: raises the first finding, returns the same object typed. Used by the clipanion pipeline. */\nfunction validateConfigShape(loaded, configPath) {\n\tconst [first] = configShapeDiagnostics(loaded, configPath);\n\tif (first !== void 0) throw first;\n\treturn blindCast(loaded);\n}\n/**\n* Evaluates `configPath` with c12 (explicit file; rc / global-rc /\n* package.json lookups disabled). `verifySamePath` runs the same-file check\n* against the discovered path — see loadAppConfigDiagnostics for when it does\n* not apply.\n*/\nasync function evaluateConfig(configPath, verifySamePath) {\n\tlet result;\n\ttry {\n\t\tresult = await c12.loadConfig({\n\t\t\tname: \"prisma-composer\",\n\t\t\tconfigFile: configPath,\n\t\t\tcwd: path.dirname(configPath),\n\t\t\trcFile: false,\n\t\t\tglobalRc: false,\n\t\t\tpackageJson: false\n\t\t});\n\t} catch (error) {\n\t\treturn {\n\t\t\tvalue: void 0,\n\t\t\tdiagnostics: [new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", `Evaluating \"${configPath}\" failed: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\t\twhere: { path: configPath },\n\t\t\t\tcause: error\n\t\t\t})]\n\t\t};\n\t}\n\tconst loadedFile = result.configFile;\n\tif (verifySamePath && (typeof loadedFile !== \"string\" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))) return {\n\t\tvalue: result.config,\n\t\tdiagnostics: [new CliStructuredError(\"CONFIG.PATH_MISMATCH\", `Config loading resolved \"${String(loadedFile)}\" instead of the discovered \"${configPath}\".`, {\n\t\t\twhy: \"Refusing to deploy against a different file.\",\n\t\t\twhere: { path: configPath }\n\t\t})]\n\t};\n\treturn {\n\t\tvalue: result.config,\n\t\tdiagnostics: configShapeDiagnostics(result.config, configPath)\n\t};\n}\n/**\n* The front of every config load, shared by the throwing and the\n* diagnostics-list shapes: verify the installed tree can evaluate a config at\n* all, then settle which file to load — the section's path, or the\n* entry-anchored walk.\n*\n* The effect-resolution check comes first because evaluating a config imports\n* alchemy's provider tree: in a tree where alchemy resolves an `effect` we did\n* not pin, nothing downstream can load, so the dependency conflict is the\n* finding with the fix in it and every later failure is its symptom.\n*/\nfunction configSource(request) {\n\tconst resolvedEntry = path.resolve(request.entryPath);\n\tconst cwd = request.cwd ?? path.dirname(resolvedEntry);\n\tconst effectConflict = effectResolutionDiagnostic(cwd);\n\tif (effectConflict !== void 0) return {\n\t\tok: false,\n\t\tpath: void 0,\n\t\tdiagnostic: effectConflict\n\t};\n\tif (request.configPath === void 0) {\n\t\tconst discovered = findConfigPathForEntry(resolvedEntry);\n\t\treturn discovered === void 0 ? {\n\t\t\tok: false,\n\t\t\tpath: void 0,\n\t\t\tdiagnostic: missingConfigError(resolvedEntry)\n\t\t} : {\n\t\t\tok: true,\n\t\t\tpath: discovered,\n\t\t\texplicit: false\n\t\t};\n\t}\n\tconst configPath = path.resolve(cwd, request.configPath);\n\tif (!fs.existsSync(configPath)) return {\n\t\tok: false,\n\t\tpath: configPath,\n\t\tdiagnostic: new CliStructuredError(\"CONFIG.FILE_MISSING\", `The \\`composer\\` config section points at \"${configPath}\", which does not exist.`, {\n\t\t\twhy: \"An explicit configPath is used as given — there is no walk to fall back on.\",\n\t\t\tfix: \"Correct `configPath` in the `composer` section of prisma.config.ts, or remove it to search upward from the entry.\",\n\t\t\twhere: { path: configPath }\n\t\t})\n\t};\n\treturn {\n\t\tok: true,\n\t\tpath: configPath,\n\t\texplicit: true\n\t};\n}\n/**\n* The throwing form of that front, for the pipeline: the file the load will\n* use, or the finding raised. `explicit` says the section named the file,\n* which is what retires the same-file check for that case.\n*/\nfunction resolveConfigFile(request) {\n\tconst source = configSource(request);\n\tif (!source.ok) throw source.diagnostic;\n\treturn {\n\t\tpath: source.path,\n\t\texplicit: source.explicit\n\t};\n}\n/**\n* Loads + validates the config at `configPath`, throwing its first diagnostic.\n* The clipanion CLI's pipeline runs on this; it goes when clipanion does.\n*/\nasync function loadAppConfig(configPath, verifySamePath = true) {\n\tconst { value, diagnostics } = await evaluateConfig(configPath, verifySamePath);\n\tconst [first] = diagnostics;\n\tif (first !== void 0) throw first;\n\treturn {\n\t\tpath: configPath,\n\t\tconfig: validateConfigShape(value, configPath)\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 ${CONFIG_FILENAME}'s \\`extensions\\` (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): config discovery/load, 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*/\n/**\n* The config step both pipelines share: the effect-resolution check and the\n* choice of config file (load-config.ts's shared front), then evaluation —\n* unless the caller substituted a config, which replaces the evaluation and\n* nothing before it.\n*/\nasync function loadConfigStep(entryPath, cwd, deps) {\n\tconst { path: configPath, explicit } = resolveConfigFile({\n\t\tentryPath,\n\t\tconfigPath: deps.configPath,\n\t\tcwd\n\t});\n\treturn {\n\t\tconfigPath,\n\t\tconfig: deps.config ?? (await loadAppConfig(configPath, !explicit)).config\n\t};\n}\n/**\n* The pipeline's front — config discovery/load, entry load, 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, deps = {}) {\n\tconst { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);\n\tconst entryModule = await loadEntry(entry, cwd);\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\treturn {\n\t\tconfigPath,\n\t\tconfig,\n\t\tname\n\t};\n}\n/**\n* Runs config discovery/load, entry load, Load, registry coverage, name\n* resolution, and assemble — steps 1–6 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, cwd, deps = {}, onAssembleError) {\n\tconst { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);\n\tconst entryModule = await loadEntry(entry, cwd);\n\tconst graph = Load(entryModule.root);\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\tvalidateRegistryCoverage(graph, config);\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\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler);\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\tconfigPath,\n\t\tconfig,\n\t\tentryModule,\n\t\tgraph,\n\t\tname,\n\t\tassembled\n\t};\n}\n//#endregion\nexport { runPipeline as n, resolveAppIdentity as t };\n\n//# sourceMappingURL=pipeline-CCuthvMX.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,aAAa;;;;;;AAMjB,SAAS,0BAA0B;CAClC,IAAI,cAAc,OAAO,QAAQ,SAAS,QAAQ,UAAU;CAC5D,IAAI,OAAO,IAAI,kBAAkB,YAAY;CAC7C,aAAa;CACb,IAAI,cAAc,EAAE,QAAQ,WAAW,SAAS,aAAa;EAC5D,IAAI;GACH,OAAO,YAAY,WAAW,OAAO;EACtC,SAAS,OAAO;GACf,IAAI,CAAC,oBAAoB,SAAS,KAAK,QAAQ,cAAc,KAAK,KAAK,CAAC,sBAAsB,KAAK,GAAG,MAAM;GAC5G,KAAK,MAAM,aAAa,iBAAiB,IAAI,IAAI,WAAW,QAAQ,SAAS,CAAC,GAAG,IAAI,WAAW,cAAc,SAAS,CAAC,GAAG,OAAO,YAAY,UAAU,MAAM,OAAO;GACrK,MAAM;EACP;CACD,EAAE,CAAC;AACJ;;;;;;;;AAQA,SAAS,iBAAiB,UAAU;CACnC,MAAM,OAAO,SAAS;CACtB,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E,KAAK,wCAAwC,CAAC;CAC1J,IAAI;CACJ,IAAI;EACH,YAAY,MAAM,iBAAiB,OAAO,QAAQ,KAAK,KAAK,YAAY;CACzE,SAAS,OAAO;EACf,IAAI,oBAAoB,KAAK,KAAK,iBAAiB,OAAO,MAAM,gBAAgB,KAAK;EACrF,MAAM;CACP;CACA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;CACD;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/composer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
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.",
|
|
6
6
|
"exports": {
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@effect/vitest": "4.0.0-beta.103",
|
|
39
|
-
"@internal/assemble": "0.
|
|
40
|
-
"@internal/cli": "0.
|
|
41
|
-
"@internal/core": "0.
|
|
42
|
-
"@internal/foundation": "0.
|
|
43
|
-
"@internal/lowering": "0.
|
|
44
|
-
"@internal/nextjs": "0.
|
|
45
|
-
"@internal/node": "0.
|
|
46
|
-
"@internal/service-rpc": "0.
|
|
47
|
-
"@internal/tsdown-config": "0.
|
|
39
|
+
"@internal/assemble": "0.9.0",
|
|
40
|
+
"@internal/cli": "0.9.0",
|
|
41
|
+
"@internal/core": "0.9.0",
|
|
42
|
+
"@internal/foundation": "0.9.0",
|
|
43
|
+
"@internal/lowering": "0.9.0",
|
|
44
|
+
"@internal/nextjs": "0.9.0",
|
|
45
|
+
"@internal/node": "0.9.0",
|
|
46
|
+
"@internal/service-rpc": "0.9.0",
|
|
47
|
+
"@internal/tsdown-config": "0.9.0",
|
|
48
48
|
"@types/node": "^26.0.1",
|
|
49
49
|
"tsdown": "^0.22.7",
|
|
50
50
|
"typescript": "^6.0.3"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-AoW8zq4I-Dg8xQ7nC.mjs","names":["path","path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/load-entry-BYBSCuWg.mjs","../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/3-tooling/cli/dist/pipeline-AoW8zq4I.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { isNode } from \"@internal/core\";\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 1 (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*/\nasync function loadEntry(entryArg, cwd) {\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\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\nexport { loadEntry as t };\n\n//# sourceMappingURL=load-entry-BYBSCuWg.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) {\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 prisma-composer.config.ts's `extensions`.\" });\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});\n}\nasync function assembleServices(graph, config, cwd, run) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd) => buildDescriptorAssemble(config, node, address, nodeCwd));\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\tfor (const { id, node } of serviceNodes) try {\n\t\tbundles[id] = await runAssembler(node, id, cwd);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) throw error;\n\t\tthrow new AssembleError(\"ASSEMBLE.BUILD_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\tmeta: { address: id },\n\t\t\tcause: error\n\t\t});\n\t}\n\treturn { bundles };\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","import { i as effectResolutionDiagnostic } from \"./shared-BTnATsqm.mjs\";\nimport { t as loadEntry } from \"./load-entry-BYBSCuWg.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { Load } from \"@internal/core\";\nimport { assembleServices } from \"@internal/assemble\";\nimport * as c12 from \"c12\";\n//#region src/load-config.ts\n/**\n* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE\n* file that imports control-plane code. Discovery is the standard walk-up\n* from the deploy entry's directory (mirrors prisma-next's config-loader);\n* loading is c12 with that explicit path (rc/global/package.json lookups\n* disabled), so the config file's own static imports resolve from the app\n* root by whatever package manager runs — no specifier construction, no\n* anchoring.\n*\n* Two shapes of the same machinery:\n*\n* loadAppConfigDiagnostics — returns the evaluated value together with\n* EVERY problem found, and never throws. This is the shape the engine\n* command family consumes: the engine renders diagnostics itself and\n* decides per command whether a broken section is fatal, so a loader that\n* threw on the first bad field would both hide the rest and bypass that\n* rendering.\n*\n* loadAppConfig — the same load, throwing its first diagnostic. The\n* clipanion CLI still runs on it; it goes when clipanion does.\n*/\nconst CONFIG_FILENAME = \"prisma-composer.config.ts\";\n/** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */\nfunction findConfigPathForEntry(entryPath) {\n\tlet current = path.dirname(path.resolve(entryPath));\n\twhile (true) {\n\t\tconst candidate = path.join(current, CONFIG_FILENAME);\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(current);\n\t\tif (parent === current) return void 0;\n\t\tcurrent = parent;\n\t}\n}\nfunction missingConfigError(entryPath) {\n\tconst searchedFrom = path.dirname(path.resolve(entryPath));\n\treturn new CliStructuredError(\"CONFIG.FILE_MISSING\", `No ${CONFIG_FILENAME} found walking up from \"${searchedFrom}\".`, {\n\t\twhy: \"The deploy needs the app's config file.\",\n\t\tfix: \"Create one next to (or above) the entry, default-exporting defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.\",\n\t\twhere: { path: searchedFrom }\n\t});\n}\nfunction fieldError(field, requirement) {\n\treturn new CliStructuredError(\"CONFIG.FIELD_INVALID\", `${CONFIG_FILENAME}: \\`${field}\\` ${requirement}.`, {\n\t\tfix: \"See defineConfig() in '@prisma/composer/config'.\",\n\t\tmeta: { field }\n\t});\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Field-by-field validation of the loaded default export — deliberately no\n* schema library: each check is a structured error naming the offending field.\n*\n* Collects rather than throws, so one bad config reports every bad field\n* instead of only the first. The `extensions` and `state` checks are\n* independent, and within `extensions` each entry is judged on its own; a\n* field whose own shape check already failed is not probed further, because\n* anything derived from it would be noise rather than a second finding.\n*/\nfunction configShapeDiagnostics(loaded, configPath) {\n\tif (!isRecord(loaded) || Object.keys(loaded).length === 0) return [new CliStructuredError(\"CONFIG.EXPORT_INVALID\", `\"${configPath}\" exported no config.`, {\n\t\tfix: \"It must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.\",\n\t\twhere: { path: configPath }\n\t})];\n\tconst diagnostics = [];\n\tconst extensions = loaded[\"extensions\"];\n\tif (!Array.isArray(extensions)) diagnostics.push(fieldError(\"extensions\", \"must be an array\"));\n\telse {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const [index, entry] of extensions.entries()) {\n\t\t\tif (!isRecord(entry)) {\n\t\t\t\tdiagnostics.push(fieldError(`extensions[${index}]`, \"must be an extension descriptor object\"));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst id = entry[\"id\"];\n\t\t\tif (typeof id !== \"string\" || id.length === 0) diagnostics.push(fieldError(`extensions[${index}].id`, \"must be a non-empty string (the extension package name)\"));\n\t\t\telse if (seen.has(id)) diagnostics.push(new CliStructuredError(\"CONFIG.EXTENSION_DUPLICATE\", `${CONFIG_FILENAME}: extension \"${id}\" is listed more than once in \\`extensions\\`.`));\n\t\t\telse seen.add(id);\n\t\t\tif (!isRecord(entry[\"nodes\"])) diagnostics.push(fieldError(`extensions[${index}].nodes`, \"must be an object (the node-ID → control registry)\"));\n\t\t}\n\t}\n\tconst state = loaded[\"state\"];\n\tif (!isRecord(state) || typeof state[\"extension\"] !== \"string\" || typeof state[\"create\"] !== \"function\") diagnostics.push(fieldError(\"state\", \"must be a state descriptor (e.g. prismaState())\"));\n\treturn diagnostics;\n}\n/** The throwing form of configShapeDiagnostics: raises the first finding, returns the same object typed. Used by the clipanion pipeline. */\nfunction validateConfigShape(loaded, configPath) {\n\tconst [first] = configShapeDiagnostics(loaded, configPath);\n\tif (first !== void 0) throw first;\n\treturn blindCast(loaded);\n}\n/**\n* Evaluates `configPath` with c12 (explicit file; rc / global-rc /\n* package.json lookups disabled). `verifySamePath` runs the same-file check\n* against the discovered path — see loadAppConfigDiagnostics for when it does\n* not apply.\n*/\nasync function evaluateConfig(configPath, verifySamePath) {\n\tlet result;\n\ttry {\n\t\tresult = await c12.loadConfig({\n\t\t\tname: \"prisma-composer\",\n\t\t\tconfigFile: configPath,\n\t\t\tcwd: path.dirname(configPath),\n\t\t\trcFile: false,\n\t\t\tglobalRc: false,\n\t\t\tpackageJson: false\n\t\t});\n\t} catch (error) {\n\t\treturn {\n\t\t\tvalue: void 0,\n\t\t\tdiagnostics: [new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", `Evaluating \"${configPath}\" failed: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\t\twhere: { path: configPath },\n\t\t\t\tcause: error\n\t\t\t})]\n\t\t};\n\t}\n\tconst loadedFile = result.configFile;\n\tif (verifySamePath && (typeof loadedFile !== \"string\" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))) return {\n\t\tvalue: result.config,\n\t\tdiagnostics: [new CliStructuredError(\"CONFIG.PATH_MISMATCH\", `Config loading resolved \"${String(loadedFile)}\" instead of the discovered \"${configPath}\".`, {\n\t\t\twhy: \"Refusing to deploy against a different file.\",\n\t\t\twhere: { path: configPath }\n\t\t})]\n\t};\n\treturn {\n\t\tvalue: result.config,\n\t\tdiagnostics: configShapeDiagnostics(result.config, configPath)\n\t};\n}\n/**\n* The front of every config load, shared by the throwing and the\n* diagnostics-list shapes: verify the installed tree can evaluate a config at\n* all, then settle which file to load — the section's path, or the\n* entry-anchored walk.\n*\n* The effect-resolution check comes first because evaluating a config imports\n* alchemy's provider tree: in a tree where alchemy resolves an `effect` we did\n* not pin, nothing downstream can load, so the dependency conflict is the\n* finding with the fix in it and every later failure is its symptom.\n*/\nfunction configSource(request) {\n\tconst resolvedEntry = path.resolve(request.entryPath);\n\tconst cwd = request.cwd ?? path.dirname(resolvedEntry);\n\tconst effectConflict = effectResolutionDiagnostic(cwd);\n\tif (effectConflict !== void 0) return {\n\t\tok: false,\n\t\tpath: void 0,\n\t\tdiagnostic: effectConflict\n\t};\n\tif (request.configPath === void 0) {\n\t\tconst discovered = findConfigPathForEntry(resolvedEntry);\n\t\treturn discovered === void 0 ? {\n\t\t\tok: false,\n\t\t\tpath: void 0,\n\t\t\tdiagnostic: missingConfigError(resolvedEntry)\n\t\t} : {\n\t\t\tok: true,\n\t\t\tpath: discovered,\n\t\t\texplicit: false\n\t\t};\n\t}\n\tconst configPath = path.resolve(cwd, request.configPath);\n\tif (!fs.existsSync(configPath)) return {\n\t\tok: false,\n\t\tpath: configPath,\n\t\tdiagnostic: new CliStructuredError(\"CONFIG.FILE_MISSING\", `The \\`composer\\` config section points at \"${configPath}\", which does not exist.`, {\n\t\t\twhy: \"An explicit configPath is used as given — there is no walk to fall back on.\",\n\t\t\tfix: \"Correct `configPath` in the `composer` section of prisma.config.ts, or remove it to search upward from the entry.\",\n\t\t\twhere: { path: configPath }\n\t\t})\n\t};\n\treturn {\n\t\tok: true,\n\t\tpath: configPath,\n\t\texplicit: true\n\t};\n}\n/**\n* The throwing form of that front, for the pipeline: the file the load will\n* use, or the finding raised. `explicit` says the section named the file,\n* which is what retires the same-file check for that case.\n*/\nfunction resolveConfigFile(request) {\n\tconst source = configSource(request);\n\tif (!source.ok) throw source.diagnostic;\n\treturn {\n\t\tpath: source.path,\n\t\texplicit: source.explicit\n\t};\n}\n/**\n* Loads + validates the config at `configPath`, throwing its first diagnostic.\n* The clipanion CLI's pipeline runs on this; it goes when clipanion does.\n*/\nasync function loadAppConfig(configPath, verifySamePath = true) {\n\tconst { value, diagnostics } = await evaluateConfig(configPath, verifySamePath);\n\tconst [first] = diagnostics;\n\tif (first !== void 0) throw first;\n\treturn {\n\t\tpath: configPath,\n\t\tconfig: validateConfigShape(value, configPath)\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 ${CONFIG_FILENAME}'s \\`extensions\\` (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): config discovery/load, 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*/\n/**\n* The config step both pipelines share: the effect-resolution check and the\n* choice of config file (load-config.ts's shared front), then evaluation —\n* unless the caller substituted a config, which replaces the evaluation and\n* nothing before it.\n*/\nasync function loadConfigStep(entryPath, cwd, deps) {\n\tconst { path: configPath, explicit } = resolveConfigFile({\n\t\tentryPath,\n\t\tconfigPath: deps.configPath,\n\t\tcwd\n\t});\n\treturn {\n\t\tconfigPath,\n\t\tconfig: deps.config ?? (await loadAppConfig(configPath, !explicit)).config\n\t};\n}\n/**\n* The pipeline's front — config discovery/load, entry load, 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, deps = {}) {\n\tconst { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);\n\tconst entryModule = await loadEntry(entry, cwd);\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\treturn {\n\t\tconfigPath,\n\t\tconfig,\n\t\tname\n\t};\n}\n/**\n* Runs config discovery/load, entry load, Load, registry coverage, name\n* resolution, and assemble — steps 1–6 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, cwd, deps = {}, onAssembleError) {\n\tconst { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);\n\tconst entryModule = await loadEntry(entry, cwd);\n\tconst graph = Load(entryModule.root);\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\tvalidateRegistryCoverage(graph, config);\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\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler);\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\tconfigPath,\n\t\tconfig,\n\t\tentryModule,\n\t\tgraph,\n\t\tname,\n\t\tassembled\n\t};\n}\n//#endregion\nexport { runPipeline as n, resolveAppIdentity as t };\n\n//# sourceMappingURL=pipeline-AoW8zq4I.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,yBAAyB;AAC/B,MAAM,iBAAiB,CAAC,QAAQ,MAAM;AACtC,SAAS,UAAU,OAAO;CACzB,OAAO,UAAU,SAAS,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,KAAK;AAC9E;AACA,SAAS,qBAAqB,OAAO;CACpC,IAAI,EAAE,iBAAiB,QAAQ,OAAO,KAAK;CAC3C,IAAI,UAAU,KAAK,MAAM,wBAAwB,OAAO,KAAK;CAC7D,OAAO,2CAA2C,KAAK,MAAM,OAAO,CAAC,GAAG;AACzE;;;;;;;AAOA,SAAS,oBAAoB,OAAO,WAAW;CAC9C,MAAM,gBAAgB,qBAAqB,KAAK;CAChD,IAAI,kBAAkB,KAAK,GAAG,OAAO,KAAK;CAC1C,IAAI,CAAC,eAAe,MAAM,QAAQ,cAAc,SAAS,GAAG,CAAC,GAAG,OAAO,KAAK;CAC5E,OAAO;EACN,SAAS,IAAI,cAAc;EAC3B,KAAK,iBAAiB,UAAU;EAChC,KAAK;CACN;AACD;;;;;;;AASA,eAAe,UAAU,UAAU,KAAK;CACvC,MAAM,eAAeA,OAAK,QAAQ,KAAK,QAAQ;CAC/C,IAAI;CACJ,IAAI;EACH,MAAM,MAAM,OAAO,cAAc,YAAY,CAAC,CAAC;CAChD,SAAS,OAAO;EACf,MAAM,YAAY,oBAAoB,OAAO,YAAY;EACzD,IAAI,cAAc,KAAK,GAAG,MAAM,IAAI,mBAAmB,4BAA4B,UA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