@prisma/engines 6.9.0-dev.46 → 6.9.0-dev.48

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,17 +1,25 @@
1
+ import type { BinaryPaths } from '@prisma/fetch-engine';
1
2
  import { BinaryType as BinaryType_2 } from '@prisma/fetch-engine';
3
+ import type { DownloadOptions } from '@prisma/fetch-engine';
2
4
  import { enginesVersion } from '@prisma/engines-version';
3
5
 
4
6
  export declare const DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = BinaryType.QueryEngineLibrary;
5
7
 
6
8
  export { enginesVersion }
7
9
 
8
- export declare function ensureBinariesExist(): Promise<void>;
10
+ export declare function ensureNeededBinariesExist({ clientEngineType, download, hasMigrateAdapterInConfig, }: EnsureSomeBinariesExistInput): Promise<void>;
11
+
12
+ declare type EnsureSomeBinariesExistInput = {
13
+ clientEngineType: 'library' | 'binary' | 'client';
14
+ hasMigrateAdapterInConfig: boolean;
15
+ download: (options: DownloadOptions) => Promise<BinaryPaths>;
16
+ };
9
17
 
10
18
  /**
11
19
  * Checks if the env override `PRISMA_CLI_QUERY_ENGINE_TYPE` is set to `library` or `binary`
12
20
  * Otherwise returns the default
13
21
  */
14
- export declare function getCliQueryEngineBinaryType(): BinaryType_2;
22
+ export declare function getCliQueryEngineBinaryType(clientEngineType?: string | undefined): BinaryType_2;
15
23
 
16
24
  export declare function getEnginesPath(): string;
17
25
 
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE: () => DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE,
34
34
  enginesVersion: () => import_engines_version2.enginesVersion,
35
- ensureBinariesExist: () => ensureBinariesExist,
35
+ ensureNeededBinariesExist: () => ensureNeededBinariesExist,
36
36
  getCliQueryEngineBinaryType: () => getCliQueryEngineBinaryType,
37
37
  getEnginesPath: () => getEnginesPath
38
38
  });
@@ -47,31 +47,30 @@ function getEnginesPath() {
47
47
  return import_path.default.join(__dirname, "../");
48
48
  }
49
49
  var DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = import_fetch_engine.BinaryType.QueryEngineLibrary;
50
- function getCliQueryEngineBinaryType() {
51
- const envCliQueryEngineType = process.env.PRISMA_CLI_QUERY_ENGINE_TYPE;
52
- if (envCliQueryEngineType) {
53
- if (envCliQueryEngineType === "binary") {
54
- return import_fetch_engine.BinaryType.QueryEngineBinary;
55
- }
56
- if (envCliQueryEngineType === "library") {
57
- return import_fetch_engine.BinaryType.QueryEngineLibrary;
58
- }
50
+ function getCliQueryEngineBinaryType(clientEngineType = process.env.PRISMA_CLI_QUERY_ENGINE_TYPE) {
51
+ if (clientEngineType === "binary") {
52
+ return import_fetch_engine.BinaryType.QueryEngineBinary;
59
53
  }
60
54
  return DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE;
61
55
  }
62
- async function ensureBinariesExist() {
56
+ async function ensureNeededBinariesExist({
57
+ clientEngineType,
58
+ download,
59
+ hasMigrateAdapterInConfig
60
+ }) {
63
61
  const binaryDir = import_path.default.join(__dirname, "../");
64
- let binaryTargets;
65
- if (process.env.PRISMA_CLI_BINARY_TARGETS) {
66
- binaryTargets = process.env.PRISMA_CLI_BINARY_TARGETS.split(",");
62
+ const binaries = {};
63
+ if (!hasMigrateAdapterInConfig) {
64
+ binaries[import_fetch_engine.BinaryType.SchemaEngineBinary] = binaryDir;
65
+ }
66
+ const usesQueryCompiler = clientEngineType === "client";
67
+ if (!usesQueryCompiler) {
68
+ const cliQueryEngineBinaryType = getCliQueryEngineBinaryType(clientEngineType);
69
+ binaries[cliQueryEngineBinaryType] = binaryDir;
67
70
  }
68
- const cliQueryEngineBinaryType = getCliQueryEngineBinaryType();
69
- const binaries = {
70
- [cliQueryEngineBinaryType]: binaryDir,
71
- [import_fetch_engine.BinaryType.SchemaEngineBinary]: binaryDir
72
- };
73
71
  debug(`binaries to download ${Object.keys(binaries).join(", ")}`);
74
- await (0, import_fetch_engine.download)({
72
+ const binaryTargets = process.env.PRISMA_CLI_BINARY_TARGETS ? process.env.PRISMA_CLI_BINARY_TARGETS.split(",") : void 0;
73
+ await download({
75
74
  binaries,
76
75
  showProgress: true,
77
76
  version: import_engines_version.enginesVersion,
@@ -107,7 +106,7 @@ import_path.default.join(__dirname, "../query_engine-windows.dll.node");
107
106
  0 && (module.exports = {
108
107
  DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE,
109
108
  enginesVersion,
110
- ensureBinariesExist,
109
+ ensureNeededBinariesExist,
111
110
  getCliQueryEngineBinaryType,
112
111
  getEnginesPath
113
112
  });
@@ -37,15 +37,9 @@ var import_path = __toESM(require("path"));
37
37
  var import_engines_version2 = require("@prisma/engines-version");
38
38
  var debug = (0, import_debug.Debug)("prisma:engines");
39
39
  var DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = import_fetch_engine.BinaryType.QueryEngineLibrary;
40
- function getCliQueryEngineBinaryType() {
41
- const envCliQueryEngineType = process.env.PRISMA_CLI_QUERY_ENGINE_TYPE;
42
- if (envCliQueryEngineType) {
43
- if (envCliQueryEngineType === "binary") {
44
- return import_fetch_engine.BinaryType.QueryEngineBinary;
45
- }
46
- if (envCliQueryEngineType === "library") {
47
- return import_fetch_engine.BinaryType.QueryEngineLibrary;
48
- }
40
+ function getCliQueryEngineBinaryType(clientEngineType = process.env.PRISMA_CLI_QUERY_ENGINE_TYPE) {
41
+ if (clientEngineType === "binary") {
42
+ return import_fetch_engine.BinaryType.QueryEngineBinary;
49
43
  }
50
44
  return DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE;
51
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/engines",
3
- "version": "6.9.0-dev.46",
3
+ "version": "6.9.0-dev.48",
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",
@@ -17,14 +17,14 @@
17
17
  "@types/jest": "29.5.14",
18
18
  "@types/node": "18.19.76",
19
19
  "execa": "5.1.1",
20
- "jest": "29.7.0",
21
- "typescript": "5.4.5"
20
+ "typescript": "5.4.5",
21
+ "vitest": "3.2.0"
22
22
  },
23
23
  "dependencies": {
24
24
  "@prisma/engines-version": "6.9.0-9.7964919760fdc6e0123bfc099b6d157b42d2e686",
25
- "@prisma/debug": "6.9.0-dev.46",
26
- "@prisma/fetch-engine": "6.9.0-dev.46",
27
- "@prisma/get-platform": "6.9.0-dev.46"
25
+ "@prisma/debug": "6.9.0-dev.48",
26
+ "@prisma/fetch-engine": "6.9.0-dev.48",
27
+ "@prisma/get-platform": "6.9.0-dev.48"
28
28
  },
29
29
  "files": [
30
30
  "dist",
@@ -35,7 +35,7 @@
35
35
  "scripts": {
36
36
  "dev": "DEV=true tsx helpers/build.ts",
37
37
  "build": "tsx helpers/build.ts",
38
- "test": "jest --passWithNoTests",
38
+ "test": "vitest run",
39
39
  "postinstall": "node scripts/postinstall.js"
40
40
  }
41
41
  }