@rivetkit/rivetkit-napi 0.0.0-pr.4711.a8b8acd → 0.0.0-pr.4719.23ea795
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/package.json +9 -9
- package/scripts/build.mjs +7 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/rivetkit-napi",
|
|
3
|
-
"version": "0.0.0-pr.
|
|
3
|
+
"version": "0.0.0-pr.4719.23ea795",
|
|
4
4
|
"description": "Native N-API addon for RivetKit providing envoy client and SQLite access",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "index.js",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@napi-rs/cli": "^2.18.4",
|
|
46
|
-
"@rivetkit/engine-envoy-protocol": "0.0.0-pr.
|
|
46
|
+
"@rivetkit/engine-envoy-protocol": "0.0.0-pr.4719.23ea795"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-pr.
|
|
50
|
-
"@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-pr.
|
|
51
|
-
"@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-pr.
|
|
52
|
-
"@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-pr.
|
|
53
|
-
"@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-pr.
|
|
54
|
-
"@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-pr.
|
|
55
|
-
"@rivetkit/rivetkit-napi-win32-x64-msvc": "0.0.0-pr.
|
|
49
|
+
"@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-pr.4719.23ea795",
|
|
50
|
+
"@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-pr.4719.23ea795",
|
|
51
|
+
"@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-pr.4719.23ea795",
|
|
52
|
+
"@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-pr.4719.23ea795",
|
|
53
|
+
"@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-pr.4719.23ea795",
|
|
54
|
+
"@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-pr.4719.23ea795",
|
|
55
|
+
"@rivetkit/rivetkit-napi-win32-x64-msvc": "0.0.0-pr.4719.23ea795"
|
|
56
56
|
}
|
|
57
57
|
}
|
package/scripts/build.mjs
CHANGED
|
@@ -1,66 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Skips the napi build if a prebuilt .node file already exists next to
|
|
6
|
-
* this package (either a root-level `rivetkit-napi.*.node` or one inside
|
|
7
|
-
* a `npm/<platform>/` directory). This lets CI skip a redundant napi build
|
|
8
|
-
* when the cross-compiled artifacts have already been downloaded from the
|
|
9
|
-
* platform build jobs.
|
|
10
|
-
*
|
|
11
|
-
* Pass `--force` to always run the napi build.
|
|
3
|
+
* Build wrapper for rivetkit-napi.
|
|
12
4
|
*/
|
|
13
|
-
import {
|
|
14
|
-
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
15
|
-
import { dirname, join } from "node:path";
|
|
16
|
-
import { fileURLToPath } from "node:url";
|
|
17
|
-
|
|
18
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
19
|
-
const packageDir = join(__dirname, "..");
|
|
5
|
+
import { execFileSync } from "node:child_process";
|
|
20
6
|
|
|
21
7
|
const args = process.argv.slice(2);
|
|
22
|
-
const
|
|
23
|
-
const releaseArg = args.find((a) => a === "--release");
|
|
24
|
-
const extraFlags = releaseArg ? ["--release"] : [];
|
|
8
|
+
const extraFlags = args.includes("--release") ? ["--release"] : [];
|
|
25
9
|
|
|
26
10
|
// Explicit skip for environments that don't need the native binary (e.g.
|
|
27
11
|
// Docker engine-frontend build which only consumes TypeScript types).
|
|
28
|
-
if (
|
|
12
|
+
if (process.env.SKIP_NAPI_BUILD === "1") {
|
|
29
13
|
console.log(
|
|
30
14
|
"[rivetkit-napi/build] SKIP_NAPI_BUILD=1 — skipping napi build",
|
|
31
15
|
);
|
|
32
16
|
process.exit(0);
|
|
33
17
|
}
|
|
34
18
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (rootFiles.some((f) => f.endsWith(".node"))) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
// Check for any npm/<platform>/*.node files.
|
|
42
|
-
const npmDir = join(packageDir, "npm");
|
|
43
|
-
if (existsSync(npmDir) && statSync(npmDir).isDirectory()) {
|
|
44
|
-
for (const entry of readdirSync(npmDir)) {
|
|
45
|
-
const platDir = join(npmDir, entry);
|
|
46
|
-
if (!statSync(platDir).isDirectory()) continue;
|
|
47
|
-
const files = readdirSync(platDir);
|
|
48
|
-
if (files.some((f) => f.endsWith(".node"))) {
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (!force && hasPrebuiltArtifact()) {
|
|
57
|
-
console.log(
|
|
58
|
-
"[rivetkit-napi/build] prebuilt .node artifact found — skipping napi build",
|
|
59
|
-
);
|
|
60
|
-
console.log("[rivetkit-napi/build] use --force to rebuild from source");
|
|
61
|
-
process.exit(0);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const cmd = ["napi", "build", "--platform", ...extraFlags].join(" ");
|
|
65
|
-
console.log(`[rivetkit-napi/build] running: ${cmd}`);
|
|
66
|
-
execSync(cmd, { stdio: "inherit", cwd: packageDir });
|
|
19
|
+
const cmd = ["build", "--platform", ...extraFlags];
|
|
20
|
+
console.log(`[rivetkit-napi/build] running: napi ${cmd.join(" ")}`);
|
|
21
|
+
execFileSync("napi", cmd, { stdio: "inherit" });
|