@pnpm/store.index 1000.0.0-0 → 1100.0.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.
Files changed (2) hide show
  1. package/lib/index.js +9 -2
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createRequire } from 'module';
2
- import fs from 'fs';
1
+ import fs from 'node:fs';
2
+ import { createRequire } from 'node:module';
3
3
  import { Packr } from 'msgpackr';
4
4
  // Use createRequire to load node:sqlite because it is a prefix-only builtin
5
5
  // that Jest's ESM module resolver cannot handle.
@@ -106,6 +106,13 @@ export class StoreIndex {
106
106
  this.stmtHas = this.db.prepare('SELECT 1 FROM package_index WHERE key = ?');
107
107
  this.stmtAll = this.db.prepare('SELECT key, data FROM package_index');
108
108
  this.exitHandler = () => this.close();
109
+ // Multiple StoreIndex instances may be created (e.g. in tests), each adding
110
+ // an exit listener. Raise the limit to avoid MaxListenersExceededWarning.
111
+ // Skip when maxListeners is 0 (unlimited).
112
+ const currentMax = process.getMaxListeners();
113
+ if (currentMax !== 0 && currentMax < openInstances.size + 11) {
114
+ process.setMaxListeners(Math.max(currentMax + 10, openInstances.size + 11));
115
+ }
109
116
  process.on('exit', this.exitHandler);
110
117
  openInstances.add(this);
111
118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/store.index",
3
- "version": "1000.0.0-0",
3
+ "version": "1100.0.0",
4
4
  "description": "SQLite-backed index for the pnpm content-addressable store",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -25,12 +25,12 @@
25
25
  "!*.map"
26
26
  ],
27
27
  "dependencies": {
28
- "msgpackr": "^1.11.2"
28
+ "msgpackr": "1.11.8"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/node": "^22.19.11",
31
+ "@types/node": "^22.19.15",
32
32
  "tempy": "3.0.0",
33
- "@pnpm/store.index": "1000.0.0-0"
33
+ "@pnpm/store.index": "1100.0.0"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=22.13"
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "scripts": {
42
42
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
43
- "_test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest",
44
- "test": "pnpm run compile && pnpm run _test",
45
- "compile": "tsgo --build && pnpm run lint --fix"
43
+ "test": "pn compile && pn .test",
44
+ "compile": "tsgo --build && pn lint --fix",
45
+ ".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
46
46
  }
47
47
  }