@prisma/composer 0.39.0-dev.7 → 0.39.0-dev.9

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 (122) hide show
  1. package/dist/{app-config-DmCj4luV-BC36-MeB.d.mts → app-config-DriAu5RU-C8hYpR38.d.mts} +17 -15
  2. package/dist/app-config-DriAu5RU-C8hYpR38.d.mts.map +1 -0
  3. package/dist/{app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs → app-configuration-file-D0rB5g65-CdMrjkCc.mjs} +10 -40
  4. package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map +1 -0
  5. package/dist/app-converge-C6Zrg2xM-D0k4EIJY.mjs +88 -0
  6. package/dist/app-converge-C6Zrg2xM-D0k4EIJY.mjs.map +1 -0
  7. package/dist/config-Bpi8QVLB.d.mts +1 -0
  8. package/dist/config.d.mts +2 -2
  9. package/dist/config.mjs +1 -1
  10. package/dist/control.d.mts +8 -23
  11. package/dist/control.d.mts.map +1 -1
  12. package/dist/control.mjs +4 -4
  13. package/dist/control.mjs.map +1 -1
  14. package/dist/{converge-in-process-BBBeood8-BCIPOG8X.d.mts → converge-in-process-CTomEXaD-BnDylZP8.d.mts} +5 -5
  15. package/dist/{converge-in-process-BBBeood8-BCIPOG8X.d.mts.map → converge-in-process-CTomEXaD-BnDylZP8.d.mts.map} +1 -1
  16. package/dist/converge-in-process-x89zb2MF-Dvj-J8xo.mjs +258 -0
  17. package/dist/converge-in-process-x89zb2MF-Dvj-J8xo.mjs.map +1 -0
  18. package/dist/{deploy-B2kxaH5E.mjs → deploy-CSU0kr4j.mjs} +65 -5
  19. package/dist/{deploy-B2kxaH5E.mjs.map → deploy-CSU0kr4j.mjs.map} +1 -1
  20. package/dist/deploy-DHgEJDpg.d.mts +32 -0
  21. package/dist/deploy-DHgEJDpg.d.mts.map +1 -0
  22. package/dist/deploy.d.mts +4 -4
  23. package/dist/deploy.mjs +3 -3
  24. package/dist/{deployment-summary-6LgQDUuu-Dp8kwMs_.d.mts → deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts} +4 -4
  25. package/dist/{deployment-summary-6LgQDUuu-Dp8kwMs_.d.mts.map → deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts.map} +1 -1
  26. package/dist/{deployment-summary-YP7eMPJI-CQsj7BHh.mjs → deployment-summary-CVJZn2v0-Dz-gX1rp.mjs} +3 -3
  27. package/dist/{deployment-summary-YP7eMPJI-CQsj7BHh.mjs.map → deployment-summary-CVJZn2v0-Dz-gX1rp.mjs.map} +1 -1
  28. package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs +165 -0
  29. package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs.map +1 -0
  30. package/dist/dev-converge-worker.d.mts +1 -0
  31. package/dist/dev-converge-worker.mjs +142 -0
  32. package/dist/dev-converge-worker.mjs.map +1 -0
  33. package/dist/{dev-current-gQnmjB4V-BaNhcGpK.mjs → dev-current-EqQbrtj5-Dda1xCjU.mjs} +11 -7
  34. package/dist/dev-current-EqQbrtj5-Dda1xCjU.mjs.map +1 -0
  35. package/dist/{dev-environment-name-6eEr5PW8-6sPgQZG3.mjs → dev-environment-name-6eEr5PW8-7ntm9Xhs.mjs} +3 -3
  36. package/dist/{dev-environment-name-6eEr5PW8-6sPgQZG3.mjs.map → dev-environment-name-6eEr5PW8-7ntm9Xhs.mjs.map} +1 -1
  37. package/dist/{dist-CyrEbDx6.mjs → dist-Cf_mZHaH.mjs} +2 -2
  38. package/dist/{dist-CyrEbDx6.mjs.map → dist-Cf_mZHaH.mjs.map} +1 -1
  39. package/dist/{emulator-retry-CV8rl69G-BgUzkxc-.mjs → emulator-retry-CV8rl69G-scQ105wk.mjs} +2 -2
  40. package/dist/{emulator-retry-CV8rl69G-BgUzkxc-.mjs.map → emulator-retry-CV8rl69G-scQ105wk.mjs.map} +1 -1
  41. package/dist/{errors-0e8IVwzi.mjs → errors-DI3TBXE-.mjs} +7 -2
  42. package/dist/{errors-0e8IVwzi.mjs.map → errors-DI3TBXE-.mjs.map} +1 -1
  43. package/dist/{execute-deploy-destroy-DKbsBkqK-BWXh0zXQ.mjs → execute-deploy-destroy-DKEmb8WI-Cad08hR1.mjs} +246 -193
  44. package/dist/execute-deploy-destroy-DKEmb8WI-Cad08hR1.mjs.map +1 -0
  45. package/dist/{execute-dev-DVCWURmI-Cp3i7Hrp.mjs → execute-dev-C42niIFY-Cl5XzBy3.mjs} +434 -261
  46. package/dist/execute-dev-C42niIFY-Cl5XzBy3.mjs.map +1 -0
  47. package/dist/{execute-dev-current-Dt_9srY2-COEgQ9h4.mjs → execute-dev-current-AVT4zQ8F-WFr1pM2p.mjs} +7 -7
  48. package/dist/{execute-dev-current-Dt_9srY2-COEgQ9h4.mjs.map → execute-dev-current-AVT4zQ8F-WFr1pM2p.mjs.map} +1 -1
  49. package/dist/{execute-log-B34AeU97-CkJiGdIc.mjs → execute-log-DCe9fk1t-vVIgGSSi.mjs} +8 -8
  50. package/dist/{execute-log-B34AeU97-CkJiGdIc.mjs.map → execute-log-DCe9fk1t-vVIgGSSi.mjs.map} +1 -1
  51. package/dist/{graph-1ILOBl8O-DBaUZL2D.d.mts → graph-CUYXjK8S-BzL-mhjq.d.mts} +3 -3
  52. package/dist/graph-CUYXjK8S-BzL-mhjq.d.mts.map +1 -0
  53. package/dist/{graph-C6Fqe2gn-qJQBxs_C.mjs → graph-D2WMLL43-CeiC5wdy.mjs} +18 -9
  54. package/dist/graph-D2WMLL43-CeiC5wdy.mjs.map +1 -0
  55. package/dist/{graph-types-CaH3flhT-DgrCdRA3.d.mts → graph-types-D4PrtP-l-B0uuchTl.d.mts} +13 -11
  56. package/dist/{graph-types-CaH3flhT-DgrCdRA3.d.mts.map → graph-types-D4PrtP-l-B0uuchTl.d.mts.map} +1 -1
  57. package/dist/http.d.mts +2 -2
  58. package/dist/http.mjs +2 -2
  59. package/dist/{index-Cnbf_d0q.d.mts → index-D8chHe55.d.mts} +3 -3
  60. package/dist/{index-Cnbf_d0q.d.mts.map → index-D8chHe55.d.mts.map} +1 -1
  61. package/dist/index.d.mts +3 -3
  62. package/dist/index.mjs +2 -2
  63. package/dist/internal-app-configuration-file.d.mts +5 -9
  64. package/dist/internal-app-configuration-file.d.mts.map +1 -1
  65. package/dist/internal-app-configuration-file.mjs +2 -2
  66. package/dist/internal-converge-contract.d.mts +6 -4
  67. package/dist/internal-converge-contract.d.mts.map +1 -1
  68. package/dist/internal-converge-contract.mjs +7 -5
  69. package/dist/internal-converge-contract.mjs.map +1 -1
  70. package/dist/internal-converge.d.mts +5 -4
  71. package/dist/internal-converge.mjs +4 -228
  72. package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs +527 -0
  73. package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs.map +1 -0
  74. package/dist/local-target-7KRsLMDO.d.mts +31 -0
  75. package/dist/local-target-7KRsLMDO.d.mts.map +1 -0
  76. package/dist/{local-target-COdS1iNs.mjs → local-target-DhU1vaxd.mjs} +6 -6
  77. package/dist/{local-target-COdS1iNs.mjs.map → local-target-DhU1vaxd.mjs.map} +1 -1
  78. package/dist/local-target.d.mts +3 -31
  79. package/dist/local-target.mjs +1 -1
  80. package/dist/{nextjs-DLyeRR7M-CSKy5tFv.d.mts → nextjs-DLyeRR7M-CzUbvPaJ.d.mts} +3 -3
  81. package/dist/{nextjs-DLyeRR7M-CSKy5tFv.d.mts.map → nextjs-DLyeRR7M-CzUbvPaJ.d.mts.map} +1 -1
  82. package/dist/nextjs-control.d.mts +4 -4
  83. package/dist/nextjs.d.mts +1 -1
  84. package/dist/node-control.d.mts +3 -3
  85. package/dist/node.d.mts +2 -2
  86. package/dist/{preflight-transport-C7_3abXW-Bza_hn9G.mjs → preflight-transport-2d6iIchu-B-v7Di6I.mjs} +5 -4
  87. package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs.map +1 -0
  88. package/dist/{redaction-CjMYXtGp-CEQ5z1PK.mjs → redaction-DY6eDC12-W-FzW7_r.mjs} +16 -4
  89. package/dist/{redaction-CjMYXtGp-CEQ5z1PK.mjs.map → redaction-DY6eDC12-W-FzW7_r.mjs.map} +1 -1
  90. package/dist/{redaction-CIaE4m9U-DyJoGPRw.d.mts → redaction-Dn7BRdaP-BcLSPhLV.d.mts} +58 -17
  91. package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts.map +1 -0
  92. package/dist/report.d.mts +3 -3
  93. package/dist/report.mjs +2 -2
  94. package/dist/report.mjs.map +1 -1
  95. package/dist/service-rpc.d.mts +2 -2
  96. package/dist/service-rpc.mjs +2 -2
  97. package/dist/steps-BZXNqW6U-C_ME2VLd.mjs +112 -0
  98. package/dist/steps-BZXNqW6U-C_ME2VLd.mjs.map +1 -0
  99. package/dist/testing.d.mts +1 -1
  100. package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs +344 -0
  101. package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs.map +1 -0
  102. package/package.json +11 -11
  103. package/skills/prisma-composer-core-concepts/SKILL.md +8 -8
  104. package/src/exports/dev-converge-worker.ts +2 -0
  105. package/dist/app-config-DmCj4luV-BC36-MeB.d.mts.map +0 -1
  106. package/dist/app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs.map +0 -1
  107. package/dist/config-vv8LBErH.d.mts +0 -1
  108. package/dist/deploy-w-BcRS8b.d.mts +0 -12
  109. package/dist/deploy-w-BcRS8b.d.mts.map +0 -1
  110. package/dist/dev-current-gQnmjB4V-BaNhcGpK.mjs.map +0 -1
  111. package/dist/execute-deploy-destroy-DKbsBkqK-BWXh0zXQ.mjs.map +0 -1
  112. package/dist/execute-dev-DVCWURmI-Cp3i7Hrp.mjs.map +0 -1
  113. package/dist/graph-1ILOBl8O-DBaUZL2D.d.mts.map +0 -1
  114. package/dist/graph-C6Fqe2gn-qJQBxs_C.mjs.map +0 -1
  115. package/dist/internal-converge.mjs.map +0 -1
  116. package/dist/local-target.d.mts.map +0 -1
  117. package/dist/preflight-transport-C7_3abXW-Bza_hn9G.mjs.map +0 -1
  118. package/dist/redaction-CIaE4m9U-DyJoGPRw.d.mts.map +0 -1
  119. package/dist/run-alchemy-BlYyc4Oh-mIzYC4lq.mjs +0 -236
  120. package/dist/run-alchemy-BlYyc4Oh-mIzYC4lq.mjs.map +0 -1
  121. package/dist/validate-environment-XwVDifWN-D14WhSH0.mjs +0 -739
  122. package/dist/validate-environment-XwVDifWN-D14WhSH0.mjs.map +0 -1
@@ -0,0 +1,527 @@
1
+ import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
2
+ import { d as isNode } from "./graph-D2WMLL43-CeiC5wdy.mjs";
3
+ import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
4
+ import "./dist-Cf_mZHaH.mjs";
5
+ import * as mod from "node:module";
6
+ import * as path$1 from "node:path";
7
+ import * as fs$1 from "node:fs";
8
+ import { existsSync, statSync } from "node:fs";
9
+ import { fileURLToPath, pathToFileURL } from "node:url";
10
+ //#region ../../0-framework/3-tooling/cli/dist/composer-config-QKdY85G-.mjs
11
+ /**
12
+ * What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.
13
+ * It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.
14
+ */
15
+ const SECTION_FIX = "Write `composer: composer({ entry: './module.ts', extensions: [...], state: ... })` in prisma.config.ts, with `import { defineConfig as composer } from '@prisma/composer/config'`.";
16
+ const MOVE_TO_SECTION_FIX = `${SECTION_FIX} If the project has a prisma-composer.config.ts, move its extensions and state into that section and delete the file.`;
17
+ const SECTION_IS_THE_ONLY_SOURCE = "Composer reads its configuration only from the `composer` section of prisma.config.ts.";
18
+ const DESCRIPTOR_FIX = "Use the descriptor the extension factory returns, unchanged, instead of building one by hand.";
19
+ const RETIRED_FILE_NAMES = [
20
+ "ts",
21
+ "mts",
22
+ "mjs",
23
+ "js"
24
+ ].map((extension) => `prisma-composer.config.${extension}`);
25
+ /** What the generated stack file throws when the file it imports has no `composer` export. */
26
+ function noComposerExportMessage(configFile) {
27
+ return `${configFile} declares no \`composer\` section. Pass the prisma.config.ts that declares it.`;
28
+ }
29
+ function configFileMissing(file) {
30
+ return {
31
+ code: "CONFIG.FILE_MISSING",
32
+ summary: `${file} does not exist.`,
33
+ fix: "Pass the path of the prisma.config.ts that declares the `composer` section.",
34
+ where: file
35
+ };
36
+ }
37
+ /** A prisma-composer.config.* beside the declaring file would otherwise be silently ignored. */
38
+ /** The path with symlinks resolved; the path itself when it cannot be resolved, so the check never throws. */
39
+ function realPath(file) {
40
+ try {
41
+ return fs$1.realpathSync(file);
42
+ } catch {
43
+ return file;
44
+ }
45
+ }
46
+ function retiredFileFinding(configFile) {
47
+ const directory = path$1.dirname(realPath(configFile));
48
+ const found = RETIRED_FILE_NAMES.map((name) => path$1.join(directory, name)).find((file) => fs$1.existsSync(file));
49
+ if (found === void 0) return void 0;
50
+ return {
51
+ code: "CONFIG.FILE_RETIRED",
52
+ summary: `${found} is no longer read.`,
53
+ why: SECTION_IS_THE_ONLY_SOURCE,
54
+ fix: MOVE_TO_SECTION_FIX,
55
+ where: found
56
+ };
57
+ }
58
+ function isObject(value) {
59
+ return typeof value === "object" && value !== null && !Array.isArray(value);
60
+ }
61
+ function isExtensionDescriptor(value) {
62
+ return isObject(value) && typeof value["id"] === "string" && value["id"].length > 0 && isObject(value["nodes"]);
63
+ }
64
+ function isStateDescriptor(value) {
65
+ return isObject(value) && typeof value["extension"] === "string" && typeof value["create"] === "function";
66
+ }
67
+ const stateInvalid = {
68
+ code: "CONFIG.FIELD_INVALID",
69
+ summary: "`composer.state` must be a state descriptor with a string `extension` and a `create` function.",
70
+ fix: "Set `state` to the state descriptor an extension provides, e.g. `state: prismaState()`.",
71
+ field: "state"
72
+ };
73
+ const SECTION_FIELDS = /* @__PURE__ */ new Set([
74
+ "entry",
75
+ "extensions",
76
+ "state",
77
+ "config",
78
+ "secrets"
79
+ ]);
80
+ const entryInvalid = {
81
+ code: "CONFIG.FIELD_INVALID",
82
+ summary: "`composer.entry` must be a non-empty string: the path to the module whose default export is the app.",
83
+ fix: "Set `entry` to that module's path, relative to prisma.config.ts, e.g. `entry: './module.ts'`.",
84
+ field: "entry"
85
+ };
86
+ /** Neither the section's `entry` nor an override names the module whose default export is the app. */
87
+ const entryMissing = {
88
+ code: "CONFIG.ENTRY_MISSING",
89
+ summary: "No entry module is set, so there is no app to load.",
90
+ why: "The entry is the module whose default export is the app root, built with appRoot(...).",
91
+ fix: "Set `entry: './module.ts'` in the `composer` section of prisma.config.ts, or pass `--entry <path>` (the `entry` input when calling @prisma/composer/control).",
92
+ field: "entry"
93
+ };
94
+ function unknownField(key) {
95
+ return {
96
+ code: "CONFIG.FIELD_UNKNOWN",
97
+ summary: `The \`composer\` section has no field \`${key}\`.`,
98
+ fix: key === "composer" ? "Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `entry`, `extensions`, `state`, `config` and `secrets`." : `Remove \`${key}\`. The section takes only \`entry\`, \`extensions\`, \`state\`, \`config\` and \`secrets\`.`,
99
+ field: key
100
+ };
101
+ }
102
+ function checkExtensions(value) {
103
+ if (!Array.isArray(value)) return {
104
+ extensions: [],
105
+ findings: [{
106
+ code: "CONFIG.FIELD_INVALID",
107
+ summary: "`composer.extensions` must be an array of extension descriptors.",
108
+ fix: "Set `extensions` to the descriptors your extensions provide, e.g. `extensions: [nodeBuild()]`.",
109
+ field: "extensions"
110
+ }]
111
+ };
112
+ const findings = [];
113
+ const extensions = [];
114
+ const seen = /* @__PURE__ */ new Set();
115
+ for (const [index, entry] of value.entries()) {
116
+ const field = `extensions[${index}]`;
117
+ if (!isObject(entry)) {
118
+ findings.push({
119
+ code: "CONFIG.FIELD_INVALID",
120
+ summary: `\`composer.${field}\` must be an extension descriptor object.`,
121
+ fix: "Put the descriptor an extension factory returns here, e.g. `nodeBuild()`, not the factory itself.",
122
+ field
123
+ });
124
+ continue;
125
+ }
126
+ const id = entry["id"];
127
+ if (typeof id !== "string" || id.length === 0) findings.push({
128
+ code: "CONFIG.FIELD_INVALID",
129
+ summary: `\`composer.${field}.id\` must be a non-empty string (the extension package name).`,
130
+ fix: DESCRIPTOR_FIX,
131
+ field: `${field}.id`
132
+ });
133
+ else if (seen.has(id)) findings.push({
134
+ code: "CONFIG.EXTENSION_DUPLICATE",
135
+ summary: `Extension "${id}" is listed more than once in \`composer.extensions\`.`,
136
+ fix: `Remove the repeated "${id}" entry from \`extensions\`.`,
137
+ field: `${field}.id`
138
+ });
139
+ else seen.add(id);
140
+ if (!isObject(entry["nodes"])) findings.push({
141
+ code: "CONFIG.FIELD_INVALID",
142
+ summary: `\`composer.${field}.nodes\` must be an object (the node-ID → control registry).`,
143
+ fix: DESCRIPTOR_FIX,
144
+ field: `${field}.nodes`
145
+ });
146
+ if (isExtensionDescriptor(entry)) extensions.push(entry);
147
+ }
148
+ return {
149
+ findings,
150
+ extensions
151
+ };
152
+ }
153
+ function isAdapterList(value) {
154
+ return Array.isArray(value) && value.every((entry) => typeof entry === "function");
155
+ }
156
+ function checkAdapters(list, value) {
157
+ if (value === void 0) return [];
158
+ if (!Array.isArray(value)) return [{
159
+ code: "CONFIG.FIELD_INVALID",
160
+ summary: `\`composer.${list}\` must be an array of adapters.`,
161
+ fix: `Set \`${list}\` to a list of adapters, e.g. \`${list}: [dotenv(), environmentVariables()]\`, imported from '@prisma/composer/config'.`,
162
+ field: list
163
+ }];
164
+ return value.flatMap((entry, index) => typeof entry === "function" ? [] : [{
165
+ code: "CONFIG.FIELD_INVALID",
166
+ summary: `\`composer.${list}[${index}]\` must be an adapter: a function that receives the environment and returns its values.`,
167
+ fix: "Put an adapter here, e.g. `dotenv()`.",
168
+ field: `${list}[${index}]`
169
+ }]);
170
+ }
171
+ function checkFields(section) {
172
+ if (Object.hasOwn(section, "configPath")) return {
173
+ ok: false,
174
+ findings: [{
175
+ code: "CONFIG.FIELD_RETIRED",
176
+ summary: "`composer.configPath` is no longer supported: prisma-composer.config.ts is no longer read.",
177
+ why: SECTION_IS_THE_ONLY_SOURCE,
178
+ fix: `Replace \`configPath\` with the section itself. ${MOVE_TO_SECTION_FIX}`,
179
+ field: "configPath"
180
+ }]
181
+ };
182
+ if (Object.hasOwn(section, "composer")) return {
183
+ ok: false,
184
+ findings: [unknownField("composer")]
185
+ };
186
+ const findings = Object.keys(section).filter((key) => !SECTION_FIELDS.has(key)).map(unknownField);
187
+ const checked = checkExtensions(section["extensions"]);
188
+ findings.push(...checked.findings);
189
+ const state = section["state"];
190
+ if (!isStateDescriptor(state)) findings.push(stateInvalid);
191
+ const entry = section["entry"];
192
+ const entryValid = entry === void 0 || typeof entry === "string" && entry.length > 0;
193
+ if (!entryValid) findings.push(entryInvalid);
194
+ const config = section["config"];
195
+ const secrets = section["secrets"];
196
+ findings.push(...checkAdapters("config", config), ...checkAdapters("secrets", secrets));
197
+ const [first, ...rest] = findings;
198
+ if (first === void 0 && isStateDescriptor(state) && entryValid && (config === void 0 || isAdapterList(config)) && (secrets === void 0 || isAdapterList(secrets))) return {
199
+ ok: true,
200
+ value: {
201
+ extensions: checked.extensions,
202
+ state,
203
+ ...entry === void 0 ? {} : { entry },
204
+ ...config === void 0 ? {} : { config },
205
+ ...secrets === void 0 ? {} : { secrets }
206
+ }
207
+ };
208
+ return {
209
+ ok: false,
210
+ findings: [first ?? stateInvalid, ...rest]
211
+ };
212
+ }
213
+ /**
214
+ * Checks the fields that identify each descriptor and returns the descriptors as the config file's own objects.
215
+ * Never throws: a section's values are user code, and a throwing getter or Proxy trap becomes a finding.
216
+ */
217
+ function checkComposerSection(raw) {
218
+ if (!isObject(raw)) return {
219
+ ok: false,
220
+ findings: [{
221
+ code: "CONFIG.FIELD_INVALID",
222
+ summary: "The `composer` section of prisma.config.ts must be an object.",
223
+ fix: SECTION_FIX
224
+ }]
225
+ };
226
+ try {
227
+ return checkFields({ ...raw });
228
+ } catch (cause) {
229
+ return {
230
+ ok: false,
231
+ findings: [{
232
+ code: "CONFIG.FIELD_INVALID",
233
+ summary: "The `composer` section of prisma.config.ts could not be read.",
234
+ why: `Reading it threw: ${cause instanceof Error ? cause.message : String(cause)}`,
235
+ fix: SECTION_FIX
236
+ }]
237
+ };
238
+ }
239
+ }
240
+ /**
241
+ * The whole check, shared by the section validator and the programmatic operations so both report the same findings in the same order: the retired file beside the declaring `configFile` (resolved through symlinks), then every field finding.
242
+ */
243
+ function checkComposerConfig(raw, configFile) {
244
+ const retired = retiredFileFinding(configFile);
245
+ const checked = checkComposerSection(raw);
246
+ if (retired === void 0) return checked;
247
+ return {
248
+ ok: false,
249
+ findings: checked.ok ? [retired] : [retired, ...checked.findings]
250
+ };
251
+ }
252
+ //#endregion
253
+ //#region ../../0-framework/3-tooling/cli/dist/load-entry-CEoVBdMj.mjs
254
+ /**
255
+ * Synchronous Node resolve hook so that entry modules may import relative
256
+ * files using the specifier forms TypeScript accepts by default —
257
+ * extensionless `./service` and `./service.js` for a `.ts` source file —
258
+ * without requiring `allowImportingTsExtensions` in every consumer's tsconfig.
259
+ *
260
+ * Resolution only; uses TypeScript's own documented mapping: for a specifier
261
+ * Node could not resolve, strip any JS-family extension and probe the
262
+ * corresponding TypeScript source; first candidate that exists on disk wins.
263
+ * Format-specific rules: `.mjs` → `.mts`; `.cjs` → `.cts`; `.js` and
264
+ * extensionless → `.ts`, `.mts`, `.tsx`, then `./index.ts`. Bare and package
265
+ * specifiers are never touched. Existing `./x.ts` imports keep working —
266
+ * Node resolves them before the hook fires (ADR-0005: no transform, no
267
+ * guessing, deterministic TypeScript rule).
268
+ *
269
+ * Bun resolves `./x.js` and `./x` to `x.ts` natively, so the hook is a
270
+ * no-op under Bun. Nothing is registered there.
271
+ *
272
+ * The hook also observes, without changing anything: `recordAppFiles` uses
273
+ * it to learn which app files an entry import loaded.
274
+ */
275
+ let registered = false;
276
+ let recording;
277
+ /** An app file: a `file:` module outside every `node_modules` directory. */
278
+ function appFile(url) {
279
+ if (!url.startsWith("file:")) return void 0;
280
+ const file = fileURLToPath(url);
281
+ return file.split(path$1.sep).includes("node_modules") ? void 0 : file;
282
+ }
283
+ function record(url) {
284
+ const file = recording === void 0 ? void 0 : appFile(url);
285
+ if (file !== void 0) recording?.add(file);
286
+ }
287
+ /**
288
+ * Runs `load` and returns the app files it imported: every module outside
289
+ * `node_modules` that the runtime loaded for the first time while it ran,
290
+ * static and dynamic imports alike. Under Node the resolve hook records them;
291
+ * under Bun they are the modules `require.cache` gained, which includes ES
292
+ * modules. A module already loaded before `load` started, and what only it
293
+ * imports, is not recorded. Each file is also added to `recorded` as it is
294
+ * found, so a caller still has them when `load` throws.
295
+ */
296
+ async function recordAppFiles(load, recorded = /* @__PURE__ */ new Set()) {
297
+ if (typeof process.versions.bun === "string") {
298
+ const cache = mod.createRequire(import.meta.url).cache;
299
+ const before = new Set(Object.keys(cache));
300
+ const files = [];
301
+ try {
302
+ return {
303
+ value: await load(),
304
+ files
305
+ };
306
+ } finally {
307
+ for (const key of Object.keys(cache)) {
308
+ if (before.has(key) || !path$1.isAbsolute(key)) continue;
309
+ if (key.split(path$1.sep).includes("node_modules")) continue;
310
+ files.push(key);
311
+ recorded.add(key);
312
+ }
313
+ }
314
+ }
315
+ registerEntryResolution();
316
+ const files = /* @__PURE__ */ new Set();
317
+ recording = files;
318
+ try {
319
+ return {
320
+ value: await load(),
321
+ files: [...files]
322
+ };
323
+ } finally {
324
+ recording = void 0;
325
+ for (const file of files) recorded.add(file);
326
+ }
327
+ }
328
+ /** The path of a `file:` URL, or `undefined` for one that names no local file, such as one with a host. */
329
+ function pathOfFileUrl(url) {
330
+ try {
331
+ return fileURLToPath(url);
332
+ } catch {
333
+ return;
334
+ }
335
+ }
336
+ /**
337
+ * The app files an import error names: the module that could not be found, or the file that did
338
+ * not parse, when the runtime says which. A module that could not be found comes with every file
339
+ * the resolve hook would try for it, since the user may create any of them. A directory is never
340
+ * returned: in its place come the files the hook would try inside it. Follows `cause`.
341
+ */
342
+ function appFilesNamedBy(error) {
343
+ const named = appPathNamedBy(error);
344
+ return named === void 0 ? [] : filesFor(named);
345
+ }
346
+ /** Whether an import error names a directory of the app that holds an `index.ts`, which the import should have loaded. */
347
+ function namesDirectoryWithIndex(error) {
348
+ const named = appPathNamedBy(error);
349
+ return named !== void 0 && isDirectory(named) && filesFor(named).some(existsSync);
350
+ }
351
+ function appPathNamedBy(error) {
352
+ const visited = /* @__PURE__ */ new Set();
353
+ for (let current = error; typeof current === "object" && current !== null;) {
354
+ if (visited.has(current)) break;
355
+ visited.add(current);
356
+ const named = fileNamedBy(current);
357
+ if (named !== void 0 && !named.split(path$1.sep).includes("node_modules")) return path$1.resolve(named);
358
+ current = "cause" in current ? current.cause : void 0;
359
+ }
360
+ }
361
+ function filesFor(named) {
362
+ const candidates = () => sourceCandidates(pathToFileURL(named)).map((url) => fileURLToPath(url));
363
+ if (isDirectory(named)) return candidates().filter((candidate) => candidate.startsWith(named + path$1.sep));
364
+ if (existsSync(named)) return [named];
365
+ return [named, ...candidates()];
366
+ }
367
+ function isDirectory(file) {
368
+ try {
369
+ return statSync(file).isDirectory();
370
+ } catch {
371
+ return false;
372
+ }
373
+ }
374
+ function fileNamedBy(error) {
375
+ if ("url" in error && typeof error.url === "string" && error.url.startsWith("file:")) return pathOfFileUrl(error.url);
376
+ if ("specifier" in error && typeof error.specifier === "string" && "referrer" in error && typeof error.referrer === "string" && isRelativeSpecifier(error.specifier)) {
377
+ const referrer = error.referrer.startsWith("file:") ? pathOfFileUrl(error.referrer) : error.referrer;
378
+ return referrer === void 0 ? void 0 : path$1.resolve(path$1.dirname(referrer), error.specifier);
379
+ }
380
+ if ("position" in error && typeof error.position === "object" && error.position !== null && "file" in error.position && typeof error.position.file === "string" && path$1.isAbsolute(error.position.file)) return error.position.file;
381
+ }
382
+ /**
383
+ * Registers the resolve hook once (idempotent). Call at the start of
384
+ * `loadEntry` so every module in the entry graph benefits, including those
385
+ * imported lazily after the entry itself loads.
386
+ */
387
+ function registerEntryResolution() {
388
+ if (registered || typeof process.versions.bun === "string") return;
389
+ if (typeof mod.registerHooks !== "function") return;
390
+ registered = true;
391
+ mod.registerHooks({ resolve(specifier, context, nextResolve) {
392
+ try {
393
+ const resolved = nextResolve(specifier, context);
394
+ record(resolved.url);
395
+ return resolved;
396
+ } catch (error) {
397
+ if (!isRelativeSpecifier(specifier) || context.parentURL === void 0 || !isModuleNotFoundError(error)) throw error;
398
+ for (const candidate of sourceCandidates(new URL(specifier, context.parentURL))) if (existsSync(fileURLToPath(candidate))) {
399
+ const resolved = nextResolve(candidate.href, context);
400
+ record(resolved.url);
401
+ return resolved;
402
+ }
403
+ throw error;
404
+ }
405
+ } });
406
+ }
407
+ /**
408
+ * TypeScript's extension mapping: for a JS-family or extensionless URL,
409
+ * produce the source candidates to probe. Format-specific: `.mjs` maps only
410
+ * to `.mts`; `.cjs` maps only to `.cts`; `.js` and extensionless probe
411
+ * `.ts`, `.mts`, `.tsx` (keeping `.tsx` so the JSX diagnostic fires), then
412
+ * `./index.ts`. A URL that already has a TypeScript extension has none.
413
+ */
414
+ function sourceCandidates(resolved) {
415
+ const href = resolved.href;
416
+ if (/\.(ts|mts|cts|tsx)$/.test(href)) return [];
417
+ if (href.endsWith(".mjs")) {
418
+ const base = href.slice(0, -4);
419
+ return [new URL(`${base}.mts`)];
420
+ }
421
+ if (href.endsWith(".cjs")) {
422
+ const base = href.slice(0, -4);
423
+ return [new URL(`${base}.cts`)];
424
+ }
425
+ const base = href.endsWith(".js") ? href.slice(0, -3) : href;
426
+ return [
427
+ new URL(`${base}.ts`),
428
+ new URL(`${base}.mts`),
429
+ new URL(`${base}.tsx`),
430
+ new URL(`${base}/index.ts`)
431
+ ];
432
+ }
433
+ function isRelativeSpecifier(specifier) {
434
+ return specifier === "." || specifier === ".." || specifier.startsWith("./") || specifier.startsWith("../");
435
+ }
436
+ function isModuleNotFoundError(error) {
437
+ if (!(error instanceof Error)) return false;
438
+ if (!("code" in error)) return false;
439
+ return error.code === "ERR_MODULE_NOT_FOUND";
440
+ }
441
+ /**
442
+ * `loadEntry` imports a user's topology with the host runtime's own module
443
+ * loader — under node (the CLI's shebang runtime), that loader strips
444
+ * TypeScript types but has no JSX transform (ADR-0005: the framework
445
+ * doesn't bundle or transform the app's code; deploy loading is no
446
+ * exception). A `.tsx`/`.jsx` file anywhere in the topology's import graph
447
+ * dies with node's raw `ERR_UNKNOWN_FILE_EXTENSION`, which names the file
448
+ * but not the cause or the fix. This turns that one case into structured
449
+ * error parts (summary/why/fix) that do — every other load failure (syntax
450
+ * errors, missing files, non-JSX unknown extensions) is untouched.
451
+ */
452
+ const UNKNOWN_EXTENSION_CODE = "ERR_UNKNOWN_FILE_EXTENSION";
453
+ const JSX_EXTENSIONS = [".tsx", ".jsx"];
454
+ function errorCode(error) {
455
+ return "code" in error && typeof error.code === "string" ? error.code : void 0;
456
+ }
457
+ function unknownExtensionPath(error) {
458
+ if (!(error instanceof Error)) return void 0;
459
+ if (errorCode(error) !== UNKNOWN_EXTENSION_CODE) return void 0;
460
+ return /Unknown file extension "\.\w+" for (.+)$/.exec(error.message)?.[1];
461
+ }
462
+ /**
463
+ * Returns structured error parts when `error` is node's
464
+ * `ERR_UNKNOWN_FILE_EXTENSION` for a `.tsx`/`.jsx` file — `undefined` for
465
+ * every other error (including unknown-extension failures for some other
466
+ * extension), so the caller can fall through to its normal rethrow.
467
+ */
468
+ function explainJsxLoadError(error, entryPath) {
469
+ const offendingPath = unknownExtensionPath(error);
470
+ if (offendingPath === void 0) return void 0;
471
+ if (!JSX_EXTENSIONS.some((ext) => offendingPath.endsWith(ext))) return void 0;
472
+ return {
473
+ summary: `"${offendingPath}" can't be loaded.`,
474
+ why: `deploy loads "${entryPath}"'s topology with node's own module loader, which strips TypeScript types but has no JSX transform — so a .tsx/.jsx file can't sit anywhere in that import graph.`,
475
+ fix: "Precompile that file in your own build (transform the JSX away, keep the real npm packages external) and import the compiled output instead of the raw .tsx/.jsx — see examples/email/scripts/build.ts in the prisma/composer repo for a worked example."
476
+ };
477
+ }
478
+ /**
479
+ * Pipeline step 2 (deploy-cli.md § The pipeline): import the entry module
480
+ * (resolved against cwd) and require its default export to be the app's root:
481
+ * an app root built with `appRoot()`, or a module built with `module()`
482
+ * (ADR-0003).
483
+ */
484
+ /**
485
+ * `unloadableFix`, when given, says where the path came from, so a wrong path names its source.
486
+ * `recorded` receives each app file the import loads, so a caller has them when it throws.
487
+ */
488
+ async function loadEntry(entryArg, cwd, unloadableFix, recorded) {
489
+ registerEntryResolution();
490
+ const resolvedPath = path$1.resolve(cwd, entryArg);
491
+ let mod;
492
+ let files;
493
+ try {
494
+ ({value: mod, files} = await recordAppFiles(() => import(pathToFileURL(resolvedPath).href), recorded));
495
+ } catch (error) {
496
+ const explained = explainJsxLoadError(error, resolvedPath);
497
+ if (explained !== void 0) throw new CliStructuredError("COMPOSE.ENTRY_UNLOADABLE", explained.summary, {
498
+ why: explained.why,
499
+ fix: explained.fix,
500
+ where: { path: resolvedPath },
501
+ cause: error
502
+ });
503
+ throw new CliStructuredError("COMPOSE.ENTRY_UNLOADABLE", `Failed to import entry module "${resolvedPath}": ${error instanceof Error ? error.message : String(error)}`, {
504
+ ...unloadableFix === void 0 ? {} : { fix: unloadableFix },
505
+ where: { path: resolvedPath },
506
+ cause: error
507
+ });
508
+ }
509
+ const root = blindCast(mod).default;
510
+ if (isNode(root) && root.kind === "service") throw new CliStructuredError("COMPOSE.ROOT_NOT_MODULE", `The entry "${resolvedPath}" default-exports a service. The app's root must be a module, built with appRoot().`, {
511
+ fix: "Provision the service inside a root, e.g. export default appRoot('name', ({ provision }) => { provision(service); }).",
512
+ where: { path: resolvedPath }
513
+ });
514
+ if (!isNode(root) || root.kind !== "module") throw new CliStructuredError("COMPOSE.ENTRY_EXPORT_INVALID", `Entry module "${resolvedPath}" must default-export the app's root.`, {
515
+ fix: "Build it with appRoot() from @prisma/composer.",
516
+ where: { path: resolvedPath }
517
+ });
518
+ return {
519
+ path: resolvedPath,
520
+ files: [.../* @__PURE__ */ new Set([resolvedPath, ...files])],
521
+ root
522
+ };
523
+ }
524
+ //#endregion
525
+ export { checkComposerConfig as a, noComposerExportMessage as c, registerEntryResolution as i, loadEntry as n, configFileMissing as o, namesDirectoryWithIndex as r, entryMissing as s, appFilesNamedBy as t };
526
+
527
+ //# sourceMappingURL=load-entry-CEoVBdMj-CHOz7jKf.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-entry-CEoVBdMj-CHOz7jKf.mjs","names":["fs","path","path"],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-QKdY85G-.mjs","../../../0-framework/3-tooling/cli/dist/load-entry-CEoVBdMj.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/composer-config.ts\n/**\n* What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.\n* It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.\n*/\nconst SECTION_FIX = \"Write `composer: composer({ entry: './module.ts', extensions: [...], state: ... })` in prisma.config.ts, with `import { defineConfig as composer } from '@prisma/composer/config'`.\";\nconst MOVE_TO_SECTION_FIX = `${SECTION_FIX} If the project has a prisma-composer.config.ts, move its extensions and state into that section and delete the file.`;\nconst SECTION_IS_THE_ONLY_SOURCE = \"Composer reads its configuration only from the `composer` section of prisma.config.ts.\";\nconst DESCRIPTOR_FIX = \"Use the descriptor the extension factory returns, unchanged, instead of building one by hand.\";\nconst RETIRED_FILE_NAMES = [\n\t\"ts\",\n\t\"mts\",\n\t\"mjs\",\n\t\"js\"\n].map((extension) => `prisma-composer.config.${extension}`);\nconst sectionMissing = {\n\tcode: \"CONFIG.SECTION_MISSING\",\n\tsummary: \"No loaded prisma.config.ts declares a `composer` section.\",\n\twhy: `${SECTION_IS_THE_ONLY_SOURCE} A prisma-composer.config.ts file is no longer read.`,\n\tfix: MOVE_TO_SECTION_FIX\n};\n/** What the generated stack file throws when the file it imports has no `composer` export. */\nfunction noComposerExportMessage(configFile) {\n\treturn `${configFile} declares no \\`composer\\` section. Pass the prisma.config.ts that declares it.`;\n}\nfunction configFileMissing(file) {\n\treturn {\n\t\tcode: \"CONFIG.FILE_MISSING\",\n\t\tsummary: `${file} does not exist.`,\n\t\tfix: \"Pass the path of the prisma.config.ts that declares the `composer` section.\",\n\t\twhere: file\n\t};\n}\n/** A prisma-composer.config.* beside the declaring file would otherwise be silently ignored. */\n/** The path with symlinks resolved; the path itself when it cannot be resolved, so the check never throws. */\nfunction realPath(file) {\n\ttry {\n\t\treturn fs.realpathSync(file);\n\t} catch {\n\t\treturn file;\n\t}\n}\nfunction retiredFileFinding(configFile) {\n\tconst directory = path.dirname(realPath(configFile));\n\tconst found = RETIRED_FILE_NAMES.map((name) => path.join(directory, name)).find((file) => fs.existsSync(file));\n\tif (found === void 0) return void 0;\n\treturn {\n\t\tcode: \"CONFIG.FILE_RETIRED\",\n\t\tsummary: `${found} is no longer read.`,\n\t\twhy: SECTION_IS_THE_ONLY_SOURCE,\n\t\tfix: MOVE_TO_SECTION_FIX,\n\t\twhere: found\n\t};\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isExtensionDescriptor(value) {\n\treturn isObject(value) && typeof value[\"id\"] === \"string\" && value[\"id\"].length > 0 && isObject(value[\"nodes\"]);\n}\nfunction isStateDescriptor(value) {\n\treturn isObject(value) && typeof value[\"extension\"] === \"string\" && typeof value[\"create\"] === \"function\";\n}\nconst stateInvalid = {\n\tcode: \"CONFIG.FIELD_INVALID\",\n\tsummary: \"`composer.state` must be a state descriptor with a string `extension` and a `create` function.\",\n\tfix: \"Set `state` to the state descriptor an extension provides, e.g. `state: prismaState()`.\",\n\tfield: \"state\"\n};\nconst SECTION_FIELDS = /* @__PURE__ */ new Set([\n\t\"entry\",\n\t\"extensions\",\n\t\"state\",\n\t\"config\",\n\t\"secrets\"\n]);\nconst entryInvalid = {\n\tcode: \"CONFIG.FIELD_INVALID\",\n\tsummary: \"`composer.entry` must be a non-empty string: the path to the module whose default export is the app.\",\n\tfix: \"Set `entry` to that module's path, relative to prisma.config.ts, e.g. `entry: './module.ts'`.\",\n\tfield: \"entry\"\n};\n/** Neither the section's `entry` nor an override names the module whose default export is the app. */\nconst entryMissing = {\n\tcode: \"CONFIG.ENTRY_MISSING\",\n\tsummary: \"No entry module is set, so there is no app to load.\",\n\twhy: \"The entry is the module whose default export is the app root, built with appRoot(...).\",\n\tfix: \"Set `entry: './module.ts'` in the `composer` section of prisma.config.ts, or pass `--entry <path>` (the `entry` input when calling @prisma/composer/control).\",\n\tfield: \"entry\"\n};\nfunction unknownField(key) {\n\treturn {\n\t\tcode: \"CONFIG.FIELD_UNKNOWN\",\n\t\tsummary: `The \\`composer\\` section has no field \\`${key}\\`.`,\n\t\tfix: key === \"composer\" ? \"Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `entry`, `extensions`, `state`, `config` and `secrets`.\" : `Remove \\`${key}\\`. The section takes only \\`entry\\`, \\`extensions\\`, \\`state\\`, \\`config\\` and \\`secrets\\`.`,\n\t\tfield: key\n\t};\n}\nfunction checkExtensions(value) {\n\tif (!Array.isArray(value)) return {\n\t\textensions: [],\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: \"`composer.extensions` must be an array of extension descriptors.\",\n\t\t\tfix: \"Set `extensions` to the descriptors your extensions provide, e.g. `extensions: [nodeBuild()]`.\",\n\t\t\tfield: \"extensions\"\n\t\t}]\n\t};\n\tconst findings = [];\n\tconst extensions = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const [index, entry] of value.entries()) {\n\t\tconst field = `extensions[${index}]`;\n\t\tif (!isObject(entry)) {\n\t\t\tfindings.push({\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tsummary: `\\`composer.${field}\\` must be an extension descriptor object.`,\n\t\t\t\tfix: \"Put the descriptor an extension factory returns here, e.g. `nodeBuild()`, not the factory itself.\",\n\t\t\t\tfield\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst id = entry[\"id\"];\n\t\tif (typeof id !== \"string\" || id.length === 0) findings.push({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: `\\`composer.${field}.id\\` must be a non-empty string (the extension package name).`,\n\t\t\tfix: DESCRIPTOR_FIX,\n\t\t\tfield: `${field}.id`\n\t\t});\n\t\telse if (seen.has(id)) findings.push({\n\t\t\tcode: \"CONFIG.EXTENSION_DUPLICATE\",\n\t\t\tsummary: `Extension \"${id}\" is listed more than once in \\`composer.extensions\\`.`,\n\t\t\tfix: `Remove the repeated \"${id}\" entry from \\`extensions\\`.`,\n\t\t\tfield: `${field}.id`\n\t\t});\n\t\telse seen.add(id);\n\t\tif (!isObject(entry[\"nodes\"])) findings.push({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: `\\`composer.${field}.nodes\\` must be an object (the node-ID → control registry).`,\n\t\t\tfix: DESCRIPTOR_FIX,\n\t\t\tfield: `${field}.nodes`\n\t\t});\n\t\tif (isExtensionDescriptor(entry)) extensions.push(entry);\n\t}\n\treturn {\n\t\tfindings,\n\t\textensions\n\t};\n}\nfunction isAdapterList(value) {\n\treturn Array.isArray(value) && value.every((entry) => typeof entry === \"function\");\n}\nfunction checkAdapters(list, value) {\n\tif (value === void 0) return [];\n\tif (!Array.isArray(value)) return [{\n\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\tsummary: `\\`composer.${list}\\` must be an array of adapters.`,\n\t\tfix: `Set \\`${list}\\` to a list of adapters, e.g. \\`${list}: [dotenv(), environmentVariables()]\\`, imported from '@prisma/composer/config'.`,\n\t\tfield: list\n\t}];\n\treturn value.flatMap((entry, index) => typeof entry === \"function\" ? [] : [{\n\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\tsummary: `\\`composer.${list}[${index}]\\` must be an adapter: a function that receives the environment and returns its values.`,\n\t\tfix: \"Put an adapter here, e.g. `dotenv()`.\",\n\t\tfield: `${list}[${index}]`\n\t}]);\n}\nfunction checkFields(section) {\n\tif (Object.hasOwn(section, \"configPath\")) return {\n\t\tok: false,\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_RETIRED\",\n\t\t\tsummary: \"`composer.configPath` is no longer supported: prisma-composer.config.ts is no longer read.\",\n\t\t\twhy: SECTION_IS_THE_ONLY_SOURCE,\n\t\t\tfix: `Replace \\`configPath\\` with the section itself. ${MOVE_TO_SECTION_FIX}`,\n\t\t\tfield: \"configPath\"\n\t\t}]\n\t};\n\tif (Object.hasOwn(section, \"composer\")) return {\n\t\tok: false,\n\t\tfindings: [unknownField(\"composer\")]\n\t};\n\tconst findings = Object.keys(section).filter((key) => !SECTION_FIELDS.has(key)).map(unknownField);\n\tconst checked = checkExtensions(section[\"extensions\"]);\n\tfindings.push(...checked.findings);\n\tconst state = section[\"state\"];\n\tif (!isStateDescriptor(state)) findings.push(stateInvalid);\n\tconst entry = section[\"entry\"];\n\tconst entryValid = entry === void 0 || typeof entry === \"string\" && entry.length > 0;\n\tif (!entryValid) findings.push(entryInvalid);\n\tconst config = section[\"config\"];\n\tconst secrets = section[\"secrets\"];\n\tfindings.push(...checkAdapters(\"config\", config), ...checkAdapters(\"secrets\", secrets));\n\tconst [first, ...rest] = findings;\n\tif (first === void 0 && isStateDescriptor(state) && entryValid && (config === void 0 || isAdapterList(config)) && (secrets === void 0 || isAdapterList(secrets))) return {\n\t\tok: true,\n\t\tvalue: {\n\t\t\textensions: checked.extensions,\n\t\t\tstate,\n\t\t\t...entry === void 0 ? {} : { entry },\n\t\t\t...config === void 0 ? {} : { config },\n\t\t\t...secrets === void 0 ? {} : { secrets }\n\t\t}\n\t};\n\treturn {\n\t\tok: false,\n\t\tfindings: [first ?? stateInvalid, ...rest]\n\t};\n}\n/**\n* Checks the fields that identify each descriptor and returns the descriptors as the config file's own objects.\n* Never throws: a section's values are user code, and a throwing getter or Proxy trap becomes a finding.\n*/\nfunction checkComposerSection(raw) {\n\tif (!isObject(raw)) return {\n\t\tok: false,\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: \"The `composer` section of prisma.config.ts must be an object.\",\n\t\t\tfix: SECTION_FIX\n\t\t}]\n\t};\n\ttry {\n\t\treturn checkFields({ ...raw });\n\t} catch (cause) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tfindings: [{\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tsummary: \"The `composer` section of prisma.config.ts could not be read.\",\n\t\t\t\twhy: `Reading it threw: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\tfix: SECTION_FIX\n\t\t\t}]\n\t\t};\n\t}\n}\n/**\n* The whole check, shared by the section validator and the programmatic operations so both report the same findings in the same order: the retired file beside the declaring `configFile` (resolved through symlinks), then every field finding.\n*/\nfunction checkComposerConfig(raw, configFile) {\n\tconst retired = retiredFileFinding(configFile);\n\tconst checked = checkComposerSection(raw);\n\tif (retired === void 0) return checked;\n\treturn {\n\t\tok: false,\n\t\tfindings: checked.ok ? [retired] : [retired, ...checked.findings]\n\t};\n}\n//#endregion\nexport { sectionMissing as a, noComposerExportMessage as i, configFileMissing as n, entryMissing as r, checkComposerConfig as t };\n\n//# sourceMappingURL=composer-config-QKdY85G-.mjs.map","import * as mod from \"node:module\";\nimport { existsSync, statSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport { isNode } from \"@internal/core\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/entry-resolution.ts\n/**\n* Synchronous Node resolve hook so that entry modules may import relative\n* files using the specifier forms TypeScript accepts by default —\n* extensionless `./service` and `./service.js` for a `.ts` source file —\n* without requiring `allowImportingTsExtensions` in every consumer's tsconfig.\n*\n* Resolution only; uses TypeScript's own documented mapping: for a specifier\n* Node could not resolve, strip any JS-family extension and probe the\n* corresponding TypeScript source; first candidate that exists on disk wins.\n* Format-specific rules: `.mjs` → `.mts`; `.cjs` → `.cts`; `.js` and\n* extensionless → `.ts`, `.mts`, `.tsx`, then `./index.ts`. Bare and package\n* specifiers are never touched. Existing `./x.ts` imports keep working —\n* Node resolves them before the hook fires (ADR-0005: no transform, no\n* guessing, deterministic TypeScript rule).\n*\n* Bun resolves `./x.js` and `./x` to `x.ts` natively, so the hook is a\n* no-op under Bun. Nothing is registered there.\n*\n* The hook also observes, without changing anything: `recordAppFiles` uses\n* it to learn which app files an entry import loaded.\n*/\nlet registered = false;\nlet recording;\n/** An app file: a `file:` module outside every `node_modules` directory. */\nfunction appFile(url) {\n\tif (!url.startsWith(\"file:\")) return void 0;\n\tconst file = fileURLToPath(url);\n\treturn file.split(path.sep).includes(\"node_modules\") ? void 0 : file;\n}\nfunction record(url) {\n\tconst file = recording === void 0 ? void 0 : appFile(url);\n\tif (file !== void 0) recording?.add(file);\n}\n/**\n* Runs `load` and returns the app files it imported: every module outside\n* `node_modules` that the runtime loaded for the first time while it ran,\n* static and dynamic imports alike. Under Node the resolve hook records them;\n* under Bun they are the modules `require.cache` gained, which includes ES\n* modules. A module already loaded before `load` started, and what only it\n* imports, is not recorded. Each file is also added to `recorded` as it is\n* found, so a caller still has them when `load` throws.\n*/\nasync function recordAppFiles(load, recorded = /* @__PURE__ */ new Set()) {\n\tif (typeof process.versions.bun === \"string\") {\n\t\tconst cache = mod.createRequire(import.meta.url).cache;\n\t\tconst before = new Set(Object.keys(cache));\n\t\tconst files = [];\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tvalue: await load(),\n\t\t\t\tfiles\n\t\t\t};\n\t\t} finally {\n\t\t\tfor (const key of Object.keys(cache)) {\n\t\t\t\tif (before.has(key) || !path.isAbsolute(key)) continue;\n\t\t\t\tif (key.split(path.sep).includes(\"node_modules\")) continue;\n\t\t\t\tfiles.push(key);\n\t\t\t\trecorded.add(key);\n\t\t\t}\n\t\t}\n\t}\n\tregisterEntryResolution();\n\tconst files = /* @__PURE__ */ new Set();\n\trecording = files;\n\ttry {\n\t\treturn {\n\t\t\tvalue: await load(),\n\t\t\tfiles: [...files]\n\t\t};\n\t} finally {\n\t\trecording = void 0;\n\t\tfor (const file of files) recorded.add(file);\n\t}\n}\n/** The path of a `file:` URL, or `undefined` for one that names no local file, such as one with a host. */\nfunction pathOfFileUrl(url) {\n\ttry {\n\t\treturn fileURLToPath(url);\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* The app files an import error names: the module that could not be found, or the file that did\n* not parse, when the runtime says which. A module that could not be found comes with every file\n* the resolve hook would try for it, since the user may create any of them. A directory is never\n* returned: in its place come the files the hook would try inside it. Follows `cause`.\n*/\nfunction appFilesNamedBy(error) {\n\tconst named = appPathNamedBy(error);\n\treturn named === void 0 ? [] : filesFor(named);\n}\n/** Whether an import error names a directory of the app that holds an `index.ts`, which the import should have loaded. */\nfunction namesDirectoryWithIndex(error) {\n\tconst named = appPathNamedBy(error);\n\treturn named !== void 0 && isDirectory(named) && filesFor(named).some(existsSync);\n}\nfunction appPathNamedBy(error) {\n\tconst visited = /* @__PURE__ */ new Set();\n\tfor (let current = error; typeof current === \"object\" && current !== null;) {\n\t\tif (visited.has(current)) break;\n\t\tvisited.add(current);\n\t\tconst named = fileNamedBy(current);\n\t\tif (named !== void 0 && !named.split(path.sep).includes(\"node_modules\")) return path.resolve(named);\n\t\tcurrent = \"cause\" in current ? current.cause : void 0;\n\t}\n}\nfunction filesFor(named) {\n\tconst candidates = () => sourceCandidates(pathToFileURL(named)).map((url) => fileURLToPath(url));\n\tif (isDirectory(named)) return candidates().filter((candidate) => candidate.startsWith(named + path.sep));\n\tif (existsSync(named)) return [named];\n\treturn [named, ...candidates()];\n}\nfunction isDirectory(file) {\n\ttry {\n\t\treturn statSync(file).isDirectory();\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction fileNamedBy(error) {\n\tif (\"url\" in error && typeof error.url === \"string\" && error.url.startsWith(\"file:\")) return pathOfFileUrl(error.url);\n\tif (\"specifier\" in error && typeof error.specifier === \"string\" && \"referrer\" in error && typeof error.referrer === \"string\" && isRelativeSpecifier(error.specifier)) {\n\t\tconst referrer = error.referrer.startsWith(\"file:\") ? pathOfFileUrl(error.referrer) : error.referrer;\n\t\treturn referrer === void 0 ? void 0 : path.resolve(path.dirname(referrer), error.specifier);\n\t}\n\tif (\"position\" in error && typeof error.position === \"object\" && error.position !== null && \"file\" in error.position && typeof error.position.file === \"string\" && path.isAbsolute(error.position.file)) return error.position.file;\n}\n/**\n* Registers the resolve hook once (idempotent). Call at the start of\n* `loadEntry` so every module in the entry graph benefits, including those\n* imported lazily after the entry itself loads.\n*/\nfunction registerEntryResolution() {\n\tif (registered || typeof process.versions.bun === \"string\") return;\n\tif (typeof mod.registerHooks !== \"function\") return;\n\tregistered = true;\n\tmod.registerHooks({ resolve(specifier, context, nextResolve) {\n\t\ttry {\n\t\t\tconst resolved = nextResolve(specifier, context);\n\t\t\trecord(resolved.url);\n\t\t\treturn resolved;\n\t\t} catch (error) {\n\t\t\tif (!isRelativeSpecifier(specifier) || context.parentURL === void 0 || !isModuleNotFoundError(error)) throw error;\n\t\t\tfor (const candidate of sourceCandidates(new URL(specifier, context.parentURL))) if (existsSync(fileURLToPath(candidate))) {\n\t\t\t\tconst resolved = nextResolve(candidate.href, context);\n\t\t\t\trecord(resolved.url);\n\t\t\t\treturn resolved;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t} });\n}\n/**\n* TypeScript's extension mapping: for a JS-family or extensionless URL,\n* produce the source candidates to probe. Format-specific: `.mjs` maps only\n* to `.mts`; `.cjs` maps only to `.cts`; `.js` and extensionless probe\n* `.ts`, `.mts`, `.tsx` (keeping `.tsx` so the JSX diagnostic fires), then\n* `./index.ts`. A URL that already has a TypeScript extension has none.\n*/\nfunction sourceCandidates(resolved) {\n\tconst href = resolved.href;\n\tif (/\\.(ts|mts|cts|tsx)$/.test(href)) return [];\n\tif (href.endsWith(\".mjs\")) {\n\t\tconst base = href.slice(0, -4);\n\t\treturn [new URL(`${base}.mts`)];\n\t}\n\tif (href.endsWith(\".cjs\")) {\n\t\tconst base = href.slice(0, -4);\n\t\treturn [new URL(`${base}.cts`)];\n\t}\n\tconst base = href.endsWith(\".js\") ? href.slice(0, -3) : href;\n\treturn [\n\t\tnew URL(`${base}.ts`),\n\t\tnew URL(`${base}.mts`),\n\t\tnew URL(`${base}.tsx`),\n\t\tnew URL(`${base}/index.ts`)\n\t];\n}\nfunction isRelativeSpecifier(specifier) {\n\treturn specifier === \".\" || specifier === \"..\" || specifier.startsWith(\"./\") || specifier.startsWith(\"../\");\n}\nfunction isModuleNotFoundError(error) {\n\tif (!(error instanceof Error)) return false;\n\tif (!(\"code\" in error)) return false;\n\treturn error.code === \"ERR_MODULE_NOT_FOUND\";\n}\n//#endregion\n//#region src/jsx-load-error.ts\n/**\n* `loadEntry` imports a user's topology with the host runtime's own module\n* loader — under node (the CLI's shebang runtime), that loader strips\n* TypeScript types but has no JSX transform (ADR-0005: the framework\n* doesn't bundle or transform the app's code; deploy loading is no\n* exception). A `.tsx`/`.jsx` file anywhere in the topology's import graph\n* dies with node's raw `ERR_UNKNOWN_FILE_EXTENSION`, which names the file\n* but not the cause or the fix. This turns that one case into structured\n* error parts (summary/why/fix) that do — every other load failure (syntax\n* errors, missing files, non-JSX unknown extensions) is untouched.\n*/\nconst UNKNOWN_EXTENSION_CODE = \"ERR_UNKNOWN_FILE_EXTENSION\";\nconst JSX_EXTENSIONS = [\".tsx\", \".jsx\"];\nfunction errorCode(error) {\n\treturn \"code\" in error && typeof error.code === \"string\" ? error.code : void 0;\n}\nfunction unknownExtensionPath(error) {\n\tif (!(error instanceof Error)) return void 0;\n\tif (errorCode(error) !== UNKNOWN_EXTENSION_CODE) return void 0;\n\treturn /Unknown file extension \"\\.\\w+\" for (.+)$/.exec(error.message)?.[1];\n}\n/**\n* Returns structured error parts when `error` is node's\n* `ERR_UNKNOWN_FILE_EXTENSION` for a `.tsx`/`.jsx` file — `undefined` for\n* every other error (including unknown-extension failures for some other\n* extension), so the caller can fall through to its normal rethrow.\n*/\nfunction explainJsxLoadError(error, entryPath) {\n\tconst offendingPath = unknownExtensionPath(error);\n\tif (offendingPath === void 0) return void 0;\n\tif (!JSX_EXTENSIONS.some((ext) => offendingPath.endsWith(ext))) return void 0;\n\treturn {\n\t\tsummary: `\"${offendingPath}\" can't be loaded.`,\n\t\twhy: `deploy loads \"${entryPath}\"'s topology with node's own module loader, which strips TypeScript types but has no JSX transform — so a .tsx/.jsx file can't sit anywhere in that import graph.`,\n\t\tfix: \"Precompile that file in your own build (transform the JSX away, keep the real npm packages external) and import the compiled output instead of the raw .tsx/.jsx — see examples/email/scripts/build.ts in the prisma/composer repo for a worked example.\"\n\t};\n}\n//#endregion\n//#region src/load-entry.ts\n/**\n* Pipeline step 2 (deploy-cli.md § The pipeline): import the entry module\n* (resolved against cwd) and require its default export to be the app's root:\n* an app root built with `appRoot()`, or a module built with `module()`\n* (ADR-0003).\n*/\n/**\n* `unloadableFix`, when given, says where the path came from, so a wrong path names its source.\n* `recorded` receives each app file the import loads, so a caller has them when it throws.\n*/\nasync function loadEntry(entryArg, cwd, unloadableFix, recorded) {\n\tregisterEntryResolution();\n\tconst resolvedPath = path.resolve(cwd, entryArg);\n\tlet mod;\n\tlet files;\n\ttry {\n\t\t({value: mod, files} = await recordAppFiles(() => import(pathToFileURL(resolvedPath).href), recorded));\n\t} catch (error) {\n\t\tconst explained = explainJsxLoadError(error, resolvedPath);\n\t\tif (explained !== void 0) throw new CliStructuredError(\"COMPOSE.ENTRY_UNLOADABLE\", explained.summary, {\n\t\t\twhy: explained.why,\n\t\t\tfix: explained.fix,\n\t\t\twhere: { path: resolvedPath },\n\t\t\tcause: error\n\t\t});\n\t\tthrow new CliStructuredError(\"COMPOSE.ENTRY_UNLOADABLE\", `Failed to import entry module \"${resolvedPath}\": ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\t...unloadableFix === void 0 ? {} : { fix: unloadableFix },\n\t\t\twhere: { path: resolvedPath },\n\t\t\tcause: error\n\t\t});\n\t}\n\tconst root = blindCast(mod).default;\n\tif (isNode(root) && root.kind === \"service\") throw new CliStructuredError(\"COMPOSE.ROOT_NOT_MODULE\", `The entry \"${resolvedPath}\" default-exports a service. The app's root must be a module, built with appRoot().`, {\n\t\tfix: \"Provision the service inside a root, e.g. export default appRoot('name', ({ provision }) => { provision(service); }).\",\n\t\twhere: { path: resolvedPath }\n\t});\n\tif (!isNode(root) || root.kind !== \"module\") throw new CliStructuredError(\"COMPOSE.ENTRY_EXPORT_INVALID\", `Entry module \"${resolvedPath}\" must default-export the app's root.`, {\n\t\tfix: \"Build it with appRoot() from @prisma/composer.\",\n\t\twhere: { path: resolvedPath }\n\t});\n\treturn {\n\t\tpath: resolvedPath,\n\t\tfiles: [.../* @__PURE__ */ new Set([resolvedPath, ...files])],\n\t\troot\n\t};\n}\n//#endregion\nexport { registerEntryResolution as i, appFilesNamedBy as n, namesDirectoryWithIndex as r, loadEntry as t };\n\n//# sourceMappingURL=load-entry-CEoVBdMj.mjs.map"],"mappings":";;;;;;;;;;;;;;AAOA,MAAM,cAAc;AACpB,MAAM,sBAAsB,GAAG,YAAY;AAC3C,MAAM,6BAA6B;AACnC,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;AACD,CAAC,CAAC,KAAK,cAAc,0BAA0B,WAAW;;AAQ1D,SAAS,wBAAwB,YAAY;CAC5C,OAAO,GAAG,WAAW;AACtB;AACA,SAAS,kBAAkB,MAAM;CAChC,OAAO;EACN,MAAM;EACN,SAAS,GAAG,KAAK;EACjB,KAAK;EACL,OAAO;CACR;AACD;;;AAGA,SAAS,SAAS,MAAM;CACvB,IAAI;EACH,OAAOA,KAAG,aAAa,IAAI;CAC5B,QAAQ;EACP,OAAO;CACR;AACD;AACA,SAAS,mBAAmB,YAAY;CACvC,MAAM,YAAYC,OAAK,QAAQ,SAAS,UAAU,CAAC;CACnD,MAAM,QAAQ,mBAAmB,KAAK,SAASA,OAAK,KAAK,WAAW,IAAI,CAAC,CAAC,CAAC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GACrG,KAAK,UAAU;GACf,KAAK,UAAU;GACf,OAAO,EAAE,MAAM,aAAa;GAC5B,OAAO;EACR,CAAC;EACD,MAAM,IAAI,mBAAmB,4BAA4B,kCAAkC,aAAa,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,KAAK;GACtK,GAAG,kBAAkB,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,cAAc;GACxD,OAAO,EAAE,MAAM,aAAa;GAC5B,OAAO;EACR,CAAC;CACF;CACA,MAAM,OAAO,UAAU,GAAG,CAAC,CAAC;CAC5B,IAAI,OAAO,IAAI,KAAK,KAAK,SAAS,WAAW,MAAM,IAAI,mBAAmB,2BAA2B,cAAc,aAAa,sFAAsF;EACrN,KAAK;EACL,OAAO,EAAE,MAAM,aAAa;CAC7B,CAAC;CACD,IAAI,CAAC,OAAO,IAAI,KAAK,KAAK,SAAS,UAAU,MAAM,IAAI,mBAAmB,gCAAgC,iBAAiB,aAAa,wCAAwC;EAC/K,KAAK;EACL,OAAO,EAAE,MAAM,aAAa;CAC7B,CAAC;CACD,OAAO;EACN,MAAM;EACN,OAAO,CAAC,mBAAmB,IAAI,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;EAC5D;CACD;AACD"}
@@ -0,0 +1,31 @@
1
+ import { A as LocalTargetDescriptor, J as PrismaAppConfig, p as ContainerInstance, t as AlchemyStateLayer, z as NamedSecrets } from "./app-config-DriAu5RU-C8hYpR38.mjs";
2
+ import * as Layer from "effect/Layer";
3
+ //#region ../../0-framework/1-core/core/dist/local-target.d.mts
4
+ //#region src/control/local-target.d.ts
5
+ /**
6
+ * Resolves every non-build-only configured extension's lazy `localTarget`
7
+ * thunk, once (ADR-0041's lazy local-target reference — operator directive:
8
+ * the production control entry carries only the thunk, never the
9
+ * descriptor, so resolving it is this module's job, not something a deploy
10
+ * path ever does). A build-only extension (`isBuildOnlyExtension`) owns no
11
+ * resources or services and is skipped entirely — never even checked for a
12
+ * `localTarget` thunk. Every other configured extension must be
13
+ * local-target-capable, or the dev command cannot bring the app up at all,
14
+ * so a missing thunk throws naming the extension. `prisma dev` calls this
15
+ * once on its main thread for the session's hooks, and once in each converge
16
+ * worker thread for `localTargetProviders`.
17
+ */
18
+ declare function resolveLocalTargets(config: PrismaAppConfig): Promise<ReadonlyMap<string, LocalTargetDescriptor>>;
19
+ /**
20
+ * All configured extensions' local-target providers merged, config array
21
+ * order (ADR-0041), from the ALREADY-RESOLVED descriptor map
22
+ * (`resolveLocalTargets`'s product — this function itself never touches a
23
+ * `localTarget` thunk). `prisma dev`'s converge worker thread is this
24
+ * aggregator's one caller, passing the result as `LowerOptions.providers`.
25
+ */
26
+ declare function localTargetProviders(resolved: ReadonlyMap<string, LocalTargetDescriptor>, containers: ReadonlyMap<string, ContainerInstance>, devDir: string, plainVariableText: Readonly<Record<string, string>>, namedSecrets: NamedSecrets): Layer.Layer<never>;
27
+ /** The state store `prisma dev` converges against: Alchemy's file store in the app's working directory. */
28
+ declare function devState(): AlchemyStateLayer;
29
+ //#endregion
30
+ export { localTargetProviders as n, resolveLocalTargets as r, devState as t };
31
+ //# sourceMappingURL=local-target-7KRsLMDO.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-target-7KRsLMDO.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/local-target.d.mts"],"mappings":";;;;;;;;;;;;;;;;;iBAgBiB,oBAAoB,QAAQ,kBAAkB,QAAQ,oBAAoB;;;;;;;;iBAQ1E,qBAAqB,UAAU,oBAAoB,wBAAwB,YAAY,oBAAoB,oBAAoB,gBAAgB,mBAAmB,SAAS,yBAAyB,cAAc,eAAe,MAAM;;iBAEvO,YAAY"}