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

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.
@@ -2,11 +2,55 @@ import type { DriverAdapter as QueryableDriverAdapter } from '@prisma/driver-ada
2
2
  import { Schema } from 'effect';
3
3
  import type { Either } from 'effect/Either';
4
4
  import type { ParseError } from 'effect/ParseResult';
5
+ declare const PrismaSchemaConfigSchema: Schema.Union<[Schema.Struct<{
6
+ /**
7
+ * Tell Prisma to use a single `.prisma` schema file.
8
+ */
9
+ kind: Schema.Literal<["single"]>;
10
+ /**
11
+ * The path to a single `.prisma` schema file.
12
+ */
13
+ filenamePath: typeof Schema.String;
14
+ }>, Schema.Struct<{
15
+ /**
16
+ * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
17
+ */
18
+ kind: Schema.Literal<["multi"]>;
19
+ /**
20
+ * The path to a folder containing multiple `.prisma` schema files.
21
+ * All of the files in this folder will be used.
22
+ */
23
+ folder: typeof Schema.String;
24
+ }>]>;
25
+ export type PrismaSchemaConfigSchema = typeof PrismaSchemaConfigSchema.Type;
5
26
  declare const createPrismaConfigSchema: <Env = any>() => Schema.Struct<{
6
27
  /**
7
28
  * Whether features with an unstable API are enabled.
8
29
  */
9
30
  earlyAccess: Schema.Literal<[true]>;
31
+ /**
32
+ * The configuration for the Prisma schema file(s).
33
+ */
34
+ schema: Schema.optional<Schema.Union<[Schema.Struct<{
35
+ /**
36
+ * Tell Prisma to use a single `.prisma` schema file.
37
+ */
38
+ kind: Schema.Literal<["single"]>;
39
+ /**
40
+ * The path to a single `.prisma` schema file.
41
+ */
42
+ filenamePath: typeof Schema.String;
43
+ }>, Schema.Struct<{
44
+ /**
45
+ * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
46
+ */
47
+ kind: Schema.Literal<["multi"]>;
48
+ /**
49
+ * The path to a folder containing multiple `.prisma` schema files.
50
+ * All of the files in this folder will be used.
51
+ */
52
+ folder: typeof Schema.String;
53
+ }>]>>;
10
54
  /**
11
55
  * The configuration for Prisma Studio.
12
56
  */
@@ -22148,7 +22148,7 @@ var createAdapterSchema = () => Schema_exports.declare(
22148
22148
  return input instanceof Function;
22149
22149
  },
22150
22150
  {
22151
- identifier: "createAdapter<Env>",
22151
+ identifier: "CreateAdapter<Env>",
22152
22152
  encode: identity,
22153
22153
  decode: identity
22154
22154
  }
@@ -22159,11 +22159,37 @@ var createPrismaStudioConfigSchema = () => Schema_exports.Struct({
22159
22159
  */
22160
22160
  createAdapter: createAdapterSchema()
22161
22161
  });
22162
+ var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22163
+ /**
22164
+ * Tell Prisma to use a single `.prisma` schema file.
22165
+ */
22166
+ kind: Schema_exports.Literal("single"),
22167
+ /**
22168
+ * The path to a single `.prisma` schema file.
22169
+ */
22170
+ filenamePath: Schema_exports.String
22171
+ });
22172
+ var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22173
+ /**
22174
+ * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
22175
+ */
22176
+ kind: Schema_exports.Literal("multi"),
22177
+ /**
22178
+ * The path to a folder containing multiple `.prisma` schema files.
22179
+ * All of the files in this folder will be used.
22180
+ */
22181
+ folder: Schema_exports.String
22182
+ });
22183
+ var PrismaSchemaConfigSchema = Schema_exports.Union(PrismaConfigSchemaSingleSchema, PrismaConfigSchemaMultiSchema);
22162
22184
  var createPrismaConfigSchema = () => Schema_exports.Struct({
22163
22185
  /**
22164
22186
  * Whether features with an unstable API are enabled.
22165
22187
  */
22166
22188
  earlyAccess: Schema_exports.Literal(true),
22189
+ /**
22190
+ * The configuration for the Prisma schema file(s).
22191
+ */
22192
+ schema: Schema_exports.optional(PrismaSchemaConfigSchema),
22167
22193
  /**
22168
22194
  * The configuration for Prisma Studio.
22169
22195
  */
@@ -1,7 +1,8 @@
1
+ import type { DeepMutable } from 'effect/Types';
1
2
  import type { PrismaConfig } from './PrismaConfig';
2
3
  /**
3
4
  * All default values for the config shall be set here.
4
5
  * Modules should not have to deal with missing config values and determining a default themselves as far as possible.
5
6
  * => Consistent defaults and centralized top-level control of configuration via the CLI.
6
7
  */
7
- export declare function defaultConfig(): PrismaConfig;
8
+ export declare function defaultConfig<Env = any>(): DeepMutable<PrismaConfig<Env>>;
@@ -26,7 +26,6 @@ module.exports = __toCommonJS(defaultConfig_exports);
26
26
  function defaultConfig() {
27
27
  return {
28
28
  earlyAccess: true,
29
- studio: void 0,
30
29
  loadedFromFile: null
31
30
  };
32
31
  }
@@ -1,5 +1,6 @@
1
+ import type { DeepMutable } from 'effect/Types';
1
2
  import type { PrismaConfig } from './PrismaConfig';
2
3
  /**
3
4
  * This default config can be used as basis for unit and integration tests.
4
5
  */
5
- export declare function defaultTestConfig(): PrismaConfig;
6
+ export declare function defaultTestConfig<Env = any>(): DeepMutable<PrismaConfig<Env>>;
@@ -1,5 +1,5 @@
1
1
  import type { DriverAdapter as QueryableDriverAdapter } from '@prisma/driver-adapter-utils';
2
- import type { PrismaConfig } from './PrismaConfig';
2
+ import type { PrismaConfig, PrismaSchemaConfigSchema } from './PrismaConfig';
3
3
  export type { PrismaConfig };
4
4
  /**
5
5
  * Define the configuration for the Prisma Development Kit.
@@ -10,6 +10,10 @@ export type PrismaConfigInput<Env> = {
10
10
  * Currently, every feature is considered experimental.
11
11
  */
12
12
  earlyAccess: true;
13
+ /**
14
+ * The location of the Prisma schema file(s).
15
+ */
16
+ schema?: PrismaSchemaConfigSchema;
13
17
  /**
14
18
  * The configuration for the Prisma Studio.
15
19
  */
@@ -22,4 +26,7 @@ export type PrismaConfigInput<Env> = {
22
26
  adapter: (env: Env) => Promise<QueryableDriverAdapter>;
23
27
  };
24
28
  };
29
+ /**
30
+ * Define the configuration for the Prisma Development Kit.
31
+ */
25
32
  export declare function defineConfig<Env>(configInput: PrismaConfigInput<Env>): PrismaConfig<Env>;
@@ -270,23 +270,38 @@ module.exports = __toCommonJS(defineConfig_exports);
270
270
  // ../driver-adapter-utils/dist/index.mjs
271
271
  var import_debug = __toESM(require_dist(), 1);
272
272
 
273
- // src/defineConfig.ts
274
- var debug = (0, import_debug.Debug)("prisma:config:defineConfig");
275
- function defineConfig(configInput) {
276
- const config = {
277
- // Currently, every feature is considered experimental.
273
+ // src/defaultConfig.ts
274
+ function defaultConfig() {
275
+ return {
278
276
  earlyAccess: true,
279
277
  loadedFromFile: null
280
- // will be overwritten after loading the config file from disk
281
278
  };
282
- if (configInput.studio) {
283
- config.studio = {
284
- createAdapter: configInput.studio.adapter
285
- };
286
- debug("Prisma config [studio]: %o", config.studio);
287
- }
279
+ }
280
+
281
+ // src/defineConfig.ts
282
+ var debug = (0, import_debug.Debug)("prisma:config:defineConfig");
283
+ function defineConfig(configInput) {
284
+ const config = defaultConfig();
285
+ defineSchemaConfig(config, configInput);
286
+ debug("Prisma config [schema]: %o", config.schema);
287
+ defineStudioConfig(config, configInput);
288
+ debug("Prisma config [studio]: %o", config.studio);
288
289
  return config;
289
290
  }
291
+ function defineSchemaConfig(config, configInput) {
292
+ if (!configInput.schema) {
293
+ return;
294
+ }
295
+ config.schema = configInput.schema;
296
+ }
297
+ function defineStudioConfig(config, configInput) {
298
+ if (!configInput.studio) {
299
+ return;
300
+ }
301
+ config.studio = {
302
+ createAdapter: configInput.studio.adapter
303
+ };
304
+ }
290
305
  // Annotate the CommonJS export names for ESM import in node:
291
306
  0 && (module.exports = {
292
307
  defineConfig
package/dist/index.js CHANGED
@@ -283,7 +283,6 @@ module.exports = __toCommonJS(index_exports);
283
283
  function defaultConfig() {
284
284
  return {
285
285
  earlyAccess: true,
286
- studio: void 0,
287
286
  loadedFromFile: null
288
287
  };
289
288
  }
@@ -302,20 +301,27 @@ var import_debug = __toESM(require_dist(), 1);
302
301
  // src/defineConfig.ts
303
302
  var debug = (0, import_debug.Debug)("prisma:config:defineConfig");
304
303
  function defineConfig(configInput) {
305
- const config2 = {
306
- // Currently, every feature is considered experimental.
307
- earlyAccess: true,
308
- loadedFromFile: null
309
- // will be overwritten after loading the config file from disk
310
- };
311
- if (configInput.studio) {
312
- config2.studio = {
313
- createAdapter: configInput.studio.adapter
314
- };
315
- debug("Prisma config [studio]: %o", config2.studio);
316
- }
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);
317
309
  return config2;
318
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
+ }
319
325
 
320
326
  // src/loadConfigFromFile.ts
321
327
  var import_node_fs = __toESM(require("node:fs"));
@@ -22555,7 +22561,7 @@ var createAdapterSchema = () => Schema_exports.declare(
22555
22561
  return input instanceof Function;
22556
22562
  },
22557
22563
  {
22558
- identifier: "createAdapter<Env>",
22564
+ identifier: "CreateAdapter<Env>",
22559
22565
  encode: identity,
22560
22566
  decode: identity
22561
22567
  }
@@ -22566,11 +22572,37 @@ var createPrismaStudioConfigSchema = () => Schema_exports.Struct({
22566
22572
  */
22567
22573
  createAdapter: createAdapterSchema()
22568
22574
  });
22575
+ var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22576
+ /**
22577
+ * Tell Prisma to use a single `.prisma` schema file.
22578
+ */
22579
+ kind: Schema_exports.Literal("single"),
22580
+ /**
22581
+ * The path to a single `.prisma` schema file.
22582
+ */
22583
+ filenamePath: Schema_exports.String
22584
+ });
22585
+ var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22586
+ /**
22587
+ * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
22588
+ */
22589
+ kind: Schema_exports.Literal("multi"),
22590
+ /**
22591
+ * The path to a folder containing multiple `.prisma` schema files.
22592
+ * All of the files in this folder will be used.
22593
+ */
22594
+ folder: Schema_exports.String
22595
+ });
22596
+ var PrismaSchemaConfigSchema = Schema_exports.Union(PrismaConfigSchemaSingleSchema, PrismaConfigSchemaMultiSchema);
22569
22597
  var createPrismaConfigSchema = () => Schema_exports.Struct({
22570
22598
  /**
22571
22599
  * Whether features with an unstable API are enabled.
22572
22600
  */
22573
22601
  earlyAccess: Schema_exports.Literal(true),
22602
+ /**
22603
+ * The configuration for the Prisma schema file(s).
22604
+ */
22605
+ schema: Schema_exports.optional(PrismaSchemaConfigSchema),
22574
22606
  /**
22575
22607
  * The configuration for Prisma Studio.
22576
22608
  */
@@ -22515,7 +22515,7 @@ var createAdapterSchema = () => Schema_exports.declare(
22515
22515
  return input instanceof Function;
22516
22516
  },
22517
22517
  {
22518
- identifier: "createAdapter<Env>",
22518
+ identifier: "CreateAdapter<Env>",
22519
22519
  encode: identity,
22520
22520
  decode: identity
22521
22521
  }
@@ -22526,11 +22526,37 @@ var createPrismaStudioConfigSchema = () => Schema_exports.Struct({
22526
22526
  */
22527
22527
  createAdapter: createAdapterSchema()
22528
22528
  });
22529
+ var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22530
+ /**
22531
+ * Tell Prisma to use a single `.prisma` schema file.
22532
+ */
22533
+ kind: Schema_exports.Literal("single"),
22534
+ /**
22535
+ * The path to a single `.prisma` schema file.
22536
+ */
22537
+ filenamePath: Schema_exports.String
22538
+ });
22539
+ var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22540
+ /**
22541
+ * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
22542
+ */
22543
+ kind: Schema_exports.Literal("multi"),
22544
+ /**
22545
+ * The path to a folder containing multiple `.prisma` schema files.
22546
+ * All of the files in this folder will be used.
22547
+ */
22548
+ folder: Schema_exports.String
22549
+ });
22550
+ var PrismaSchemaConfigSchema = Schema_exports.Union(PrismaConfigSchemaSingleSchema, PrismaConfigSchemaMultiSchema);
22529
22551
  var createPrismaConfigSchema = () => Schema_exports.Struct({
22530
22552
  /**
22531
22553
  * Whether features with an unstable API are enabled.
22532
22554
  */
22533
22555
  earlyAccess: Schema_exports.Literal(true),
22556
+ /**
22557
+ * The configuration for the Prisma schema file(s).
22558
+ */
22559
+ schema: Schema_exports.optional(PrismaSchemaConfigSchema),
22534
22560
  /**
22535
22561
  * The configuration for Prisma Studio.
22536
22562
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/config",
3
- "version": "6.4.0-dev.45",
3
+ "version": "6.4.0-dev.46",
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.45",
22
- "@prisma/get-platform": "6.4.0-dev.45"
21
+ "@prisma/driver-adapter-utils": "6.4.0-dev.46",
22
+ "@prisma/get-platform": "6.4.0-dev.46"
23
23
  },
24
24
  "files": [
25
25
  "dist"