@prisma/config 6.4.0-integration-push-rxrkoptlzzms.1 → 6.4.1-dev.1
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 +43 -14
- package/dist/PrismaConfig.js +23 -24
- package/dist/defaultConfig.d.ts +1 -1
- package/dist/defaultConfig.js +2 -22
- package/dist/defaultTestConfig.d.ts +1 -1
- package/dist/defaultTestConfig.js +2 -22
- package/dist/defineConfig.d.ts +2 -28
- package/dist/defineConfig.js +2 -32
- package/dist/index.d.ts +2 -1
- package/dist/index.js +32 -35
- package/dist/loadConfigFromFile.d.ts +2 -2
- package/dist/loadConfigFromFile.js +60 -30
- package/package.json +3 -3
package/dist/PrismaConfig.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DriverAdapter as QueryableDriverAdapter } from '@prisma/driver-adapter-utils';
|
|
2
1
|
import { Schema as Shape } from 'effect';
|
|
3
2
|
import type { Either } from 'effect/Either';
|
|
4
3
|
import type { ParseError } from 'effect/ParseResult';
|
|
@@ -10,7 +9,7 @@ declare const PrismaSchemaConfigShape: Shape.Union<[Shape.Struct<{
|
|
|
10
9
|
/**
|
|
11
10
|
* The path to a single `.prisma` schema file.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
filePath: typeof Shape.String;
|
|
14
13
|
}>, Shape.Struct<{
|
|
15
14
|
/**
|
|
16
15
|
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
@@ -20,10 +19,10 @@ declare const PrismaSchemaConfigShape: Shape.Union<[Shape.Struct<{
|
|
|
20
19
|
* The path to a folder containing multiple `.prisma` schema files.
|
|
21
20
|
* All of the files in this folder will be used.
|
|
22
21
|
*/
|
|
23
|
-
|
|
22
|
+
folderPath: typeof Shape.String;
|
|
24
23
|
}>]>;
|
|
25
24
|
export type PrismaSchemaConfigShape = typeof PrismaSchemaConfigShape.Type;
|
|
26
|
-
export declare const
|
|
25
|
+
export declare const createPrismaConfigShape: () => Shape.Struct<{
|
|
27
26
|
/**
|
|
28
27
|
* Whether features with an unstable API are enabled.
|
|
29
28
|
*/
|
|
@@ -39,7 +38,7 @@ export declare const createPrismaConfigInternalShape: <Env = any>() => Shape.bra
|
|
|
39
38
|
/**
|
|
40
39
|
* The path to a single `.prisma` schema file.
|
|
41
40
|
*/
|
|
42
|
-
|
|
41
|
+
filePath: typeof Shape.String;
|
|
43
42
|
}>, Shape.Struct<{
|
|
44
43
|
/**
|
|
45
44
|
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
@@ -49,17 +48,47 @@ export declare const createPrismaConfigInternalShape: <Env = any>() => Shape.bra
|
|
|
49
48
|
* The path to a folder containing multiple `.prisma` schema files.
|
|
50
49
|
* All of the files in this folder will be used.
|
|
51
50
|
*/
|
|
52
|
-
|
|
51
|
+
folderPath: typeof Shape.String;
|
|
53
52
|
}>]>>;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* The configuration for the Prisma Development Kit, before it is passed to the `defineConfig` function.
|
|
56
|
+
* Thanks to the branding, this type is opaque and cannot be constructed directly.
|
|
57
|
+
*/
|
|
58
|
+
export type PrismaConfig = ReturnType<typeof createPrismaConfigShape>['Type'];
|
|
59
|
+
/**
|
|
60
|
+
* Parse a given input object to ensure it conforms to the `PrismaConfig` type Shape.
|
|
61
|
+
* This function may fail, but it will never throw.
|
|
62
|
+
*/
|
|
63
|
+
export declare function parsePrismaConfigShape(input: unknown): Either<PrismaConfig, ParseError>;
|
|
64
|
+
export declare const createPrismaConfigInternalShape: () => Shape.brand<Shape.Struct<{
|
|
54
65
|
/**
|
|
55
|
-
*
|
|
66
|
+
* Whether features with an unstable API are enabled.
|
|
56
67
|
*/
|
|
57
|
-
|
|
68
|
+
earlyAccess: Shape.Literal<[true]>;
|
|
69
|
+
/**
|
|
70
|
+
* The configuration for the Prisma schema file(s).
|
|
71
|
+
*/
|
|
72
|
+
schema: Shape.optional<Shape.Union<[Shape.Struct<{
|
|
58
73
|
/**
|
|
59
|
-
*
|
|
74
|
+
* Tell Prisma to use a single `.prisma` schema file.
|
|
60
75
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
kind: Shape.Literal<["single"]>;
|
|
77
|
+
/**
|
|
78
|
+
* The path to a single `.prisma` schema file.
|
|
79
|
+
*/
|
|
80
|
+
filePath: typeof Shape.String;
|
|
81
|
+
}>, Shape.Struct<{
|
|
82
|
+
/**
|
|
83
|
+
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
84
|
+
*/
|
|
85
|
+
kind: Shape.Literal<["multi"]>;
|
|
86
|
+
/**
|
|
87
|
+
* The path to a folder containing multiple `.prisma` schema files.
|
|
88
|
+
* All of the files in this folder will be used.
|
|
89
|
+
*/
|
|
90
|
+
folderPath: typeof Shape.String;
|
|
91
|
+
}>]>>;
|
|
63
92
|
/**
|
|
64
93
|
* The path from where the config was loaded.
|
|
65
94
|
* It's set to `null` if no config file was found and only default config is applied.
|
|
@@ -71,10 +100,10 @@ export declare const createPrismaConfigInternalShape: <Env = any>() => Shape.bra
|
|
|
71
100
|
* by the `defineConfig` function.
|
|
72
101
|
* Thanks to the branding, this type is opaque and cannot be constructed directly.
|
|
73
102
|
*/
|
|
74
|
-
export type PrismaConfigInternal
|
|
103
|
+
export type PrismaConfigInternal = ReturnType<typeof createPrismaConfigInternalShape>['Type'];
|
|
75
104
|
/**
|
|
76
|
-
* Parse a given input object to ensure it conforms to the `
|
|
105
|
+
* Parse a given input object to ensure it conforms to the `PrismaConfigInternal` type Shape.
|
|
77
106
|
* This function may fail, but it will never throw.
|
|
78
107
|
*/
|
|
79
|
-
export declare function parsePrismaConfigInternalShape
|
|
108
|
+
export declare function parsePrismaConfigInternalShape(input: unknown): Either<PrismaConfigInternal, ParseError>;
|
|
80
109
|
export {};
|
package/dist/PrismaConfig.js
CHANGED
|
@@ -30,7 +30,9 @@ var __privateSet = (obj, member, value3, setter) => (__accessCheck(obj, member,
|
|
|
30
30
|
var PrismaConfig_exports = {};
|
|
31
31
|
__export(PrismaConfig_exports, {
|
|
32
32
|
createPrismaConfigInternalShape: () => createPrismaConfigInternalShape,
|
|
33
|
-
|
|
33
|
+
createPrismaConfigShape: () => createPrismaConfigShape,
|
|
34
|
+
parsePrismaConfigInternalShape: () => parsePrismaConfigInternalShape,
|
|
35
|
+
parsePrismaConfigShape: () => parsePrismaConfigShape
|
|
34
36
|
});
|
|
35
37
|
module.exports = __toCommonJS(PrismaConfig_exports);
|
|
36
38
|
|
|
@@ -22144,22 +22146,6 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22144
22146
|
};
|
|
22145
22147
|
|
|
22146
22148
|
// src/PrismaConfig.ts
|
|
22147
|
-
var createAdapterShape = () => Schema_exports.declare(
|
|
22148
|
-
(input) => {
|
|
22149
|
-
return input instanceof Function;
|
|
22150
|
-
},
|
|
22151
|
-
{
|
|
22152
|
-
identifier: "CreateAdapter<Env>",
|
|
22153
|
-
encode: identity,
|
|
22154
|
-
decode: identity
|
|
22155
|
-
}
|
|
22156
|
-
);
|
|
22157
|
-
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22158
|
-
/**
|
|
22159
|
-
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22160
|
-
*/
|
|
22161
|
-
createAdapter: createAdapterShape()
|
|
22162
|
-
});
|
|
22163
22149
|
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22164
22150
|
/**
|
|
22165
22151
|
* Tell Prisma to use a single `.prisma` schema file.
|
|
@@ -22168,7 +22154,7 @@ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
|
22168
22154
|
/**
|
|
22169
22155
|
* The path to a single `.prisma` schema file.
|
|
22170
22156
|
*/
|
|
22171
|
-
|
|
22157
|
+
filePath: Schema_exports.String
|
|
22172
22158
|
});
|
|
22173
22159
|
var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
22174
22160
|
/**
|
|
@@ -22179,9 +22165,24 @@ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
|
22179
22165
|
* The path to a folder containing multiple `.prisma` schema files.
|
|
22180
22166
|
* All of the files in this folder will be used.
|
|
22181
22167
|
*/
|
|
22182
|
-
|
|
22168
|
+
folderPath: Schema_exports.String
|
|
22183
22169
|
});
|
|
22184
22170
|
var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
|
|
22171
|
+
var createPrismaConfigShape = () => Schema_exports.Struct({
|
|
22172
|
+
/**
|
|
22173
|
+
* Whether features with an unstable API are enabled.
|
|
22174
|
+
*/
|
|
22175
|
+
earlyAccess: Schema_exports.Literal(true),
|
|
22176
|
+
/**
|
|
22177
|
+
* The configuration for the Prisma schema file(s).
|
|
22178
|
+
*/
|
|
22179
|
+
schema: Schema_exports.optional(PrismaSchemaConfigShape)
|
|
22180
|
+
});
|
|
22181
|
+
function parsePrismaConfigShape(input) {
|
|
22182
|
+
return Schema_exports.decodeUnknownEither(createPrismaConfigShape(), {})(input, {
|
|
22183
|
+
onExcessProperty: "error"
|
|
22184
|
+
});
|
|
22185
|
+
}
|
|
22185
22186
|
var createPrismaConfigInternalShape = () => pipe(
|
|
22186
22187
|
Schema_exports.Struct({
|
|
22187
22188
|
/**
|
|
@@ -22192,10 +22193,6 @@ var createPrismaConfigInternalShape = () => pipe(
|
|
|
22192
22193
|
* The configuration for the Prisma schema file(s).
|
|
22193
22194
|
*/
|
|
22194
22195
|
schema: Schema_exports.optional(PrismaSchemaConfigShape),
|
|
22195
|
-
/**
|
|
22196
|
-
* The configuration for Prisma Studio.
|
|
22197
|
-
*/
|
|
22198
|
-
studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
|
|
22199
22196
|
/**
|
|
22200
22197
|
* The path from where the config was loaded.
|
|
22201
22198
|
* It's set to `null` if no config file was found and only default config is applied.
|
|
@@ -22212,5 +22209,7 @@ function parsePrismaConfigInternalShape(input) {
|
|
|
22212
22209
|
// Annotate the CommonJS export names for ESM import in node:
|
|
22213
22210
|
0 && (module.exports = {
|
|
22214
22211
|
createPrismaConfigInternalShape,
|
|
22215
|
-
|
|
22212
|
+
createPrismaConfigShape,
|
|
22213
|
+
parsePrismaConfigInternalShape,
|
|
22214
|
+
parsePrismaConfigShape
|
|
22216
22215
|
});
|
package/dist/defaultConfig.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ import { type PrismaConfigInternal } from './PrismaConfig';
|
|
|
5
5
|
* Modules should not have to deal with missing config values and determining a default themselves as far as possible.
|
|
6
6
|
* => Consistent defaults and centralized top-level control of configuration via the CLI.
|
|
7
7
|
*/
|
|
8
|
-
export declare function defaultConfig
|
|
8
|
+
export declare function defaultConfig(): DeepMutable<PrismaConfigInternal>;
|
package/dist/defaultConfig.js
CHANGED
|
@@ -22143,22 +22143,6 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22143
22143
|
};
|
|
22144
22144
|
|
|
22145
22145
|
// src/PrismaConfig.ts
|
|
22146
|
-
var createAdapterShape = () => Schema_exports.declare(
|
|
22147
|
-
(input) => {
|
|
22148
|
-
return input instanceof Function;
|
|
22149
|
-
},
|
|
22150
|
-
{
|
|
22151
|
-
identifier: "CreateAdapter<Env>",
|
|
22152
|
-
encode: identity,
|
|
22153
|
-
decode: identity
|
|
22154
|
-
}
|
|
22155
|
-
);
|
|
22156
|
-
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22157
|
-
/**
|
|
22158
|
-
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22159
|
-
*/
|
|
22160
|
-
createAdapter: createAdapterShape()
|
|
22161
|
-
});
|
|
22162
22146
|
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22163
22147
|
/**
|
|
22164
22148
|
* Tell Prisma to use a single `.prisma` schema file.
|
|
@@ -22167,7 +22151,7 @@ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
|
22167
22151
|
/**
|
|
22168
22152
|
* The path to a single `.prisma` schema file.
|
|
22169
22153
|
*/
|
|
22170
|
-
|
|
22154
|
+
filePath: Schema_exports.String
|
|
22171
22155
|
});
|
|
22172
22156
|
var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
22173
22157
|
/**
|
|
@@ -22178,7 +22162,7 @@ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
|
22178
22162
|
* The path to a folder containing multiple `.prisma` schema files.
|
|
22179
22163
|
* All of the files in this folder will be used.
|
|
22180
22164
|
*/
|
|
22181
|
-
|
|
22165
|
+
folderPath: Schema_exports.String
|
|
22182
22166
|
});
|
|
22183
22167
|
var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
|
|
22184
22168
|
var createPrismaConfigInternalShape = () => pipe(
|
|
@@ -22191,10 +22175,6 @@ var createPrismaConfigInternalShape = () => pipe(
|
|
|
22191
22175
|
* The configuration for the Prisma schema file(s).
|
|
22192
22176
|
*/
|
|
22193
22177
|
schema: Schema_exports.optional(PrismaSchemaConfigShape),
|
|
22194
|
-
/**
|
|
22195
|
-
* The configuration for Prisma Studio.
|
|
22196
|
-
*/
|
|
22197
|
-
studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
|
|
22198
22178
|
/**
|
|
22199
22179
|
* The path from where the config was loaded.
|
|
22200
22180
|
* It's set to `null` if no config file was found and only default config is applied.
|
|
@@ -3,4 +3,4 @@ import { type PrismaConfigInternal } from './PrismaConfig';
|
|
|
3
3
|
/**
|
|
4
4
|
* This default config can be used as basis for unit and integration tests.
|
|
5
5
|
*/
|
|
6
|
-
export declare function defaultTestConfig
|
|
6
|
+
export declare function defaultTestConfig(): DeepMutable<PrismaConfigInternal>;
|
|
@@ -22143,22 +22143,6 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22143
22143
|
};
|
|
22144
22144
|
|
|
22145
22145
|
// src/PrismaConfig.ts
|
|
22146
|
-
var createAdapterShape = () => Schema_exports.declare(
|
|
22147
|
-
(input) => {
|
|
22148
|
-
return input instanceof Function;
|
|
22149
|
-
},
|
|
22150
|
-
{
|
|
22151
|
-
identifier: "CreateAdapter<Env>",
|
|
22152
|
-
encode: identity,
|
|
22153
|
-
decode: identity
|
|
22154
|
-
}
|
|
22155
|
-
);
|
|
22156
|
-
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22157
|
-
/**
|
|
22158
|
-
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22159
|
-
*/
|
|
22160
|
-
createAdapter: createAdapterShape()
|
|
22161
|
-
});
|
|
22162
22146
|
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22163
22147
|
/**
|
|
22164
22148
|
* Tell Prisma to use a single `.prisma` schema file.
|
|
@@ -22167,7 +22151,7 @@ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
|
22167
22151
|
/**
|
|
22168
22152
|
* The path to a single `.prisma` schema file.
|
|
22169
22153
|
*/
|
|
22170
|
-
|
|
22154
|
+
filePath: Schema_exports.String
|
|
22171
22155
|
});
|
|
22172
22156
|
var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
22173
22157
|
/**
|
|
@@ -22178,7 +22162,7 @@ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
|
22178
22162
|
* The path to a folder containing multiple `.prisma` schema files.
|
|
22179
22163
|
* All of the files in this folder will be used.
|
|
22180
22164
|
*/
|
|
22181
|
-
|
|
22165
|
+
folderPath: Schema_exports.String
|
|
22182
22166
|
});
|
|
22183
22167
|
var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
|
|
22184
22168
|
var createPrismaConfigInternalShape = () => pipe(
|
|
@@ -22191,10 +22175,6 @@ var createPrismaConfigInternalShape = () => pipe(
|
|
|
22191
22175
|
* The configuration for the Prisma schema file(s).
|
|
22192
22176
|
*/
|
|
22193
22177
|
schema: Schema_exports.optional(PrismaSchemaConfigShape),
|
|
22194
|
-
/**
|
|
22195
|
-
* The configuration for Prisma Studio.
|
|
22196
|
-
*/
|
|
22197
|
-
studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
|
|
22198
22178
|
/**
|
|
22199
22179
|
* The path from where the config was loaded.
|
|
22200
22180
|
* It's set to `null` if no config file was found and only default config is applied.
|
package/dist/defineConfig.d.ts
CHANGED
|
@@ -1,32 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PrismaConfigInternal, PrismaSchemaConfigShape } from './PrismaConfig';
|
|
1
|
+
import type { PrismaConfig, PrismaConfigInternal } from './PrismaConfig';
|
|
3
2
|
export type { PrismaConfigInternal };
|
|
4
|
-
/**
|
|
5
|
-
* Define the input configuration for the Prisma Development Kit.
|
|
6
|
-
*/
|
|
7
|
-
export type PrismaConfig<Env> = {
|
|
8
|
-
/**
|
|
9
|
-
* Whether to enable experimental features.
|
|
10
|
-
* Currently, every feature is considered experimental.
|
|
11
|
-
*/
|
|
12
|
-
earlyAccess: true;
|
|
13
|
-
/**
|
|
14
|
-
* The location of the Prisma schema file(s).
|
|
15
|
-
*/
|
|
16
|
-
schema?: PrismaSchemaConfigShape;
|
|
17
|
-
/**
|
|
18
|
-
* The configuration for the Prisma Studio.
|
|
19
|
-
*/
|
|
20
|
-
studio?: {
|
|
21
|
-
/**
|
|
22
|
-
* Istantiates the Prisma driver adapter to use for Prisma Studio.
|
|
23
|
-
* @param env Dictionary of environment variables.
|
|
24
|
-
* @returns The Prisma driver adapter to use for Prisma Studio.
|
|
25
|
-
*/
|
|
26
|
-
adapter: (env: Env) => Promise<QueryableDriverAdapter>;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
3
|
/**
|
|
30
4
|
* Define the configuration for the Prisma Development Kit.
|
|
31
5
|
*/
|
|
32
|
-
export declare function defineConfig
|
|
6
|
+
export declare function defineConfig(configInput: PrismaConfig): PrismaConfigInternal;
|
package/dist/defineConfig.js
CHANGED
|
@@ -22329,22 +22329,6 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22329
22329
|
};
|
|
22330
22330
|
|
|
22331
22331
|
// src/PrismaConfig.ts
|
|
22332
|
-
var createAdapterShape = () => Schema_exports.declare(
|
|
22333
|
-
(input) => {
|
|
22334
|
-
return input instanceof Function;
|
|
22335
|
-
},
|
|
22336
|
-
{
|
|
22337
|
-
identifier: "CreateAdapter<Env>",
|
|
22338
|
-
encode: identity,
|
|
22339
|
-
decode: identity
|
|
22340
|
-
}
|
|
22341
|
-
);
|
|
22342
|
-
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22343
|
-
/**
|
|
22344
|
-
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22345
|
-
*/
|
|
22346
|
-
createAdapter: createAdapterShape()
|
|
22347
|
-
});
|
|
22348
22332
|
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22349
22333
|
/**
|
|
22350
22334
|
* Tell Prisma to use a single `.prisma` schema file.
|
|
@@ -22353,7 +22337,7 @@ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
|
22353
22337
|
/**
|
|
22354
22338
|
* The path to a single `.prisma` schema file.
|
|
22355
22339
|
*/
|
|
22356
|
-
|
|
22340
|
+
filePath: Schema_exports.String
|
|
22357
22341
|
});
|
|
22358
22342
|
var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
22359
22343
|
/**
|
|
@@ -22364,7 +22348,7 @@ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
|
22364
22348
|
* The path to a folder containing multiple `.prisma` schema files.
|
|
22365
22349
|
* All of the files in this folder will be used.
|
|
22366
22350
|
*/
|
|
22367
|
-
|
|
22351
|
+
folderPath: Schema_exports.String
|
|
22368
22352
|
});
|
|
22369
22353
|
var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
|
|
22370
22354
|
var createPrismaConfigInternalShape = () => pipe(
|
|
@@ -22377,10 +22361,6 @@ var createPrismaConfigInternalShape = () => pipe(
|
|
|
22377
22361
|
* The configuration for the Prisma schema file(s).
|
|
22378
22362
|
*/
|
|
22379
22363
|
schema: Schema_exports.optional(PrismaSchemaConfigShape),
|
|
22380
|
-
/**
|
|
22381
|
-
* The configuration for Prisma Studio.
|
|
22382
|
-
*/
|
|
22383
|
-
studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
|
|
22384
22364
|
/**
|
|
22385
22365
|
* The path from where the config was loaded.
|
|
22386
22366
|
* It's set to `null` if no config file was found and only default config is applied.
|
|
@@ -22403,7 +22383,6 @@ var debug = Debug("prisma:config:defineConfig");
|
|
|
22403
22383
|
function defineConfig(configInput) {
|
|
22404
22384
|
const config2 = defaultConfig();
|
|
22405
22385
|
defineSchemaConfig(config2, configInput);
|
|
22406
|
-
defineStudioConfig(config2, configInput);
|
|
22407
22386
|
return config2;
|
|
22408
22387
|
}
|
|
22409
22388
|
function defineSchemaConfig(config2, configInput) {
|
|
@@ -22413,15 +22392,6 @@ function defineSchemaConfig(config2, configInput) {
|
|
|
22413
22392
|
config2.schema = configInput.schema;
|
|
22414
22393
|
debug("Prisma config [schema]: %o", config2.schema);
|
|
22415
22394
|
}
|
|
22416
|
-
function defineStudioConfig(config2, configInput) {
|
|
22417
|
-
if (!configInput.studio) {
|
|
22418
|
-
return;
|
|
22419
|
-
}
|
|
22420
|
-
config2.studio = {
|
|
22421
|
-
createAdapter: configInput.studio.adapter
|
|
22422
|
-
};
|
|
22423
|
-
debug("Prisma config [studio]: %o", config2.studio);
|
|
22424
|
-
}
|
|
22425
22395
|
// Annotate the CommonJS export names for ESM import in node:
|
|
22426
22396
|
0 && (module.exports = {
|
|
22427
22397
|
defineConfig
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ 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 { PrismaConfigInternal } from './PrismaConfig';
|
|
5
|
+
export type { PrismaConfig, PrismaConfigInternal } from './PrismaConfig';
|
|
6
|
+
export type { Brand } from 'effect/Brand';
|
package/dist/index.js
CHANGED
|
@@ -22274,22 +22274,6 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22274
22274
|
};
|
|
22275
22275
|
|
|
22276
22276
|
// src/PrismaConfig.ts
|
|
22277
|
-
var createAdapterShape = () => Schema_exports.declare(
|
|
22278
|
-
(input) => {
|
|
22279
|
-
return input instanceof Function;
|
|
22280
|
-
},
|
|
22281
|
-
{
|
|
22282
|
-
identifier: "CreateAdapter<Env>",
|
|
22283
|
-
encode: identity,
|
|
22284
|
-
decode: identity
|
|
22285
|
-
}
|
|
22286
|
-
);
|
|
22287
|
-
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22288
|
-
/**
|
|
22289
|
-
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22290
|
-
*/
|
|
22291
|
-
createAdapter: createAdapterShape()
|
|
22292
|
-
});
|
|
22293
22277
|
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22294
22278
|
/**
|
|
22295
22279
|
* Tell Prisma to use a single `.prisma` schema file.
|
|
@@ -22298,7 +22282,7 @@ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
|
22298
22282
|
/**
|
|
22299
22283
|
* The path to a single `.prisma` schema file.
|
|
22300
22284
|
*/
|
|
22301
|
-
|
|
22285
|
+
filePath: Schema_exports.String
|
|
22302
22286
|
});
|
|
22303
22287
|
var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
22304
22288
|
/**
|
|
@@ -22309,9 +22293,24 @@ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
|
22309
22293
|
* The path to a folder containing multiple `.prisma` schema files.
|
|
22310
22294
|
* All of the files in this folder will be used.
|
|
22311
22295
|
*/
|
|
22312
|
-
|
|
22296
|
+
folderPath: Schema_exports.String
|
|
22313
22297
|
});
|
|
22314
22298
|
var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
|
|
22299
|
+
var createPrismaConfigShape = () => Schema_exports.Struct({
|
|
22300
|
+
/**
|
|
22301
|
+
* Whether features with an unstable API are enabled.
|
|
22302
|
+
*/
|
|
22303
|
+
earlyAccess: Schema_exports.Literal(true),
|
|
22304
|
+
/**
|
|
22305
|
+
* The configuration for the Prisma schema file(s).
|
|
22306
|
+
*/
|
|
22307
|
+
schema: Schema_exports.optional(PrismaSchemaConfigShape)
|
|
22308
|
+
});
|
|
22309
|
+
function parsePrismaConfigShape(input) {
|
|
22310
|
+
return Schema_exports.decodeUnknownEither(createPrismaConfigShape(), {})(input, {
|
|
22311
|
+
onExcessProperty: "error"
|
|
22312
|
+
});
|
|
22313
|
+
}
|
|
22315
22314
|
var createPrismaConfigInternalShape = () => pipe(
|
|
22316
22315
|
Schema_exports.Struct({
|
|
22317
22316
|
/**
|
|
@@ -22322,10 +22321,6 @@ var createPrismaConfigInternalShape = () => pipe(
|
|
|
22322
22321
|
* The configuration for the Prisma schema file(s).
|
|
22323
22322
|
*/
|
|
22324
22323
|
schema: Schema_exports.optional(PrismaSchemaConfigShape),
|
|
22325
|
-
/**
|
|
22326
|
-
* The configuration for Prisma Studio.
|
|
22327
|
-
*/
|
|
22328
|
-
studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
|
|
22329
22324
|
/**
|
|
22330
22325
|
* The path from where the config was loaded.
|
|
22331
22326
|
* It's set to `null` if no config file was found and only default config is applied.
|
|
@@ -22547,7 +22542,6 @@ var debug = Debug2("prisma:config:defineConfig");
|
|
|
22547
22542
|
function defineConfig(configInput) {
|
|
22548
22543
|
const config2 = defaultConfig();
|
|
22549
22544
|
defineSchemaConfig(config2, configInput);
|
|
22550
|
-
defineStudioConfig(config2, configInput);
|
|
22551
22545
|
return config2;
|
|
22552
22546
|
}
|
|
22553
22547
|
function defineSchemaConfig(config2, configInput) {
|
|
@@ -22557,15 +22551,6 @@ function defineSchemaConfig(config2, configInput) {
|
|
|
22557
22551
|
config2.schema = configInput.schema;
|
|
22558
22552
|
debug("Prisma config [schema]: %o", config2.schema);
|
|
22559
22553
|
}
|
|
22560
|
-
function defineStudioConfig(config2, configInput) {
|
|
22561
|
-
if (!configInput.studio) {
|
|
22562
|
-
return;
|
|
22563
|
-
}
|
|
22564
|
-
config2.studio = {
|
|
22565
|
-
createAdapter: configInput.studio.adapter
|
|
22566
|
-
};
|
|
22567
|
-
debug("Prisma config [studio]: %o", config2.studio);
|
|
22568
|
-
}
|
|
22569
22554
|
|
|
22570
22555
|
// src/loadConfigFromFile.ts
|
|
22571
22556
|
var import_node_fs = __toESM(require("node:fs"));
|
|
@@ -22601,7 +22586,17 @@ async function loadConfigFromFile({
|
|
|
22601
22586
|
};
|
|
22602
22587
|
}
|
|
22603
22588
|
debug2(`Config file loaded in %s`, getTime());
|
|
22604
|
-
const
|
|
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
|
+
);
|
|
22605
22600
|
if (Either_exports.isLeft(parseResultEither)) {
|
|
22606
22601
|
return {
|
|
22607
22602
|
resolvedPath,
|
|
@@ -22611,6 +22606,8 @@ async function loadConfigFromFile({
|
|
|
22611
22606
|
}
|
|
22612
22607
|
};
|
|
22613
22608
|
}
|
|
22609
|
+
import_node_process.default.stdout.write(`Loaded Prisma config from "${resolvedPath}".
|
|
22610
|
+
`);
|
|
22614
22611
|
const prismaConfig = transformPathsInConfigToAbsolute(parseResultEither.right, resolvedPath);
|
|
22615
22612
|
return {
|
|
22616
22613
|
config: {
|
|
@@ -22660,7 +22657,7 @@ function transformPathsInConfigToAbsolute(prismaConfig, resolvedPath) {
|
|
|
22660
22657
|
...prismaConfig,
|
|
22661
22658
|
schema: {
|
|
22662
22659
|
...prismaConfig.schema,
|
|
22663
|
-
|
|
22660
|
+
filePath: import_node_path.default.resolve(import_node_path.default.dirname(resolvedPath), prismaConfig.schema.filePath)
|
|
22664
22661
|
}
|
|
22665
22662
|
};
|
|
22666
22663
|
} else if (prismaConfig.schema?.kind === "multi") {
|
|
@@ -22668,7 +22665,7 @@ function transformPathsInConfigToAbsolute(prismaConfig, resolvedPath) {
|
|
|
22668
22665
|
...prismaConfig,
|
|
22669
22666
|
schema: {
|
|
22670
22667
|
...prismaConfig.schema,
|
|
22671
|
-
|
|
22668
|
+
folderPath: import_node_path.default.resolve(import_node_path.default.dirname(resolvedPath), prismaConfig.schema.folderPath)
|
|
22672
22669
|
}
|
|
22673
22670
|
};
|
|
22674
22671
|
} else {
|
|
@@ -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: PrismaConfigInternal
|
|
27
|
+
config: PrismaConfigInternal;
|
|
28
28
|
error?: never;
|
|
29
29
|
} | {
|
|
30
30
|
resolvedPath: string;
|
|
@@ -22460,22 +22460,6 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22460
22460
|
};
|
|
22461
22461
|
|
|
22462
22462
|
// src/PrismaConfig.ts
|
|
22463
|
-
var createAdapterShape = () => Schema_exports.declare(
|
|
22464
|
-
(input) => {
|
|
22465
|
-
return input instanceof Function;
|
|
22466
|
-
},
|
|
22467
|
-
{
|
|
22468
|
-
identifier: "CreateAdapter<Env>",
|
|
22469
|
-
encode: identity,
|
|
22470
|
-
decode: identity
|
|
22471
|
-
}
|
|
22472
|
-
);
|
|
22473
|
-
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22474
|
-
/**
|
|
22475
|
-
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22476
|
-
*/
|
|
22477
|
-
createAdapter: createAdapterShape()
|
|
22478
|
-
});
|
|
22479
22463
|
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22480
22464
|
/**
|
|
22481
22465
|
* Tell Prisma to use a single `.prisma` schema file.
|
|
@@ -22484,7 +22468,7 @@ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
|
22484
22468
|
/**
|
|
22485
22469
|
* The path to a single `.prisma` schema file.
|
|
22486
22470
|
*/
|
|
22487
|
-
|
|
22471
|
+
filePath: Schema_exports.String
|
|
22488
22472
|
});
|
|
22489
22473
|
var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
22490
22474
|
/**
|
|
@@ -22495,9 +22479,24 @@ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
|
22495
22479
|
* The path to a folder containing multiple `.prisma` schema files.
|
|
22496
22480
|
* All of the files in this folder will be used.
|
|
22497
22481
|
*/
|
|
22498
|
-
|
|
22482
|
+
folderPath: Schema_exports.String
|
|
22499
22483
|
});
|
|
22500
22484
|
var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
|
|
22485
|
+
var createPrismaConfigShape = () => Schema_exports.Struct({
|
|
22486
|
+
/**
|
|
22487
|
+
* Whether features with an unstable API are enabled.
|
|
22488
|
+
*/
|
|
22489
|
+
earlyAccess: Schema_exports.Literal(true),
|
|
22490
|
+
/**
|
|
22491
|
+
* The configuration for the Prisma schema file(s).
|
|
22492
|
+
*/
|
|
22493
|
+
schema: Schema_exports.optional(PrismaSchemaConfigShape)
|
|
22494
|
+
});
|
|
22495
|
+
function parsePrismaConfigShape(input) {
|
|
22496
|
+
return Schema_exports.decodeUnknownEither(createPrismaConfigShape(), {})(input, {
|
|
22497
|
+
onExcessProperty: "error"
|
|
22498
|
+
});
|
|
22499
|
+
}
|
|
22501
22500
|
var createPrismaConfigInternalShape = () => pipe(
|
|
22502
22501
|
Schema_exports.Struct({
|
|
22503
22502
|
/**
|
|
@@ -22508,10 +22507,6 @@ var createPrismaConfigInternalShape = () => pipe(
|
|
|
22508
22507
|
* The configuration for the Prisma schema file(s).
|
|
22509
22508
|
*/
|
|
22510
22509
|
schema: Schema_exports.optional(PrismaSchemaConfigShape),
|
|
22511
|
-
/**
|
|
22512
|
-
* The configuration for Prisma Studio.
|
|
22513
|
-
*/
|
|
22514
|
-
studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
|
|
22515
22510
|
/**
|
|
22516
22511
|
* The path from where the config was loaded.
|
|
22517
22512
|
* It's set to `null` if no config file was found and only default config is applied.
|
|
@@ -22526,8 +22521,31 @@ function parsePrismaConfigInternalShape(input) {
|
|
|
22526
22521
|
});
|
|
22527
22522
|
}
|
|
22528
22523
|
|
|
22524
|
+
// src/defaultConfig.ts
|
|
22525
|
+
function defaultConfig() {
|
|
22526
|
+
return createPrismaConfigInternalShape().make({
|
|
22527
|
+
earlyAccess: true,
|
|
22528
|
+
loadedFromFile: null
|
|
22529
|
+
});
|
|
22530
|
+
}
|
|
22531
|
+
|
|
22532
|
+
// src/defineConfig.ts
|
|
22533
|
+
var debug = Debug("prisma:config:defineConfig");
|
|
22534
|
+
function defineConfig(configInput) {
|
|
22535
|
+
const config2 = defaultConfig();
|
|
22536
|
+
defineSchemaConfig(config2, configInput);
|
|
22537
|
+
return config2;
|
|
22538
|
+
}
|
|
22539
|
+
function defineSchemaConfig(config2, configInput) {
|
|
22540
|
+
if (!configInput.schema) {
|
|
22541
|
+
return;
|
|
22542
|
+
}
|
|
22543
|
+
config2.schema = configInput.schema;
|
|
22544
|
+
debug("Prisma config [schema]: %o", config2.schema);
|
|
22545
|
+
}
|
|
22546
|
+
|
|
22529
22547
|
// src/loadConfigFromFile.ts
|
|
22530
|
-
var
|
|
22548
|
+
var debug2 = Debug("prisma:config:loadConfigFromFile");
|
|
22531
22549
|
async function loadConfigFromFile({
|
|
22532
22550
|
configFile,
|
|
22533
22551
|
configRoot = import_node_process.default.cwd()
|
|
@@ -22538,13 +22556,13 @@ async function loadConfigFromFile({
|
|
|
22538
22556
|
if (configFile) {
|
|
22539
22557
|
resolvedPath = import_node_path.default.resolve(configRoot, configFile);
|
|
22540
22558
|
if (!import_node_fs.default.existsSync(resolvedPath)) {
|
|
22541
|
-
|
|
22559
|
+
debug2(`The given config file was not found at %s`, resolvedPath);
|
|
22542
22560
|
return { resolvedPath, error: { _tag: "ConfigFileNotFound" } };
|
|
22543
22561
|
}
|
|
22544
22562
|
} else {
|
|
22545
22563
|
resolvedPath = ["prisma.config.ts"].map((file) => import_node_path.default.resolve(configRoot, file)).find((file) => import_node_fs.default.existsSync(file)) ?? null;
|
|
22546
22564
|
if (resolvedPath === null) {
|
|
22547
|
-
|
|
22565
|
+
debug2(`No config file found in the current working directory %s`, configRoot);
|
|
22548
22566
|
return { resolvedPath };
|
|
22549
22567
|
}
|
|
22550
22568
|
}
|
|
@@ -22556,8 +22574,18 @@ async function loadConfigFromFile({
|
|
|
22556
22574
|
error
|
|
22557
22575
|
};
|
|
22558
22576
|
}
|
|
22559
|
-
|
|
22560
|
-
const
|
|
22577
|
+
debug2(`Config file loaded in %s`, getTime());
|
|
22578
|
+
const defaultExport = required3["default"];
|
|
22579
|
+
const parseResultEither = pipe(
|
|
22580
|
+
// If the given config conforms to the `PrismaConfig` shape, feed it to `defineConfig`.
|
|
22581
|
+
parsePrismaConfigShape(defaultExport),
|
|
22582
|
+
Either_exports.map((config2) => {
|
|
22583
|
+
debug2("Parsed `PrismaConfig` shape: %o", config2);
|
|
22584
|
+
return defineConfig(config2);
|
|
22585
|
+
}),
|
|
22586
|
+
// Otherwise, try to parse it as a `PrismaConfigInternal` shape.
|
|
22587
|
+
Either_exports.orElse(() => parsePrismaConfigInternalShape(defaultExport))
|
|
22588
|
+
);
|
|
22561
22589
|
if (Either_exports.isLeft(parseResultEither)) {
|
|
22562
22590
|
return {
|
|
22563
22591
|
resolvedPath,
|
|
@@ -22567,6 +22595,8 @@ async function loadConfigFromFile({
|
|
|
22567
22595
|
}
|
|
22568
22596
|
};
|
|
22569
22597
|
}
|
|
22598
|
+
import_node_process.default.stdout.write(`Loaded Prisma config from "${resolvedPath}".
|
|
22599
|
+
`);
|
|
22570
22600
|
const prismaConfig = transformPathsInConfigToAbsolute(parseResultEither.right, resolvedPath);
|
|
22571
22601
|
return {
|
|
22572
22602
|
config: {
|
|
@@ -22601,7 +22631,7 @@ async function requireTypeScriptFile(resolvedPath) {
|
|
|
22601
22631
|
};
|
|
22602
22632
|
} catch (e) {
|
|
22603
22633
|
const error = e;
|
|
22604
|
-
|
|
22634
|
+
debug2("esbuild-register registration failed: %s", error.message);
|
|
22605
22635
|
return {
|
|
22606
22636
|
error: {
|
|
22607
22637
|
_tag: "TypeScriptImportFailed",
|
|
@@ -22616,7 +22646,7 @@ function transformPathsInConfigToAbsolute(prismaConfig, resolvedPath) {
|
|
|
22616
22646
|
...prismaConfig,
|
|
22617
22647
|
schema: {
|
|
22618
22648
|
...prismaConfig.schema,
|
|
22619
|
-
|
|
22649
|
+
filePath: import_node_path.default.resolve(import_node_path.default.dirname(resolvedPath), prismaConfig.schema.filePath)
|
|
22620
22650
|
}
|
|
22621
22651
|
};
|
|
22622
22652
|
} else if (prismaConfig.schema?.kind === "multi") {
|
|
@@ -22624,7 +22654,7 @@ function transformPathsInConfigToAbsolute(prismaConfig, resolvedPath) {
|
|
|
22624
22654
|
...prismaConfig,
|
|
22625
22655
|
schema: {
|
|
22626
22656
|
...prismaConfig.schema,
|
|
22627
|
-
|
|
22657
|
+
folderPath: import_node_path.default.resolve(import_node_path.default.dirname(resolvedPath), prismaConfig.schema.folderPath)
|
|
22628
22658
|
}
|
|
22629
22659
|
};
|
|
22630
22660
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/config",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.1-dev.1",
|
|
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.4.
|
|
26
|
-
"@prisma/get-platform": "6.4.
|
|
25
|
+
"@prisma/driver-adapter-utils": "6.4.1-dev.1",
|
|
26
|
+
"@prisma/get-platform": "6.4.1-dev.1"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist"
|