querysub 0.376.0 → 0.377.0

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": "querysub",
3
- "version": "0.376.0",
3
+ "version": "0.377.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -16,8 +16,7 @@
16
16
  "test-wat": "yarn typenode ./src/wat/watCompiler.ts",
17
17
  "error-watch": "yarn typenode ./src/diagnostics/logs/errorNotifications/errorWatchEntry.tsx",
18
18
  "error-email": "yarn typenode ./src/diagnostics/logs/errorNotifications/errorDigestEntry.tsx",
19
- "build-native": "cd src/diagnostics/logs/IndexedLogs && node-gyp rebuild",
20
- "postinstall": "node scripts/postinstall.js"
19
+ "build-native": "cd src/diagnostics/logs/IndexedLogs && node-gyp rebuild"
21
20
  },
22
21
  "bin": {
23
22
  "deploy": "./bin/deploy.js",
@@ -17,6 +17,7 @@ static uint32_t RemapUnit(uint32_t unit) {
17
17
  return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24);
18
18
  }
19
19
 
20
+
20
21
  static napi_value PopulateUnits(napi_env env, napi_callback_info info) {
21
22
  size_t argc = 2;
22
23
  napi_value args[2];
@@ -8,7 +8,7 @@ import { formatNumber, formatPercent } from "socket-function/src/formatting/form
8
8
  import { lazy } from "socket-function/src/caching";
9
9
  import { list, sort } from "socket-function/src/misc";
10
10
  import { testDisableCache } from "../../../-a-archives/archivesMemoryCache";
11
- import { devDebugbreak } from "../../../config";
11
+ import { devDebugbreak, isPublic } from "../../../config";
12
12
  import { BufferUnitIndexParallelSearchCount, DEFAULT_BLOCK_SIZE, DEFAULT_TARGET_UNITS_PER_BUCKET } from "./BufferIndexLogsOptimizationConstants";
13
13
  import { runInParallel } from "socket-function/src/batching";
14
14
  import { createMatchesPattern } from "./bufferSearchFindMatcher";
@@ -51,7 +51,9 @@ const getCppAddon = lazy(async () => {
51
51
 
52
52
  if (checkNeedsBuild()) {
53
53
  try {
54
- await runPromise("node-gyp rebuild");
54
+ await runPromise("yarn build-native", {
55
+ cwd: __dirname
56
+ });
55
57
  const cppFilePath = path.join(__dirname, "BufferIndexCPP.cpp");
56
58
  const distPath = path.join(__dirname, "dist");
57
59
  const versionFilePath = path.join(distPath, "BufferIndexCPP.version");
@@ -62,6 +64,11 @@ const getCppAddon = lazy(async () => {
62
64
  const currentHash = crypto.createHash("sha256").update(cppFileContent).digest("hex");
63
65
  fs.writeFileSync(versionFilePath, currentHash);
64
66
  } catch (e) {
67
+ if (!isPublic()) {
68
+ require("debugbreak")(2);
69
+ debugger;
70
+ console.error(`Error building C++ addon: ${e}`);
71
+ }
65
72
  return undefined;
66
73
  }
67
74
  }
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Only run build-native if we're being installed as a dependency in someone else's project
4
- // Not when we're the root project adding new dependencies
5
- const path = require("path");
6
- const { execSync } = require("child_process");
7
-
8
- // Check if we're in node_modules (installed as a dependency)
9
- const isInstalledAsDependency = __dirname.includes("node_modules");
10
-
11
- if (isInstalledAsDependency) {
12
- console.log("Running native build for querysub...");
13
- try {
14
- execSync("node-gyp rebuild", {
15
- cwd: path.join(__dirname, "..", "src", "diagnostics", "logs", "IndexedLogs"),
16
- stdio: "inherit"
17
- });
18
- } catch (err) {
19
- console.log("Native build failed (this is okay, continuing...)");
20
- }
21
- } else {
22
- console.log("Skipping native build (running in development)");
23
- }