pi-hashline-edit-pro 0.17.4 → 0.17.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-hashline-edit-pro",
3
- "version": "0.17.4",
3
+ "version": "0.17.5",
4
4
  "description": "Strict hashline read/replace tool for pi-coding-agent with hash-anchored edits (3-char, 18-bit, perfect hashing)",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -3,15 +3,17 @@ const fs = require("fs");
3
3
  const path = require("path");
4
4
 
5
5
  const root = path.resolve(__dirname, "..");
6
+ const bsqlDir = path.join(root, "node_modules", "better-sqlite3");
6
7
 
7
8
  try {
8
- require(path.join(root, "node_modules", "better-sqlite3"));
9
+ require(bsqlDir);
9
10
  process.exit(0);
10
11
  } catch (e) {
11
12
  const msg = e && typeof e.message === "string" ? e.message : String(e);
12
13
  if (/GLIBC|Cannot find module|dlo|not found/i.test(msg)) {
13
14
  console.error("better-sqlite3 prebuilt incompatible, rebuilding from source...");
14
- const prebuildDir = path.join(root, "node_modules", "better-sqlite3", "prebuilds");
15
+
16
+ const prebuildDir = path.join(bsqlDir, "prebuilds");
15
17
  if (fs.existsSync(prebuildDir)) {
16
18
  const platform = process.platform + "-" + process.arch;
17
19
  const prebuilt = path.join(prebuildDir, platform + ".node");
@@ -20,11 +22,17 @@ try {
20
22
  console.error("Removed incompatible prebuilt:", platform + ".node");
21
23
  }
22
24
  }
25
+
26
+ const buildDir = path.join(bsqlDir, "build");
27
+ if (fs.existsSync(buildDir)) {
28
+ fs.rmSync(buildDir, { recursive: true, force: true });
29
+ }
30
+
23
31
  try {
24
- execSync("npm rebuild better-sqlite3", {
25
- cwd: root,
32
+ execSync("npx --yes node-gyp rebuild", {
33
+ cwd: bsqlDir,
26
34
  stdio: "inherit",
27
- timeout: 120000,
35
+ timeout: 300000,
28
36
  });
29
37
  console.error("better-sqlite3 rebuilt successfully from source.");
30
38
  } catch (rebuildErr) {