@kungfu-tech/libnode-win32-x64 22.22.3-kf.1 → 22.22.3-kf.3-alpha.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.
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "22.22.3-kf.1",
2
+ "version": "22.22.3-kf.3-alpha.0",
3
3
  "git": {
4
4
  "revision": "fdfa0ff0dbaf0fbf4d7d6d89a2ab807f3177fa5c"
5
5
  },
6
6
  "build": {
7
7
  "user": "gha-runner",
8
- "timestamp": "2026-07-01T07:46:36.834Z"
8
+ "timestamp": "2026-07-02T01:46:54.465Z"
9
9
  }
10
10
  }
Binary file
@@ -0,0 +1,41 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const aliases = [];
5
+ const distDir = path.join(__dirname, 'dist', 'node');
6
+
7
+ function findAliasSource(match, target) {
8
+ const pattern = new RegExp(match);
9
+ return fs.readdirSync(distDir).find((entry) => entry !== target && pattern.test(entry));
10
+ }
11
+
12
+ function ensureAlias(alias) {
13
+ const sourceName = findAliasSource(alias.match, alias.target);
14
+ if (!sourceName) {
15
+ throw new Error(`Unable to create ${alias.target}: no source matching ${alias.match}`);
16
+ }
17
+
18
+ const target = path.join(distDir, alias.target);
19
+ const source = path.join(distDir, sourceName);
20
+
21
+ try {
22
+ if (fs.lstatSync(target).isSymbolicLink() && fs.readlinkSync(target) === sourceName) return;
23
+ fs.rmSync(target, { force: true });
24
+ } catch (error) {
25
+ if (error.code !== 'ENOENT') throw error;
26
+ }
27
+
28
+ try {
29
+ fs.symlinkSync(sourceName, target, 'file');
30
+ } catch (error) {
31
+ fs.copyFileSync(source, target);
32
+ }
33
+ }
34
+
35
+ function ensureLibnodeAliases() {
36
+ for (const alias of aliases) ensureAlias(alias);
37
+ }
38
+
39
+ module.exports = { ensureLibnodeAliases };
40
+
41
+ if (require.main === module) ensureLibnodeAliases();
package/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  const path = require('path');
2
+ const { ensureLibnodeAliases } = require('./ensure-libnode-aliases.js');
2
3
 
3
4
  const distDir = path.join(__dirname, 'dist', 'node');
5
+ ensureLibnodeAliases();
4
6
  exports.include = path.join(distDir, 'include');
5
7
  exports.libpath = distDir;
@@ -3,6 +3,6 @@
3
3
  "nodeVersion": "22.22.3",
4
4
  "nodeTag": "v22.22.3",
5
5
  "nodeCommit": "fdfa0ff0dbaf0fbf4d7d6d89a2ab807f3177fa5c",
6
- "libnodeRevision": 1,
7
- "npmVersion": "22.22.3-kf.1"
6
+ "libnodeRevision": 3,
7
+ "npmVersion": "22.22.3-kf.3-alpha.0"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/libnode-win32-x64",
3
- "version": "22.22.3-kf.1",
3
+ "version": "22.22.3-kf.3-alpha.0",
4
4
  "description": "libnode binaries for win32-x64",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -17,6 +17,7 @@
17
17
  "main": "index.js",
18
18
  "files": [
19
19
  "index.js",
20
+ "ensure-libnode-aliases.js",
20
21
  "dist/",
21
22
  "libnode.release.json",
22
23
  "LICENSE",