@vulfram/transport-napi 0.5.5-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 ADDED
@@ -0,0 +1,91 @@
1
+ import { createRequire } from "node:module";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
18
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
+
21
+ // lib/macos-arm64/vulfram_core.node
22
+ var require_vulfram_core = __commonJS((exports, module) => {
23
+ module.exports = __require("./vulfram_core-mkbsehf3.node");
24
+ });
25
+
26
+ // lib/macos-x64/vulfram_core.node
27
+ var require_vulfram_core2 = __commonJS((exports, module) => {
28
+ module.exports = __require("./vulfram_core-5c9z7prr.node");
29
+ });
30
+
31
+ // lib/linux-arm64/vulfram_core.node
32
+ var require_vulfram_core3 = __commonJS((exports, module) => {
33
+ module.exports = __require("./vulfram_core-br8kkbd0.node");
34
+ });
35
+
36
+ // lib/linux-x64/vulfram_core.node
37
+ var require_vulfram_core4 = __commonJS((exports, module) => {
38
+ module.exports = __require("./vulfram_core-y5t2jf4z.node");
39
+ });
40
+
41
+ // lib/windows-arm64/vulfram_core.node
42
+ var require_vulfram_core5 = __commonJS((exports, module) => {
43
+ module.exports = __require("./vulfram_core-2h16c4fp.node");
44
+ });
45
+
46
+ // lib/windows-x64/vulfram_core.node
47
+ var require_vulfram_core6 = __commonJS((exports, module) => {
48
+ module.exports = __require("./vulfram_core-p7mtx72t.node");
49
+ });
50
+
51
+ // src/bind/utils.ts
52
+ function detectRuntime() {
53
+ if (typeof globalThis.Deno !== "undefined" && typeof globalThis.Deno?.version?.deno === "string") {
54
+ return { runtime: "deno", version: globalThis.Deno.version.deno };
55
+ }
56
+ if (typeof globalThis.Bun !== "undefined" && typeof globalThis.Bun?.version === "string") {
57
+ return { runtime: "bun", version: globalThis.Bun.version };
58
+ }
59
+ if (typeof globalThis.process !== "undefined" && typeof globalThis.process?.versions?.node === "string") {
60
+ return { runtime: "node", version: globalThis.process.versions.node };
61
+ }
62
+ return { runtime: "unknown", version: null };
63
+ }
64
+
65
+ // src/bind/napi-loader.ts
66
+ var loaders = {
67
+ darwin: {
68
+ arm64: () => Promise.resolve().then(() => __toESM(require_vulfram_core(), 1)),
69
+ x64: () => Promise.resolve().then(() => __toESM(require_vulfram_core2(), 1))
70
+ },
71
+ linux: {
72
+ arm64: () => Promise.resolve().then(() => __toESM(require_vulfram_core3(), 1)),
73
+ x64: () => Promise.resolve().then(() => __toESM(require_vulfram_core4(), 1))
74
+ },
75
+ win32: {
76
+ arm64: () => Promise.resolve().then(() => __toESM(require_vulfram_core5(), 1)),
77
+ x64: () => Promise.resolve().then(() => __toESM(require_vulfram_core6(), 1))
78
+ }
79
+ };
80
+ var importLoader = loaders[process.platform]?.[process.arch];
81
+ if (!importLoader) {
82
+ throw new Error(`FFI build not found for the current runtime: ${JSON.stringify(detectRuntime())}`);
83
+ }
84
+ var lib = await importLoader().then((mod) => mod.default);
85
+ var VULFRAM_CORE = lib;
86
+
87
+ // src/index.ts
88
+ var transportNapi = () => VULFRAM_CORE;
89
+ export {
90
+ transportNapi
91
+ };
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@vulfram/transport-napi",
3
+ "version": "0.5.5-alpha",
4
+ "type": "module",
5
+ "types": "dist/index.d.ts",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "scripts": {
9
+ "build": "bun scripts/bun-bundle.ts"
10
+ },
11
+ "dependencies": {
12
+ "@vulfram/transport-types": "^0.2.1",
13
+ "glob": "^13.0.0",
14
+ "msgpackr": "^1.11.8"
15
+ },
16
+ "devDependencies": {
17
+ "@types/bun": "^1.3.6"
18
+ }
19
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,29 @@
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
+ }