@prisma/config 6.4.0-dev.40 → 6.4.0-dev.42

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.
@@ -4,6 +4,10 @@ export type PrismaConfig<Env = any> = {
4
4
  * Whether experimental features are enabled.
5
5
  */
6
6
  experimental: true;
7
+ /**
8
+ * The path from where the config was loaded. `null` if no config file was found and only default config is applied.
9
+ */
10
+ loadedFromFile: string | null;
7
11
  /**
8
12
  * The configuration for Prisma Studio.
9
13
  */
@@ -0,0 +1,7 @@
1
+ import { PrismaConfig } from './PrismaConfig';
2
+ /**
3
+ * All default values for the config shall be set here.
4
+ * Modules should not have to deal with missing config values and determining a default themselves as far as possible.
5
+ * => Consistent defaults and centralized top-level control of configuration via the CLI.
6
+ */
7
+ export declare function defaultConfig(): PrismaConfig;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/defaultConfig.ts
21
+ var defaultConfig_exports = {};
22
+ __export(defaultConfig_exports, {
23
+ defaultConfig: () => defaultConfig
24
+ });
25
+ module.exports = __toCommonJS(defaultConfig_exports);
26
+ function defaultConfig() {
27
+ return {
28
+ experimental: true,
29
+ studio: void 0,
30
+ loadedFromFile: null
31
+ };
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ defaultConfig
36
+ });
@@ -0,0 +1,5 @@
1
+ import { PrismaConfig } from './PrismaConfig';
2
+ /**
3
+ * This default config can be used as basis for unit and integration tests.
4
+ */
5
+ export declare function defaultTestConfig(): PrismaConfig;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/defaultTestConfig.ts
21
+ var defaultTestConfig_exports = {};
22
+ __export(defaultTestConfig_exports, {
23
+ defaultTestConfig: () => defaultTestConfig
24
+ });
25
+ module.exports = __toCommonJS(defaultTestConfig_exports);
26
+ function defaultTestConfig() {
27
+ return {
28
+ experimental: true,
29
+ loadedFromFile: null
30
+ };
31
+ }
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ defaultTestConfig
35
+ });
@@ -275,7 +275,9 @@ var debug = (0, import_debug.Debug)("prisma:config:defineConfig");
275
275
  function defineConfig(configInput) {
276
276
  const config = {
277
277
  // Currently, every feature is considered experimental.
278
- experimental: true
278
+ experimental: true,
279
+ loadedFromFile: null
280
+ // will be overwritten after loading the config file from disk
279
281
  };
280
282
  if (configInput.studio) {
281
283
  config.studio = {
package/dist/index.d.ts CHANGED
@@ -1,2 +1,5 @@
1
+ export { defaultConfig } from './defaultConfig';
2
+ export { defaultTestConfig } from './defaultTestConfig';
1
3
  export { defineConfig } from './defineConfig';
2
4
  export { type ConfigFromFile, loadConfigFromFile, type LoadConfigFromFileError } from './loadConfigFromFile';
5
+ export type { PrismaConfig } from './PrismaConfig';
package/dist/index.js CHANGED
@@ -263,11 +263,30 @@ var require_dist = __commonJS({
263
263
  // src/index.ts
264
264
  var index_exports = {};
265
265
  __export(index_exports, {
266
+ defaultConfig: () => defaultConfig,
267
+ defaultTestConfig: () => defaultTestConfig,
266
268
  defineConfig: () => defineConfig,
267
269
  loadConfigFromFile: () => loadConfigFromFile
268
270
  });
269
271
  module.exports = __toCommonJS(index_exports);
270
272
 
273
+ // src/defaultConfig.ts
274
+ function defaultConfig() {
275
+ return {
276
+ experimental: true,
277
+ studio: void 0,
278
+ loadedFromFile: null
279
+ };
280
+ }
281
+
282
+ // src/defaultTestConfig.ts
283
+ function defaultTestConfig() {
284
+ return {
285
+ experimental: true,
286
+ loadedFromFile: null
287
+ };
288
+ }
289
+
271
290
  // ../driver-adapter-utils/dist/index.mjs
272
291
  var import_debug = __toESM(require_dist(), 1);
273
292
 
@@ -276,7 +295,9 @@ var debug = (0, import_debug.Debug)("prisma:config:defineConfig");
276
295
  function defineConfig(configInput) {
277
296
  const config = {
278
297
  // Currently, every feature is considered experimental.
279
- experimental: true
298
+ experimental: true,
299
+ loadedFromFile: null
300
+ // will be overwritten after loading the config file from disk
280
301
  };
281
302
  if (configInput.studio) {
282
303
  config.studio = {
@@ -330,7 +351,10 @@ async function loadConfigFromFile({
330
351
  };
331
352
  }
332
353
  return {
333
- config: required["default"],
354
+ config: {
355
+ ...required["default"],
356
+ loadedFromFile: resolvedPath
357
+ },
334
358
  resolvedPath
335
359
  };
336
360
  } catch (e) {
@@ -370,6 +394,8 @@ async function requireTypeScriptFile(resolvedPath) {
370
394
  }
371
395
  // Annotate the CommonJS export names for ESM import in node:
372
396
  0 && (module.exports = {
397
+ defaultConfig,
398
+ defaultTestConfig,
373
399
  defineConfig,
374
400
  loadConfigFromFile
375
401
  });
@@ -313,7 +313,10 @@ async function loadConfigFromFile({
313
313
  };
314
314
  }
315
315
  return {
316
- config: required["default"],
316
+ config: {
317
+ ...required["default"],
318
+ loadedFromFile: resolvedPath
319
+ },
317
320
  resolvedPath
318
321
  };
319
322
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/config",
3
- "version": "6.4.0-dev.40",
3
+ "version": "6.4.0-dev.42",
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",
@@ -17,8 +17,8 @@
17
17
  "esbuild-register": "3.6.0",
18
18
  "jest": "29.7.0",
19
19
  "jest-junit": "16.0.0",
20
- "@prisma/driver-adapter-utils": "6.4.0-dev.40",
21
- "@prisma/get-platform": "6.4.0-dev.40"
20
+ "@prisma/driver-adapter-utils": "6.4.0-dev.42",
21
+ "@prisma/get-platform": "6.4.0-dev.42"
22
22
  },
23
23
  "files": [
24
24
  "dist"