@vulfram/transport-napi 0.22.2-alpha → 0.22.4-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/linux-arm64/manifest.json +9 -0
- package/dist/{vulfram_core-trs2y4az.node → linux-arm64/vulfram_core.node} +0 -0
- package/dist/linux-arm64/vulfram_core.node.sha256 +1 -0
- package/dist/linux-x64/manifest.json +9 -0
- package/dist/{vulfram_core-23armmd1.node → linux-x64/vulfram_core.node} +0 -0
- package/dist/linux-x64/vulfram_core.node.sha256 +1 -0
- package/dist/macos-arm64/manifest.json +9 -0
- package/dist/{vulfram_core-aw1j31s7.node → macos-arm64/vulfram_core.node} +0 -0
- package/dist/macos-arm64/vulfram_core.node.sha256 +1 -0
- package/dist/macos-x64/manifest.json +9 -0
- package/dist/{vulfram_core-y6zz6xs4.node → macos-x64/vulfram_core.node} +0 -0
- package/dist/macos-x64/vulfram_core.node.sha256 +1 -0
- package/dist/windows-arm64/manifest.json +9 -0
- package/dist/{vulfram_core-mg5029s8.node → windows-arm64/vulfram_core.node} +0 -0
- package/dist/windows-arm64/vulfram_core.node.sha256 +1 -0
- package/dist/windows-x64/manifest.json +9 -0
- package/dist/{vulfram_core-bcxdx55r.node → windows-x64/vulfram_core.node} +0 -0
- package/dist/windows-x64/vulfram_core.node.sha256 +1 -0
- package/package.json +5 -4
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -202
- package/tsconfig.json +0 -29
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"channel": "alpha",
|
|
3
|
+
"version": "0.22.4-alpha",
|
|
4
|
+
"binding": "napi",
|
|
5
|
+
"platform": "linux-arm64",
|
|
6
|
+
"rust_target": "aarch64-unknown-linux-gnu",
|
|
7
|
+
"artifact": "vulfram_core.node",
|
|
8
|
+
"sha256": "0d84562044484efc65fcac5f976be654199c4f38e096cae35fc01330d40ead87"
|
|
9
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0d84562044484efc65fcac5f976be654199c4f38e096cae35fc01330d40ead87
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f6b98361946719cb5872dbeead4ab3523ce1b3aff9f281e42c41f4d262e52dfa
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e31686727979b51c08946bbc7857d1127616ce7d99b8c40f86a37636169a09f0
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
006e0d7eb15ba8b60085271538a8f984f94cf1fe2990736f2dd8aadd15eac7b7
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"channel": "alpha",
|
|
3
|
+
"version": "0.22.4-alpha",
|
|
4
|
+
"binding": "napi",
|
|
5
|
+
"platform": "windows-arm64",
|
|
6
|
+
"rust_target": "aarch64-pc-windows-msvc",
|
|
7
|
+
"artifact": "vulfram_core.node",
|
|
8
|
+
"sha256": "90ab90a2566c3fb0ed8bc6f2837a55c7c0c1d310e8a7d6eac8d5c4bfcbe17d95"
|
|
9
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
90ab90a2566c3fb0ed8bc6f2837a55c7c0c1d310e8a7d6eac8d5c4bfcbe17d95
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0706546100695b1db7c165b5cabbc87c29dd94dc7b412d01003f199ec1b189fc
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulfram/transport-napi",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.4-alpha",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
12
12
|
"main": "dist/index.js",
|
|
13
13
|
"module": "dist/index.js",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
17
18
|
"publishConfig": {
|
|
18
19
|
"access": "public"
|
|
19
20
|
},
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
function __accessProp(key) {
|
|
7
|
-
return this[key];
|
|
8
|
-
}
|
|
9
|
-
var __toESMCache_node;
|
|
10
|
-
var __toESMCache_esm;
|
|
11
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
12
|
-
var canCache = mod != null && typeof mod === "object";
|
|
13
|
-
if (canCache) {
|
|
14
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
15
|
-
var cached = cache.get(mod);
|
|
16
|
-
if (cached)
|
|
17
|
-
return cached;
|
|
18
|
-
}
|
|
19
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
20
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
-
for (let key of __getOwnPropNames(mod))
|
|
22
|
-
if (!__hasOwnProp.call(to, key))
|
|
23
|
-
__defProp(to, key, {
|
|
24
|
-
get: __accessProp.bind(mod, key),
|
|
25
|
-
enumerable: true
|
|
26
|
-
});
|
|
27
|
-
if (canCache)
|
|
28
|
-
cache.set(mod, to);
|
|
29
|
-
return to;
|
|
30
|
-
};
|
|
31
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
32
|
-
|
|
33
|
-
// lib/macos-arm64/vulfram_core.node
|
|
34
|
-
var require_vulfram_core = __commonJS((exports, module) => {
|
|
35
|
-
module.exports = "./vulfram_core-aw1j31s7.node";
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// lib/macos-x64/vulfram_core.node
|
|
39
|
-
var require_vulfram_core2 = __commonJS((exports, module) => {
|
|
40
|
-
module.exports = "./vulfram_core-y6zz6xs4.node";
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// lib/linux-arm64/vulfram_core.node
|
|
44
|
-
var require_vulfram_core3 = __commonJS((exports, module) => {
|
|
45
|
-
module.exports = "./vulfram_core-trs2y4az.node";
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// lib/linux-x64/vulfram_core.node
|
|
49
|
-
var require_vulfram_core4 = __commonJS((exports, module) => {
|
|
50
|
-
module.exports = "./vulfram_core-23armmd1.node";
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// lib/windows-arm64/vulfram_core.node
|
|
54
|
-
var require_vulfram_core5 = __commonJS((exports, module) => {
|
|
55
|
-
module.exports = "./vulfram_core-mg5029s8.node";
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// lib/windows-x64/vulfram_core.node
|
|
59
|
-
var require_vulfram_core6 = __commonJS((exports, module) => {
|
|
60
|
-
module.exports = "./vulfram_core-bcxdx55r.node";
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
// ../transport-types/src/index.ts
|
|
64
|
-
function detectRuntime() {
|
|
65
|
-
if (typeof globalThis.Deno !== "undefined" && typeof globalThis.Deno?.version?.deno === "string") {
|
|
66
|
-
const deno = globalThis.Deno;
|
|
67
|
-
return {
|
|
68
|
-
runtime: "deno",
|
|
69
|
-
version: deno.version.deno,
|
|
70
|
-
platform: deno.build?.os ?? null,
|
|
71
|
-
arch: deno.build?.arch ?? null
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
if (typeof globalThis.Bun !== "undefined" && typeof globalThis.Bun?.version === "string") {
|
|
75
|
-
return {
|
|
76
|
-
runtime: "bun",
|
|
77
|
-
version: globalThis.Bun.version,
|
|
78
|
-
platform: typeof process !== "undefined" ? process.platform : null,
|
|
79
|
-
arch: typeof process !== "undefined" ? process.arch : null
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (typeof globalThis.process !== "undefined" && typeof globalThis.process?.versions?.node === "string") {
|
|
83
|
-
const proc = globalThis.process;
|
|
84
|
-
return {
|
|
85
|
-
runtime: "node",
|
|
86
|
-
version: proc.versions.node,
|
|
87
|
-
platform: proc.platform ?? null,
|
|
88
|
-
arch: proc.arch ?? null
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
runtime: "unknown",
|
|
93
|
-
version: null,
|
|
94
|
-
platform: null,
|
|
95
|
-
arch: null
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function selectPlatformLoader(loaders, artifactKind) {
|
|
99
|
-
const runtime = detectRuntime();
|
|
100
|
-
const platformKey = runtime.platform ?? "";
|
|
101
|
-
const archKey = runtime.arch ?? "";
|
|
102
|
-
const byPlatform = loaders[platformKey];
|
|
103
|
-
const selected = byPlatform?.[archKey];
|
|
104
|
-
if (selected)
|
|
105
|
-
return selected;
|
|
106
|
-
throw new Error(`${artifactKind} build not found for the current runtime: ${JSON.stringify(runtime)}`);
|
|
107
|
-
}
|
|
108
|
-
function resolveNativePlatform(runtime = detectRuntime()) {
|
|
109
|
-
const platform = runtime.platform;
|
|
110
|
-
const arch = runtime.arch;
|
|
111
|
-
if (platform === "linux" && arch === "x64")
|
|
112
|
-
return "linux-x64";
|
|
113
|
-
if (platform === "linux" && arch === "arm64")
|
|
114
|
-
return "linux-arm64";
|
|
115
|
-
if (platform === "darwin" && arch === "x64")
|
|
116
|
-
return "macos-x64";
|
|
117
|
-
if (platform === "darwin" && arch === "arm64")
|
|
118
|
-
return "macos-arm64";
|
|
119
|
-
if (platform === "win32" && arch === "x64")
|
|
120
|
-
return "windows-x64";
|
|
121
|
-
if (platform === "win32" && arch === "arm64")
|
|
122
|
-
return "windows-arm64";
|
|
123
|
-
throw new Error(`Unsupported native platform for Vulfram transports: ${JSON.stringify(runtime)}`);
|
|
124
|
-
}
|
|
125
|
-
function getArtifactFileName(binding, platform) {
|
|
126
|
-
if (binding === "napi")
|
|
127
|
-
return "vulfram_core.node";
|
|
128
|
-
if (binding === "wasm")
|
|
129
|
-
return "vulfram_core_bg.wasm";
|
|
130
|
-
if (binding === "ffi" && platform.startsWith("windows"))
|
|
131
|
-
return "vulfram_core.dll";
|
|
132
|
-
if (binding === "ffi" && platform.startsWith("macos"))
|
|
133
|
-
return "vulfram_core.dylib";
|
|
134
|
-
if (binding === "ffi")
|
|
135
|
-
return "vulfram_core.so";
|
|
136
|
-
if (platform.startsWith("windows"))
|
|
137
|
-
return "vulfram_core.dll";
|
|
138
|
-
if (platform.startsWith("macos"))
|
|
139
|
-
return "vulfram_core.dylib";
|
|
140
|
-
return "vulfram_core.so";
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// src/bind/napi-loader.ts
|
|
144
|
-
import { createRequire } from "module";
|
|
145
|
-
var requireNative = createRequire(import.meta.url);
|
|
146
|
-
var loaders = {
|
|
147
|
-
darwin: {
|
|
148
|
-
arm64: () => Promise.resolve().then(() => __toESM(require_vulfram_core(), 1)),
|
|
149
|
-
x64: () => Promise.resolve().then(() => __toESM(require_vulfram_core2(), 1))
|
|
150
|
-
},
|
|
151
|
-
linux: {
|
|
152
|
-
arm64: () => Promise.resolve().then(() => __toESM(require_vulfram_core3(), 1)),
|
|
153
|
-
x64: () => Promise.resolve().then(() => __toESM(require_vulfram_core4(), 1))
|
|
154
|
-
},
|
|
155
|
-
win32: {
|
|
156
|
-
arm64: () => Promise.resolve().then(() => __toESM(require_vulfram_core5(), 1)),
|
|
157
|
-
x64: () => Promise.resolve().then(() => __toESM(require_vulfram_core6(), 1))
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
function getExpectedLocalArtifact() {
|
|
161
|
-
try {
|
|
162
|
-
const platform = resolveNativePlatform();
|
|
163
|
-
const filename = getArtifactFileName("napi", platform);
|
|
164
|
-
return `../../lib/${platform}/${filename}`;
|
|
165
|
-
} catch {
|
|
166
|
-
return "../../lib/<platform>/vulfram_core.node";
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
async function resolveNativeModulePath() {
|
|
170
|
-
const importLoader = selectPlatformLoader(loaders, "N-API");
|
|
171
|
-
try {
|
|
172
|
-
return (await importLoader()).default;
|
|
173
|
-
} catch (error) {
|
|
174
|
-
const runtime = detectRuntime();
|
|
175
|
-
const expectedArtifact = getExpectedLocalArtifact();
|
|
176
|
-
throw new Error(`Failed to load bundled N-API artifact (runtime=${runtime.runtime}, platform=${runtime.platform ?? "unknown"}, arch=${runtime.arch ?? "unknown"}, expected=${expectedArtifact}): ${String(error)}`);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
var modulePath = await resolveNativeModulePath();
|
|
180
|
-
var raw = requireNative(modulePath);
|
|
181
|
-
var VULFRAM_CORE = {
|
|
182
|
-
vulframInit: () => raw.vulframInit(),
|
|
183
|
-
vulframDispose: () => raw.vulframDispose(),
|
|
184
|
-
vulframReceiveQueue: () => raw.vulframReceiveQueue(),
|
|
185
|
-
vulframReceiveEvents: () => raw.vulframReceiveEvents(),
|
|
186
|
-
vulframTick: (timeMs, deltaMs) => raw.vulframTick(timeMs, deltaMs),
|
|
187
|
-
vulframGetProfiling: () => raw.vulframGetProfiling(),
|
|
188
|
-
vulframSendQueue: (buffer) => {
|
|
189
|
-
const data = Buffer.isBuffer(buffer) ? buffer : Buffer.from(buffer);
|
|
190
|
-
return raw.vulframSendQueue(data);
|
|
191
|
-
},
|
|
192
|
-
vulframUploadBuffer: (id, uploadType, buffer) => {
|
|
193
|
-
const data = Buffer.isBuffer(buffer) ? buffer : Buffer.from(buffer);
|
|
194
|
-
return raw.vulframUploadBuffer(id, uploadType, data);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
// src/index.ts
|
|
199
|
-
var transportNapi = () => VULFRAM_CORE;
|
|
200
|
-
export {
|
|
201
|
-
transportNapi
|
|
202
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Environment setup & latest features
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "Preserve",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Best practices
|
|
18
|
-
"strict": true,
|
|
19
|
-
"skipLibCheck": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"noUncheckedIndexedAccess": true,
|
|
22
|
-
"noImplicitOverride": true,
|
|
23
|
-
|
|
24
|
-
// Some stricter flags (disabled by default)
|
|
25
|
-
"noUnusedLocals": false,
|
|
26
|
-
"noUnusedParameters": false,
|
|
27
|
-
"noPropertyAccessFromIndexSignature": false
|
|
28
|
-
}
|
|
29
|
-
}
|