@prisma/orm-toolchain 8.0.0-rc.3-dev.7 → 8.0.0-rc.3-dev.8

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 (86) hide show
  1. package/dist/{aggregate-CPZB020V.mjs → aggregate-BOlLu7k7.mjs} +8 -8
  2. package/dist/{aggregate-CPZB020V.mjs.map → aggregate-BOlLu7k7.mjs.map} +1 -1
  3. package/dist/cli-telemetry.d.mts +2 -2
  4. package/dist/cli-telemetry.mjs +9 -12
  5. package/dist/cli-telemetry.mjs.map +1 -1
  6. package/dist/cli.d.mts +1 -5
  7. package/dist/cli.d.mts.map +1 -1
  8. package/dist/cli.mjs +117 -58
  9. package/dist/cli.mjs.map +1 -1
  10. package/dist/cli__control-api.d.mts +3 -3
  11. package/dist/cli__control-api.d.mts.map +1 -1
  12. package/dist/cli__control-api.mjs +1 -1
  13. package/dist/cli__control-api__testing.d.mts +1 -1
  14. package/dist/cli__migration-cli.mjs +5 -5
  15. package/dist/cli__migration-cli.mjs.map +1 -1
  16. package/dist/config-loader.d.mts +1 -1
  17. package/dist/config-loader.mjs +1 -1
  18. package/dist/{contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs → contract-snapshot-store-BAmQkHe5-BJFpuIQQ.mjs} +3 -3
  19. package/dist/{contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs.map → contract-snapshot-store-BAmQkHe5-BJFpuIQQ.mjs.map} +1 -1
  20. package/dist/{db-verify-BwgNK50T-DGvKgFCK.d.mts → db-verify-BRDzImLV-3eI346zy.d.mts} +3 -3
  21. package/dist/{db-verify-BwgNK50T-DGvKgFCK.d.mts.map → db-verify-BRDzImLV-3eI346zy.d.mts.map} +1 -1
  22. package/dist/emitter.mjs +1 -1
  23. package/dist/{errors-CXbGUWGu-CstQHPh6.mjs → errors-CcEpbfnE-CsSXrttT.mjs} +6 -6
  24. package/dist/errors-CcEpbfnE-CsSXrttT.mjs.map +1 -0
  25. package/dist/{exports-DLDFkjNv.mjs → exports-CN1Qe98l.mjs} +3 -3
  26. package/dist/{exports-DLDFkjNv.mjs.map → exports-CN1Qe98l.mjs.map} +1 -1
  27. package/dist/{exports-UjssmDwy.mjs → exports-Cv8nMmBT.mjs} +15 -51
  28. package/dist/exports-Cv8nMmBT.mjs.map +1 -0
  29. package/dist/{exports-BCLg4CiV-05kuwcb0.mjs → exports-Dw2WIX63-CQgI2e_L.mjs} +6 -6
  30. package/dist/exports-Dw2WIX63-CQgI2e_L.mjs.map +1 -0
  31. package/dist/{graph-membership-BViWUMpP-C4lYYJdU.mjs → graph-membership-BoITerZB-C2-x1Qp6.mjs} +3 -3
  32. package/dist/{graph-membership-BViWUMpP-C4lYYJdU.mjs.map → graph-membership-BoITerZB-C2-x1Qp6.mjs.map} +1 -1
  33. package/dist/{import-roots-CfoYgejL.d.mts → import-roots-ARK1wjzc.d.mts} +3 -3
  34. package/dist/{import-roots-CfoYgejL.d.mts.map → import-roots-ARK1wjzc.d.mts.map} +1 -1
  35. package/dist/{import-roots-CNFBPAT1.mjs → import-roots-D0H8HuRw.mjs} +3 -3
  36. package/dist/import-roots-D0H8HuRw.mjs.map +1 -0
  37. package/dist/{index-BRjNSwL-.d.mts → index-u5RdrumF.d.mts} +2 -10
  38. package/dist/index-u5RdrumF.d.mts.map +1 -0
  39. package/dist/{invariants-CTHy88OP-CYI2a8IO.mjs → invariants-DcFfhJMZ-BHDWZP9k.mjs} +3 -3
  40. package/dist/{invariants-CTHy88OP-CYI2a8IO.mjs.map → invariants-DcFfhJMZ-BHDWZP9k.mjs.map} +1 -1
  41. package/dist/{io-635GlNx1-D3zrw2qu.mjs → io-DsViRB_O-Ci1kJGBg.mjs} +5 -5
  42. package/dist/{io-635GlNx1-D3zrw2qu.mjs.map → io-DsViRB_O-Ci1kJGBg.mjs.map} +1 -1
  43. package/dist/{migration-BB4LDjuS.mjs → migration-CWSj4pMr.mjs} +3 -3
  44. package/dist/{migration-BB4LDjuS.mjs.map → migration-CWSj4pMr.mjs.map} +1 -1
  45. package/dist/{migration-graph-_SJImD5V-BURyY1KM.mjs → migration-graph-DwXAHP6T-NgmP2DNz.mjs} +3 -3
  46. package/dist/{migration-graph-_SJImD5V-BURyY1KM.mjs.map → migration-graph-DwXAHP6T-NgmP2DNz.mjs.map} +1 -1
  47. package/dist/migration-tools.d.mts +1 -1
  48. package/dist/migration-tools.mjs +12 -12
  49. package/dist/migration-tools__aggregate.mjs +1 -1
  50. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  51. package/dist/migration-tools__errors.mjs +1 -1
  52. package/dist/migration-tools__invariants.mjs +1 -1
  53. package/dist/migration-tools__io.mjs +1 -1
  54. package/dist/migration-tools__migration-graph.mjs +2 -2
  55. package/dist/migration-tools__migration.mjs +1 -1
  56. package/dist/migration-tools__ref-resolution.mjs +1 -1
  57. package/dist/migration-tools__refs.mjs +1 -1
  58. package/dist/migration-tools__spaces.d.mts +1 -1
  59. package/dist/migration-tools__spaces.mjs +2 -2
  60. package/dist/publish-surface.d.mts +1 -1
  61. package/dist/publish-surface.mjs +1 -1
  62. package/dist/publish-surface__import-roots.d.mts +1 -1
  63. package/dist/publish-surface__import-roots.mjs +1 -1
  64. package/dist/quick-reference-postgres.md +1 -1
  65. package/dist/{ref-BSRf-7Uh-JmET-ptm.mjs → ref-dWFulULw-TMeX1ZM1.mjs} +16 -16
  66. package/dist/ref-dWFulULw-TMeX1ZM1.mjs.map +1 -0
  67. package/dist/{ref-resolution-HeNBXW53.mjs → ref-resolution-Cbdejrwt.mjs} +2 -2
  68. package/dist/{ref-resolution-HeNBXW53.mjs.map → ref-resolution-Cbdejrwt.mjs.map} +1 -1
  69. package/dist/{refs-WK86uYYp-gM8tvWQP.mjs → refs-KVVlm3lE-BcqdpdYD.mjs} +6 -6
  70. package/dist/refs-KVVlm3lE-BcqdpdYD.mjs.map +1 -0
  71. package/dist/{spaces-Dj65JrwZ.d.mts → spaces-B20bgxF9.d.mts} +2 -2
  72. package/dist/{spaces-Dj65JrwZ.d.mts.map → spaces-B20bgxF9.d.mts.map} +1 -1
  73. package/dist/{spaces-4qMOAYE9.mjs → spaces-CHrjWRoZ.mjs} +7 -7
  74. package/dist/spaces-CHrjWRoZ.mjs.map +1 -0
  75. package/dist/{verify-contract-spaces-DhJTb0zM-B62maCfE.mjs → verify-contract-spaces-DomK5uP5-CyI3hD3Q.mjs} +7 -7
  76. package/dist/{verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map → verify-contract-spaces-DomK5uP5-CyI3hD3Q.mjs.map} +1 -1
  77. package/dist/vite-plugin-contract-emit.mjs +3 -3
  78. package/package.json +12 -12
  79. package/dist/errors-CXbGUWGu-CstQHPh6.mjs.map +0 -1
  80. package/dist/exports-BCLg4CiV-05kuwcb0.mjs.map +0 -1
  81. package/dist/exports-UjssmDwy.mjs.map +0 -1
  82. package/dist/import-roots-CNFBPAT1.mjs.map +0 -1
  83. package/dist/index-BRjNSwL-.d.mts.map +0 -1
  84. package/dist/ref-BSRf-7Uh-JmET-ptm.mjs.map +0 -1
  85. package/dist/refs-WK86uYYp-gM8tvWQP.mjs.map +0 -1
  86. package/dist/spaces-4qMOAYE9.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
1
+ import { r as getEmittedArtifactPaths } from "./exports-Dw2WIX63-CQgI2e_L.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { realpathSync } from "node:fs";
4
4
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
@@ -6,10 +6,10 @@ import { isStructuredError } from "@prisma/orm-framework/utils/structured-error"
6
6
  import { blindCast } from "@prisma/orm-framework/utils/casts";
7
7
  import { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from "@prisma/orm-framework/errors/control";
8
8
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
9
- import { basename, dirname, join, resolve } from "pathe";
9
+ import { dirname, join, resolve } from "pathe";
10
10
  import { access } from "node:fs/promises";
11
11
  import { collectConfigIssues } from "@prisma/orm-framework/config/config-validation";
12
- import { hasCurrentConfigFormatVersion, normalizeContractConfig } from "@prisma/orm-framework/config/config-types";
12
+ import { normalizeContractConfig } from "@prisma/orm-framework/config/config-types";
13
13
  import { pathToFileURL } from "node:url";
14
14
  //#region ../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs
15
15
  function finalizeContractSource(source, configDir) {
@@ -50,26 +50,11 @@ function finalizeConfig(config, configDir) {
50
50
  };
51
51
  }
52
52
  const CONFIG_FILENAME = "prisma.config.ts";
53
- const DEPRECATED_CONFIG_FILENAME = "prisma-next.config.ts";
54
- function deprecatedFilenameWarning() {
55
- return {
56
- code: "CONFIG.DEPRECATED_FILENAME",
57
- message: `${DEPRECATED_CONFIG_FILENAME} is deprecated; rename the file to ${CONFIG_FILENAME}.`
58
- };
59
- }
60
- function deprecatedShapeWarning() {
61
- return {
62
- code: "CONFIG.DEPRECATED_SHAPE",
63
- message: "The flat Prisma Next config shape is deprecated; wrap it in an `orm` section with defineConfig from @prisma/cli-engine: export default defineConfig({ orm: { … } })."
64
- };
65
- }
66
53
  async function findNearestConfigPathForFile(filePath) {
67
54
  let current = dirname(resolve(process.cwd(), filePath));
68
55
  while (true) {
69
- for (const filename of [CONFIG_FILENAME, DEPRECATED_CONFIG_FILENAME]) {
70
- const candidate = join(current, filename);
71
- if (await fileExists(candidate)) return candidate;
72
- }
56
+ const candidate = join(current, CONFIG_FILENAME);
57
+ if (await fileExists(candidate)) return candidate;
73
58
  const parent = dirname(current);
74
59
  if (parent === current) return;
75
60
  current = parent;
@@ -158,12 +143,11 @@ function toConfigLoadFailure(error, configPath) {
158
143
  * fail only on the sections they read (via {@link requireConfigSections}).
159
144
  */
160
145
  /**
161
- * Imports c12 by the realpath of its entry file. Under pnpm, resolving the
162
- * bare specifier can pin c12 at its symlinked node_modules path — Node's
163
- * synchronous ESM linker and some resolver states skip the realpath step —
164
- * and from that path c12's own dependencies (`dotenv`) do not resolve, which
165
- * fails every config load with CONFIG.EVALUATION_FAILED. Anchoring the import
166
- * at the real on-disk location keeps every transitive resolution working.
146
+ * c12 is resolved to its real on-disk entry before importing: jiti (inside
147
+ * c12) resolves its own transitive imports from the importing file's location,
148
+ * and a symlinked install (pnpm) would otherwise anchor them somewhere the
149
+ * packages are not. Importing at the real location keeps every transitive
150
+ * resolution working.
167
151
  */
168
152
  async function importC12() {
169
153
  return await import(pathToFileURL(realpathSync(createRequire(import.meta.url).resolve("c12"))).href);
@@ -172,18 +156,10 @@ async function loadConfig(configPath, options) {
172
156
  const cwd = options?.cwd ?? process.cwd();
173
157
  const resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;
174
158
  const configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;
175
- const deprecations = [];
176
- let discoveryName = "prisma";
177
- if (resolvedConfigPath === void 0) {
178
- if (!await fileExists(join(configCwd, CONFIG_FILENAME)) && await fileExists(join(configCwd, DEPRECATED_CONFIG_FILENAME))) {
179
- discoveryName = "prisma-next";
180
- deprecations.push(deprecatedFilenameWarning());
181
- }
182
- } else if (basename(resolvedConfigPath) === DEPRECATED_CONFIG_FILENAME) deprecations.push(deprecatedFilenameWarning());
183
159
  let result;
184
160
  try {
185
161
  result = await (await importC12()).loadConfig({
186
- name: discoveryName,
162
+ name: "prisma",
187
163
  ...ifDefined("configFile", resolvedConfigPath),
188
164
  cwd: configCwd
189
165
  });
@@ -205,20 +181,9 @@ async function loadConfig(configPath, options) {
205
181
  const orm = result.config["orm"];
206
182
  if (orm !== void 0 && !isRecord(orm)) return ok({
207
183
  config: buildLoadedConfig({}, loadedConfigDir).config,
208
- diagnostics: [errorConfigValidation("orm", { why: `The orm section of ${CONFIG_FILENAME} must be an object` })],
209
- deprecations
210
- });
211
- return ok({
212
- ...buildLoadedConfig(orm ?? {}, loadedConfigDir),
213
- deprecations
214
- });
215
- }
216
- if (hasCurrentConfigFormatVersion(layerConfig)) {
217
- deprecations.push(deprecatedShapeWarning());
218
- return ok({
219
- ...buildLoadedConfig(result.config, loadedConfigDir),
220
- deprecations
184
+ diagnostics: [errorConfigValidation("orm", { why: `The orm section of ${CONFIG_FILENAME} must be an object` })]
221
185
  });
186
+ return ok(buildLoadedConfig(orm ?? {}, loadedConfigDir));
222
187
  }
223
188
  /* v8 ignore next -- a config that evaluated always carries its resolved path */
224
189
  return notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));
@@ -240,10 +205,9 @@ function requireConfigSections(loaded, sections) {
240
205
  * {@link requireConfigSections} for commands that read a fixed set of
241
206
  * sections and have no use for diagnostics outside them.
242
207
  */
243
- async function loadConfigForSections(configPath, sections, options) {
208
+ async function loadConfigForSections(configPath, sections) {
244
209
  const loaded = await loadConfig(configPath);
245
210
  if (!loaded.ok) return loaded;
246
- if (options?.onDeprecation) for (const deprecation of loaded.value.deprecations) options.onDeprecation(deprecation);
247
211
  return requireConfigSections(loaded.value, sections);
248
212
  }
249
213
  async function loadConfigForFile(filePath) {
@@ -254,4 +218,4 @@ async function loadConfigForFile(filePath) {
254
218
  //#endregion
255
219
  export { loadConfigForSections as a, loadConfigForFile as i, findNearestConfigPathForFile as n, requireConfigSections as o, loadConfig as r, finalizeConfig as t };
256
220
 
257
- //# sourceMappingURL=exports-UjssmDwy.mjs.map
221
+ //# sourceMappingURL=exports-Cv8nMmBT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports-Cv8nMmBT.mjs","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { normalizeContractConfig } from \"@internal/config/config-types\";\nimport { dirname, join, resolve } from \"pathe\";\nimport { realpathSync } from \"node:fs\";\nimport { access } from \"node:fs/promises\";\nimport { pathToFileURL } from \"node:url\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from \"@internal/errors/control\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\n//#region src/finalize-config.ts\nfunction finalizeContractSource(source, configDir) {\n\tconst resolvedInputs = source.inputs?.map((input) => resolve(configDir, input));\n\tif (resolvedInputs === void 0) return source;\n\treturn {\n\t\t...source,\n\t\tinputs: resolvedInputs\n\t};\n}\n/** Normalizes a contract section and resolves its paths against `configDir`. */\nfunction finalizeContractConfig(contract, configDir) {\n\tconst normalized = normalizeContractConfig(contract);\n\treturn {\n\t\t...normalized,\n\t\tsource: finalizeContractSource(normalized.source, configDir),\n\t\toutput: resolve(configDir, normalized.output)\n\t};\n}\nconst DEFAULT_MIGRATIONS_DIR = \"migrations\";\n/**\n* Resolves the migrations directory against `configDir`, which is what `migrations.dir` is\n* documented to be relative to. The default is applied here too, so no caller re-derives it\n* against a different base — a command run from one directory with `--config` naming a project in\n* another would otherwise read the wrong `migrations/`.\n*/\nfunction finalizeMigrationsConfig(migrations, configDir) {\n\treturn {\n\t\t...migrations,\n\t\tdir: resolve(configDir, migrations?.dir ?? DEFAULT_MIGRATIONS_DIR)\n\t};\n}\nfunction finalizeConfig(config, configDir) {\n\treturn {\n\t\t...config,\n\t\t...config.contract ? { contract: finalizeContractConfig(config.contract, configDir) } : void 0,\n\t\tmigrations: finalizeMigrationsConfig(config.migrations, configDir)\n\t};\n}\n//#endregion\n//#region src/load.ts\nconst CONFIG_FILENAME = \"prisma.config.ts\";\nasync function findNearestConfigPathForFile(filePath) {\n\tlet current = dirname(resolve(process.cwd(), filePath));\n\twhile (true) {\n\t\tconst candidate = join(current, CONFIG_FILENAME);\n\t\tif (await fileExists(candidate)) return candidate;\n\t\tconst parent = dirname(current);\n\t\tif (parent === current) return;\n\t\tcurrent = parent;\n\t}\n}\nasync function fileExists(path) {\n\ttry {\n\t\tawait access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction collectArtifactCollisionDiagnostics(contract) {\n\tconst inputs = contract.source.inputs;\n\tconst output = contract.output;\n\tif (inputs === void 0 || output === void 0) return [];\n\tlet emittedArtifactPaths;\n\ttry {\n\t\temittedArtifactPaths = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\treturn [errorConfigValidation(\"contract.output\", {\n\t\t\t/* v8 ignore next -- getEmittedArtifactPaths only ever throws an Error */\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tsection: \"contract\"\n\t\t})];\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([emittedArtifactPaths.jsonPath, emittedArtifactPaths.dtsPath]);\n\tif (inputs.some((input) => emittedPaths.has(input))) return [errorConfigValidation(\"contract.source.inputs[]\", {\n\t\twhy: \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\",\n\t\tsection: \"contract\"\n\t})];\n\treturn [];\n}\nfunction buildLoadedConfig(rawConfig, configDir) {\n\tconst issues = collectConfigIssues(rawConfig);\n\tconst diagnostics = issues.map((issue) => errorConfigValidation(issue.field, {\n\t\twhy: issue.message,\n\t\tsection: issue.section\n\t}));\n\tconst raw = blindCast(rawConfig);\n\tconst config = issues.some((issue) => issue.section === \"migrations\") ? raw : {\n\t\t...raw,\n\t\tmigrations: finalizeMigrationsConfig(raw.migrations, configDir)\n\t};\n\tif (config.contract === void 0 || issues.some((issue) => issue.section === \"contract\")) return {\n\t\tconfig,\n\t\tdiagnostics\n\t};\n\tconst contract = finalizeContractConfig(config.contract, configDir);\n\tdiagnostics.push(...collectArtifactCollisionDiagnostics(contract));\n\treturn {\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tcontract\n\t\t},\n\t\tdiagnostics\n\t};\n}\nfunction toConfigLoadFailure(error, configPath) {\n\tif (CliStructuredError.is(error)) return error;\n\tconst resolvedPath = configPath ? resolve(process.cwd(), configPath) : void 0;\n\tif (isStructuredError(error)) return new CliStructuredError(error.code, error.message, {\n\t\t...ifDefined(\"why\", error.why),\n\t\t...ifDefined(\"fix\", error.fix),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\tcause: error\n\t});\n\tif (error instanceof Error) return errorConfigEvaluationFailed(resolvedPath, {\n\t\twhy: error.message,\n\t\tcause: error\n\t});\n\treturn errorConfigEvaluationFailed(resolvedPath, { why: String(error) });\n}\n/**\n* Loads and finalizes the Prisma Next config.\n*\n* Failures that prevent evaluation entirely — missing file, module that does\n* not evaluate (`CONFIG.FILE_NOT_FOUND`, `CONFIG.EVALUATION_FAILED`) — are the\n* `Result` failure. Structural problems inside an evaluated config do not\n* fail the load: they are returned as section-tagged diagnostics so commands\n* fail only on the sections they read (via {@link requireConfigSections}).\n*/\n/**\n* c12 is resolved to its real on-disk entry before importing: jiti (inside\n* c12) resolves its own transitive imports from the importing file's location,\n* and a symlinked install (pnpm) would otherwise anchor them somewhere the\n* packages are not. Importing at the real location keeps every transitive\n* resolution working.\n*/\nasync function importC12() {\n\treturn await import(pathToFileURL(realpathSync(createRequire(import.meta.url).resolve(\"c12\"))).href);\n}\nasync function loadConfig(configPath, options) {\n\tconst cwd = options?.cwd ?? process.cwd();\n\tconst resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;\n\tconst configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;\n\tlet result;\n\ttry {\n\t\tresult = await (await importC12()).loadConfig({\n\t\t\tname: \"prisma\",\n\t\t\t...ifDefined(\"configFile\", resolvedConfigPath),\n\t\t\tcwd: configCwd\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(toConfigLoadFailure(error, configPath));\n\t}\n\tif (resolvedConfigPath && result.configFile !== resolvedConfigPath) return notOk(errorConfigFileNotFound(resolvedConfigPath));\n\tif (!result.config || Object.keys(result.config).length === 0) return notOk(errorConfigFileNotFound(result.configFile || resolvedConfigPath || configPath));\n\t/* v8 ignore next -- @preserve */\n\tconst loadedConfigDir = result.configFile ? dirname(result.configFile) : configCwd;\n\t/* v8 ignore next -- c12 always returns layers for a config it evaluated */\n\tconst [requestedLayer] = result.layers ?? [];\n\tconst layerConfig = requestedLayer?.config;\n\tconst engineMarker = isRecord(layerConfig) ? layerConfig[\"$prismaConfig\"] : void 0;\n\tif (engineMarker !== void 0) {\n\t\tif (engineMarker !== 1)\n /* v8 ignore next -- a config that evaluated always carries its resolved path */\n\t\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n\t\tconst orm = result.config[\"orm\"];\n\t\tif (orm !== void 0 && !isRecord(orm)) return ok({\n\t\t\tconfig: buildLoadedConfig({}, loadedConfigDir).config,\n\t\t\tdiagnostics: [errorConfigValidation(\"orm\", { why: `The orm section of ${CONFIG_FILENAME} must be an object` })]\n\t\t});\n\t\treturn ok(buildLoadedConfig(orm ?? {}, loadedConfigDir));\n\t}\n\t/* v8 ignore next -- a config that evaluated always carries its resolved path */\n\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n}\n/**\n* Narrows a {@link LoadedConfig} to the sections a command reads. Fails with\n* the first diagnostic concerning a required section; diagnostics on other\n* sections are ignored so unrelated commands keep working.\n*/\nfunction requireConfigSections(loaded, sections) {\n\tconst blocking = loaded.diagnostics.find((diagnostic) => {\n\t\tconst section = diagnostic.meta?.[\"section\"];\n\t\treturn typeof section !== \"string\" || sections.some((required) => required === section);\n\t});\n\treturn blocking ? notOk(blocking) : ok(loaded.config);\n}\n/**\n* Convenience composition of {@link loadConfig} and\n* {@link requireConfigSections} for commands that read a fixed set of\n* sections and have no use for diagnostics outside them.\n*/\nasync function loadConfigForSections(configPath, sections) {\n\tconst loaded = await loadConfig(configPath);\n\tif (!loaded.ok) return loaded;\n\treturn requireConfigSections(loaded.value, sections);\n}\nasync function loadConfigForFile(filePath) {\n\tconst configPath = await findNearestConfigPathForFile(filePath);\n\tif (configPath === void 0) return notOk(errorConfigFileNotFound(join(dirname(resolve(process.cwd(), filePath)), CONFIG_FILENAME)));\n\treturn loadConfig(configPath);\n}\n//#endregion\nexport { finalizeConfig, findNearestConfigPathForFile, loadConfig, loadConfigForFile, loadConfigForSections, requireConfigSections };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,uBAAuB,QAAQ,WAAW;CAClD,MAAM,iBAAiB,OAAO,QAAQ,KAAK,UAAU,QAAQ,WAAW,KAAK,CAAC;CAC9E,IAAI,mBAAmB,KAAK,GAAG,OAAO;CACtC,OAAO;EACN,GAAG;EACH,QAAQ;CACT;AACD;;AAEA,SAAS,uBAAuB,UAAU,WAAW;CACpD,MAAM,aAAa,wBAAwB,QAAQ;CACnD,OAAO;EACN,GAAG;EACH,QAAQ,uBAAuB,WAAW,QAAQ,SAAS;EAC3D,QAAQ,QAAQ,WAAW,WAAW,MAAM;CAC7C;AACD;AACA,MAAM,yBAAyB;;;;;;;AAO/B,SAAS,yBAAyB,YAAY,WAAW;CACxD,OAAO;EACN,GAAG;EACH,KAAK,QAAQ,WAAW,YAAY,OAAO,sBAAsB;CAClE;AACD;AACA,SAAS,eAAe,QAAQ,WAAW;CAC1C,OAAO;EACN,GAAG;EACH,GAAG,OAAO,WAAW,EAAE,UAAU,uBAAuB,OAAO,UAAU,SAAS,EAAE,IAAI,KAAK;EAC7F,YAAY,yBAAyB,OAAO,YAAY,SAAS;CAClE;AACD;AAGA,MAAM,kBAAkB;AACxB,eAAe,6BAA6B,UAAU;CACrD,IAAI,UAAU,QAAQ,QAAQ,QAAQ,IAAI,GAAG,QAAQ,CAAC;CACtD,OAAO,MAAM;EACZ,MAAM,YAAY,KAAK,SAAS,eAAe;EAC/C,IAAI,MAAM,WAAW,SAAS,GAAG,OAAO;EACxC,MAAM,SAAS,QAAQ,OAAO;EA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AI,OAAO;CACvB,OAAO,sBAAsB,OAAO,OAAO,QAAQ;AACpD;AACA,eAAe,kBAAkB,UAAU;CAC1C,MAAM,aAAa,MAAM,6BAA6B,QAAQ;CAC9D,IAAI,eAAe,KAAK,GAAG,OAAO,MAAM,wBAAwB,KAAK,QAAQ,QAAQ,QAAQ,IAAI,GAAG,QAAQ,CAAC,GAAG,eAAe,CAAC,CAAC;CACjI,OAAO,WAAW,UAAU;AAC7B"}
@@ -5,7 +5,7 @@ import { blindCast } from "@prisma/orm-framework/utils/casts";
5
5
  import { canonicalizeContractToObject } from "@prisma/orm-framework/contract/hashing";
6
6
  import { format } from "prettier";
7
7
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
8
- //#region ../../../1-framework/3-tooling/emitter/dist/exports-BCLg4CiV.mjs
8
+ //#region ../../../1-framework/3-tooling/emitter/dist/exports-Dw2WIX63.mjs
9
9
  const JSON_EXTENSION = ".json";
10
10
  function getEmittedArtifactPaths(outputJsonPath) {
11
11
  if (!outputJsonPath.endsWith(JSON_EXTENSION)) throw emitterError("CONFIG.VALIDATION_FAILED", "Contract output path must end with .json", { meta: {
@@ -66,8 +66,8 @@ function generateContractDts(contract, emitter, codecTypeImports, hashes, option
66
66
  const extraTypeExports = emitter.getStorageTypeExports?.(contract, codecLookup);
67
67
  const contractWrapper = emitter.getContractWrapper("ContractBase", "TypeMaps");
68
68
  return `// ⚠️ GENERATED FILE - DO NOT EDIT
69
- // This file is automatically generated by 'prisma-next contract emit'.
70
- // To regenerate, run: prisma-next contract emit
69
+ // This file is automatically generated by 'prisma contract emit'.
70
+ // To regenerate, run: prisma contract emit
71
71
  ${importLines.join("\n")}
72
72
 
73
73
  ${familyImportLines.join("\n")}
@@ -127,8 +127,8 @@ async function emit(contract, stack, targetFamily, options) {
127
127
  ...canonicalized,
128
128
  _generated: {
129
129
  warning: "⚠️ GENERATED FILE - DO NOT EDIT",
130
- message: "This file is automatically generated by \"prisma-next contract emit\".",
131
- regenerate: "To regenerate, run: prisma-next contract emit"
130
+ message: "This file is automatically generated by \"prisma contract emit\".",
131
+ regenerate: "To regenerate, run: prisma contract emit"
132
132
  }
133
133
  }, null, 2);
134
134
  const generateOptions = {
@@ -157,4 +157,4 @@ async function emit(contract, stack, targetFamily, options) {
157
157
  //#endregion
158
158
  export { generateContractDts as n, getEmittedArtifactPaths as r, emit as t };
159
159
 
160
- //# sourceMappingURL=exports-BCLg4CiV-05kuwcb0.mjs.map
160
+ //# sourceMappingURL=exports-Dw2WIX63-CQgI2e_L.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports-Dw2WIX63-CQgI2e_L.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/exports-Dw2WIX63.mjs"],"sourcesContent":["import { C as serializeExecutionType, D as emitterError, E as serializeValue, T as serializeObjectKey, _ as generateValueObjectTypeAliases, c as generateFieldTypesMapsByNamespace, h as generateRootsType, l as generateHashTypeAliases, m as generateModelsType, r as generateCodecTypeIntersection, t as deduplicateImports, u as generateImportLines, v as generateValueObjectsDescriptorType } from \"./domain-type-generation-bpSO3Y0L.mjs\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { canonicalizeContractToObject } from \"@internal/contract/hashing\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { format } from \"prettier\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/artifact-paths.ts\nconst JSON_EXTENSION = \".json\";\nfunction getEmittedArtifactPaths(outputJsonPath) {\n\tif (!outputJsonPath.endsWith(JSON_EXTENSION)) throw emitterError(\"CONFIG.VALIDATION_FAILED\", \"Contract output path must end with .json\", { meta: {\n\t\tfield: \"contract.output\",\n\t\toutputJsonPath\n\t} });\n\treturn {\n\t\tjsonPath: outputJsonPath,\n\t\tdtsPath: `${outputJsonPath.slice(0, -5)}.d.ts`\n\t};\n}\n//#endregion\n//#region src/generate-contract-dts.ts\nfunction generateEnumBlockType(enums) {\n\treturn `{ ${Object.entries(enums).map(([name, entry]) => {\n\t\tconst membersType = `readonly [${entry.members.map((m) => `{ readonly name: ${serializeValue(m.name)}; readonly value: ${serializeValue(m.value)} }`).join(\", \")}]`;\n\t\treturn `readonly ${serializeObjectKey(name)}: { readonly codecId: ${serializeValue(entry.codecId)}; readonly members: ${membersType} }`;\n\t}).join(\"; \")} }`;\n}\nfunction generateContractDts(contract, emitter, codecTypeImports, hashes, options, codecLookup, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst allImports = [...codecTypeImports];\n\tif (options?.queryOperationTypeImports) allImports.push(...options.queryOperationTypeImports);\n\tconst importLines = generateImportLines(deduplicateImports(allImports), resolveImportSpecifier);\n\tconst familyImportLines = emitter.getFamilyImports(resolveImportSpecifier);\n\tconst hashAliases = generateHashTypeAliases(hashes);\n\tconst codecTypes = generateCodecTypeIntersection(codecTypeImports, \"CodecTypes\");\n\tconst familyTypeAliases = emitter.getFamilyTypeAliases(options);\n\tconst typeMapsExpr = emitter.getTypeMapsExpression();\n\tconst storageType = emitter.generateStorageType(contract, \"StorageHash\");\n\tconst namespaceEntries = Object.entries(contract.domain.namespaces);\n\tif (namespaceEntries.length === 0) throw emitterError(\"CONTRACT.NAMESPACE_INVALID\", \"domain has no namespaces\", { meta: { reason: \"no-domain-namespaces\" } });\n\tfor (const [nsId, ns] of namespaceEntries) if (ns === void 0) throw new InternalError(`domain namespace \"${nsId}\" is not present on the contract`);\n\tconst rootsType = generateRootsType(contract.roots);\n\tconst flatValueObjects = {};\n\tfor (const [, ns] of namespaceEntries) for (const [voName, vo] of Object.entries(blindCast(ns.valueObjects ?? {}))) if (!(voName in flatValueObjects)) flatValueObjects[voName] = vo;\n\tconst valueObjects = Object.keys(flatValueObjects).length > 0 ? flatValueObjects : void 0;\n\tconst valueObjectTypeAliases = generateValueObjectTypeAliases(valueObjects, codecLookup);\n\tconst valueObjectsDescriptor = generateValueObjectsDescriptorType(valueObjects);\n\tconst domainNamespacesType = namespaceEntries.map(([nsId, ns]) => {\n\t\tconst nsModels = ns.models;\n\t\tconst nsModelsType = generateModelsType(nsModels, (name, model) => emitter.generateModelStorageType(name, model));\n\t\tconst nsValueObjects = blindCast(ns.valueObjects);\n\t\tconst nsValueObjectsDescriptor = nsValueObjects !== void 0 && Object.keys(nsValueObjects).length > 0 ? generateValueObjectsDescriptorType(nsValueObjects) : void 0;\n\t\tconst nsEnums = blindCast(ns.enum);\n\t\treturn [\n\t\t\tnsId,\n\t\t\tnsModelsType,\n\t\t\tnsValueObjectsDescriptor,\n\t\t\tnsEnums !== void 0 && Object.keys(nsEnums).length > 0 ? generateEnumBlockType(nsEnums) : void 0\n\t\t];\n\t}).map(([nsId, nsModelsType, nsValueObjectsDescriptor, nsEnumBlock]) => {\n\t\tconst voLine = nsValueObjectsDescriptor !== void 0 ? `\\n readonly valueObjects: ${nsValueObjectsDescriptor};` : \"\";\n\t\tconst enumLine = nsEnumBlock !== void 0 ? `\\n readonly enum: ${nsEnumBlock};` : \"\";\n\t\treturn ` readonly ${serializeObjectKey(nsId)}: {\\n readonly models: ${nsModelsType};${voLine}${enumLine}\\n }`;\n\t}).join(\";\\n\");\n\tconst executionClause = contract.execution !== void 0 ? `\\n readonly execution: ${serializeExecutionType(contract.execution)};` : \"\";\n\tconst resolveFieldTypeParams = emitter.resolveFieldTypeParams ? (modelName, fieldName, model) => emitter.resolveFieldTypeParams?.(modelName, fieldName, model, contract) : void 0;\n\tconst resolveFieldValueSet = emitter.resolveFieldValueSet ? (modelName, fieldName, model) => emitter.resolveFieldValueSet?.(modelName, fieldName, model, contract) : void 0;\n\tconst fieldTypesMaps = generateFieldTypesMapsByNamespace(namespaceEntries.map(([nsId, ns]) => [nsId, ns.models]), codecLookup, resolveFieldTypeParams, resolveFieldValueSet);\n\tconst extraTypeExports = emitter.getStorageTypeExports?.(contract, codecLookup);\n\tconst contractWrapper = emitter.getContractWrapper(\"ContractBase\", \"TypeMaps\");\n\treturn `// ⚠️ GENERATED FILE - DO NOT EDIT\n// This file is automatically generated by 'prisma contract emit'.\n// To regenerate, run: prisma contract emit\n${importLines.join(\"\\n\")}\n\n${familyImportLines.join(\"\\n\")}\nimport type {\n Contract as ContractType,\n ExecutionHashBase,\n NamespaceId,\n ProfileHashBase,\n StorageHashBase,\n} from '${resolveImportSpecifier(\"@internal/contract/types\")}';\n\n${hashAliases}\n\nexport type CodecTypes = ${codecTypes};\n${familyTypeAliases}\n${valueObjectTypeAliases}\nexport type FieldOutputTypes = ${fieldTypesMaps.output};\nexport type FieldInputTypes = ${fieldTypesMaps.input};\n${extraTypeExports ? `${extraTypeExports}\\n` : \"\"}export type TypeMaps = ${typeMapsExpr};\n\ntype ContractBase = Omit<\n ContractType<${storageType}>,\n 'roots' | 'domain'\n> & {\n readonly target: ${serializeValue(contract.target)};\n readonly targetFamily: ${serializeValue(contract.targetFamily)};\n readonly roots: ${rootsType};\n readonly domain: {\n readonly namespaces: {\n${domainNamespacesType};\n };\n };\n readonly capabilities: ${serializeValue(contract.capabilities)};\n readonly extensions: ${serializeValue(contract.extensions)};${executionClause}\n readonly meta: ${serializeValue(contract.meta)};\n ${valueObjects ? `readonly valueObjects: ${valueObjectsDescriptor};` : \"\"}\n readonly profileHash: ProfileHash;\n};\n\n${contractWrapper}\n`;\n}\n//#endregion\n//#region src/emit.ts\nconst SCHEMA_VERSION = \"1\";\nasync function emit(contract, stack, targetFamily, options) {\n\tif (options.outputJsonPath !== void 0) getEmittedArtifactPaths(options.outputJsonPath);\n\tconst { codecTypeImports, queryOperationTypeImports, aggregateDescriptors, codecDescriptors } = stack;\n\tconst { storageHash } = contract.storage;\n\tconst executionHash = contract.execution?.executionHash;\n\tconst { profileHash } = contract;\n\tconst canonicalized = canonicalizeContractToObject(contract, {\n\t\tschemaVersion: SCHEMA_VERSION,\n\t\tserializeContract: options.serializeContract,\n\t\t...ifDefined(\"shouldPreserveEmpty\", options.shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", options.sortStorage)\n\t});\n\tconst contractJsonString = JSON.stringify({\n\t\t...canonicalized,\n\t\t_generated: {\n\t\t\twarning: \"⚠️ GENERATED FILE - DO NOT EDIT\",\n\t\t\tmessage: \"This file is automatically generated by \\\"prisma contract emit\\\".\",\n\t\t\tregenerate: \"To regenerate, run: prisma contract emit\"\n\t\t}\n\t}, null, 2);\n\tconst generateOptions = {\n\t\t...ifDefined(\"queryOperationTypeImports\", queryOperationTypeImports),\n\t\t...ifDefined(\"aggregateDescriptors\", aggregateDescriptors),\n\t\t...ifDefined(\"codecDescriptors\", codecDescriptors)\n\t};\n\tconst contractTypeHashes = {\n\t\tstorageHash,\n\t\t...ifDefined(\"executionHash\", executionHash),\n\t\tprofileHash\n\t};\n\treturn {\n\t\tcontractJson: contractJsonString,\n\t\tcontractDts: await format(generateContractDts(contract, targetFamily, codecTypeImports ?? [], contractTypeHashes, generateOptions, stack.codecLookup, options.resolveImportSpecifier ?? keepInternalSpecifiers), {\n\t\t\tparser: \"typescript\",\n\t\t\tsingleQuote: true,\n\t\t\tsemi: true,\n\t\t\tprintWidth: 100\n\t\t}),\n\t\tstorageHash,\n\t\t...ifDefined(\"executionHash\", executionHash),\n\t\tprofileHash\n\t};\n}\n//#endregion\nexport { generateContractDts as n, getEmittedArtifactPaths as r, emit as t };\n\n//# sourceMappingURL=exports-Dw2WIX63.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,iBAAiB;AACvB,SAAS,wBAAwB,gBAAgB;CAChD,IAAI,CAAC,eAAe,SAAS,cAAc,GAAG,MAAM,aAAa,4BAA4B,4CAA4C,EAAE,MAAM;EAChJ,OAAO;EACP;CACD,EAAE,CAAC;CACH,OAAO;EACN,UAAU;EACV,SAAS,GAAG,eAAe,MAAM,GAAG,EAAE,EAAE;CACzC;AACD;AAGA,SAAS,sBAAsB,OAAO;CACrC,OAAO,KAAK,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW;EACxD,MAAM,cAAc,aAAa,MAAM,QAAQ,KAAK,MA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H,YAAY;GACX,SAAS;GACT,SAAS;GACT,YAAY;EACb;CACD,GAAG,MAAM,CAAC;CACV,MAAM,kBAAkB;EACvB,GAAG,UAAU,6BAA6B,yBAAyB;EACnE,GAAG,UAAU,wBAAwB,oBAAoB;EACzD,GAAG,UAAU,oBAAoB,gBAAgB;CAClD;CACA,MAAM,qBAAqB;EAC1B;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;CACA,OAAO;EACN,cAAc;EACd,aAAa,MAAM,OAAO,oBAAoB,UAAU,cAAc,oBAAoB,CAAC,GAAG,oBAAoB,iBAAiB,MAAM,aAAa,QAAQ,0BAA0B,sBAAsB,GAAG;GAChN,QAAQ;GACR,aAAa;GACb,MAAM;GACN,YAAY;EACb,CAAC;EACD;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;AACD"}
@@ -1,5 +1,5 @@
1
- import { p as errorHashNotInGraph } from "./errors-CXbGUWGu-CstQHPh6.mjs";
2
- //#region ../../../1-framework/3-tooling/migration/dist/graph-membership-BViWUMpP.mjs
1
+ import { p as errorHashNotInGraph } from "./errors-CcEpbfnE-CsSXrttT.mjs";
2
+ //#region ../../../1-framework/3-tooling/migration/dist/graph-membership-BoITerZB.mjs
3
3
  function isGraphNode(hash, graph) {
4
4
  if (hash === "empty") return true;
5
5
  return graph.nodes.has(hash);
@@ -11,4 +11,4 @@ function assertHashIsGraphNode(hash, graph) {
11
11
  //#endregion
12
12
  export { isGraphNode as n, assertHashIsGraphNode as t };
13
13
 
14
- //# sourceMappingURL=graph-membership-BViWUMpP-C4lYYJdU.mjs.map
14
+ //# sourceMappingURL=graph-membership-BoITerZB-C2-x1Qp6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph-membership-BViWUMpP-C4lYYJdU.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/graph-membership-BViWUMpP.mjs"],"sourcesContent":["import { p as errorHashNotInGraph } from \"./errors-CXbGUWGu.mjs\";\nimport \"./constants-CM-w38DQ.mjs\";\n//#region src/graph-membership.ts\nfunction isGraphNode(hash, graph) {\n\tif (hash === \"empty\") return true;\n\treturn graph.nodes.has(hash);\n}\nfunction assertHashIsGraphNode(hash, graph) {\n\tif (isGraphNode(hash, graph)) return;\n\tthrow errorHashNotInGraph(hash, graph);\n}\n//#endregion\nexport { isGraphNode as n, assertHashIsGraphNode as t };\n\n//# sourceMappingURL=graph-membership-BViWUMpP.mjs.map"],"mappings":";;AAGA,SAAS,YAAY,MAAM,OAAO;CACjC,IAAI,SAAS,SAAS,OAAO;CAC7B,OAAO,MAAM,MAAM,IAAI,IAAI;AAC5B;AACA,SAAS,sBAAsB,MAAM,OAAO;CAC3C,IAAI,YAAY,MAAM,KAAK,GAAG;CAC9B,MAAM,oBAAoB,MAAM,KAAK;AACtC"}
1
+ {"version":3,"file":"graph-membership-BoITerZB-C2-x1Qp6.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/graph-membership-BoITerZB.mjs"],"sourcesContent":["import { p as errorHashNotInGraph } from \"./errors-CcEpbfnE.mjs\";\nimport \"./constants-CM-w38DQ.mjs\";\n//#region src/graph-membership.ts\nfunction isGraphNode(hash, graph) {\n\tif (hash === \"empty\") return true;\n\treturn graph.nodes.has(hash);\n}\nfunction assertHashIsGraphNode(hash, graph) {\n\tif (isGraphNode(hash, graph)) return;\n\tthrow errorHashNotInGraph(hash, graph);\n}\n//#endregion\nexport { isGraphNode as n, assertHashIsGraphNode as t };\n\n//# sourceMappingURL=graph-membership-BoITerZB.mjs.map"],"mappings":";;AAGA,SAAS,YAAY,MAAM,OAAO;CACjC,IAAI,SAAS,SAAS,OAAO;CAC7B,OAAO,MAAM,MAAM,IAAI,IAAI;AAC5B;AACA,SAAS,sBAAsB,MAAM,OAAO;CAC3C,IAAI,YAAY,MAAM,KAAK,GAAG;CAC9B,MAAM,oBAAoB,MAAM,KAAK;AACtC"}
@@ -81,7 +81,7 @@ declare function createImportSpecifierResolver(root: ImportRoot): ImportSpecifie
81
81
  * The import roots a scaffolded application can be generated against.
82
82
  *
83
83
  * `platform` is absent deliberately, and this is a modelling statement rather
84
- * than a limitation to be lifted: `prisma-next init` writes an application
84
+ * than a limitation to be lifted: `prisma orm init` writes an application
85
85
  * around a per-database facade, and that facade's `runtime` entrypoint is its
86
86
  * own wiring code, not a re-export of anything. A decomposed install has no
87
87
  * name for it because it has no such module — it wires the platform packages
@@ -92,7 +92,7 @@ type ScaffoldImportRoot = Extract<ImportRoot, {
92
92
  mode: 'internal' | 'facade';
93
93
  }>;
94
94
  /**
95
- * Builds the resolver `prisma-next init` scaffolds with. Identical to
95
+ * Builds the resolver `prisma orm init` scaffolds with. Identical to
96
96
  * {@link createImportSpecifierResolver} except that it will not accept a root
97
97
  * a scaffold cannot express, so the impossible case is rejected where the
98
98
  * resolver is made rather than when a template happens to hit a name.
@@ -116,4 +116,4 @@ declare function importedSpecifiers(source: string): string[];
116
116
  declare function transitiveImports(source: string, root: ImportRoot): string[];
117
117
  //#endregion
118
118
  export { ScaffoldImportRoot as a, createScaffoldSpecifierResolver as c, importedSpecifiers as d, internalImportRoot as f, transitiveImports as h, ImportSpecifierResolver as i, directDependencyShells as l, resolveImportSpecifier as m, ImportRootError as n, buildOwnerIndex as o, platformEntrypointOf as p, ImportRootMode as r, createImportSpecifierResolver as s, ImportRoot as t, importRootForDependencies as u };
119
- //# sourceMappingURL=import-roots-CfoYgejL.d.mts.map
119
+ //# sourceMappingURL=import-roots-ARK1wjzc.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"import-roots-CfoYgejL.d.mts","names":[],"sources":["../../../../0-shared/publish-surface/dist/import-roots.d.mts"],"mappings":";;;;cAGc,wBAAwB;KACjC;;;;;;;;;;;KAWA;WACM;;WAEA;WACA,QAAQ;;WAER;;cAEG,oBAAoB,QAAQ;EACxC;;;;;;;KAOG,2BAA2B;;;;;;;;;;;;;;;;;iBAiBf,0BAA0B,cAAc,mBAAmB;UAClE;WACC,OAAO;WACP;;;;;;;;iBAQM,gBAAgB,QAAQ,YAAY,WAAW,mBAAmB,YAAY;;;;;;;iBAO9E,uBAAuB,MAAM,aAAa,YAAY;;;;;;iBAMtD,qBAAqB;EACpC,OAAO;EACP;;iBAEe,uBAAuB,mBAAmB,MAAM;iBAChD,8BAA8B,MAAM,aAAa;;;;;;;;;;;;KAY7D,qBAAqB,QAAQ;EAChC;;;;;;;;iBAQe,gCAAgC,MAAM,qBAAqB;;iBAE3D,mBAAmB;;;;;;;;;;;;;;iBAcnB,kBAAkB,gBAAgB,MAAM"}
1
+ {"version":3,"file":"import-roots-ARK1wjzc.d.mts","names":[],"sources":["../../../../0-shared/publish-surface/dist/import-roots.d.mts"],"mappings":";;;;cAGc,wBAAwB;KACjC;;;;;;;;;;;KAWA;WACM;;WAEA;WACA,QAAQ;;WAER;;cAEG,oBAAoB,QAAQ;EACxC;;;;;;;KAOG,2BAA2B;;;;;;;;;;;;;;;;;iBAiBf,0BAA0B,cAAc,mBAAmB;UAClE;WACC,OAAO;WACP;;;;;;;;iBAQM,gBAAgB,QAAQ,YAAY,WAAW,mBAAmB,YAAY;;;;;;;iBAO9E,uBAAuB,MAAM,aAAa,YAAY;;;;;;iBAMtD,qBAAqB;EACpC,OAAO;EACP;;iBAEe,uBAAuB,mBAAmB,MAAM;iBAChD,8BAA8B,MAAM,aAAa;;;;;;;;;;;;KAY7D,qBAAqB,QAAQ;EAChC;;;;;;;;iBAQe,gCAAgC,MAAM,qBAAqB;;iBAE3D,mBAAmB;;;;;;;;;;;;;;iBAcnB,kBAAkB,gBAAgB,MAAM"}
@@ -5,7 +5,7 @@ import { n as publicShells } from "./shells-C4HbRAr5.mjs";
5
5
  * specifier into the name generated code should carry.
6
6
  *
7
7
  * Emission writes package names into files the user keeps — generated
8
- * contract types, scaffolded migrations, `prisma-next init` output. Which
8
+ * contract types, scaffolded migrations, `prisma orm init` output. Which
9
9
  * name is correct depends on how the application installed Prisma Next, so
10
10
  * every emitter resolves through an {@link ImportRoot} rather than hardcoding
11
11
  * a specifier. The mapping itself is `./shells`; nothing here duplicates it.
@@ -160,7 +160,7 @@ function createImportSpecifierResolver(root) {
160
160
  return (specifier) => resolveImportSpecifier(specifier, root);
161
161
  }
162
162
  /**
163
- * Builds the resolver `prisma-next init` scaffolds with. Identical to
163
+ * Builds the resolver `prisma orm init` scaffolds with. Identical to
164
164
  * {@link createImportSpecifierResolver} except that it will not accept a root
165
165
  * a scaffold cannot express, so the impossible case is rejected where the
166
166
  * resolver is made rather than when a template happens to hit a name.
@@ -221,4 +221,4 @@ const EXTERNAL_DIRECT_DEPENDENCIES = /* @__PURE__ */ new Set(["@prisma/cli-engin
221
221
  //#endregion
222
222
  export { directDependencyShells as a, internalImportRoot as c, transitiveImports as d, createScaffoldSpecifierResolver as i, platformEntrypointOf as l, buildOwnerIndex as n, importRootForDependencies as o, createImportSpecifierResolver as r, importedSpecifiers as s, ImportRootError as t, resolveImportSpecifier as u };
223
223
 
224
- //# sourceMappingURL=import-roots-CNFBPAT1.mjs.map
224
+ //# sourceMappingURL=import-roots-D0H8HuRw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-roots-D0H8HuRw.mjs","names":[],"sources":["../../../../0-shared/publish-surface/dist/import-roots.mjs"],"sourcesContent":["import { publicShells } from \"./shells.mjs\";\n//#region src/import-roots.ts\n/**\n* Import-root resolution: the one place that turns an internal workspace\n* specifier into the name generated code should carry.\n*\n* Emission writes package names into files the user keeps — generated\n* contract types, scaffolded migrations, `prisma orm init` output. Which\n* name is correct depends on how the application installed Prisma Next, so\n* every emitter resolves through an {@link ImportRoot} rather than hardcoding\n* a specifier. The mapping itself is `./shells`; nothing here duplicates it.\n*/\nconst INTERNAL_SCOPE = \"@internal/\";\nconst PUBLISHED_SCOPE = \"@prisma/\";\n/** An import root that emitted code cannot express. */\nvar ImportRootError = class extends Error {};\nconst internalImportRoot = { mode: \"internal\" };\n/**\n* The import root an application's own dependency list expresses.\n*\n* Emission has to name packages the application can actually resolve, and the\n* application already states which those are. Reading its manifest keeps the\n* two from drifting and lets consumers move to published names one project at\n* a time instead of behind a repository-wide switch.\n*\n* A project that names exactly one facade is on the facade root; one that\n* names platform shells without a facade is a decomposed install; anything\n* else — including a project with no `@prisma/orm-*` dependency at all — is on\n* the internal root, which emits workspace names unchanged.\n*\n* @throws {ImportRootError} when the project depends on two facades, which no\n* single generated file can be emitted for.\n*/\nfunction importRootForDependencies(dependencies) {\n\tconst named = new Set(dependencies);\n\tconst facades = [];\n\tlet hasPlatform = false;\n\tfor (const [shell, definition] of publicShells) {\n\t\tif (!named.has(shell)) continue;\n\t\tif (definition.kind === \"facade\") facades.push(shell);\n\t\tif (definition.kind === \"platform\") hasPlatform = true;\n\t}\n\tif (facades.length > 1) throw new ImportRootError(`an application may depend on only one database facade, but this one depends on ${facades.join(\" and \")}`);\n\tconst [facade] = facades;\n\tif (facade !== void 0) return {\n\t\tmode: \"facade\",\n\t\tfacade\n\t};\n\treturn hasPlatform ? { mode: \"platform\" } : internalImportRoot;\n}\nconst owners = buildOwnerIndex(publicShells);\n/**\n* Takes the shell map as an argument rather than closing over `publicShells`\n* so the duplicate-owner guard is reachable from a test: the real map is\n* valid by construction, and a guard nothing can exercise is a guard nobody\n* knows still works.\n*/\nfunction buildOwnerIndex(shells) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const [shell, definition] of shells) for (const pkg of definition.packages) {\n\t\tconst existing = index.get(pkg.name);\n\t\tif (existing !== void 0) throw new ImportRootError(`${pkg.name} is mapped to both ${existing.shell} and ${shell}; one module may live in only one published package (ADR 242)`);\n\t\tindex.set(pkg.name, {\n\t\t\tshell,\n\t\t\tentry: pkg.entry\n\t\t});\n\t}\n\treturn index;\n}\nfunction splitSpecifier(specifier) {\n\tconst [scope, pkg, ...rest] = specifier.split(\"/\");\n\treturn {\n\t\tname: `${scope}/${pkg}`,\n\t\tsubpath: rest.join(\"/\")\n\t};\n}\nfunction joinEntrypoint(shell, entry, subpath) {\n\tconst tail = [entry, subpath].filter(Boolean).join(\"/\");\n\treturn tail === \"\" ? shell : `${shell}/${tail}`;\n}\n/**\n* The shells an application installs directly under this root. Emitted code\n* may name only these: a package manager puts a package's own dependencies in\n* its own `node_modules`, so importing a transitively installed package fails\n* to resolve at run time even though the files are on disk.\n*/\nfunction directDependencyShells(root) {\n\tconst direct = /* @__PURE__ */ new Set();\n\tif (root.mode === \"internal\") return direct;\n\tfor (const [shell, definition] of publicShells) {\n\t\tif (definition.kind === \"extension\") direct.add(shell);\n\t\tif (root.mode === \"platform\" && definition.kind === \"platform\") direct.add(shell);\n\t}\n\tif (root.mode === \"facade\") direct.add(root.facade);\n\treturn direct;\n}\nfunction owningShell(specifier, name) {\n\tconst owner = owners.get(name);\n\tif (owner === void 0) throw new ImportRootError(`${specifier} is not mapped to any published shell`);\n\treturn owner;\n}\n/**\n* The platform-install name for an internal specifier, with the shell that\n* owns it. The shell build needs both: an import that stays inside the shell\n* being built is bundled rather than externalized.\n*/\nfunction platformEntrypointOf(specifier) {\n\tconst { name, subpath } = splitSpecifier(specifier);\n\tconst owner = owningShell(specifier, name);\n\treturn {\n\t\tshell: owner.shell,\n\t\tid: joinEntrypoint(owner.shell, owner.entry, subpath)\n\t};\n}\n/**\n* The facade's own name for an internal specifier it republishes, or\n* `undefined` when the facade does not carry that surface.\n*/\nfunction facadeEntrypoint(facade, name, subpath) {\n\tconst definition = publicShells.get(facade);\n\t/* v8 ignore next -- @preserve: every ShellName is a key of publicShells */\n\tif (definition === void 0) throw new ImportRootError(`unknown shell ${facade}`);\n\tif (definition.kind !== \"facade\") throw new ImportRootError(`${facade} is a ${definition.kind} shell, not a facade`);\n\tfor (const reexport of definition.reexports ?? []) {\n\t\tif (reexport.package !== name) continue;\n\t\tif (subpath === \"\" && reexport.root === false) return void 0;\n\t\tif (reexport.subpaths !== void 0 && !reexport.subpaths.includes(subpath)) return void 0;\n\t\treturn joinEntrypoint(facade, reexport.entry, subpath);\n\t}\n}\nfunction describe(root) {\n\treturn root.mode === \"facade\" ? `${root.mode} (${root.facade})` : root.mode;\n}\nfunction resolveImportSpecifier(specifier, root) {\n\tif (root.mode === \"internal\") return specifier;\n\tif (!specifier.startsWith(INTERNAL_SCOPE)) return specifier;\n\tconst { name, subpath } = splitSpecifier(specifier);\n\tif (root.mode === \"facade\") {\n\t\tconst republished = facadeEntrypoint(root.facade, name, subpath);\n\t\tif (republished !== void 0) return republished;\n\t}\n\tconst owner = owningShell(specifier, name);\n\tconst published = joinEntrypoint(owner.shell, owner.entry, subpath);\n\tif (!directDependencyShells(root).has(owner.shell)) throw new ImportRootError(unreachableUnder(specifier, published, root));\n\treturn published;\n}\n/**\n* Why a specifier has no name under `root`.\n*\n* The facade wording deliberately does not say \"not a direct dependency\":\n* under ADR 242 the answer to that is never \"install the platform package\n* too\", it is that the facade has to republish the surface.\n*/\nfunction unreachableUnder(specifier, published, root) {\n\tif (root.mode === \"facade\") return `${specifier} has no name under ${root.facade}: the facade does not republish ${published}. An application installs one facade and nothing else, so every surface it reaches has to be one of that facade’s own entrypoints (ADR 242).`;\n\treturn `${specifier} resolves to ${published}, which an application on the ${describe(root)} import root does not depend on directly. Emitted code may name only direct dependencies (ADR 242).`;\n}\nfunction createImportSpecifierResolver(root) {\n\tif (root.mode === \"internal\") return (specifier) => specifier;\n\treturn (specifier) => resolveImportSpecifier(specifier, root);\n}\n/**\n* Builds the resolver `prisma orm init` scaffolds with. Identical to\n* {@link createImportSpecifierResolver} except that it will not accept a root\n* a scaffold cannot express, so the impossible case is rejected where the\n* resolver is made rather than when a template happens to hit a name.\n*/\nfunction createScaffoldSpecifierResolver(root) {\n\treturn createImportSpecifierResolver(root);\n}\nconst MODULE_SPECIFIER = /\\b(?:from|import)\\s*\\(?\\s*(['\"])([^'\"\\n]+)\\1/g;\n/**\n* True when `source` contains module syntax that must carry a quoted\n* specifier: `import '<s>'`, `import('<s>')`, or an import/export clause\n* followed by `from '<s>'`.\n*\n* Deliberately independent of {@link MODULE_SPECIFIER} — it exists to notice\n* when that scanner has stopped matching, so it accepts any quote character,\n* including the backtick a renderer must never emit. It does still require a\n* quote: the word \"import\" on its own appears in prose and comments all the\n* time, and treating that as module syntax made the check below fire on files\n* that have no imports at all.\n*/\nconst HAS_IMPORT_SYNTAX = /(?:^|[\\s(;}])import\\s*[('\"`]|(?:^|[\\s;}])(?:import|export)\\b[\\w$*,{}\\s]*?\\bfrom\\s*['\"`]/;\n/** The module specifiers a generated source file names. */\nfunction importedSpecifiers(source) {\n\treturn [...source.matchAll(MODULE_SPECIFIER)].map(([, , specifier]) => specifier ?? \"\");\n}\n/**\n* The specifiers in a generated file that the application would not have as a\n* direct dependency under `root` — the thing no emitted file may contain.\n*\n* Under the `internal` root nothing is reported: those names are the\n* repository's own, and every in-repo consumer resolves them through the\n* workspace.\n*\n* Throws rather than returning `[]` when the source plainly has imports but\n* the scan found none. An audit whose scanner has stopped matching would\n* otherwise report every file as clean, which is the one failure mode that\n* makes the audit worse than not having it.\n*/\nfunction transitiveImports(source, root) {\n\tconst specifiers = importedSpecifiers(source);\n\tif (specifiers.length === 0 && HAS_IMPORT_SYNTAX.test(source)) throw new ImportRootError(\"source contains import syntax but no specifier was recognised; the audit would pass vacuously\");\n\tif (root.mode === \"internal\") return [];\n\tconst direct = new Set(directDependencyShells(root));\n\treturn specifiers.filter((specifier) => {\n\t\tif (specifier.startsWith(INTERNAL_SCOPE)) return true;\n\t\tif (!specifier.startsWith(PUBLISHED_SCOPE)) return false;\n\t\tconst [scope, shell] = specifier.split(\"/\");\n\t\tconst name = `${scope}/${shell}`;\n\t\treturn !direct.has(name) && !EXTERNAL_DIRECT_DEPENDENCIES.has(name);\n\t});\n}\n/**\n* Published packages this workspace does not own but `init` installs into a\n* scaffolded application directly, so its files may import them:\n* `@prisma/cli-engine` is the config file's `defineConfig` import.\n*/\nconst EXTERNAL_DIRECT_DEPENDENCIES = /* @__PURE__ */ new Set([\"@prisma/cli-engine\"]);\n//#endregion\nexport { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, resolveImportSpecifier, transitiveImports };\n\n//# sourceMappingURL=import-roots.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;;AAExB,IAAI,kBAAkB,cAAc,MAAM,CAAC;AAC3C,MAAM,qBAAqB,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;AAiB9C,SAAS,0BAA0B,cAAc;CAChD,MAAM,QAAQ,IAAI,IAAI,YAAY;CAClC,MAAM,UAAU,CAAC;CACjB,IAAI,cAAc;CAClB,KAAK,MAAM,CAAC,OAAO,eAAe,cAAc;EAC/C,IAAI,CAAC,MAAM,IAAI,KAAK,GAAG;EACvB,IAAI,WAAW,SAAS,UAAU,QAAQ,KAAK,KAAK;EACpD,IAAI,WAAW,SAAS,YAAY,cAAc;CACnD;CACA,IAAI,QAAQ,SAAS,GAAG,MAAM,IAAI,gBAAgB,kFAAkF,QAAQ,KAAK,OAAO,GAAG;CAC3J,MAAM,CAAC,UAAU;CACjB,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,OAAO,cAAc,EAAE,MAAM,WAAW,IAAI;AAC7C;AACA,MAAM,SAAS,gBAAgB,YAAY;;;;;;;AAO3C,SAAS,gBAAgB,QAAQ;CAChC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,CAAC,OAAO,eAAe,QAAQ,KAAK,MAAM,OAAO,WAAW,UAAU;EAChF,MAAM,WAAW,MAAM,IAAI,IAAI,IAAI;EACnC,IAAI,aAAa,KAAK,GAAG,MAAM,IAAI,gBAAgB,GAAG,IAAI,KAAK,qBAAqB,SAAS,MAAM,OAAO,MAAM,8DAA8D;EAC9K,MAAM,IAAI,IAAI,MAAM;GACnB;GACA,OAAO,IAAI;EACZ,CAAC;CACF;CACA,OAAO;AACR;AACA,SAAS,eAAe,WAAW;CAClC,MAAM,C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SAAS,gCAAgC,MAAM;CAC9C,OAAO,8BAA8B,IAAI;AAC1C;AACA,MAAM,mBAAmB;;;;;;;;;;;;;AAazB,MAAM,oBAAoB;;AAE1B,SAAS,mBAAmB,QAAQ;CACnC,OAAO,CAAC,GAAG,OAAO,SAAS,gBAAgB,CAAC,CAAC,CAAC,KAAK,KAAK,eAAe,aAAa,EAAE;AACvF;;;;;;;;;;;;;;AAcA,SAAS,kBAAkB,QAAQ,MAAM;CACxC,MAAM,aAAa,mBAAmB,MAAM;CAC5C,IAAI,WAAW,WAAW,KAAK,kBAAkB,KAAK,MAAM,GAAG,MAAM,IAAI,gBAAgB,+FAA+F;CACxL,IAAI,KAAK,SAAS,YAAY,OAAO,CAAC;CACtC,MAAM,SAAS,IAAI,IAAI,uBAAuB,IAAI,CAAC;CACnD,OAAO,WAAW,QAAQ,cAAc;EACvC,IAAI,UAAU,WAAW,cAAc,GAAG,OAAO;EACjD,IAAI,CAAC,UAAU,WAAW,eAAe,GAAG,OAAO;EACnD,MAAM,CAAC,OAAO,SAAS,UAAU,MAAM,GAAG;EAC1C,MAAM,OAAO,GAAG,MAAM,GAAG;EACzB,OAAO,CAAC,OAAO,IAAI,IAAI,KAAK,CAAC,6BAA6B,IAAI,IAAI;CACnE,CAAC;AACF;;;;;;AAMA,MAAM,+CAA+C,IAAI,IAAI,CAAC,oBAAoB,CAAC"}
@@ -7,11 +7,6 @@ import { PrismaNextConfig, PrismaNextConfig as PrismaNextConfig$1 } from "@prism
7
7
  declare function finalizeConfig(config: PrismaNextConfig, configDir: string): PrismaNextConfig;
8
8
  //#endregion
9
9
  //#region src/load.d.ts
10
- /** A deprecated spelling the loader accepted; callers surface it as a warning. */
11
- interface ConfigDeprecation {
12
- readonly code: 'CONFIG.DEPRECATED_FILENAME' | 'CONFIG.DEPRECATED_SHAPE';
13
- readonly message: string;
14
- }
15
10
  /**
16
11
  * A successfully evaluated config plus the structural diagnostics found in it.
17
12
  * Diagnostics are tagged with the config section they concern
@@ -22,7 +17,6 @@ interface ConfigDeprecation {
22
17
  interface LoadedConfig {
23
18
  readonly config: PrismaNextConfig;
24
19
  readonly diagnostics: readonly CliStructuredError[];
25
- readonly deprecations: readonly ConfigDeprecation[];
26
20
  }
27
21
  declare function findNearestConfigPathForFile(filePath: string): Promise<string | undefined>;
28
22
  declare function loadConfig(configPath?: string, options?: {
@@ -39,10 +33,8 @@ declare function requireConfigSections(loaded: LoadedConfig, sections: readonly
39
33
  * {@link requireConfigSections} for commands that read a fixed set of
40
34
  * sections and have no use for diagnostics outside them.
41
35
  */
42
- declare function loadConfigForSections(configPath: string | undefined, sections: readonly ConfigSection[], options?: {
43
- readonly onDeprecation?: (deprecation: ConfigDeprecation) => void;
44
- }): Promise<Result<PrismaNextConfig, CliStructuredError>>;
36
+ declare function loadConfigForSections(configPath: string | undefined, sections: readonly ConfigSection[]): Promise<Result<PrismaNextConfig, CliStructuredError>>;
45
37
  declare function loadConfigForFile(filePath: string): Promise<Result<LoadedConfig, CliStructuredError>>;
46
38
  //#endregion
47
39
  export { findNearestConfigPathForFile as a, loadConfigForSections as c, finalizeConfig as i, requireConfigSections as l, LoadedConfig as n, loadConfig as o, PrismaNextConfig$1 as r, loadConfigForFile as s, ConfigSection as t };
48
- //# sourceMappingURL=index-BRjNSwL-.d.mts.map
40
+ //# sourceMappingURL=index-u5RdrumF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-u5RdrumF.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.d.mts"],"mappings":";;;;;;iBAKiB,eAAe,QAAQ,kBAAoB,oBAAoB;;;;;;;;;;UAUtE;WACC,QAAQ;WACR,sBAAsB;;iBAEhB,6BAA6B,mBAAmB;iBAChD,WAAW,qBAAqB;WACtC;IACP,QAAQ,OAAO,cAAc;;;;;;iBAMhB,sBAAsB,QAAQ,cAAc,mBAAmB,kBAAkB,OAAO,kBAAoB;;;;;;iBAM5G,sBAAsB,gCAAgC,mBAAmB,kBAAkB,QAAQ,OAAO,kBAAoB;iBAC9H,kBAAkB,mBAAmB,QAAQ,OAAO,cAAc"}
@@ -1,5 +1,5 @@
1
- import { d as errorDuplicateInvariantInEdge, h as errorInvalidInvariantId } from "./errors-CXbGUWGu-CstQHPh6.mjs";
2
- //#region ../../../1-framework/3-tooling/migration/dist/invariants-CTHy88OP.mjs
1
+ import { d as errorDuplicateInvariantInEdge, h as errorInvalidInvariantId } from "./errors-CcEpbfnE-CsSXrttT.mjs";
2
+ //#region ../../../1-framework/3-tooling/migration/dist/invariants-DcFfhJMZ.mjs
3
3
  /**
4
4
  * Hygiene check for `invariantId`. Rejects empty values plus any
5
5
  * whitespace or control character (including Unicode whitespace like
@@ -54,4 +54,4 @@ function readInvariantId(op) {
54
54
  //#endregion
55
55
  export { validateInvariantId as n, deriveProvidedInvariants as t };
56
56
 
57
- //# sourceMappingURL=invariants-CTHy88OP-CYI2a8IO.mjs.map
57
+ //# sourceMappingURL=invariants-DcFfhJMZ-BHDWZP9k.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"invariants-CTHy88OP-CYI2a8IO.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/invariants-CTHy88OP.mjs"],"sourcesContent":["import { d as errorDuplicateInvariantInEdge, h as errorInvalidInvariantId } from \"./errors-CXbGUWGu.mjs\";\n//#region src/invariants.ts\n/**\n* Hygiene check for `invariantId`. Rejects empty values plus any\n* whitespace or control character (including Unicode whitespace like\n* NBSP and em space, which are visually identical to ASCII space and\n* routinely sneak in via paste).\n*/\nfunction validateInvariantId(invariantId) {\n\tif (invariantId.length === 0) return false;\n\treturn !/[\\p{Cc}\\p{White_Space}]/u.test(invariantId);\n}\n/**\n* Walk a migration's operations and produce its `providedInvariants`\n* aggregate: the sorted, deduplicated list of `invariantId`s declared\n* by ops in the migration. Ops without an `invariantId` are skipped.\n*\n* Both `data`-class ops (data-transforms, e.g. backfills) and\n* `additive`-class opaque DDL (e.g. cipherstash's vendored EQL bundle\n* via `installEqlBundleOp`) may declare invariantIds: the\n* `operationClass` axis classifies *policy gating* (which kinds of ops\n* a `db init` / `db update` policy permits), while `invariantId`\n* classifies *marker bookkeeping* (which named bundles of work a\n* future regeneration knows to skip). The two concerns are\n* intentionally orthogonal — an extension can ship additive\n* non-IR-derivable DDL (the only way the planner can know the bundle\n* is already applied is via the invariantId on the marker) without\n* needing to mis-classify it as `data`-class.\n*\n* Throws `MIGRATION.INVALID_INVARIANT_ID` on a malformed id and\n* `MIGRATION.DUPLICATE_INVARIANT_IN_EDGE` on duplicates.\n*\n* @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md\n* — extension migrations carry `invariantId`s on additive ops; e.g.\n* cipherstash's `installEqlBundle` and structural `create-*` ops are\n* additive-class but carry `cipherstash:*` invariantIds.\n*/\nfunction deriveProvidedInvariants(ops) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const op of ops) {\n\t\tconst invariantId = readInvariantId(op);\n\t\tif (invariantId === void 0) continue;\n\t\tif (!validateInvariantId(invariantId)) throw errorInvalidInvariantId(invariantId);\n\t\tif (seen.has(invariantId)) throw errorDuplicateInvariantInEdge(invariantId);\n\t\tseen.add(invariantId);\n\t}\n\treturn [...seen].sort();\n}\nfunction readInvariantId(op) {\n\tif (!Object.hasOwn(op, \"invariantId\")) return void 0;\n\tconst candidate = op.invariantId;\n\treturn typeof candidate === \"string\" ? candidate : void 0;\n}\n//#endregion\nexport { validateInvariantId as n, deriveProvidedInvariants as t };\n\n//# sourceMappingURL=invariants-CTHy88OP.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,oBAAoB,aAAa;CACzC,IAAI,YAAY,WAAW,GAAG,OAAO;CACrC,OAAO,CAAC,2BAA2B,KAAK,WAAW;AACpD;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,yBAAyB,KAAK;CACtC,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,MAAM,MAAM,KAAK;EACrB,MAAM,cAAc,gBAAgB,EAAE;EACtC,IAAI,gBAAgB,KAAK,GAAG;EAC5B,IAAI,CAAC,oBAAoB,WAAW,GAAG,MAAM,wBAAwB,WAAW;EAChF,IAAI,KAAK,IAAI,WAAW,GAAG,MAAM,8BAA8B,WAAW;EAC1E,KAAK,IAAI,WAAW;CACrB;CACA,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK;AACvB;AACA,SAAS,gBAAgB,IAAI;CAC5B,IAAI,CAAC,OAAO,OAAO,IAAI,aAAa,GAAG,OAAO,KAAK;CACnD,MAAM,YAAY,GAAG;CACrB,OAAO,OAAO,cAAc,WAAW,YAAY,KAAK;AACzD"}
1
+ {"version":3,"file":"invariants-DcFfhJMZ-BHDWZP9k.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/invariants-DcFfhJMZ.mjs"],"sourcesContent":["import { d as errorDuplicateInvariantInEdge, h as errorInvalidInvariantId } from \"./errors-CcEpbfnE.mjs\";\n//#region src/invariants.ts\n/**\n* Hygiene check for `invariantId`. Rejects empty values plus any\n* whitespace or control character (including Unicode whitespace like\n* NBSP and em space, which are visually identical to ASCII space and\n* routinely sneak in via paste).\n*/\nfunction validateInvariantId(invariantId) {\n\tif (invariantId.length === 0) return false;\n\treturn !/[\\p{Cc}\\p{White_Space}]/u.test(invariantId);\n}\n/**\n* Walk a migration's operations and produce its `providedInvariants`\n* aggregate: the sorted, deduplicated list of `invariantId`s declared\n* by ops in the migration. Ops without an `invariantId` are skipped.\n*\n* Both `data`-class ops (data-transforms, e.g. backfills) and\n* `additive`-class opaque DDL (e.g. cipherstash's vendored EQL bundle\n* via `installEqlBundleOp`) may declare invariantIds: the\n* `operationClass` axis classifies *policy gating* (which kinds of ops\n* a `db init` / `db update` policy permits), while `invariantId`\n* classifies *marker bookkeeping* (which named bundles of work a\n* future regeneration knows to skip). The two concerns are\n* intentionally orthogonal — an extension can ship additive\n* non-IR-derivable DDL (the only way the planner can know the bundle\n* is already applied is via the invariantId on the marker) without\n* needing to mis-classify it as `data`-class.\n*\n* Throws `MIGRATION.INVALID_INVARIANT_ID` on a malformed id and\n* `MIGRATION.DUPLICATE_INVARIANT_IN_EDGE` on duplicates.\n*\n* @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md\n* — extension migrations carry `invariantId`s on additive ops; e.g.\n* cipherstash's `installEqlBundle` and structural `create-*` ops are\n* additive-class but carry `cipherstash:*` invariantIds.\n*/\nfunction deriveProvidedInvariants(ops) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const op of ops) {\n\t\tconst invariantId = readInvariantId(op);\n\t\tif (invariantId === void 0) continue;\n\t\tif (!validateInvariantId(invariantId)) throw errorInvalidInvariantId(invariantId);\n\t\tif (seen.has(invariantId)) throw errorDuplicateInvariantInEdge(invariantId);\n\t\tseen.add(invariantId);\n\t}\n\treturn [...seen].sort();\n}\nfunction readInvariantId(op) {\n\tif (!Object.hasOwn(op, \"invariantId\")) return void 0;\n\tconst candidate = op.invariantId;\n\treturn typeof candidate === \"string\" ? candidate : void 0;\n}\n//#endregion\nexport { validateInvariantId as n, deriveProvidedInvariants as t };\n\n//# sourceMappingURL=invariants-DcFfhJMZ.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,oBAAoB,aAAa;CACzC,IAAI,YAAY,WAAW,GAAG,OAAO;CACrC,OAAO,CAAC,2BAA2B,KAAK,WAAW;AACpD;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,yBAAyB,KAAK;CACtC,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,MAAM,MAAM,KAAK;EACrB,MAAM,cAAc,gBAAgB,EAAE;EACtC,IAAI,gBAAgB,KAAK,GAAG;EAC5B,IAAI,CAAC,oBAAoB,WAAW,GAAG,MAAM,wBAAwB,WAAW;EAChF,IAAI,KAAK,IAAI,WAAW,GAAG,MAAM,8BAA8B,WAAW;EAC1E,KAAK,IAAI,WAAW;CACrB;CACA,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK;AACvB;AACA,SAAS,gBAAgB,IAAI;CAC5B,IAAI,CAAC,OAAO,OAAO,IAAI,aAAa,GAAG,OAAO,KAAK;CACnD,MAAM,YAAY,GAAG;CACrB,OAAO,OAAO,cAAc,WAAW,YAAY,KAAK;AACzD"}
@@ -1,13 +1,13 @@
1
- import { E as errorMissingFile, S as errorInvalidSlug, T as errorMigrationHashMismatch, _ as errorInvalidManifest, g as errorInvalidJson, j as errorProvidedInvariantsMismatch, m as errorInvalidDestName, t as MigrationToolsError, u as errorDirectoryExists } from "./errors-CXbGUWGu-CstQHPh6.mjs";
2
- import { i as readContractSnapshotJsonTolerant } from "./contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs";
1
+ import { E as errorMissingFile, S as errorInvalidSlug, T as errorMigrationHashMismatch, _ as errorInvalidManifest, g as errorInvalidJson, j as errorProvidedInvariantsMismatch, m as errorInvalidDestName, t as MigrationToolsError, u as errorDirectoryExists } from "./errors-CcEpbfnE-CsSXrttT.mjs";
2
+ import { i as readContractSnapshotJsonTolerant } from "./contract-snapshot-store-BAmQkHe5-BJFpuIQQ.mjs";
3
3
  import { n as verifyMigrationHash } from "./hash-DH8hl5Rq-BpM2t3Nu.mjs";
4
- import { t as deriveProvidedInvariants } from "./invariants-CTHy88OP-CYI2a8IO.mjs";
4
+ import { t as deriveProvidedInvariants } from "./invariants-DcFfhJMZ-BHDWZP9k.mjs";
5
5
  import { n as MigrationOpsSchema } from "./op-schema-BSVHzEQN-DIWt28D8.mjs";
6
6
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
7
7
  import { basename, dirname, join, resolve } from "pathe";
8
8
  import { copyFile, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
9
9
  import { type } from "arktype";
10
- //#region ../../../1-framework/3-tooling/migration/dist/io-635GlNx1.mjs
10
+ //#region ../../../1-framework/3-tooling/migration/dist/io-DsViRB_O.mjs
11
11
  const MANIFEST_FILE = "migration.json";
12
12
  const OPS_FILE = "ops.json";
13
13
  const MAX_SLUG_LENGTH = 64;
@@ -310,4 +310,4 @@ function formatMigrationDirName(timestamp, slug) {
310
310
  //#endregion
311
311
  export { materialiseMigrationPackage as a, writeMigrationMetadata as c, materialiseExtensionMigrationPackageIfMissing as i, writeMigrationOps as l, copyFilesWithRename as n, readMigrationPackage as o, formatMigrationDirName as r, readMigrationsDir as s, MANIFEST_FILE as t, writeMigrationPackage as u };
312
312
 
313
- //# sourceMappingURL=io-635GlNx1-D3zrw2qu.mjs.map
313
+ //# sourceMappingURL=io-DsViRB_O-Ci1kJGBg.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"io-635GlNx1-D3zrw2qu.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/io-635GlNx1.mjs"],"sourcesContent":["import { E as errorMissingFile, S as errorInvalidSlug, T as errorMigrationHashMismatch, _ as errorInvalidManifest, g as errorInvalidJson, j as errorProvidedInvariantsMismatch, m as errorInvalidDestName, t as MigrationToolsError, u as errorDirectoryExists } from \"./errors-CXbGUWGu.mjs\";\nimport { i as readContractSnapshotJsonTolerant } from \"./contract-snapshot-store-B0G1Fw_F.mjs\";\nimport { n as verifyMigrationHash } from \"./hash-DH8hl5Rq.mjs\";\nimport { t as deriveProvidedInvariants } from \"./invariants-CTHy88OP.mjs\";\nimport { n as MigrationOpsSchema } from \"./op-schema-BSVHzEQN.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { basename, dirname, join, resolve } from \"pathe\";\nimport { copyFile, mkdir, readFile, readdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { type } from \"arktype\";\n//#region src/io.ts\nconst MANIFEST_FILE = \"migration.json\";\nconst OPS_FILE = \"ops.json\";\nconst MAX_SLUG_LENGTH = 64;\nfunction hasErrnoCode(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\nconst MigrationMetadataSchema = type({\n\t\"+\": \"reject\",\n\tfrom: \"string > 0 | null\",\n\tto: \"string\",\n\tmigrationHash: \"string\",\n\tprovidedInvariants: \"string[]\",\n\tcreatedAt: \"string\"\n});\nasync function writeMigrationPackage(dir, metadata, ops) {\n\tawait mkdir(dirname(dir), { recursive: true });\n\ttry {\n\t\tawait mkdir(dir);\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"EEXIST\")) throw errorDirectoryExists(dir);\n\t\tthrow error;\n\t}\n\tawait writeFile(join(dir, MANIFEST_FILE), JSON.stringify(metadata, null, 2), { flag: \"wx\" });\n\tawait writeFile(join(dir, OPS_FILE), JSON.stringify(ops, null, 2), { flag: \"wx\" });\n}\n/**\n* Materialise an in-memory {@link MigrationPackage} to a per-space\n* directory on disk.\n*\n* Writes two files under `<targetDir>/<pkg.dirName>/`:\n*\n* - `migration.json` — the manifest (pretty-printed, matches\n* {@link writeMigrationPackage}'s output for byte-for-byte parity with\n* app-space migrations).\n* - `ops.json` — the operation list (pretty-printed).\n*\n* Distinct verb from the lower-level {@link writeMigrationPackage}\n* (which takes constituent `(metadata, ops)`): callers reading\n* `materialise…` know they are persisting a struct-typed package.\n*\n* Overwrite-idempotent: the per-package directory is cleared before\n* each emit, so re-running against the same `targetDir` produces\n* byte-identical contents and never leaves stale files behind. The\n* lower-level {@link writeMigrationPackage} stays strict because the\n* CLI authoring path (`migration plan` / `migration new`) deliberately\n* refuses to clobber an existing authored migration; this helper is\n* the re-emit path that is supposed to converge on a single canonical\n* on-disk shape.\n*\n* The per-space head contract resolves through\n* `<projectMigrationsDir>/snapshots/<hex>/` (written by\n* {@link import('./emit-contract-space-artifacts').emitContractSpaceArtifacts}),\n* not inside the per-package directory. The runner reads only\n* `migration.json` + `ops.json` from each package.\n*/\nasync function materialiseMigrationPackage(targetDir, pkg) {\n\tconst dir = join(targetDir, pkg.dirName);\n\tawait rm(dir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tawait writeMigrationPackage(dir, pkg.metadata, pkg.ops);\n}\n/**\n* Idempotent variant of {@link materialiseMigrationPackage}: writes the\n* package only if `<targetDir>/<pkg.dirName>/` does not already exist on\n* disk as a directory; returns `{ written: false }` when the package\n* directory is present (no rewrite, no comparison — by-existence skip).\n*\n* Concretely:\n* - existing directory → skip silently, return `{ written: false }`.\n* - missing path → write three files via {@link materialiseMigrationPackage},\n* return `{ written: true }`.\n* - path exists but is not a directory (file/symlink) → treated as\n* missing; {@link materialiseMigrationPackage} will attempt creation\n* and fail with an appropriate OS error.\n* - any other I/O error from `stat` → propagated unchanged.\n*\n* Used by the CLI's `runContractSpaceExtensionMigrationsPass` to\n* materialise extension migration packages into a project's\n* `migrations/<spaceId>/` directory, and by extension-package tests\n* that mirror the same idempotent-rematerialise property locally\n* without taking a CLI dependency.\n*/\nasync function materialiseExtensionMigrationPackageIfMissing(targetDir, pkg) {\n\tif (await directoryExists(join(targetDir, pkg.dirName))) return { written: false };\n\tawait materialiseMigrationPackage(targetDir, pkg);\n\treturn { written: true };\n}\nasync function directoryExists(p) {\n\ttry {\n\t\treturn (await stat(p)).isDirectory();\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return false;\n\t\tthrow error;\n\t}\n}\n/**\n* Copy a list of files into `destDir`, optionally renaming each one.\n*\n* The destination directory is created (with `recursive: true`) if it\n* does not already exist. Each source path is copied byte-for-byte into\n* `destDir/<destName>`; missing sources throw `ENOENT`. The helper is\n* intentionally generic: callers own the list of files and the naming\n* convention for the copies.\n*/\nasync function copyFilesWithRename(destDir, files) {\n\tawait mkdir(destDir, { recursive: true });\n\tfor (const file of files) {\n\t\tif (basename(file.destName) !== file.destName) throw errorInvalidDestName(file.destName);\n\t\tawait copyFile(file.sourcePath, join(destDir, file.destName));\n\t}\n}\nasync function writeMigrationMetadata(dir, metadata) {\n\tawait writeFile(join(dir, MANIFEST_FILE), `${JSON.stringify(metadata, null, 2)}\\n`);\n}\nasync function writeMigrationOps(dir, ops) {\n\tawait writeFile(join(dir, OPS_FILE), `${JSON.stringify(ops, null, 2)}\\n`);\n}\nasync function readMigrationPackage(dir, options) {\n\tconst absoluteDir = resolve(dir);\n\tconst manifestPath = join(absoluteDir, MANIFEST_FILE);\n\tconst opsPath = join(absoluteDir, OPS_FILE);\n\tlet manifestRaw;\n\ttry {\n\t\tmanifestRaw = await readFile(manifestPath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) throw errorMissingFile(MANIFEST_FILE, absoluteDir);\n\t\tthrow error;\n\t}\n\tlet opsRaw;\n\ttry {\n\t\topsRaw = await readFile(opsPath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) throw errorMissingFile(OPS_FILE, absoluteDir);\n\t\tthrow error;\n\t}\n\tlet metadata;\n\ttry {\n\t\tmetadata = JSON.parse(manifestRaw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(manifestPath, e instanceof Error ? e.message : String(e));\n\t}\n\tlet ops;\n\ttry {\n\t\tops = JSON.parse(opsRaw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(opsPath, e instanceof Error ? e.message : String(e));\n\t}\n\tvalidateMetadata(metadata, manifestPath);\n\tvalidateOps(ops, opsPath);\n\tconst derivedInvariants = deriveProvidedInvariants(ops);\n\tif (!arraysEqual(metadata.providedInvariants, derivedInvariants)) throw errorProvidedInvariantsMismatch(manifestPath, metadata.providedInvariants, derivedInvariants);\n\tconst endContractJson = await readContractSnapshotJsonTolerant(options.migrationsDir, metadata.to);\n\tconst pkg = {\n\t\tdirName: basename(absoluteDir),\n\t\tdirPath: absoluteDir,\n\t\tmetadata,\n\t\tops,\n\t\t...ifDefined(\"endContractJson\", endContractJson)\n\t};\n\tconst verification = verifyMigrationHash(pkg);\n\tif (!verification.ok) throw errorMigrationHashMismatch(absoluteDir, verification.storedHash, verification.computedHash);\n\treturn pkg;\n}\n/**\n* Reads a migration package's manifest and ops without running hash or\n* invariants verification. Returns `null` when the files cannot be read or\n* parsed (i.e. when the package is genuinely unloadable).\n*\n* Used by {@link readMigrationsDir} to retain a package whose hash or\n* invariants diverge from what is stored on disk — the raw content is still\n* useful for display / querying; only integrity is in question.\n*/\nasync function readMigrationPackageRaw(dir) {\n\tconst absoluteDir = resolve(dir);\n\tconst manifestPath = join(absoluteDir, MANIFEST_FILE);\n\tconst opsPath = join(absoluteDir, OPS_FILE);\n\tlet manifestRaw;\n\ttry {\n\t\tmanifestRaw = await readFile(manifestPath, \"utf-8\");\n\t} catch {\n\t\treturn null;\n\t}\n\tlet opsRaw;\n\ttry {\n\t\topsRaw = await readFile(opsPath, \"utf-8\");\n\t} catch {\n\t\treturn null;\n\t}\n\tlet metadata;\n\ttry {\n\t\tmetadata = JSON.parse(manifestRaw);\n\t} catch {\n\t\treturn null;\n\t}\n\tlet ops;\n\ttry {\n\t\tops = JSON.parse(opsRaw);\n\t} catch {\n\t\treturn null;\n\t}\n\tif (MigrationMetadataSchema(metadata) instanceof type.errors) return null;\n\tif (MigrationOpsSchema(ops) instanceof type.errors) return null;\n\treturn {\n\t\tdirName: basename(absoluteDir),\n\t\tdirPath: absoluteDir,\n\t\tmetadata,\n\t\tops\n\t};\n}\nfunction arraysEqual(a, b) {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\n\treturn true;\n}\nfunction validateMetadata(metadata, filePath) {\n\tconst result = MigrationMetadataSchema(metadata);\n\tif (result instanceof type.errors) throw errorInvalidManifest(filePath, result.summary);\n}\nfunction validateOps(ops, filePath) {\n\tconst result = MigrationOpsSchema(ops);\n\tif (result instanceof type.errors) throw errorInvalidManifest(filePath, result.summary);\n}\nfunction packageLoadProblemDetailFromError(error) {\n\tif (MigrationToolsError.is(error)) return error.why;\n\tif (error instanceof Error) return error.message;\n\treturn String(error);\n}\nasync function readMigrationsDir(migrationsRoot, options) {\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(migrationsRoot);\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return {\n\t\t\tpackages: [],\n\t\t\tproblems: []\n\t\t};\n\t\tthrow error;\n\t}\n\tconst packages = [];\n\tconst problems = [];\n\tfor (const entry of entries.sort()) {\n\t\tconst entryPath = join(migrationsRoot, entry);\n\t\tif (!(await stat(entryPath)).isDirectory()) continue;\n\t\tconst manifestPath = join(entryPath, MANIFEST_FILE);\n\t\ttry {\n\t\t\tawait stat(manifestPath);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tlet pkg;\n\t\ttry {\n\t\t\tpkg = await readMigrationPackage(entryPath, options);\n\t\t} catch (error) {\n\t\t\tconst dirName = entry;\n\t\t\tif (MigrationToolsError.is(error)) {\n\t\t\t\tif (error.code === \"MIGRATION.HASH_MISMATCH\") {\n\t\t\t\t\tconst meta = error.meta;\n\t\t\t\t\tconst rawPkg = await readMigrationPackageRaw(entryPath);\n\t\t\t\t\tif (rawPkg !== null) packages.push(rawPkg);\n\t\t\t\t\tproblems.push({\n\t\t\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\t\t\tdirName,\n\t\t\t\t\t\tstored: typeof meta?.[\"storedHash\"] === \"string\" ? meta[\"storedHash\"] : \"\",\n\t\t\t\t\t\tcomputed: typeof meta?.[\"computedHash\"] === \"string\" ? meta[\"computedHash\"] : \"\"\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (error.code === \"MIGRATION.PROVIDED_INVARIANTS_MISMATCH\") {\n\t\t\t\t\tconst rawPkg = await readMigrationPackageRaw(entryPath);\n\t\t\t\t\tif (rawPkg !== null) packages.push(rawPkg);\n\t\t\t\t\tproblems.push({\n\t\t\t\t\t\tkind: \"providedInvariantsMismatch\",\n\t\t\t\t\t\tdirName\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tproblems.push({\n\t\t\t\tkind: \"packageUnloadable\",\n\t\t\t\tdirName,\n\t\t\t\tdetail: packageLoadProblemDetailFromError(error)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tpackages.push(pkg);\n\t}\n\treturn {\n\t\tpackages,\n\t\tproblems\n\t};\n}\nfunction formatMigrationDirName(timestamp, slug) {\n\tconst sanitized = slug.toLowerCase().replace(/[^a-z0-9]/g, \"_\").replace(/_+/g, \"_\").replace(/^_|_$/g, \"\");\n\tif (sanitized.length === 0) throw errorInvalidSlug(slug);\n\tconst truncated = sanitized.slice(0, MAX_SLUG_LENGTH);\n\treturn `${timestamp.getUTCFullYear()}${String(timestamp.getUTCMonth() + 1).padStart(2, \"0\")}${String(timestamp.getUTCDate()).padStart(2, \"0\")}T${String(timestamp.getUTCHours()).padStart(2, \"0\")}${String(timestamp.getUTCMinutes()).padStart(2, \"0\")}_${truncated}`;\n}\n//#endregion\nexport { materialiseMigrationPackage as a, writeMigrationMetadata as c, materialiseExtensionMigrationPackageIfMissing as i, writeMigrationOps as l, copyFilesWithRename as n, readMigrationPackage as o, formatMigrationDirName as r, readMigrationsDir as s, MANIFEST_FILE as t, writeMigrationPackage as u };\n\n//# sourceMappingURL=io-635GlNx1.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,gBAAgB;AACtB,MAAM,WAAW;AACjB,MAAM,kBAAkB;AACxB,SAAS,aAAa,OAAO,MAAM;CAClC,OAAO,iBAAiB,SAAS,MAAM,SAAS;AACjD;AACA,MAAM,0BAA0B,KAAK;CACpC,KAAK;CACL,MAAM;CACN,IAAI;CACJ,eAAe;CACf,oBAAoB;CACpB,WAAW;AACZ,CAAC;AACD,eAAe,sBAAsB,KAAK,UAAU,KAAK;CACxD,MAAM,MAAM,QAAQ,GAAG,GAAG,EAAE,WAAW,KAAK,CAAC;CAC7C,IAAI;EACH,MAAM,MAAM,GAAG;CAChB,SAAS,OAAO;EACf,IAAI,aAAa,OAAO,QAAQ,GAAG,MAAM,qBAAqB,GAAG;EACjE,MAAM;CACP;CACA,MAAM,UAAU,KAAK,KAAK,aAAa,GAAG,KAAK,UAAU,UAAU,MAAM,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC;CAC3F,MAAM,UAAU,KAAK,KAAK,QAAQ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WAAW,MAAM;CAChD,MAAM,YAAY,KAAK,YAAY,CAAC,CAAC,QAAQ,cAAc,GAAG,CAAC,CAAC,QAAQ,OAAO,GAAG,CAAC,CAAC,QAAQ,UAAU,EAAE;CACxG,IAAI,UAAU,WAAW,GAAG,MAAM,iBAAiB,IAAI;CACvD,MAAM,YAAY,UAAU,MAAM,GAAG,eAAe;CACpD,OAAO,GAAG,UAAU,eAAe,IAAI,OAAO,UAAU,YAAY,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI,OAAO,UAAU,WAAW,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,UAAU,YAAY,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI,OAAO,UAAU,cAAc,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG;AAC3P"}
1
+ {"version":3,"file":"io-DsViRB_O-Ci1kJGBg.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/io-DsViRB_O.mjs"],"sourcesContent":["import { E as errorMissingFile, S as errorInvalidSlug, T as errorMigrationHashMismatch, _ as errorInvalidManifest, g as errorInvalidJson, j as errorProvidedInvariantsMismatch, m as errorInvalidDestName, t as MigrationToolsError, u as errorDirectoryExists } from \"./errors-CcEpbfnE.mjs\";\nimport { i as readContractSnapshotJsonTolerant } from \"./contract-snapshot-store-BAmQkHe5.mjs\";\nimport { n as verifyMigrationHash } from \"./hash-DH8hl5Rq.mjs\";\nimport { t as deriveProvidedInvariants } from \"./invariants-DcFfhJMZ.mjs\";\nimport { n as MigrationOpsSchema } from \"./op-schema-BSVHzEQN.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { basename, dirname, join, resolve } from \"pathe\";\nimport { copyFile, mkdir, readFile, readdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { type } from \"arktype\";\n//#region src/io.ts\nconst MANIFEST_FILE = \"migration.json\";\nconst OPS_FILE = \"ops.json\";\nconst MAX_SLUG_LENGTH = 64;\nfunction hasErrnoCode(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\nconst MigrationMetadataSchema = type({\n\t\"+\": \"reject\",\n\tfrom: \"string > 0 | null\",\n\tto: \"string\",\n\tmigrationHash: \"string\",\n\tprovidedInvariants: \"string[]\",\n\tcreatedAt: \"string\"\n});\nasync function writeMigrationPackage(dir, metadata, ops) {\n\tawait mkdir(dirname(dir), { recursive: true });\n\ttry {\n\t\tawait mkdir(dir);\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"EEXIST\")) throw errorDirectoryExists(dir);\n\t\tthrow error;\n\t}\n\tawait writeFile(join(dir, MANIFEST_FILE), JSON.stringify(metadata, null, 2), { flag: \"wx\" });\n\tawait writeFile(join(dir, OPS_FILE), JSON.stringify(ops, null, 2), { flag: \"wx\" });\n}\n/**\n* Materialise an in-memory {@link MigrationPackage} to a per-space\n* directory on disk.\n*\n* Writes two files under `<targetDir>/<pkg.dirName>/`:\n*\n* - `migration.json` — the manifest (pretty-printed, matches\n* {@link writeMigrationPackage}'s output for byte-for-byte parity with\n* app-space migrations).\n* - `ops.json` — the operation list (pretty-printed).\n*\n* Distinct verb from the lower-level {@link writeMigrationPackage}\n* (which takes constituent `(metadata, ops)`): callers reading\n* `materialise…` know they are persisting a struct-typed package.\n*\n* Overwrite-idempotent: the per-package directory is cleared before\n* each emit, so re-running against the same `targetDir` produces\n* byte-identical contents and never leaves stale files behind. The\n* lower-level {@link writeMigrationPackage} stays strict because the\n* CLI authoring path (`migration plan` / `migration new`) deliberately\n* refuses to clobber an existing authored migration; this helper is\n* the re-emit path that is supposed to converge on a single canonical\n* on-disk shape.\n*\n* The per-space head contract resolves through\n* `<projectMigrationsDir>/snapshots/<hex>/` (written by\n* {@link import('./emit-contract-space-artifacts').emitContractSpaceArtifacts}),\n* not inside the per-package directory. The runner reads only\n* `migration.json` + `ops.json` from each package.\n*/\nasync function materialiseMigrationPackage(targetDir, pkg) {\n\tconst dir = join(targetDir, pkg.dirName);\n\tawait rm(dir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tawait writeMigrationPackage(dir, pkg.metadata, pkg.ops);\n}\n/**\n* Idempotent variant of {@link materialiseMigrationPackage}: writes the\n* package only if `<targetDir>/<pkg.dirName>/` does not already exist on\n* disk as a directory; returns `{ written: false }` when the package\n* directory is present (no rewrite, no comparison — by-existence skip).\n*\n* Concretely:\n* - existing directory → skip silently, return `{ written: false }`.\n* - missing path → write three files via {@link materialiseMigrationPackage},\n* return `{ written: true }`.\n* - path exists but is not a directory (file/symlink) → treated as\n* missing; {@link materialiseMigrationPackage} will attempt creation\n* and fail with an appropriate OS error.\n* - any other I/O error from `stat` → propagated unchanged.\n*\n* Used by the CLI's `runContractSpaceExtensionMigrationsPass` to\n* materialise extension migration packages into a project's\n* `migrations/<spaceId>/` directory, and by extension-package tests\n* that mirror the same idempotent-rematerialise property locally\n* without taking a CLI dependency.\n*/\nasync function materialiseExtensionMigrationPackageIfMissing(targetDir, pkg) {\n\tif (await directoryExists(join(targetDir, pkg.dirName))) return { written: false };\n\tawait materialiseMigrationPackage(targetDir, pkg);\n\treturn { written: true };\n}\nasync function directoryExists(p) {\n\ttry {\n\t\treturn (await stat(p)).isDirectory();\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return false;\n\t\tthrow error;\n\t}\n}\n/**\n* Copy a list of files into `destDir`, optionally renaming each one.\n*\n* The destination directory is created (with `recursive: true`) if it\n* does not already exist. Each source path is copied byte-for-byte into\n* `destDir/<destName>`; missing sources throw `ENOENT`. The helper is\n* intentionally generic: callers own the list of files and the naming\n* convention for the copies.\n*/\nasync function copyFilesWithRename(destDir, files) {\n\tawait mkdir(destDir, { recursive: true });\n\tfor (const file of files) {\n\t\tif (basename(file.destName) !== file.destName) throw errorInvalidDestName(file.destName);\n\t\tawait copyFile(file.sourcePath, join(destDir, file.destName));\n\t}\n}\nasync function writeMigrationMetadata(dir, metadata) {\n\tawait writeFile(join(dir, MANIFEST_FILE), `${JSON.stringify(metadata, null, 2)}\\n`);\n}\nasync function writeMigrationOps(dir, ops) {\n\tawait writeFile(join(dir, OPS_FILE), `${JSON.stringify(ops, null, 2)}\\n`);\n}\nasync function readMigrationPackage(dir, options) {\n\tconst absoluteDir = resolve(dir);\n\tconst manifestPath = join(absoluteDir, MANIFEST_FILE);\n\tconst opsPath = join(absoluteDir, OPS_FILE);\n\tlet manifestRaw;\n\ttry {\n\t\tmanifestRaw = await readFile(manifestPath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) throw errorMissingFile(MANIFEST_FILE, absoluteDir);\n\t\tthrow error;\n\t}\n\tlet opsRaw;\n\ttry {\n\t\topsRaw = await readFile(opsPath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) throw errorMissingFile(OPS_FILE, absoluteDir);\n\t\tthrow error;\n\t}\n\tlet metadata;\n\ttry {\n\t\tmetadata = JSON.parse(manifestRaw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(manifestPath, e instanceof Error ? e.message : String(e));\n\t}\n\tlet ops;\n\ttry {\n\t\tops = JSON.parse(opsRaw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(opsPath, e instanceof Error ? e.message : String(e));\n\t}\n\tvalidateMetadata(metadata, manifestPath);\n\tvalidateOps(ops, opsPath);\n\tconst derivedInvariants = deriveProvidedInvariants(ops);\n\tif (!arraysEqual(metadata.providedInvariants, derivedInvariants)) throw errorProvidedInvariantsMismatch(manifestPath, metadata.providedInvariants, derivedInvariants);\n\tconst endContractJson = await readContractSnapshotJsonTolerant(options.migrationsDir, metadata.to);\n\tconst pkg = {\n\t\tdirName: basename(absoluteDir),\n\t\tdirPath: absoluteDir,\n\t\tmetadata,\n\t\tops,\n\t\t...ifDefined(\"endContractJson\", endContractJson)\n\t};\n\tconst verification = verifyMigrationHash(pkg);\n\tif (!verification.ok) throw errorMigrationHashMismatch(absoluteDir, verification.storedHash, verification.computedHash);\n\treturn pkg;\n}\n/**\n* Reads a migration package's manifest and ops without running hash or\n* invariants verification. Returns `null` when the files cannot be read or\n* parsed (i.e. when the package is genuinely unloadable).\n*\n* Used by {@link readMigrationsDir} to retain a package whose hash or\n* invariants diverge from what is stored on disk — the raw content is still\n* useful for display / querying; only integrity is in question.\n*/\nasync function readMigrationPackageRaw(dir) {\n\tconst absoluteDir = resolve(dir);\n\tconst manifestPath = join(absoluteDir, MANIFEST_FILE);\n\tconst opsPath = join(absoluteDir, OPS_FILE);\n\tlet manifestRaw;\n\ttry {\n\t\tmanifestRaw = await readFile(manifestPath, \"utf-8\");\n\t} catch {\n\t\treturn null;\n\t}\n\tlet opsRaw;\n\ttry {\n\t\topsRaw = await readFile(opsPath, \"utf-8\");\n\t} catch {\n\t\treturn null;\n\t}\n\tlet metadata;\n\ttry {\n\t\tmetadata = JSON.parse(manifestRaw);\n\t} catch {\n\t\treturn null;\n\t}\n\tlet ops;\n\ttry {\n\t\tops = JSON.parse(opsRaw);\n\t} catch {\n\t\treturn null;\n\t}\n\tif (MigrationMetadataSchema(metadata) instanceof type.errors) return null;\n\tif (MigrationOpsSchema(ops) instanceof type.errors) return null;\n\treturn {\n\t\tdirName: basename(absoluteDir),\n\t\tdirPath: absoluteDir,\n\t\tmetadata,\n\t\tops\n\t};\n}\nfunction arraysEqual(a, b) {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\n\treturn true;\n}\nfunction validateMetadata(metadata, filePath) {\n\tconst result = MigrationMetadataSchema(metadata);\n\tif (result instanceof type.errors) throw errorInvalidManifest(filePath, result.summary);\n}\nfunction validateOps(ops, filePath) {\n\tconst result = MigrationOpsSchema(ops);\n\tif (result instanceof type.errors) throw errorInvalidManifest(filePath, result.summary);\n}\nfunction packageLoadProblemDetailFromError(error) {\n\tif (MigrationToolsError.is(error)) return error.why;\n\tif (error instanceof Error) return error.message;\n\treturn String(error);\n}\nasync function readMigrationsDir(migrationsRoot, options) {\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(migrationsRoot);\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return {\n\t\t\tpackages: [],\n\t\t\tproblems: []\n\t\t};\n\t\tthrow error;\n\t}\n\tconst packages = [];\n\tconst problems = [];\n\tfor (const entry of entries.sort()) {\n\t\tconst entryPath = join(migrationsRoot, entry);\n\t\tif (!(await stat(entryPath)).isDirectory()) continue;\n\t\tconst manifestPath = join(entryPath, MANIFEST_FILE);\n\t\ttry {\n\t\t\tawait stat(manifestPath);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tlet pkg;\n\t\ttry {\n\t\t\tpkg = await readMigrationPackage(entryPath, options);\n\t\t} catch (error) {\n\t\t\tconst dirName = entry;\n\t\t\tif (MigrationToolsError.is(error)) {\n\t\t\t\tif (error.code === \"MIGRATION.HASH_MISMATCH\") {\n\t\t\t\t\tconst meta = error.meta;\n\t\t\t\t\tconst rawPkg = await readMigrationPackageRaw(entryPath);\n\t\t\t\t\tif (rawPkg !== null) packages.push(rawPkg);\n\t\t\t\t\tproblems.push({\n\t\t\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\t\t\tdirName,\n\t\t\t\t\t\tstored: typeof meta?.[\"storedHash\"] === \"string\" ? meta[\"storedHash\"] : \"\",\n\t\t\t\t\t\tcomputed: typeof meta?.[\"computedHash\"] === \"string\" ? meta[\"computedHash\"] : \"\"\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (error.code === \"MIGRATION.PROVIDED_INVARIANTS_MISMATCH\") {\n\t\t\t\t\tconst rawPkg = await readMigrationPackageRaw(entryPath);\n\t\t\t\t\tif (rawPkg !== null) packages.push(rawPkg);\n\t\t\t\t\tproblems.push({\n\t\t\t\t\t\tkind: \"providedInvariantsMismatch\",\n\t\t\t\t\t\tdirName\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tproblems.push({\n\t\t\t\tkind: \"packageUnloadable\",\n\t\t\t\tdirName,\n\t\t\t\tdetail: packageLoadProblemDetailFromError(error)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tpackages.push(pkg);\n\t}\n\treturn {\n\t\tpackages,\n\t\tproblems\n\t};\n}\nfunction formatMigrationDirName(timestamp, slug) {\n\tconst sanitized = slug.toLowerCase().replace(/[^a-z0-9]/g, \"_\").replace(/_+/g, \"_\").replace(/^_|_$/g, \"\");\n\tif (sanitized.length === 0) throw errorInvalidSlug(slug);\n\tconst truncated = sanitized.slice(0, MAX_SLUG_LENGTH);\n\treturn `${timestamp.getUTCFullYear()}${String(timestamp.getUTCMonth() + 1).padStart(2, \"0\")}${String(timestamp.getUTCDate()).padStart(2, \"0\")}T${String(timestamp.getUTCHours()).padStart(2, \"0\")}${String(timestamp.getUTCMinutes()).padStart(2, \"0\")}_${truncated}`;\n}\n//#endregion\nexport { materialiseMigrationPackage as a, writeMigrationMetadata as c, materialiseExtensionMigrationPackageIfMissing as i, writeMigrationOps as l, copyFilesWithRename as n, readMigrationPackage as o, formatMigrationDirName as r, readMigrationsDir as s, MANIFEST_FILE as t, writeMigrationPackage as u };\n\n//# sourceMappingURL=io-DsViRB_O.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,gBAAgB;AACtB,MAAM,WAAW;AACjB,MAAM,kBAAkB;AACxB,SAAS,aAAa,OAAO,MAAM;CAClC,OAAO,iBAAiB,SAAS,MAAM,SAAS;AACjD;AACA,MAAM,0BAA0B,KAAK;CACpC,KAAK;CACL,MAAM;CACN,IAAI;CACJ,eAAe;CACf,oBAAoB;CACpB,WAAW;AACZ,CAAC;AACD,eAAe,sBAAsB,KAAK,UAAU,KAAK;CACxD,MAAM,MAAM,QAAQ,GAAG,GAAG,EAAE,WAAW,KAAK,CAAC;CAC7C,IAAI;EACH,MAAM,MAAM,GAAG;CAChB,SAAS,OAAO;EACf,IAAI,aAAa,OAAO,QAA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;KACD,CAAC;KACD;IACD;GACD;GACA,SAAS,KAAK;IACb,MAAM;IACN;IACA,QAAQ,kCAAkC,KAAK;GAChD,CAAC;GACD;EACD;EACA,SAAS,KAAK,GAAG;CAClB;CACA,OAAO;EACN;EACA;CACD;AACD;AACA,SAAS,uBAAuB,WAAW,MAAM;CAChD,MAAM,YAAY,KAAK,YAAY,CAAC,CAAC,QAAQ,cAAc,GAAG,CAAC,CAAC,QAAQ,OAAO,GAAG,CAAC,CAAC,QAAQ,UAAU,EAAE;CACxG,IAAI,UAAU,WAAW,GAAG,MAAM,iBAAiB,IAAI;CACvD,MAAM,YAAY,UAAU,MAAM,GAAG,eAAe;CACpD,OAAO,GAAG,UAAU,eAAe,IAAI,OAAO,UAAU,YAAY,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI,OAAO,UAAU,WAAW,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,UAAU,YAAY,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI,OAAO,UAAU,cAAc,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG;AAC3P"}
@@ -1,6 +1,6 @@
1
- import { A as errorOperationsNotArray, c as errorDescribeMissingEndContract, s as errorDescribeInvalidMetadata, v as errorInvalidOperationEntry, w as errorMigrationContractViewMissing } from "./errors-CXbGUWGu-CstQHPh6.mjs";
1
+ import { A as errorOperationsNotArray, c as errorDescribeMissingEndContract, s as errorDescribeInvalidMetadata, v as errorInvalidOperationEntry, w as errorMigrationContractViewMissing } from "./errors-CcEpbfnE-CsSXrttT.mjs";
2
2
  import { t as computeMigrationHash } from "./hash-DH8hl5Rq-BpM2t3Nu.mjs";
3
- import { t as deriveProvidedInvariants } from "./invariants-CTHy88OP-CYI2a8IO.mjs";
3
+ import { t as deriveProvidedInvariants } from "./invariants-DcFfhJMZ-BHDWZP9k.mjs";
4
4
  import { t as MigrationOpSchema } from "./op-schema-BSVHzEQN-DIWt28D8.mjs";
5
5
  import { realpathSync } from "node:fs";
6
6
  import { type } from "arktype";
@@ -206,4 +206,4 @@ async function buildMigrationArtifacts(instance, existing) {
206
206
  //#endregion
207
207
  export { isDirectEntrypoint as i, MigrationContractViews as n, buildMigrationArtifacts as r, Migration as t };
208
208
 
209
- //# sourceMappingURL=migration-BB4LDjuS.mjs.map
209
+ //# sourceMappingURL=migration-CWSj4pMr.mjs.map