@prisma/composer 0.25.0 → 0.26.0-dev.2

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 (58) hide show
  1. package/dist/{app-config-joXc-BKm-CdcXqNMD.mjs → app-config-CGJHcFb--CIEFCG4V.mjs} +3 -3
  2. package/dist/{app-config-joXc-BKm-CdcXqNMD.mjs.map → app-config-CGJHcFb--CIEFCG4V.mjs.map} +1 -1
  3. package/dist/{app-config-jGcCcxK4-DnzGGbDS.d.mts → app-config-DyCMnkDr-CguUhanl.d.mts} +4 -4
  4. package/dist/{app-config-jGcCcxK4-DnzGGbDS.d.mts.map → app-config-DyCMnkDr-CguUhanl.d.mts.map} +1 -1
  5. package/dist/config-CdxvLFzg.mjs.map +1 -1
  6. package/dist/config-i9yR7YWi.d.mts +1 -0
  7. package/dist/config.d.mts +2 -2
  8. package/dist/config.mjs +1 -1
  9. package/dist/control.d.mts +63 -44
  10. package/dist/control.d.mts.map +1 -1
  11. package/dist/control.mjs +10 -42
  12. package/dist/control.mjs.map +1 -1
  13. package/dist/deploy-i9yR7YWi.d.mts +1 -0
  14. package/dist/deploy.d.mts +2 -2
  15. package/dist/deploy.mjs +1 -1
  16. package/dist/deploy.mjs.map +1 -1
  17. package/dist/deployment-summary-37e6WEuh-BOTJynIi.mjs +168 -0
  18. package/dist/deployment-summary-37e6WEuh-BOTJynIi.mjs.map +1 -0
  19. package/dist/deployment-summary-CU-eVvJM-c3AqO52N.d.mts +26 -0
  20. package/dist/deployment-summary-CU-eVvJM-c3AqO52N.d.mts.map +1 -0
  21. package/dist/dev-Bmq-eLnv-DsenQNJM.mjs +154 -0
  22. package/dist/dev-Bmq-eLnv-DsenQNJM.mjs.map +1 -0
  23. package/dist/{execute-deploy-destroy-CvKCwVkD-Di3Ooeip.mjs → execute-deploy-destroy-c0eko3AO-BoK0-r1U.mjs} +43 -32
  24. package/dist/execute-deploy-destroy-c0eko3AO-BoK0-r1U.mjs.map +1 -0
  25. package/dist/{execute-dev-BLCK5wF7-CJvkj5wl.mjs → execute-dev-BICPaq1g-DQccw8kr.mjs} +180 -131
  26. package/dist/{execute-dev-BLCK5wF7-CJvkj5wl.mjs.map → execute-dev-BICPaq1g-DQccw8kr.mjs.map} +1 -1
  27. package/dist/{execute-log-B_zCJ17b-CE954g1a.mjs → execute-log-DivzSDBL-CBdSN2Vv.mjs} +7 -10
  28. package/dist/execute-log-DivzSDBL-CBdSN2Vv.mjs.map +1 -0
  29. package/dist/{local-target-DnA2E8IN.mjs → local-target-B4xoiDAV.mjs} +2 -2
  30. package/dist/{local-target-DnA2E8IN.mjs.map → local-target-B4xoiDAV.mjs.map} +1 -1
  31. package/dist/local-target.d.mts +1 -1
  32. package/dist/local-target.mjs +2 -2
  33. package/dist/nextjs-control.d.mts +4 -4
  34. package/dist/nextjs-control.mjs +2 -2
  35. package/dist/nextjs-control.mjs.map +1 -1
  36. package/dist/node-control.d.mts +4 -4
  37. package/dist/node-control.mjs +2 -2
  38. package/dist/node-control.mjs.map +1 -1
  39. package/dist/{pipeline-C7gNjMzJ-CzM8DNS_.mjs → pipeline-DYvl561J-DDtnkFPh.mjs} +278 -311
  40. package/dist/pipeline-DYvl561J-DDtnkFPh.mjs.map +1 -0
  41. package/dist/report.d.mts +4 -3
  42. package/dist/report.d.mts.map +1 -1
  43. package/dist/report.mjs +2 -2
  44. package/dist/report.mjs.map +1 -1
  45. package/dist/{run-alchemy-pANK8XNX-CgCpXLkG.mjs → run-alchemy-BEvB2sYQ-Cy2fhbcu.mjs} +2 -2
  46. package/dist/{run-alchemy-pANK8XNX-CgCpXLkG.mjs.map → run-alchemy-BEvB2sYQ-Cy2fhbcu.mjs.map} +1 -1
  47. package/package.json +11 -12
  48. package/skills/prisma-composer-core-concepts/SKILL.md +116 -45
  49. package/src/exports/testing.ts +1 -1
  50. package/dist/config-BGtKERz-.d.mts +0 -1
  51. package/dist/deploy-BGtKERz-.d.mts +0 -1
  52. package/dist/deployment-summary-DswOl_9E-B9MhYYDt.mjs +0 -70
  53. package/dist/deployment-summary-DswOl_9E-B9MhYYDt.mjs.map +0 -1
  54. package/dist/execute-deploy-destroy-CvKCwVkD-Di3Ooeip.mjs.map +0 -1
  55. package/dist/execute-log-B_zCJ17b-CE954g1a.mjs.map +0 -1
  56. package/dist/pipeline-C7gNjMzJ-CzM8DNS_.mjs.map +0 -1
  57. package/dist/result-CQIOBgdW.mjs +0 -247
  58. package/dist/result-CQIOBgdW.mjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
- import { t as DEV_DIR } from "./app-config-joXc-BKm-CdcXqNMD.mjs";
3
- import { n as ok, s as toStructured, t as notOk } from "./result-CQIOBgdW.mjs";
4
- import { n as resolveLocalTargets } from "./local-target-DnA2E8IN.mjs";
5
- import { t as resolveAppIdentity } from "./pipeline-C7gNjMzJ-CzM8DNS_.mjs";
2
+ import { t as DEV_DIR } from "./app-config-CGJHcFb--CIEFCG4V.mjs";
3
+ import { a as toStructured, o as notOk, s as ok } from "./dev-Bmq-eLnv-DsenQNJM.mjs";
4
+ import { n as resolveLocalTargets } from "./local-target-B4xoiDAV.mjs";
5
+ import { t as resolveAppIdentity } from "./pipeline-DYvl561J-DDtnkFPh.mjs";
6
6
  import { t as withEmulatorRetry } from "./emulator-retry-DGonap4g-S8BNrXFD.mjs";
7
7
  import * as path$1 from "node:path";
8
- //#region ../../0-framework/3-tooling/cli/dist/execute-log-B_zCJ17b.mjs
8
+ //#region ../../0-framework/3-tooling/cli/dist/execute-log-DivzSDBL.mjs
9
9
  /**
10
10
  * The log executor — run-log.ts's attach-and-tail (config → localTarget →
11
11
  * container → attach → logs) with console and signal handling removed: the
@@ -115,10 +115,7 @@ async function executeLog(input, deps, cwd) {
115
115
  const attachments = [];
116
116
  let services;
117
117
  try {
118
- const identity = deps.identity ?? await resolveAppIdentity(input.entry, input.name, cwd, {
119
- config: deps.config,
120
- configPath: deps.configPath
121
- });
118
+ const identity = deps.identity ?? await resolveAppIdentity(input.entry, input.name, cwd, input.config);
122
119
  name = identity.name;
123
120
  const resolved = await resolveLocalTargets(identity.config);
124
121
  for (const target of resolved.values()) try {
@@ -157,4 +154,4 @@ async function executeLog(input, deps, cwd) {
157
154
  //#endregion
158
155
  export { LOG_QUEUE_LIMIT, executeLog };
159
156
 
160
- //# sourceMappingURL=execute-log-B_zCJ17b-CE954g1a.mjs.map
157
+ //# sourceMappingURL=execute-log-DivzSDBL-CBdSN2Vv.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-log-DivzSDBL-CBdSN2Vv.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-log-DivzSDBL.mjs"],"sourcesContent":["import { s as toStructured } from \"./dev-Bmq-eLnv.mjs\";\nimport { t as resolveAppIdentity } from \"./pipeline-DYvl561J.mjs\";\nimport { t as withEmulatorRetry } from \"./emulator-retry-DGonap4g.mjs\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\nimport { DEV_DIR, resolveLocalTargets } from \"@internal/core/local-target\";\n//#region src/operations/execute-log.ts\n/**\n* The log executor — run-log.ts's attach-and-tail (config → localTarget →\n* container → attach → logs) with console and signal handling removed: the\n* merged stream comes back as an AsyncIterable, ended by the caller's\n* AbortSignal. Reached only by lazy import from log.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nfunction failureMessage(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** The merge queue's bound: past this, the oldest line is dropped and the\n* consumer is told via a `lines-dropped` event — a log viewer tolerates loss\n* better than the host tolerates unbounded memory growth. Exported so tests\n* can size their floods relative to the bound. */\nconst LOG_QUEUE_LIMIT = 1e4;\n/**\n* Merges every attachment's log stream into one iterable: one pump per\n* attachment pushing into a shared bounded queue. A pump's throw becomes a\n* `stream-failed` event and ends that pump only; the merged iterable ends\n* when `input.signal` aborts, when every pump ends, or when the consumer\n* stops iterating (an early `break` aborts an internal controller so the\n* pumps tear down — the generator never waits on a source that will not\n* end). No event is delivered after the iterable has ended. Address\n* filtering and `tail` apply exactly as the CLI always has.\n*/\nasync function* mergeLogStreams(attachments, input) {\n\tconst controller = new AbortController();\n\tconst { signal } = controller;\n\tconst abortInternal = () => controller.abort();\n\tif (input.signal?.aborted === true) controller.abort();\n\tinput.signal?.addEventListener(\"abort\", abortInternal, { once: true });\n\tconst queue = [];\n\tlet dropped = 0;\n\tlet done = false;\n\tlet active = attachments.length;\n\tlet wake;\n\tconst notify = () => {\n\t\twake?.();\n\t\twake = void 0;\n\t};\n\tsignal.addEventListener(\"abort\", notify, { once: true });\n\tconst emit = (event) => {\n\t\tif (done) return;\n\t\ttry {\n\t\t\tinput.onEvent?.(event);\n\t\t} catch {}\n\t};\n\tconst pump = async (attachment) => {\n\t\ttry {\n\t\t\tfor await (const { service, line } of attachment.logs(signal, { tail: input.tail ?? 0 })) {\n\t\t\t\tif (signal.aborted) return;\n\t\t\t\tif (input.address !== void 0 && service !== input.address) continue;\n\t\t\t\tif (queue.length >= 1e4) {\n\t\t\t\t\tqueue.shift();\n\t\t\t\t\tdropped += 1;\n\t\t\t\t}\n\t\t\t\tqueue.push({\n\t\t\t\t\tservice,\n\t\t\t\t\tline\n\t\t\t\t});\n\t\t\t\tnotify();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (!signal.aborted) emit({\n\t\t\t\tkind: \"stream-failed\",\n\t\t\t\tmessage: failureMessage(error)\n\t\t\t});\n\t\t} finally {\n\t\t\tactive -= 1;\n\t\t\tnotify();\n\t\t}\n\t};\n\tfor (const attachment of attachments) pump(attachment);\n\ttry {\n\t\twhile (true) {\n\t\t\tlet next = queue.shift();\n\t\t\twhile (next !== void 0) {\n\t\t\t\tif (dropped > 0) {\n\t\t\t\t\tconst count = dropped;\n\t\t\t\t\tdropped = 0;\n\t\t\t\t\temit({\n\t\t\t\t\t\tkind: \"lines-dropped\",\n\t\t\t\t\t\tcount\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tyield next;\n\t\t\t\tnext = queue.shift();\n\t\t\t}\n\t\t\tif (signal.aborted || active === 0) break;\n\t\t\tawait new Promise((resolve) => {\n\t\t\t\twake = resolve;\n\t\t\t});\n\t\t}\n\t} finally {\n\t\tdone = true;\n\t\tcontroller.abort();\n\t\tsignal.removeEventListener(\"abort\", notify);\n\t\tinput.signal?.removeEventListener(\"abort\", abortInternal);\n\t}\n}\n/** Resolves the running app and attaches to its log streams; the caller consumes `lines`. */\nasync function executeLog(input, deps, cwd) {\n\tif (process.platform === \"win32\") return notOk(new CliStructuredError(\"LOG.PLATFORM_UNSUPPORTED\", \"local dev is not supported on Windows yet.\"));\n\tconst devDir = path.join(cwd, DEV_DIR);\n\tlet name;\n\tconst attachments = [];\n\tlet services;\n\ttry {\n\t\tconst identity = deps.identity ?? await resolveAppIdentity(input.entry, input.name, cwd, input.config);\n\t\tname = identity.name;\n\t\tconst resolved = await resolveLocalTargets(identity.config);\n\t\tfor (const target of resolved.values()) try {\n\t\t\tconst container = await target.container.ensure({\n\t\t\t\tappName: name,\n\t\t\t\tstage: void 0\n\t\t\t});\n\t\t\tattachments.push(await withEmulatorRetry(() => target.attach({\n\t\t\t\tcontainer,\n\t\t\t\tdevDir\n\t\t\t})));\n\t\t} catch (error) {\n\t\t\tthrow toStructured(\"LOG.ATTACH_FAILED\", error);\n\t\t}\n\t\ttry {\n\t\t\tservices = (await Promise.all(attachments.map((a) => withEmulatorRetry(() => a.endpoints())))).flat();\n\t\t} catch (error) {\n\t\t\tthrow toStructured(\"LOG.ATTACH_FAILED\", error);\n\t\t}\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (services.length === 0) return ok({\n\t\tappName: name,\n\t\tservices: [],\n\t\tlines: mergeLogStreams([], input)\n\t});\n\tif (input.address !== void 0 && !services.some((s) => s.address === input.address)) return notOk(new CliStructuredError(\"LOG.ADDRESS_UNKNOWN\", `no service \"${input.address}\" in \"${name}\" — running services: ${services.map((s) => s.address).join(\", \")}.`));\n\treturn ok({\n\t\tappName: name,\n\t\tservices,\n\t\tlines: mergeLogStreams(attachments, input)\n\t});\n}\n//#endregion\nexport { LOG_QUEUE_LIMIT, executeLog };\n\n//# sourceMappingURL=execute-log-DivzSDBL.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,eAAe,OAAO;CAC9B,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC7D;;;;;AAKA,MAAM,kBAAkB;;;;;;;;;;;AAWxB,gBAAgB,gBAAgB,aAAa,OAAO;CACnD,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,EAAE,WAAW;CACnB,MAAM,sBAAsB,WAAW,MAAM;CAC7C,IAAI,MAAM,QAAQ,YAAY,MAAM,WAAW,MAAM;CACrD,MAAM,QAAQ,iBAAiB,SAAS,eAAe,EAAE,MAAM,KAAK,CAAC;CACrE,MAAM,QAAQ,CAAC;CACf,IAAI,UAAU;CACd,IAAI,OAAO;CACX,IAAI,SAAS,YAAY;CACzB,IAAI;CACJ,MAAM,eAAe;EACpB,OAAO;EACP,OAAO,KAAK;CACb;CACA,OAAO,iBAAiB,SAAS,QAAQ,EAAE,MAAM,KAAK,CAAC;CACvD,MAAM,QAAQ,UAAU;EACvB,IAAI,MAAM;EACV,IAAI;GACH,MAAM,UAAU,KAAK;EACtB,QAAQ,CAAC;CACV;CACA,MAAM,OAAO,OAAO,eAAe;EAClC,IAAI;GACH,WAAW,MAAM,EAAE,SAAS,UAAU,WAAW,KAAK,QAAQ,EAAE,MAAM,MAAM,QAAQ,EAAE,CAAC,GAAG;IACzF,IAAI,OAAO,SAAS;IACpB,IAAI,MAAM,YAAY,KAAK,KAAK,YAAY,MAAM,SAAS;IAC3D,IAAI,MAAM,UAAU,KAAK;KACxB,MAAM,MAAM;KACZ,WAAW;IACZ;IACA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A;GACD,CAAC,CAAC,CAAC;EACJ,SAAS,OAAO;GACf,MAAM,aAAa,qBAAqB,KAAK;EAC9C;EACA,IAAI;GACH,YAAY,MAAM,QAAQ,IAAI,YAAY,KAAK,MAAM,wBAAwB,EAAE,UAAU,CAAC,CAAC,CAAC,EAAA,CAAG,KAAK;EACrG,SAAS,OAAO;GACf,MAAM,aAAa,qBAAqB,KAAK;EAC9C;CACD,SAAS,OAAO;EACf,IAAI,mBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,MAAM;CACP;CACA,IAAI,SAAS,WAAW,GAAG,OAAO,GAAG;EACpC,SAAS;EACT,UAAU,CAAC;EACX,OAAO,gBAAgB,CAAC,GAAG,KAAK;CACjC,CAAC;CACD,IAAI,MAAM,YAAY,KAAK,KAAK,CAAC,SAAS,MAAM,MAAM,EAAE,YAAY,MAAM,OAAO,GAAG,OAAO,MAAM,IAAI,mBAAmB,uBAAuB,eAAe,MAAM,QAAQ,QAAQ,KAAK,wBAAwB,SAAS,KAAK,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;CAC9P,OAAO,GAAG;EACT,SAAS;EACT;EACA,OAAO,gBAAgB,aAAa,KAAK;CAC1C,CAAC;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
- import { r as isBuildOnlyExtension } from "./app-config-joXc-BKm-CdcXqNMD.mjs";
2
+ import { r as isBuildOnlyExtension } from "./app-config-CGJHcFb--CIEFCG4V.mjs";
3
3
  import * as Layer from "effect/Layer";
4
4
  //#region ../../0-framework/1-core/core/dist/local-target.mjs
5
5
  /** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, "dev" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */
@@ -44,4 +44,4 @@ function localTargetProviders(resolved, containers, devDir) {
44
44
  //#endregion
45
45
  export { resolveLocalTargets as n, localTargetProviders as t };
46
46
 
47
- //# sourceMappingURL=local-target-DnA2E8IN.mjs.map
47
+ //# sourceMappingURL=local-target-B4xoiDAV.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-target-DnA2E8IN.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/local-target.mjs"],"sourcesContent":["import { r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-joXc-BKm.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as Layer from \"effect/Layer\";\n//#region src/control/local-target.ts\n/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, \"dev\" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */\nfunction noLocalTargetSupportError(id) {\n\treturn new CliStructuredError(\"DEV.TARGET_UNSUPPORTED\", `extension \"${id}\" has no dev support — it declares no \\`localTarget\\` descriptor (ADR-0041).`);\n}\n/**\n* Resolves every non-build-only configured extension's lazy `localTarget`\n* thunk, once (ADR-0041's lazy local-target reference — operator directive:\n* the production control entry carries only the thunk, never the\n* descriptor, so resolving it is this module's job, not something a deploy\n* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no\n* resources or services and is skipped entirely — never even checked for a\n* `localTarget` thunk. Every other configured extension must be\n* local-target-capable, or the dev command cannot bring the app up at all,\n* so a missing thunk throws naming the extension. The generated dev stack\n* module calls this once and threads the resolved map through every\n* subsequent hook, including `localTargetProviders`.\n*/\nasync function resolveLocalTargets(config) {\n\tconst entries = await Promise.all(config.extensions.flatMap((extension) => {\n\t\tif (isBuildOnlyExtension(extension)) return [];\n\t\tif (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);\n\t\treturn [extension.localTarget().then((descriptor) => [extension.id, descriptor])];\n\t}));\n\treturn new Map(entries);\n}\n/**\n* All configured extensions' local-target providers merged, config array\n* order (ADR-0041), from the ALREADY-RESOLVED descriptor map\n* (`resolveLocalTargets`'s product — this function itself never touches a\n* `localTarget` thunk). The generated dev stack module is this\n* aggregator's one caller, passing the result as `LowerOptions.providers`.\n*/\nfunction localTargetProviders(resolved, containers, devDir) {\n\tconst [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({\n\t\tcontainer: containers.get(id),\n\t\tdevDir\n\t}));\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n//#endregion\nexport { DEV_DIR, localTargetProviders, resolveLocalTargets };\n\n//# sourceMappingURL=local-target.mjs.map"],"mappings":";;;;;AAKA,SAAS,0BAA0B,IAAI;CACtC,OAAO,IAAI,mBAAmB,0BAA0B,cAAc,GAAG,6EAA6E;AACvJ;;;;;;;;;;;;;;AAcA,eAAe,oBAAoB,QAAQ;CAC1C,MAAM,UAAU,MAAM,QAAQ,IAAI,OAAO,WAAW,SAAS,cAAc;EAC1E,IAAI,qBAAqB,SAAS,GAAG,OAAO,CAAC;EAC7C,IAAI,UAAU,gBAAgB,KAAK,GAAG,MAAM,0BAA0B,UAAU,EAAE;EAClF,OAAO,CAAC,UAAU,YAAY,CAAC,CAAC,MAAM,eAAe,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC;CACjF,CAAC,CAAC;CACF,OAAO,IAAI,IAAI,OAAO;AACvB;;;;;;;;AAQA,SAAS,qBAAqB,UAAU,YAAY,QAAQ;CAC3D,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,SAAS,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,gBAAgB,WAAW,UAAU;EAC/F,WAAW,WAAW,IAAI,EAAE;EAC5B;CACD,CAAC,CAAC;CACF,OAAO,UAAU,KAAK,IAAI,MAAM,QAAQ,MAAM,SAAS,OAAO,GAAG,IAAI;AACtE"}
1
+ {"version":3,"file":"local-target-B4xoiDAV.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/local-target.mjs"],"sourcesContent":["import { r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-CGJHcFb-.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as Layer from \"effect/Layer\";\n//#region src/control/local-target.ts\n/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, \"dev\" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */\nfunction noLocalTargetSupportError(id) {\n\treturn new CliStructuredError(\"DEV.TARGET_UNSUPPORTED\", `extension \"${id}\" has no dev support — it declares no \\`localTarget\\` descriptor (ADR-0041).`);\n}\n/**\n* Resolves every non-build-only configured extension's lazy `localTarget`\n* thunk, once (ADR-0041's lazy local-target reference — operator directive:\n* the production control entry carries only the thunk, never the\n* descriptor, so resolving it is this module's job, not something a deploy\n* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no\n* resources or services and is skipped entirely — never even checked for a\n* `localTarget` thunk. Every other configured extension must be\n* local-target-capable, or the dev command cannot bring the app up at all,\n* so a missing thunk throws naming the extension. The generated dev stack\n* module calls this once and threads the resolved map through every\n* subsequent hook, including `localTargetProviders`.\n*/\nasync function resolveLocalTargets(config) {\n\tconst entries = await Promise.all(config.extensions.flatMap((extension) => {\n\t\tif (isBuildOnlyExtension(extension)) return [];\n\t\tif (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);\n\t\treturn [extension.localTarget().then((descriptor) => [extension.id, descriptor])];\n\t}));\n\treturn new Map(entries);\n}\n/**\n* All configured extensions' local-target providers merged, config array\n* order (ADR-0041), from the ALREADY-RESOLVED descriptor map\n* (`resolveLocalTargets`'s product — this function itself never touches a\n* `localTarget` thunk). The generated dev stack module is this\n* aggregator's one caller, passing the result as `LowerOptions.providers`.\n*/\nfunction localTargetProviders(resolved, containers, devDir) {\n\tconst [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({\n\t\tcontainer: containers.get(id),\n\t\tdevDir\n\t}));\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n//#endregion\nexport { DEV_DIR, localTargetProviders, resolveLocalTargets };\n\n//# sourceMappingURL=local-target.mjs.map"],"mappings":";;;;;AAKA,SAAS,0BAA0B,IAAI;CACtC,OAAO,IAAI,mBAAmB,0BAA0B,cAAc,GAAG,6EAA6E;AACvJ;;;;;;;;;;;;;;AAcA,eAAe,oBAAoB,QAAQ;CAC1C,MAAM,UAAU,MAAM,QAAQ,IAAI,OAAO,WAAW,SAAS,cAAc;EAC1E,IAAI,qBAAqB,SAAS,GAAG,OAAO,CAAC;EAC7C,IAAI,UAAU,gBAAgB,KAAK,GAAG,MAAM,0BAA0B,UAAU,EAAE;EAClF,OAAO,CAAC,UAAU,YAAY,CAAC,CAAC,MAAM,eAAe,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC;CACjF,CAAC,CAAC;CACF,OAAO,IAAI,IAAI,OAAO;AACvB;;;;;;;;AAQA,SAAS,qBAAqB,UAAU,YAAY,QAAQ;CAC3D,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,SAAS,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,gBAAgB,WAAW,UAAU;EAC/F,WAAW,WAAW,IAAI,EAAE;EAC5B;CACD,CAAC,CAAC;CACF,OAAO,UAAU,KAAK,IAAI,MAAM,QAAQ,MAAM,SAAS,OAAO,GAAG,IAAI;AACtE"}
@@ -1,4 +1,4 @@
1
- import { A as PrismaAppConfig, _ as LocalTargetEmulatorsInput, c as ContainerInstance, g as LocalTargetDescriptor, h as LocalTargetAttachment, l as DEV_DIR, m as LocalTargetAttachInput, v as LocalTargetProvidersInput } from "./app-config-jGcCcxK4-DnzGGbDS.mjs";
1
+ import { A as PrismaAppConfig, _ as LocalTargetEmulatorsInput, c as ContainerInstance, g as LocalTargetDescriptor, h as LocalTargetAttachment, l as DEV_DIR, m as LocalTargetAttachInput, v as LocalTargetProvidersInput } from "./app-config-DyCMnkDr-CguUhanl.mjs";
2
2
  import * as Layer from "effect/Layer";
3
3
  //#region ../../0-framework/1-core/core/dist/local-target.d.mts
4
4
  //#region src/control/local-target.d.ts
@@ -1,3 +1,3 @@
1
- import { t as DEV_DIR } from "./app-config-joXc-BKm-CdcXqNMD.mjs";
2
- import { n as resolveLocalTargets, t as localTargetProviders } from "./local-target-DnA2E8IN.mjs";
1
+ import { t as DEV_DIR } from "./app-config-CGJHcFb--CIEFCG4V.mjs";
2
+ import { n as resolveLocalTargets, t as localTargetProviders } from "./local-target-B4xoiDAV.mjs";
3
3
  export { DEV_DIR, localTargetProviders, resolveLocalTargets };
@@ -1,13 +1,13 @@
1
- import { a as Bundle, i as AssembleInput, p as ExtensionDescriptor } from "./app-config-jGcCcxK4-DnzGGbDS.mjs";
2
- import "./config-BGtKERz-.mjs";
3
- import "./deploy-BGtKERz-.mjs";
1
+ import { a as Bundle, i as AssembleInput, p as ExtensionDescriptor } from "./app-config-DyCMnkDr-CguUhanl.mjs";
2
+ import "./config-i9yR7YWi.mjs";
3
+ import "./deploy-i9yR7YWi.mjs";
4
4
  import { t as NextjsBuildAdapter } from "./nextjs-DLyeRR7M-D7UOddVQ.mjs";
5
5
  //#region ../../0-framework/2-authoring/nextjs/dist/control.d.mts
6
6
  //#region src/control/build.d.ts
7
7
  /** 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. */
8
8
  declare function standaloneServerPath(build: NextjsBuildAdapter): string;
9
9
  declare function assemble(input: AssembleInput): Promise<Bundle>;
10
- /** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */
10
+ /** The nextjs build extension descriptor — the `composer` section of `prisma.config.ts` lists it under `extensions`. */
11
11
  declare const nextjsBuild: () => ExtensionDescriptor;
12
12
  //#endregion
13
13
  export { type AssembleInput, type Bundle, assemble, nextjsBuild, standaloneServerPath };
@@ -6,7 +6,7 @@ import { build } from "esbuild";
6
6
  //#region ../../0-framework/2-authoring/nextjs/dist/control.mjs
7
7
  /**
8
8
  * The extension's control entry (ADR-0017): `nextjsBuild()` returns the build
9
- * descriptor `prisma-composer.config.ts` lists. Deploy-only (ADR-0005): the user
9
+ * descriptor `prisma.config.ts` lists. Deploy-only (ADR-0005): the user
10
10
  * runs `next build` (`output: "standalone"`); `assemble` then performs the
11
11
  * *documented* Next standalone deploy — it ships the standalone tree and copies
12
12
  * in the client assets Next deliberately omits (`.next/static`, `public/`) — and
@@ -223,7 +223,7 @@ async function assemble(input) {
223
223
  watch: [standaloneRoot, ...stagedLinkTargets]
224
224
  };
225
225
  }
226
- /** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */
226
+ /** The nextjs build extension descriptor — the `composer` section of `prisma.config.ts` lists it under `extensions`. */
227
227
  const nextjsBuild = () => ({
228
228
  id: "@prisma/composer/nextjs",
229
229
  nodes: { nextjs: {
@@ -1 +1 @@
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, copyTreeVerbatim, createBundleLink, isWithin, repairWindowsDirectorySymlinks } 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\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* Absolute junctions (pnpm on Windows) often point from `.next/standalone`\n* straight into the app's `node_modules/.pnpm/...` under the tracing root —\n* outside the standalone copy root. After `copyTreeVerbatim` those links still\n* escape the assembled bundle; stage the real target under the bundle at the\n* same tracing-root-relative path and repoint the link.\n*/\nasync function stageEscapingTracingRootLinks(bundleDir, tracedRootReal) {\n\tconst nodeModulesRoot = path.join(tracedRootReal, \"node_modules\");\n\tconst stagedSources = /* @__PURE__ */ new Set();\n\tfor (const linkPath of await collectSymlinks(bundleDir)) {\n\t\tconst rawTarget = await fs.promises.readlink(linkPath);\n\t\tlet resolved = path.resolve(path.dirname(linkPath), rawTarget);\n\t\tif (await lstatIfPresent(resolved) === void 0) continue;\n\t\ttry {\n\t\t\tresolved = await fs.promises.realpath(resolved);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tif (isWithin(bundleDir, resolved)) continue;\n\t\tif (!isWithin(nodeModulesRoot, resolved) && resolved !== nodeModulesRoot) continue;\n\t\tconst stagedAt = path.join(bundleDir, path.relative(tracedRootReal, resolved));\n\t\tif (await lstatIfPresent(stagedAt) === void 0) {\n\t\t\tawait fs.promises.mkdir(path.dirname(stagedAt), { recursive: true });\n\t\t\tif ((await fs.promises.stat(resolved)).isDirectory()) await copyTreeVerbatim(resolved, stagedAt);\n\t\t\telse await fs.promises.copyFile(resolved, stagedAt);\n\t\t\tstagedSources.add(resolved);\n\t\t}\n\t\tconst type = (await fs.promises.stat(stagedAt)).isDirectory() ? \"dir\" : \"file\";\n\t\tawait fs.promises.unlink(linkPath);\n\t\tawait createBundleLink(linkPath, path.relative(path.dirname(linkPath), stagedAt), type, {\n\t\t\tresolvedTarget: stagedAt,\n\t\t\tcopySource: stagedAt,\n\t\t\tcopyWithinRoot: bundleDir\n\t\t});\n\t}\n\treturn [...stagedSources];\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 copyTreeVerbatim(source, target);\n\t\t\tstagedSources.add(source);\n\t\t\tstaged = true;\n\t\t}\n\t}\n\tfor (const source of await stageEscapingTracingRootLinks(bundleDir, tracedRootReal)) stagedSources.add(source);\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 copyTreeVerbatim(standaloneRoot, bundleDir);\n\tconst stagedLinkTargets = await stageMissingStandaloneLinkTargets(bundleDir, manifest);\n\tawait repairWindowsDirectorySymlinks(bundleDir);\n\tconst appOut = path.join(bundleDir, appRel);\n\tconst staticSrc = path.join(appDir, \".next\", \"static\");\n\tif (fs.existsSync(staticSrc)) await copyTreeVerbatim(staticSrc, path.join(appOut, \".next\", \"static\"));\n\tconst publicSrc = path.join(appDir, \"public\");\n\tif (fs.existsSync(publicSrc)) await copyTreeVerbatim(publicSrc, path.join(appOut, \"public\"));\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,KAAK,IAAI,KAAK,IAAIA,OAAK,SAAS,SAAS,aAAa,MAAM,CAAC,CAAC,MAAMA,OAAK,GAAG,CAAC,CAAC,KAAK,GAAG;CAC5J,IAAI,aAAa,KAAK,GAAG,MAAM,IAAI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,GAAG,MAAM,iBAAiB,WAAWD,OAAK,KAAK,QAAQ,SAAS,QAAQ,CAAC;CACpG,MAAM,YAAYA,OAAK,KAAK,QAAQ,QAAQ;CAC5C,IAAIC,KAAG,WAAW,SAAS,GAAG,MAAM,iBAAiB,WAAWD,OAAK,KAAK,QAAQ,QAAQ,CAAC;CAC3F,MAAM,+BAA+B,SAAS;CAC9C,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,CAACC,KAAG,WAAWD,OAAK,KAAK,SAAS,UAAU,CAAC,GAAG,MAAM,IAAI,MAAM,mCAAmC,SAAS;CAChH,OAAO;EACN,KAAK;EACL,OAAOA,OAAK,MAAM,KAAK,UAAU,OAAO,MAAMA,OAAK,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,WAAW;EAC9E,OAAO,CAAC,gBAAgB,GAAG,iBAAiB;CAC7C;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, copyTreeVerbatim, createBundleLink, isWithin, repairWindowsDirectorySymlinks } 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.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\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* Absolute junctions (pnpm on Windows) often point from `.next/standalone`\n* straight into the app's `node_modules/.pnpm/...` under the tracing root —\n* outside the standalone copy root. After `copyTreeVerbatim` those links still\n* escape the assembled bundle; stage the real target under the bundle at the\n* same tracing-root-relative path and repoint the link.\n*/\nasync function stageEscapingTracingRootLinks(bundleDir, tracedRootReal) {\n\tconst nodeModulesRoot = path.join(tracedRootReal, \"node_modules\");\n\tconst stagedSources = /* @__PURE__ */ new Set();\n\tfor (const linkPath of await collectSymlinks(bundleDir)) {\n\t\tconst rawTarget = await fs.promises.readlink(linkPath);\n\t\tlet resolved = path.resolve(path.dirname(linkPath), rawTarget);\n\t\tif (await lstatIfPresent(resolved) === void 0) continue;\n\t\ttry {\n\t\t\tresolved = await fs.promises.realpath(resolved);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tif (isWithin(bundleDir, resolved)) continue;\n\t\tif (!isWithin(nodeModulesRoot, resolved) && resolved !== nodeModulesRoot) continue;\n\t\tconst stagedAt = path.join(bundleDir, path.relative(tracedRootReal, resolved));\n\t\tif (await lstatIfPresent(stagedAt) === void 0) {\n\t\t\tawait fs.promises.mkdir(path.dirname(stagedAt), { recursive: true });\n\t\t\tif ((await fs.promises.stat(resolved)).isDirectory()) await copyTreeVerbatim(resolved, stagedAt);\n\t\t\telse await fs.promises.copyFile(resolved, stagedAt);\n\t\t\tstagedSources.add(resolved);\n\t\t}\n\t\tconst type = (await fs.promises.stat(stagedAt)).isDirectory() ? \"dir\" : \"file\";\n\t\tawait fs.promises.unlink(linkPath);\n\t\tawait createBundleLink(linkPath, path.relative(path.dirname(linkPath), stagedAt), type, {\n\t\t\tresolvedTarget: stagedAt,\n\t\t\tcopySource: stagedAt,\n\t\t\tcopyWithinRoot: bundleDir\n\t\t});\n\t}\n\treturn [...stagedSources];\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 copyTreeVerbatim(source, target);\n\t\t\tstagedSources.add(source);\n\t\t\tstaged = true;\n\t\t}\n\t}\n\tfor (const source of await stageEscapingTracingRootLinks(bundleDir, tracedRootReal)) stagedSources.add(source);\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 copyTreeVerbatim(standaloneRoot, bundleDir);\n\tconst stagedLinkTargets = await stageMissingStandaloneLinkTargets(bundleDir, manifest);\n\tawait repairWindowsDirectorySymlinks(bundleDir);\n\tconst appOut = path.join(bundleDir, appRel);\n\tconst staticSrc = path.join(appDir, \".next\", \"static\");\n\tif (fs.existsSync(staticSrc)) await copyTreeVerbatim(staticSrc, path.join(appOut, \".next\", \"static\"));\n\tconst publicSrc = path.join(appDir, \"public\");\n\tif (fs.existsSync(publicSrc)) await copyTreeVerbatim(publicSrc, path.join(appOut, \"public\"));\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 — the `composer` section of `prisma.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,SA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AAW,QAAQ;CACrF,MAAM,+BAA+B,SAAS;CAC9C,MAAM,SAASA,OAAK,KAAK,WAAW,MAAM;CAC1C,MAAM,YAAYA,OAAK,KAAK,QAAQ,SAAS,QAAQ;CACrD,IAAIC,KAAG,WAAW,SAAS,GAAG,MAAM,iBAAiB,WAAWD,OAAK,KAAK,QAAQ,SAAS,QAAQ,CAAC;CACpG,MAAM,YAAYA,OAAK,KAAK,QAAQ,QAAQ;CAC5C,IAAIC,KAAG,WAAW,SAAS,GAAG,MAAM,iBAAiB,WAAWD,OAAK,KAAK,QAAQ,QAAQ,CAAC;CAC3F,MAAM,+BAA+B,SAAS;CAC9C,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,CAACC,KAAG,WAAWD,OAAK,KAAK,SAAS,UAAU,CAAC,GAAG,MAAM,IAAI,MAAM,mCAAmC,SAAS;CAChH,OAAO;EACN,KAAK;EACL,OAAOA,OAAK,MAAM,KAAK,UAAU,OAAO,MAAMA,OAAK,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,WAAW;EAC9E,OAAO,CAAC,gBAAgB,GAAG,iBAAiB;CAC7C;AACD;;AAEA,MAAM,qBAAqB;CAC1B,IAAI;CACJ,OAAO,EAAE,QAAQ;EAChB,MAAM;EACN;CACD,EAAE;AACH"}
@@ -1,10 +1,10 @@
1
- import { a as Bundle, i as AssembleInput, p as ExtensionDescriptor } from "./app-config-jGcCcxK4-DnzGGbDS.mjs";
2
- import "./config-BGtKERz-.mjs";
3
- import "./deploy-BGtKERz-.mjs";
1
+ import { a as Bundle, i as AssembleInput, p as ExtensionDescriptor } from "./app-config-DyCMnkDr-CguUhanl.mjs";
2
+ import "./config-i9yR7YWi.mjs";
3
+ import "./deploy-i9yR7YWi.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>;
7
- /** The node build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */
7
+ /** The node build extension descriptor — the `composer` section of `prisma.config.ts` lists it under `extensions`. */
8
8
  declare const nodeBuild: () => ExtensionDescriptor;
9
9
  //#endregion
10
10
  export { type AssembleInput, type Bundle, assemble, nodeBuild };
@@ -21659,7 +21659,7 @@ var require_out = /* @__PURE__ */ __commonJSMin(((exports) => {
21659
21659
  var import_out = require_out();
21660
21660
  /**
21661
21661
  * The extension's control entry (ADR-0017): `nodeBuild()` returns the build
21662
- * descriptor `prisma-composer.config.ts` lists. Deploy-only (ADR-0005): the user
21662
+ * descriptor `prisma.config.ts` lists. Deploy-only (ADR-0005): the user
21663
21663
  * builds their own runnable; `assemble` copies what they built under `bundle/`
21664
21664
  * and adds the framework's boot wrapper — it never bundles or transforms the
21665
21665
  * app's code.
@@ -21918,7 +21918,7 @@ async function assemble(input) {
21918
21918
  watch: [runnable.source]
21919
21919
  };
21920
21920
  }
21921
- /** The node build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */
21921
+ /** The node build extension descriptor — the `composer` section of `prisma.config.ts` lists it under `extensions`. */
21922
21922
  const nodeBuild = () => ({
21923
21923
  id: "@prisma/composer/node",
21924
21924
  nodes: { node: {