@vulfram/transport-napi 0.22.2-alpha → 0.22.3-alpha

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/dist/index.js CHANGED
@@ -30,34 +30,34 @@ var __toESM = (mod, isNodeMode, target) => {
30
30
  };
31
31
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
32
32
 
33
- // lib/macos-arm64/vulfram_core.node
33
+ // dist/macos-arm64/vulfram_core.node
34
34
  var require_vulfram_core = __commonJS((exports, module) => {
35
- module.exports = "./vulfram_core-aw1j31s7.node";
35
+ module.exports = "./vulfram_core-frych3wz.node";
36
36
  });
37
37
 
38
- // lib/macos-x64/vulfram_core.node
38
+ // dist/macos-x64/vulfram_core.node
39
39
  var require_vulfram_core2 = __commonJS((exports, module) => {
40
- module.exports = "./vulfram_core-y6zz6xs4.node";
40
+ module.exports = "./vulfram_core-zb0wmdrr.node";
41
41
  });
42
42
 
43
- // lib/linux-arm64/vulfram_core.node
43
+ // dist/linux-arm64/vulfram_core.node
44
44
  var require_vulfram_core3 = __commonJS((exports, module) => {
45
- module.exports = "./vulfram_core-trs2y4az.node";
45
+ module.exports = "./vulfram_core-8n05w6k7.node";
46
46
  });
47
47
 
48
- // lib/linux-x64/vulfram_core.node
48
+ // dist/linux-x64/vulfram_core.node
49
49
  var require_vulfram_core4 = __commonJS((exports, module) => {
50
- module.exports = "./vulfram_core-23armmd1.node";
50
+ module.exports = "./vulfram_core-argtfgna.node";
51
51
  });
52
52
 
53
- // lib/windows-arm64/vulfram_core.node
53
+ // dist/windows-arm64/vulfram_core.node
54
54
  var require_vulfram_core5 = __commonJS((exports, module) => {
55
- module.exports = "./vulfram_core-mg5029s8.node";
55
+ module.exports = "./vulfram_core-248v78f0.node";
56
56
  });
57
57
 
58
- // lib/windows-x64/vulfram_core.node
58
+ // dist/windows-x64/vulfram_core.node
59
59
  var require_vulfram_core6 = __commonJS((exports, module) => {
60
- module.exports = "./vulfram_core-bcxdx55r.node";
60
+ module.exports = "./vulfram_core-jsrdc9yc.node";
61
61
  });
62
62
 
63
63
  // ../transport-types/src/index.ts
@@ -142,8 +142,11 @@ function getArtifactFileName(binding, platform) {
142
142
 
143
143
  // src/bind/napi-loader.ts
144
144
  import { createRequire } from "module";
145
+ import { dirname, join } from "path";
146
+ import { existsSync } from "fs";
147
+ import { fileURLToPath } from "url";
145
148
  var requireNative = createRequire(import.meta.url);
146
- var loaders = {
149
+ var bundledLoaders = {
147
150
  darwin: {
148
151
  arm64: () => Promise.resolve().then(() => __toESM(require_vulfram_core(), 1)),
149
152
  x64: () => Promise.resolve().then(() => __toESM(require_vulfram_core2(), 1))
@@ -161,14 +164,26 @@ function getExpectedLocalArtifact() {
161
164
  try {
162
165
  const platform = resolveNativePlatform();
163
166
  const filename = getArtifactFileName("napi", platform);
164
- return `../../lib/${platform}/${filename}`;
167
+ return `../../dist/${platform}/${filename}`;
165
168
  } catch {
166
- return "../../lib/<platform>/vulfram_core.node";
169
+ return "../../dist/<platform>/vulfram_core.node";
167
170
  }
168
171
  }
169
172
  async function resolveNativeModulePath() {
170
- const importLoader = selectPlatformLoader(loaders, "N-API");
173
+ const platform = resolveNativePlatform();
174
+ const filename = getArtifactFileName("napi", platform);
175
+ const moduleDir = dirname(fileURLToPath(import.meta.url));
176
+ const candidates = [
177
+ join(moduleDir, "..", "..", "dist", platform, filename),
178
+ join(moduleDir, platform, filename),
179
+ join(moduleDir, "..", platform, filename)
180
+ ];
171
181
  try {
182
+ const resolved = candidates.find((candidate) => existsSync(candidate));
183
+ if (resolved) {
184
+ return resolved;
185
+ }
186
+ const importLoader = selectPlatformLoader(bundledLoaders, "N-API");
172
187
  return (await importLoader()).default;
173
188
  } catch (error) {
174
189
  const runtime = detectRuntime();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulfram/transport-napi",
3
- "version": "0.22.2-alpha",
3
+ "version": "0.22.3-alpha",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
package/tsconfig.json CHANGED
@@ -1,29 +1,31 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  // Environment setup & latest features
4
- "lib": ["ESNext"],
4
+ "lib": [
5
+ "ESNext"
6
+ ],
7
+ "types": [
8
+ "bun"
9
+ ],
5
10
  "target": "ESNext",
6
11
  "module": "Preserve",
7
12
  "moduleDetection": "force",
8
13
  "jsx": "react-jsx",
9
14
  "allowJs": true,
10
-
11
15
  // Bundler mode
12
16
  "moduleResolution": "bundler",
13
17
  "allowImportingTsExtensions": true,
14
18
  "verbatimModuleSyntax": true,
15
19
  "noEmit": true,
16
-
17
20
  // Best practices
18
21
  "strict": true,
19
22
  "skipLibCheck": true,
20
23
  "noFallthroughCasesInSwitch": true,
21
24
  "noUncheckedIndexedAccess": true,
22
25
  "noImplicitOverride": true,
23
-
24
26
  // Some stricter flags (disabled by default)
25
27
  "noUnusedLocals": false,
26
28
  "noUnusedParameters": false,
27
29
  "noPropertyAccessFromIndexSignature": false
28
30
  }
29
- }
31
+ }