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