@prisma/internals 5.22.0-integration-engines-5-22-0-22-gh-4998-integration-eb7519dcdf552de090269ebfa2beabc8e1a13e1b.1 → 5.22.0-integration-remove-custom-yarn-logic.4

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.
Files changed (50) hide show
  1. package/dist/{chunk-XROFIVPW.js → chunk-2E5RJRUI.js} +5 -5
  2. package/dist/{chunk-CKUKHDZZ.js → chunk-2G6A4TX2.js} +8 -8
  3. package/dist/{chunk-CKLTDPWC.js → chunk-52GJGTO3.js} +5 -5
  4. package/dist/{chunk-5I4BOTBV.js → chunk-5MCWLJSR.js} +3 -9
  5. package/dist/{chunk-UIEISQJN.js → chunk-7MZ7L3FO.js} +5 -5
  6. package/dist/{chunk-S6RYKKKC.js → chunk-7RF5FHKY.js} +5 -5
  7. package/dist/{chunk-T5Y6IV3B.js → chunk-DL67PXXE.js} +8 -8
  8. package/dist/{chunk-W5EW54U6.js → chunk-FAEW2D5M.js} +8 -8
  9. package/dist/{chunk-GZSXOKNT.js → chunk-HDLERT2Z.js} +8 -8
  10. package/dist/{chunk-AQVMCGTT.js → chunk-HGO72LGR.js} +5 -5
  11. package/dist/{chunk-UQUACE5Z.js → chunk-HXVKJWC6.js} +7 -7
  12. package/dist/{chunk-76RRS4L7.js → chunk-MCAGL6AP.js} +8 -8
  13. package/dist/{chunk-SA3RTUER.js → chunk-QPQSC3JJ.js} +5 -5
  14. package/dist/{chunk-W6ZSG2O2.js → chunk-SEMJP57T.js} +4 -4
  15. package/dist/{chunk-5OL5BV3V.js → chunk-UK22OTEL.js} +5 -5
  16. package/dist/{chunk-5ELK2BDH.js → chunk-VIYW6CYM.js} +20 -139
  17. package/dist/{chunk-SJEFZQXD.js → chunk-VP52BYP6.js} +8 -8
  18. package/dist/{chunk-OL6TWMQ4.js → chunk-XNNORB6A.js} +20 -139
  19. package/dist/{chunk-D7ZB4GKV.js → chunk-XW5NCCKJ.js} +7 -7
  20. package/dist/{chunk-RIKWWYWO.js → chunk-YVCVAF6S.js} +5 -5
  21. package/dist/{chunk-ZA3RMW2P.js → chunk-ZKAW5JSN.js} +5 -8
  22. package/dist/{chunk-YUUAEUGK.js → chunk-ZKB5ULTL.js} +5 -5
  23. package/dist/cli/checkUnsupportedDataProxy.js +14 -14
  24. package/dist/cli/getSchema.js +19 -19
  25. package/dist/cli/hashes.js +14 -14
  26. package/dist/engine-commands/errorHelpers.js +4 -4
  27. package/dist/engine-commands/formatSchema.js +13 -13
  28. package/dist/engine-commands/getConfig.js +10 -10
  29. package/dist/engine-commands/getDmmf.js +7 -7
  30. package/dist/engine-commands/index.js +22 -22
  31. package/dist/engine-commands/lintSchema.js +8 -8
  32. package/dist/engine-commands/mergeSchemas.js +7 -7
  33. package/dist/engine-commands/validate.js +7 -7
  34. package/dist/get-generators/generatorResolvers/generatorResolvers.js +13 -13
  35. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +13 -13
  36. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +14 -14
  37. package/dist/get-generators/getGenerators.js +16 -16
  38. package/dist/index.js +43 -43
  39. package/dist/sendPanic.js +13 -13
  40. package/dist/utils/getCommandWithExecutor.js +3 -3
  41. package/dist/utils/getEnvPaths.js +13 -13
  42. package/dist/utils/getVersionFromPackageJson.js +3 -3
  43. package/dist/utils/handlePanic.js +13 -13
  44. package/dist/utils/isCurrentBinInstalledGlobally.d.ts +1 -1
  45. package/dist/utils/isCurrentBinInstalledGlobally.js +2 -2
  46. package/dist/utils/loadEnvFile.js +13 -13
  47. package/dist/wasm.js +4 -4
  48. package/package.json +8 -8
  49. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.d.ts +0 -9
  50. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.js +0 -132
@@ -26,11 +26,10 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_5ELK2BDH_exports = {};
30
- __export2(chunk_5ELK2BDH_exports, {
29
+ var chunk_VIYW6CYM_exports = {};
30
+ __export2(chunk_VIYW6CYM_exports, {
31
31
  checkTypeScriptVersion: () => checkTypeScriptVersion,
32
32
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
33
- checkYarnVersion: () => checkYarnVersion,
34
33
  debug: () => debug5,
35
34
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
36
35
  formatSchema: () => formatSchema,
@@ -56,7 +55,7 @@ __export2(chunk_5ELK2BDH_exports, {
56
55
  sendPanic: () => sendPanic,
57
56
  skipIndex: () => skipIndex
58
57
  });
59
- module.exports = __toCommonJS2(chunk_5ELK2BDH_exports);
58
+ module.exports = __toCommonJS2(chunk_VIYW6CYM_exports);
60
59
  var import_chunk_IABMG3F4 = require("./chunk-IABMG3F4.js");
61
60
  var import_chunk_3U2ANLD3 = require("./chunk-3U2ANLD3.js");
62
61
  var import_chunk_FTS2IEWX = require("./chunk-FTS2IEWX.js");
@@ -81,17 +80,16 @@ var import_chunk_XLYQ6PQW = require("./chunk-XLYQ6PQW.js");
81
80
  var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
82
81
  var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
83
82
  var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
84
- var import_chunk_S6RYKKKC = require("./chunk-S6RYKKKC.js");
85
- var import_chunk_UQUACE5Z = require("./chunk-UQUACE5Z.js");
86
- var import_chunk_SJEFZQXD = require("./chunk-SJEFZQXD.js");
87
- var import_chunk_CKUKHDZZ = require("./chunk-CKUKHDZZ.js");
83
+ var import_chunk_7RF5FHKY = require("./chunk-7RF5FHKY.js");
84
+ var import_chunk_XW5NCCKJ = require("./chunk-XW5NCCKJ.js");
85
+ var import_chunk_VP52BYP6 = require("./chunk-VP52BYP6.js");
86
+ var import_chunk_2G6A4TX2 = require("./chunk-2G6A4TX2.js");
88
87
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
89
88
  var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
90
- var import_chunk_SA3RTUER = require("./chunk-SA3RTUER.js");
89
+ var import_chunk_QPQSC3JJ = require("./chunk-QPQSC3JJ.js");
91
90
  var import_chunk_MUPZUVSI = require("./chunk-MUPZUVSI.js");
92
91
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
93
92
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
94
- var import_chunk_7XNZDY2V = require("./chunk-7XNZDY2V.js");
95
93
  var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
96
94
  var import_chunk_635TMBAP = require("./chunk-635TMBAP.js");
97
95
  var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
@@ -15478,7 +15476,6 @@ var require_tmp = (0, import_chunk_WWAWV7DQ.__commonJS)({
15478
15476
  }
15479
15477
  });
15480
15478
  var import_find_up = (0, import_chunk_WWAWV7DQ.__toESM)(require_find_up());
15481
- var import_execa = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_7XNZDY2V.require_execa)());
15482
15479
  var readFile = (0, import_util.promisify)(import_fs3.default.readFile);
15483
15480
  var stat = (0, import_util.promisify)(import_fs3.default.stat);
15484
15481
  var debug2 = (0, import_debug3.Debug)("prisma:getSchema");
@@ -15517,7 +15514,7 @@ async function readSchemaFromDirectory(schemaPath2) {
15517
15514
  }
15518
15515
  const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
15519
15516
  debug2("Loading config");
15520
- const config2 = await (0, import_chunk_SJEFZQXD.getConfig)({
15517
+ const config2 = await (0, import_chunk_VP52BYP6.getConfig)({
15521
15518
  datamodel: files,
15522
15519
  ignoreEnvVarErrors: true
15523
15520
  });
@@ -15584,14 +15581,9 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName
15584
15581
  if (defaultResult.ok) {
15585
15582
  return defaultResult;
15586
15583
  }
15587
- const yarnResult = await getSchemaFromYarn1Workspace(cwd, defaultResult.error.failures);
15588
- if (yarnResult.ok) {
15589
- return yarnResult;
15590
- }
15591
- const finalError = yarnResult.error.kind === "Yarn1WorkspaceSchemaNotFound" ? defaultResult.error : yarnResult.error;
15592
15584
  return {
15593
15585
  ok: false,
15594
- error: finalError
15586
+ error: defaultResult.error
15595
15587
  };
15596
15588
  }
15597
15589
  function renderLookupError(error) {
@@ -15666,47 +15658,6 @@ async function getSchemaFromPackageJson(cwd) {
15666
15658
  }
15667
15659
  return lookupResult;
15668
15660
  }
15669
- async function getSchemaFromYarn1Workspace(cwd, pastFailures) {
15670
- if (!process.env.npm_config_user_agent?.includes("yarn")) {
15671
- return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
15672
- }
15673
- let workspaces;
15674
- try {
15675
- const { stdout: version3 } = await import_execa.default.command("yarn --version", {
15676
- cwd
15677
- });
15678
- if (version3.startsWith("2")) {
15679
- return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
15680
- }
15681
- const { stdout } = await import_execa.default.command("yarn workspaces info --json", {
15682
- cwd
15683
- });
15684
- const json = getJson(stdout);
15685
- workspaces = Object.values(json);
15686
- } catch {
15687
- return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
15688
- }
15689
- const workspaceRootDir = await findWorkspaceRoot(cwd);
15690
- if (!workspaceRootDir) {
15691
- return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
15692
- }
15693
- for (const workspace of workspaces) {
15694
- const workspacePath = import_path2.default.join(workspaceRootDir, workspace.location);
15695
- const workspaceSchema = await tryWorkspacePath(workspacePath, pastFailures);
15696
- if (workspaceSchema.ok) {
15697
- return workspaceSchema;
15698
- }
15699
- }
15700
- const rootPathSchema = await tryWorkspacePath(workspaceRootDir, pastFailures);
15701
- return rootPathSchema;
15702
- }
15703
- async function tryWorkspacePath(cwd, pastFailures) {
15704
- const pkgJson = await getSchemaFromPackageJson(cwd);
15705
- if (pkgJson.ok) {
15706
- return pkgJson;
15707
- }
15708
- return getDefaultSchema(cwd, pastFailures);
15709
- }
15710
15661
  async function getDefaultSchema(cwd, failures = []) {
15711
15662
  const schemaPrisma = {
15712
15663
  schemaPath: {
@@ -15785,44 +15736,6 @@ async function getSchema(schemaPathFromArgs) {
15785
15736
  const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs);
15786
15737
  return schemaPathResult.schemas;
15787
15738
  }
15788
- function getJson(stdout) {
15789
- const firstCurly = stdout.indexOf("{");
15790
- const lastCurly = stdout.lastIndexOf("}");
15791
- const sliced = stdout.slice(firstCurly, lastCurly + 1);
15792
- return JSON.parse(sliced);
15793
- }
15794
- function isPkgJsonWorkspaceRoot(pkgJson) {
15795
- const workspaces = pkgJson.workspaces;
15796
- if (!workspaces) {
15797
- return false;
15798
- }
15799
- return Array.isArray(workspaces) || workspaces.packages !== void 0;
15800
- }
15801
- async function isNearestPkgJsonWorkspaceRoot(cwd) {
15802
- const pkgJson = await (0, import_chunk_J3JE5NVO.readPackageUp)({ cwd, normalize: false });
15803
- if (!pkgJson) {
15804
- return null;
15805
- }
15806
- return {
15807
- isRoot: isPkgJsonWorkspaceRoot(pkgJson.packageJson),
15808
- path: pkgJson.path
15809
- };
15810
- }
15811
- async function findWorkspaceRoot(cwd) {
15812
- let pkgJson = await isNearestPkgJsonWorkspaceRoot(cwd);
15813
- if (!pkgJson) {
15814
- return null;
15815
- }
15816
- if (pkgJson.isRoot === true) {
15817
- return import_path2.default.dirname(pkgJson.path);
15818
- }
15819
- const pkgJsonParentDir = import_path2.default.dirname(import_path2.default.dirname(pkgJson.path));
15820
- pkgJson = await isNearestPkgJsonWorkspaceRoot(pkgJsonParentDir);
15821
- if (!pkgJson || pkgJson.isRoot === false) {
15822
- return null;
15823
- }
15824
- return import_path2.default.dirname(pkgJson.path);
15825
- }
15826
15739
  var debug3 = (0, import_debug2.default)("prisma:loadEnv");
15827
15740
  async function getEnvPaths(schemaPath2, opts = { cwd: process.cwd() }) {
15828
15741
  const rootEnvPath = getProjectRootEnvPath({ cwd: opts.cwd }) ?? null;
@@ -15909,8 +15822,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
15909
15822
  if (argName.includes("schema")) {
15910
15823
  await loadEnvFile({ schemaPath: argValue, printMessage: false });
15911
15824
  const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
15912
- const config2 = await (0, import_chunk_SJEFZQXD.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15913
- const url = (0, import_chunk_SJEFZQXD.resolveUrl)((0, import_chunk_SJEFZQXD.getEffectiveUrl)(config2.datasources[0]));
15825
+ const config2 = await (0, import_chunk_VP52BYP6.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15826
+ const url = (0, import_chunk_VP52BYP6.resolveUrl)((0, import_chunk_VP52BYP6.getEffectiveUrl)(config2.datasources[0]));
15914
15827
  if (url?.startsWith("prisma://")) {
15915
15828
  return forbiddenCmdWithDataProxyFlagMessage(command);
15916
15829
  }
@@ -15957,42 +15870,10 @@ async function checkTypeScriptVersion() {
15957
15870
  } catch (e) {
15958
15871
  }
15959
15872
  }
15960
- function checkYarnVersion() {
15961
- if (process.env.npm_config_user_agent) {
15962
- const match = parseUserAgentString(process.env.npm_config_user_agent);
15963
- if (match) {
15964
- const { agent, major, minor, patch } = match;
15965
- if (agent === "yarn" && major === 1) {
15966
- const currentYarnVersion = `${major}.${minor}.${patch}`;
15967
- const minYarnVersion = "1.19.2";
15968
- if ((0, import_chunk_EUTJYQDW.semverLt)(currentYarnVersion, minYarnVersion)) {
15969
- import_chunk_AZNLB67U.logger_exports.warn(
15970
- `Your ${(0, import_chunk_PG5FDKSF.bold)("yarn")} has version ${currentYarnVersion}, which is outdated. Please update it to ${(0, import_chunk_PG5FDKSF.bold)(
15971
- minYarnVersion
15972
- )} or ${(0, import_chunk_PG5FDKSF.bold)("newer")} in order to use Prisma.`
15973
- );
15974
- }
15975
- }
15976
- }
15977
- }
15978
- }
15979
- function parseUserAgentString(str) {
15980
- const userAgentRegex = /(\w+)\/(\d+)\.(\d+)\.(\d+)/;
15981
- const match = userAgentRegex.exec(str);
15982
- if (match) {
15983
- const agent = match[1];
15984
- const major = parseInt(match[2]);
15985
- const minor = parseInt(match[3]);
15986
- const patch = parseInt(match[4]);
15987
- return { agent, major, minor, patch };
15988
- }
15989
- return null;
15990
- }
15991
15873
  var debug5 = (0, import_debug5.default)("prisma:generator");
15992
15874
  async function prismaClientResolver(baseDir, version3) {
15993
15875
  let prismaClientDir = await (0, import_chunk_KEBDP2C3.findPrismaClientDir)(baseDir);
15994
15876
  debug5("baseDir", baseDir);
15995
- checkYarnVersion();
15996
15877
  await checkTypeScriptVersion();
15997
15878
  if (!prismaClientDir && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
15998
15879
  let projectRoot = (0, import_chunk_J77ZIDXB.longestCommonPathPrefix)(baseDir, process.cwd());
@@ -16114,7 +15995,7 @@ async function getGenerators(options) {
16114
15995
  prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
16115
15996
  }
16116
15997
  }
16117
- const config = await (0, import_chunk_SJEFZQXD.getConfig)({
15998
+ const config = await (0, import_chunk_VP52BYP6.getConfig)({
16118
15999
  datamodel: schemas,
16119
16000
  datamodelPath: schemaPath,
16120
16001
  prismaPath,
@@ -16125,7 +16006,7 @@ async function getGenerators(options) {
16125
16006
  }
16126
16007
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
16127
16008
  const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
16128
- const dmmf = await (0, import_chunk_CKUKHDZZ.getDMMF)({
16009
+ const dmmf = await (0, import_chunk_2G6A4TX2.getDMMF)({
16129
16010
  datamodel: schemas,
16130
16011
  datamodelPath: schemaPath,
16131
16012
  prismaPath,
@@ -16186,7 +16067,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
16186
16067
  fromEnvVar: "null"
16187
16068
  };
16188
16069
  }
16189
- const datamodel = (0, import_chunk_UQUACE5Z.mergeSchemas)({ schemas });
16070
+ const datamodel = (0, import_chunk_XW5NCCKJ.mergeSchemas)({ schemas });
16190
16071
  const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
16191
16072
  const options2 = {
16192
16073
  datamodel,
@@ -16269,7 +16150,7 @@ generator gen {
16269
16150
  debug6({ generatorBinaryPaths });
16270
16151
  generator.setBinaryPaths(generatorBinaryPaths);
16271
16152
  if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
16272
- const customDmmf = await (0, import_chunk_CKUKHDZZ.getDMMF)({
16153
+ const customDmmf = await (0, import_chunk_2G6A4TX2.getDMMF)({
16273
16154
  datamodel: schemas,
16274
16155
  datamodelPath: schemaPath,
16275
16156
  prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
@@ -16567,7 +16448,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
16567
16448
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
16568
16449
  handleFormatPanic(
16569
16450
  () => {
16570
- import_chunk_SA3RTUER.prismaSchemaWasm.debug_panic();
16451
+ import_chunk_QPQSC3JJ.prismaSchemaWasm.debug_panic();
16571
16452
  },
16572
16453
  { schemas: schemas2 }
16573
16454
  );
@@ -16587,12 +16468,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
16587
16468
  () => {
16588
16469
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
16589
16470
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
16590
- const lintDiagnostics2 = (0, import_chunk_S6RYKKKC.lintSchema)({ schemas: formattedMultipleSchemas2 });
16471
+ const lintDiagnostics2 = (0, import_chunk_7RF5FHKY.lintSchema)({ schemas: formattedMultipleSchemas2 });
16591
16472
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
16592
16473
  },
16593
16474
  { schemas: schemas2 }
16594
16475
  );
16595
- const lintWarnings = (0, import_chunk_S6RYKKKC.getLintWarningsAsText)(lintDiagnostics);
16476
+ const lintWarnings = (0, import_chunk_7RF5FHKY.getLintWarningsAsText)(lintDiagnostics);
16596
16477
  if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
16597
16478
  console.warn(lintWarnings);
16598
16479
  }
@@ -16622,7 +16503,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
16622
16503
  }
16623
16504
  }
16624
16505
  function formatWasm(schema, documentFormattingParams) {
16625
- const formattedSchema = import_chunk_SA3RTUER.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
16506
+ const formattedSchema = import_chunk_QPQSC3JJ.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
16626
16507
  return formattedSchema;
16627
16508
  }
16628
16509
  /*! Bundled license information:
@@ -26,22 +26,22 @@ 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 chunk_SJEFZQXD_exports = {};
30
- __export(chunk_SJEFZQXD_exports, {
29
+ var chunk_VP52BYP6_exports = {};
30
+ __export(chunk_VP52BYP6_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(chunk_SJEFZQXD_exports);
37
+ module.exports = __toCommonJS(chunk_VP52BYP6_exports);
38
38
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
39
39
  var import_chunk_IAEMHQAC = require("./chunk-IAEMHQAC.js");
40
40
  var import_chunk_WMIBAVWZ = require("./chunk-WMIBAVWZ.js");
41
- var import_chunk_5OL5BV3V = require("./chunk-5OL5BV3V.js");
41
+ var import_chunk_UK22OTEL = require("./chunk-UK22OTEL.js");
42
42
  var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
43
43
  var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
44
- var import_chunk_SA3RTUER = require("./chunk-SA3RTUER.js");
44
+ var import_chunk_QPQSC3JJ = require("./chunk-QPQSC3JJ.js");
45
45
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
46
46
  var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
47
47
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
@@ -65,7 +65,7 @@ ${detailsHeader} ${message}`;
65
65
  }).exhaustive();
66
66
  const errorMessageWithContext = `${constructedErrorMessage}
67
67
  [Context: getConfig]`;
68
- super((0, import_chunk_5OL5BV3V.addVersionDetailsToErrorMessage)(errorMessageWithContext));
68
+ super((0, import_chunk_UK22OTEL.addVersionDetailsToErrorMessage)(errorMessageWithContext));
69
69
  this.name = "GetConfigError";
70
70
  }
71
71
  };
@@ -90,7 +90,7 @@ async function getConfig(options) {
90
90
  () => {
91
91
  if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
92
92
  debug("Triggering a Rust panic...");
93
- import_chunk_SA3RTUER.prismaSchemaWasm.debug_panic();
93
+ import_chunk_QPQSC3JJ.prismaSchemaWasm.debug_panic();
94
94
  }
95
95
  const params = JSON.stringify({
96
96
  prismaSchema: options.datamodel,
@@ -98,7 +98,7 @@ async function getConfig(options) {
98
98
  ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
99
99
  env: process.env
100
100
  });
101
- const data = import_chunk_SA3RTUER.prismaSchemaWasm.get_config(params);
101
+ const data = import_chunk_QPQSC3JJ.prismaSchemaWasm.get_config(params);
102
102
  return data;
103
103
  },
104
104
  (e) => ({
@@ -26,11 +26,10 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_OL6TWMQ4_exports = {};
30
- __export2(chunk_OL6TWMQ4_exports, {
29
+ var chunk_XNNORB6A_exports = {};
30
+ __export2(chunk_XNNORB6A_exports, {
31
31
  checkTypeScriptVersion: () => checkTypeScriptVersion,
32
32
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
33
- checkYarnVersion: () => checkYarnVersion,
34
33
  debug: () => debug5,
35
34
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
36
35
  formatSchema: () => formatSchema,
@@ -56,7 +55,7 @@ __export2(chunk_OL6TWMQ4_exports, {
56
55
  sendPanic: () => sendPanic,
57
56
  skipIndex: () => skipIndex
58
57
  });
59
- module.exports = __toCommonJS2(chunk_OL6TWMQ4_exports);
58
+ module.exports = __toCommonJS2(chunk_XNNORB6A_exports);
60
59
  var import_chunk_IABMG3F4 = require("./chunk-IABMG3F4.js");
61
60
  var import_chunk_3U2ANLD3 = require("./chunk-3U2ANLD3.js");
62
61
  var import_chunk_FTS2IEWX = require("./chunk-FTS2IEWX.js");
@@ -81,17 +80,16 @@ var import_chunk_XLYQ6PQW = require("./chunk-XLYQ6PQW.js");
81
80
  var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
82
81
  var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
83
82
  var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
84
- var import_chunk_XROFIVPW = require("./chunk-XROFIVPW.js");
85
- var import_chunk_D7ZB4GKV = require("./chunk-D7ZB4GKV.js");
86
- var import_chunk_GZSXOKNT = require("./chunk-GZSXOKNT.js");
87
- var import_chunk_T5Y6IV3B = require("./chunk-T5Y6IV3B.js");
83
+ var import_chunk_2E5RJRUI = require("./chunk-2E5RJRUI.js");
84
+ var import_chunk_HXVKJWC6 = require("./chunk-HXVKJWC6.js");
85
+ var import_chunk_HDLERT2Z = require("./chunk-HDLERT2Z.js");
86
+ var import_chunk_DL67PXXE = require("./chunk-DL67PXXE.js");
88
87
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
89
88
  var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
90
- var import_chunk_CKLTDPWC = require("./chunk-CKLTDPWC.js");
89
+ var import_chunk_52GJGTO3 = require("./chunk-52GJGTO3.js");
91
90
  var import_chunk_MUPZUVSI = require("./chunk-MUPZUVSI.js");
92
91
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
93
92
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
94
- var import_chunk_7XNZDY2V = require("./chunk-7XNZDY2V.js");
95
93
  var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
96
94
  var import_chunk_635TMBAP = require("./chunk-635TMBAP.js");
97
95
  var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
@@ -15478,7 +15476,6 @@ var require_tmp = (0, import_chunk_WWAWV7DQ.__commonJS)({
15478
15476
  }
15479
15477
  });
15480
15478
  var import_find_up = (0, import_chunk_WWAWV7DQ.__toESM)(require_find_up());
15481
- var import_execa = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_7XNZDY2V.require_execa)());
15482
15479
  var readFile = (0, import_util.promisify)(import_fs3.default.readFile);
15483
15480
  var stat = (0, import_util.promisify)(import_fs3.default.stat);
15484
15481
  var debug2 = (0, import_debug3.Debug)("prisma:getSchema");
@@ -15517,7 +15514,7 @@ async function readSchemaFromDirectory(schemaPath2) {
15517
15514
  }
15518
15515
  const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
15519
15516
  debug2("Loading config");
15520
- const config2 = await (0, import_chunk_GZSXOKNT.getConfig)({
15517
+ const config2 = await (0, import_chunk_HDLERT2Z.getConfig)({
15521
15518
  datamodel: files,
15522
15519
  ignoreEnvVarErrors: true
15523
15520
  });
@@ -15584,14 +15581,9 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName
15584
15581
  if (defaultResult.ok) {
15585
15582
  return defaultResult;
15586
15583
  }
15587
- const yarnResult = await getSchemaFromYarn1Workspace(cwd, defaultResult.error.failures);
15588
- if (yarnResult.ok) {
15589
- return yarnResult;
15590
- }
15591
- const finalError = yarnResult.error.kind === "Yarn1WorkspaceSchemaNotFound" ? defaultResult.error : yarnResult.error;
15592
15584
  return {
15593
15585
  ok: false,
15594
- error: finalError
15586
+ error: defaultResult.error
15595
15587
  };
15596
15588
  }
15597
15589
  function renderLookupError(error) {
@@ -15666,47 +15658,6 @@ async function getSchemaFromPackageJson(cwd) {
15666
15658
  }
15667
15659
  return lookupResult;
15668
15660
  }
15669
- async function getSchemaFromYarn1Workspace(cwd, pastFailures) {
15670
- if (!process.env.npm_config_user_agent?.includes("yarn")) {
15671
- return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
15672
- }
15673
- let workspaces;
15674
- try {
15675
- const { stdout: version3 } = await import_execa.default.command("yarn --version", {
15676
- cwd
15677
- });
15678
- if (version3.startsWith("2")) {
15679
- return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
15680
- }
15681
- const { stdout } = await import_execa.default.command("yarn workspaces info --json", {
15682
- cwd
15683
- });
15684
- const json = getJson(stdout);
15685
- workspaces = Object.values(json);
15686
- } catch {
15687
- return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
15688
- }
15689
- const workspaceRootDir = await findWorkspaceRoot(cwd);
15690
- if (!workspaceRootDir) {
15691
- return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
15692
- }
15693
- for (const workspace of workspaces) {
15694
- const workspacePath = import_path2.default.join(workspaceRootDir, workspace.location);
15695
- const workspaceSchema = await tryWorkspacePath(workspacePath, pastFailures);
15696
- if (workspaceSchema.ok) {
15697
- return workspaceSchema;
15698
- }
15699
- }
15700
- const rootPathSchema = await tryWorkspacePath(workspaceRootDir, pastFailures);
15701
- return rootPathSchema;
15702
- }
15703
- async function tryWorkspacePath(cwd, pastFailures) {
15704
- const pkgJson = await getSchemaFromPackageJson(cwd);
15705
- if (pkgJson.ok) {
15706
- return pkgJson;
15707
- }
15708
- return getDefaultSchema(cwd, pastFailures);
15709
- }
15710
15661
  async function getDefaultSchema(cwd, failures = []) {
15711
15662
  const schemaPrisma = {
15712
15663
  schemaPath: {
@@ -15785,44 +15736,6 @@ async function getSchema(schemaPathFromArgs) {
15785
15736
  const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs);
15786
15737
  return schemaPathResult.schemas;
15787
15738
  }
15788
- function getJson(stdout) {
15789
- const firstCurly = stdout.indexOf("{");
15790
- const lastCurly = stdout.lastIndexOf("}");
15791
- const sliced = stdout.slice(firstCurly, lastCurly + 1);
15792
- return JSON.parse(sliced);
15793
- }
15794
- function isPkgJsonWorkspaceRoot(pkgJson) {
15795
- const workspaces = pkgJson.workspaces;
15796
- if (!workspaces) {
15797
- return false;
15798
- }
15799
- return Array.isArray(workspaces) || workspaces.packages !== void 0;
15800
- }
15801
- async function isNearestPkgJsonWorkspaceRoot(cwd) {
15802
- const pkgJson = await (0, import_chunk_J3JE5NVO.readPackageUp)({ cwd, normalize: false });
15803
- if (!pkgJson) {
15804
- return null;
15805
- }
15806
- return {
15807
- isRoot: isPkgJsonWorkspaceRoot(pkgJson.packageJson),
15808
- path: pkgJson.path
15809
- };
15810
- }
15811
- async function findWorkspaceRoot(cwd) {
15812
- let pkgJson = await isNearestPkgJsonWorkspaceRoot(cwd);
15813
- if (!pkgJson) {
15814
- return null;
15815
- }
15816
- if (pkgJson.isRoot === true) {
15817
- return import_path2.default.dirname(pkgJson.path);
15818
- }
15819
- const pkgJsonParentDir = import_path2.default.dirname(import_path2.default.dirname(pkgJson.path));
15820
- pkgJson = await isNearestPkgJsonWorkspaceRoot(pkgJsonParentDir);
15821
- if (!pkgJson || pkgJson.isRoot === false) {
15822
- return null;
15823
- }
15824
- return import_path2.default.dirname(pkgJson.path);
15825
- }
15826
15739
  var debug3 = (0, import_debug2.default)("prisma:loadEnv");
15827
15740
  async function getEnvPaths(schemaPath2, opts = { cwd: process.cwd() }) {
15828
15741
  const rootEnvPath = getProjectRootEnvPath({ cwd: opts.cwd }) ?? null;
@@ -15909,8 +15822,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
15909
15822
  if (argName.includes("schema")) {
15910
15823
  await loadEnvFile({ schemaPath: argValue, printMessage: false });
15911
15824
  const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
15912
- const config2 = await (0, import_chunk_GZSXOKNT.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15913
- const url = (0, import_chunk_GZSXOKNT.resolveUrl)((0, import_chunk_GZSXOKNT.getEffectiveUrl)(config2.datasources[0]));
15825
+ const config2 = await (0, import_chunk_HDLERT2Z.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15826
+ const url = (0, import_chunk_HDLERT2Z.resolveUrl)((0, import_chunk_HDLERT2Z.getEffectiveUrl)(config2.datasources[0]));
15914
15827
  if (url?.startsWith("prisma://")) {
15915
15828
  return forbiddenCmdWithDataProxyFlagMessage(command);
15916
15829
  }
@@ -15957,42 +15870,10 @@ async function checkTypeScriptVersion() {
15957
15870
  } catch (e) {
15958
15871
  }
15959
15872
  }
15960
- function checkYarnVersion() {
15961
- if (process.env.npm_config_user_agent) {
15962
- const match = parseUserAgentString(process.env.npm_config_user_agent);
15963
- if (match) {
15964
- const { agent, major, minor, patch } = match;
15965
- if (agent === "yarn" && major === 1) {
15966
- const currentYarnVersion = `${major}.${minor}.${patch}`;
15967
- const minYarnVersion = "1.19.2";
15968
- if ((0, import_chunk_EUTJYQDW.semverLt)(currentYarnVersion, minYarnVersion)) {
15969
- import_chunk_AZNLB67U.logger_exports.warn(
15970
- `Your ${(0, import_chunk_PG5FDKSF.bold)("yarn")} has version ${currentYarnVersion}, which is outdated. Please update it to ${(0, import_chunk_PG5FDKSF.bold)(
15971
- minYarnVersion
15972
- )} or ${(0, import_chunk_PG5FDKSF.bold)("newer")} in order to use Prisma.`
15973
- );
15974
- }
15975
- }
15976
- }
15977
- }
15978
- }
15979
- function parseUserAgentString(str) {
15980
- const userAgentRegex = /(\w+)\/(\d+)\.(\d+)\.(\d+)/;
15981
- const match = userAgentRegex.exec(str);
15982
- if (match) {
15983
- const agent = match[1];
15984
- const major = parseInt(match[2]);
15985
- const minor = parseInt(match[3]);
15986
- const patch = parseInt(match[4]);
15987
- return { agent, major, minor, patch };
15988
- }
15989
- return null;
15990
- }
15991
15873
  var debug5 = (0, import_debug5.default)("prisma:generator");
15992
15874
  async function prismaClientResolver(baseDir, version3) {
15993
15875
  let prismaClientDir = await (0, import_chunk_KEBDP2C3.findPrismaClientDir)(baseDir);
15994
15876
  debug5("baseDir", baseDir);
15995
- checkYarnVersion();
15996
15877
  await checkTypeScriptVersion();
15997
15878
  if (!prismaClientDir && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
15998
15879
  let projectRoot = (0, import_chunk_J77ZIDXB.longestCommonPathPrefix)(baseDir, process.cwd());
@@ -16114,7 +15995,7 @@ async function getGenerators(options) {
16114
15995
  prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
16115
15996
  }
16116
15997
  }
16117
- const config = await (0, import_chunk_GZSXOKNT.getConfig)({
15998
+ const config = await (0, import_chunk_HDLERT2Z.getConfig)({
16118
15999
  datamodel: schemas,
16119
16000
  datamodelPath: schemaPath,
16120
16001
  prismaPath,
@@ -16125,7 +16006,7 @@ async function getGenerators(options) {
16125
16006
  }
16126
16007
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
16127
16008
  const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
16128
- const dmmf = await (0, import_chunk_T5Y6IV3B.getDMMF)({
16009
+ const dmmf = await (0, import_chunk_DL67PXXE.getDMMF)({
16129
16010
  datamodel: schemas,
16130
16011
  datamodelPath: schemaPath,
16131
16012
  prismaPath,
@@ -16186,7 +16067,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
16186
16067
  fromEnvVar: "null"
16187
16068
  };
16188
16069
  }
16189
- const datamodel = (0, import_chunk_D7ZB4GKV.mergeSchemas)({ schemas });
16070
+ const datamodel = (0, import_chunk_HXVKJWC6.mergeSchemas)({ schemas });
16190
16071
  const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
16191
16072
  const options2 = {
16192
16073
  datamodel,
@@ -16269,7 +16150,7 @@ generator gen {
16269
16150
  debug6({ generatorBinaryPaths });
16270
16151
  generator.setBinaryPaths(generatorBinaryPaths);
16271
16152
  if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
16272
- const customDmmf = await (0, import_chunk_T5Y6IV3B.getDMMF)({
16153
+ const customDmmf = await (0, import_chunk_DL67PXXE.getDMMF)({
16273
16154
  datamodel: schemas,
16274
16155
  datamodelPath: schemaPath,
16275
16156
  prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
@@ -16567,7 +16448,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
16567
16448
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
16568
16449
  handleFormatPanic(
16569
16450
  () => {
16570
- import_chunk_CKLTDPWC.prismaSchemaWasm.debug_panic();
16451
+ import_chunk_52GJGTO3.prismaSchemaWasm.debug_panic();
16571
16452
  },
16572
16453
  { schemas: schemas2 }
16573
16454
  );
@@ -16587,12 +16468,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
16587
16468
  () => {
16588
16469
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
16589
16470
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
16590
- const lintDiagnostics2 = (0, import_chunk_XROFIVPW.lintSchema)({ schemas: formattedMultipleSchemas2 });
16471
+ const lintDiagnostics2 = (0, import_chunk_2E5RJRUI.lintSchema)({ schemas: formattedMultipleSchemas2 });
16591
16472
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
16592
16473
  },
16593
16474
  { schemas: schemas2 }
16594
16475
  );
16595
- const lintWarnings = (0, import_chunk_XROFIVPW.getLintWarningsAsText)(lintDiagnostics);
16476
+ const lintWarnings = (0, import_chunk_2E5RJRUI.getLintWarningsAsText)(lintDiagnostics);
16596
16477
  if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
16597
16478
  console.warn(lintWarnings);
16598
16479
  }
@@ -16622,7 +16503,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
16622
16503
  }
16623
16504
  }
16624
16505
  function formatWasm(schema, documentFormattingParams) {
16625
- const formattedSchema = import_chunk_CKLTDPWC.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
16506
+ const formattedSchema = import_chunk_52GJGTO3.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
16626
16507
  return formattedSchema;
16627
16508
  }
16628
16509
  /*! Bundled license information: