@prisma/config 6.5.0-dev.3 → 6.5.0-dev.30

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.
package/dist/index.js CHANGED
@@ -39,13 +39,198 @@ var __privateSet = (obj, member, value3, setter) => (__accessCheck(obj, member,
39
39
  // src/index.ts
40
40
  var index_exports = {};
41
41
  __export(index_exports, {
42
- defaultConfig: () => defaultConfig,
43
42
  defaultTestConfig: () => defaultTestConfig,
44
43
  defineConfig: () => defineConfig,
45
44
  loadConfigFromFile: () => loadConfigFromFile
46
45
  });
47
46
  module.exports = __toCommonJS(index_exports);
48
47
 
48
+ // ../debug/dist/index.mjs
49
+ var __defProp2 = Object.defineProperty;
50
+ var __export2 = (target, all5) => {
51
+ for (var name in all5)
52
+ __defProp2(target, name, { get: all5[name], enumerable: true });
53
+ };
54
+ var colors_exports = {};
55
+ __export2(colors_exports, {
56
+ $: () => $,
57
+ bgBlack: () => bgBlack,
58
+ bgBlue: () => bgBlue,
59
+ bgCyan: () => bgCyan,
60
+ bgGreen: () => bgGreen,
61
+ bgMagenta: () => bgMagenta,
62
+ bgRed: () => bgRed,
63
+ bgWhite: () => bgWhite,
64
+ bgYellow: () => bgYellow,
65
+ black: () => black,
66
+ blue: () => blue,
67
+ bold: () => bold,
68
+ cyan: () => cyan,
69
+ dim: () => dim,
70
+ gray: () => gray,
71
+ green: () => green,
72
+ grey: () => grey,
73
+ hidden: () => hidden,
74
+ inverse: () => inverse,
75
+ italic: () => italic,
76
+ magenta: () => magenta,
77
+ red: () => red,
78
+ reset: () => reset,
79
+ strikethrough: () => strikethrough,
80
+ underline: () => underline,
81
+ white: () => white,
82
+ yellow: () => yellow
83
+ });
84
+ var FORCE_COLOR;
85
+ var NODE_DISABLE_COLORS;
86
+ var NO_COLOR;
87
+ var TERM;
88
+ var isTTY = true;
89
+ if (typeof process !== "undefined") {
90
+ ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
91
+ isTTY = process.stdout && process.stdout.isTTY;
92
+ }
93
+ var $ = {
94
+ enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
95
+ };
96
+ function init(x, y) {
97
+ let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
98
+ let open = `\x1B[${x}m`, close2 = `\x1B[${y}m`;
99
+ return function(txt) {
100
+ if (!$.enabled || txt == null) return txt;
101
+ return open + (!!~("" + txt).indexOf(close2) ? txt.replace(rgx, close2 + open) : txt) + close2;
102
+ };
103
+ }
104
+ var reset = init(0, 0);
105
+ var bold = init(1, 22);
106
+ var dim = init(2, 22);
107
+ var italic = init(3, 23);
108
+ var underline = init(4, 24);
109
+ var inverse = init(7, 27);
110
+ var hidden = init(8, 28);
111
+ var strikethrough = init(9, 29);
112
+ var black = init(30, 39);
113
+ var red = init(31, 39);
114
+ var green = init(32, 39);
115
+ var yellow = init(33, 39);
116
+ var blue = init(34, 39);
117
+ var magenta = init(35, 39);
118
+ var cyan = init(36, 39);
119
+ var white = init(37, 39);
120
+ var gray = init(90, 39);
121
+ var grey = init(90, 39);
122
+ var bgBlack = init(40, 49);
123
+ var bgRed = init(41, 49);
124
+ var bgGreen = init(42, 49);
125
+ var bgYellow = init(43, 49);
126
+ var bgBlue = init(44, 49);
127
+ var bgMagenta = init(45, 49);
128
+ var bgCyan = init(46, 49);
129
+ var bgWhite = init(47, 49);
130
+ var MAX_ARGS_HISTORY = 100;
131
+ var COLORS = ["green", "yellow", "blue", "magenta", "cyan", "red"];
132
+ var argsHistory = [];
133
+ var lastTimestamp = Date.now();
134
+ var lastColor = 0;
135
+ var processEnv = typeof process !== "undefined" ? process.env : {};
136
+ globalThis.DEBUG ??= processEnv.DEBUG ?? "";
137
+ globalThis.DEBUG_COLORS ??= processEnv.DEBUG_COLORS ? processEnv.DEBUG_COLORS === "true" : true;
138
+ var topProps = {
139
+ enable(namespace) {
140
+ if (typeof namespace === "string") {
141
+ globalThis.DEBUG = namespace;
142
+ }
143
+ },
144
+ disable() {
145
+ const prev = globalThis.DEBUG;
146
+ globalThis.DEBUG = "";
147
+ return prev;
148
+ },
149
+ // this is the core logic to check if logging should happen or not
150
+ enabled(namespace) {
151
+ const listenedNamespaces = globalThis.DEBUG.split(",").map((s) => {
152
+ return s.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
153
+ });
154
+ const isListened = listenedNamespaces.some((listenedNamespace) => {
155
+ if (listenedNamespace === "" || listenedNamespace[0] === "-") return false;
156
+ return namespace.match(RegExp(listenedNamespace.split("*").join(".*") + "$"));
157
+ });
158
+ const isExcluded = listenedNamespaces.some((listenedNamespace) => {
159
+ if (listenedNamespace === "" || listenedNamespace[0] !== "-") return false;
160
+ return namespace.match(RegExp(listenedNamespace.slice(1).split("*").join(".*") + "$"));
161
+ });
162
+ return isListened && !isExcluded;
163
+ },
164
+ log: (...args2) => {
165
+ const [namespace, format7, ...rest] = args2;
166
+ const logWithFormatting = console.warn ?? console.log;
167
+ logWithFormatting(`${namespace} ${format7}`, ...rest);
168
+ },
169
+ formatters: {}
170
+ // not implemented
171
+ };
172
+ function debugCreate(namespace) {
173
+ const instanceProps = {
174
+ color: COLORS[lastColor++ % COLORS.length],
175
+ enabled: topProps.enabled(namespace),
176
+ namespace,
177
+ log: topProps.log,
178
+ extend: () => {
179
+ }
180
+ // not implemented
181
+ };
182
+ const debugCall = (...args2) => {
183
+ const { enabled: enabled2, namespace: namespace2, color, log } = instanceProps;
184
+ if (args2.length !== 0) {
185
+ argsHistory.push([namespace2, ...args2]);
186
+ }
187
+ if (argsHistory.length > MAX_ARGS_HISTORY) {
188
+ argsHistory.shift();
189
+ }
190
+ if (topProps.enabled(namespace2) || enabled2) {
191
+ const stringArgs = args2.map((arg) => {
192
+ if (typeof arg === "string") {
193
+ return arg;
194
+ }
195
+ return safeStringify(arg);
196
+ });
197
+ const ms = `+${Date.now() - lastTimestamp}ms`;
198
+ lastTimestamp = Date.now();
199
+ if (globalThis.DEBUG_COLORS) {
200
+ log(colors_exports[color](bold(namespace2)), ...stringArgs, colors_exports[color](ms));
201
+ } else {
202
+ log(namespace2, ...stringArgs, ms);
203
+ }
204
+ }
205
+ };
206
+ return new Proxy(debugCall, {
207
+ get: (_, prop) => instanceProps[prop],
208
+ set: (_, prop, value3) => instanceProps[prop] = value3
209
+ });
210
+ }
211
+ var Debug = new Proxy(debugCreate, {
212
+ get: (_, prop) => topProps[prop],
213
+ set: (_, prop, value3) => topProps[prop] = value3
214
+ });
215
+ function safeStringify(value3, indent = 2) {
216
+ const cache = /* @__PURE__ */ new Set();
217
+ return JSON.stringify(
218
+ value3,
219
+ (key, value22) => {
220
+ if (typeof value22 === "object" && value22 !== null) {
221
+ if (cache.has(value22)) {
222
+ return `[Circular *]`;
223
+ }
224
+ cache.add(value22);
225
+ } else if (typeof value22 === "bigint") {
226
+ return value22.toString();
227
+ }
228
+ return value22;
229
+ },
230
+ indent
231
+ );
232
+ }
233
+
49
234
  // ../../node_modules/.pnpm/effect@3.12.10/node_modules/effect/dist/esm/Function.js
50
235
  var isFunction = (input) => typeof input === "function";
51
236
  var dual = function(arity, body) {
@@ -11338,7 +11523,7 @@ var Fatal = logLevelFatal;
11338
11523
  var Error2 = logLevelError;
11339
11524
  var Warning = logLevelWarning;
11340
11525
  var Info = logLevelInfo;
11341
- var Debug = logLevelDebug;
11526
+ var Debug2 = logLevelDebug;
11342
11527
  var Trace = logLevelTrace;
11343
11528
  var None3 = logLevelNone;
11344
11529
  var Order5 = /* @__PURE__ */ pipe(Order, /* @__PURE__ */ mapInput2((level) => level.ordinal));
@@ -11348,7 +11533,7 @@ var fromLiteral = (literal2) => {
11348
11533
  case "All":
11349
11534
  return All;
11350
11535
  case "Debug":
11351
- return Debug;
11536
+ return Debug2;
11352
11537
  case "Error":
11353
11538
  return Error2;
11354
11539
  case "Fatal":
@@ -22273,290 +22458,129 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
22273
22458
  })) {
22274
22459
  };
22275
22460
 
22461
+ // src/defaultConfig.ts
22462
+ function defaultConfig() {
22463
+ return makePrismaConfigInternal({
22464
+ earlyAccess: true,
22465
+ loadedFromFile: null
22466
+ });
22467
+ }
22468
+
22469
+ // src/defineConfig.ts
22470
+ var debug = Debug("prisma:config:defineConfig");
22471
+ function defineConfig(configInput) {
22472
+ const config2 = defaultConfig();
22473
+ debug("Prisma config [default]: %o", config2);
22474
+ defineSchemaConfig(config2, configInput);
22475
+ return config2;
22476
+ }
22477
+ function defineSchemaConfig(config2, configInput) {
22478
+ if (!configInput.schema) {
22479
+ return;
22480
+ }
22481
+ config2.schema = configInput.schema;
22482
+ debug("Prisma config [schema]: %o", config2.schema);
22483
+ }
22484
+
22276
22485
  // src/PrismaConfig.ts
22486
+ var debug2 = Debug("prisma:config:PrismaConfig");
22277
22487
  var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
22278
- /**
22279
- * Tell Prisma to use a single `.prisma` schema file.
22280
- */
22281
22488
  kind: Schema_exports.Literal("single"),
22282
- /**
22283
- * The path to a single `.prisma` schema file.
22284
- */
22285
22489
  filePath: Schema_exports.String
22286
22490
  });
22287
22491
  var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
22288
- /**
22289
- * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
22290
- */
22291
22492
  kind: Schema_exports.Literal("multi"),
22292
- /**
22293
- * The path to a folder containing multiple `.prisma` schema files.
22294
- * All of the files in this folder will be used.
22295
- */
22296
22493
  folderPath: Schema_exports.String
22297
22494
  });
22298
22495
  var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
22496
+ if (false) {
22497
+ __testPrismaConfigShapeValueA;
22498
+ __testPrismaConfigShapeValueB;
22499
+ }
22299
22500
  var createPrismaConfigShape = () => Schema_exports.Struct({
22300
- /**
22301
- * Whether features with an unstable API are enabled.
22302
- */
22303
22501
  earlyAccess: Schema_exports.Literal(true),
22304
- /**
22305
- * The configuration for the Prisma schema file(s).
22306
- */
22307
22502
  schema: Schema_exports.optional(PrismaSchemaConfigShape)
22308
22503
  });
22504
+ if (false) {
22505
+ __testPrismaConfigValueA;
22506
+ __testPrismaConfigValueB;
22507
+ }
22309
22508
  function parsePrismaConfigShape(input) {
22310
22509
  return Schema_exports.decodeUnknownEither(createPrismaConfigShape(), {})(input, {
22311
22510
  onExcessProperty: "error"
22312
22511
  });
22313
22512
  }
22314
- var createPrismaConfigInternalShape = () => pipe(
22315
- Schema_exports.Struct({
22316
- /**
22317
- * Whether features with an unstable API are enabled.
22318
- */
22319
- earlyAccess: Schema_exports.Literal(true),
22320
- /**
22321
- * The configuration for the Prisma schema file(s).
22322
- */
22323
- schema: Schema_exports.optional(PrismaSchemaConfigShape),
22324
- /**
22325
- * The path from where the config was loaded.
22326
- * It's set to `null` if no config file was found and only default config is applied.
22327
- */
22328
- loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22329
- }),
22330
- Schema_exports.brand("PrismaConfigInternal")
22331
- );
22332
- function parsePrismaConfigInternalShape(input) {
22333
- return Schema_exports.decodeUnknownEither(createPrismaConfigInternalShape(), {})(input, {
22334
- onExcessProperty: "error"
22335
- });
22513
+ var PRISMA_CONFIG_INTERNAL_BRAND = Symbol.for("PrismaConfigInternal");
22514
+ var createPrismaConfigInternalShape = () => Schema_exports.Struct({
22515
+ earlyAccess: Schema_exports.Literal(true),
22516
+ schema: Schema_exports.optional(PrismaSchemaConfigShape),
22517
+ loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22518
+ });
22519
+ if (false) {
22520
+ __testPrismaConfigInternalValueA;
22521
+ __testPrismaConfigInternalValueB;
22336
22522
  }
22337
-
22338
- // src/defaultConfig.ts
22339
- function defaultConfig() {
22340
- return createPrismaConfigInternalShape().make({
22341
- earlyAccess: true,
22342
- loadedFromFile: null
22523
+ function brandPrismaConfigInternal(config2) {
22524
+ Object.defineProperty(config2, "__brand", {
22525
+ value: PRISMA_CONFIG_INTERNAL_BRAND,
22526
+ writable: true,
22527
+ configurable: true,
22528
+ enumerable: false
22343
22529
  });
22530
+ return config2;
22531
+ }
22532
+ function parsePrismaConfigInternalShape(input) {
22533
+ debug2("Parsing PrismaConfigInternal: %o", input);
22534
+ if (typeof input === "object" && input !== null && input["__brand"] === PRISMA_CONFIG_INTERNAL_BRAND) {
22535
+ debug2("Short-circuit: input is already a PrismaConfigInternal object");
22536
+ return Either_exports.right(input);
22537
+ }
22538
+ return pipe(
22539
+ Schema_exports.decodeUnknownEither(createPrismaConfigInternalShape(), {})(input, {
22540
+ onExcessProperty: "error"
22541
+ }),
22542
+ // Brand the output type to make `PrismaConfigInternal` opaque, without exposing the `Effect/Brand` type
22543
+ // to the public API.
22544
+ // This is done to work around the following issues:
22545
+ // - https://github.com/microsoft/rushstack/issues/1308
22546
+ // - https://github.com/microsoft/rushstack/issues/4034
22547
+ // - https://github.com/microsoft/TypeScript/issues/58914
22548
+ Either_exports.map(brandPrismaConfigInternal)
22549
+ );
22550
+ }
22551
+ function makePrismaConfigInternal(makeArgs) {
22552
+ return pipe(createPrismaConfigInternalShape().make(makeArgs), brandPrismaConfigInternal);
22553
+ }
22554
+ function parseDefaultExport(defaultExport) {
22555
+ const parseResultEither = pipe(
22556
+ // If the given config conforms to the `PrismaConfig` shape, feed it to `defineConfig`.
22557
+ parsePrismaConfigShape(defaultExport),
22558
+ Either_exports.map((config2) => {
22559
+ debug2("Parsed `PrismaConfig` shape: %o", config2);
22560
+ return defineConfig(config2);
22561
+ }),
22562
+ // Otherwise, try to parse it as a `PrismaConfigInternal` shape.
22563
+ Either_exports.orElse(() => parsePrismaConfigInternalShape(defaultExport))
22564
+ );
22565
+ if (Either_exports.isLeft(parseResultEither)) {
22566
+ throw parseResultEither.left;
22567
+ }
22568
+ return parseResultEither.right;
22344
22569
  }
22345
22570
 
22346
22571
  // src/defaultTestConfig.ts
22347
22572
  function defaultTestConfig() {
22348
- return createPrismaConfigInternalShape().make({
22573
+ return makePrismaConfigInternal({
22349
22574
  earlyAccess: true,
22350
22575
  loadedFromFile: null
22351
22576
  });
22352
22577
  }
22353
22578
 
22354
- // ../debug/dist/index.mjs
22355
- var __defProp2 = Object.defineProperty;
22356
- var __export2 = (target, all5) => {
22357
- for (var name in all5)
22358
- __defProp2(target, name, { get: all5[name], enumerable: true });
22359
- };
22360
- var colors_exports = {};
22361
- __export2(colors_exports, {
22362
- $: () => $,
22363
- bgBlack: () => bgBlack,
22364
- bgBlue: () => bgBlue,
22365
- bgCyan: () => bgCyan,
22366
- bgGreen: () => bgGreen,
22367
- bgMagenta: () => bgMagenta,
22368
- bgRed: () => bgRed,
22369
- bgWhite: () => bgWhite,
22370
- bgYellow: () => bgYellow,
22371
- black: () => black,
22372
- blue: () => blue,
22373
- bold: () => bold,
22374
- cyan: () => cyan,
22375
- dim: () => dim,
22376
- gray: () => gray,
22377
- green: () => green,
22378
- grey: () => grey,
22379
- hidden: () => hidden,
22380
- inverse: () => inverse2,
22381
- italic: () => italic,
22382
- magenta: () => magenta,
22383
- red: () => red,
22384
- reset: () => reset,
22385
- strikethrough: () => strikethrough,
22386
- underline: () => underline,
22387
- white: () => white,
22388
- yellow: () => yellow
22389
- });
22390
- var FORCE_COLOR;
22391
- var NODE_DISABLE_COLORS;
22392
- var NO_COLOR;
22393
- var TERM;
22394
- var isTTY = true;
22395
- if (typeof process !== "undefined") {
22396
- ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
22397
- isTTY = process.stdout && process.stdout.isTTY;
22398
- }
22399
- var $ = {
22400
- enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
22401
- };
22402
- function init(x, y) {
22403
- let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
22404
- let open = `\x1B[${x}m`, close2 = `\x1B[${y}m`;
22405
- return function(txt) {
22406
- if (!$.enabled || txt == null) return txt;
22407
- return open + (!!~("" + txt).indexOf(close2) ? txt.replace(rgx, close2 + open) : txt) + close2;
22408
- };
22409
- }
22410
- var reset = init(0, 0);
22411
- var bold = init(1, 22);
22412
- var dim = init(2, 22);
22413
- var italic = init(3, 23);
22414
- var underline = init(4, 24);
22415
- var inverse2 = init(7, 27);
22416
- var hidden = init(8, 28);
22417
- var strikethrough = init(9, 29);
22418
- var black = init(30, 39);
22419
- var red = init(31, 39);
22420
- var green = init(32, 39);
22421
- var yellow = init(33, 39);
22422
- var blue = init(34, 39);
22423
- var magenta = init(35, 39);
22424
- var cyan = init(36, 39);
22425
- var white = init(37, 39);
22426
- var gray = init(90, 39);
22427
- var grey = init(90, 39);
22428
- var bgBlack = init(40, 49);
22429
- var bgRed = init(41, 49);
22430
- var bgGreen = init(42, 49);
22431
- var bgYellow = init(43, 49);
22432
- var bgBlue = init(44, 49);
22433
- var bgMagenta = init(45, 49);
22434
- var bgCyan = init(46, 49);
22435
- var bgWhite = init(47, 49);
22436
- var MAX_ARGS_HISTORY = 100;
22437
- var COLORS = ["green", "yellow", "blue", "magenta", "cyan", "red"];
22438
- var argsHistory = [];
22439
- var lastTimestamp = Date.now();
22440
- var lastColor = 0;
22441
- var processEnv = typeof process !== "undefined" ? process.env : {};
22442
- globalThis.DEBUG ??= processEnv.DEBUG ?? "";
22443
- globalThis.DEBUG_COLORS ??= processEnv.DEBUG_COLORS ? processEnv.DEBUG_COLORS === "true" : true;
22444
- var topProps = {
22445
- enable(namespace) {
22446
- if (typeof namespace === "string") {
22447
- globalThis.DEBUG = namespace;
22448
- }
22449
- },
22450
- disable() {
22451
- const prev = globalThis.DEBUG;
22452
- globalThis.DEBUG = "";
22453
- return prev;
22454
- },
22455
- // this is the core logic to check if logging should happen or not
22456
- enabled(namespace) {
22457
- const listenedNamespaces = globalThis.DEBUG.split(",").map((s) => {
22458
- return s.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
22459
- });
22460
- const isListened = listenedNamespaces.some((listenedNamespace) => {
22461
- if (listenedNamespace === "" || listenedNamespace[0] === "-") return false;
22462
- return namespace.match(RegExp(listenedNamespace.split("*").join(".*") + "$"));
22463
- });
22464
- const isExcluded = listenedNamespaces.some((listenedNamespace) => {
22465
- if (listenedNamespace === "" || listenedNamespace[0] !== "-") return false;
22466
- return namespace.match(RegExp(listenedNamespace.slice(1).split("*").join(".*") + "$"));
22467
- });
22468
- return isListened && !isExcluded;
22469
- },
22470
- log: (...args2) => {
22471
- const [namespace, format7, ...rest] = args2;
22472
- const logWithFormatting = console.warn ?? console.log;
22473
- logWithFormatting(`${namespace} ${format7}`, ...rest);
22474
- },
22475
- formatters: {}
22476
- // not implemented
22477
- };
22478
- function debugCreate(namespace) {
22479
- const instanceProps = {
22480
- color: COLORS[lastColor++ % COLORS.length],
22481
- enabled: topProps.enabled(namespace),
22482
- namespace,
22483
- log: topProps.log,
22484
- extend: () => {
22485
- }
22486
- // not implemented
22487
- };
22488
- const debugCall = (...args2) => {
22489
- const { enabled: enabled2, namespace: namespace2, color, log } = instanceProps;
22490
- if (args2.length !== 0) {
22491
- argsHistory.push([namespace2, ...args2]);
22492
- }
22493
- if (argsHistory.length > MAX_ARGS_HISTORY) {
22494
- argsHistory.shift();
22495
- }
22496
- if (topProps.enabled(namespace2) || enabled2) {
22497
- const stringArgs = args2.map((arg) => {
22498
- if (typeof arg === "string") {
22499
- return arg;
22500
- }
22501
- return safeStringify(arg);
22502
- });
22503
- const ms = `+${Date.now() - lastTimestamp}ms`;
22504
- lastTimestamp = Date.now();
22505
- if (globalThis.DEBUG_COLORS) {
22506
- log(colors_exports[color](bold(namespace2)), ...stringArgs, colors_exports[color](ms));
22507
- } else {
22508
- log(namespace2, ...stringArgs, ms);
22509
- }
22510
- }
22511
- };
22512
- return new Proxy(debugCall, {
22513
- get: (_, prop) => instanceProps[prop],
22514
- set: (_, prop, value3) => instanceProps[prop] = value3
22515
- });
22516
- }
22517
- var Debug2 = new Proxy(debugCreate, {
22518
- get: (_, prop) => topProps[prop],
22519
- set: (_, prop, value3) => topProps[prop] = value3
22520
- });
22521
- function safeStringify(value3, indent = 2) {
22522
- const cache = /* @__PURE__ */ new Set();
22523
- return JSON.stringify(
22524
- value3,
22525
- (key, value22) => {
22526
- if (typeof value22 === "object" && value22 !== null) {
22527
- if (cache.has(value22)) {
22528
- return `[Circular *]`;
22529
- }
22530
- cache.add(value22);
22531
- } else if (typeof value22 === "bigint") {
22532
- return value22.toString();
22533
- }
22534
- return value22;
22535
- },
22536
- indent
22537
- );
22538
- }
22539
-
22540
- // src/defineConfig.ts
22541
- var debug = Debug2("prisma:config:defineConfig");
22542
- function defineConfig(configInput) {
22543
- const config2 = defaultConfig();
22544
- defineSchemaConfig(config2, configInput);
22545
- return config2;
22546
- }
22547
- function defineSchemaConfig(config2, configInput) {
22548
- if (!configInput.schema) {
22549
- return;
22550
- }
22551
- config2.schema = configInput.schema;
22552
- debug("Prisma config [schema]: %o", config2.schema);
22553
- }
22554
-
22555
22579
  // src/loadConfigFromFile.ts
22556
22580
  var import_node_fs = __toESM(require("node:fs"));
22557
22581
  var import_node_path = __toESM(require("node:path"));
22558
22582
  var import_node_process = __toESM(require("node:process"));
22559
- var debug2 = Debug2("prisma:config:loadConfigFromFile");
22583
+ var debug3 = Debug("prisma:config:loadConfigFromFile");
22560
22584
  async function loadConfigFromFile({
22561
22585
  configFile,
22562
22586
  configRoot = import_node_process.default.cwd()
@@ -22567,14 +22591,14 @@ async function loadConfigFromFile({
22567
22591
  if (configFile) {
22568
22592
  resolvedPath = import_node_path.default.resolve(configRoot, configFile);
22569
22593
  if (!import_node_fs.default.existsSync(resolvedPath)) {
22570
- debug2(`The given config file was not found at %s`, resolvedPath);
22594
+ debug3(`The given config file was not found at %s`, resolvedPath);
22571
22595
  return { resolvedPath, error: { _tag: "ConfigFileNotFound" } };
22572
22596
  }
22573
22597
  } else {
22574
22598
  resolvedPath = ["prisma.config.ts"].map((file) => import_node_path.default.resolve(configRoot, file)).find((file) => import_node_fs.default.existsSync(file)) ?? null;
22575
22599
  if (resolvedPath === null) {
22576
- debug2(`No config file found in the current working directory %s`, configRoot);
22577
- return { resolvedPath };
22600
+ debug3(`No config file found in the current working directory %s`, configRoot);
22601
+ return { resolvedPath, config: defaultConfig() };
22578
22602
  }
22579
22603
  }
22580
22604
  try {
@@ -22585,30 +22609,23 @@ async function loadConfigFromFile({
22585
22609
  error
22586
22610
  };
22587
22611
  }
22588
- debug2(`Config file loaded in %s`, getTime());
22589
- const defaultExport = required3["default"];
22590
- const parseResultEither = pipe(
22591
- // If the given config conforms to the `PrismaConfig` shape, feed it to `defineConfig`.
22592
- parsePrismaConfigShape(defaultExport),
22593
- Either_exports.map((config2) => {
22594
- debug2("Parsed `PrismaConfig` shape: %o", config2);
22595
- return defineConfig(config2);
22596
- }),
22597
- // Otherwise, try to parse it as a `PrismaConfigInternal` shape.
22598
- Either_exports.orElse(() => parsePrismaConfigInternalShape(defaultExport))
22599
- );
22600
- if (Either_exports.isLeft(parseResultEither)) {
22612
+ debug3(`Config file loaded in %s`, getTime());
22613
+ let defaultExport;
22614
+ try {
22615
+ defaultExport = parseDefaultExport(required3["default"]);
22616
+ } catch (e) {
22617
+ const error2 = e;
22601
22618
  return {
22602
22619
  resolvedPath,
22603
22620
  error: {
22604
22621
  _tag: "ConfigFileParseError",
22605
- error: parseResultEither.left
22622
+ error: error2
22606
22623
  }
22607
22624
  };
22608
22625
  }
22609
22626
  import_node_process.default.stdout.write(`Loaded Prisma config from "${resolvedPath}".
22610
22627
  `);
22611
- const prismaConfig = transformPathsInConfigToAbsolute(parseResultEither.right, resolvedPath);
22628
+ const prismaConfig = transformPathsInConfigToAbsolute(defaultExport, resolvedPath);
22612
22629
  return {
22613
22630
  config: {
22614
22631
  ...prismaConfig,
@@ -22642,7 +22659,7 @@ async function requireTypeScriptFile(resolvedPath) {
22642
22659
  };
22643
22660
  } catch (e) {
22644
22661
  const error = e;
22645
- debug2("esbuild-register registration failed: %s", error.message);
22662
+ debug3("esbuild-register registration failed: %s", error.message);
22646
22663
  return {
22647
22664
  error: {
22648
22665
  _tag: "TypeScriptImportFailed",
@@ -22674,7 +22691,6 @@ function transformPathsInConfigToAbsolute(prismaConfig, resolvedPath) {
22674
22691
  }
22675
22692
  // Annotate the CommonJS export names for ESM import in node:
22676
22693
  0 && (module.exports = {
22677
- defaultConfig,
22678
22694
  defaultTestConfig,
22679
22695
  defineConfig,
22680
22696
  loadConfigFromFile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/config",
3
- "version": "6.5.0-dev.3",
3
+ "version": "6.5.0-dev.30",
4
4
  "description": "Internal package used to define and read Prisma configuration files",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,8 +22,8 @@
22
22
  "esbuild-register": "3.6.0",
23
23
  "jest": "29.7.0",
24
24
  "jest-junit": "16.0.0",
25
- "@prisma/driver-adapter-utils": "6.5.0-dev.3",
26
- "@prisma/get-platform": "6.5.0-dev.3"
25
+ "@prisma/driver-adapter-utils": "6.5.0-dev.30",
26
+ "@prisma/get-platform": "6.5.0-dev.30"
27
27
  },
28
28
  "files": [
29
29
  "dist"