@prisma/config 6.4.0-dev.46 → 6.4.0-dev.47

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.d.ts CHANGED
@@ -2,4 +2,4 @@ export { defaultConfig } from './defaultConfig';
2
2
  export { defaultTestConfig } from './defaultTestConfig';
3
3
  export { defineConfig } from './defineConfig';
4
4
  export { type ConfigFromFile, loadConfigFromFile, type LoadConfigFromFileError } from './loadConfigFromFile';
5
- export type { PrismaConfig } from './PrismaConfig';
5
+ export type { PrismaConfigInternal } from './PrismaConfig';
package/dist/index.js CHANGED
@@ -279,55 +279,6 @@ __export(index_exports, {
279
279
  });
280
280
  module.exports = __toCommonJS(index_exports);
281
281
 
282
- // src/defaultConfig.ts
283
- function defaultConfig() {
284
- return {
285
- earlyAccess: true,
286
- loadedFromFile: null
287
- };
288
- }
289
-
290
- // src/defaultTestConfig.ts
291
- function defaultTestConfig() {
292
- return {
293
- earlyAccess: true,
294
- loadedFromFile: null
295
- };
296
- }
297
-
298
- // ../driver-adapter-utils/dist/index.mjs
299
- var import_debug = __toESM(require_dist(), 1);
300
-
301
- // src/defineConfig.ts
302
- var debug = (0, import_debug.Debug)("prisma:config:defineConfig");
303
- function defineConfig(configInput) {
304
- const config2 = defaultConfig();
305
- defineSchemaConfig(config2, configInput);
306
- debug("Prisma config [schema]: %o", config2.schema);
307
- defineStudioConfig(config2, configInput);
308
- debug("Prisma config [studio]: %o", config2.studio);
309
- return config2;
310
- }
311
- function defineSchemaConfig(config2, configInput) {
312
- if (!configInput.schema) {
313
- return;
314
- }
315
- config2.schema = configInput.schema;
316
- }
317
- function defineStudioConfig(config2, configInput) {
318
- if (!configInput.studio) {
319
- return;
320
- }
321
- config2.studio = {
322
- createAdapter: configInput.studio.adapter
323
- };
324
- }
325
-
326
- // src/loadConfigFromFile.ts
327
- var import_node_fs = __toESM(require("node:fs"));
328
- var import_node_path = __toESM(require("node:path"));
329
- var import_node_process = __toESM(require("node:process"));
330
-
331
282
  // ../../node_modules/.pnpm/effect@3.12.10/node_modules/effect/dist/esm/Function.js
332
283
  var isFunction = (input) => typeof input === "function";
333
284
  var dual = function(arity, body) {
@@ -11620,7 +11571,7 @@ var Fatal = logLevelFatal;
11620
11571
  var Error2 = logLevelError;
11621
11572
  var Warning = logLevelWarning;
11622
11573
  var Info = logLevelInfo;
11623
- var Debug2 = logLevelDebug;
11574
+ var Debug = logLevelDebug;
11624
11575
  var Trace = logLevelTrace;
11625
11576
  var None3 = logLevelNone;
11626
11577
  var Order5 = /* @__PURE__ */ pipe(Order, /* @__PURE__ */ mapInput2((level) => level.ordinal));
@@ -11630,7 +11581,7 @@ var fromLiteral = (literal2) => {
11630
11581
  case "All":
11631
11582
  return All;
11632
11583
  case "Debug":
11633
- return Debug2;
11584
+ return Debug;
11634
11585
  case "Error":
11635
11586
  return Error2;
11636
11587
  case "Fatal":
@@ -22556,7 +22507,7 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
22556
22507
  };
22557
22508
 
22558
22509
  // src/PrismaConfig.ts
22559
- var createAdapterSchema = () => Schema_exports.declare(
22510
+ var createAdapterShape = () => Schema_exports.declare(
22560
22511
  (input) => {
22561
22512
  return input instanceof Function;
22562
22513
  },
@@ -22566,13 +22517,13 @@ var createAdapterSchema = () => Schema_exports.declare(
22566
22517
  decode: identity
22567
22518
  }
22568
22519
  );
22569
- var createPrismaStudioConfigSchema = () => Schema_exports.Struct({
22520
+ var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
22570
22521
  /**
22571
22522
  * Instantiates the Prisma driver adapter to use for Prisma Studio.
22572
22523
  */
22573
- createAdapter: createAdapterSchema()
22524
+ createAdapter: createAdapterShape()
22574
22525
  });
22575
- var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22526
+ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
22576
22527
  /**
22577
22528
  * Tell Prisma to use a single `.prisma` schema file.
22578
22529
  */
@@ -22582,7 +22533,7 @@ var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22582
22533
  */
22583
22534
  filenamePath: Schema_exports.String
22584
22535
  });
22585
- var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22536
+ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
22586
22537
  /**
22587
22538
  * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
22588
22539
  */
@@ -22593,33 +22544,83 @@ var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22593
22544
  */
22594
22545
  folder: Schema_exports.String
22595
22546
  });
22596
- var PrismaSchemaConfigSchema = Schema_exports.Union(PrismaConfigSchemaSingleSchema, PrismaConfigSchemaMultiSchema);
22597
- var createPrismaConfigSchema = () => Schema_exports.Struct({
22598
- /**
22599
- * Whether features with an unstable API are enabled.
22600
- */
22601
- earlyAccess: Schema_exports.Literal(true),
22602
- /**
22603
- * The configuration for the Prisma schema file(s).
22604
- */
22605
- schema: Schema_exports.optional(PrismaSchemaConfigSchema),
22606
- /**
22607
- * The configuration for Prisma Studio.
22608
- */
22609
- studio: Schema_exports.optional(createPrismaStudioConfigSchema()),
22610
- /**
22611
- * The path from where the config was loaded.
22612
- * It's set to `null` if no config file was found and only default config is applied.
22613
- */
22614
- loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22615
- });
22616
- function parsePrismaConfig(input) {
22617
- return Schema_exports.decodeUnknownEither(createPrismaConfigSchema(), {})(input, {
22547
+ var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
22548
+ var createPrismaConfigInternalShape = () => pipe(
22549
+ Schema_exports.Struct({
22550
+ /**
22551
+ * Whether features with an unstable API are enabled.
22552
+ */
22553
+ earlyAccess: Schema_exports.Literal(true),
22554
+ /**
22555
+ * The configuration for the Prisma schema file(s).
22556
+ */
22557
+ schema: Schema_exports.optional(PrismaSchemaConfigShape),
22558
+ /**
22559
+ * The configuration for Prisma Studio.
22560
+ */
22561
+ studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
22562
+ /**
22563
+ * The path from where the config was loaded.
22564
+ * It's set to `null` if no config file was found and only default config is applied.
22565
+ */
22566
+ loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22567
+ }),
22568
+ Schema_exports.brand("PrismaConfigInternal")
22569
+ );
22570
+ function parsePrismaConfigInternalShape(input) {
22571
+ return Schema_exports.decodeUnknownEither(createPrismaConfigInternalShape(), {})(input, {
22618
22572
  onExcessProperty: "error"
22619
22573
  });
22620
22574
  }
22621
22575
 
22576
+ // src/defaultConfig.ts
22577
+ function defaultConfig() {
22578
+ return createPrismaConfigInternalShape().make({
22579
+ earlyAccess: true,
22580
+ loadedFromFile: null
22581
+ });
22582
+ }
22583
+
22584
+ // src/defaultTestConfig.ts
22585
+ function defaultTestConfig() {
22586
+ return createPrismaConfigInternalShape().make({
22587
+ earlyAccess: true,
22588
+ loadedFromFile: null
22589
+ });
22590
+ }
22591
+
22592
+ // ../driver-adapter-utils/dist/index.mjs
22593
+ var import_debug = __toESM(require_dist(), 1);
22594
+
22595
+ // src/defineConfig.ts
22596
+ var debug = (0, import_debug.Debug)("prisma:config:defineConfig");
22597
+ function defineConfig(configInput) {
22598
+ const config2 = defaultConfig();
22599
+ defineSchemaConfig(config2, configInput);
22600
+ defineStudioConfig(config2, configInput);
22601
+ return config2;
22602
+ }
22603
+ function defineSchemaConfig(config2, configInput) {
22604
+ if (!configInput.schema) {
22605
+ return;
22606
+ }
22607
+ config2.schema = configInput.schema;
22608
+ debug("Prisma config [schema]: %o", config2.schema);
22609
+ }
22610
+ function defineStudioConfig(config2, configInput) {
22611
+ if (!configInput.studio) {
22612
+ return;
22613
+ }
22614
+ config2.studio = {
22615
+ createAdapter: configInput.studio.adapter
22616
+ };
22617
+ debug("Prisma config [studio]: %o", config2.studio);
22618
+ }
22619
+
22622
22620
  // src/loadConfigFromFile.ts
22621
+ var import_node_fs = __toESM(require("node:fs"));
22622
+ var import_node_path = __toESM(require("node:path"));
22623
+ var import_node_process = __toESM(require("node:process"));
22623
22624
  var debug2 = (0, import_debug.Debug)("prisma:config:loadConfigFromFile");
22624
22625
  async function loadConfigFromFile({
22625
22626
  configFile,
@@ -22650,7 +22651,7 @@ async function loadConfigFromFile({
22650
22651
  };
22651
22652
  }
22652
22653
  debug2(`Config file loaded in %s`, getTime());
22653
- const parseResultEither = parsePrismaConfig(required3["default"]);
22654
+ const parseResultEither = parsePrismaConfigInternalShape(required3["default"]);
22654
22655
  if (Either_exports.isLeft(parseResultEither)) {
22655
22656
  return {
22656
22657
  resolvedPath,
@@ -1,5 +1,5 @@
1
1
  import { ParseError } from 'effect/ParseResult';
2
- import type { PrismaConfig } from './defineConfig';
2
+ import type { PrismaConfigInternal } from './defineConfig';
3
3
  type LoadConfigFromFileInput = {
4
4
  /**
5
5
  * The path to the config file to load. If not provided, we will attempt to find a config file in the `configRoot` directory.
@@ -24,7 +24,7 @@ export type LoadConfigFromFileError = {
24
24
  };
25
25
  export type ConfigFromFile = {
26
26
  resolvedPath: string;
27
- config: PrismaConfig<any>;
27
+ config: PrismaConfigInternal<any>;
28
28
  error?: never;
29
29
  } | {
30
30
  resolvedPath: string;
@@ -22510,7 +22510,7 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
22510
22510
  };
22511
22511
 
22512
22512
  // src/PrismaConfig.ts
22513
- var createAdapterSchema = () => Schema_exports.declare(
22513
+ var createAdapterShape = () => Schema_exports.declare(
22514
22514
  (input) => {
22515
22515
  return input instanceof Function;
22516
22516
  },
@@ -22520,13 +22520,13 @@ var createAdapterSchema = () => Schema_exports.declare(
22520
22520
  decode: identity
22521
22521
  }
22522
22522
  );
22523
- var createPrismaStudioConfigSchema = () => Schema_exports.Struct({
22523
+ var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
22524
22524
  /**
22525
22525
  * Instantiates the Prisma driver adapter to use for Prisma Studio.
22526
22526
  */
22527
- createAdapter: createAdapterSchema()
22527
+ createAdapter: createAdapterShape()
22528
22528
  });
22529
- var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22529
+ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
22530
22530
  /**
22531
22531
  * Tell Prisma to use a single `.prisma` schema file.
22532
22532
  */
@@ -22536,7 +22536,7 @@ var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22536
22536
  */
22537
22537
  filenamePath: Schema_exports.String
22538
22538
  });
22539
- var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22539
+ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
22540
22540
  /**
22541
22541
  * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
22542
22542
  */
@@ -22547,28 +22547,31 @@ var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22547
22547
  */
22548
22548
  folder: Schema_exports.String
22549
22549
  });
22550
- var PrismaSchemaConfigSchema = Schema_exports.Union(PrismaConfigSchemaSingleSchema, PrismaConfigSchemaMultiSchema);
22551
- var createPrismaConfigSchema = () => Schema_exports.Struct({
22552
- /**
22553
- * Whether features with an unstable API are enabled.
22554
- */
22555
- earlyAccess: Schema_exports.Literal(true),
22556
- /**
22557
- * The configuration for the Prisma schema file(s).
22558
- */
22559
- schema: Schema_exports.optional(PrismaSchemaConfigSchema),
22560
- /**
22561
- * The configuration for Prisma Studio.
22562
- */
22563
- studio: Schema_exports.optional(createPrismaStudioConfigSchema()),
22564
- /**
22565
- * The path from where the config was loaded.
22566
- * It's set to `null` if no config file was found and only default config is applied.
22567
- */
22568
- loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22569
- });
22570
- function parsePrismaConfig(input) {
22571
- return Schema_exports.decodeUnknownEither(createPrismaConfigSchema(), {})(input, {
22550
+ var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
22551
+ var createPrismaConfigInternalShape = () => pipe(
22552
+ Schema_exports.Struct({
22553
+ /**
22554
+ * Whether features with an unstable API are enabled.
22555
+ */
22556
+ earlyAccess: Schema_exports.Literal(true),
22557
+ /**
22558
+ * The configuration for the Prisma schema file(s).
22559
+ */
22560
+ schema: Schema_exports.optional(PrismaSchemaConfigShape),
22561
+ /**
22562
+ * The configuration for Prisma Studio.
22563
+ */
22564
+ studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
22565
+ /**
22566
+ * The path from where the config was loaded.
22567
+ * It's set to `null` if no config file was found and only default config is applied.
22568
+ */
22569
+ loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22570
+ }),
22571
+ Schema_exports.brand("PrismaConfigInternal")
22572
+ );
22573
+ function parsePrismaConfigInternalShape(input) {
22574
+ return Schema_exports.decodeUnknownEither(createPrismaConfigInternalShape(), {})(input, {
22572
22575
  onExcessProperty: "error"
22573
22576
  });
22574
22577
  }
@@ -22604,7 +22607,7 @@ async function loadConfigFromFile({
22604
22607
  };
22605
22608
  }
22606
22609
  debug(`Config file loaded in %s`, getTime());
22607
- const parseResultEither = parsePrismaConfig(required3["default"]);
22610
+ const parseResultEither = parsePrismaConfigInternalShape(required3["default"]);
22608
22611
  if (Either_exports.isLeft(parseResultEither)) {
22609
22612
  return {
22610
22613
  resolvedPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/config",
3
- "version": "6.4.0-dev.46",
3
+ "version": "6.4.0-dev.47",
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",
@@ -18,8 +18,8 @@
18
18
  "esbuild-register": "3.6.0",
19
19
  "jest": "29.7.0",
20
20
  "jest-junit": "16.0.0",
21
- "@prisma/driver-adapter-utils": "6.4.0-dev.46",
22
- "@prisma/get-platform": "6.4.0-dev.46"
21
+ "@prisma/get-platform": "6.4.0-dev.47",
22
+ "@prisma/driver-adapter-utils": "6.4.0-dev.47"
23
23
  },
24
24
  "files": [
25
25
  "dist"