fast-pgn-parser 0.0.2 → 0.1.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,12 +1,11 @@
1
1
  {
2
2
  "name": "fast-pgn-parser",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "Basic but fast PGN parser",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
8
8
  "install": "node scripts/install-libpgn.cjs",
9
- "preinstall": "node scripts/fix-node-gyp-vs18.cjs",
10
9
  "rebuild": "node-gyp rebuild",
11
10
  "test": "node --test",
12
11
  "test:coverage": "c8 node --test",
@@ -15,7 +14,7 @@
15
14
  },
16
15
  "dependencies": {
17
16
  "node-addon-api": "^8.0.0",
18
- "node-gyp": "^10.0.0"
17
+ "node-gyp": "^12.1.0"
19
18
  },
20
19
  "devDependencies": {
21
20
  "c8": "^10.1.2",
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Apply the same VS 18 fix as bitboard-chess (no patch file):
4
- * - Map version 18 to versionYear 2022 so node-gyp accepts it via [2019, 2022]
5
- * - In getToolset, use v145 when install path contains \18\, else v143 for 2022
6
- * Idempotent: safe to run on vanilla or already-patched node-gyp.
7
- */
8
- const fs = require('fs');
9
- const path = require('path');
10
-
11
- const findVs = path.join(
12
- __dirname,
13
- '..',
14
- 'node_modules',
15
- 'node-gyp',
16
- 'lib',
17
- 'find-visualstudio.js'
18
- );
19
-
20
- if (!fs.existsSync(findVs)) {
21
- process.exit(0);
22
- }
23
-
24
- let code = fs.readFileSync(findVs, 'utf8');
25
-
26
- // 1) getVersionInfo: versionMajor 18 -> versionYear 2022 (so [2019, 2022] accepts it)
27
- code = code.replace(
28
- /(if \(ret\.versionMajor === 18\) \{\s*)ret\.versionYear = 2026/,
29
- '$1ret.versionYear = 2022'
30
- );
31
- if (!code.includes('if (ret.versionMajor === 18)')) {
32
- code = code.replace(
33
- /(if \(ret\.versionMajor === 17\) \{\s*ret\.versionYear = 2022\s*return ret\s*\})\s*(this\.log\.silly\('- unsupported version:', ret\.versionMajor\))/,
34
- "$1\n if (ret.versionMajor === 18) {\n ret.versionYear = 2022\n return ret\n }\n $2"
35
- );
36
- }
37
-
38
- // 2) supportedYears: use [2019, 2022] only
39
- code = code.replace(/\[2019, 2022, 2026\]/g, '[2019, 2022]');
40
-
41
- // 3) getToolset: for 2022 use v145 when path has \18\, else v143; remove 2026 branch if present
42
- if (!code.includes("includes('\\\\18\\\\')")) {
43
- code = code.replace(
44
- /(versionYear === 2022\) \{\s*)return 'v143'/,
45
- "$1return (info.path && info.path.includes('\\\\18\\\\')) ? 'v145' : 'v143'"
46
- );
47
- code = code.replace(
48
- /\s*\} else if \(versionYear === 2026\) \{\s*return 'v145'\s*\}/m,
49
- '\n }'
50
- );
51
- }
52
-
53
- fs.writeFileSync(findVs, code, 'utf8');