@prisma/internals 6.20.0-dev.8 → 6.20.0-dev.9
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-73KNWD4T.js → chunk-57XKRBO4.js} +8 -10
- package/dist/{chunk-TQFONRJP.js → chunk-5BRXEOYH.js} +5 -5
- package/dist/{chunk-RS2R7COT.js → chunk-5I4ERIIY.js} +3 -9
- package/dist/chunk-5SAWCTGN.js +46 -0
- package/dist/{chunk-T4KYUNGO.js → chunk-63BLJTNP.js} +12 -12
- package/dist/{chunk-UHCUM4US.js → chunk-6AOQ56XS.js} +5 -5
- package/dist/{chunk-F7K755YZ.js → chunk-6XDWK3XF.js} +16 -38
- package/dist/{chunk-X24HKSTU.js → chunk-7AMQW56E.js} +5 -5
- package/dist/{chunk-WFNB7VRA.js → chunk-ARC7TW3L.js} +4 -14
- package/dist/{chunk-OJS6PNYD.js → chunk-AYH4F3GT.js} +5 -5
- package/dist/{chunk-7QC5VORA.js → chunk-BGMZPA2F.js} +5 -6
- package/dist/{chunk-GIXAB3OO.js → chunk-BKZWG6HK.js} +52 -133
- package/dist/{chunk-BVJP43JS.js → chunk-BXIKQUP5.js} +7 -7
- package/dist/{chunk-C3H5LCW7.js → chunk-DZUMYQIA.js} +5 -5
- package/dist/{chunk-FYZCPL2Z.js → chunk-FASYSGWP.js} +3 -6
- package/dist/{chunk-TXQN2QQI.js → chunk-FBHUMCED.js} +11 -11
- package/dist/{chunk-4CGPN5SR.js → chunk-GJSFP4V4.js} +3 -9
- package/dist/{chunk-4JCVHBYR.js → chunk-GL7OANR6.js} +5 -5
- package/dist/{chunk-UQUWZJVN.js → chunk-GZLJZGHX.js} +5 -5
- package/dist/{chunk-BREG3SXT.js → chunk-J2WU5F65.js} +12 -12
- package/dist/{chunk-G7PC6PUN.js → chunk-JBAD62EV.js} +13 -13
- package/dist/{chunk-AX5N26KG.js → chunk-K4IC7NPI.js} +15 -10
- package/dist/{chunk-R3S5ZHUO.js → chunk-KV5M6BWD.js} +13 -13
- package/dist/{chunk-OAT7ZJED.js → chunk-MNP6VO5F.js} +7 -20
- package/dist/{chunk-BCQZ6JQE.js → chunk-NBWRGVYR.js} +4 -6
- package/dist/{chunk-W2C5H5H4.js → chunk-NHM75P2J.js} +7 -9
- package/dist/{chunk-EYVG6XQS.js → chunk-OKVM3CW4.js} +3 -39
- package/dist/{chunk-DT7GMC6R.js → chunk-PHCC4RQK.js} +11 -11
- package/dist/{chunk-F2OZV76L.js → chunk-PKOQQT7I.js} +7 -7
- package/dist/{chunk-75BIJ5PX.js → chunk-Q5XW7CMJ.js} +9 -9
- package/dist/{chunk-OSHZ4P3G.js → chunk-SP2ETLT2.js} +5 -5
- package/dist/{chunk-UHI6VYFX.js → chunk-TRAG7WPX.js} +15 -11
- package/dist/{chunk-27XVRCOV.js → chunk-UIA6QRTF.js} +5 -5
- package/dist/{chunk-HYJQ3CE6.js → chunk-UNTUCN6K.js} +16 -38
- package/dist/{chunk-QSE2V5UT.js → chunk-UUZVVTOP.js} +5 -5
- package/dist/{chunk-RF5CLPSL.js → chunk-UYMUOW4P.js} +52 -133
- package/dist/{chunk-GMW36QQF.js → chunk-V6DWK6TN.js} +7 -7
- package/dist/{chunk-TQCLUNM2.js → chunk-VNIE2AZB.js} +4 -4
- package/dist/{chunk-TZJROXB3.js → chunk-WSZXPLJQ.js} +4 -4
- package/dist/{chunk-LYKUEAOI.js → chunk-XV3WHAKH.js} +5 -5
- package/dist/{chunk-JOIIWB3U.js → chunk-YV4IFLW4.js} +128 -129
- package/dist/{chunk-HFFWZTVM.js → chunk-YXCPS3WU.js} +5 -15
- package/dist/{chunk-WPDUAPVD.js → chunk-YYNGIIPX.js} +5 -5
- package/dist/cli/checkUnsupportedDataProxy.d.ts +7 -9
- package/dist/cli/checkUnsupportedDataProxy.js +52 -62
- package/dist/cli/directoryConfig.d.ts +5 -2
- package/dist/cli/directoryConfig.js +2 -2
- package/dist/cli/getGeneratorSuccessMessage.js +2 -3
- package/dist/cli/getSchema.d.ts +1 -15
- package/dist/cli/getSchema.js +4 -5
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +3 -20
- package/dist/cli/schemaContext.js +53 -62
- package/dist/cli/types.d.ts +1 -1
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +51 -61
- package/dist/engine-commands/getConfig.d.ts +1 -5
- package/dist/engine-commands/getConfig.js +10 -13
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +4 -8
- package/dist/engine-commands/getEnginesInfo.d.ts +0 -1
- package/dist/engine-commands/getEnginesInfo.js +5 -8
- package/dist/engine-commands/index.d.ts +1 -1
- package/dist/engine-commands/index.js +61 -73
- package/dist/engine-commands/lintSchema.js +9 -9
- package/dist/engine-commands/mergeSchemas.js +10 -10
- package/dist/engine-commands/queryEngineCommons.js +6 -6
- package/dist/engine-commands/validate.js +10 -10
- package/dist/get-generators/getGenerators.d.ts +0 -2
- package/dist/get-generators/getGenerators.js +54 -64
- package/dist/get-generators/utils/binaryTypeToEngineType.js +2 -2
- package/dist/get-generators/utils/engineTypeToBinaryType.js +2 -2
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +4 -4
- package/dist/getPackedPackage.js +3 -3
- package/dist/highlight/highlight.js +5 -5
- package/dist/index.d.ts +4 -16
- package/dist/index.js +96 -120
- package/dist/resolveBinary.js +6 -6
- package/dist/schemaEngineCommands.js +7 -7
- package/dist/sendPanic.js +2 -3
- package/dist/types.d.ts +15 -0
- package/dist/utils/fs-functional.js +10 -10
- package/dist/utils/fs-utils.js +8 -8
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +4 -5
- package/dist/utils/missingDatasource.js +4 -4
- package/dist/utils/missingGeneratorMessage.js +6 -6
- package/dist/utils/toSchemasContainer.d.ts +1 -1
- package/dist/utils/toSchemasContainer.js +3 -3
- package/dist/utils/validatePrismaConfigWithDatasource.d.ts +15 -0
- package/dist/utils/{handleEngineLoadingErrors.js → validatePrismaConfigWithDatasource.js} +7 -6
- package/dist/wasm.js +5 -5
- package/package.json +15 -17
- package/dist/chunk-3FP46GUV.js +0 -471
- package/dist/chunk-46ABODUM.js +0 -186
- package/dist/chunk-6TTRTZXU.js +0 -37
- package/dist/chunk-D4VDA2TZ.js +0 -66
- package/dist/chunk-DZYINYAA.js +0 -68
- package/dist/chunk-ERSH2BQA.js +0 -58
- package/dist/chunk-HO5HRHFZ.js +0 -30
- package/dist/chunk-KDHESRKE.js +0 -49
- package/dist/chunk-PZMRR772.js +0 -41
- package/dist/chunk-RFB2U4GQ.js +0 -41
- package/dist/chunk-T2PM5TKT.js +0 -55
- package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +0 -22
- package/dist/cli/checkUnsupportedSchemaEngineWasm.js +0 -135
- package/dist/client/getClientEngineType.d.ts +0 -7
- package/dist/client/getClientEngineType.js +0 -26
- package/dist/dotenvExpand.d.ts +0 -35
- package/dist/dotenvExpand.js +0 -25
- package/dist/utils/__tests__/maskSchema.test.js +0 -23
- package/dist/utils/cloudflareD1.d.ts +0 -5
- package/dist/utils/cloudflareD1.js +0 -27
- package/dist/utils/getEnvPaths.d.ts +0 -14
- package/dist/utils/getEnvPaths.js +0 -29
- package/dist/utils/getMigrateConfigDir.d.ts +0 -2
- package/dist/utils/getMigrateConfigDir.js +0 -25
- package/dist/utils/handleEngineLoadingErrors.d.ts +0 -8
- package/dist/utils/load.d.ts +0 -6
- package/dist/utils/load.js +0 -28
- package/dist/utils/loadEnvFile.d.ts +0 -10
- package/dist/utils/loadEnvFile.js +0 -30
- package/dist/utils/maskSchema.d.ts +0 -4
- package/dist/utils/maskSchema.js +0 -27
- package/dist/utils/serializeQueryEngineName.d.ts +0 -4
- package/dist/utils/serializeQueryEngineName.js +0 -25
- package/dist/utils/tryLoadEnvs.d.ts +0 -25
- package/dist/utils/tryLoadEnvs.js +0 -30
|
@@ -26,83 +26,58 @@ 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_BKZWG6HK_exports = {};
|
|
30
|
+
__export(chunk_BKZWG6HK_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
|
-
checkUnsupportedSchemaEngineWasm: () => checkUnsupportedSchemaEngineWasm,
|
|
33
|
-
forbiddenCmdFlagWithSchemaEngineWasm: () => forbiddenCmdFlagWithSchemaEngineWasm,
|
|
34
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
35
33
|
formatSchema: () => formatSchema,
|
|
36
34
|
getBinaryTargetForCurrentPlatform: () => import_get_platform2.getBinaryTargetForCurrentPlatform,
|
|
37
35
|
getGenerator: () => getGenerator,
|
|
38
36
|
getGenerators: () => getGenerators,
|
|
39
|
-
|
|
37
|
+
getSchemaDatasourceProvider: () => getSchemaDatasourceProvider,
|
|
40
38
|
knownBinaryTargets: () => knownBinaryTargets,
|
|
41
39
|
loadSchemaContext: () => loadSchemaContext,
|
|
42
40
|
processSchemaResult: () => processSchemaResult,
|
|
43
41
|
skipIndex: () => skipIndex
|
|
44
42
|
});
|
|
45
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_BKZWG6HK_exports);
|
|
44
|
+
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
|
+
var import_chunk_PKOQQT7I = require("./chunk-PKOQQT7I.js");
|
|
46
46
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
|
47
47
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
|
48
|
-
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
49
|
-
var import_chunk_F2OZV76L = require("./chunk-F2OZV76L.js");
|
|
50
|
-
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
|
51
|
-
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
52
48
|
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
49
|
+
var import_chunk_K4IC7NPI = require("./chunk-K4IC7NPI.js");
|
|
50
|
+
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
51
|
+
var import_chunk_BGMZPA2F = require("./chunk-BGMZPA2F.js");
|
|
56
52
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
57
53
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
54
|
+
var import_chunk_YYNGIIPX = require("./chunk-YYNGIIPX.js");
|
|
55
|
+
var import_chunk_FBHUMCED = require("./chunk-FBHUMCED.js");
|
|
56
|
+
var import_chunk_UNTUCN6K = require("./chunk-UNTUCN6K.js");
|
|
57
|
+
var import_chunk_J2WU5F65 = require("./chunk-J2WU5F65.js");
|
|
58
|
+
var import_chunk_7AMQW56E = require("./chunk-7AMQW56E.js");
|
|
59
|
+
var import_chunk_OKVM3CW4 = require("./chunk-OKVM3CW4.js");
|
|
65
60
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
66
61
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
67
62
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
68
63
|
var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
|
|
69
64
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
65
|
+
var import_chunk_BXIKQUP5 = require("./chunk-BXIKQUP5.js");
|
|
66
|
+
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
70
67
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
71
|
-
var import_chunk_BVJP43JS = require("./chunk-BVJP43JS.js");
|
|
72
68
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
73
|
-
var
|
|
69
|
+
var import_node_path = __toESM(require("node:path"));
|
|
74
70
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
75
71
|
var import_debug2 = __toESM(require("@prisma/debug"));
|
|
76
72
|
var import_engines = require("@prisma/engines");
|
|
77
73
|
var import_get_platform = require("@prisma/get-platform");
|
|
78
|
-
var
|
|
74
|
+
var import_path = __toESM(require("path"));
|
|
79
75
|
var import_get_platform2 = require("@prisma/get-platform");
|
|
80
|
-
var forbiddenCmdFlagWithSchemaEngineWasm = ({ cmd, flag }) => `
|
|
81
|
-
Passing the ${(0, import_chunk_PG5FDKSF.green)(`${flag}`)} flag to the ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} command is not supported when
|
|
82
|
-
defining an ${(0, import_chunk_PG5FDKSF.green)(`adapter`)} in Prisma config file (e.g., ${(0, import_chunk_PG5FDKSF.green)(`\`prisma.config.ts\``)}).
|
|
83
|
-
|
|
84
|
-
More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/schema-engine-limitations")}
|
|
85
|
-
`;
|
|
86
|
-
function checkUnsupportedSchemaEngineWasm({
|
|
87
|
-
cmd,
|
|
88
|
-
config,
|
|
89
|
-
args,
|
|
90
|
-
flags
|
|
91
|
-
}) {
|
|
92
|
-
if (config.engine !== "js") {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
for (const flag of flags) {
|
|
96
|
-
if (args[flag] !== void 0) {
|
|
97
|
-
throw new Error(forbiddenCmdFlagWithSchemaEngineWasm({ cmd, flag }));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
76
|
var debug = (0, import_debug.default)("prisma:format");
|
|
102
77
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
103
78
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
104
79
|
handleFormatPanic(() => {
|
|
105
|
-
|
|
80
|
+
import_chunk_7AMQW56E.prismaSchemaWasm.debug_panic();
|
|
106
81
|
});
|
|
107
82
|
}
|
|
108
83
|
const defaultFormattingOptions = {
|
|
@@ -119,10 +94,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
|
119
94
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
|
120
95
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
|
121
96
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
122
|
-
const lintDiagnostics2 = (0,
|
|
97
|
+
const lintDiagnostics2 = (0, import_chunk_YYNGIIPX.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
123
98
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
124
99
|
});
|
|
125
|
-
const lintWarnings = (0,
|
|
100
|
+
const lintWarnings = (0, import_chunk_YYNGIIPX.getLintWarningsAsText)(lintDiagnostics);
|
|
126
101
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
|
127
102
|
console.warn(lintWarnings);
|
|
128
103
|
}
|
|
@@ -149,60 +124,44 @@ function handleFormatPanic(tryCb) {
|
|
|
149
124
|
}
|
|
150
125
|
}
|
|
151
126
|
function formatWasm(schema, documentFormattingParams) {
|
|
152
|
-
const formattedSchema =
|
|
127
|
+
const formattedSchema = import_chunk_7AMQW56E.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
153
128
|
return formattedSchema;
|
|
154
129
|
}
|
|
155
130
|
async function loadSchemaContext({
|
|
156
131
|
schemaPathFromArg,
|
|
157
132
|
schemaPathFromConfig,
|
|
158
|
-
schemaEngineConfig,
|
|
159
133
|
printLoadMessage = true,
|
|
160
|
-
ignoreEnvVarErrors = false,
|
|
161
134
|
allowNull = false,
|
|
162
135
|
schemaPathArgumentName = "--schema",
|
|
163
136
|
cwd = process.cwd()
|
|
164
137
|
} = {}) {
|
|
165
138
|
let schemaResult = null;
|
|
166
139
|
if (allowNull) {
|
|
167
|
-
schemaResult = await (0,
|
|
140
|
+
schemaResult = await (0, import_chunk_OKVM3CW4.getSchemaWithPathOptional)(schemaPathFromArg, schemaPathFromConfig, {
|
|
168
141
|
argumentName: schemaPathArgumentName,
|
|
169
142
|
cwd
|
|
170
143
|
});
|
|
171
144
|
if (!schemaResult) return null;
|
|
172
145
|
} else {
|
|
173
|
-
schemaResult = await (0,
|
|
146
|
+
schemaResult = await (0, import_chunk_OKVM3CW4.getSchemaWithPath)(schemaPathFromArg, schemaPathFromConfig, {
|
|
174
147
|
argumentName: schemaPathArgumentName,
|
|
175
148
|
cwd
|
|
176
149
|
});
|
|
177
150
|
}
|
|
178
|
-
return processSchemaResult({ schemaResult,
|
|
151
|
+
return processSchemaResult({ schemaResult, printLoadMessage, cwd });
|
|
179
152
|
}
|
|
180
153
|
async function processSchemaResult({
|
|
181
154
|
schemaResult,
|
|
182
|
-
schemaEngineConfig,
|
|
183
155
|
printLoadMessage = true,
|
|
184
|
-
ignoreEnvVarErrors = false,
|
|
185
156
|
cwd = process.cwd()
|
|
186
157
|
}) {
|
|
187
|
-
const loadedFromPathForLogMessages =
|
|
158
|
+
const loadedFromPathForLogMessages = import_node_path.default.relative(cwd, schemaResult.schemaPath);
|
|
188
159
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
|
189
160
|
if (printLoadMessage) {
|
|
190
|
-
(0,
|
|
161
|
+
(0, import_chunk_OKVM3CW4.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
|
191
162
|
}
|
|
192
|
-
const configFromPsl = await (0,
|
|
193
|
-
const
|
|
194
|
-
const primaryDatasource = (0, import_chunk_XKZ6CBLA.z)(schemaEngineConfig).with({ engine: "classic" }, ({ datasource }) => {
|
|
195
|
-
const { url, directUrl, shadowDatabaseUrl } = datasource;
|
|
196
|
-
const primaryDatasource2 = {
|
|
197
|
-
...datasourceFromPsl,
|
|
198
|
-
url: { fromEnvVar: null, value: url },
|
|
199
|
-
directUrl: directUrl ? { fromEnvVar: null, value: directUrl } : void 0,
|
|
200
|
-
shadowDatabaseUrl: shadowDatabaseUrl ? { fromEnvVar: null, value: shadowDatabaseUrl } : void 0,
|
|
201
|
-
[Symbol.for("engine.classic")]: true
|
|
202
|
-
};
|
|
203
|
-
return primaryDatasource2;
|
|
204
|
-
}).otherwise(() => datasourceFromPsl);
|
|
205
|
-
const primaryDatasourceDirectory = getPrimaryDatasourceDirectory(datasourceFromPsl) || schemaRootDir;
|
|
163
|
+
const configFromPsl = await (0, import_chunk_UNTUCN6K.getConfig)({ datamodel: schemaResult.schemas });
|
|
164
|
+
const primaryDatasource = configFromPsl.datasources.at(0);
|
|
206
165
|
return {
|
|
207
166
|
schemaFiles: schemaResult.schemas,
|
|
208
167
|
schemaPath: schemaResult.schemaPath,
|
|
@@ -210,19 +169,17 @@ async function processSchemaResult({
|
|
|
210
169
|
datasources: configFromPsl.datasources,
|
|
211
170
|
generators: configFromPsl.generators,
|
|
212
171
|
primaryDatasource,
|
|
213
|
-
primaryDatasourceDirectory,
|
|
214
172
|
warnings: configFromPsl.warnings,
|
|
215
173
|
loadedFromPathForLogMessages
|
|
216
174
|
};
|
|
217
175
|
}
|
|
218
|
-
function
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return import_path.default.dirname(datasourcePath);
|
|
176
|
+
function getSchemaDatasourceProvider(schemaContext) {
|
|
177
|
+
if (schemaContext.primaryDatasource === void 0) {
|
|
178
|
+
throw new Error("Schema must contain a datasource block");
|
|
222
179
|
}
|
|
223
|
-
return
|
|
180
|
+
return schemaContext.primaryDatasource.activeProvider;
|
|
224
181
|
}
|
|
225
|
-
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0,
|
|
182
|
+
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_BXIKQUP5.require_p_map)());
|
|
226
183
|
var debug2 = (0, import_debug2.default)("prisma:getGenerators");
|
|
227
184
|
async function getGenerators(options) {
|
|
228
185
|
if (options.registry === void 0 && options.providerAliases !== void 0) {
|
|
@@ -246,29 +203,27 @@ async function getGenerators(options) {
|
|
|
246
203
|
skipDownload,
|
|
247
204
|
binaryPathsOverride,
|
|
248
205
|
generatorNames = [],
|
|
249
|
-
postinstall,
|
|
250
|
-
noEngine,
|
|
251
206
|
allowNoModels = true,
|
|
252
207
|
typedSql
|
|
253
208
|
} = options;
|
|
254
|
-
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath
|
|
209
|
+
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath }) : options.schemaContext;
|
|
255
210
|
if (!schemaContext) {
|
|
256
211
|
throw new Error(`no schema provided for getGenerators`);
|
|
257
212
|
}
|
|
258
213
|
if (!schemaContext.primaryDatasource) {
|
|
259
|
-
throw new Error(
|
|
214
|
+
throw new Error(import_chunk_BGMZPA2F.missingDatasource);
|
|
260
215
|
}
|
|
261
216
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
262
217
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
|
263
|
-
const dmmf = await (0,
|
|
218
|
+
const dmmf = await (0, import_chunk_J2WU5F65.getDMMF)({
|
|
264
219
|
datamodel: schemaContext.schemaFiles,
|
|
265
220
|
previewFeatures
|
|
266
221
|
});
|
|
267
222
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
268
223
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
269
|
-
throw new Error(
|
|
224
|
+
throw new Error(import_chunk_K4IC7NPI.missingModelMessageMongoDB);
|
|
270
225
|
}
|
|
271
|
-
throw new Error(
|
|
226
|
+
throw new Error(import_chunk_K4IC7NPI.missingModelMessage);
|
|
272
227
|
}
|
|
273
228
|
const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
|
|
274
229
|
await validateGenerators(generatorConfigs);
|
|
@@ -277,7 +232,7 @@ async function getGenerators(options) {
|
|
|
277
232
|
const generators = await (0, import_p_map.default)(
|
|
278
233
|
generatorConfigs,
|
|
279
234
|
async (generatorConfig, index) => {
|
|
280
|
-
const baseDir =
|
|
235
|
+
const baseDir = import_path.default.dirname(generatorConfig.sourceFilePath ?? schemaContext.schemaRootDir);
|
|
281
236
|
const providerValue = (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.provider);
|
|
282
237
|
const generatorDefinition = registry[providerValue] ?? {
|
|
283
238
|
type: "rpc",
|
|
@@ -290,7 +245,7 @@ async function getGenerators(options) {
|
|
|
290
245
|
await generatorInstance.init();
|
|
291
246
|
if (generatorConfig.output) {
|
|
292
247
|
generatorConfig.output = {
|
|
293
|
-
value:
|
|
248
|
+
value: import_path.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.output)),
|
|
294
249
|
fromEnvVar: null
|
|
295
250
|
};
|
|
296
251
|
generatorConfig.isCustomOutput = true;
|
|
@@ -311,8 +266,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
311
266
|
fromEnvVar: null
|
|
312
267
|
};
|
|
313
268
|
}
|
|
314
|
-
const datamodel = (0,
|
|
315
|
-
const envPaths = await (0, import_chunk_46ABODUM.getEnvPaths)(schemaContext.schemaPath, { cwd: generatorConfig.output.value });
|
|
269
|
+
const datamodel = (0, import_chunk_FBHUMCED.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
|
316
270
|
const options2 = {
|
|
317
271
|
datamodel,
|
|
318
272
|
datasources: schemaContext.datasources,
|
|
@@ -323,10 +277,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
323
277
|
// TODO:(schemaPath) can we get rid of schema path passing here?
|
|
324
278
|
version: version2 || import_engines.enginesVersion,
|
|
325
279
|
// this version makes no sense anymore and should be ignored
|
|
326
|
-
postinstall,
|
|
327
|
-
noEngine,
|
|
328
280
|
allowNoModels,
|
|
329
|
-
envPaths,
|
|
330
281
|
typedSql
|
|
331
282
|
};
|
|
332
283
|
generatorInstance.setOptions(options2);
|
|
@@ -370,18 +321,16 @@ generator gen {
|
|
|
370
321
|
}
|
|
371
322
|
const generatorBinaryTargets = g.options?.generator?.binaryTargets;
|
|
372
323
|
if (generatorBinaryTargets && generatorBinaryTargets.length > 0) {
|
|
373
|
-
for (const
|
|
374
|
-
if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value ===
|
|
375
|
-
neededVersions[neededVersion].binaryTargets.push(
|
|
324
|
+
for (const binaryTarget of generatorBinaryTargets) {
|
|
325
|
+
if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value === binaryTarget.value)) {
|
|
326
|
+
neededVersions[neededVersion].binaryTargets.push(binaryTarget);
|
|
376
327
|
}
|
|
377
328
|
}
|
|
378
329
|
}
|
|
379
330
|
}
|
|
380
331
|
}
|
|
381
|
-
const queryEngineBinaryType = (0, import_engines.getCliQueryEngineBinaryType)();
|
|
382
|
-
const queryEngineType = (0, import_chunk_RS2R7COT.binaryTypeToEngineType)(queryEngineBinaryType);
|
|
383
332
|
debug2("neededVersions", JSON.stringify(neededVersions, null, 2));
|
|
384
|
-
const { binaryPathsByVersion
|
|
333
|
+
const { binaryPathsByVersion } = await (0, import_chunk_PKOQQT7I.getBinaryPathsByVersion)({
|
|
385
334
|
neededVersions,
|
|
386
335
|
// We're lazily computing the binary target here, to avoid printing the
|
|
387
336
|
// `Prisma failed to detect the libssl/openssl version to use` warning
|
|
@@ -402,17 +351,6 @@ generator gen {
|
|
|
402
351
|
const generatorBinaryPaths = (0, import_chunk_GXW4NTU2.pick)(binaryPaths ?? {}, generator.manifest.requiresEngines);
|
|
403
352
|
debug2({ generatorBinaryPaths });
|
|
404
353
|
generator.setBinaryPaths(generatorBinaryPaths);
|
|
405
|
-
if (engineVersion !== version2 && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
|
406
|
-
const customDmmf = await (0, import_chunk_BREG3SXT.getDMMF)({
|
|
407
|
-
datamodel: schemaContext.schemaFiles,
|
|
408
|
-
previewFeatures
|
|
409
|
-
});
|
|
410
|
-
const options2 = { ...generator.options, dmmf: customDmmf };
|
|
411
|
-
debug2("generator.manifest.prettyName", generator.manifest.prettyName);
|
|
412
|
-
debug2("options", options2);
|
|
413
|
-
debug2("options.generator.binaryTargets", options2.generator.binaryTargets);
|
|
414
|
-
generator.setOptions(options2);
|
|
415
|
-
}
|
|
416
354
|
}
|
|
417
355
|
}
|
|
418
356
|
return generators;
|
|
@@ -437,17 +375,6 @@ var oldToNewBinaryTargetsMapping = {
|
|
|
437
375
|
async function validateGenerators(generators) {
|
|
438
376
|
const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
|
|
439
377
|
for (const generator of generators) {
|
|
440
|
-
if (generator.config.platforms) {
|
|
441
|
-
throw new Error(
|
|
442
|
-
`The \`platforms\` field on the generator definition is deprecated. Please rename it to \`binaryTargets\`.`
|
|
443
|
-
);
|
|
444
|
-
}
|
|
445
|
-
if (generator.config.pinnedBinaryTargets) {
|
|
446
|
-
throw new Error(
|
|
447
|
-
`The \`pinnedBinaryTargets\` field on the generator definition is deprecated.
|
|
448
|
-
Please use the PRISMA_QUERY_ENGINE_BINARY env var instead to pin the binary target.`
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
378
|
if (generator.binaryTargets) {
|
|
452
379
|
const binaryTargets2 = generator.binaryTargets && generator.binaryTargets.length > 0 ? generator.binaryTargets : [{ fromEnvVar: null, value: "native" }];
|
|
453
380
|
const resolvedBinaryTargets = binaryTargets2.flatMap((object) => (0, import_chunk_IOIAK7V7.parseBinaryTargetsEnvValue)(object)).map((p) => p === "native" ? binaryTarget : p);
|
|
@@ -507,25 +434,17 @@ function filterGenerators(generators, generatorNames) {
|
|
|
507
434
|
}
|
|
508
435
|
return filtered;
|
|
509
436
|
}
|
|
510
|
-
var forbiddenCmdWithDataProxyFlagMessage = (
|
|
511
|
-
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${
|
|
512
|
-
Please use a direct connection to your database
|
|
437
|
+
var forbiddenCmdWithDataProxyFlagMessage = (cmd) => `
|
|
438
|
+
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} yet.
|
|
439
|
+
Please use a direct connection to your database in \`prisma.config.ts\`.
|
|
513
440
|
|
|
514
441
|
More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/accelerate-limitations")}
|
|
515
442
|
`;
|
|
516
443
|
function checkUnsupportedDataProxy({
|
|
517
444
|
cmd,
|
|
518
|
-
|
|
519
|
-
urls = []
|
|
445
|
+
validatedConfig
|
|
520
446
|
}) {
|
|
521
|
-
|
|
522
|
-
if (url2 && url2.includes("prisma://")) {
|
|
523
|
-
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
if (!schemaContext?.primaryDatasource) return;
|
|
527
|
-
const url = (0, import_chunk_F7K755YZ.resolveUrl)((0, import_chunk_F7K755YZ.getEffectiveUrl)(schemaContext.primaryDatasource));
|
|
528
|
-
if (url?.startsWith("prisma://")) {
|
|
447
|
+
if (validatedConfig.datasource.url.startsWith("prisma://")) {
|
|
529
448
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
530
449
|
}
|
|
531
450
|
}
|
|
@@ -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_BXIKQUP5_exports = {};
|
|
30
|
+
__export(chunk_BXIKQUP5_exports, {
|
|
31
31
|
getPackedPackage: () => getPackedPackage,
|
|
32
32
|
require_p_map: () => require_p_map
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_BXIKQUP5_exports);
|
|
35
35
|
var import_chunk_KDP6C3CB = require("./chunk-KDP6C3CB.js");
|
|
36
|
-
var
|
|
36
|
+
var import_chunk_YV4IFLW4 = require("./chunk-YV4IFLW4.js");
|
|
37
37
|
var import_chunk_UMM35VP5 = require("./chunk-UMM35VP5.js");
|
|
38
38
|
var import_chunk_5VQNKCKW = require("./chunk-5VQNKCKW.js");
|
|
39
39
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
@@ -6254,9 +6254,9 @@ var require_del = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
6254
6254
|
"use strict";
|
|
6255
6255
|
var { promisify } = (0, import_chunk_4VNS5WPM.__require)("util");
|
|
6256
6256
|
var path2 = (0, import_chunk_4VNS5WPM.__require)("path");
|
|
6257
|
-
var globby = (0,
|
|
6258
|
-
var isGlob = (0,
|
|
6259
|
-
var slash = (0,
|
|
6257
|
+
var globby = (0, import_chunk_YV4IFLW4.require_globby)();
|
|
6258
|
+
var isGlob = (0, import_chunk_YV4IFLW4.require_is_glob)();
|
|
6259
|
+
var slash = (0, import_chunk_YV4IFLW4.require_slash)();
|
|
6260
6260
|
var gracefulFs = require_graceful_fs();
|
|
6261
6261
|
var isPathCwd = require_is_path_cwd();
|
|
6262
6262
|
var isPathInside = require_is_path_inside();
|
|
@@ -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_DZUMYQIA_exports = {};
|
|
20
|
+
__export(chunk_DZUMYQIA_exports, {
|
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var import_chunk_UHCUM4US = require("./chunk-UHCUM4US.js");
|
|
23
|
+
module.exports = __toCommonJS(chunk_DZUMYQIA_exports);
|
|
25
24
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
|
25
|
+
var import_chunk_6AOQ56XS = require("./chunk-6AOQ56XS.js");
|
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
|
27
|
-
const rows = [["Prisma CLI Version",
|
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_6AOQ56XS.version]];
|
|
28
28
|
return `${message}
|
|
29
29
|
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
|
@@ -26,15 +26,15 @@ 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_FASYSGWP_exports = {};
|
|
30
|
+
__export(chunk_FASYSGWP_exports, {
|
|
31
31
|
BinaryType: () => import_fetch_engine.BinaryType,
|
|
32
32
|
engineEnvVarMap: () => import_fetch_engine.engineEnvVarMap,
|
|
33
33
|
maybeCopyToTmp: () => maybeCopyToTmp,
|
|
34
34
|
resolveBinary: () => resolveBinary,
|
|
35
35
|
safeResolveBinary: () => safeResolveBinary
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(chunk_FASYSGWP_exports);
|
|
38
38
|
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
|
39
39
|
var import_chunk_IDINCQMN = require("./chunk-IDINCQMN.js");
|
|
40
40
|
var import_chunk_TWSLDIFL = require("./chunk-TWSLDIFL.js");
|
|
@@ -51,9 +51,6 @@ var import_temp_dir = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_5VQNKC
|
|
|
51
51
|
async function getBinaryName(name) {
|
|
52
52
|
const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
|
|
53
53
|
const extension = binaryTarget === "windows" ? ".exe" : "";
|
|
54
|
-
if (name === import_fetch_engine.BinaryType.QueryEngineLibrary) {
|
|
55
|
-
return (0, import_get_platform.getNodeAPIName)(binaryTarget, "fs");
|
|
56
|
-
}
|
|
57
54
|
return `${name}-${binaryTarget}${extension}`;
|
|
58
55
|
}
|
|
59
56
|
async function resolveBinary(name, proposedPath) {
|
|
@@ -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_FBHUMCED_exports = {};
|
|
30
|
+
__export(chunk_FBHUMCED_exports, {
|
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
|
32
32
|
mergeSchemas: () => mergeSchemas
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
36
|
-
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
34
|
+
module.exports = __toCommonJS(chunk_FBHUMCED_exports);
|
|
35
|
+
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
|
37
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
37
|
+
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
+
var import_chunk_DZUMYQIA = require("./chunk-DZUMYQIA.js");
|
|
39
|
+
var import_chunk_7AMQW56E = require("./chunk-7AMQW56E.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,12 +59,12 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: mergeSchemas]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_DZUMYQIA.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "MergeSchemasError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
function mergeSchemas(options) {
|
|
67
|
-
const debugErrorType = (0,
|
|
67
|
+
const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "mergeSchemasWasm");
|
|
68
68
|
debug(`Using mergeSchemas Wasm`);
|
|
69
69
|
const mergeSchemasEither = (0, import_function.pipe)(
|
|
70
70
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
@@ -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_7AMQW56E.prismaSchemaWasm.merge_schemas(params);
|
|
76
76
|
},
|
|
77
77
|
(e) => ({
|
|
78
78
|
type: "wasm-error",
|
|
@@ -104,7 +104,7 @@ function mergeSchemas(options) {
|
|
|
104
104
|
return panic;
|
|
105
105
|
}
|
|
106
106
|
const errorOutput = e.error.message;
|
|
107
|
-
return new MergeSchemasError((0,
|
|
107
|
+
return new MergeSchemasError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
108
108
|
}).exhaustive();
|
|
109
109
|
throw error;
|
|
110
110
|
}
|
|
@@ -16,21 +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_GJSFP4V4_exports = {};
|
|
20
|
+
__export(chunk_GJSFP4V4_exports, {
|
|
21
21
|
engineTypeToBinaryType: () => engineTypeToBinaryType
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_GJSFP4V4_exports);
|
|
24
24
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
25
25
|
function engineTypeToBinaryType(engineType) {
|
|
26
26
|
if (engineType === "schemaEngine") {
|
|
27
27
|
return import_fetch_engine.BinaryType.SchemaEngineBinary;
|
|
28
28
|
}
|
|
29
|
-
if (engineType === "queryEngine") {
|
|
30
|
-
return import_fetch_engine.BinaryType.QueryEngineBinary;
|
|
31
|
-
}
|
|
32
|
-
if (engineType === "libqueryEngine") {
|
|
33
|
-
return import_fetch_engine.BinaryType.QueryEngineLibrary;
|
|
34
|
-
}
|
|
35
29
|
throw new Error(`Could not convert engine type ${engineType}`);
|
|
36
30
|
}
|
|
@@ -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_GL7OANR6_exports = {};
|
|
30
|
+
__export(chunk_GL7OANR6_exports, {
|
|
31
31
|
getCLIPathHash: () => getCLIPathHash,
|
|
32
32
|
getProjectHash: () => getProjectHash
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_GL7OANR6_exports);
|
|
35
|
+
var import_chunk_OKVM3CW4 = require("./chunk-OKVM3CW4.js");
|
|
36
36
|
var import_crypto = __toESM(require("crypto"));
|
|
37
37
|
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
|
38
|
-
const projectPath = (await (0,
|
|
38
|
+
const projectPath = (await (0, import_chunk_OKVM3CW4.getSchemaWithPath)(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
|
39
39
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
|
40
40
|
}
|
|
41
41
|
function getCLIPathHash() {
|
|
@@ -26,15 +26,15 @@ 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_GZLJZGHX_exports = {};
|
|
30
|
+
__export(chunk_GZLJZGHX_exports, {
|
|
31
31
|
handlePanic: () => handlePanic
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_GZLJZGHX_exports);
|
|
34
34
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
35
35
|
var import_chunk_7IKUTPWQ = require("./chunk-7IKUTPWQ.js");
|
|
36
36
|
var import_chunk_FCYHZHVW = require("./chunk-FCYHZHVW.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_YXCPS3WU = require("./chunk-YXCPS3WU.js");
|
|
38
38
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
39
39
|
var import_prompts = __toESM(require("prompts"));
|
|
40
40
|
async function handlePanic(args) {
|
|
@@ -79,7 +79,7 @@ ${(0, import_chunk_PG5FDKSF.dim)(`Learn more: ${(0, import_chunk_I6WLABB2.link)(
|
|
|
79
79
|
if (shouldSubmitReport) {
|
|
80
80
|
try {
|
|
81
81
|
console.log("Submitting...");
|
|
82
|
-
const reportId = await (0,
|
|
82
|
+
const reportId = await (0, import_chunk_YXCPS3WU.sendPanic)({ error, cliVersion, enginesVersion, getDatabaseVersionSafe });
|
|
83
83
|
console.log(`
|
|
84
84
|
${(0, import_chunk_PG5FDKSF.bold)(`We successfully received the error report id: ${reportId}`)}`);
|
|
85
85
|
console.log(`
|