@prisma/orm-toolchain 8.0.0-rc.24-dev.27 → 8.0.0-rc.24-dev.29

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 (91) hide show
  1. package/README.md +1 -3
  2. package/dist/{aggregate-CRIdmKmq.mjs → aggregate-7sB4u_aJ.mjs} +11 -5
  3. package/dist/aggregate-7sB4u_aJ.mjs.map +1 -0
  4. package/dist/{aggregate-C6PGBKyb.d.mts → aggregate-DgWdbWNs.d.mts} +12 -6
  5. package/dist/{aggregate-C6PGBKyb.d.mts.map → aggregate-DgWdbWNs.d.mts.map} +1 -1
  6. package/dist/{caught-errors-I1l50iPc-D_-F2M3t.mjs → caught-errors-D_pbHqmS-B-4jRN6g.mjs} +52 -11
  7. package/dist/caught-errors-D_pbHqmS-B-4jRN6g.mjs.map +1 -0
  8. package/dist/cli-telemetry.mjs +1 -1
  9. package/dist/cli.d.mts +2 -2
  10. package/dist/cli.mjs +1094 -1012
  11. package/dist/cli.mjs.map +1 -1
  12. package/dist/cli__control-api.d.mts +16 -14
  13. package/dist/cli__control-api.d.mts.map +1 -1
  14. package/dist/cli__control-api.mjs +2 -2
  15. package/dist/cli__control-api__testing.d.mts +1 -1
  16. package/dist/cli__init-contribution.d.mts +101 -0
  17. package/dist/cli__init-contribution.d.mts.map +1 -0
  18. package/dist/cli__init-contribution.mjs +1 -0
  19. package/dist/cli__init-output.d.mts +3 -3
  20. package/dist/cli__init-output.mjs +1 -1
  21. package/dist/cli__migration-cli.mjs +3 -3
  22. package/dist/cli__migration-cli.mjs.map +1 -1
  23. package/dist/config-loader.d.mts +1 -1
  24. package/dist/config-loader.mjs +1 -1
  25. package/dist/{db-sign-Bv-FZMAD-uQhMNCC7.d.mts → db-sign-DLIR5swa-DQ0aN1nU.d.mts} +25 -21
  26. package/dist/db-sign-DLIR5swa-DQ0aN1nU.d.mts.map +1 -0
  27. package/dist/{domain-type-generation-BlYB8GiS-k0HNTf4f.mjs → domain-type-generation-BGcbGgHJ-Cdw5RNaZ.mjs} +11 -12
  28. package/dist/domain-type-generation-BGcbGgHJ-Cdw5RNaZ.mjs.map +1 -0
  29. package/dist/{domain-type-generation-D5cG6TGd-DKLpO6ZA.d.mts → domain-type-generation-BP8J5hy8-CxSjSRCh.d.mts} +6 -5
  30. package/dist/domain-type-generation-BP8J5hy8-CxSjSRCh.d.mts.map +1 -0
  31. package/dist/emitter.d.mts +3 -3
  32. package/dist/emitter.mjs +3 -3
  33. package/dist/emitter__domain-type-generation.d.mts +2 -2
  34. package/dist/emitter__domain-type-generation.mjs +2 -2
  35. package/dist/{exports-RTLU0w9r.mjs → exports-BiXPktAF.mjs} +4 -4
  36. package/dist/{exports-RTLU0w9r.mjs.map → exports-BiXPktAF.mjs.map} +1 -1
  37. package/dist/{exports-CVgs3YWV-BF4rqnxF.mjs → exports-CCuYD8dO-yw1GizAT.mjs} +28 -18
  38. package/dist/exports-CCuYD8dO-yw1GizAT.mjs.map +1 -0
  39. package/dist/{exports-CSVHjfwG.mjs → exports-CZ6dPu-O.mjs} +35 -10
  40. package/dist/exports-CZ6dPu-O.mjs.map +1 -0
  41. package/dist/{index-BHYAWGxJ.d.mts → index-C09OeJjf.d.mts} +7 -12
  42. package/dist/index-C09OeJjf.d.mts.map +1 -0
  43. package/dist/{index-BhNbc269.d.mts → index-C3KtOcBP.d.mts} +3 -1
  44. package/dist/index-C3KtOcBP.d.mts.map +1 -0
  45. package/dist/migration-tools.d.mts +1 -1
  46. package/dist/migration-tools.mjs +3 -3
  47. package/dist/migration-tools__aggregate.d.mts +1 -1
  48. package/dist/migration-tools__aggregate.mjs +1 -1
  49. package/dist/migration-tools__ref-resolution.mjs +1 -1
  50. package/dist/migration-tools__refs.mjs +1 -1
  51. package/dist/{output-BcC8eB0h-C5bRd-aC.mjs → output-E6F4-EMc-CqlzGlv-.mjs} +50 -9
  52. package/dist/output-E6F4-EMc-CqlzGlv-.mjs.map +1 -0
  53. package/dist/{ref-DfuqRCA7-CPPoVHY9.mjs → ref-PQOM_LTC-lyfzb0MO.mjs} +535 -270
  54. package/dist/ref-PQOM_LTC-lyfzb0MO.mjs.map +1 -0
  55. package/dist/{ref-resolution-C9j2SSb6.mjs → ref-resolution-C0xsiRig.mjs} +2 -2
  56. package/dist/{ref-resolution-C9j2SSb6.mjs.map → ref-resolution-C0xsiRig.mjs.map} +1 -1
  57. package/dist/{refs-t_JbIjGo-CRpBRRkq.mjs → refs-t_JbIjGo-BVCqKpXd.mjs} +2 -2
  58. package/dist/{refs-t_JbIjGo-CRpBRRkq.mjs.map → refs-t_JbIjGo-BVCqKpXd.mjs.map} +1 -1
  59. package/dist/vite-plugin-contract-emit.mjs +4 -5
  60. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  61. package/package.json +12 -15
  62. package/dist/aggregate-CRIdmKmq.mjs.map +0 -1
  63. package/dist/caught-errors-I1l50iPc-D_-F2M3t.mjs.map +0 -1
  64. package/dist/db-sign-Bv-FZMAD-uQhMNCC7.d.mts.map +0 -1
  65. package/dist/domain-type-generation-BlYB8GiS-k0HNTf4f.mjs.map +0 -1
  66. package/dist/domain-type-generation-D5cG6TGd-DKLpO6ZA.d.mts.map +0 -1
  67. package/dist/exports-CSVHjfwG.mjs.map +0 -1
  68. package/dist/exports-CVgs3YWV-BF4rqnxF.mjs.map +0 -1
  69. package/dist/import-roots-DlSoi7oS.d.mts +0 -119
  70. package/dist/import-roots-DlSoi7oS.d.mts.map +0 -1
  71. package/dist/import-roots-Dqs1_cn4.mjs +0 -224
  72. package/dist/import-roots-Dqs1_cn4.mjs.map +0 -1
  73. package/dist/index-BHYAWGxJ.d.mts.map +0 -1
  74. package/dist/index-BhNbc269.d.mts.map +0 -1
  75. package/dist/output-BcC8eB0h-C5bRd-aC.mjs.map +0 -1
  76. package/dist/publish-surface.d.mts +0 -3
  77. package/dist/publish-surface.mjs +0 -3
  78. package/dist/publish-surface__import-roots.d.mts +0 -2
  79. package/dist/publish-surface__import-roots.mjs +0 -2
  80. package/dist/publish-surface__shells.d.mts +0 -2
  81. package/dist/publish-surface__shells.mjs +0 -2
  82. package/dist/quick-reference-mongo.md +0 -116
  83. package/dist/quick-reference-postgres.md +0 -95
  84. package/dist/quick-reference-prisma7.md +0 -80
  85. package/dist/readme-mongo.md +0 -35
  86. package/dist/readme-postgres.md +0 -34
  87. package/dist/ref-DfuqRCA7-CPPoVHY9.mjs.map +0 -1
  88. package/dist/shells-BA7YJyPT.mjs +0 -777
  89. package/dist/shells-BA7YJyPT.mjs.map +0 -1
  90. package/dist/shells-D7NNxMLT.d.mts +0 -129
  91. package/dist/shells-D7NNxMLT.d.mts.map +0 -1
@@ -1,14 +1,14 @@
1
- import { E as serializeExecutionType, O as serializeObjectKey, _ as parameterizedOutputTypeFunctionsAlias, a as generateCodecTypeIntersection, c as generateHashTypeAliases, h as generateValueObjectTypeAliases, i as fieldTypesMapExpression, k as serializeValue, l as generateImportLines, m as generateRootsType, n as deduplicateImports, p as generateModelsType, r as emitterError, s as generateFieldTypeOverridesMap, x as renderValueLiteralType } from "./domain-type-generation-BlYB8GiS-k0HNTf4f.mjs";
1
+ import { D as serializeObjectKey, O as serializeValue, T as serializeExecutionType, a as generateCodecTypeIntersection, b as renderValueLiteralType, c as generateHashTypeAliases, f as generateModelsType, g as parameterizedOutputTypeFunctionsAlias, i as fieldTypesMapExpression, k as typesImportRequirements, m as generateValueObjectTypeAliases, n as deduplicateImports, p as generateRootsType, r as emitterError, s as generateFieldTypeOverridesMap } from "./domain-type-generation-BGcbGgHJ-Cdw5RNaZ.mjs";
2
2
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
3
3
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
4
4
  import { blindCast } from "@prisma/orm-framework/utils/casts";
5
5
  import { canonicalizeContractToObject } from "@prisma/orm-framework/contract/hashing";
6
6
  import { valueObjectsWithCoordinates } from "@prisma/orm-framework/contract/types";
7
- import { keepInternalSpecifiers } from "@prisma/orm-framework/components/emission";
8
7
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
8
+ import { renderImports } from "@prisma/orm-framework/ts-render";
9
9
  import { format } from "prettier";
10
10
  import { UNBOUND_PSL_NAMESPACE_NAME } from "@prisma/orm-framework/components/psl-ast";
11
- //#region ../../../1-framework/3-tooling/emitter/dist/exports-CVgs3YWV.mjs
11
+ //#region ../../../1-framework/3-tooling/emitter/dist/exports-CCuYD8dO.mjs
12
12
  const JSON_EXTENSION = ".json";
13
13
  function getEmittedArtifactPaths(outputJsonPath) {
14
14
  if (!outputJsonPath.endsWith(JSON_EXTENSION)) throw emitterError("CONFIG.VALIDATION_FAILED", "Contract output path must end with .json", { meta: {
@@ -244,12 +244,11 @@ function generateEnumMemberTypesBlock(enums, codecLookup) {
244
244
  return `readonly ${serializeObjectKey(name)}: readonly [${memberTupleItems.join(", ")}]`;
245
245
  }).join("; ")} }`;
246
246
  }
247
- function generateContractDts(contract, emitter, codecTypeImports, hashes, options, codecLookup, resolveImportSpecifier = keepInternalSpecifiers) {
247
+ function generateContractDts(contract, emitter, codecTypeImports, hashes, typesModule, options, codecLookup) {
248
248
  const allImports = [...codecTypeImports];
249
249
  if (options?.queryOperationTypeImports) allImports.push(...options.queryOperationTypeImports);
250
250
  if (options?.parameterizedOutputTypeImports) allImports.push(...options.parameterizedOutputTypeImports);
251
251
  const uniqueImports = deduplicateImports(allImports);
252
- const familyImportLines = emitter.getFamilyImports(resolveImportSpecifier);
253
252
  const hashAliases = generateHashTypeAliases(hashes);
254
253
  const codecTypes = generateCodecTypeIntersection(codecTypeImports, "CodecTypes");
255
254
  const familyTypeAliases = emitter.getFamilyTypeAliases(options);
@@ -322,20 +321,31 @@ ${contractWrapper}
322
321
  return `// ⚠️ GENERATED FILE - DO NOT EDIT
323
322
  // This file is automatically generated by 'prisma contract emit'.
324
323
  // To regenerate, run: prisma contract emit
325
- ${generateImportLines(uniqueImports.filter((spec) => mentions(body, spec.alias)), resolveImportSpecifier).join("\n")}
326
-
327
- ${familyImportLines.join("\n")}
328
- import type {
329
- Contract as ContractType,
330
- ExecutionHashBase,
331
- FieldTypesFromDomain,
332
- NamespaceId,
333
- ProfileHashBase,
334
- StorageHashBase,${hasValueObjects ? "\n ValueObjectTypesFromStorage," : ""}
335
- } from '${resolveImportSpecifier("@internal/contract/types")}';
324
+ ${renderImports([
325
+ ...typesImportRequirements(uniqueImports.filter((spec) => mentions(body, spec.alias))),
326
+ ...emitter.getFamilyImports(typesModule),
327
+ ...frameworkImports(typesModule, hasValueObjects)
328
+ ])}
336
329
 
337
330
  ${body}`;
338
331
  }
332
+ function frameworkImports(typesModule, hasValueObjects) {
333
+ const named = (symbol, alias) => ({
334
+ moduleSpecifier: typesModule,
335
+ symbol,
336
+ ...alias === void 0 ? {} : { alias },
337
+ typeOnly: true
338
+ });
339
+ return [
340
+ named("Contract", "ContractType"),
341
+ named("ExecutionHashBase"),
342
+ named("FieldTypesFromDomain"),
343
+ named("NamespaceId"),
344
+ named("ProfileHashBase"),
345
+ named("StorageHashBase"),
346
+ ...hasValueObjects ? [named("ValueObjectTypesFromStorage")] : []
347
+ ];
348
+ }
339
349
  /** Whether `text` uses `identifier` as a whole identifier, not as part of a longer one. */
340
350
  function mentions(text, identifier) {
341
351
  const escaped = identifier.replace(/[$]/g, "\\$");
@@ -396,7 +406,7 @@ async function emit(contract, stack, targetFamily, options) {
396
406
  };
397
407
  return {
398
408
  contractJson: contractJsonString,
399
- contractDts: await format(generateContractDts(options.deserializeContract(canonicalized), targetFamily, codecTypeImports ?? [], contractTypeHashes, generateOptions, stack.codecLookup, options.resolveImportSpecifier ?? keepInternalSpecifiers), {
409
+ contractDts: await format(generateContractDts(options.deserializeContract(canonicalized), targetFamily, codecTypeImports ?? [], contractTypeHashes, options.typesModule, generateOptions, stack.codecLookup), {
400
410
  parser: "typescript",
401
411
  singleQuote: true,
402
412
  semi: true,
@@ -410,4 +420,4 @@ async function emit(contract, stack, targetFamily, options) {
410
420
  //#endregion
411
421
  export { generateContractDts as n, getEmittedArtifactPaths as r, emit as t };
412
422
 
413
- //# sourceMappingURL=exports-CVgs3YWV-BF4rqnxF.mjs.map
423
+ //# sourceMappingURL=exports-CCuYD8dO-yw1GizAT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports-CCuYD8dO-yw1GizAT.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/exports-CCuYD8dO.mjs"],"sourcesContent":["import { D as serializeValue, E as serializeObjectKey, O as typesImportRequirements, d as generateModelsType, f as generateRootsType, h as parameterizedOutputTypeFunctionsAlias, i as generateCodecTypeIntersection, k as emitterError, n as deduplicateImports, o as generateFieldTypeOverridesMap, p as generateValueObjectTypeAliases, r as fieldTypesMapExpression, s as generateHashTypeAliases, w as serializeExecutionType, y as renderValueLiteralType } from \"./domain-type-generation-BGcbGgHJ.mjs\";\nimport { valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { renderImports } from \"@internal/ts-render\";\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\";\nimport { UNBOUND_PSL_NAMESPACE_NAME } from \"@internal/framework-components/psl-ast\";\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/model-types-emission.ts\nconst TYPESCRIPT_IDENTIFIER = /^[$A-Z_a-z][$\\w]*$/;\nfunction namespacedMemberName(namespaceId, modelName) {\n\treturn `${namespaceId === UNBOUND_NAMESPACE_ID ? UNBOUND_PSL_NAMESPACE_NAME : namespaceId}_${modelName}`;\n}\nfunction bareMemberName(_namespaceId, modelName) {\n\treturn modelName;\n}\nfunction claimMemberName(claims, memberName, source) {\n\tif (!TYPESCRIPT_IDENTIFIER.test(memberName)) throw emitterError(\"CONTRACT.MODEL_TYPE_NAME_INVALID\", `Emitted model type name \"${memberName}\" (from ${source}) is not a TypeScript identifier`, {\n\t\twhy: \"Every entry in the emitted Models namespace is declared as `export type <name>`, so the name must be a TypeScript identifier.\",\n\t\tfix: \"Rename the namespace or model so that <namespace>_<Model> contains only letters, digits, `$`, and `_`, and does not start with a digit.\",\n\t\tmeta: {\n\t\t\tmemberName,\n\t\t\tsource\n\t\t}\n\t});\n\tconst existing = claims.get(memberName);\n\tif (existing !== void 0) throw emitterError(\"CONTRACT.MODEL_TYPE_NAME_COLLISION\", `Emitted model type name \"${memberName}\" is produced by both ${existing} and ${source}`, {\n\t\twhy: \"Every entry in the emitted Models namespace needs a distinct name, formed as <namespace>_<Model>.\",\n\t\tfix: \"Rename one of the models or namespaces so the two names differ.\",\n\t\tmeta: {\n\t\t\tmemberName,\n\t\t\tsources: [existing, source]\n\t\t}\n\t});\n\tclaims.set(memberName, source);\n}\nfunction isPolymorphicBase(model) {\n\treturn model.discriminator !== void 0 && model.variants !== void 0;\n}\nfunction findModel(namespaces, ref) {\n\treturn namespaces.find((ns) => ns.namespaceId === ref.namespace)?.models.find((m) => m.modelName === ref.model);\n}\nfunction requireRelationTarget(namespaces, owner, relationName, ref) {\n\tconst target = findModel(namespaces, ref);\n\tif (target !== void 0) return target;\n\tconst ownerSource = `${owner.namespaceId}.${owner.modelName}`;\n\tthrow emitterError(\"CONTRACT.MODEL_RELATION_TARGET_MISSING\", `Relation \"${relationName}\" on ${ownerSource} targets ${ref.namespace}.${ref.model}, which is not in the contract`, {\n\t\twhy: \"A same-space relation must point at a model the contract declares; only cross-space relations may reference models outside it.\",\n\t\tfix: \"Declare the target model in the contract, or mark the relation as cross-space by giving its target a `space`.\",\n\t\tmeta: {\n\t\t\towner: ownerSource,\n\t\t\trelationName,\n\t\t\ttarget: {\n\t\t\t\tnamespaceId: ref.namespace,\n\t\t\t\tmodelName: ref.model\n\t\t\t}\n\t\t}\n\t});\n}\nfunction requireBase(namespaces, variant, base) {\n\tconst found = findModel(namespaces, base);\n\tif (found !== void 0) return found;\n\tconst variantSource = `${variant.namespaceId}.${variant.modelName}`;\n\tconst baseSource = `${base.namespace}.${base.model}`;\n\tthrow emitterError(\"CONTRACT.MODEL_BASE_MISSING\", `Model ${variantSource} names base ${baseSource}, which is not in the contract`, {\n\t\twhy: \"A variant's type is its base's fields plus its own, so the base must be a model the contract declares.\",\n\t\tfix: \"Declare the base model in the contract, or remove `base` from the variant.\",\n\t\tmeta: {\n\t\t\tvariant: variantSource,\n\t\t\tbase: baseSource\n\t\t}\n\t});\n}\nfunction requireVariant(namespaces, base, variantRef) {\n\tconst variant = findModel(namespaces, variantRef);\n\tif (variant !== void 0) return variant;\n\tconst baseSource = `${base.namespaceId}.${base.modelName}`;\n\tconst variantSource = `${variantRef.namespace}.${variantRef.model}`;\n\tthrow emitterError(\"CONTRACT.MODEL_VARIANT_MISSING\", `Polymorphic base ${baseSource} names variant ${variantSource}, which is not in the contract`, {\n\t\twhy: \"The Any<Base> union is the union of the variant model types, so every variant a base declares must be a model in the contract.\",\n\t\tfix: \"Declare the variant model, or remove it from the base's variants.\",\n\t\tmeta: {\n\t\t\tbase: baseSource,\n\t\t\tvariant: variantSource\n\t\t}\n\t});\n}\nfunction collectFieldLines(ref, discriminatorType) {\n\tconst lines = /* @__PURE__ */ new Map();\n\tfor (const fieldName of Object.keys(ref.model.fields)) {\n\t\tconst type = discriminatorType !== void 0 && fieldName === discriminatorType.field ? discriminatorType.type : `FieldOutputTypes[${serializeValue(ref.namespaceId)}][${serializeValue(ref.modelName)}][${serializeValue(fieldName)}]`;\n\t\tlines.set(fieldName, `${serializeObjectKey(fieldName)}: ${type};`);\n\t}\n\treturn lines;\n}\nfunction hasJoin(relation) {\n\treturn \"on\" in relation && relation.on !== void 0;\n}\nfunction relationLine(owner, relationName, relation, index) {\n\tif (relation.to.space !== void 0) return void 0;\n\tconst target = requireRelationTarget(index.namespaces, owner, relationName, relation.to);\n\tconst targetMember = index.memberNameOf(target.namespaceId, isPolymorphicBase(target.model) ? `Any${target.modelName}` : target.modelName);\n\tconst key = serializeObjectKey(relationName);\n\tif (!hasJoin(relation)) return {\n\t\tline: `${key}: ${relation.cardinality === \"1:N\" ? `${targetMember}[]` : targetMember};`,\n\t\thasJoin: false\n\t};\n\tif (relation.cardinality === \"1:N\" || relation.cardinality === \"N:M\") return {\n\t\tline: `${key}: ${targetMember}[];`,\n\t\thasJoin: true\n\t};\n\treturn {\n\t\tline: `${key}: ${relation.nullable ? `${targetMember} | null` : targetMember};`,\n\t\thasJoin: true\n\t};\n}\nfunction collectRelationLines(ref, index) {\n\tconst lines = /* @__PURE__ */ new Map();\n\tfor (const [relationName, relation] of Object.entries(ref.model.relations)) {\n\t\tconst rendered = relationLine(ref, relationName, relation, index);\n\t\tif (rendered !== void 0) lines.set(relationName, rendered);\n\t}\n\treturn lines;\n}\nfunction discriminatorUnion(base) {\n\tconst values = Object.keys(base.variants ?? {}).map((value) => serializeValue(value));\n\treturn values.length > 0 ? values.join(\" | \") : \"never\";\n}\nfunction memberLines(ref, index) {\n\tconst base = ref.model.base !== void 0 ? requireBase(index.namespaces, ref, ref.model.base) : void 0;\n\tif (base !== void 0 && isPolymorphicBase(base.model)) {\n\t\tconst discriminatorField = base.model.discriminator?.field ?? \"\";\n\t\tconst variantValue = Object.entries(base.model.variants ?? {}).find(([, variant]) => variant.namespace === ref.namespaceId && variant.model === ref.modelName)?.[0];\n\t\tconst discriminatorType = {\n\t\t\tfield: discriminatorField,\n\t\t\ttype: variantValue !== void 0 ? serializeValue(variantValue) : discriminatorUnion(base.model)\n\t\t};\n\t\treturn {\n\t\t\tfieldsByName: new Map([...collectFieldLines(base, discriminatorType), ...collectFieldLines(ref, void 0)]),\n\t\t\trelationsByName: new Map([...collectRelationLines(base, index), ...collectRelationLines(ref, index)])\n\t\t};\n\t}\n\treturn {\n\t\tfieldsByName: collectFieldLines(ref, isPolymorphicBase(ref.model) ? {\n\t\t\tfield: ref.model.discriminator?.field ?? \"\",\n\t\t\ttype: discriminatorUnion(ref.model)\n\t\t} : void 0),\n\t\trelationsByName: collectRelationLines(ref, index)\n\t};\n}\nfunction renderMember(memberName, lines, hasOwner) {\n\tconst entries = [...lines.relationsByName];\n\tconst joinlessLines = entries.filter(([, r]) => !r.hasJoin).map(([, r]) => r.line);\n\tconst joinedLines = entries.filter(([, r]) => r.hasJoin).map(([, r]) => r.line);\n\tconst relationNames = entries.filter(([, r]) => r.hasJoin).map(([name]) => name);\n\tconst phantom = relationNames.length > 0 ? relationNames.map((name) => serializeValue(name)).join(\" | \") : \"never\";\n\treturn ` export type ${memberName} = {\\n${[\n\t\t...lines.fieldsByName.values(),\n\t\t...joinlessLines,\n\t\t...joinedLines,\n\t\t...hasOwner ? [] : [`readonly [RelationKeys]?: ${phantom};`]\n\t].map((line) => ` ${line}`).join(\"\\n\")}\\n };`;\n}\nfunction namespaceModelsOf(contract) {\n\treturn Object.entries(contract.domain.namespaces).map(([namespaceId, ns]) => ({\n\t\tnamespaceId,\n\t\tmodels: Object.entries(ns.models).map(([modelName, model]) => ({\n\t\t\tnamespaceId,\n\t\t\tmodelName,\n\t\t\tmodel\n\t\t}))\n\t}));\n}\nfunction generateModelTypesBlock(contract, supportsNamespaces) {\n\tconst memberNameOf = supportsNamespaces ? namespacedMemberName : bareMemberName;\n\tconst namespaces = namespaceModelsOf(contract);\n\tconst index = {\n\t\tnamespaces,\n\t\tmemberNameOf\n\t};\n\tconst claims = /* @__PURE__ */ new Map();\n\tfor (const ns of namespaces) for (const ref of ns.models) claimMemberName(claims, memberNameOf(ns.namespaceId, ref.modelName), `${ns.namespaceId}.${ref.modelName}`);\n\tfor (const ns of namespaces) for (const ref of ns.models) {\n\t\tif (!isPolymorphicBase(ref.model)) continue;\n\t\tclaimMemberName(claims, memberNameOf(ns.namespaceId, `Any${ref.modelName}`), `${ns.namespaceId}.Any<${ref.modelName}>`);\n\t}\n\tconst members = [];\n\tconst constantEntries = [];\n\tfor (const ns of namespaces) {\n\t\tconst keys = [];\n\t\tfor (const ref of ns.models) {\n\t\t\tconst memberName = memberNameOf(ns.namespaceId, ref.modelName);\n\t\t\tmembers.push(renderMember(memberName, memberLines(ref, index), ref.model.owner !== void 0));\n\t\t\tkeys.push(`${serializeObjectKey(ref.modelName)}: Models.${memberName};`);\n\t\t}\n\t\tfor (const ref of ns.models) {\n\t\t\tif (!isPolymorphicBase(ref.model)) continue;\n\t\t\tconst unionName = memberNameOf(ns.namespaceId, `Any${ref.modelName}`);\n\t\t\tconst variantMembers = Object.values(ref.model.variants ?? {}).map((variantRef) => {\n\t\t\t\tconst variant = requireVariant(namespaces, ref, variantRef);\n\t\t\t\treturn memberNameOf(variant.namespaceId, variant.modelName);\n\t\t\t});\n\t\t\tmembers.push(` export type ${unionName} = ${variantMembers.length > 0 ? variantMembers.join(\" | \") : \"never\"};`);\n\t\t\tkeys.push(`${serializeObjectKey(`Any${ref.modelName}`)}: Models.${unionName};`);\n\t\t}\n\t\tif (!supportsNamespaces) {\n\t\t\tconstantEntries.push(...keys.map((key) => ` ${key}`));\n\t\t\tcontinue;\n\t\t}\n\t\tconst nsKey = serializeObjectKey(ns.namespaceId);\n\t\tconst nested = keys.map((key) => ` ${key}`).join(\"\\n\");\n\t\tconstantEntries.push(keys.length > 0 ? ` ${nsKey}: {\\n${nested}\\n };` : ` ${nsKey}: {};`);\n\t}\n\treturn `${members.length > 0 ? `export namespace Models {\\n${members.join(\"\\n\")}\\n}` : \"export namespace Models {}\"}\\n\\n${`export declare const models: {\\n${constantEntries.join(\"\\n\")}\\n};`}`;\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}\n/**\n* Types each enum member as the value a query returns for it: the literal its codec renders for the stored form, or the codec's output type when the codec renders none.\n*/\nfunction generateEnumMemberTypesBlock(enums, codecLookup) {\n\treturn `{ ${Object.entries(enums).map(([name, entry]) => {\n\t\tconst memberTupleItems = entry.members.map((m) => {\n\t\t\tconst valueType = renderValueLiteralType(m.value, entry.codecId, \"output\", codecLookup) ?? `CodecTypes[${serializeValue(entry.codecId)}][\"output\"]`;\n\t\t\treturn `{ readonly name: ${serializeValue(m.name)}; readonly value: ${valueType} }`;\n\t\t});\n\t\treturn `readonly ${serializeObjectKey(name)}: readonly [${memberTupleItems.join(\", \")}]`;\n\t}).join(\"; \")} }`;\n}\nfunction generateContractDts(contract, emitter, codecTypeImports, hashes, typesModule, options, codecLookup) {\n\tconst allImports = [...codecTypeImports];\n\tif (options?.queryOperationTypeImports) allImports.push(...options.queryOperationTypeImports);\n\tif (options?.parameterizedOutputTypeImports) allImports.push(...options.parameterizedOutputTypeImports);\n\tconst uniqueImports = deduplicateImports(allImports);\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 firstNamespaceOfValueObject = /* @__PURE__ */ new Map();\n\tfor (const { coordinate: { namespaceId, entityName: name } } of valueObjectsWithCoordinates(contract.storage)) if (!firstNamespaceOfValueObject.has(name)) firstNamespaceOfValueObject.set(name, namespaceId);\n\tconst valueObjectNamespaces = [...firstNamespaceOfValueObject];\n\tconst hasValueObjects = valueObjectNamespaces.length > 0;\n\tconst valueObjectTypeAliases = generateValueObjectTypeAliases(valueObjectNamespaces);\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 nsEnums = blindCast(ns.enum);\n\t\tconst hasEnums = nsEnums !== void 0 && Object.keys(nsEnums).length > 0;\n\t\treturn [\n\t\t\tnsId,\n\t\t\tnsModelsType,\n\t\t\thasEnums ? generateEnumBlockType(nsEnums) : void 0,\n\t\t\thasEnums ? generateEnumMemberTypesBlock(nsEnums, codecLookup) : void 0\n\t\t];\n\t}).map(([nsId, nsModelsType, nsEnumBlock, nsEnumMemberTypesBlock]) => {\n\t\tconst enumLine = nsEnumBlock !== void 0 ? `\\n readonly enum: ${nsEnumBlock};` : \"\";\n\t\tconst enumMemberTypesLine = nsEnumMemberTypesBlock !== void 0 ? `\\n readonly enumMemberTypes?: ${nsEnumMemberTypesBlock};` : \"\";\n\t\treturn ` readonly ${serializeObjectKey(nsId)}: {\\n readonly models: ${nsModelsType};${enumLine}${enumMemberTypesLine}\\n }`;\n\t}).join(\";\\n\");\n\tconst executionClause = contract.execution !== void 0 ? `\\n readonly execution: ${serializeExecutionType(contract.execution)};` : \"\";\n\tconst fieldTypeOverrides = generateFieldTypeOverridesMap(contract, codecLookup, emitter.resolveStorageValueSet ? (modelName, fieldName, model) => emitter.resolveStorageValueSet?.(modelName, fieldName, model, contract) : void 0);\n\tconst extraTypeExports = emitter.getStorageTypeExports?.(contract, codecLookup);\n\tconst contractWrapper = emitter.getContractWrapper(\"ContractBase\", \"TypeMaps\");\n\tconst modelTypesBlock = generateModelTypesBlock(contract, options?.supportsNamespaces ?? true);\n\tconst body = `${hashAliases}\n\nexport type CodecTypes = ${codecTypes};\n${familyTypeAliases}\n${parameterizedOutputTypeFunctionsAlias(options?.parameterizedOutputTypeImports ?? [])}\n${valueObjectTypeAliases}\ntype FieldTypeOverrides = ${fieldTypeOverrides};\nexport type FieldOutputTypes = ${fieldTypesMapExpression(\"output\")};\nexport type FieldInputTypes = ${fieldTypesMapExpression(\"input\")};\n${extraTypeExports ? `${extraTypeExports}\\n` : \"\"}\n${modelTypesBlock}\n\nexport 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 readonly profileHash: ProfileHash;\n};\n\n${contractWrapper}\n`;\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${renderImports([\n\t\t...typesImportRequirements(uniqueImports.filter((spec) => mentions(body, spec.alias))),\n\t\t...emitter.getFamilyImports(typesModule),\n\t\t...frameworkImports(typesModule, hasValueObjects)\n\t])}\n\n${body}`;\n}\nfunction frameworkImports(typesModule, hasValueObjects) {\n\tconst named = (symbol, alias) => ({\n\t\tmoduleSpecifier: typesModule,\n\t\tsymbol,\n\t\t...alias === void 0 ? {} : { alias },\n\t\ttypeOnly: true\n\t});\n\treturn [\n\t\tnamed(\"Contract\", \"ContractType\"),\n\t\tnamed(\"ExecutionHashBase\"),\n\t\tnamed(\"FieldTypesFromDomain\"),\n\t\tnamed(\"NamespaceId\"),\n\t\tnamed(\"ProfileHashBase\"),\n\t\tnamed(\"StorageHashBase\"),\n\t\t...hasValueObjects ? [named(\"ValueObjectTypesFromStorage\")] : []\n\t];\n}\n/** Whether `text` uses `identifier` as a whole identifier, not as part of a longer one. */\nfunction mentions(text, identifier) {\n\tconst escaped = identifier.replace(/[$]/g, \"\\\\$\");\n\treturn new RegExp(`(?<![\\\\w$])${escaped}(?![\\\\w$])`).test(text);\n}\n//#endregion\n//#region src/require-relation-nullability.ts\n/**\n* The emitter only ever consumes a freshly authored contract, so every same-space to-one relation\n* must already state whether it is nullable. Hydration of an on-disk contract derives a missing\n* flag instead; that path never reaches here.\n*/\nfunction requireToOneRelationNullability(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) for (const [relationName, relation] of Object.entries(model.relations ?? {})) {\n\t\tif (!(\"on\" in relation && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\") && relation.to.space === void 0) || typeof relation.nullable === \"boolean\") continue;\n\t\tthrow emitterError(\"CONTRACT.RELATION_INVALID\", `Relation \"${relationName}\" on model \"${namespaceId}:${modelName}\" is a ${relation.cardinality} relation and must carry a boolean \"nullable\"`, {\n\t\t\twhy: \"contract.d.ts types a to-one relation as nullable or required from this flag, and the authoring surfaces always set it.\",\n\t\t\tfix: \"Author the contract through PSL or the contract builder, which derive the flag from the local fields the relation joins on.\",\n\t\t\tmeta: {\n\t\t\t\tmodelName,\n\t\t\t\trelationName,\n\t\t\t\treason: \"to-one-nullability-missing\"\n\t\t\t}\n\t\t});\n\t}\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\trequireToOneRelationNullability(contract);\n\tconst { codecTypeImports, queryOperationTypeImports, parameterizedOutputTypeImports, 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(\"parameterizedOutputTypeImports\", parameterizedOutputTypeImports),\n\t\t...ifDefined(\"aggregateDescriptors\", aggregateDescriptors),\n\t\t...ifDefined(\"codecDescriptors\", codecDescriptors),\n\t\t...ifDefined(\"supportsNamespaces\", options.supportsNamespaces)\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(options.deserializeContract(canonicalized), targetFamily, codecTypeImports ?? [], contractTypeHashes, options.typesModule, generateOptions, stack.codecLookup), {\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, getEmittedAr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AAQ;CACxC,MAAM,EAAE,kBAAkB,2BAA2B,gCAAgC,sBAAsB,qBAAqB;CAChI,MAAM,EAAE,gBAAgB,SAAS;CACjC,MAAM,gBAAgB,SAAS,WAAW;CAC1C,MAAM,EAAE,gBAAgB;CACxB,MAAM,gBAAgB,6BAA6B,UAAU;EAC5D,eAAe;EACf,mBAAmB,QAAQ;EAC3B,GAAG,UAAU,uBAAuB,QAAQ,mBAAmB;EAC/D,GAAG,UAAU,eAAe,QAAQ,WAAW;CAChD,CAAC;CACD,MAAM,qBAAqB,KAAK,UAAU;EACzC,GAAG;EACH,YAAY;GACX,SAAS;GACT,SAAS;GACT,YAAY;EACb;CACD,GAAG,MAAM,CAAC;CACV,MAAM,kBAAkB;EACvB,GAAG,UAAU,6BAA6B,yBAAyB;EACnE,GAAG,UAAU,kCAAkC,8BAA8B;EAC7E,GAAG,UAAU,wBAAwB,oBAAoB;EACzD,GAAG,UAAU,oBAAoB,gBAAgB;EACjD,GAAG,UAAU,sBAAsB,QAAQ,kBAAkB;CAC9D;CACA,MAAM,qBAAqB;EAC1B;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;CACA,OAAO;EACN,cAAc;EACd,aAAa,MAAM,OAAO,oBAAoB,QAAQ,oBAAoB,aAAa,GAAG,cAAc,oBAAoB,CAAC,GAAG,oBAAoB,QAAQ,aAAa,iBAAiB,MAAM,WAAW,GAAG;GAC7M,QAAQ;GACR,aAAa;GACb,MAAM;GACN,YAAY;EACb,CAAC;EACD;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;AACD"}
@@ -1,13 +1,13 @@
1
- import { r as getEmittedArtifactPaths } from "./exports-CVgs3YWV-BF4rqnxF.mjs";
1
+ import { r as getEmittedArtifactPaths } from "./exports-CCuYD8dO-yw1GizAT.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
4
  import { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from "@prisma/orm-framework/errors/control";
5
+ import { notOk, ok } from "@prisma/orm-framework/utils/result";
5
6
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
6
7
  import { dirname, join, matchesGlob, resolve } from "pathe";
7
8
  import { access } from "node:fs/promises";
8
9
  import { blindCast } from "@prisma/orm-framework/utils/casts";
9
10
  import { realpathSync } from "node:fs";
10
- import { notOk, ok } from "@prisma/orm-framework/utils/result";
11
11
  import { glob, isDynamicPattern } from "tinyglobby";
12
12
  import { pathToFileURL } from "node:url";
13
13
  import { configSchema, defineConfigSection, reference, validateSectionWithSchema } from "@prisma/cli-engine";
@@ -194,14 +194,18 @@ const ormSubsectionsSchema = configSchema({
194
194
  "path",
195
195
  "=",
196
196
  () => "src/prisma/contract.json"
197
- ]
197
+ ],
198
+ "typesModule?": "string"
198
199
  },
199
200
  migrations: [
200
- { dir: [
201
- "path",
202
- "=",
203
- () => "./migrations"
204
- ] },
201
+ {
202
+ dir: [
203
+ "path",
204
+ "=",
205
+ () => "./migrations"
206
+ ],
207
+ "module?": "string"
208
+ },
205
209
  "=",
206
210
  () => ({})
207
211
  ],
@@ -242,6 +246,25 @@ function descriptorRelationshipProblems(config, checked) {
242
246
  }
243
247
  return problems;
244
248
  }
249
+ const NAMING_ADVICE = "Name the module the way a package is imported, or by a `#` import declared in the `imports` of the package that holds the generated files";
250
+ function namesPathOrUrl(specifier) {
251
+ const startsLikePath = /^[./\\]/.test(specifier) || specifier.includes("\\");
252
+ const startsWithSchemeOrDrive = /^[A-Za-z][\w+.-]*:/.test(specifier);
253
+ return startsLikePath || startsWithSchemeOrDrive;
254
+ }
255
+ function moduleNameProblem(member, module) {
256
+ if (module === "") return `Config.${member} is empty. ${NAMING_ADVICE}`;
257
+ if (namesPathOrUrl(module)) return `Config.${member} names the path or URL '${module}': generated files are written into more than one folder, beside the contract and beside each migration, so a path resolves from at most one of them. ${NAMING_ADVICE}`;
258
+ }
259
+ function generatedFileModuleProblems(config) {
260
+ return [[["contract", "typesModule"], config.contract?.typesModule], [["migrations", "module"], config.migrations?.module]].flatMap(([path, module]) => {
261
+ const message = module === void 0 ? void 0 : moduleNameProblem(path.join("."), module);
262
+ return message === void 0 ? [] : [{
263
+ path,
264
+ message
265
+ }];
266
+ });
267
+ }
245
268
  /**
246
269
  * The shape of the `orm` section of `prisma.config.ts`, declared once. The
247
270
  * CLI engine derives validation, the diagnostics naming a bad field and the
@@ -260,7 +283,9 @@ const ormConfigSchema = ormSubsectionsSchema.narrow((config, ctx) => {
260
283
  expected: problem.expected,
261
284
  actual: problem.actual
262
285
  });
263
- return problems.length === 0;
286
+ const modulePaths = generatedFileModuleProblems(config);
287
+ for (const problem of modulePaths) ctx.reject(problem);
288
+ return problems.length === 0 && modulePaths.length === 0;
264
289
  });
265
290
  /**
266
291
  * The section token the ORM's commands declare in `needs.config`. The
@@ -568,4 +593,4 @@ async function loadConfigForFile(filePath) {
568
593
  //#endregion
569
594
  export { validateOrmSection as _, expandContractInputs as a, globContractInputMatching as c, loadConfigFiles as d, loadConfigForFile as f, requireConfigSections as g, ormConfigSection as h, evaluateConfigModule as i, isConfigSection as l, ormConfigSchema as m, ORM_CONFIG_SECTION_NAME as n, exports_exports as o, loadConfigForSections as p, buildLoadedConfig as r, findNearestConfigPathForFile as s, CONFIG_FILENAME as t, loadConfig as u };
570
595
 
571
- //# sourceMappingURL=exports-CSVHjfwG.mjs.map
596
+ //# sourceMappingURL=exports-CZ6dPu-O.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports-CZ6dPu-O.mjs","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { dirname, join, matchesGlob, resolve } from \"pathe\";\nimport { glob, isDynamicPattern } from \"tinyglobby\";\nimport { realpathSync } from \"node:fs\";\nimport { access } from \"node:fs/promises\";\nimport { pathToFileURL } from \"node:url\";\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\";\nimport { configSchema, defineConfigSection, reference, validateSectionWithSchema } from \"@prisma/cli-engine\";\n//#region src/expand-contract-inputs.ts\nconst UNC_PREFIX_RE = /^(?:\\\\\\\\|\\/\\/)/;\nfunction isUncLike(entry) {\n\treturn UNC_PREFIX_RE.test(entry);\n}\nfunction resolveLiteral(entry) {\n\treturn isUncLike(entry) ? entry : resolve(entry);\n}\n/**\n* Glob syntax (tinyglobby, pathe's `matchesGlob`) only understands `/` as a\n* separator and reads a backslash as an escape. Config validation resolves inputs\n* to native absolute paths, so on Windows an authored `./schema/*.prisma`\n* arrives as `C:\\app\\schema\\*.prisma`, where the backslash escapes the\n* wildcard. Convert native separators back to `/` on Windows only, so glob\n* escapes keep working on POSIX.\n*/\nfunction withForwardSlashSeparators(pattern) {\n\treturn process.platform === \"win32\" ? pattern.replaceAll(\"\\\\\", \"/\") : pattern;\n}\n/**\n* The form of `entry` the glob libraries understand, or nothing when `entry`\n* is a literal. A UNC entry on Windows stays a literal: tinyglobby would\n* crawl the share's path on the working directory's drive.\n*/\nfunction globPatternOf(entry) {\n\tif (process.platform === \"win32\" && isUncLike(entry)) return;\n\tconst candidate = withForwardSlashSeparators(entry);\n\treturn isDynamicPattern(candidate) ? candidate : void 0;\n}\n/** pathe's `matchesGlob` uppercases the drive letter of the path it tests, so the pattern's must match. */\nfunction withUppercaseDrive(globPattern) {\n\treturn globPattern.replace(/^[a-z]:/, (drive) => drive.toUpperCase());\n}\n/**\n* Expands a finalized contract source input list into its member file set:\n* absolute, deduped by canonical path, sorted. `patterns` must already be\n* absolute (the `orm` config schema resolves each entry against the config\n* file that wrote it but does not expand it).\n*\n* A wildcard-free entry (per tinyglobby's own magic-character check) passes\n* through verbatim — no globbing, no existence check, no directory\n* expansion — so a literal file, a nonexistent path (its read error\n* surfaces downstream), and a directory (`contract-prisma7`'s adoption\n* surface) all reach the result unchanged. Only entries containing glob\n* magic run through `tinyglobby`, directories-not-auto-expanded and\n* files-only; a glob matching nothing contributes nothing — no diagnostic\n* here.\n*/\nasync function expandContractInputs(patterns) {\n\tif (patterns === void 0 || patterns.length === 0) return [];\n\tconst literals = [];\n\tconst globPatterns = [];\n\tfor (const pattern of patterns) {\n\t\tconst globPattern = globPatternOf(pattern);\n\t\tif (globPattern === void 0) literals.push(pattern);\n\t\telse globPatterns.push(globPattern);\n\t}\n\tconst globMatches = globPatterns.length === 0 ? [] : await glob(globPatterns, {\n\t\tabsolute: true,\n\t\tonlyFiles: true,\n\t\texpandDirectories: false\n\t});\n\tconst canonical = new Set([...literals, ...globMatches].map(resolveLiteral));\n\treturn Array.from(canonical).sort();\n}\n/**\n* The first glob entry of `patterns` that `path` matches, whether or not a\n* file exists at `path`. Both must be absolute.\n*/\nfunction globContractInputMatching(patterns, path) {\n\treturn patterns.find((pattern) => {\n\t\tconst globPattern = globPatternOf(pattern);\n\t\treturn globPattern !== void 0 && matchesGlob(path, withUppercaseDrive(globPattern));\n\t});\n}\n//#endregion\n//#region src/orm-section.ts\n/** The single config section the `orm` command family owns. */\nconst ORM_CONFIG_SECTION_NAME = \"orm\";\nconst CONFIG_SECTIONS = [\n\t\"family\",\n\t\"target\",\n\t\"adapter\",\n\t\"driver\",\n\t\"extensions\",\n\t\"db\",\n\t\"contract\",\n\t\"migrations\",\n\t\"formatter\"\n];\nfunction isConfigSection(value) {\n\treturn CONFIG_SECTIONS.some((section) => section === value);\n}\n/**\n* The fields that identify a control descriptor. Only these are declared: a\n* descriptor is a runtime object the family builds, and its other members\n* (codec tables, the contract serializer, migration hooks) pass through. Each\n* descriptor is declared a reference, so the command receives the object the\n* config file built.\n*/\nconst descriptorFields = {\n\tid: \"string\",\n\tfamilyId: \"string\",\n\tversion: \"string\",\n\tcreate: \"Function\"\n};\nconst targetLikeFields = {\n\t...descriptorFields,\n\ttargetId: \"string\"\n};\n/**\n* The contract source provider: `load` closes over the authored contract,\n* `inputs` are paths the schema resolves against the config file, and\n* `format` names the language the inputs are written in. Other keys a\n* provider carries pass through.\n*/\nconst contractSource = {\n\tload: \"Function\",\n\t\"inputs?\": \"path[]\",\n\tformat: \"'psl' | 'typescript'\",\n\t\"parserOptions?\": {\n\t\t\"+\": \"reject\",\n\t\t\"grammar?\": \"'prisma-7' | 'prisma-8'\"\n\t}\n};\n/** Each subsection's own shape, without the rules that relate subsections to one another. */\nconst ormSubsectionsSchema = configSchema({\n\tfamily: reference(configSchema({\n\t\tkind: \"'family'\",\n\t\t...descriptorFields,\n\t\temission: \"object\"\n\t})),\n\ttarget: reference(configSchema({\n\t\tkind: \"'target'\",\n\t\t...targetLikeFields\n\t})),\n\tadapter: reference(configSchema({\n\t\tkind: \"'adapter'\",\n\t\t...targetLikeFields\n\t})),\n\t\"driver?\": reference(configSchema({\n\t\tkind: \"'driver'\",\n\t\t...targetLikeFields\n\t})),\n\t\"extensions?\": [reference(configSchema({\n\t\tkind: \"'extension'\",\n\t\t...targetLikeFields\n\t})), \"[]\"],\n\t\"db?\": { \"connection?\": reference(configSchema(\"unknown\")) },\n\t\"contract?\": {\n\t\tsource: contractSource,\n\t\toutput: [\n\t\t\t\"path\",\n\t\t\t\"=\",\n\t\t\t() => \"src/prisma/contract.json\"\n\t\t],\n\t\t\"typesModule?\": \"string\"\n\t},\n\tmigrations: [\n\t\t{\n\t\t\tdir: [\n\t\t\t\t\"path\",\n\t\t\t\t\"=\",\n\t\t\t\t() => \"./migrations\"\n\t\t\t],\n\t\t\t\"module?\": \"string\"\n\t\t},\n\t\t\"=\",\n\t\t() => ({})\n\t],\n\t\"formatter?\": {\n\t\t\"indent?\": \"number.integer >= 1 | 'tab'\",\n\t\t\"newline?\": \"'LF' | 'CRLF'\"\n\t}\n});\n/**\n* Every broken rule relating the descriptor subsections: each descriptor\n* shares the family's `familyId`, and each target-bound descriptor shares\n* the target's `targetId`. A rule is checked only when `checked` accepts\n* both subsections it relates, so a loader can check the subsections that\n* validated while others have diagnostics.\n*/\nfunction descriptorRelationshipProblems(config, checked) {\n\tconst family = checked(\"family\") ? config.family : void 0;\n\tconst target = checked(\"target\") ? config.target : void 0;\n\tconst bound = [\n\t\t[[\"target\"], target],\n\t\t[[\"adapter\"], checked(\"adapter\") ? config.adapter : void 0],\n\t\t[[\"driver\"], checked(\"driver\") ? config.driver : void 0],\n\t\t...(checked(\"extensions\") ? config.extensions ?? [] : []).map((extension, index) => [[\"extensions\", index], extension])\n\t];\n\tconst problems = [];\n\tfor (const [path, descriptor] of bound) {\n\t\tif (descriptor === void 0) continue;\n\t\tif (family !== void 0 && descriptor.familyId !== family.familyId) problems.push({\n\t\t\tpath: [...path, \"familyId\"],\n\t\t\texpected: `Config.family.familyId (${family.familyId})`,\n\t\t\tactual: descriptor.familyId\n\t\t});\n\t\tif (target !== void 0 && path[0] !== \"target\" && descriptor.targetId !== target.targetId) problems.push({\n\t\t\tpath: [...path, \"targetId\"],\n\t\t\texpected: `Config.target.targetId (${target.targetId})`,\n\t\t\tactual: descriptor.targetId\n\t\t});\n\t}\n\treturn problems;\n}\nconst NAMING_ADVICE = \"Name the module the way a package is imported, or by a `#` import declared in the `imports` of the package that holds the generated files\";\nfunction namesPathOrUrl(specifier) {\n\tconst startsLikePath = /^[./\\\\]/.test(specifier) || specifier.includes(\"\\\\\");\n\tconst startsWithSchemeOrDrive = /^[A-Za-z][\\w+.-]*:/.test(specifier);\n\treturn startsLikePath || startsWithSchemeOrDrive;\n}\nfunction moduleNameProblem(member, module) {\n\tif (module === \"\") return `Config.${member} is empty. ${NAMING_ADVICE}`;\n\tif (namesPathOrUrl(module)) return `Config.${member} names the path or URL '${module}': generated files are written into more than one folder, beside the contract and beside each migration, so a path resolves from at most one of them. ${NAMING_ADVICE}`;\n}\nfunction generatedFileModuleProblems(config) {\n\treturn [[[\"contract\", \"typesModule\"], config.contract?.typesModule], [[\"migrations\", \"module\"], config.migrations?.module]].flatMap(([path, module]) => {\n\t\tconst message = module === void 0 ? void 0 : moduleNameProblem(path.join(\".\"), module);\n\t\treturn message === void 0 ? [] : [{\n\t\t\tpath,\n\t\t\tmessage\n\t\t}];\n\t});\n}\n/**\n* The shape of the `orm` section of `prisma.config.ts`, declared once. The\n* CLI engine derives validation, the diagnostics naming a bad field and the\n* file to fix, and the resolution of every `path` field against the config\n* file that wrote it (prisma-cli ADR 0005). Relative paths are resolved\n* before any command sees the value, and the value carries `baseDir`.\n*/\nconst ormConfigSchema = ormSubsectionsSchema.narrow((config, ctx) => {\n\tif (\"extensionPacks\" in config) return ctx.reject({\n\t\tpath: [\"extensionPacks\"],\n\t\tmessage: \"Config.extensionPacks is no longer supported; rename it to Config.extensions\"\n\t});\n\tconst problems = descriptorRelationshipProblems(config, () => true);\n\tfor (const problem of problems) ctx.error({\n\t\tpath: [...problem.path],\n\t\texpected: problem.expected,\n\t\tactual: problem.actual\n\t});\n\tconst modulePaths = generatedFileModuleProblems(config);\n\tfor (const problem of modulePaths) ctx.reject(problem);\n\treturn problems.length === 0 && modulePaths.length === 0;\n});\n/**\n* The section token the ORM's commands declare in `needs.config`. The\n* engine validates the merged section with its provenance and hands the\n* handler the value: absolute paths, `migrations.dir` defaulted, `baseDir`\n* recorded.\n*/\nconst ormConfigSection = blindCast(defineConfigSection({\n\tname: \"orm\",\n\tschema: ormConfigSchema\n}));\n/**\n* Validates a raw `orm` section the way the engine does for a command,\n* for the loaders and tools that read the config outside a command run.\n*/\nfunction validateOrmSection(raw, provenance) {\n\treturn blindCast(validateSectionWithSchema(\"orm\", ormConfigSchema, raw, provenance));\n}\n/**\n* Validates the shape of every subsection except `failing`, which comes back\n* as authored. A loader uses it when some subsections have diagnostics, so a\n* caller that reads only the others still gets their paths resolved and\n* defaults applied. The rules relating subsections are not applied here; see\n* {@link descriptorRelationshipProblems}.\n*/\nfunction validateOrmSectionExcept(raw, provenance, failing) {\n\tconst healthy = CONFIG_SECTIONS.filter((section) => !failing.has(section));\n\treturn validateSectionWithSchema(\"orm\", ormSubsectionsSchema.pick(...healthy), raw, provenance);\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 validateLoadedSection(rawConfig, provenance) {\n\tconst validation = validateOrmSection(rawConfig, provenance);\n\tif (!validation.ok) {\n\t\tconst diagnostics = validation.diagnostics.map((diagnostic) => {\n\t\t\tconst field = typeof diagnostic.meta?.[\"field\"] === \"string\" ? diagnostic.meta[\"field\"] : \"\";\n\t\t\tconst section = field.split(\".\")[0] ?? \"\";\n\t\t\treturn errorConfigValidation(field, {\n\t\t\t\twhy: diagnostic.summary,\n\t\t\t\t...isConfigSection(section) ? { section } : {}\n\t\t\t});\n\t\t});\n\t\tconst failing = new Set(diagnostics.map((diagnostic) => String(diagnostic.meta?.[\"section\"] ?? \"\")));\n\t\tconst partial = validateOrmSectionExcept(rawConfig, provenance, failing);\n\t\tconst config = blindCast(partial.ok ? partial.value : rawConfig);\n\t\tif (!partial.ok) return {\n\t\t\tconfig,\n\t\t\tdiagnostics\n\t\t};\n\t\tconst related = descriptorRelationshipProblems(config, (section) => !failing.has(section)).map((problem) => errorConfigValidation(problem.path.join(\".\"), {\n\t\t\twhy: `${problem.path.join(\".\")} must be ${problem.expected} (was ${problem.actual})`,\n\t\t\tsection: String(problem.path[0])\n\t\t}));\n\t\tconst collisions = failing.has(\"contract\") || config.contract === void 0 ? [] : collectArtifactCollisionDiagnostics(config.contract);\n\t\treturn {\n\t\t\tconfig,\n\t\t\tdiagnostics: [\n\t\t\t\t...diagnostics,\n\t\t\t\t...related,\n\t\t\t\t...collisions\n\t\t\t]\n\t\t};\n\t}\n\tconst config = validation.value;\n\tif (config.contract === void 0) return {\n\t\tconfig,\n\t\tdiagnostics: []\n\t};\n\treturn {\n\t\tconfig,\n\t\tdiagnostics: collectArtifactCollisionDiagnostics(config.contract)\n\t};\n}\n/**\n* Validates a raw `orm` section and resolves its paths against `configDir`, the way a loaded config\n* file is. A caller that builds the section in memory gets the same diagnostics as one that wrote\n* it to `prisma.config.ts`.\n*/\nfunction buildLoadedConfig(rawConfig, configDir) {\n\tconst file = join(configDir, CONFIG_FILENAME);\n\treturn validateLoadedSection(rawConfig, {\n\t\tfiles: [file],\n\t\tkeys: Object.fromEntries(Object.keys(rawConfig).map((key) => [key, file]))\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* 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}\n/**\n* Runs c12 against one config path. Every throw out of evaluation becomes a\n* `CONFIG.EVALUATION_FAILED` and a requested path c12 did not resolve to becomes\n* `CONFIG.FILE_NOT_FOUND`, so both loaders report the same failures for the\n* same file.\n*/\nasync function evaluateWithC12(configPath, 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\treturn ok(result);\n}\nconst FILE_FORMAT_KEYS = /* @__PURE__ */ new Set([\"$prismaConfig\", \"extends\"]);\nfunction sectionsOf(exported) {\n\treturn Object.fromEntries(Object.entries(exported).filter(([key]) => !FILE_FORMAT_KEYS.has(key)));\n}\n/**\n* Evaluates `prisma.config.ts` and hands back each file on the chain with its\n* sections as written, plus c12's merge. Failures that prevent evaluation are\n* the Result failure. Nothing is validated or resolved here: the CLI engine\n* validates each section against its schema with the files' provenance, and\n* {@link loadConfig} does the same for the `orm` section outside a command run.\n*/\nasync function loadConfigFiles(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\tconst evaluated = await evaluateWithC12(configPath, cwd);\n\tif (!evaluated.ok) return evaluated;\n\tconst result = evaluated.value;\n\tif (!result.config || Object.keys(result.config).length === 0) return notOk(errorConfigFileNotFound(result.configFile || resolvedConfigPath || configPath));\n\t/* v8 ignore next -- c12 always returns layers for a config it evaluated */\n\tconst layers = result.layers ?? [];\n\tconst layerConfig = layers[0]?.config;\n\tconst engineMarker = isRecord(layerConfig) ? layerConfig[\"$prismaConfig\"] : void 0;\n\tif (engineMarker === void 0)\n /* v8 ignore next -- a config that evaluated always carries its resolved path */\n\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n\tif (engineMarker !== 1)\n /* v8 ignore next -- a config that evaluated always carries its resolved path */\n\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n\t/* v8 ignore next -- @preserve */\n\tconst requested = result.configFile ?? join(configCwd, \"prisma.config.ts\");\n\tconst files = layers.flatMap((layer, index) => isRecord(layer.config) && Object.keys(layer.config).length > 0 ? [{\n\t\tpath: index === 0 ? requested : resolve(configCwd, layer.configFile ?? requested),\n\t\tsections: sectionsOf(layer.config)\n\t}] : []);\n\treturn ok({\n\t\tfiles: files.length === 0 ? [{\n\t\t\tpath: requested,\n\t\t\tsections: sectionsOf(result.config)\n\t\t}] : files,\n\t\tmerged: result.config\n\t});\n}\n/**\n* The raw default export of the module at `configPath`, evaluated exactly as\n* {@link loadConfig} evaluates it and returned without validation or the\n* version-marker check. The caller decides what the export means — a\n* default export without the `$prismaConfig` marker is what an earlier Prisma\n* CLI's config looks like.\n*/\nasync function evaluateConfigModule(configPath, options) {\n\tconst cwd = options?.cwd ?? process.cwd();\n\tconst resolvedConfigPath = resolve(cwd, configPath);\n\tif (!await fileExists(resolvedConfigPath)) return notOk(errorConfigFileNotFound(resolvedConfigPath));\n\tconst evaluated = await evaluateWithC12(resolvedConfigPath, cwd);\n\tif (!evaluated.ok) return evaluated;\n\t/* v8 ignore next -- c12 always returns layers for a config it evaluated */\n\tconst [requestedLayer] = evaluated.value.layers ?? [];\n\treturn ok(requestedLayer?.config);\n}\n/** Which file wrote each top-level key of the `orm` section, nearest file first. */\nfunction ormProvenance(files, merged) {\n\tconst contributors = files.filter((file) => isRecord(file.sections[\"orm\"]));\n\tconst paths = contributors.map((file) => file.path);\n\treturn {\n\t\tfiles: paths,\n\t\tkeys: Object.fromEntries(Object.keys(merged).flatMap((key) => {\n\t\t\tconst file = contributors.find((contributor) => {\n\t\t\t\tconst orm = contributor.sections[\"orm\"];\n\t\t\t\treturn isRecord(orm) && Object.hasOwn(orm, key);\n\t\t\t})?.path ?? paths[0];\n\t\t\treturn file === void 0 ? [] : [[key, file]];\n\t\t}))\n\t};\n}\n/**\n* Loads the Prisma 8 config and validates its `orm` section.\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*/\nasync function loadConfig(configPath, options) {\n\tconst loaded = await loadConfigFiles(configPath, options);\n\tif (!loaded.ok) return loaded;\n\tconst orm = loaded.value.merged[\"orm\"];\n\tif (orm !== void 0 && !isRecord(orm)) return ok({\n\t\tconfig: validateLoadedSection({}, {\n\t\t\tfiles: [],\n\t\t\tkeys: {}\n\t\t}).config,\n\t\tdiagnostics: [errorConfigValidation(\"orm\", { why: `The orm section of ${CONFIG_FILENAME} must be an object` })]\n\t});\n\tconst section = orm ?? {};\n\tconst provenance = ormProvenance(loaded.value.files, section);\n\tconst requested = loaded.value.files[0]?.path;\n\treturn ok(validateLoadedSection(section, provenance.files.length === 0 && requested !== void 0 ? {\n\t\tfiles: [requested],\n\t\tkeys: Object.fromEntries(Object.keys(section).map((key) => [key, requested]))\n\t} : provenance));\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 { CONFIG_FILENAME, ORM_CONFIG_SECTION_NAME, buildLoadedConfig, evaluateConfigModule, expandContractInputs, findNearestConfigPathForFile, globContractInputMatching, isConfigSection, loadConfig, loadConfigFiles, loadConfigForFile, loadConfigForSections, ormConfigSchema, ormConfigSection, requireConfigSections, validateOrmSection };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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orm-framework/contract/hashing";
3
3
  import { Contract } from "@prisma/orm-framework/contract/types";
4
- import { EmissionSpi, GenerateContractTypesOptions, ImportSpecifierResolver, TypesImportSpec } from "@prisma/orm-framework/components/emission";
5
4
  import { AggregateDescriptor } from "@prisma/orm-framework/components/components";
6
5
  import { AnyCodecDescriptor, CodecLookup } from "@prisma/orm-framework/components/codec";
7
- //#region ../../../1-framework/3-tooling/emitter/dist/index-nITR4zko.d.mts
6
+ import { EmissionSpi, GenerateContractTypesOptions, TypesImportSpec } from "@prisma/orm-framework/components/emission";
7
+ //#region ../../../1-framework/3-tooling/emitter/dist/index-yZCaPZuA.d.mts
8
8
  //#region src/artifact-paths.d.ts
9
9
  interface EmittedArtifactPaths {
10
10
  readonly jsonPath: string;
@@ -49,13 +49,8 @@ interface EmitOptions {
49
49
  * `descriptor.contractSerializer.sortStorage` when present.
50
50
  */
51
51
  readonly sortStorage?: StorageSort;
52
- /**
53
- * Rewrites the package names the generated `contract.d.ts` imports from, for
54
- * the import root the consuming application installed. Defaults to leaving
55
- * every specifier as authored, which is what the repository itself needs
56
- * while its own code still imports workspace names.
57
- */
58
- readonly resolveImportSpecifier?: ImportSpecifierResolver;
52
+ /** The module the generated `contract.d.ts` imports the framework's and family's contract types from: the config's `contract.typesModule`. */
53
+ readonly typesModule: string;
59
54
  /**
60
55
  * Threaded from `descriptor.supportsNamespaces`. `false` drops the namespace segment from emitted `Models` member names and the `models` constant.
61
56
  */
@@ -84,7 +79,7 @@ declare function generateContractDts(contract: Contract, emitter: EmissionSpi, c
84
79
  readonly storageHash: string;
85
80
  readonly executionHash?: string;
86
81
  readonly profileHash: string;
87
- }, options?: GenerateContractTypesOptions, codecLookup?: CodecLookup, resolveImportSpecifier?: ImportSpecifierResolver): string;
82
+ }, typesModule: string, options?: GenerateContractTypesOptions, codecLookup?: CodecLookup): string;
88
83
  //#endregion
89
84
  export { emit as a, EmittedArtifactPaths as i, EmitResult as n, generateContractDts as o, EmitStackInput as r, getEmittedArtifactPaths as s, EmitOptions as t };
90
- //# sourceMappingURL=index-BHYAWGxJ.d.mts.map
85
+ //# sourceMappingURL=index-C09OeJjf.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C09OeJjf.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/index-yZCaPZuA.d.mts"],"mappings":";;;;;;;;UAOU;WACC;WACA;;iBAEM,wBAAwB,yBAAyB;;;;;;;;UAQxD;WACC,mBAAmB,cAAc;WACjC,4BAA4B,cAAc;WAC1C,iCAAiC,cAAc;WAC/C,eAAe;WACf,cAAc;WACd,mBAAmB,cAAc;WACjC,uBAAuB,cAAc;;UAEtC;WACC;;;;;;;;;;WAUA,mBAAmB;;;;;WAKnB,sBAAsB;;;;;WAKtB,cAAc;;WAEd;;;;WAIA;;;;;;;WAOA,sBAAsB,MAAM,4BAA4B;;UAEzD;WACC;WACA;WACA;WACA;WACA;;;;iBAIM,KAAK,UAAU,UAAU,OAAO,gBAAgB,cAAc,aAAa,SAAS,cAAc,QAAQ;;;iBAG1G,oBAAoB,UAAU,UAAU,SAAS,aAAa,kBAAkB,cAAc,kBAAkB;WACtH;WACA;WACA;GACR,qBAAqB,UAAU,8BAA8B,cAAc"}
@@ -70,6 +70,7 @@ declare const ormConfigSchema: import("arktype/internal/variants/object.ts").Obj
70
70
  };
71
71
  migrations: import("arktype/internal/attributes.ts").Default<{
72
72
  dir: (In: import("arktype/internal/attributes.ts").Default<string, string>) => import("arktype").Out<string>;
73
+ module?: string;
73
74
  }, {}>;
74
75
  driver?: {
75
76
  targetId: string;
@@ -100,6 +101,7 @@ declare const ormConfigSchema: import("arktype/internal/variants/object.ts").Obj
100
101
  };
101
102
  };
102
103
  output: (In: import("arktype/internal/attributes.ts").Default<string, string>) => import("arktype").Out<string>;
104
+ typesModule?: string;
103
105
  };
104
106
  formatter?: {
105
107
  indent?: number | "tab";
@@ -201,4 +203,4 @@ declare function loadConfigForSections(configPath: string | undefined, sections:
201
203
  declare function loadConfigForFile(filePath: string): Promise<Result<LoadedConfig$1, CliStructuredError>>;
202
204
  //#endregion
203
205
  export { loadConfigForSections as _, LoadedConfig$1 as a, requireConfigSections as b, buildLoadedConfig as c, findNearestConfigPathForFile as d, globContractInputMatching as f, loadConfigForFile as g, loadConfigFiles as h, ConfigSection$1 as i, evaluateConfigModule as l, loadConfig as m, ConfigFile as n, ORM_CONFIG_SECTION_NAME as o, isConfigSection as p, ConfigFiles as r, PrismaConfig$1 as s, CONFIG_FILENAME as t, expandContractInputs as u, ormConfigSchema as v, validateOrmSection as x, ormConfigSection as y };
204
- //# sourceMappingURL=index-BhNbc269.d.mts.map
206
+ //# sourceMappingURL=index-C3KtOcBP.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C3KtOcBP.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAoBiB,qBAAqB,0CAA0C;;;;;iBAK/D,0BAA0B,6BAA6B;;;;cAI1D;;;;;;KAMT;iBACY,gBAAgB,gBAAgB,SAAS;;;;;;;;cAQ5C,+DAA+D;EAC3E;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF,qDAAqD;IACnD,MAAM,6CAA6C,8CAA8C;IACjG;;EAEF;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF;IACE;;EAEF;IACE;MACE,MAAM;MACN;MACA,WAAW,iCAAiC;MAC5C;QACE;;;IAGJ,SAAS,6CAA6C,8CAA8C;IACpG;;EAEF;IACE;IACA;;;EAGF,OAAO,iCAAiC;;;;;;;;cAQ5B,kBAAkB,cAAgB;;;;;iBAK/B,mBAAmB,cAAc,YAAY,oBAAoB,kBAAkB,iBAAiB;;;cAGvG;;;;;;;;UAQJ;WACC,QAAQ;WACR,sBAAsB;;iBAEhB,6BAA6B,mBAAmB;;;;;;iBAMhD,kBAAkB,WAAW,yBAAyB,oBAAoB;;UAEjF;WACC;;WAEA,UAAU,SAAS;;;UAGpB;;WAEC,gBAAgB;;WAEhB,QAAQ,SAAS;;;;;;;;;iBASX,gBAAgB,qBAAqB;WAC3C;IACP,QAAQ,OAAO,aAAa;;;;;;;;iBAQf,qBAAqB,oBAAoB;WAC/C;IACP,QAAQ,gBAAgB;;;;;;;;;;iBAUX,WAAW,qBAAqB;WACtC;IACP,QAAQ,OAAO,gBAAc;;;;;;iBAMhB,sBAAsB,QAAQ,gBAAc,mBAAmB,oBAAkB,OAAO,cAAgB;;;;;;iBAMxG,sBAAsB,gCAAgC,mBAAmB,oBAAkB,QAAQ,OAAO,cAAgB;iBAC1H,kBAAkB,mBAAmB,QAAQ,OAAO,gBAAc"}
@@ -10,7 +10,7 @@ import { _ as isReservedContractRef, a as MigrationRef, c as RefResolutionAmbigu
10
10
  import { a as VerifyContractSpacesResult, i as VerifyContractSpacesInputs, n as SpaceMarkerRecord, o as listContractSpaceDirectories, r as SpaceVerifierViolation, s as verifyContractSpaces, t as ContractSpaceHeadRecord } from "./verify-contract-spaces-DHD3C7sU-DA28bANE.mjs";
11
11
  import { a as materialiseExtensionMigrationPackageIfMissing, c as readMigrationsDir, d as writeMigrationPackage, i as formatMigrationDirName, l as writeMigrationMetadata, n as ReadMigrationsDirResult, o as materialiseMigrationPackage, r as copyFilesWithRename, s as readMigrationPackage, t as PackageLoadProblem, u as writeMigrationOps } from "./io-BzVNzfsY-DE_ev9K6.mjs";
12
12
  import { a as findPathWithDecision, i as findPath, n as detectCycles, o as findPathWithInvariants, r as detectOrphans, s as reconstructGraph, t as PathDecision } from "./migration-graph-D8IuOkZb-pSI7-k4_.mjs";
13
- import { A as allStorageElementsExternal, B as requireHeadRef, C as ResolveRecordedPathInputs, D as VerifierInput, E as VerifierError, F as createAggregateContractSpace, H as spacesInApplyOrder, I as createContractSpaceAggregate, L as loadContractSpaceAggregate, M as collectAggregateNamespaces, N as computeIntegrityViolations, O as VerifierOutput, P as contractHashAtMarker, R as loadProblemToViolation, S as PlannerSuccess, T as SchemaCheckSection, U as verifyMigration, V as resolveRecordedPath, _ as MarkerCheckSection, a as CallerPolicy, b as PlannerInput, c as ContractMarkerRecordLike, d as IntegrityComputationInput, f as IntegrityQueryOptions, g as MarkerCheckResult, h as LoadAggregateInput, i as AppSpacePlanningInputs, j as buildFabricatedMigrationEdge, k as VerifierSuccess, l as ContractSpaceAggregate, m as IntegrityViolation, n as AggregateCurrentDBState, o as ContractAtOptions, p as IntegritySpaceState, r as AggregateMigrationEdgeRef, s as ContractAtResult, t as AggregateContractSpace, u as DeclaredExtensionEntry, v as PerSpacePlan, w as ResolveRecordedPathOutcome, x as PlannerOutput, y as PlannerError, z as planMigration } from "./aggregate-C6PGBKyb.mjs";
13
+ import { A as allStorageElementsExternal, B as requireHeadRef, C as ResolveRecordedPathInputs, D as VerifierInput, E as VerifierError, F as createAggregateContractSpace, H as spacesInApplyOrder, I as createContractSpaceAggregate, L as loadContractSpaceAggregate, M as collectAggregateNamespaces, N as computeIntegrityViolations, O as VerifierOutput, P as contractHashAtMarker, R as loadProblemToViolation, S as PlannerSuccess, T as SchemaCheckSection, U as verifyMigration, V as resolveRecordedPath, _ as MarkerCheckSection, a as CallerPolicy, b as PlannerInput, c as ContractMarkerRecordLike, d as IntegrityComputationInput, f as IntegrityQueryOptions, g as MarkerCheckResult, h as LoadAggregateInput, i as AppSpacePlanningInputs, j as buildFabricatedMigrationEdge, k as VerifierSuccess, l as ContractSpaceAggregate, m as IntegrityViolation, n as AggregateCurrentDBState, o as ContractAtOptions, p as IntegritySpaceState, r as AggregateMigrationEdgeRef, s as ContractAtResult, t as AggregateContractSpace, u as DeclaredExtensionEntry, v as PerSpacePlan, w as ResolveRecordedPathOutcome, x as PlannerOutput, y as PlannerError, z as planMigration } from "./aggregate-DgWdbWNs.mjs";
14
14
  import "./metadata-BtscDay2.mjs";
15
15
  import { t as MigrationPackage } from "./package-N9PPdFV_.mjs";
16
16
  import { a as buildMigrationArtifacts, i as MigrationMeta, n as MigrationArtifacts, o as isDirectEntrypoint, r as MigrationContractViews, t as Migration } from "./migration-Bjz05034.mjs";
@@ -8,10 +8,10 @@ import { a as findPathWithInvariants, i as findPathWithDecision, n as detectOrph
8
8
  import { c as readContractSpaceHeadRef, d as verifyContractSpaces, i as assertValidSpaceId, l as spaceMigrationDirectory, n as RESERVED_SPACE_SUBDIR_NAMES, o as isValidSpaceId, r as SPACE_REFS_DIRNAME, s as listContractSpaceDirectories, t as APP_SPACE_ID, u as spaceRefsDirectory } from "./verify-contract-spaces-BOnqhfQs-BBq5YOKo.mjs";
9
9
  import { a as gatherDiskContractSpaceState, i as emitContractSpaceArtifacts, n as computeExtensionSpaceApplyPath, o as planAllSpaces, r as contractSpaceFromJson, t as assertDescriptorSelfConsistency } from "./spaces-OVZ0QzWJ.mjs";
10
10
  import { n as isGraphNode, r as isInSpaceHistory, t as assertHashIsGraphNode } from "./graph-membership-D7m41lWA-B68g1CRS.mjs";
11
- import { a as readRefs, c as resolveRef, d as validateRefValue, f as writeRef, i as readRef, l as resolveRefsByContractHash, n as advanceRef, r as deleteRef, s as refsByContractHash, t as HEAD_REF_NAME, u as validateRefName } from "./refs-t_JbIjGo-CRpBRRkq.mjs";
12
- import { a as contractHashAtMarker, c as loadContractSpaceAggregate, d as requireHeadRef, f as resolveRecordedPath, i as computeIntegrityViolations, l as loadProblemToViolation, m as verifyMigration, n as buildFabricatedMigrationEdge, o as createAggregateContractSpace, p as spacesInApplyOrder, r as collectAggregateNamespaces, s as createContractSpaceAggregate, t as allStorageElementsExternal, u as planMigration } from "./aggregate-CRIdmKmq.mjs";
11
+ import { a as readRefs, c as resolveRef, d as validateRefValue, f as writeRef, i as readRef, l as resolveRefsByContractHash, n as advanceRef, r as deleteRef, s as refsByContractHash, t as HEAD_REF_NAME, u as validateRefName } from "./refs-t_JbIjGo-BVCqKpXd.mjs";
12
+ import { a as contractHashAtMarker, c as loadContractSpaceAggregate, d as requireHeadRef, f as resolveRecordedPath, i as computeIntegrityViolations, l as loadProblemToViolation, m as verifyMigration, n as buildFabricatedMigrationEdge, o as createAggregateContractSpace, p as spacesInApplyOrder, r as collectAggregateNamespaces, s as createContractSpaceAggregate, t as allStorageElementsExternal, u as planMigration } from "./aggregate-7sB4u_aJ.mjs";
13
13
  import { a as writeMigrationTs, i as shebangLineFor, n as formatMigrationTs, r as hasMigrationTs, t as detectScaffoldRuntime } from "./migration-ts-DDgjsR1O.mjs";
14
- import { a as findEdgeByDirName, c as parseContractRef, i as WORKING_CONTRACT_REF, l as parseMigrationRef, n as LIVE_MARKER_REF, o as isLiveMarkerRef, r as RESERVED_CONTRACT_REFS, s as isReservedContractRef, t as EMPTY_CONTRACT_REF } from "./ref-resolution-C9j2SSb6.mjs";
14
+ import { a as findEdgeByDirName, c as parseContractRef, i as WORKING_CONTRACT_REF, l as parseMigrationRef, n as LIVE_MARKER_REF, o as isLiveMarkerRef, r as RESERVED_CONTRACT_REFS, s as isReservedContractRef, t as EMPTY_CONTRACT_REF } from "./ref-resolution-C0xsiRig.mjs";
15
15
  import { i as isDirectEntrypoint, n as MigrationContractViews, r as buildMigrationArtifacts, t as Migration } from "./migration-DTmtOJ0n.mjs";
16
16
  import { t as ledgerOriginFromStored } from "./ledger-origin-D7PN4Fon.mjs";
17
17
  export { APP_SPACE_ID, EMPTY_CONTRACT_HASH, EMPTY_CONTRACT_REF, HEAD_REF_NAME, LIVE_MARKER_REF, Migration, MigrationContractViews, MigrationToolsError, RESERVED_CONTRACT_REFS, RESERVED_SPACE_SUBDIR_NAMES, SPACE_REFS_DIRNAME, WORKING_CONTRACT_REF, advanceRef, allStorageElementsExternal, assertDescriptorSelfConsistency, assertHashIsGraphNode, assertValidSpaceId, buildFabricatedMigrationEdge, buildMigrationArtifacts, collectAggregateNamespaces, computeExtensionSpaceApplyPath, computeIntegrityViolations, computeMigrationHash, contractHashAtMarker, contractSnapshotDir, contractSnapshotFiles, contractSpaceFromJson, copyFilesWithRename, createAggregateContractSpace, createContractSpaceAggregate, createSnapshotContentVerifier, deleteRef, deriveProvidedInvariants, detectCycles, detectOrphans, detectScaffoldRuntime, emitContractSpaceArtifacts, errorContractDeserializationFailed, errorContractSnapshotHashMismatch, errorContractSnapshotMissing, errorDescriptorHeadHashMismatch, errorInvalidJson, errorInvalidRefFile, errorInvalidRefName, errorNoInvariantPath, errorUnknownInvariant, findEdgeByDirName, findPath, findPathWithDecision, findPathWithInvariants, formatMigrationDirName, formatMigrationTs, gatherDiskContractSpaceState, hasMigrationTs, isDirectEntrypoint, isGraphNode, isInSpaceHistory, isLiveMarkerRef, isReservedContractRef, isValidSpaceId, ledgerOriginFromStored, listContractSpaceDirectories, loadContractSpaceAggregate, loadProblemToViolation, materialiseExtensionMigrationPackageIfMissing, materialiseMigrationPackage, parseContractRef, parseMigrationRef, planAllSpaces, planMigration, readContractSnapshotJson, readContractSnapshotJsonTolerant, readContractSpaceHeadRef, readMigrationPackage, readMigrationsDir, readRef, readRefs, reconstructGraph, refsByContractHash, requireHeadRef, resolveRecordedPath, resolveRef, resolveRefsByContractHash, shebangLineFor, singleLineDeclarations, snapshotsImportPathFrom, spaceMigrationDirectory, spaceRefsDirectory, spacesInApplyOrder, validateInvariantId, validateRefName, validateRefValue, verifyContractSpaces, verifyMigration, verifyMigrationHash, writeContractSnapshot, writeMigrationMetadata, writeMigrationOps, writeMigrationPackage, writeMigrationTs, writeRef };
@@ -1,2 +1,2 @@
1
- import { A as allStorageElementsExternal, B as requireHeadRef, C as ResolveRecordedPathInputs, D as VerifierInput, E as VerifierError, F as createAggregateContractSpace, H as spacesInApplyOrder, I as createContractSpaceAggregate, L as loadContractSpaceAggregate, M as collectAggregateNamespaces, N as computeIntegrityViolations, O as VerifierOutput, P as contractHashAtMarker, R as loadProblemToViolation, S as PlannerSuccess, T as SchemaCheckSection, U as verifyMigration, V as resolveRecordedPath, _ as MarkerCheckSection, a as CallerPolicy, b as PlannerInput, c as ContractMarkerRecordLike, d as IntegrityComputationInput, f as IntegrityQueryOptions, g as MarkerCheckResult, h as LoadAggregateInput, i as AppSpacePlanningInputs, j as buildFabricatedMigrationEdge, k as VerifierSuccess, l as ContractSpaceAggregate, m as IntegrityViolation, n as AggregateCurrentDBState, o as ContractAtOptions, p as IntegritySpaceState, r as AggregateMigrationEdgeRef, s as ContractAtResult, t as AggregateContractSpace, u as DeclaredExtensionEntry, v as PerSpacePlan, w as ResolveRecordedPathOutcome, x as PlannerOutput, y as PlannerError, z as planMigration } from "./aggregate-C6PGBKyb.mjs";
1
+ import { A as allStorageElementsExternal, B as requireHeadRef, C as ResolveRecordedPathInputs, D as VerifierInput, E as VerifierError, F as createAggregateContractSpace, H as spacesInApplyOrder, I as createContractSpaceAggregate, L as loadContractSpaceAggregate, M as collectAggregateNamespaces, N as computeIntegrityViolations, O as VerifierOutput, P as contractHashAtMarker, R as loadProblemToViolation, S as PlannerSuccess, T as SchemaCheckSection, U as verifyMigration, V as resolveRecordedPath, _ as MarkerCheckSection, a as CallerPolicy, b as PlannerInput, c as ContractMarkerRecordLike, d as IntegrityComputationInput, f as IntegrityQueryOptions, g as MarkerCheckResult, h as LoadAggregateInput, i as AppSpacePlanningInputs, j as buildFabricatedMigrationEdge, k as VerifierSuccess, l as ContractSpaceAggregate, m as IntegrityViolation, n as AggregateCurrentDBState, o as ContractAtOptions, p as IntegritySpaceState, r as AggregateMigrationEdgeRef, s as ContractAtResult, t as AggregateContractSpace, u as DeclaredExtensionEntry, v as PerSpacePlan, w as ResolveRecordedPathOutcome, x as PlannerOutput, y as PlannerError, z as planMigration } from "./aggregate-DgWdbWNs.mjs";
2
2
  export { type AggregateContractSpace, type AggregateCurrentDBState, type AggregateMigrationEdgeRef, type AppSpacePlanningInputs, type CallerPolicy, type ContractAtOptions, type ContractAtResult, type ContractMarkerRecordLike, type ContractSpaceAggregate, type DeclaredExtensionEntry, type IntegrityComputationInput, type IntegrityQueryOptions, type IntegritySpaceState, type IntegrityViolation, type LoadAggregateInput, type MarkerCheckResult, type MarkerCheckSection, type PerSpacePlan, type PlannerError, type PlannerInput, type PlannerOutput, type PlannerSuccess, type ResolveRecordedPathInputs, type ResolveRecordedPathOutcome, type SchemaCheckSection, type VerifierError, type VerifierInput, type VerifierOutput, type VerifierSuccess, allStorageElementsExternal, buildFabricatedMigrationEdge, collectAggregateNamespaces, computeIntegrityViolations, contractHashAtMarker, createAggregateContractSpace, createContractSpaceAggregate, loadContractSpaceAggregate, loadProblemToViolation, planMigration, requireHeadRef, resolveRecordedPath, spacesInApplyOrder, verifyMigration };
@@ -1,2 +1,2 @@
1
- import { a as contractHashAtMarker, c as loadContractSpaceAggregate, d as requireHeadRef, f as resolveRecordedPath, i as computeIntegrityViolations, l as loadProblemToViolation, m as verifyMigration, n as buildFabricatedMigrationEdge, o as createAggregateContractSpace, p as spacesInApplyOrder, r as collectAggregateNamespaces, s as createContractSpaceAggregate, t as allStorageElementsExternal, u as planMigration } from "./aggregate-CRIdmKmq.mjs";
1
+ import { a as contractHashAtMarker, c as loadContractSpaceAggregate, d as requireHeadRef, f as resolveRecordedPath, i as computeIntegrityViolations, l as loadProblemToViolation, m as verifyMigration, n as buildFabricatedMigrationEdge, o as createAggregateContractSpace, p as spacesInApplyOrder, r as collectAggregateNamespaces, s as createContractSpaceAggregate, t as allStorageElementsExternal, u as planMigration } from "./aggregate-7sB4u_aJ.mjs";
2
2
  export { allStorageElementsExternal, buildFabricatedMigrationEdge, collectAggregateNamespaces, computeIntegrityViolations, contractHashAtMarker, createAggregateContractSpace, createContractSpaceAggregate, loadContractSpaceAggregate, loadProblemToViolation, planMigration, requireHeadRef, resolveRecordedPath, spacesInApplyOrder, verifyMigration };
@@ -1,2 +1,2 @@
1
- import { a as findEdgeByDirName, c as parseContractRef, i as WORKING_CONTRACT_REF, l as parseMigrationRef, n as LIVE_MARKER_REF, o as isLiveMarkerRef, r as RESERVED_CONTRACT_REFS, s as isReservedContractRef, t as EMPTY_CONTRACT_REF } from "./ref-resolution-C9j2SSb6.mjs";
1
+ import { a as findEdgeByDirName, c as parseContractRef, i as WORKING_CONTRACT_REF, l as parseMigrationRef, n as LIVE_MARKER_REF, o as isLiveMarkerRef, r as RESERVED_CONTRACT_REFS, s as isReservedContractRef, t as EMPTY_CONTRACT_REF } from "./ref-resolution-C0xsiRig.mjs";
2
2
  export { EMPTY_CONTRACT_REF, LIVE_MARKER_REF, RESERVED_CONTRACT_REFS, WORKING_CONTRACT_REF, findEdgeByDirName, isLiveMarkerRef, isReservedContractRef, parseContractRef, parseMigrationRef };
@@ -1,2 +1,2 @@
1
- import { a as readRefs, c as resolveRef, d as validateRefValue, f as writeRef, i as readRef, l as resolveRefsByContractHash, n as advanceRef, r as deleteRef, s as refsByContractHash, t as HEAD_REF_NAME, u as validateRefName } from "./refs-t_JbIjGo-CRpBRRkq.mjs";
1
+ import { a as readRefs, c as resolveRef, d as validateRefValue, f as writeRef, i as readRef, l as resolveRefsByContractHash, n as advanceRef, r as deleteRef, s as refsByContractHash, t as HEAD_REF_NAME, u as validateRefName } from "./refs-t_JbIjGo-BVCqKpXd.mjs";
2
2
  export { HEAD_REF_NAME, advanceRef, deleteRef, readRef, readRefs, refsByContractHash, resolveRef, resolveRefsByContractHash, validateRefName, validateRefValue, writeRef };
@@ -1,13 +1,53 @@
1
1
  import { type } from "arktype";
2
- //#region ../../../1-framework/3-tooling/cli/dist/output-BcC8eB0h.mjs
2
+ //#region ../../../1-framework/3-tooling/cli/dist/output-E6F4-EMc.mjs
3
+ const KNOWN_TARGET_PACKAGES = [{
4
+ shortName: "postgres",
5
+ aliases: ["postgresql"],
6
+ packageName: "@prisma/orm-postgres",
7
+ workspacePackageName: "@internal/postgres",
8
+ label: "PostgreSQL",
9
+ provider: {
10
+ name: "postgresql",
11
+ writtenBy: 7
12
+ },
13
+ peerPackages: ["pg"]
14
+ }, {
15
+ shortName: "mongodb",
16
+ aliases: ["mongo"],
17
+ packageName: "@prisma/orm-mongo",
18
+ workspacePackageName: "@internal/mongo",
19
+ label: "MongoDB",
20
+ provider: {
21
+ name: "mongodb",
22
+ writtenBy: 6
23
+ },
24
+ peerPackages: ["mongodb"]
25
+ }];
26
+ const TARGET_SHORT_NAMES = KNOWN_TARGET_PACKAGES.map((entry) => entry.shortName);
27
+ /** The entry `--target` names by its short name or an alias, in any case. */
28
+ function findTargetByName(value) {
29
+ const name = value.toLowerCase();
30
+ return KNOWN_TARGET_PACKAGES.find((entry) => entry.shortName === name || entry.aliases.some((alias) => alias === name));
31
+ }
32
+ /**
33
+ * The entry a `datasource` provider names, matched exactly: the provider itself, or the short
34
+ * name or an alias.
35
+ */
36
+ function findTargetByProvider(provider) {
37
+ return KNOWN_TARGET_PACKAGES.find((entry) => entry.provider.name === provider || entry.shortName === provider || entry.aliases.some((alias) => alias === provider));
38
+ }
39
+ /** The entry whose provider only Prisma 6 and earlier wrote; such a schema is a Prisma 6 schema. */
40
+ function findPrisma6OnlyTarget(provider) {
41
+ return KNOWN_TARGET_PACKAGES.find((entry) => entry.provider.writtenBy === 6 && entry.provider.name === provider);
42
+ }
3
43
  /**
4
44
  * arktype schema for the structured success document `init --json` writes
5
45
  * to stdout (FR1.5). The same shape backs the human-readable outro
6
46
  * renderer (FR10), so the two output modes carry identical information.
7
47
  *
8
- * `target` is normalised to the user-facing flag value (`mongodb` rather
9
- * than the internal `mongo`) so consumers can round-trip the document
10
- * straight into a follow-up `--target` invocation.
48
+ * `target` is the short name of the target package, the value `--target`
49
+ * takes, so consumers can round-trip the document straight into a
50
+ * follow-up `--target` invocation.
11
51
  *
12
52
  * The `ok: true` literal is the documented success/error discriminator —
13
53
  * see [Style Guide § JSON Semantics](../../../../../../../docs/CLI%20Style%20Guide.md#json-semantics).
@@ -16,7 +56,7 @@ import { type } from "arktype";
16
56
  */
17
57
  const InitOutputSchema = type({
18
58
  ok: "true",
19
- target: "'postgres'|'mongodb'",
59
+ target: type.enumerated(...TARGET_SHORT_NAMES),
20
60
  /** `prisma7` when an existing Prisma 7 schema is the contract source. */
21
61
  authoring: "'psl'|'typescript'|'prisma7'",
22
62
  /** The starter schema init wrote, or the Prisma 7 schema it points the config at. */
@@ -38,8 +78,9 @@ const InitOutputSchema = type({
38
78
  * What became of the dependency install. `skipped` is the deliberate
39
79
  * `--skip-install`; `failed` is an install that ran and did not succeed,
40
80
  * which leaves a scaffolded project that cannot run yet. `deps` and
41
- * `devDeps` list what was installed, so both non-`installed` states
42
- * carry them empty.
81
+ * `devDeps` list what was installed: under `skipped`, and under a `failed`
82
+ * first install, both are empty; when a later install fails, `deps` holds
83
+ * what the first install, before the questions, put in place.
43
84
  */
44
85
  packagesInstalled: {
45
86
  status: "'installed'|'skipped'|'failed'",
@@ -124,6 +165,6 @@ function pushPrisma7Steps(push, options) {
124
165
  push(AGENT_SKILLS_STEP);
125
166
  }
126
167
  //#endregion
127
- export { PRISMA7_QUICK_REFERENCE_STEP as a, PRISMA7_LOOP_STEP as i, InitOutputSchema as n, buildNextSteps as o, NEXT_STEPS_BEFORE_SCAFFOLD as r, DB_SIGN_STEP as t };
168
+ export { PRISMA7_LOOP_STEP as a, buildNextSteps as c, findTargetByProvider as d, NEXT_STEPS_BEFORE_SCAFFOLD as i, findPrisma6OnlyTarget as l, InitOutputSchema as n, PRISMA7_QUICK_REFERENCE_STEP as o, KNOWN_TARGET_PACKAGES as r, TARGET_SHORT_NAMES as s, DB_SIGN_STEP as t, findTargetByName as u };
128
169
 
129
- //# sourceMappingURL=output-BcC8eB0h-C5bRd-aC.mjs.map
170
+ //# sourceMappingURL=output-E6F4-EMc-CqlzGlv-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-E6F4-EMc-CqlzGlv-.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/output-E6F4-EMc.mjs"],"sourcesContent":["import { type } from \"arktype\";\n//#region src/commands/init/target-packages.ts\nconst KNOWN_TARGET_PACKAGES = [{\n\tshortName: \"postgres\",\n\taliases: [\"postgresql\"],\n\tpackageName: \"@prisma/orm-postgres\",\n\tworkspacePackageName: \"@internal/postgres\",\n\tlabel: \"PostgreSQL\",\n\tprovider: {\n\t\tname: \"postgresql\",\n\t\twrittenBy: 7\n\t},\n\tpeerPackages: [\"pg\"]\n}, {\n\tshortName: \"mongodb\",\n\taliases: [\"mongo\"],\n\tpackageName: \"@prisma/orm-mongo\",\n\tworkspacePackageName: \"@internal/mongo\",\n\tlabel: \"MongoDB\",\n\tprovider: {\n\t\tname: \"mongodb\",\n\t\twrittenBy: 6\n\t},\n\tpeerPackages: [\"mongodb\"]\n}];\nconst TARGET_SHORT_NAMES = KNOWN_TARGET_PACKAGES.map((entry) => entry.shortName);\n/** The entry `--target` names by its short name or an alias, in any case. */\nfunction findTargetByName(value) {\n\tconst name = value.toLowerCase();\n\treturn KNOWN_TARGET_PACKAGES.find((entry) => entry.shortName === name || entry.aliases.some((alias) => alias === name));\n}\n/**\n* The entry a `datasource` provider names, matched exactly: the provider itself, or the short\n* name or an alias.\n*/\nfunction findTargetByProvider(provider) {\n\treturn KNOWN_TARGET_PACKAGES.find((entry) => entry.provider.name === provider || entry.shortName === provider || entry.aliases.some((alias) => alias === provider));\n}\n/** The entry whose provider only Prisma 6 and earlier wrote; such a schema is a Prisma 6 schema. */\nfunction findPrisma6OnlyTarget(provider) {\n\treturn KNOWN_TARGET_PACKAGES.find((entry) => entry.provider.writtenBy === 6 && entry.provider.name === provider);\n}\n//#endregion\n//#region src/commands/init/output.ts\n/**\n* arktype schema for the structured success document `init --json` writes\n* to stdout (FR1.5). The same shape backs the human-readable outro\n* renderer (FR10), so the two output modes carry identical information.\n*\n* `target` is the short name of the target package, the value `--target`\n* takes, so consumers can round-trip the document straight into a\n* follow-up `--target` invocation.\n*\n* The `ok: true` literal is the documented success/error discriminator —\n* see [Style Guide § JSON Semantics](../../../../../../../docs/CLI%20Style%20Guide.md#json-semantics).\n* Error envelopes (`CliErrorEnvelope`) carry `ok: false` so consumers can\n* branch with `if (doc.ok)` without inspecting the rest of the structure.\n*/\nconst InitOutputSchema = type({\n\tok: \"true\",\n\ttarget: type.enumerated(...TARGET_SHORT_NAMES),\n\t/** `prisma7` when an existing Prisma 7 schema is the contract source. */\n\tauthoring: \"'psl'|'typescript'|'prisma7'\",\n\t/** The starter schema init wrote, or the Prisma 7 schema it points the config at. */\n\tschemaPath: \"string\",\n\tfilesWritten: \"string[]\",\n\t/**\n\t* FR9.1 — paths removed from disk during this run: contract artifacts\n\t* (`contract.json`, `contract.d.ts`, `ops.json`, `migration.json`) an\n\t* earlier run left behind, which only a re-init has, and the retired\n\t* agent-skill directories, which every run removes when it finds them.\n\t*/\n\tfilesDeleted: \"string[]\",\n\t/** The Prisma 7 config moved out of Prisma 8's way; empty on a normal run. */\n\tfilesRenamed: type({\n\t\tfrom: \"string\",\n\t\tto: \"string\"\n\t}).array(),\n\t/**\n\t* What became of the dependency install. `skipped` is the deliberate\n\t* `--skip-install`; `failed` is an install that ran and did not succeed,\n\t* which leaves a scaffolded project that cannot run yet. `deps` and\n\t* `devDeps` list what was installed: under `skipped`, and under a `failed`\n\t* first install, both are empty; when a later install fails, `deps` holds\n\t* what the first install, before the questions, put in place.\n\t*/\n\tpackagesInstalled: {\n\t\tstatus: \"'installed'|'skipped'|'failed'\",\n\t\tdeps: \"string[]\",\n\t\tdevDeps: \"string[]\"\n\t},\n\tcontractEmitted: \"boolean\",\n\t/**\n\t* What the Prisma 7 path did beyond a normal run: the schema adopted, the\n\t* config renamed (or `null` when it was already `prisma7.config.*`), the\n\t* `package.json` scripts now invoking `prisma7`, and the Prisma 7 package\n\t* specs installed or listed to install. `null` on a normal run.\n\t*/\n\tprisma7: type({\n\t\tschemaPath: \"string\",\n\t\tconfigRenamedTo: \"string | null\",\n\t\tscriptsRewritten: \"string[]\",\n\t\tpackagesMoved: \"string[]\"\n\t}).or(\"null\"),\n\tnextSteps: \"string[]\",\n\twarnings: \"string[]\"\n});\n/**\n* Builds the `nextSteps` array from the resolved scaffold state. Steps are\n* ordered by the workflow a user needs to follow: install what is missing →\n* configure connection → (emit if not yet done) → run a starter query →\n* docs / agent skill.\n*\n* The strings are stable and human-readable; agents wanting to act on them\n* should match on substrings (e.g. \"DATABASE_URL\") rather than exact text,\n* since copy may evolve.\n*/\nfunction buildNextSteps(options) {\n\tconst steps = [];\n\tlet stepNumber = 1;\n\tconst push = (text) => {\n\t\tsteps.push(`${stepNumber}. ${text}`);\n\t\tstepNumber += 1;\n\t};\n\tif (options.prisma7 !== null) {\n\t\tpushPrisma7Steps(push, {\n\t\t\t...options,\n\t\t\tprisma7: options.prisma7\n\t\t});\n\t\treturn steps;\n\t}\n\tif (options.packagesInstalled === \"failed\") push(\"Install the project dependencies with your package manager — the install this run attempted failed, so nothing else here will work yet.\");\n\tif (options.packagesInstalled === \"skipped\") push(\"Install the project dependencies with your package manager (this run skipped them).\");\n\tpush(\"Set DATABASE_URL in your environment (export it or add it to .env).\");\n\tif (!options.contractEmitted) {\n\t\tpush(`Emit the contract: \\`${options.emitCommand}\\``);\n\t\tpush(`Edit your schema at ${options.schemaPath}, then re-run the emit command.`);\n\t} else push(`Edit your schema at ${options.schemaPath}, then re-run \\`${options.emitCommand}\\`.`);\n\tpush(\"Open prisma-8.md for a quick reference on how to write your first typed query.\");\n\tpush(\"Working with a coding agent? Run `prisma init` in this project to set up the Prisma agent skills.\");\n\treturn steps;\n}\n/** The install that precedes the Prisma 7 check failed, so nothing was written. */\nconst NEXT_STEPS_BEFORE_SCAFFOLD = [\"1. Install the project dependencies with your package manager. The install this run attempted failed before anything was written.\", \"2. Run `prisma orm init` again.\"];\nconst DB_SIGN_STEP = \"Adopt your existing database: `prisma db sign` verifies it against the contract and records the signing marker and the `db` ref. It makes no change to the database schema.\";\nconst PRISMA7_ROUTES_STEP = \"Move your routes one at a time to the Prisma 8 client in src/prisma/db.ts.\";\nconst PRISMA7_LOOP_STEP = \"After each `prisma7 migrate dev`, run `prisma contract emit` and then `prisma db sign`.\";\nconst PRISMA7_GENERATE_STEP = \"Run `prisma7 generate` so the Prisma 7 client matches the Prisma 7 CLI.\";\nconst PRISMA7_QUICK_REFERENCE_STEP = \"Open prisma-8.md for a quick reference on the transition loop and your first typed query.\";\nconst AGENT_SKILLS_STEP = \"Working with a coding agent? Run `prisma init` in this project to set up the Prisma agent skills.\";\n/**\n* The transition routine, project requirement 7: init set Prisma 8 up beside\n* Prisma 7 and stopped, so every database action here is one the user runs.\n*/\nfunction pushPrisma7Steps(push, options) {\n\tconst moved = options.prisma7.packagesMoved;\n\tconst including = moved.length === 0 ? \"\" : ` That includes ${moved.join(\", \")}.`;\n\tpush(\"Set DATABASE_URL in your environment (export it or add it to .env).\");\n\tif (options.packagesInstalled === \"failed\") push(`Install the project dependencies with your package manager — the install this run attempted failed, so nothing else here will work yet.${including}`);\n\tif (options.packagesInstalled === \"skipped\") push(`Install the project dependencies with your package manager (this run skipped them)${moved.length === 0 ? \"\" : `, including ${moved.join(\", \")}`}.`);\n\tif (!options.contractEmitted) push(`Emit the contract: \\`${options.emitCommand}\\``);\n\tpush(DB_SIGN_STEP);\n\tpush(PRISMA7_ROUTES_STEP);\n\tpush(PRISMA7_LOOP_STEP);\n\tif (options.prisma7.clientMoved) push(PRISMA7_GENERATE_STEP);\n\tpush(PRISMA7_QUICK_REFERENCE_STEP);\n\tpush(AGENT_SKILLS_STEP);\n}\n//#endregion\nexport { PRISMA7_QUICK_REFERENCE_STEP as a, TARGET_SHORT_NAMES as c, findTargetByProvider as d, PRISMA7_LOOP_STEP as i, findPrisma6OnlyTarget as l, InitOutputSchema as n, buildNextSteps as o, NEXT_STEPS_BEFORE_SCAFFOLD as r, KNOWN_TARGET_PACKAGES as s, DB_SIGN_STEP as t, findTargetByName as u };\n\n//# sourceMappingURL=output-E6F4-EMc.mjs.map"],"mappings":";;AAEA,MAAM,wBAAwB,CAAC;CAC9B,WAAW;CACX,SAAS,CAAC,YAAY;CACtB,aAAa;CACb,sBAAsB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