@prisma/composer 0.6.0 → 0.7.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.
Files changed (83) hide show
  1. package/dist/{app-config-Cbv_lA38-BHJsd1DF.d.mts → app-config-BinBcpPf-1akTl5h4.d.mts} +130 -17
  2. package/dist/app-config-BinBcpPf-1akTl5h4.d.mts.map +1 -0
  3. package/dist/config-647Wkm51.d.mts +1 -0
  4. package/dist/config.d.mts +3 -3
  5. package/dist/control.d.mts +260 -0
  6. package/dist/control.d.mts.map +1 -0
  7. package/dist/control.mjs +71 -0
  8. package/dist/control.mjs.map +1 -0
  9. package/dist/deploy-647Wkm51.d.mts +1 -0
  10. package/dist/deploy.d.mts +2 -2
  11. package/dist/deploy.mjs +312 -1
  12. package/dist/deploy.mjs.map +1 -0
  13. package/dist/deployment-summary-DswOl_9E-B9MhYYDt.mjs +70 -0
  14. package/dist/deployment-summary-DswOl_9E-B9MhYYDt.mjs.map +1 -0
  15. package/dist/{dist-BdvFDCLV.mjs → dist-C5rZnr4n.mjs} +2 -2
  16. package/dist/{dist-BdvFDCLV.mjs.map → dist-C5rZnr4n.mjs.map} +1 -1
  17. package/dist/dist-CVk7Pk4B.mjs +42 -0
  18. package/dist/dist-CVk7Pk4B.mjs.map +1 -0
  19. package/dist/emulator-retry-DGonap4g-S8BNrXFD.mjs +24 -0
  20. package/dist/emulator-retry-DGonap4g-S8BNrXFD.mjs.map +1 -0
  21. package/dist/errors-0e8IVwzi.mjs +88 -0
  22. package/dist/errors-0e8IVwzi.mjs.map +1 -0
  23. package/dist/execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs +405 -0
  24. package/dist/execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs.map +1 -0
  25. package/dist/execute-dev-BMTFWfFc-7MifQgpp.mjs +2014 -0
  26. package/dist/execute-dev-BMTFWfFc-7MifQgpp.mjs.map +1 -0
  27. package/dist/execute-log-Cay9hlKW-BcvKPOW1.mjs +160 -0
  28. package/dist/execute-log-Cay9hlKW-BcvKPOW1.mjs.map +1 -0
  29. package/dist/{graph-DgbALPDo-BEHF94BN.mjs → graph-BJgUfGB0-kvgFzT4q.mjs} +13 -7
  30. package/dist/graph-BJgUfGB0-kvgFzT4q.mjs.map +1 -0
  31. package/dist/{graph-DDpXh7S8-b-93BcHn.d.mts → graph-DqklX5Sf-BNS2aO1j.d.mts} +3 -3
  32. package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts.map +1 -0
  33. package/dist/{graph-types-C3FOaaXm-C6_rGzfn.d.mts → graph-types-N6brq1zY-1VMNwtkJ.d.mts} +88 -5
  34. package/dist/graph-types-N6brq1zY-1VMNwtkJ.d.mts.map +1 -0
  35. package/dist/{index-BQVrMGfe.d.mts → index-DryPyF9U.d.mts} +3 -3
  36. package/dist/{index-BQVrMGfe.d.mts.map → index-DryPyF9U.d.mts.map} +1 -1
  37. package/dist/index.d.mts +3 -3
  38. package/dist/index.mjs +2 -2
  39. package/dist/internal-error-BIc-ehme-Ck_lgxD_.mjs +18 -0
  40. package/dist/internal-error-BIc-ehme-Ck_lgxD_.mjs.map +1 -0
  41. package/dist/local-target-DnA2E8IN.mjs +47 -0
  42. package/dist/local-target-DnA2E8IN.mjs.map +1 -0
  43. package/dist/local-target.d.mts +1 -1
  44. package/dist/local-target.mjs +2 -46
  45. package/dist/{nextjs-DLyeRR7M-D47aMmfr.d.mts → nextjs-DLyeRR7M-DZODs9tk.d.mts} +3 -3
  46. package/dist/{nextjs-DLyeRR7M-D47aMmfr.d.mts.map → nextjs-DLyeRR7M-DZODs9tk.d.mts.map} +1 -1
  47. package/dist/nextjs-control.d.mts +4 -4
  48. package/dist/nextjs-control.mjs +138 -34
  49. package/dist/nextjs-control.mjs.map +1 -1
  50. package/dist/nextjs.d.mts +1 -1
  51. package/dist/node-control.d.mts +3 -3
  52. package/dist/node-control.mjs +21814 -55
  53. package/dist/node-control.mjs.map +1 -1
  54. package/dist/node.d.mts +2 -2
  55. package/dist/pipeline-AoW8zq4I-Dg8xQ7nC.mjs +452 -0
  56. package/dist/pipeline-AoW8zq4I-Dg8xQ7nC.mjs.map +1 -0
  57. package/dist/report.d.mts +4 -3
  58. package/dist/report.d.mts.map +1 -1
  59. package/dist/report.mjs +4 -1
  60. package/dist/report.mjs.map +1 -1
  61. package/dist/result-D95kAAek.mjs +247 -0
  62. package/dist/result-D95kAAek.mjs.map +1 -0
  63. package/dist/run-alchemy-D44OZlyB-Cw5CVbUQ.mjs +93 -0
  64. package/dist/run-alchemy-D44OZlyB-Cw5CVbUQ.mjs.map +1 -0
  65. package/dist/run-report-C2o98uD--AX8kpz4Q.mjs +60 -0
  66. package/dist/run-report-C2o98uD--AX8kpz4Q.mjs.map +1 -0
  67. package/dist/service-rpc.d.mts +2 -2
  68. package/dist/service-rpc.mjs +2 -2
  69. package/dist/testing.d.mts +1 -1
  70. package/package.json +17 -21
  71. package/src/exports/control.ts +1 -0
  72. package/src/exports/testing.ts +5 -0
  73. package/dist/app-config-Cbv_lA38-BHJsd1DF.d.mts.map +0 -1
  74. package/dist/bin.mjs +0 -3283
  75. package/dist/bin.mjs.map +0 -1
  76. package/dist/config-whuqZ5xT.d.mts +0 -1
  77. package/dist/deploy-C4DxNkJ9-D73lmBqy.mjs +0 -313
  78. package/dist/deploy-C4DxNkJ9-D73lmBqy.mjs.map +0 -1
  79. package/dist/deploy-whuqZ5xT.d.mts +0 -1
  80. package/dist/graph-DDpXh7S8-b-93BcHn.d.mts.map +0 -1
  81. package/dist/graph-DgbALPDo-BEHF94BN.mjs.map +0 -1
  82. package/dist/graph-types-C3FOaaXm-C6_rGzfn.d.mts.map +0 -1
  83. package/dist/local-target.mjs.map +0 -1
@@ -1,5 +1,6 @@
1
- import * as fs from "node:fs";
2
- import * as path from "node:path";
1
+ import { n as isWithin, t as assertBundleSymlinksStayInside } from "./dist-CVk7Pk4B.mjs";
2
+ import * as fs$1 from "node:fs";
3
+ import * as path$1 from "node:path";
3
4
  import { fileURLToPath } from "node:url";
4
5
  import { build } from "esbuild";
5
6
  //#region ../../0-framework/2-authoring/nextjs/dist/control.mjs
@@ -16,10 +17,11 @@ import { build } from "esbuild";
16
17
  * `outputFileTracingRoot` is the monorepo root) is *read from Next's own build
17
18
  * manifest* (`.next/required-server-files.json`'s `relativeAppDir`), never walked
18
19
  * for or computed from a hardcoded depth. It does not launder: node_modules is
19
- * shipped exactly as `next build` produced it, so a symlinked (non-hoisted)
20
- * node_modules is the packager's hard error the same misconfiguration crashes
21
- * the standalone server at boot, so it must be a flat install (npm, or pnpm/bun
22
- * with a hoisted node-linker).
20
+ * shipped exactly as `next build` produced it. The packager preserves a link
21
+ * only after resolving its target inside the assembled bundle, and rejects
22
+ * escaping links. When Next records an in-root package link but omits its target
23
+ * from standalone (seen with pnpm's virtual store), assembly stages that exact
24
+ * target from `outputFileTracingRoot` so the artifact remains self-contained.
23
25
  *
24
26
  * Artifact layout: `<workDir>/main.mjs` (our wrapper) + `<workDir>/bundle/`
25
27
  * (the standalone tree, with static/public copied in). The packager adds
@@ -33,6 +35,18 @@ import { build } from "esbuild";
33
35
  function isNextjsBuild(descriptor) {
34
36
  return descriptor.type === "nextjs" && "appDir" in descriptor && typeof descriptor.appDir === "string";
35
37
  }
38
+ function readServerFilesManifest(appDir) {
39
+ const manifestPath = path$1.join(appDir, ".next", "required-server-files.json");
40
+ if (!fs$1.existsSync(manifestPath)) throw new Error(`no ${path$1.join(".next", "required-server-files.json")} under ${appDir} — run \`next build\` with output: "standalone" first.`);
41
+ const manifest = JSON.parse(fs$1.readFileSync(manifestPath, "utf8"));
42
+ const relativeAppDir = manifest?.relativeAppDir;
43
+ const tracingRoot = manifest?.config?.outputFileTracingRoot;
44
+ return {
45
+ path: manifestPath,
46
+ relativeAppDir: typeof relativeAppDir === "string" ? relativeAppDir : void 0,
47
+ tracingRoot: typeof tracingRoot === "string" ? path$1.resolve(appDir, tracingRoot) : void 0
48
+ };
49
+ }
36
50
  /**
37
51
  * The app's own subpath within `.next/standalone`, as an OS-relative path. Next
38
52
  * mirrors the app's location under `outputFileTracingRoot` (deep, when that's the
@@ -41,41 +55,131 @@ function isNextjsBuild(descriptor) {
41
55
  * that subpath. Older Next lacks the field; fall back to computing it from the
42
56
  * same manifest's `config.outputFileTracingRoot`.
43
57
  */
44
- function nextAppRel(appDir) {
45
- const manifestPath = path.join(appDir, ".next", "required-server-files.json");
46
- if (!fs.existsSync(manifestPath)) throw new Error(`no ${path.join(".next", "required-server-files.json")} under ${appDir} run \`next build\` with output: "standalone" first.`);
47
- const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
48
- const relativeAppDir = manifest?.relativeAppDir;
49
- const tracingRoot = manifest?.config?.outputFileTracingRoot;
50
- const posixRel = typeof relativeAppDir === "string" ? relativeAppDir : typeof tracingRoot === "string" ? path.relative(tracingRoot, appDir).split(path.sep).join("/") : void 0;
51
- if (posixRel === void 0) throw new Error(`${manifestPath} records neither relativeAppDir nor config.outputFileTracingRoot — cannot locate the standalone server`);
52
- return posixRel.split("/").join(path.sep);
58
+ function appRelFrom(manifest, appDir) {
59
+ const posixRel = manifest.relativeAppDir ?? (manifest.tracingRoot === void 0 ? void 0 : path$1.relative(manifest.tracingRoot, appDir).split(path$1.sep).join("/"));
60
+ if (posixRel === void 0) throw new Error(`${manifest.path} records neither relativeAppDir nor config.outputFileTracingRoot cannot locate the standalone server`);
61
+ const rel = posixRel.split("/").join(path$1.sep);
62
+ if (path$1.isAbsolute(rel) || !isWithin(appDir, path$1.join(appDir, rel))) throw new Error(`${manifest.path} records an app location that escapes its tracing root (${posixRel}) — refusing to stage outside the bundle`);
63
+ return rel;
64
+ }
65
+ async function lstatIfPresent(candidate) {
66
+ try {
67
+ return await fs$1.promises.lstat(candidate);
68
+ } catch (error) {
69
+ if (error instanceof Error && Reflect.get(error, "code") === "ENOENT") return void 0;
70
+ throw error;
71
+ }
72
+ }
73
+ /** Do not write through an existing link while repairing a missing target. */
74
+ async function hasSymlinkAncestor(root, candidate) {
75
+ const relative = path$1.relative(root, path$1.dirname(candidate));
76
+ let cursor = root;
77
+ for (const segment of relative.split(path$1.sep).filter(Boolean)) {
78
+ cursor = path$1.join(cursor, segment);
79
+ const stat = await lstatIfPresent(cursor);
80
+ if (stat === void 0) return false;
81
+ if (stat.isSymbolicLink()) return true;
82
+ }
83
+ return false;
84
+ }
85
+ async function collectSymlinks(root) {
86
+ const links = [];
87
+ async function visit(directory) {
88
+ for (const entry of await fs$1.promises.readdir(directory, { withFileTypes: true })) {
89
+ const entryPath = path$1.join(directory, entry.name);
90
+ if (entry.isSymbolicLink()) links.push(entryPath);
91
+ else if (entry.isDirectory()) await visit(entryPath);
92
+ }
93
+ }
94
+ await visit(root);
95
+ return links;
96
+ }
97
+ /** In-bundle link targets that the standalone tree does not contain — the
98
+ * repairs staging has to make. */
99
+ async function missingLinkTargets(bundleDir) {
100
+ const missing = [];
101
+ for (const linkPath of await collectSymlinks(bundleDir)) {
102
+ const rawTarget = await fs$1.promises.readlink(linkPath);
103
+ if (path$1.isAbsolute(rawTarget)) continue;
104
+ const target = path$1.resolve(path$1.dirname(linkPath), rawTarget);
105
+ if (!isWithin(bundleDir, target) || await lstatIfPresent(target) !== void 0) continue;
106
+ if (await hasSymlinkAncestor(bundleDir, target)) continue;
107
+ missing.push(target);
108
+ }
109
+ return missing;
110
+ }
111
+ /**
112
+ * pnpm can leave a traced hoist link in standalone while omitting the virtual-
113
+ * store directory it targets. The same target still exists at the corresponding
114
+ * path under outputFileTracingRoot. Stage only that exact, real in-root target;
115
+ * unsafe or genuinely unavailable links remain for the packager to reject.
116
+ */
117
+ async function stageMissingStandaloneLinkTargets(bundleDir, manifest) {
118
+ const tracingRoot = manifest.tracingRoot;
119
+ if (tracingRoot === void 0) {
120
+ if ((await missingLinkTargets(bundleDir)).length === 0) return [];
121
+ throw new Error(`${manifest.path} records no config.outputFileTracingRoot, but the standalone tree contains symlinks whose targets Next omitted — the source root those targets must be staged from is unknown. Rebuild with a Next version that records config.outputFileTracingRoot, or set outputFileTracingRoot in next.config.`);
122
+ }
123
+ if (await lstatIfPresent(tracingRoot) === void 0) return [];
124
+ const tracedRootReal = await fs$1.promises.realpath(tracingRoot);
125
+ const stagedSources = /* @__PURE__ */ new Set();
126
+ let staged = true;
127
+ while (staged) {
128
+ staged = false;
129
+ for (const target of await missingLinkTargets(bundleDir)) {
130
+ const standaloneRelative = path$1.relative(bundleDir, target);
131
+ const source = path$1.resolve(tracingRoot, standaloneRelative);
132
+ if (await lstatIfPresent(source) === void 0) continue;
133
+ if (!isWithin(tracedRootReal, await fs$1.promises.realpath(source))) continue;
134
+ await fs$1.promises.mkdir(path$1.dirname(target), { recursive: true });
135
+ await fs$1.promises.cp(source, target, {
136
+ recursive: true,
137
+ verbatimSymlinks: true
138
+ });
139
+ stagedSources.add(source);
140
+ staged = true;
141
+ }
142
+ }
143
+ return [...stagedSources];
53
144
  }
54
145
  /** The built standalone server.js for a nextjs build — `appDir`'s standalone root plus the app subpath Next recorded. Single-sourced so `assemble()` (deploy) and the integration-test seam can't drift. */
55
146
  function standaloneServerPath(build) {
56
- const appDir = path.resolve(path.dirname(fileURLToPath(build.module)), build.appDir);
57
- return path.join(appDir, ".next", "standalone", nextAppRel(appDir), "server.js");
147
+ const appDir = path$1.resolve(path$1.dirname(fileURLToPath(build.module)), build.appDir);
148
+ const manifest = readServerFilesManifest(appDir);
149
+ return path$1.join(appDir, ".next", "standalone", appRelFrom(manifest, appDir), "server.js");
58
150
  }
59
151
  async function assemble(input) {
60
152
  if (!isNextjsBuild(input.build)) throw new Error(`@prisma/composer/nextjs/control: expected a "nextjs" build adapter (with appDir), got "${input.build.type}".`);
61
153
  const buildDescriptor = input.build;
62
- const appDir = path.resolve(path.dirname(fileURLToPath(buildDescriptor.module)), buildDescriptor.appDir);
63
- const standaloneRoot = path.join(appDir, ".next", "standalone");
64
- if (!fs.existsSync(standaloneRoot)) throw new Error(`no ${path.join(".next", "standalone")} under ${appDir} — run \`next build\` with output: "standalone" first.`);
65
- const appRel = nextAppRel(appDir);
66
- const workDir = path.join(input.cwd, ".prisma-composer", "artifacts", input.address);
67
- await fs.promises.rm(workDir, {
154
+ const appDir = path$1.resolve(path$1.dirname(fileURLToPath(buildDescriptor.module)), buildDescriptor.appDir);
155
+ const standaloneRoot = path$1.join(appDir, ".next", "standalone");
156
+ if (!fs$1.existsSync(standaloneRoot)) throw new Error(`no ${path$1.join(".next", "standalone")} under ${appDir} — run \`next build\` with output: "standalone" first.`);
157
+ const manifest = readServerFilesManifest(appDir);
158
+ const appRel = appRelFrom(manifest, appDir);
159
+ const workDir = path$1.join(input.cwd, ".prisma-composer", "artifacts", input.address);
160
+ await fs$1.promises.rm(workDir, {
68
161
  recursive: true,
69
162
  force: true
70
163
  });
71
- await fs.promises.mkdir(workDir, { recursive: true });
72
- const bundleDir = path.join(workDir, "bundle");
73
- await fs.promises.cp(standaloneRoot, bundleDir, { recursive: true });
74
- const appOut = path.join(bundleDir, appRel);
75
- const staticSrc = path.join(appDir, ".next", "static");
76
- if (fs.existsSync(staticSrc)) await fs.promises.cp(staticSrc, path.join(appOut, ".next", "static"), { recursive: true });
77
- const publicSrc = path.join(appDir, "public");
78
- if (fs.existsSync(publicSrc)) await fs.promises.cp(publicSrc, path.join(appOut, "public"), { recursive: true });
164
+ await fs$1.promises.mkdir(workDir, { recursive: true });
165
+ const bundleDir = path$1.join(workDir, "bundle");
166
+ await fs$1.promises.cp(standaloneRoot, bundleDir, {
167
+ recursive: true,
168
+ verbatimSymlinks: true
169
+ });
170
+ const stagedLinkTargets = await stageMissingStandaloneLinkTargets(bundleDir, manifest);
171
+ const appOut = path$1.join(bundleDir, appRel);
172
+ const staticSrc = path$1.join(appDir, ".next", "static");
173
+ if (fs$1.existsSync(staticSrc)) await fs$1.promises.cp(staticSrc, path$1.join(appOut, ".next", "static"), {
174
+ recursive: true,
175
+ verbatimSymlinks: true
176
+ });
177
+ const publicSrc = path$1.join(appDir, "public");
178
+ if (fs$1.existsSync(publicSrc)) await fs$1.promises.cp(publicSrc, path$1.join(appOut, "public"), {
179
+ recursive: true,
180
+ verbatimSymlinks: true
181
+ });
182
+ await assertBundleSymlinksStayInside(bundleDir);
79
183
  await build({
80
184
  entryPoints: { main: fileURLToPath(buildDescriptor.module) },
81
185
  outdir: workDir,
@@ -85,11 +189,11 @@ async function assemble(input) {
85
189
  external: ["bun", "bun:*"],
86
190
  outExtension: { ".js": ".mjs" }
87
191
  });
88
- if (!fs.existsSync(path.join(workDir, "main.mjs"))) throw new Error(`esbuild produced no main.mjs in ${workDir}`);
192
+ if (!fs$1.existsSync(path$1.join(workDir, "main.mjs"))) throw new Error(`esbuild produced no main.mjs in ${workDir}`);
89
193
  return {
90
194
  dir: workDir,
91
- entry: path.posix.join("bundle", appRel.split(path.sep).join("/"), "server.js"),
92
- watch: [standaloneRoot]
195
+ entry: path$1.posix.join("bundle", appRel.split(path$1.sep).join("/"), "server.js"),
196
+ watch: [standaloneRoot, ...stagedLinkTargets]
93
197
  };
94
198
  }
95
199
  /** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */
@@ -1 +1 @@
1
- {"version":3,"file":"nextjs-control.mjs","names":[],"sources":["../../../0-framework/2-authoring/nextjs/dist/control.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { build } from \"esbuild\";\n//#region src/control/build.ts\n/**\n* The extension's control entry (ADR-0017): `nextjsBuild()` returns the build\n* descriptor `prisma-composer.config.ts` lists. Deploy-only (ADR-0005): the user\n* runs `next build` (`output: \"standalone\"`); `assemble` then performs the\n* *documented* Next standalone deploy — it ships the standalone tree and copies\n* in the client assets Next deliberately omits (`.next/static`, `public/`) — and\n* adds the framework's boot wrapper. This is the canonical `cp` step from the\n* Next docs, run at deploy so no app needs a build-script for it.\n*\n* It does not guess: the app's location inside the standalone tree (deep, when\n* `outputFileTracingRoot` is the monorepo root) is *read from Next's own build\n* manifest* (`.next/required-server-files.json`'s `relativeAppDir`), never walked\n* for or computed from a hardcoded depth. It does not launder: node_modules is\n* shipped exactly as `next build` produced it, so a symlinked (non-hoisted)\n* node_modules is the packager's hard error — the same misconfiguration crashes\n* the standalone server at boot, so it must be a flat install (npm, or pnpm/bun\n* with a hoisted node-linker).\n*\n* Artifact layout: `<workDir>/main.mjs` (our wrapper) + `<workDir>/bundle/`\n* (the standalone tree, with static/public copied in). The packager adds\n* `bootstrap.js` + the manifest at the root; bootstrap imports main.mjs, whose\n* run() dynamically imports `./bundle/<relativeAppDir>/server.js`.\n*\n* Paths are file-relative (ADR-0004): `appDir` resolves against\n* `dirname(build.module)`.\n*/\n/** Narrows the shared BuildAdapter to this extension's own descriptor — the value-level mirror of the registry routing on (extension, type). */\nfunction isNextjsBuild(descriptor) {\n\treturn descriptor.type === \"nextjs\" && \"appDir\" in descriptor && typeof descriptor.appDir === \"string\";\n}\n/**\n* The app's own subpath within `.next/standalone`, as an OS-relative path. Next\n* mirrors the app's location under `outputFileTracingRoot` (deep, when that's the\n* monorepo root); rather than walk the tree for `server.js`, we read where Next\n* put it from `.next/required-server-files.json` — `relativeAppDir` is exactly\n* that subpath. Older Next lacks the field; fall back to computing it from the\n* same manifest's `config.outputFileTracingRoot`.\n*/\nfunction nextAppRel(appDir) {\n\tconst manifestPath = path.join(appDir, \".next\", \"required-server-files.json\");\n\tif (!fs.existsSync(manifestPath)) throw new Error(`no ${path.join(\".next\", \"required-server-files.json\")} under ${appDir} — run \\`next build\\` with output: \"standalone\" first.`);\n\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf8\"));\n\tconst relativeAppDir = manifest?.relativeAppDir;\n\tconst tracingRoot = manifest?.config?.outputFileTracingRoot;\n\tconst posixRel = typeof relativeAppDir === \"string\" ? relativeAppDir : typeof tracingRoot === \"string\" ? path.relative(tracingRoot, appDir).split(path.sep).join(\"/\") : void 0;\n\tif (posixRel === void 0) throw new Error(`${manifestPath} records neither relativeAppDir nor config.outputFileTracingRoot — cannot locate the standalone server`);\n\treturn posixRel.split(\"/\").join(path.sep);\n}\n/** The built standalone server.js for a nextjs build — `appDir`'s standalone root plus the app subpath Next recorded. Single-sourced so `assemble()` (deploy) and the integration-test seam can't drift. */\nfunction standaloneServerPath(build) {\n\tconst appDir = path.resolve(path.dirname(fileURLToPath(build.module)), build.appDir);\n\treturn path.join(appDir, \".next\", \"standalone\", nextAppRel(appDir), \"server.js\");\n}\nasync function assemble(input) {\n\tif (!isNextjsBuild(input.build)) throw new Error(`@prisma/composer/nextjs/control: expected a \"nextjs\" build adapter (with appDir), got \"${input.build.type}\".`);\n\tconst buildDescriptor = input.build;\n\tconst appDir = path.resolve(path.dirname(fileURLToPath(buildDescriptor.module)), buildDescriptor.appDir);\n\tconst standaloneRoot = path.join(appDir, \".next\", \"standalone\");\n\tif (!fs.existsSync(standaloneRoot)) throw new Error(`no ${path.join(\".next\", \"standalone\")} under ${appDir} — run \\`next build\\` with output: \"standalone\" first.`);\n\tconst appRel = nextAppRel(appDir);\n\tconst workDir = path.join(input.cwd, \".prisma-composer\", \"artifacts\", input.address);\n\tawait fs.promises.rm(workDir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tawait fs.promises.mkdir(workDir, { recursive: true });\n\tconst bundleDir = path.join(workDir, \"bundle\");\n\tawait fs.promises.cp(standaloneRoot, bundleDir, { recursive: true });\n\tconst appOut = path.join(bundleDir, appRel);\n\tconst staticSrc = path.join(appDir, \".next\", \"static\");\n\tif (fs.existsSync(staticSrc)) await fs.promises.cp(staticSrc, path.join(appOut, \".next\", \"static\"), { recursive: true });\n\tconst publicSrc = path.join(appDir, \"public\");\n\tif (fs.existsSync(publicSrc)) await fs.promises.cp(publicSrc, path.join(appOut, \"public\"), { recursive: true });\n\tawait build({\n\t\tentryPoints: { main: fileURLToPath(buildDescriptor.module) },\n\t\toutdir: workDir,\n\t\tbundle: true,\n\t\tformat: \"esm\",\n\t\tplatform: \"node\",\n\t\texternal: [\"bun\", \"bun:*\"],\n\t\toutExtension: { \".js\": \".mjs\" }\n\t});\n\tif (!fs.existsSync(path.join(workDir, \"main.mjs\"))) throw new Error(`esbuild produced no main.mjs in ${workDir}`);\n\treturn {\n\t\tdir: workDir,\n\t\tentry: path.posix.join(\"bundle\", appRel.split(path.sep).join(\"/\"), \"server.js\"),\n\t\twatch: [standaloneRoot]\n\t};\n}\n/** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */\nconst nextjsBuild = () => ({\n\tid: \"@prisma/composer/nextjs\",\n\tnodes: { nextjs: {\n\t\tkind: \"build\",\n\t\tassemble\n\t} }\n});\n//#endregion\nexport { assemble, nextjsBuild, standaloneServerPath };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,cAAc,YAAY;CAClC,OAAO,WAAW,SAAS,YAAY,YAAY,cAAc,OAAO,WAAW,WAAW;AAC/F;;;;;;;;;AASA,SAAS,WAAW,QAAQ;CAC3B,MAAM,eAAe,KAAK,KAAK,QAAQ,SAAS,4BAA4B;CAC5E,IAAI,CAAC,GAAG,WAAW,YAAY,GAAG,MAAM,IAAI,MAAM,MAAM,KAAK,KAAK,SAAS,4BAA4B,EAAE,SAAS,OAAO,uDAAuD;CAChL,MAAM,WAAW,KAAK,MAAM,GAAG,aAAa,cAAc,MAAM,CAAC;CACjE,MAAM,iBAAiB,UAAU;CACjC,MAAM,cAAc,UAAU,QAAQ;CACtC,MAAM,WAAW,OAAO,mBAAmB,WAAW,iBAAiB,OAAO,gBAAgB,WAAW,KAAK,SAAS,aAAa,MAAM,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK;CAC7K,IAAI,aAAa,KAAK,GAAG,MAAM,IAAI,MAAM,GAAG,aAAa,uGAAuG;CAChK,OAAO,SAAS,MAAM,GAAG,CAAC,CAAC,KAAK,KAAK,GAAG;AACzC;;AAEA,SAAS,qBAAqB,O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AS,GAAG,WAAW,KAAK,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;CAC9G,MAAM,MAAM;EACX,aAAa,EAAE,MAAM,cAAc,gBAAgB,MAAM,EAAE;EAC3D,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,UAAU,CAAC,OAAO,OAAO;EACzB,cAAc,EAAE,OAAO,OAAO;CAC/B,CAAC;CACD,IAAI,CAAC,GAAG,WAAW,KAAK,KAAK,SAAS,UAAU,CAAC,GAAG,MAAM,IAAI,MAAM,mCAAmC,SAAS;CAChH,OAAO;EACN,KAAK;EACL,OAAO,KAAK,MAAM,KAAK,UAAU,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,WAAW;EAC9E,OAAO,CAAC,cAAc;CACvB;AACD;;AAEA,MAAM,qBAAqB;CAC1B,IAAI;CACJ,OAAO,EAAE,QAAQ;EAChB,MAAM;EACN;CACD,EAAE;AACH"}
1
+ {"version":3,"file":"nextjs-control.mjs","names":["path","fs"],"sources":["../../../0-framework/2-authoring/nextjs/dist/control.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { assertBundleSymlinksStayInside, isWithin } from \"@internal/bundle-paths\";\nimport { build } from \"esbuild\";\n//#region src/control/build.ts\n/**\n* The extension's control entry (ADR-0017): `nextjsBuild()` returns the build\n* descriptor `prisma-composer.config.ts` lists. Deploy-only (ADR-0005): the user\n* runs `next build` (`output: \"standalone\"`); `assemble` then performs the\n* *documented* Next standalone deploy — it ships the standalone tree and copies\n* in the client assets Next deliberately omits (`.next/static`, `public/`) — and\n* adds the framework's boot wrapper. This is the canonical `cp` step from the\n* Next docs, run at deploy so no app needs a build-script for it.\n*\n* It does not guess: the app's location inside the standalone tree (deep, when\n* `outputFileTracingRoot` is the monorepo root) is *read from Next's own build\n* manifest* (`.next/required-server-files.json`'s `relativeAppDir`), never walked\n* for or computed from a hardcoded depth. It does not launder: node_modules is\n* shipped exactly as `next build` produced it. The packager preserves a link\n* only after resolving its target inside the assembled bundle, and rejects\n* escaping links. When Next records an in-root package link but omits its target\n* from standalone (seen with pnpm's virtual store), assembly stages that exact\n* target from `outputFileTracingRoot` so the artifact remains self-contained.\n*\n* Artifact layout: `<workDir>/main.mjs` (our wrapper) + `<workDir>/bundle/`\n* (the standalone tree, with static/public copied in). The packager adds\n* `bootstrap.js` + the manifest at the root; bootstrap imports main.mjs, whose\n* run() dynamically imports `./bundle/<relativeAppDir>/server.js`.\n*\n* Paths are file-relative (ADR-0004): `appDir` resolves against\n* `dirname(build.module)`.\n*/\n/** Narrows the shared BuildAdapter to this extension's own descriptor — the value-level mirror of the registry routing on (extension, type). */\nfunction isNextjsBuild(descriptor) {\n\treturn descriptor.type === \"nextjs\" && \"appDir\" in descriptor && typeof descriptor.appDir === \"string\";\n}\nfunction readServerFilesManifest(appDir) {\n\tconst manifestPath = path.join(appDir, \".next\", \"required-server-files.json\");\n\tif (!fs.existsSync(manifestPath)) throw new Error(`no ${path.join(\".next\", \"required-server-files.json\")} under ${appDir} — run \\`next build\\` with output: \"standalone\" first.`);\n\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf8\"));\n\tconst relativeAppDir = manifest?.relativeAppDir;\n\tconst tracingRoot = manifest?.config?.outputFileTracingRoot;\n\treturn {\n\t\tpath: manifestPath,\n\t\trelativeAppDir: typeof relativeAppDir === \"string\" ? relativeAppDir : void 0,\n\t\ttracingRoot: typeof tracingRoot === \"string\" ? path.resolve(appDir, tracingRoot) : void 0\n\t};\n}\n/**\n* The app's own subpath within `.next/standalone`, as an OS-relative path. Next\n* mirrors the app's location under `outputFileTracingRoot` (deep, when that's the\n* monorepo root); rather than walk the tree for `server.js`, we read where Next\n* put it from `.next/required-server-files.json` — `relativeAppDir` is exactly\n* that subpath. Older Next lacks the field; fall back to computing it from the\n* same manifest's `config.outputFileTracingRoot`.\n*/\nfunction appRelFrom(manifest, appDir) {\n\tconst posixRel = manifest.relativeAppDir ?? (manifest.tracingRoot === void 0 ? void 0 : path.relative(manifest.tracingRoot, appDir).split(path.sep).join(\"/\"));\n\tif (posixRel === void 0) throw new Error(`${manifest.path} records neither relativeAppDir nor config.outputFileTracingRoot — cannot locate the standalone server`);\n\tconst rel = posixRel.split(\"/\").join(path.sep);\n\tif (path.isAbsolute(rel) || !isWithin(appDir, path.join(appDir, rel))) throw new Error(`${manifest.path} records an app location that escapes its tracing root (${posixRel}) — refusing to stage outside the bundle`);\n\treturn rel;\n}\nasync function lstatIfPresent(candidate) {\n\ttry {\n\t\treturn await fs.promises.lstat(candidate);\n\t} catch (error) {\n\t\tif (error instanceof Error && Reflect.get(error, \"code\") === \"ENOENT\") return void 0;\n\t\tthrow error;\n\t}\n}\n/** Do not write through an existing link while repairing a missing target. */\nasync function hasSymlinkAncestor(root, candidate) {\n\tconst relative = path.relative(root, path.dirname(candidate));\n\tlet cursor = root;\n\tfor (const segment of relative.split(path.sep).filter(Boolean)) {\n\t\tcursor = path.join(cursor, segment);\n\t\tconst stat = await lstatIfPresent(cursor);\n\t\tif (stat === void 0) return false;\n\t\tif (stat.isSymbolicLink()) return true;\n\t}\n\treturn false;\n}\nasync function collectSymlinks(root) {\n\tconst links = [];\n\tasync function visit(directory) {\n\t\tfor (const entry of await fs.promises.readdir(directory, { withFileTypes: true })) {\n\t\t\tconst entryPath = path.join(directory, entry.name);\n\t\t\tif (entry.isSymbolicLink()) links.push(entryPath);\n\t\t\telse if (entry.isDirectory()) await visit(entryPath);\n\t\t}\n\t}\n\tawait visit(root);\n\treturn links;\n}\n/** In-bundle link targets that the standalone tree does not contain — the\n* repairs staging has to make. */\nasync function missingLinkTargets(bundleDir) {\n\tconst missing = [];\n\tfor (const linkPath of await collectSymlinks(bundleDir)) {\n\t\tconst rawTarget = await fs.promises.readlink(linkPath);\n\t\tif (path.isAbsolute(rawTarget)) continue;\n\t\tconst target = path.resolve(path.dirname(linkPath), rawTarget);\n\t\tif (!isWithin(bundleDir, target) || await lstatIfPresent(target) !== void 0) continue;\n\t\tif (await hasSymlinkAncestor(bundleDir, target)) continue;\n\t\tmissing.push(target);\n\t}\n\treturn missing;\n}\n/**\n* pnpm can leave a traced hoist link in standalone while omitting the virtual-\n* store directory it targets. The same target still exists at the corresponding\n* path under outputFileTracingRoot. Stage only that exact, real in-root target;\n* unsafe or genuinely unavailable links remain for the packager to reject.\n*/\nasync function stageMissingStandaloneLinkTargets(bundleDir, manifest) {\n\tconst tracingRoot = manifest.tracingRoot;\n\tif (tracingRoot === void 0) {\n\t\tif ((await missingLinkTargets(bundleDir)).length === 0) return [];\n\t\tthrow new Error(`${manifest.path} records no config.outputFileTracingRoot, but the standalone tree contains symlinks whose targets Next omitted — the source root those targets must be staged from is unknown. Rebuild with a Next version that records config.outputFileTracingRoot, or set outputFileTracingRoot in next.config.`);\n\t}\n\tif (await lstatIfPresent(tracingRoot) === void 0) return [];\n\tconst tracedRootReal = await fs.promises.realpath(tracingRoot);\n\tconst stagedSources = /* @__PURE__ */ new Set();\n\tlet staged = true;\n\twhile (staged) {\n\t\tstaged = false;\n\t\tfor (const target of await missingLinkTargets(bundleDir)) {\n\t\t\tconst standaloneRelative = path.relative(bundleDir, target);\n\t\t\tconst source = path.resolve(tracingRoot, standaloneRelative);\n\t\t\tif (await lstatIfPresent(source) === void 0) continue;\n\t\t\tif (!isWithin(tracedRootReal, await fs.promises.realpath(source))) continue;\n\t\t\tawait fs.promises.mkdir(path.dirname(target), { recursive: true });\n\t\t\tawait fs.promises.cp(source, target, {\n\t\t\t\trecursive: true,\n\t\t\t\tverbatimSymlinks: true\n\t\t\t});\n\t\t\tstagedSources.add(source);\n\t\t\tstaged = true;\n\t\t}\n\t}\n\treturn [...stagedSources];\n}\n/** The built standalone server.js for a nextjs build — `appDir`'s standalone root plus the app subpath Next recorded. Single-sourced so `assemble()` (deploy) and the integration-test seam can't drift. */\nfunction standaloneServerPath(build) {\n\tconst appDir = path.resolve(path.dirname(fileURLToPath(build.module)), build.appDir);\n\tconst manifest = readServerFilesManifest(appDir);\n\treturn path.join(appDir, \".next\", \"standalone\", appRelFrom(manifest, appDir), \"server.js\");\n}\nasync function assemble(input) {\n\tif (!isNextjsBuild(input.build)) throw new Error(`@prisma/composer/nextjs/control: expected a \"nextjs\" build adapter (with appDir), got \"${input.build.type}\".`);\n\tconst buildDescriptor = input.build;\n\tconst appDir = path.resolve(path.dirname(fileURLToPath(buildDescriptor.module)), buildDescriptor.appDir);\n\tconst standaloneRoot = path.join(appDir, \".next\", \"standalone\");\n\tif (!fs.existsSync(standaloneRoot)) throw new Error(`no ${path.join(\".next\", \"standalone\")} under ${appDir} — run \\`next build\\` with output: \"standalone\" first.`);\n\tconst manifest = readServerFilesManifest(appDir);\n\tconst appRel = appRelFrom(manifest, appDir);\n\tconst workDir = path.join(input.cwd, \".prisma-composer\", \"artifacts\", input.address);\n\tawait fs.promises.rm(workDir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tawait fs.promises.mkdir(workDir, { recursive: true });\n\tconst bundleDir = path.join(workDir, \"bundle\");\n\tawait fs.promises.cp(standaloneRoot, bundleDir, {\n\t\trecursive: true,\n\t\tverbatimSymlinks: true\n\t});\n\tconst stagedLinkTargets = await stageMissingStandaloneLinkTargets(bundleDir, manifest);\n\tconst appOut = path.join(bundleDir, appRel);\n\tconst staticSrc = path.join(appDir, \".next\", \"static\");\n\tif (fs.existsSync(staticSrc)) await fs.promises.cp(staticSrc, path.join(appOut, \".next\", \"static\"), {\n\t\trecursive: true,\n\t\tverbatimSymlinks: true\n\t});\n\tconst publicSrc = path.join(appDir, \"public\");\n\tif (fs.existsSync(publicSrc)) await fs.promises.cp(publicSrc, path.join(appOut, \"public\"), {\n\t\trecursive: true,\n\t\tverbatimSymlinks: true\n\t});\n\tawait assertBundleSymlinksStayInside(bundleDir);\n\tawait build({\n\t\tentryPoints: { main: fileURLToPath(buildDescriptor.module) },\n\t\toutdir: workDir,\n\t\tbundle: true,\n\t\tformat: \"esm\",\n\t\tplatform: \"node\",\n\t\texternal: [\"bun\", \"bun:*\"],\n\t\toutExtension: { \".js\": \".mjs\" }\n\t});\n\tif (!fs.existsSync(path.join(workDir, \"main.mjs\"))) throw new Error(`esbuild produced no main.mjs in ${workDir}`);\n\treturn {\n\t\tdir: workDir,\n\t\tentry: path.posix.join(\"bundle\", appRel.split(path.sep).join(\"/\"), \"server.js\"),\n\t\twatch: [standaloneRoot, ...stagedLinkTargets]\n\t};\n}\n/** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */\nconst nextjsBuild = () => ({\n\tid: \"@prisma/composer/nextjs\",\n\tnodes: { nextjs: {\n\t\tkind: \"build\",\n\t\tassemble\n\t} }\n});\n//#endregion\nexport { assemble, nextjsBuild, standaloneServerPath };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,SAAS,cAAc,YAAY;CAClC,OAAO,WAAW,SAAS,YAAY,YAAY,cAAc,OAAO,WAAW,WAAW;AAC/F;AACA,SAAS,wBAAwB,QAAQ;CACxC,MAAM,eAAeA,OAAK,KAAK,QAAQ,SAAS,4BAA4B;CAC5E,IAAI,CAACC,KAAG,WAAW,YAAY,GAAG,MAAM,IAAI,MAAM,MAAMD,OAAK,KAAK,SAAS,4BAA4B,EAAE,SAAS,OAAO,uDAAuD;CAChL,MAAM,WAAW,KAAK,MAAMC,KAAG,aAAa,cAAc,MAAM,CAAC;CACjE,MAAM,iBAAiB,UAAU;CACjC,MAAM,cAAc,UAAU,QAAQ;CACtC,OAAO;EACN,MAAM;EACN,gBAAgB,OAAO,mBAAmB,WAAW,iBAAiB,KAAK;EAC3E,aAAa,OAAO,gBAAgB,WAAWD,OAAK,QAAQ,QAAQ,WAAW,IAAI,KAAK;CACzF;AACD;;;;;;;;;AASA,SAAS,WAAW,UAAU,QAAQ;CACrC,MAAM,WAAW,SAAS,mBAAmB,SAAS,gBAAgB,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, t as NextjsBuildAdapter } from "./nextjs-DLyeRR7M-DZODs9tk.mjs";
2
2
  export { type NextjsBuildAdapter, nextjsBuild as default };
@@ -1,6 +1,6 @@
1
- import { a as Bundle, f as ExtensionDescriptor, i as AssembleInput } from "./app-config-Cbv_lA38-BHJsd1DF.mjs";
2
- import "./config-whuqZ5xT.mjs";
3
- import "./deploy-whuqZ5xT.mjs";
1
+ import { a as Bundle, i as AssembleInput, p as ExtensionDescriptor } from "./app-config-BinBcpPf-1akTl5h4.mjs";
2
+ import "./config-647Wkm51.mjs";
3
+ import "./deploy-647Wkm51.mjs";
4
4
  //#region ../../0-framework/2-authoring/node/dist/control.d.mts
5
5
  //#region src/control/build.d.ts
6
6
  declare function assemble(input: AssembleInput): Promise<Bundle>;