@prisma/config 6.4.0-dev.45 → 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/PrismaConfig.d.ts +57 -11
- package/dist/PrismaConfig.js +47 -16
- package/dist/defaultConfig.d.ts +3 -2
- package/dist/defaultConfig.js +22189 -8
- package/dist/defaultTestConfig.d.ts +3 -2
- package/dist/defaultTestConfig.js +22189 -7
- package/dist/defineConfig.d.ts +12 -5
- package/dist/defineConfig.js +22243 -48
- package/dist/index.d.ts +1 -1
- package/dist/index.js +93 -60
- package/dist/loadConfigFromFile.d.ts +2 -2
- package/dist/loadConfigFromFile.js +44 -15
- package/package.json +3 -3
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 {
|
|
5
|
+
export type { PrismaConfigInternal } from './PrismaConfig';
|
package/dist/index.js
CHANGED
|
@@ -279,49 +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
|
-
studio: void 0,
|
|
287
|
-
loadedFromFile: null
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// src/defaultTestConfig.ts
|
|
292
|
-
function defaultTestConfig() {
|
|
293
|
-
return {
|
|
294
|
-
earlyAccess: true,
|
|
295
|
-
loadedFromFile: null
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// ../driver-adapter-utils/dist/index.mjs
|
|
300
|
-
var import_debug = __toESM(require_dist(), 1);
|
|
301
|
-
|
|
302
|
-
// src/defineConfig.ts
|
|
303
|
-
var debug = (0, import_debug.Debug)("prisma:config:defineConfig");
|
|
304
|
-
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
|
-
}
|
|
317
|
-
return config2;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// src/loadConfigFromFile.ts
|
|
321
|
-
var import_node_fs = __toESM(require("node:fs"));
|
|
322
|
-
var import_node_path = __toESM(require("node:path"));
|
|
323
|
-
var import_node_process = __toESM(require("node:process"));
|
|
324
|
-
|
|
325
282
|
// ../../node_modules/.pnpm/effect@3.12.10/node_modules/effect/dist/esm/Function.js
|
|
326
283
|
var isFunction = (input) => typeof input === "function";
|
|
327
284
|
var dual = function(arity, body) {
|
|
@@ -11614,7 +11571,7 @@ var Fatal = logLevelFatal;
|
|
|
11614
11571
|
var Error2 = logLevelError;
|
|
11615
11572
|
var Warning = logLevelWarning;
|
|
11616
11573
|
var Info = logLevelInfo;
|
|
11617
|
-
var
|
|
11574
|
+
var Debug = logLevelDebug;
|
|
11618
11575
|
var Trace = logLevelTrace;
|
|
11619
11576
|
var None3 = logLevelNone;
|
|
11620
11577
|
var Order5 = /* @__PURE__ */ pipe(Order, /* @__PURE__ */ mapInput2((level) => level.ordinal));
|
|
@@ -11624,7 +11581,7 @@ var fromLiteral = (literal2) => {
|
|
|
11624
11581
|
case "All":
|
|
11625
11582
|
return All;
|
|
11626
11583
|
case "Debug":
|
|
11627
|
-
return
|
|
11584
|
+
return Debug;
|
|
11628
11585
|
case "Error":
|
|
11629
11586
|
return Error2;
|
|
11630
11587
|
case "Fatal":
|
|
@@ -22550,44 +22507,120 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22550
22507
|
};
|
|
22551
22508
|
|
|
22552
22509
|
// src/PrismaConfig.ts
|
|
22553
|
-
var
|
|
22510
|
+
var createAdapterShape = () => Schema_exports.declare(
|
|
22554
22511
|
(input) => {
|
|
22555
22512
|
return input instanceof Function;
|
|
22556
22513
|
},
|
|
22557
22514
|
{
|
|
22558
|
-
identifier: "
|
|
22515
|
+
identifier: "CreateAdapter<Env>",
|
|
22559
22516
|
encode: identity,
|
|
22560
22517
|
decode: identity
|
|
22561
22518
|
}
|
|
22562
22519
|
);
|
|
22563
|
-
var
|
|
22520
|
+
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22564
22521
|
/**
|
|
22565
22522
|
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22566
22523
|
*/
|
|
22567
|
-
createAdapter:
|
|
22524
|
+
createAdapter: createAdapterShape()
|
|
22568
22525
|
});
|
|
22569
|
-
var
|
|
22526
|
+
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22527
|
+
/**
|
|
22528
|
+
* Tell Prisma to use a single `.prisma` schema file.
|
|
22529
|
+
*/
|
|
22530
|
+
kind: Schema_exports.Literal("single"),
|
|
22570
22531
|
/**
|
|
22571
|
-
*
|
|
22532
|
+
* The path to a single `.prisma` schema file.
|
|
22572
22533
|
*/
|
|
22573
|
-
|
|
22534
|
+
filenamePath: Schema_exports.String
|
|
22535
|
+
});
|
|
22536
|
+
var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
22574
22537
|
/**
|
|
22575
|
-
*
|
|
22538
|
+
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
22576
22539
|
*/
|
|
22577
|
-
|
|
22540
|
+
kind: Schema_exports.Literal("multi"),
|
|
22578
22541
|
/**
|
|
22579
|
-
* The path
|
|
22580
|
-
*
|
|
22542
|
+
* The path to a folder containing multiple `.prisma` schema files.
|
|
22543
|
+
* All of the files in this folder will be used.
|
|
22581
22544
|
*/
|
|
22582
|
-
|
|
22545
|
+
folder: Schema_exports.String
|
|
22583
22546
|
});
|
|
22584
|
-
|
|
22585
|
-
|
|
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, {
|
|
22586
22572
|
onExcessProperty: "error"
|
|
22587
22573
|
});
|
|
22588
22574
|
}
|
|
22589
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
|
+
|
|
22590
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"));
|
|
22591
22624
|
var debug2 = (0, import_debug.Debug)("prisma:config:loadConfigFromFile");
|
|
22592
22625
|
async function loadConfigFromFile({
|
|
22593
22626
|
configFile,
|
|
@@ -22618,7 +22651,7 @@ async function loadConfigFromFile({
|
|
|
22618
22651
|
};
|
|
22619
22652
|
}
|
|
22620
22653
|
debug2(`Config file loaded in %s`, getTime());
|
|
22621
|
-
const parseResultEither =
|
|
22654
|
+
const parseResultEither = parsePrismaConfigInternalShape(required3["default"]);
|
|
22622
22655
|
if (Either_exports.isLeft(parseResultEither)) {
|
|
22623
22656
|
return {
|
|
22624
22657
|
resolvedPath,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ParseError } from 'effect/ParseResult';
|
|
2
|
-
import type {
|
|
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:
|
|
27
|
+
config: PrismaConfigInternal<any>;
|
|
28
28
|
error?: never;
|
|
29
29
|
} | {
|
|
30
30
|
resolvedPath: string;
|
|
@@ -22510,39 +22510,68 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22510
22510
|
};
|
|
22511
22511
|
|
|
22512
22512
|
// src/PrismaConfig.ts
|
|
22513
|
-
var
|
|
22513
|
+
var createAdapterShape = () => Schema_exports.declare(
|
|
22514
22514
|
(input) => {
|
|
22515
22515
|
return input instanceof Function;
|
|
22516
22516
|
},
|
|
22517
22517
|
{
|
|
22518
|
-
identifier: "
|
|
22518
|
+
identifier: "CreateAdapter<Env>",
|
|
22519
22519
|
encode: identity,
|
|
22520
22520
|
decode: identity
|
|
22521
22521
|
}
|
|
22522
22522
|
);
|
|
22523
|
-
var
|
|
22523
|
+
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22524
22524
|
/**
|
|
22525
22525
|
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22526
22526
|
*/
|
|
22527
|
-
createAdapter:
|
|
22527
|
+
createAdapter: createAdapterShape()
|
|
22528
22528
|
});
|
|
22529
|
-
var
|
|
22529
|
+
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22530
22530
|
/**
|
|
22531
|
-
*
|
|
22531
|
+
* Tell Prisma to use a single `.prisma` schema file.
|
|
22532
22532
|
*/
|
|
22533
|
-
|
|
22533
|
+
kind: Schema_exports.Literal("single"),
|
|
22534
22534
|
/**
|
|
22535
|
-
* The
|
|
22535
|
+
* The path to a single `.prisma` schema file.
|
|
22536
22536
|
*/
|
|
22537
|
-
|
|
22537
|
+
filenamePath: Schema_exports.String
|
|
22538
|
+
});
|
|
22539
|
+
var PrismaConfigSchemaMultiShape = 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"),
|
|
22538
22544
|
/**
|
|
22539
|
-
* The path
|
|
22540
|
-
*
|
|
22545
|
+
* The path to a folder containing multiple `.prisma` schema files.
|
|
22546
|
+
* All of the files in this folder will be used.
|
|
22541
22547
|
*/
|
|
22542
|
-
|
|
22548
|
+
folder: Schema_exports.String
|
|
22543
22549
|
});
|
|
22544
|
-
|
|
22545
|
-
|
|
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, {
|
|
22546
22575
|
onExcessProperty: "error"
|
|
22547
22576
|
});
|
|
22548
22577
|
}
|
|
@@ -22578,7 +22607,7 @@ async function loadConfigFromFile({
|
|
|
22578
22607
|
};
|
|
22579
22608
|
}
|
|
22580
22609
|
debug(`Config file loaded in %s`, getTime());
|
|
22581
|
-
const parseResultEither =
|
|
22610
|
+
const parseResultEither = parsePrismaConfigInternalShape(required3["default"]);
|
|
22582
22611
|
if (Either_exports.isLeft(parseResultEither)) {
|
|
22583
22612
|
return {
|
|
22584
22613
|
resolvedPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/config",
|
|
3
|
-
"version": "6.4.0-dev.
|
|
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/
|
|
22
|
-
"@prisma/
|
|
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"
|