@prisma/internals 6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.4 → 6.6.0-integration-mcp.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/{chunk-GIOVJ5SL.js → chunk-226NCPFJ.js} +8 -8
- package/dist/{chunk-TV34NMBZ.js → chunk-2H6XXXKO.js} +15 -12
- package/dist/{chunk-EPXBOIA5.js → chunk-2I3VYCA7.js} +5 -5
- package/dist/{chunk-2QTAK7KO.js → chunk-2LDG4PID.js} +5 -5
- package/dist/{chunk-JOIIWB3U.js → chunk-2LOGW45F.js} +68 -33
- package/dist/{chunk-KB5DKCI4.js → chunk-3GYXMWBM.js} +7 -7
- package/dist/{chunk-75AJJ2SV.js → chunk-5UX7SDF4.js} +5 -5
- package/dist/{chunk-FQ7QE2EZ.js → chunk-6NIWKOQM.js} +5 -5
- package/dist/{chunk-GHQCAB3L.js → chunk-6TAXYMS3.js} +8 -8
- package/dist/{chunk-DG3K2SNH.js → chunk-A4UZ4UKB.js} +66 -127
- package/dist/{chunk-PQE76XRR.js → chunk-AP52B62F.js} +5 -5
- package/dist/{chunk-HG3YOAAE.js → chunk-AXD7KB4D.js} +5 -5
- package/dist/chunk-DYV47NUW.js +796 -0
- package/dist/{chunk-DKSUHQGA.js → chunk-EKESIUIK.js} +7 -7
- package/dist/{chunk-VVXXJDPA.js → chunk-FAPPXX7W.js} +8 -8
- package/dist/{chunk-OB2FZR3M.js → chunk-FAQHAUBK.js} +7 -7
- package/dist/{chunk-BTWAF3S4.js → chunk-GV244NDE.js} +7 -7
- package/dist/{chunk-D4VDA2TZ.js → chunk-IRWX4FCC.js} +6 -6
- package/dist/{chunk-IDINCQMN.js → chunk-IWTEX7EE.js} +9 -780
- package/dist/{chunk-XKIMYV5V.js → chunk-J27QTOYA.js} +5 -5
- package/dist/{chunk-NVNI2SRU.js → chunk-KNNTV7IN.js} +687 -213
- package/dist/{chunk-AZI6RPIA.js → chunk-L2SLJQ2Z.js} +5 -5
- package/dist/{chunk-55SEKKR3.js → chunk-LWBLVV7Y.js} +8 -8
- package/dist/{chunk-5AI4FIZ3.js → chunk-MEOOYUIZ.js} +10 -10
- package/dist/{chunk-TQFONRJP.js → chunk-MXAUURHG.js} +5 -5
- package/dist/{chunk-QGJH4P4N.js → chunk-OQ2NRV2Y.js} +5 -5
- package/dist/{chunk-U4BGZ3NX.js → chunk-OUQPIJFQ.js} +5 -5
- package/dist/{chunk-MSQTODVE.js → chunk-OYKZ24UT.js} +8 -8
- package/dist/{chunk-EWWOTVR3.js → chunk-PE6DXWOX.js} +6 -6
- package/dist/{chunk-XQSHUIJ5.js → chunk-PING5S2U.js} +8 -8
- package/dist/{chunk-HX2VLZFY.js → chunk-PWGQKUJW.js} +66 -127
- package/dist/{chunk-K5W6WZ6E.js → chunk-R4ZFFYJA.js} +238 -2734
- package/dist/{chunk-3DQANJMY.js → chunk-SAAMENIS.js} +7 -7
- package/dist/{chunk-LHESHKC2.js → chunk-SNSJWJTA.js} +5 -5
- package/dist/{chunk-YR5KNFKN.js → chunk-SUOMIRLO.js} +6 -6
- package/dist/{chunk-75BIJ5PX.js → chunk-UB2X7DGZ.js} +9 -9
- package/dist/{chunk-VVPSLVOR.js → chunk-URRVX2VQ.js} +3 -4
- package/dist/{chunk-EZI6235B.js → chunk-VTJOX6HO.js} +5 -5
- package/dist/{chunk-ABTIXQDX.js → chunk-VYJSNZF3.js} +4 -4
- package/dist/{chunk-POCSNJFA.js → chunk-W2PA2Y65.js} +5 -5
- package/dist/{chunk-ETYWYJBX.js → chunk-WF5LZFJS.js} +12 -12
- package/dist/cli/checkUnsupportedDataProxy.js +33 -32
- package/dist/cli/directoryConfig.d.ts +1 -1
- package/dist/cli/directoryConfig.js +2 -2
- package/dist/cli/getSchema.d.ts +3 -28
- package/dist/cli/getSchema.js +36 -36
- package/dist/cli/hashes.d.ts +1 -2
- package/dist/cli/hashes.js +33 -32
- package/dist/cli/schemaContext.d.ts +4 -3
- package/dist/cli/schemaContext.js +33 -32
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +32 -31
- package/dist/engine-commands/getConfig.js +10 -10
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/getEngineVersion.js +7 -6
- package/dist/engine-commands/getEnginesMetaInfo.js +9 -8
- package/dist/engine-commands/index.js +43 -42
- 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/errorReporting.js +6 -6
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +32 -31
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.js +3 -3
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.js +3 -3
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +32 -31
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.js +3 -3
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +33 -32
- package/dist/get-generators/getGenerators.js +35 -34
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +4 -3
- package/dist/getPackedPackage.js +5 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +75 -75
- package/dist/{multipart-parser-3AFJFP6K.js → multipart-parser-UV3WZSWW.js} +6 -6
- package/dist/resolveBinary.js +8 -7
- package/dist/schemaEngineCommands.js +10 -9
- package/dist/sendPanic.js +4 -4
- package/dist/utils/cloudflareD1.js +3 -3
- package/dist/utils/fs-functional.js +10 -10
- package/dist/utils/fs-utils.js +8 -8
- package/dist/utils/getEnvPaths.js +32 -31
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +5 -5
- package/dist/utils/loadEnvFile.js +32 -31
- package/dist/wasm.js +4 -4
- package/package.json +11 -11
@@ -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_A4UZ4UKB_exports = {};
|
30
|
+
__export(chunk_A4UZ4UKB_exports, {
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
33
|
debug: () => debug4,
|
@@ -42,26 +42,25 @@ __export(chunk_DG3K2SNH_exports, {
|
|
42
42
|
getNodeAPIName: () => import_get_platform2.getNodeAPIName,
|
43
43
|
getPrismaConfigFromPackageJson: () => getPrismaConfigFromPackageJson,
|
44
44
|
getProjectHash: () => getProjectHash,
|
45
|
-
getSchema: () => getSchema,
|
46
|
-
getSchemaDir: () => getSchemaDir,
|
47
45
|
getSchemaFromPackageJson: () => getSchemaFromPackageJson,
|
48
46
|
getSchemaWithPath: () => getSchemaWithPath,
|
49
47
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
50
48
|
knownBinaryTargets: () => knownBinaryTargets,
|
51
49
|
loadEnvFile: () => loadEnvFile,
|
52
50
|
loadSchemaContext: () => loadSchemaContext,
|
51
|
+
printSchemaLoadedMessage: () => printSchemaLoadedMessage,
|
53
52
|
prismaClientResolver: () => prismaClientResolver,
|
54
53
|
processSchemaResult: () => processSchemaResult,
|
55
54
|
skipIndex: () => skipIndex
|
56
55
|
});
|
57
|
-
module.exports = __toCommonJS(
|
58
|
-
var
|
56
|
+
module.exports = __toCommonJS(chunk_A4UZ4UKB_exports);
|
57
|
+
var import_chunk_OQ2NRV2Y = require("./chunk-OQ2NRV2Y.js");
|
59
58
|
var import_chunk_GHHABGYW = require("./chunk-GHHABGYW.js");
|
60
59
|
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
61
|
-
var
|
60
|
+
var import_chunk_PE6DXWOX = require("./chunk-PE6DXWOX.js");
|
62
61
|
var import_chunk_72UZXEBG = require("./chunk-72UZXEBG.js");
|
63
62
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
64
|
-
var
|
63
|
+
var import_chunk_2I3VYCA7 = require("./chunk-2I3VYCA7.js");
|
65
64
|
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
66
65
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
67
66
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
@@ -73,18 +72,18 @@ var import_chunk_XLTQGAI2 = require("./chunk-XLTQGAI2.js");
|
|
73
72
|
var import_chunk_HAGJ64PM = require("./chunk-HAGJ64PM.js");
|
74
73
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
75
74
|
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
76
|
-
var
|
77
|
-
var
|
78
|
-
var
|
79
|
-
var
|
80
|
-
var
|
75
|
+
var import_chunk_J27QTOYA = require("./chunk-J27QTOYA.js");
|
76
|
+
var import_chunk_FAQHAUBK = require("./chunk-FAQHAUBK.js");
|
77
|
+
var import_chunk_OYKZ24UT = require("./chunk-OYKZ24UT.js");
|
78
|
+
var import_chunk_226NCPFJ = require("./chunk-226NCPFJ.js");
|
79
|
+
var import_chunk_6NIWKOQM = require("./chunk-6NIWKOQM.js");
|
81
80
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
82
81
|
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
83
82
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
84
83
|
var import_chunk_DYVL6P7F = require("./chunk-DYVL6P7F.js");
|
85
84
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
86
|
-
var
|
87
|
-
var
|
85
|
+
var import_chunk_R4ZFFYJA = require("./chunk-R4ZFFYJA.js");
|
86
|
+
var import_chunk_URRVX2VQ = require("./chunk-URRVX2VQ.js");
|
88
87
|
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
89
88
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
90
89
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
@@ -121,7 +120,7 @@ var debug = (0, import_debug2.default)("prisma:format");
|
|
121
120
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
122
121
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
123
122
|
handleFormatPanic(() => {
|
124
|
-
|
123
|
+
import_chunk_6NIWKOQM.prismaSchemaWasm.debug_panic();
|
125
124
|
});
|
126
125
|
}
|
127
126
|
const defaultFormattingOptions = {
|
@@ -138,10 +137,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
138
137
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
139
138
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
140
139
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
141
|
-
const lintDiagnostics2 = (0,
|
140
|
+
const lintDiagnostics2 = (0, import_chunk_J27QTOYA.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
142
141
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
143
142
|
});
|
144
|
-
const lintWarnings = (0,
|
143
|
+
const lintWarnings = (0, import_chunk_J27QTOYA.getLintWarningsAsText)(lintDiagnostics);
|
145
144
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
146
145
|
console.warn(lintWarnings);
|
147
146
|
}
|
@@ -168,7 +167,7 @@ function handleFormatPanic(tryCb) {
|
|
168
167
|
}
|
169
168
|
}
|
170
169
|
function formatWasm(schema, documentFormattingParams) {
|
171
|
-
const formattedSchema =
|
170
|
+
const formattedSchema = import_chunk_6NIWKOQM.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
172
171
|
return formattedSchema;
|
173
172
|
}
|
174
173
|
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
@@ -188,6 +187,9 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfi
|
|
188
187
|
}
|
189
188
|
return null;
|
190
189
|
}
|
190
|
+
function printSchemaLoadedMessage(schemaPath2) {
|
191
|
+
process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath2)}`) + "\n");
|
192
|
+
}
|
191
193
|
async function readSchemaFromSingleFile(schemaPath2) {
|
192
194
|
debug2("Reading schema from single file", schemaPath2);
|
193
195
|
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
|
@@ -209,7 +211,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
209
211
|
}
|
210
212
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
211
213
|
debug2("Loading config");
|
212
|
-
const config = await (0,
|
214
|
+
const config = await (0, import_chunk_OYKZ24UT.getConfig)({
|
213
215
|
datamodel: files,
|
214
216
|
ignoreEnvVarErrors: true
|
215
217
|
});
|
@@ -283,15 +285,16 @@ function renderLookupError(error) {
|
|
283
285
|
function renderDefaultLookupError(error, cwd) {
|
284
286
|
const parts = [
|
285
287
|
`Could not find Prisma Schema that is required for this command.`,
|
286
|
-
`You can either provide it with ${(0, import_chunk_PG5FDKSF.green)(
|
287
|
-
|
288
|
-
|
288
|
+
`You can either provide it with ${(0, import_chunk_PG5FDKSF.green)("`--schema`")} argument,`,
|
289
|
+
`set it in your ${(0, import_chunk_PG5FDKSF.green)("`prisma.config.ts`")},`,
|
290
|
+
`set it as ${(0, import_chunk_PG5FDKSF.green)("`prisma.schema`")} in your ${(0, import_chunk_PG5FDKSF.green)("package.json")},`,
|
291
|
+
`or put it into the default location (${(0, import_chunk_PG5FDKSF.green)("`./prisma/schema.prisma`")}, or ${(0, import_chunk_PG5FDKSF.green)("`./schema.prisma`")}.`,
|
289
292
|
"Checked following paths:\n"
|
290
293
|
];
|
291
294
|
const printedPaths = /* @__PURE__ */ new Set();
|
292
295
|
for (const failure of error.failures) {
|
293
|
-
const filePath = failure.
|
294
|
-
if (!printedPaths.has(failure.
|
296
|
+
const filePath = failure.path;
|
297
|
+
if (!printedPaths.has(failure.path)) {
|
295
298
|
parts.push(`${import_path.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
|
296
299
|
printedPaths.add(filePath);
|
297
300
|
}
|
@@ -300,7 +303,7 @@ function renderDefaultLookupError(error, cwd) {
|
|
300
303
|
return parts.join("\n");
|
301
304
|
}
|
302
305
|
async function getPrismaConfigFromPackageJson(cwd) {
|
303
|
-
const pkgJson = await (0,
|
306
|
+
const pkgJson = await (0, import_chunk_R4ZFFYJA.readPackageUp)({ cwd, normalize: false });
|
304
307
|
const prismaPropertyFromPkgJson = pkgJson?.packageJson?.prisma;
|
305
308
|
if (!pkgJson) {
|
306
309
|
return null;
|
@@ -317,21 +320,13 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
317
320
|
error: { kind: "PrismaConfigNotConfigured" }
|
318
321
|
};
|
319
322
|
}
|
320
|
-
|
321
|
-
if (
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
}
|
328
|
-
} else {
|
329
|
-
schemaResult = await readSchemaFromDirectory(schemaPathFromConfig.folderPath);
|
330
|
-
if (!schemaResult.ok) {
|
331
|
-
throw new Error(
|
332
|
-
`Could not load schema from folder \`${schemaPathFromConfig.folderPath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
|
333
|
-
);
|
334
|
-
}
|
323
|
+
const schemaResult = await readSchemaFromFileOrDirectory(schemaPathFromConfig);
|
324
|
+
if (!schemaResult.ok) {
|
325
|
+
throw new Error(
|
326
|
+
`Could not load schema from \`${schemaPathFromConfig}\` provided by "prisma.config.ts"\`: ${renderLookupError(
|
327
|
+
schemaResult.error
|
328
|
+
)}`
|
329
|
+
);
|
335
330
|
}
|
336
331
|
return schemaResult;
|
337
332
|
}
|
@@ -366,51 +361,14 @@ async function getSchemaFromPackageJson(cwd) {
|
|
366
361
|
return lookupResult;
|
367
362
|
}
|
368
363
|
async function getDefaultSchema(cwd, failures = []) {
|
369
|
-
const
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
}
|
374
|
-
};
|
375
|
-
const prismaSchemaFile = {
|
376
|
-
schemaPath: {
|
377
|
-
path: import_path.default.join(cwd, "prisma", "schema.prisma"),
|
378
|
-
kind: "file"
|
379
|
-
},
|
380
|
-
conflictsWith: {
|
381
|
-
path: import_path.default.join(cwd, "prisma", "schema"),
|
382
|
-
kind: "directory"
|
383
|
-
}
|
384
|
-
};
|
385
|
-
const prismaSchemaFolder = {
|
386
|
-
schemaPath: {
|
387
|
-
path: import_path.default.join(cwd, "prisma", "schema"),
|
388
|
-
kind: "directory"
|
389
|
-
},
|
390
|
-
conflictsWith: {
|
391
|
-
path: import_path.default.join(cwd, "prisma", "schema.prisma"),
|
392
|
-
kind: "file"
|
393
|
-
}
|
394
|
-
};
|
395
|
-
const rules = [schemaPrisma, prismaSchemaFile, prismaSchemaFolder];
|
396
|
-
for (const rule of rules) {
|
397
|
-
debug2(`Checking existence of ${rule.schemaPath.path}`);
|
398
|
-
const schema = await loadSchemaFromDefaultLocation(rule.schemaPath);
|
364
|
+
const lookupPaths = [import_path.default.join(cwd, "schema.prisma"), import_path.default.join(cwd, "prisma", "schema.prisma")];
|
365
|
+
for (const path9 of lookupPaths) {
|
366
|
+
debug2(`Checking existence of ${path9}`);
|
367
|
+
const schema = await readSchemaFromSingleFile(path9);
|
399
368
|
if (!schema.ok) {
|
400
|
-
failures.push({
|
369
|
+
failures.push({ path: path9, error: schema.error });
|
401
370
|
continue;
|
402
371
|
}
|
403
|
-
if (rule.conflictsWith) {
|
404
|
-
const conflictingSchema = await loadSchemaFromDefaultLocation(rule.conflictsWith);
|
405
|
-
if (conflictingSchema.ok) {
|
406
|
-
throw new Error(
|
407
|
-
`Found Prisma Schemas at both \`${import_path.default.relative(cwd, rule.schemaPath.path)}\` and \`${import_path.default.relative(
|
408
|
-
cwd,
|
409
|
-
rule.conflictsWith.path
|
410
|
-
)}\`. Please remove one.`
|
411
|
-
);
|
412
|
-
}
|
413
|
-
}
|
414
372
|
return schema;
|
415
373
|
}
|
416
374
|
return {
|
@@ -421,28 +379,6 @@ async function getDefaultSchema(cwd, failures = []) {
|
|
421
379
|
}
|
422
380
|
};
|
423
381
|
}
|
424
|
-
async function loadSchemaFromDefaultLocation(lookupPath) {
|
425
|
-
switch (lookupPath.kind) {
|
426
|
-
case "file":
|
427
|
-
return readSchemaFromSingleFile(lookupPath.path);
|
428
|
-
case "directory":
|
429
|
-
return readSchemaFromDirectory(lookupPath.path);
|
430
|
-
}
|
431
|
-
}
|
432
|
-
async function getSchemaDir(schemaPathFromArgs) {
|
433
|
-
if (schemaPathFromArgs) {
|
434
|
-
return import_path.default.resolve(import_path.default.dirname(schemaPathFromArgs));
|
435
|
-
}
|
436
|
-
const schemaPathResult = await getSchemaWithPath();
|
437
|
-
if (!schemaPathResult) {
|
438
|
-
return null;
|
439
|
-
}
|
440
|
-
return import_path.default.dirname(schemaPathResult.schemaPath);
|
441
|
-
}
|
442
|
-
async function getSchema(schemaPathFromArgs, schemaPathFromConfig) {
|
443
|
-
const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig);
|
444
|
-
return schemaPathResult.schemas;
|
445
|
-
}
|
446
382
|
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
447
383
|
const projectPath = (await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
448
384
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
@@ -457,32 +393,35 @@ async function loadSchemaContext({
|
|
457
393
|
printLoadMessage = true,
|
458
394
|
ignoreEnvVarErrors = false,
|
459
395
|
allowNull = false,
|
460
|
-
schemaPathArgumentName = "--schema"
|
396
|
+
schemaPathArgumentName = "--schema",
|
397
|
+
cwd = process.cwd()
|
461
398
|
} = {}) {
|
462
399
|
let schemaResult = null;
|
463
400
|
if (allowNull) {
|
464
401
|
schemaResult = await getSchemaWithPathOptional(schemaPathFromArg, schemaPathFromConfig, {
|
465
|
-
argumentName: schemaPathArgumentName
|
402
|
+
argumentName: schemaPathArgumentName,
|
403
|
+
cwd
|
466
404
|
});
|
467
405
|
if (!schemaResult) return null;
|
468
406
|
} else {
|
469
407
|
schemaResult = await getSchemaWithPath(schemaPathFromArg, schemaPathFromConfig, {
|
470
|
-
argumentName: schemaPathArgumentName
|
408
|
+
argumentName: schemaPathArgumentName,
|
409
|
+
cwd
|
471
410
|
});
|
472
411
|
}
|
473
|
-
return processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors });
|
412
|
+
return processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors, cwd });
|
474
413
|
}
|
475
414
|
async function processSchemaResult({
|
476
415
|
schemaResult,
|
477
416
|
printLoadMessage = true,
|
478
|
-
ignoreEnvVarErrors = false
|
417
|
+
ignoreEnvVarErrors = false,
|
418
|
+
cwd = process.cwd()
|
479
419
|
}) {
|
480
|
-
const cwd = process.cwd();
|
481
420
|
const loadedFromPathForLogMessages = import_path2.default.relative(cwd, schemaResult.schemaPath);
|
482
421
|
if (printLoadMessage) {
|
483
|
-
|
422
|
+
printSchemaLoadedMessage(loadedFromPathForLogMessages);
|
484
423
|
}
|
485
|
-
const configFromPsl = await (0,
|
424
|
+
const configFromPsl = await (0, import_chunk_OYKZ24UT.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
|
486
425
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
487
426
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
488
427
|
return {
|
@@ -504,12 +443,12 @@ function primaryDatasourceDirectory(primaryDatasource) {
|
|
504
443
|
}
|
505
444
|
return null;
|
506
445
|
}
|
507
|
-
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0,
|
446
|
+
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_R4ZFFYJA.require_p_map)());
|
508
447
|
var debug3 = (0, import_debug5.default)("prisma:generator");
|
509
448
|
async function checkTypeScriptVersion() {
|
510
449
|
const minVersion = "4.1.0";
|
511
450
|
try {
|
512
|
-
const typescriptPath = await (0,
|
451
|
+
const typescriptPath = await (0, import_chunk_URRVX2VQ.resolvePkg)("typescript", {
|
513
452
|
basedir: process.cwd()
|
514
453
|
});
|
515
454
|
debug3("typescriptPath", typescriptPath);
|
@@ -532,7 +471,7 @@ async function checkTypeScriptVersion() {
|
|
532
471
|
}
|
533
472
|
var debug4 = (0, import_debug4.default)("prisma:generator");
|
534
473
|
async function prismaClientResolver(baseDir, version3) {
|
535
|
-
let prismaClientDir = await (0,
|
474
|
+
let prismaClientDir = await (0, import_chunk_PE6DXWOX.findPrismaClientDir)(baseDir);
|
536
475
|
debug4("baseDir", baseDir);
|
537
476
|
await checkTypeScriptVersion();
|
538
477
|
if (!prismaClientDir && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
|
@@ -558,7 +497,7 @@ async function prismaClientResolver(baseDir, version3) {
|
|
558
497
|
)
|
559
498
|
);
|
560
499
|
}
|
561
|
-
const prismaCliDir = await (0,
|
500
|
+
const prismaCliDir = await (0, import_chunk_URRVX2VQ.resolvePkg)("prisma", { basedir: baseDir });
|
562
501
|
if (process.platform === "win32" && await (0, import_chunk_GHHABGYW.isYarnUsed)(baseDir)) {
|
563
502
|
const hasCli = (s) => prismaCliDir !== void 0 ? s : "";
|
564
503
|
const missingCli = (s) => prismaCliDir === void 0 ? s : "";
|
@@ -573,10 +512,10 @@ async function prismaClientResolver(baseDir, version3) {
|
|
573
512
|
);
|
574
513
|
}
|
575
514
|
if (!prismaCliDir) {
|
576
|
-
await (0,
|
515
|
+
await (0, import_chunk_OQ2NRV2Y.runPackageCmd)(projectRoot, "add", `prisma@${version3 ?? "latest"}`, "-D", "--silent");
|
577
516
|
}
|
578
|
-
await (0,
|
579
|
-
prismaClientDir = await (0,
|
517
|
+
await (0, import_chunk_OQ2NRV2Y.runPackageCmd)(projectRoot, "add", `@prisma/client@${version3 ?? "latest"}`, "--silent");
|
518
|
+
prismaClientDir = await (0, import_chunk_PE6DXWOX.findPrismaClientDir)(import_path4.default.join(".", baseDir));
|
580
519
|
if (!prismaClientDir) {
|
581
520
|
throw new Error(
|
582
521
|
`Could not resolve @prisma/client despite the installation that we just tried.
|
@@ -652,7 +591,7 @@ async function getGenerators(options) {
|
|
652
591
|
}
|
653
592
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
654
593
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
655
|
-
const dmmf = await (0,
|
594
|
+
const dmmf = await (0, import_chunk_226NCPFJ.getDMMF)({
|
656
595
|
datamodel: schemaContext.schemaFiles,
|
657
596
|
previewFeatures
|
658
597
|
});
|
@@ -710,7 +649,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
|
|
710
649
|
fromEnvVar: null
|
711
650
|
};
|
712
651
|
}
|
713
|
-
const datamodel = (0,
|
652
|
+
const datamodel = (0, import_chunk_FAQHAUBK.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
714
653
|
const envPaths = await getEnvPaths(schemaContext.schemaPath, { cwd: generator.output.value });
|
715
654
|
const options2 = {
|
716
655
|
datamodel,
|
@@ -778,7 +717,7 @@ generator gen {
|
|
778
717
|
}
|
779
718
|
}
|
780
719
|
debug5("neededVersions", JSON.stringify(neededVersions, null, 2));
|
781
|
-
const binaryPathsByVersion = await (0,
|
720
|
+
const binaryPathsByVersion = await (0, import_chunk_2I3VYCA7.getBinaryPathsByVersion)({
|
782
721
|
neededVersions,
|
783
722
|
binaryTarget,
|
784
723
|
version,
|
@@ -794,7 +733,7 @@ generator gen {
|
|
794
733
|
debug5({ generatorBinaryPaths });
|
795
734
|
generator.setBinaryPaths(generatorBinaryPaths);
|
796
735
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
797
|
-
const customDmmf = await (0,
|
736
|
+
const customDmmf = await (0, import_chunk_226NCPFJ.getDMMF)({
|
798
737
|
datamodel: schemaContext.schemaFiles,
|
799
738
|
previewFeatures
|
800
739
|
});
|
@@ -943,9 +882,9 @@ function pathExistsSync(path9) {
|
|
943
882
|
}
|
944
883
|
var findUpStop = Symbol("findUpStop");
|
945
884
|
function findUpMultipleSync(name, options2 = {}) {
|
946
|
-
let directory = import_node_path.default.resolve((0,
|
885
|
+
let directory = import_node_path.default.resolve((0, import_chunk_R4ZFFYJA.toPath)(options2.cwd) ?? "");
|
947
886
|
const { root } = import_node_path.default.parse(directory);
|
948
|
-
const stopAt = import_node_path.default.resolve(directory, (0,
|
887
|
+
const stopAt = import_node_path.default.resolve(directory, (0, import_chunk_R4ZFFYJA.toPath)(options2.stopAt) ?? root);
|
949
888
|
const limit = options2.limit ?? Number.POSITIVE_INFINITY;
|
950
889
|
const paths = [name].flat();
|
951
890
|
const runMatcher = (locateOptions) => {
|
@@ -1069,7 +1008,7 @@ function checkUnsupportedDataProxy({
|
|
1069
1008
|
}
|
1070
1009
|
}
|
1071
1010
|
if (!schemaContext2?.primaryDatasource) return;
|
1072
|
-
const url = (0,
|
1011
|
+
const url = (0, import_chunk_OYKZ24UT.resolveUrl)((0, import_chunk_OYKZ24UT.getEffectiveUrl)(schemaContext2.primaryDatasource));
|
1073
1012
|
if (url?.startsWith("prisma://")) {
|
1074
1013
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
1075
1014
|
}
|
@@ -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_AP52B62F_exports = {};
|
20
|
+
__export(chunk_AP52B62F_exports, {
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_AP52B62F_exports);
|
24
|
+
var import_chunk_VTJOX6HO = require("./chunk-VTJOX6HO.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_VTJOX6HO.version]];
|
28
28
|
return `${message}
|
29
29
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
@@ -26,17 +26,17 @@ 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_AXD7KB4D_exports = {};
|
30
|
+
__export(chunk_AXD7KB4D_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_AXD7KB4D_exports);
|
38
38
|
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
39
|
-
var
|
39
|
+
var import_chunk_IWTEX7EE = require("./chunk-IWTEX7EE.js");
|
40
40
|
var import_chunk_TWSLDIFL = require("./chunk-TWSLDIFL.js");
|
41
41
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
42
42
|
var import_chunk_5VQNKCKW = require("./chunk-5VQNKCKW.js");
|
@@ -46,7 +46,7 @@ var import_fetch_engine = require("@prisma/fetch-engine");
|
|
46
46
|
var import_get_platform = require("@prisma/get-platform");
|
47
47
|
var import_fs = __toESM2(require("fs"));
|
48
48
|
var import_path = __toESM2(require("path"));
|
49
|
-
var import_fs_extra = (0, import_chunk_4VNS5WPM.__toESM)((0,
|
49
|
+
var import_fs_extra = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_IWTEX7EE.require_lib)());
|
50
50
|
var import_temp_dir = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_5VQNKCKW.require_temp_dir)());
|
51
51
|
async function getBinaryName(name) {
|
52
52
|
const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
|