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

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