@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/PrismaConfig.d.ts
CHANGED
|
@@ -1,34 +1,80 @@
|
|
|
1
1
|
import type { DriverAdapter as QueryableDriverAdapter } from '@prisma/driver-adapter-utils';
|
|
2
|
-
import { Schema } from 'effect';
|
|
2
|
+
import { Schema as Shape } from 'effect';
|
|
3
3
|
import type { Either } from 'effect/Either';
|
|
4
4
|
import type { ParseError } from 'effect/ParseResult';
|
|
5
|
-
declare const
|
|
5
|
+
declare const PrismaSchemaConfigShape: Shape.Union<[Shape.Struct<{
|
|
6
|
+
/**
|
|
7
|
+
* Tell Prisma to use a single `.prisma` schema file.
|
|
8
|
+
*/
|
|
9
|
+
kind: Shape.Literal<["single"]>;
|
|
10
|
+
/**
|
|
11
|
+
* The path to a single `.prisma` schema file.
|
|
12
|
+
*/
|
|
13
|
+
filenamePath: typeof Shape.String;
|
|
14
|
+
}>, Shape.Struct<{
|
|
15
|
+
/**
|
|
16
|
+
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
17
|
+
*/
|
|
18
|
+
kind: Shape.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 Shape.String;
|
|
24
|
+
}>]>;
|
|
25
|
+
export type PrismaSchemaConfigShape = typeof PrismaSchemaConfigShape.Type;
|
|
26
|
+
export declare const createPrismaConfigInternalShape: <Env = any>() => Shape.brand<Shape.Struct<{
|
|
6
27
|
/**
|
|
7
28
|
* Whether features with an unstable API are enabled.
|
|
8
29
|
*/
|
|
9
|
-
earlyAccess:
|
|
30
|
+
earlyAccess: Shape.Literal<[true]>;
|
|
31
|
+
/**
|
|
32
|
+
* The configuration for the Prisma schema file(s).
|
|
33
|
+
*/
|
|
34
|
+
schema: Shape.optional<Shape.Union<[Shape.Struct<{
|
|
35
|
+
/**
|
|
36
|
+
* Tell Prisma to use a single `.prisma` schema file.
|
|
37
|
+
*/
|
|
38
|
+
kind: Shape.Literal<["single"]>;
|
|
39
|
+
/**
|
|
40
|
+
* The path to a single `.prisma` schema file.
|
|
41
|
+
*/
|
|
42
|
+
filenamePath: typeof Shape.String;
|
|
43
|
+
}>, Shape.Struct<{
|
|
44
|
+
/**
|
|
45
|
+
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
46
|
+
*/
|
|
47
|
+
kind: Shape.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 Shape.String;
|
|
53
|
+
}>]>>;
|
|
10
54
|
/**
|
|
11
55
|
* The configuration for Prisma Studio.
|
|
12
56
|
*/
|
|
13
|
-
studio:
|
|
57
|
+
studio: Shape.optional<Shape.Struct<{
|
|
14
58
|
/**
|
|
15
59
|
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
16
60
|
*/
|
|
17
|
-
createAdapter:
|
|
61
|
+
createAdapter: Shape.SchemaClass<(env: Env) => Promise<QueryableDriverAdapter>, (env: Env) => Promise<QueryableDriverAdapter>, never>;
|
|
18
62
|
}>>;
|
|
19
63
|
/**
|
|
20
64
|
* The path from where the config was loaded.
|
|
21
65
|
* It's set to `null` if no config file was found and only default config is applied.
|
|
22
66
|
*/
|
|
23
|
-
loadedFromFile:
|
|
24
|
-
}>;
|
|
67
|
+
loadedFromFile: Shape.NullOr<typeof Shape.String>;
|
|
68
|
+
}>, "PrismaConfigInternal">;
|
|
25
69
|
/**
|
|
26
|
-
* The configuration for the Prisma Development Kit
|
|
70
|
+
* The configuration for the Prisma Development Kit, after it has been parsed and processed
|
|
71
|
+
* by the `defineConfig` function.
|
|
72
|
+
* Thanks to the branding, this type is opaque and cannot be constructed directly.
|
|
27
73
|
*/
|
|
28
|
-
export type
|
|
74
|
+
export type PrismaConfigInternal<Env = any> = ReturnType<typeof createPrismaConfigInternalShape<Env>>['Type'];
|
|
29
75
|
/**
|
|
30
|
-
* Parse a given input object to ensure it conforms to the `PrismaConfig` type
|
|
76
|
+
* Parse a given input object to ensure it conforms to the `PrismaConfig` type Shape.
|
|
31
77
|
* This function may fail, but it will never throw.
|
|
32
78
|
*/
|
|
33
|
-
export declare function
|
|
79
|
+
export declare function parsePrismaConfigInternalShape<Env = any>(input: unknown): Either<PrismaConfigInternal<Env>, ParseError>;
|
|
34
80
|
export {};
|
package/dist/PrismaConfig.js
CHANGED
|
@@ -29,7 +29,8 @@ var __privateSet = (obj, member, value3, setter) => (__accessCheck(obj, member,
|
|
|
29
29
|
// src/PrismaConfig.ts
|
|
30
30
|
var PrismaConfig_exports = {};
|
|
31
31
|
__export(PrismaConfig_exports, {
|
|
32
|
-
|
|
32
|
+
createPrismaConfigInternalShape: () => createPrismaConfigInternalShape,
|
|
33
|
+
parsePrismaConfigInternalShape: () => parsePrismaConfigInternalShape
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(PrismaConfig_exports);
|
|
35
36
|
|
|
@@ -22143,43 +22144,73 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
|
|
|
22143
22144
|
};
|
|
22144
22145
|
|
|
22145
22146
|
// src/PrismaConfig.ts
|
|
22146
|
-
var
|
|
22147
|
+
var createAdapterShape = () => Schema_exports.declare(
|
|
22147
22148
|
(input) => {
|
|
22148
22149
|
return input instanceof Function;
|
|
22149
22150
|
},
|
|
22150
22151
|
{
|
|
22151
|
-
identifier: "
|
|
22152
|
+
identifier: "CreateAdapter<Env>",
|
|
22152
22153
|
encode: identity,
|
|
22153
22154
|
decode: identity
|
|
22154
22155
|
}
|
|
22155
22156
|
);
|
|
22156
|
-
var
|
|
22157
|
+
var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
|
|
22157
22158
|
/**
|
|
22158
22159
|
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
22159
22160
|
*/
|
|
22160
|
-
createAdapter:
|
|
22161
|
+
createAdapter: createAdapterShape()
|
|
22161
22162
|
});
|
|
22162
|
-
var
|
|
22163
|
+
var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
|
|
22163
22164
|
/**
|
|
22164
|
-
*
|
|
22165
|
+
* Tell Prisma to use a single `.prisma` schema file.
|
|
22165
22166
|
*/
|
|
22166
|
-
|
|
22167
|
+
kind: Schema_exports.Literal("single"),
|
|
22167
22168
|
/**
|
|
22168
|
-
* The
|
|
22169
|
+
* The path to a single `.prisma` schema file.
|
|
22169
22170
|
*/
|
|
22170
|
-
|
|
22171
|
+
filenamePath: Schema_exports.String
|
|
22172
|
+
});
|
|
22173
|
+
var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
|
|
22174
|
+
/**
|
|
22175
|
+
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
22176
|
+
*/
|
|
22177
|
+
kind: Schema_exports.Literal("multi"),
|
|
22171
22178
|
/**
|
|
22172
|
-
* The path
|
|
22173
|
-
*
|
|
22179
|
+
* The path to a folder containing multiple `.prisma` schema files.
|
|
22180
|
+
* All of the files in this folder will be used.
|
|
22174
22181
|
*/
|
|
22175
|
-
|
|
22182
|
+
folder: Schema_exports.String
|
|
22176
22183
|
});
|
|
22177
|
-
|
|
22178
|
-
|
|
22184
|
+
var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
|
|
22185
|
+
var createPrismaConfigInternalShape = () => pipe(
|
|
22186
|
+
Schema_exports.Struct({
|
|
22187
|
+
/**
|
|
22188
|
+
* Whether features with an unstable API are enabled.
|
|
22189
|
+
*/
|
|
22190
|
+
earlyAccess: Schema_exports.Literal(true),
|
|
22191
|
+
/**
|
|
22192
|
+
* The configuration for the Prisma schema file(s).
|
|
22193
|
+
*/
|
|
22194
|
+
schema: Schema_exports.optional(PrismaSchemaConfigShape),
|
|
22195
|
+
/**
|
|
22196
|
+
* The configuration for Prisma Studio.
|
|
22197
|
+
*/
|
|
22198
|
+
studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
|
|
22199
|
+
/**
|
|
22200
|
+
* The path from where the config was loaded.
|
|
22201
|
+
* It's set to `null` if no config file was found and only default config is applied.
|
|
22202
|
+
*/
|
|
22203
|
+
loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
|
|
22204
|
+
}),
|
|
22205
|
+
Schema_exports.brand("PrismaConfigInternal")
|
|
22206
|
+
);
|
|
22207
|
+
function parsePrismaConfigInternalShape(input) {
|
|
22208
|
+
return Schema_exports.decodeUnknownEither(createPrismaConfigInternalShape(), {})(input, {
|
|
22179
22209
|
onExcessProperty: "error"
|
|
22180
22210
|
});
|
|
22181
22211
|
}
|
|
22182
22212
|
// Annotate the CommonJS export names for ESM import in node:
|
|
22183
22213
|
0 && (module.exports = {
|
|
22184
|
-
|
|
22214
|
+
createPrismaConfigInternalShape,
|
|
22215
|
+
parsePrismaConfigInternalShape
|
|
22185
22216
|
});
|
package/dist/defaultConfig.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DeepMutable } from 'effect/Types';
|
|
2
|
+
import { type PrismaConfigInternal } 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():
|
|
8
|
+
export declare function defaultConfig<Env = any>(): DeepMutable<PrismaConfigInternal<Env>>;
|