@prisma/engines 6.19.0-integration-next.6 → 6.19.0-integration-feat-remove-binary-engine.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/index.d.ts CHANGED
@@ -1,26 +1,17 @@
1
1
  import type { BinaryPaths } from '@prisma/fetch-engine';
2
- import { BinaryType as BinaryType_2 } from '@prisma/fetch-engine';
3
2
  import type { DownloadOptions } from '@prisma/fetch-engine';
4
3
  import { enginesVersion } from '@prisma/engines-version';
5
4
 
6
- export declare const DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = BinaryType.QueryEngineLibrary;
7
-
8
5
  export { enginesVersion }
9
6
 
10
7
  export declare function ensureNeededBinariesExist({ clientEngineType, download, hasMigrateAdapterInConfig, }: EnsureSomeBinariesExistInput): Promise<void>;
11
8
 
12
9
  declare type EnsureSomeBinariesExistInput = {
13
- clientEngineType: 'library' | 'binary' | 'client';
10
+ clientEngineType: 'library' | 'client';
14
11
  hasMigrateAdapterInConfig: boolean;
15
12
  download: (options: DownloadOptions) => Promise<BinaryPaths>;
16
13
  };
17
14
 
18
- /**
19
- * Checks if the env override `PRISMA_CLI_QUERY_ENGINE_TYPE` is set to `library` or `binary`
20
- * Otherwise returns the default
21
- */
22
- export declare function getCliQueryEngineBinaryType(clientEngineType?: string | undefined): BinaryType_2;
23
-
24
15
  export declare function getEnginesPath(): string;
25
16
 
26
17
  export { }
package/dist/index.js CHANGED
@@ -30,10 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
- DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE: () => DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE,
34
33
  enginesVersion: () => import_engines_version2.enginesVersion,
35
34
  ensureNeededBinariesExist: () => ensureNeededBinariesExist,
36
- getCliQueryEngineBinaryType: () => getCliQueryEngineBinaryType,
37
35
  getEnginesPath: () => getEnginesPath
38
36
  });
39
37
  module.exports = __toCommonJS(index_exports);
@@ -46,13 +44,6 @@ var debug = (0, import_debug.Debug)("prisma:engines");
46
44
  function getEnginesPath() {
47
45
  return import_path.default.join(__dirname, "../");
48
46
  }
49
- var DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = import_fetch_engine.BinaryType.QueryEngineLibrary;
50
- function getCliQueryEngineBinaryType(clientEngineType = process.env.PRISMA_CLI_QUERY_ENGINE_TYPE) {
51
- if (clientEngineType === "binary") {
52
- return import_fetch_engine.BinaryType.QueryEngineBinary;
53
- }
54
- return DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE;
55
- }
56
47
  async function ensureNeededBinariesExist({
57
48
  clientEngineType,
58
49
  download,
@@ -65,8 +56,7 @@ async function ensureNeededBinariesExist({
65
56
  }
66
57
  const usesQueryCompiler = clientEngineType === "client";
67
58
  if (!usesQueryCompiler) {
68
- const cliQueryEngineBinaryType = getCliQueryEngineBinaryType(clientEngineType);
69
- binaries[cliQueryEngineBinaryType] = binaryDir;
59
+ binaries[import_fetch_engine.BinaryType.QueryEngineLibrary] = binaryDir;
70
60
  }
71
61
  debug(`binaries to download ${Object.keys(binaries).join(", ")}`);
72
62
  const binaryTargets = process.env.PRISMA_CLI_BINARY_TARGETS ? process.env.PRISMA_CLI_BINARY_TARGETS.split(",") : void 0;
@@ -104,9 +94,7 @@ import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-3.0.x.so.no
104
94
  import_path.default.join(__dirname, "../query_engine-windows.dll.node");
105
95
  // Annotate the CommonJS export names for ESM import in node:
106
96
  0 && (module.exports = {
107
- DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE,
108
97
  enginesVersion,
109
98
  ensureNeededBinariesExist,
110
- getCliQueryEngineBinaryType,
111
99
  getEnginesPath
112
100
  });
@@ -2001,7 +2001,6 @@ async function main() {
2001
2001
  const branch = import_package.enginesOverride?.["branch"];
2002
2002
  let folder = import_package.enginesOverride?.["folder"];
2003
2003
  const engineCachePaths = {
2004
- [import_fetch_engine.BinaryType.QueryEngineBinary]: import_path.default.join(cacheDir, import_fetch_engine.BinaryType.QueryEngineBinary),
2005
2004
  [import_fetch_engine.BinaryType.QueryEngineLibrary]: import_path.default.join(cacheDir, import_fetch_engine.BinaryType.QueryEngineLibrary),
2006
2005
  [import_fetch_engine.BinaryType.SchemaEngineBinary]: import_path.default.join(cacheDir, import_fetch_engine.BinaryType.SchemaEngineBinary)
2007
2006
  };
@@ -2034,7 +2033,6 @@ async function main() {
2034
2033
  const binExt = binaryTarget.includes("windows") ? ".exe" : "";
2035
2034
  const engineOutputPaths = {
2036
2035
  [import_fetch_engine.BinaryType.QueryEngineLibrary]: import_path.default.join(folder, "libquery_engine".concat(libExt)),
2037
- [import_fetch_engine.BinaryType.QueryEngineBinary]: import_path.default.join(folder, import_fetch_engine.BinaryType.QueryEngineBinary.concat(binExt)),
2038
2036
  [import_fetch_engine.BinaryType.SchemaEngineBinary]: import_path.default.join(folder, import_fetch_engine.BinaryType.SchemaEngineBinary.concat(binExt))
2039
2037
  };
2040
2038
  for (const [binaryType, outputPath] of Object.entries(engineOutputPaths)) {
@@ -23,77 +23,35 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  ));
24
24
 
25
25
  // src/scripts/postinstall.ts
26
- var import_debug2 = __toESM(require("@prisma/debug"));
27
- var import_engines_version3 = require("@prisma/engines-version");
28
- var import_fetch_engine2 = require("@prisma/fetch-engine");
29
- var import_fs = __toESM(require("fs"));
30
- var import_path2 = __toESM(require("path"));
31
-
32
- // src/index.ts
33
- var import_debug = require("@prisma/debug");
26
+ var import_debug = __toESM(require("@prisma/debug"));
34
27
  var import_engines_version = require("@prisma/engines-version");
35
28
  var import_fetch_engine = require("@prisma/fetch-engine");
29
+ var import_fs = __toESM(require("fs"));
36
30
  var import_path = __toESM(require("path"));
37
- var import_engines_version2 = require("@prisma/engines-version");
38
- var debug = (0, import_debug.Debug)("prisma:engines");
39
- var DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = import_fetch_engine.BinaryType.QueryEngineLibrary;
40
- function getCliQueryEngineBinaryType(clientEngineType = process.env.PRISMA_CLI_QUERY_ENGINE_TYPE) {
41
- if (clientEngineType === "binary") {
42
- return import_fetch_engine.BinaryType.QueryEngineBinary;
43
- }
44
- return DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE;
45
- }
46
- import_path.default.join(__dirname, "../query-engine-darwin");
47
- import_path.default.join(__dirname, "../query-engine-darwin-arm64");
48
- import_path.default.join(__dirname, "../query-engine-debian-openssl-1.0.x");
49
- import_path.default.join(__dirname, "../query-engine-debian-openssl-1.1.x");
50
- import_path.default.join(__dirname, "../query-engine-debian-openssl-3.0.x");
51
- import_path.default.join(__dirname, "../query-engine-linux-static-x64");
52
- import_path.default.join(__dirname, "../query-engine-linux-static-arm64");
53
- import_path.default.join(__dirname, "../query-engine-rhel-openssl-1.0.x");
54
- import_path.default.join(__dirname, "../query-engine-rhel-openssl-1.1.x");
55
- import_path.default.join(__dirname, "../query-engine-rhel-openssl-3.0.x");
56
- import_path.default.join(__dirname, "../libquery_engine-darwin.dylib.node");
57
- import_path.default.join(__dirname, "../libquery_engine-darwin-arm64.dylib.node");
58
- import_path.default.join(__dirname, "../libquery_engine-debian-openssl-1.0.x.so.node");
59
- import_path.default.join(__dirname, "../libquery_engine-debian-openssl-1.1.x.so.node");
60
- import_path.default.join(__dirname, "../libquery_engine-debian-openssl-3.0.x.so.node");
61
- import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-1.0.x.so.node");
62
- import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-1.1.x.so.node");
63
- import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-3.0.x.so.node");
64
- import_path.default.join(__dirname, "../libquery_engine-linux-musl.so.node");
65
- import_path.default.join(__dirname, "../libquery_engine-linux-musl-openssl-3.0.x.so.node");
66
- import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-1.0.x.so.node");
67
- import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-1.1.x.so.node");
68
- import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-3.0.x.so.node");
69
- import_path.default.join(__dirname, "../query_engine-windows.dll.node");
70
-
71
- // src/scripts/postinstall.ts
72
- var debug2 = (0, import_debug2.default)("prisma:download");
73
- var baseDir = import_path2.default.join(__dirname, "../../");
74
- var lockFile = import_path2.default.join(baseDir, "download-lock");
31
+ var debug = (0, import_debug.default)("prisma:download");
32
+ var baseDir = import_path.default.join(__dirname, "../../");
33
+ var lockFile = import_path.default.join(baseDir, "download-lock");
75
34
  var createdLockFile = false;
76
35
  async function main() {
77
36
  if (import_fs.default.existsSync(lockFile) && parseInt(import_fs.default.readFileSync(lockFile, "utf-8"), 10) > Date.now() - 2e4) {
78
- debug2(`Lock file already exists, so we're skipping the download of the prisma binaries`);
37
+ debug(`Lock file already exists, so we're skipping the download of the prisma binaries`);
79
38
  } else {
80
39
  createLockFile();
81
40
  let binaryTargets;
82
41
  if (process.env.PRISMA_CLI_BINARY_TARGETS) {
83
42
  binaryTargets = process.env.PRISMA_CLI_BINARY_TARGETS.split(",");
84
43
  }
85
- const cliQueryEngineBinaryType = getCliQueryEngineBinaryType();
86
44
  const binaries = {
87
- [cliQueryEngineBinaryType]: baseDir,
88
- [import_fetch_engine2.BinaryType.SchemaEngineBinary]: baseDir
45
+ [import_fetch_engine.BinaryType.QueryEngineLibrary]: baseDir,
46
+ [import_fetch_engine.BinaryType.SchemaEngineBinary]: baseDir
89
47
  };
90
- await (0, import_fetch_engine2.download)({
48
+ await (0, import_fetch_engine.download)({
91
49
  binaries,
92
- version: import_engines_version3.enginesVersion,
50
+ version: import_engines_version.enginesVersion,
93
51
  showProgress: true,
94
52
  failSilent: true,
95
53
  binaryTargets
96
- }).catch((e) => debug2(e));
54
+ }).catch((e) => debug(e));
97
55
  cleanupLockFile();
98
56
  }
99
57
  }
@@ -108,11 +66,11 @@ function cleanupLockFile() {
108
66
  import_fs.default.unlinkSync(lockFile);
109
67
  }
110
68
  } catch (e) {
111
- debug2(e);
69
+ debug(e);
112
70
  }
113
71
  }
114
72
  }
115
- main().catch((e) => debug2(e));
73
+ main().catch((e) => debug(e));
116
74
  process.on("beforeExit", () => {
117
75
  cleanupLockFile();
118
76
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/engines",
3
- "version": "6.19.0-integration-next.6",
3
+ "version": "6.19.0-integration-feat-remove-binary-engine.1",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,9 +22,9 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@prisma/engines-version": "6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f",
25
- "@prisma/fetch-engine": "6.19.0-integration-next.6",
26
- "@prisma/debug": "6.19.0-integration-next.6",
27
- "@prisma/get-platform": "6.19.0-integration-next.6"
25
+ "@prisma/fetch-engine": "6.19.0-integration-feat-remove-binary-engine.1",
26
+ "@prisma/debug": "6.19.0-integration-feat-remove-binary-engine.1",
27
+ "@prisma/get-platform": "6.19.0-integration-feat-remove-binary-engine.1"
28
28
  },
29
29
  "files": [
30
30
  "dist",