@prisma/internals 6.6.0-integration-push-xmzqvqxpztks.1 → 6.6.0-integration-push-xmzqvqxpztks.3
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/{chunk-LVUBW3T7.js → chunk-2AE2H55C.js} +5 -5
- package/dist/{chunk-76QFLC66.js → chunk-3MSKE2BF.js} +8 -8
- package/dist/{chunk-PUKEXBI4.js → chunk-GANLEYUE.js} +8 -8
- package/dist/{chunk-ETVM6IV5.js → chunk-OYXPLLDN.js} +8 -8
- package/dist/{chunk-BL6JTZ5B.js → chunk-SA67765L.js} +4 -4
- package/dist/{chunk-TAP5I7K3.js → chunk-SCFKBBJZ.js} +5 -5
- package/dist/{chunk-AADL5UHK.js → chunk-VWCKVQI6.js} +23 -35
- package/dist/{chunk-SZD3E6G4.js → chunk-X7VE2NPV.js} +8 -20
- package/dist/{chunk-6YPRKPWR.js → chunk-YIFFEUFQ.js} +5 -5
- package/dist/{chunk-LS2NTQLX.js → chunk-ZWINUKID.js} +5 -5
- package/dist/{chunk-UZI5CEWB.js → chunk-ZWTVFN27.js} +7 -7
- package/dist/cli/checkUnsupportedDataProxy.js +12 -12
- package/dist/cli/getSchema.d.ts +1 -6
- package/dist/cli/getSchema.js +15 -16
- package/dist/cli/hashes.js +12 -12
- package/dist/cli/schemaContext.js +12 -12
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +11 -11
- package/dist/engine-commands/getConfig.js +10 -10
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/index.js +20 -20
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +7 -7
- package/dist/engine-commands/validate.js +7 -7
- package/dist/get-generators/getGenerators.js +14 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +38 -39
- package/dist/utils/getEnvPaths.js +11 -11
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/loadEnvFile.js +11 -11
- package/dist/wasm.js +4 -4
- package/package.json +10 -10
@@ -16,20 +16,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
return to;
|
17
17
|
};
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var
|
20
|
-
__export(
|
19
|
+
var chunk_2AE2H55C_exports = {};
|
20
|
+
__export(chunk_2AE2H55C_exports, {
|
21
21
|
getLintWarnings: () => getLintWarnings,
|
22
22
|
getLintWarningsAsText: () => getLintWarningsAsText,
|
23
23
|
handleLintPanic: () => handleLintPanic,
|
24
24
|
lintSchema: () => lintSchema,
|
25
25
|
warningToString: () => warningToString
|
26
26
|
});
|
27
|
-
module.exports = __toCommonJS(
|
28
|
-
var
|
27
|
+
module.exports = __toCommonJS(chunk_2AE2H55C_exports);
|
28
|
+
var import_chunk_ZWINUKID = require("./chunk-ZWINUKID.js");
|
29
29
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
30
30
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
31
31
|
function lintSchema({ schemas }) {
|
32
|
-
const lintResult =
|
32
|
+
const lintResult = import_chunk_ZWINUKID.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
33
33
|
const lintDiagnostics = JSON.parse(lintResult);
|
34
34
|
return lintDiagnostics;
|
35
35
|
}
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_3MSKE2BF_exports = {};
|
30
|
+
__export(chunk_3MSKE2BF_exports, {
|
31
31
|
ValidateError: () => ValidateError,
|
32
32
|
validate: () => validate
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_3MSKE2BF_exports);
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
39
|
-
var
|
38
|
+
var import_chunk_YIFFEUFQ = require("./chunk-YIFFEUFQ.js");
|
39
|
+
var import_chunk_ZWINUKID = require("./chunk-ZWINUKID.js");
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
|
|
59
59
|
}).exhaustive();
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
61
61
|
[Context: validate]`;
|
62
|
-
super((0,
|
62
|
+
super((0, import_chunk_YIFFEUFQ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
63
63
|
this.name = "ValidateError";
|
64
64
|
}
|
65
65
|
};
|
@@ -71,13 +71,13 @@ function validate(options) {
|
|
71
71
|
() => {
|
72
72
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
73
73
|
debug("Triggering a Rust panic...");
|
74
|
-
|
74
|
+
import_chunk_ZWINUKID.prismaSchemaWasm.debug_panic();
|
75
75
|
}
|
76
76
|
const params = JSON.stringify({
|
77
77
|
prismaSchema: options.schemas,
|
78
78
|
noColor: Boolean(process.env.NO_COLOR)
|
79
79
|
});
|
80
|
-
|
80
|
+
import_chunk_ZWINUKID.prismaSchemaWasm.validate(params);
|
81
81
|
},
|
82
82
|
(e) => ({
|
83
83
|
type: "wasm-error",
|
@@ -26,16 +26,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_GANLEYUE_exports = {};
|
30
|
+
__export(chunk_GANLEYUE_exports, {
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
32
32
|
getDMMF: () => getDMMF
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_GANLEYUE_exports);
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
37
|
-
var
|
38
|
-
var
|
37
|
+
var import_chunk_YIFFEUFQ = require("./chunk-YIFFEUFQ.js");
|
38
|
+
var import_chunk_ZWINUKID = require("./chunk-ZWINUKID.js");
|
39
39
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
41
41
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
@@ -58,7 +58,7 @@ ${detailsHeader} ${message}`;
|
|
58
58
|
}).exhaustive();
|
59
59
|
const errorMessageWithContext = `${constructedErrorMessage}
|
60
60
|
[Context: getDmmf]`;
|
61
|
-
super((0,
|
61
|
+
super((0, import_chunk_YIFFEUFQ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
62
62
|
this.name = "GetDmmfError";
|
63
63
|
}
|
64
64
|
};
|
@@ -70,13 +70,13 @@ async function getDMMF(options) {
|
|
70
70
|
() => {
|
71
71
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
72
72
|
debug("Triggering a Rust panic...");
|
73
|
-
|
73
|
+
import_chunk_ZWINUKID.prismaSchemaWasm.debug_panic();
|
74
74
|
}
|
75
75
|
const params = JSON.stringify({
|
76
76
|
prismaSchema: options.datamodel,
|
77
77
|
noColor: Boolean(process.env.NO_COLOR)
|
78
78
|
});
|
79
|
-
const data =
|
79
|
+
const data = import_chunk_ZWINUKID.prismaSchemaWasm.get_dmmf(params);
|
80
80
|
return data;
|
81
81
|
},
|
82
82
|
(e) => ({
|
@@ -26,20 +26,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_OYXPLLDN_exports = {};
|
30
|
+
__export(chunk_OYXPLLDN_exports, {
|
31
31
|
GetConfigError: () => GetConfigError,
|
32
32
|
getConfig: () => getConfig,
|
33
33
|
getDirectUrl: () => getDirectUrl,
|
34
34
|
getEffectiveUrl: () => getEffectiveUrl,
|
35
35
|
resolveUrl: () => resolveUrl
|
36
36
|
});
|
37
|
-
module.exports = __toCommonJS(
|
37
|
+
module.exports = __toCommonJS(chunk_OYXPLLDN_exports);
|
38
38
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
39
39
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
40
40
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
41
|
-
var
|
42
|
-
var
|
41
|
+
var import_chunk_YIFFEUFQ = require("./chunk-YIFFEUFQ.js");
|
42
|
+
var import_chunk_ZWINUKID = require("./chunk-ZWINUKID.js");
|
43
43
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
44
44
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
45
45
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
@@ -64,7 +64,7 @@ ${detailsHeader} ${message}`;
|
|
64
64
|
}).exhaustive();
|
65
65
|
const errorMessageWithContext = `${constructedErrorMessage}
|
66
66
|
[Context: getConfig]`;
|
67
|
-
super((0,
|
67
|
+
super((0, import_chunk_YIFFEUFQ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
68
68
|
this.name = "GetConfigError";
|
69
69
|
}
|
70
70
|
};
|
@@ -89,7 +89,7 @@ async function getConfig(options) {
|
|
89
89
|
() => {
|
90
90
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
91
91
|
debug("Triggering a Rust panic...");
|
92
|
-
|
92
|
+
import_chunk_ZWINUKID.prismaSchemaWasm.debug_panic();
|
93
93
|
}
|
94
94
|
const params = JSON.stringify({
|
95
95
|
prismaSchema: options.datamodel,
|
@@ -97,7 +97,7 @@ async function getConfig(options) {
|
|
97
97
|
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
98
98
|
env: process.env
|
99
99
|
});
|
100
|
-
const data =
|
100
|
+
const data = import_chunk_ZWINUKID.prismaSchemaWasm.get_config(params);
|
101
101
|
return data;
|
102
102
|
},
|
103
103
|
(e) => ({
|
@@ -16,17 +16,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
return to;
|
17
17
|
};
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var
|
20
|
-
__export(
|
19
|
+
var chunk_SA67765L_exports = {};
|
20
|
+
__export(chunk_SA67765L_exports, {
|
21
21
|
require_package: () => require_package
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
23
|
+
module.exports = __toCommonJS(chunk_SA67765L_exports);
|
24
24
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
25
25
|
var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
26
26
|
"package.json"(exports, module2) {
|
27
27
|
module2.exports = {
|
28
28
|
name: "@prisma/internals",
|
29
|
-
version: "6.6.0-integration-push-xmzqvqxpztks.
|
29
|
+
version: "6.6.0-integration-push-xmzqvqxpztks.3",
|
30
30
|
description: "This package is intended for Prisma's internal use",
|
31
31
|
main: "dist/index.js",
|
32
32
|
types: "dist/index.d.ts",
|
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
return to;
|
17
17
|
};
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var
|
20
|
-
__export(
|
19
|
+
var chunk_SCFKBBJZ_exports = {};
|
20
|
+
__export(chunk_SCFKBBJZ_exports, {
|
21
21
|
version: () => version
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
25
|
-
var packageJson = (0,
|
23
|
+
module.exports = __toCommonJS(chunk_SCFKBBJZ_exports);
|
24
|
+
var import_chunk_SA67765L = require("./chunk-SA67765L.js");
|
25
|
+
var packageJson = (0, import_chunk_SA67765L.require_package)();
|
26
26
|
var version = packageJson.version;
|
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_VWCKVQI6_exports = {};
|
30
|
+
__export(chunk_VWCKVQI6_exports, {
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
32
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
33
33
|
formatSchema: () => formatSchema,
|
@@ -39,18 +39,17 @@ __export(chunk_AADL5UHK_exports, {
|
|
39
39
|
getNodeAPIName: () => import_get_platform2.getNodeAPIName,
|
40
40
|
getPrismaConfigFromPackageJson: () => getPrismaConfigFromPackageJson,
|
41
41
|
getProjectHash: () => getProjectHash,
|
42
|
-
getSchema: () => getSchema,
|
43
|
-
getSchemaDir: () => getSchemaDir,
|
44
42
|
getSchemaFromPackageJson: () => getSchemaFromPackageJson,
|
45
43
|
getSchemaWithPath: () => getSchemaWithPath,
|
46
44
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
47
45
|
knownBinaryTargets: () => knownBinaryTargets,
|
48
46
|
loadEnvFile: () => loadEnvFile,
|
49
47
|
loadSchemaContext: () => loadSchemaContext,
|
48
|
+
printSchemaLoadedMessage: () => printSchemaLoadedMessage,
|
50
49
|
processSchemaResult: () => processSchemaResult,
|
51
50
|
skipIndex: () => skipIndex
|
52
51
|
});
|
53
|
-
module.exports = __toCommonJS(
|
52
|
+
module.exports = __toCommonJS(chunk_VWCKVQI6_exports);
|
54
53
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
55
54
|
var import_chunk_EPXBOIA5 = require("./chunk-EPXBOIA5.js");
|
56
55
|
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
@@ -63,11 +62,11 @@ var import_chunk_5V36RLCO = require("./chunk-5V36RLCO.js");
|
|
63
62
|
var import_chunk_AZV6HVKA = require("./chunk-AZV6HVKA.js");
|
64
63
|
var import_chunk_HAGJ64PM = require("./chunk-HAGJ64PM.js");
|
65
64
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
66
|
-
var
|
67
|
-
var
|
68
|
-
var
|
69
|
-
var
|
70
|
-
var
|
65
|
+
var import_chunk_GANLEYUE = require("./chunk-GANLEYUE.js");
|
66
|
+
var import_chunk_2AE2H55C = require("./chunk-2AE2H55C.js");
|
67
|
+
var import_chunk_ZWTVFN27 = require("./chunk-ZWTVFN27.js");
|
68
|
+
var import_chunk_OYXPLLDN = require("./chunk-OYXPLLDN.js");
|
69
|
+
var import_chunk_ZWINUKID = require("./chunk-ZWINUKID.js");
|
71
70
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
72
71
|
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
73
72
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
@@ -105,7 +104,7 @@ var debug = (0, import_debug2.default)("prisma:format");
|
|
105
104
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
106
105
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
107
106
|
handleFormatPanic(() => {
|
108
|
-
|
107
|
+
import_chunk_ZWINUKID.prismaSchemaWasm.debug_panic();
|
109
108
|
});
|
110
109
|
}
|
111
110
|
const defaultFormattingOptions = {
|
@@ -122,10 +121,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
122
121
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
123
122
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
124
123
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
125
|
-
const lintDiagnostics2 = (0,
|
124
|
+
const lintDiagnostics2 = (0, import_chunk_2AE2H55C.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
126
125
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
127
126
|
});
|
128
|
-
const lintWarnings = (0,
|
127
|
+
const lintWarnings = (0, import_chunk_2AE2H55C.getLintWarningsAsText)(lintDiagnostics);
|
129
128
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
130
129
|
console.warn(lintWarnings);
|
131
130
|
}
|
@@ -152,7 +151,7 @@ function handleFormatPanic(tryCb) {
|
|
152
151
|
}
|
153
152
|
}
|
154
153
|
function formatWasm(schema, documentFormattingParams) {
|
155
|
-
const formattedSchema =
|
154
|
+
const formattedSchema = import_chunk_ZWINUKID.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
156
155
|
return formattedSchema;
|
157
156
|
}
|
158
157
|
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
@@ -172,6 +171,9 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfi
|
|
172
171
|
}
|
173
172
|
return null;
|
174
173
|
}
|
174
|
+
function printSchemaLoadedMessage(schemaPath2) {
|
175
|
+
process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath2)}`) + "\n");
|
176
|
+
}
|
175
177
|
async function readSchemaFromSingleFile(schemaPath2) {
|
176
178
|
debug2("Reading schema from single file", schemaPath2);
|
177
179
|
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
|
@@ -193,7 +195,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
193
195
|
}
|
194
196
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
195
197
|
debug2("Loading config");
|
196
|
-
const config = await (0,
|
198
|
+
const config = await (0, import_chunk_OYXPLLDN.getConfig)({
|
197
199
|
datamodel: files,
|
198
200
|
ignoreEnvVarErrors: true
|
199
201
|
});
|
@@ -361,20 +363,6 @@ async function getDefaultSchema(cwd, failures = []) {
|
|
361
363
|
}
|
362
364
|
};
|
363
365
|
}
|
364
|
-
async function getSchemaDir(schemaPathFromArgs) {
|
365
|
-
if (schemaPathFromArgs) {
|
366
|
-
return import_path.default.resolve(import_path.default.dirname(schemaPathFromArgs));
|
367
|
-
}
|
368
|
-
const schemaPathResult = await getSchemaWithPath();
|
369
|
-
if (!schemaPathResult) {
|
370
|
-
return null;
|
371
|
-
}
|
372
|
-
return import_path.default.dirname(schemaPathResult.schemaPath);
|
373
|
-
}
|
374
|
-
async function getSchema(schemaPathFromArgs, schemaPathFromConfig) {
|
375
|
-
const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig);
|
376
|
-
return schemaPathResult.schemas;
|
377
|
-
}
|
378
366
|
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
379
367
|
const projectPath = (await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
380
368
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
@@ -415,9 +403,9 @@ async function processSchemaResult({
|
|
415
403
|
}) {
|
416
404
|
const loadedFromPathForLogMessages = import_path2.default.relative(cwd, schemaResult.schemaPath);
|
417
405
|
if (printLoadMessage) {
|
418
|
-
|
406
|
+
printSchemaLoadedMessage(loadedFromPathForLogMessages);
|
419
407
|
}
|
420
|
-
const configFromPsl = await (0,
|
408
|
+
const configFromPsl = await (0, import_chunk_OYXPLLDN.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
|
421
409
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
422
410
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
423
411
|
return {
|
@@ -483,7 +471,7 @@ async function getGenerators(options) {
|
|
483
471
|
}
|
484
472
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
485
473
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
486
|
-
const dmmf = await (0,
|
474
|
+
const dmmf = await (0, import_chunk_GANLEYUE.getDMMF)({
|
487
475
|
datamodel: schemaContext.schemaFiles,
|
488
476
|
previewFeatures
|
489
477
|
});
|
@@ -531,7 +519,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
531
519
|
fromEnvVar: null
|
532
520
|
};
|
533
521
|
}
|
534
|
-
const datamodel = (0,
|
522
|
+
const datamodel = (0, import_chunk_ZWTVFN27.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
535
523
|
const envPaths = await getEnvPaths(schemaContext.schemaPath, { cwd: generatorConfig.output.value });
|
536
524
|
const options2 = {
|
537
525
|
datamodel,
|
@@ -615,7 +603,7 @@ generator gen {
|
|
615
603
|
debug3({ generatorBinaryPaths });
|
616
604
|
generator.setBinaryPaths(generatorBinaryPaths);
|
617
605
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
618
|
-
const customDmmf = await (0,
|
606
|
+
const customDmmf = await (0, import_chunk_GANLEYUE.getDMMF)({
|
619
607
|
datamodel: schemaContext.schemaFiles,
|
620
608
|
previewFeatures
|
621
609
|
});
|
@@ -890,7 +878,7 @@ function checkUnsupportedDataProxy({
|
|
890
878
|
}
|
891
879
|
}
|
892
880
|
if (!schemaContext2?.primaryDatasource) return;
|
893
|
-
const url = (0,
|
881
|
+
const url = (0, import_chunk_OYXPLLDN.resolveUrl)((0, import_chunk_OYXPLLDN.getEffectiveUrl)(schemaContext2.primaryDatasource));
|
894
882
|
if (url?.startsWith("prisma://")) {
|
895
883
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
896
884
|
}
|
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_X7VE2NPV_exports = {};
|
30
|
+
__export(chunk_X7VE2NPV_exports, {
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
32
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
33
33
|
formatSchema: () => formatSchema,
|
@@ -39,18 +39,17 @@ __export(chunk_SZD3E6G4_exports, {
|
|
39
39
|
getNodeAPIName: () => import_get_platform2.getNodeAPIName,
|
40
40
|
getPrismaConfigFromPackageJson: () => getPrismaConfigFromPackageJson,
|
41
41
|
getProjectHash: () => getProjectHash,
|
42
|
-
getSchema: () => getSchema,
|
43
|
-
getSchemaDir: () => getSchemaDir,
|
44
42
|
getSchemaFromPackageJson: () => getSchemaFromPackageJson,
|
45
43
|
getSchemaWithPath: () => getSchemaWithPath,
|
46
44
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
47
45
|
knownBinaryTargets: () => knownBinaryTargets,
|
48
46
|
loadEnvFile: () => loadEnvFile,
|
49
47
|
loadSchemaContext: () => loadSchemaContext,
|
48
|
+
printSchemaLoadedMessage: () => printSchemaLoadedMessage,
|
50
49
|
processSchemaResult: () => processSchemaResult,
|
51
50
|
skipIndex: () => skipIndex
|
52
51
|
});
|
53
|
-
module.exports = __toCommonJS(
|
52
|
+
module.exports = __toCommonJS(chunk_X7VE2NPV_exports);
|
54
53
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
55
54
|
var import_chunk_EPXBOIA5 = require("./chunk-EPXBOIA5.js");
|
56
55
|
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
@@ -172,6 +171,9 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfi
|
|
172
171
|
}
|
173
172
|
return null;
|
174
173
|
}
|
174
|
+
function printSchemaLoadedMessage(schemaPath2) {
|
175
|
+
process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath2)}`) + "\n");
|
176
|
+
}
|
175
177
|
async function readSchemaFromSingleFile(schemaPath2) {
|
176
178
|
debug2("Reading schema from single file", schemaPath2);
|
177
179
|
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
|
@@ -361,20 +363,6 @@ async function getDefaultSchema(cwd, failures = []) {
|
|
361
363
|
}
|
362
364
|
};
|
363
365
|
}
|
364
|
-
async function getSchemaDir(schemaPathFromArgs) {
|
365
|
-
if (schemaPathFromArgs) {
|
366
|
-
return import_path.default.resolve(import_path.default.dirname(schemaPathFromArgs));
|
367
|
-
}
|
368
|
-
const schemaPathResult = await getSchemaWithPath();
|
369
|
-
if (!schemaPathResult) {
|
370
|
-
return null;
|
371
|
-
}
|
372
|
-
return import_path.default.dirname(schemaPathResult.schemaPath);
|
373
|
-
}
|
374
|
-
async function getSchema(schemaPathFromArgs, schemaPathFromConfig) {
|
375
|
-
const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig);
|
376
|
-
return schemaPathResult.schemas;
|
377
|
-
}
|
378
366
|
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
379
367
|
const projectPath = (await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
380
368
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
@@ -415,7 +403,7 @@ async function processSchemaResult({
|
|
415
403
|
}) {
|
416
404
|
const loadedFromPathForLogMessages = import_path2.default.relative(cwd, schemaResult.schemaPath);
|
417
405
|
if (printLoadMessage) {
|
418
|
-
|
406
|
+
printSchemaLoadedMessage(loadedFromPathForLogMessages);
|
419
407
|
}
|
420
408
|
const configFromPsl = await (0, import_chunk_S2R7ACYL.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
|
421
409
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
return to;
|
17
17
|
};
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var
|
20
|
-
__export(
|
19
|
+
var chunk_YIFFEUFQ_exports = {};
|
20
|
+
__export(chunk_YIFFEUFQ_exports, {
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_YIFFEUFQ_exports);
|
24
|
+
var import_chunk_SCFKBBJZ = require("./chunk-SCFKBBJZ.js");
|
25
25
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
27
|
-
const rows = [["Prisma CLI Version",
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_SCFKBBJZ.version]];
|
28
28
|
return `${message}
|
29
29
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_ZWINUKID_exports = {};
|
30
|
+
__export(chunk_ZWINUKID_exports, {
|
31
31
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
32
32
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
|
33
33
|
wasm_exports: () => wasm_exports
|
34
34
|
});
|
35
|
-
module.exports = __toCommonJS(
|
36
|
-
var
|
35
|
+
module.exports = __toCommonJS(chunk_ZWINUKID_exports);
|
36
|
+
var import_chunk_SA67765L = require("./chunk-SA67765L.js");
|
37
37
|
var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
|
38
38
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
39
39
|
var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
|
@@ -42,6 +42,6 @@ var wasm_exports = {};
|
|
42
42
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
43
43
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion
|
44
44
|
});
|
45
|
-
var { dependencies } = (0,
|
45
|
+
var { dependencies } = (0, import_chunk_SA67765L.require_package)();
|
46
46
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
47
47
|
globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_ZWTVFN27_exports = {};
|
30
|
+
__export(chunk_ZWTVFN27_exports, {
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
32
32
|
mergeSchemas: () => mergeSchemas
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_ZWTVFN27_exports);
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
39
|
-
var
|
38
|
+
var import_chunk_YIFFEUFQ = require("./chunk-YIFFEUFQ.js");
|
39
|
+
var import_chunk_ZWINUKID = require("./chunk-ZWINUKID.js");
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
|
|
59
59
|
}).exhaustive();
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
61
61
|
[Context: mergeSchemas]`;
|
62
|
-
super((0,
|
62
|
+
super((0, import_chunk_YIFFEUFQ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
63
63
|
this.name = "MergeSchemasError";
|
64
64
|
}
|
65
65
|
};
|
@@ -72,7 +72,7 @@ function mergeSchemas(options) {
|
|
72
72
|
const params = JSON.stringify({
|
73
73
|
schema: options.schemas
|
74
74
|
});
|
75
|
-
return
|
75
|
+
return import_chunk_ZWINUKID.prismaSchemaWasm.merge_schemas(params);
|
76
76
|
},
|
77
77
|
(e) => ({
|
78
78
|
type: "wasm-error",
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
19
|
var checkUnsupportedDataProxy_exports = {};
|
20
20
|
__export(checkUnsupportedDataProxy_exports, {
|
21
|
-
checkUnsupportedDataProxy: () =>
|
22
|
-
forbiddenCmdWithDataProxyFlagMessage: () =>
|
21
|
+
checkUnsupportedDataProxy: () => import_chunk_VWCKVQI6.checkUnsupportedDataProxy,
|
22
|
+
forbiddenCmdWithDataProxyFlagMessage: () => import_chunk_VWCKVQI6.forbiddenCmdWithDataProxyFlagMessage
|
23
23
|
});
|
24
24
|
module.exports = __toCommonJS(checkUnsupportedDataProxy_exports);
|
25
|
-
var
|
25
|
+
var import_chunk_VWCKVQI6 = require("../chunk-VWCKVQI6.js");
|
26
26
|
var import_chunk_X77CS5RK = require("../chunk-X77CS5RK.js");
|
27
27
|
var import_chunk_EPXBOIA5 = require("../chunk-EPXBOIA5.js");
|
28
28
|
var import_chunk_RS2R7COT = require("../chunk-RS2R7COT.js");
|
@@ -68,7 +68,7 @@ var import_chunk_R3J2O23S = require("../chunk-R3J2O23S.js");
|
|
68
68
|
var import_chunk_ICFLO5JW = require("../chunk-ICFLO5JW.js");
|
69
69
|
var import_chunk_H4NI2RIK = require("../chunk-H4NI2RIK.js");
|
70
70
|
var import_chunk_D4VDA2TZ = require("../chunk-D4VDA2TZ.js");
|
71
|
-
var
|
71
|
+
var import_chunk_3MSKE2BF = require("../chunk-3MSKE2BF.js");
|
72
72
|
var import_chunk_TQCLUNM2 = require("../chunk-TQCLUNM2.js");
|
73
73
|
var import_chunk_OIVPX3BR = require("../chunk-OIVPX3BR.js");
|
74
74
|
var import_chunk_CYAS6B5N = require("../chunk-CYAS6B5N.js");
|
@@ -76,24 +76,24 @@ var import_chunk_HPVMQFIY = require("../chunk-HPVMQFIY.js");
|
|
76
76
|
var import_chunk_E23HYCQJ = require("../chunk-E23HYCQJ.js");
|
77
77
|
var import_chunk_HW5RCZSE = require("../chunk-HW5RCZSE.js");
|
78
78
|
var import_chunk_Y4TOGY6I = require("../chunk-Y4TOGY6I.js");
|
79
|
-
var
|
79
|
+
var import_chunk_GANLEYUE = require("../chunk-GANLEYUE.js");
|
80
80
|
var import_chunk_KB5DKCI4 = require("../chunk-KB5DKCI4.js");
|
81
81
|
var import_chunk_3DQANJMY = require("../chunk-3DQANJMY.js");
|
82
82
|
var import_chunk_6TTRTZXU = require("../chunk-6TTRTZXU.js");
|
83
83
|
var import_chunk_DZYINYAA = require("../chunk-DZYINYAA.js");
|
84
|
-
var
|
85
|
-
var
|
84
|
+
var import_chunk_2AE2H55C = require("../chunk-2AE2H55C.js");
|
85
|
+
var import_chunk_ZWTVFN27 = require("../chunk-ZWTVFN27.js");
|
86
86
|
var import_chunk_D4VZUY3O = require("../chunk-D4VZUY3O.js");
|
87
|
-
var
|
87
|
+
var import_chunk_OYXPLLDN = require("../chunk-OYXPLLDN.js");
|
88
88
|
var import_chunk_WSZXPLJQ = require("../chunk-WSZXPLJQ.js");
|
89
89
|
var import_chunk_R6QH57HZ = require("../chunk-R6QH57HZ.js");
|
90
90
|
var import_chunk_C47SCASR = require("../chunk-C47SCASR.js");
|
91
|
-
var
|
92
|
-
var
|
91
|
+
var import_chunk_YIFFEUFQ = require("../chunk-YIFFEUFQ.js");
|
92
|
+
var import_chunk_SCFKBBJZ = require("../chunk-SCFKBBJZ.js");
|
93
93
|
var import_chunk_QN6PSQY7 = require("../chunk-QN6PSQY7.js");
|
94
94
|
var import_chunk_DTPFRZWV = require("../chunk-DTPFRZWV.js");
|
95
|
-
var
|
96
|
-
var
|
95
|
+
var import_chunk_ZWINUKID = require("../chunk-ZWINUKID.js");
|
96
|
+
var import_chunk_SA67765L = require("../chunk-SA67765L.js");
|
97
97
|
var import_chunk_6JE6QGSJ = require("../chunk-6JE6QGSJ.js");
|
98
98
|
var import_chunk_2H6XXXKO = require("../chunk-2H6XXXKO.js");
|
99
99
|
var import_chunk_QVVSDACW = require("../chunk-QVVSDACW.js");
|
package/dist/cli/getSchema.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import type { GetSchemaResult, SuccessfulLookupResult } from '@prisma/schema-files-loader';
|
2
|
-
import type { MultipleSchemas } from '../utils/schemaFileInput';
|
3
2
|
type PackageJsonLookupResult = SuccessfulLookupResult | {
|
4
3
|
ok: false;
|
5
4
|
error: {
|
@@ -28,6 +27,7 @@ export declare function getSchemaWithPath(schemaPathFromArgs?: string, schemaPat
|
|
28
27
|
* @returns
|
29
28
|
*/
|
30
29
|
export declare function getSchemaWithPathOptional(schemaPathFromArgs?: string, schemaPathFromConfig?: string, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult | null>;
|
30
|
+
export declare function printSchemaLoadedMessage(schemaPath: string): void;
|
31
31
|
export type PrismaConfig = {
|
32
32
|
schema?: string;
|
33
33
|
seed?: string;
|
@@ -37,9 +37,4 @@ export declare function getPrismaConfigFromPackageJson(cwd: string): Promise<{
|
|
37
37
|
packagePath: string;
|
38
38
|
} | null>;
|
39
39
|
export declare function getSchemaFromPackageJson(cwd: string): Promise<PackageJsonLookupResult>;
|
40
|
-
/**
|
41
|
-
* Small helper that returns the directory which contains the `schema.prisma` file
|
42
|
-
*/
|
43
|
-
export declare function getSchemaDir(schemaPathFromArgs?: string): Promise<string | null>;
|
44
|
-
export declare function getSchema(schemaPathFromArgs?: string, schemaPathFromConfig?: string): Promise<MultipleSchemas>;
|
45
40
|
export {};
|