@ruby/wasm-wasi 2.7.1-2025-02-27-a → 2.7.1-2025-03-01-a
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/browser.script.umd.js +8 -8
- package/dist/browser.umd.js +7 -7
- package/dist/index.umd.js +3 -3
- package/package.json +5 -5
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
if (m) return m.call(o);
|
|
27
27
|
if (o && typeof o.length === "number") return {
|
|
28
28
|
next: function () {
|
|
29
|
-
if (o && i >= o.length) o =
|
|
29
|
+
if (o && i >= o.length) o = void 0;
|
|
30
30
|
return { value: o && o[i++], done: !o };
|
|
31
31
|
}
|
|
32
32
|
};
|
|
@@ -771,7 +771,7 @@
|
|
|
771
771
|
wasi_snapshot_preview1: wasip1.wasiImport,
|
|
772
772
|
};
|
|
773
773
|
vm.addToImports(imports);
|
|
774
|
-
(_a = options.addToImports) === null || _a ===
|
|
774
|
+
(_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
|
|
775
775
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
776
776
|
try {
|
|
777
777
|
await vm.setInstance(instance);
|
|
@@ -780,7 +780,7 @@
|
|
|
780
780
|
console.error("Failed to instantiate Ruby VM. Please make sure that you have added `gem \"js\"` to your Gemfile.");
|
|
781
781
|
throw e;
|
|
782
782
|
}
|
|
783
|
-
(_b = options.setMemory) === null || _b ===
|
|
783
|
+
(_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
|
|
784
784
|
wasip1.initialize(instance);
|
|
785
785
|
vm.initialize(options.args);
|
|
786
786
|
return { vm, instance };
|
|
@@ -899,7 +899,7 @@
|
|
|
899
899
|
}
|
|
900
900
|
return exports;
|
|
901
901
|
};
|
|
902
|
-
this.guest = proxyExports(binding !== null && binding !==
|
|
902
|
+
this.guest = proxyExports(binding !== null && binding !== void 0 ? binding : new LegacyBinding());
|
|
903
903
|
this.transport = new JsValueTransport();
|
|
904
904
|
this.exceptionFormatter = new RbExceptionFormatter();
|
|
905
905
|
}
|
|
@@ -1568,7 +1568,7 @@
|
|
|
1568
1568
|
const DefaultRubyVM = async (rubyModule, options = {}) => {
|
|
1569
1569
|
var _a, _b;
|
|
1570
1570
|
const args = [];
|
|
1571
|
-
const env = Object.entries((_a = options.env) !== null && _a !==
|
|
1571
|
+
const env = Object.entries((_a = options.env) !== null && _a !== void 0 ? _a : {}).map(([k, v]) => `${k}=${v}`);
|
|
1572
1572
|
const fds = [
|
|
1573
1573
|
new OpenFile(new File([])),
|
|
1574
1574
|
new OpenFile(new File([])),
|
|
@@ -1576,14 +1576,14 @@
|
|
|
1576
1576
|
new PreopenDirectory("/", new Map()),
|
|
1577
1577
|
];
|
|
1578
1578
|
const wasi = new WASI(args, env, fds, { debug: false });
|
|
1579
|
-
const printer = ((_b = options.consolePrint) !== null && _b !==
|
|
1579
|
+
const printer = ((_b = options.consolePrint) !== null && _b !== void 0 ? _b : true) ? consolePrinter() : undefined;
|
|
1580
1580
|
const { vm, instance } = await RubyVM.instantiateModule({
|
|
1581
1581
|
module: rubyModule, wasip1: wasi,
|
|
1582
1582
|
addToImports: (imports) => {
|
|
1583
|
-
printer === null || printer ===
|
|
1583
|
+
printer === null || printer === void 0 ? void 0 : printer.addToImports(imports);
|
|
1584
1584
|
},
|
|
1585
1585
|
setMemory: (memory) => {
|
|
1586
|
-
printer === null || printer ===
|
|
1586
|
+
printer === null || printer === void 0 ? void 0 : printer.setMemory(memory);
|
|
1587
1587
|
}
|
|
1588
1588
|
});
|
|
1589
1589
|
return {
|
package/dist/browser.umd.js
CHANGED
|
@@ -729,7 +729,7 @@
|
|
|
729
729
|
wasi_snapshot_preview1: wasip1.wasiImport,
|
|
730
730
|
};
|
|
731
731
|
vm.addToImports(imports);
|
|
732
|
-
(_a = options.addToImports) === null || _a ===
|
|
732
|
+
(_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
|
|
733
733
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
734
734
|
try {
|
|
735
735
|
await vm.setInstance(instance);
|
|
@@ -738,7 +738,7 @@
|
|
|
738
738
|
console.error("Failed to instantiate Ruby VM. Please make sure that you have added `gem \"js\"` to your Gemfile.");
|
|
739
739
|
throw e;
|
|
740
740
|
}
|
|
741
|
-
(_b = options.setMemory) === null || _b ===
|
|
741
|
+
(_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
|
|
742
742
|
wasip1.initialize(instance);
|
|
743
743
|
vm.initialize(options.args);
|
|
744
744
|
return { vm, instance };
|
|
@@ -857,7 +857,7 @@
|
|
|
857
857
|
}
|
|
858
858
|
return exports;
|
|
859
859
|
};
|
|
860
|
-
this.guest = proxyExports(binding !== null && binding !==
|
|
860
|
+
this.guest = proxyExports(binding !== null && binding !== void 0 ? binding : new LegacyBinding());
|
|
861
861
|
this.transport = new JsValueTransport();
|
|
862
862
|
this.exceptionFormatter = new RbExceptionFormatter();
|
|
863
863
|
}
|
|
@@ -1526,7 +1526,7 @@
|
|
|
1526
1526
|
const DefaultRubyVM = async (rubyModule, options = {}) => {
|
|
1527
1527
|
var _a, _b;
|
|
1528
1528
|
const args = [];
|
|
1529
|
-
const env = Object.entries((_a = options.env) !== null && _a !==
|
|
1529
|
+
const env = Object.entries((_a = options.env) !== null && _a !== void 0 ? _a : {}).map(([k, v]) => `${k}=${v}`);
|
|
1530
1530
|
const fds = [
|
|
1531
1531
|
new OpenFile(new File([])),
|
|
1532
1532
|
new OpenFile(new File([])),
|
|
@@ -1534,14 +1534,14 @@
|
|
|
1534
1534
|
new PreopenDirectory("/", new Map()),
|
|
1535
1535
|
];
|
|
1536
1536
|
const wasi = new WASI(args, env, fds, { debug: false });
|
|
1537
|
-
const printer = ((_b = options.consolePrint) !== null && _b !==
|
|
1537
|
+
const printer = ((_b = options.consolePrint) !== null && _b !== void 0 ? _b : true) ? consolePrinter() : undefined;
|
|
1538
1538
|
const { vm, instance } = await RubyVM.instantiateModule({
|
|
1539
1539
|
module: rubyModule, wasip1: wasi,
|
|
1540
1540
|
addToImports: (imports) => {
|
|
1541
|
-
printer === null || printer ===
|
|
1541
|
+
printer === null || printer === void 0 ? void 0 : printer.addToImports(imports);
|
|
1542
1542
|
},
|
|
1543
1543
|
setMemory: (memory) => {
|
|
1544
|
-
printer === null || printer ===
|
|
1544
|
+
printer === null || printer === void 0 ? void 0 : printer.setMemory(memory);
|
|
1545
1545
|
}
|
|
1546
1546
|
});
|
|
1547
1547
|
return {
|
package/dist/index.umd.js
CHANGED
|
@@ -719,7 +719,7 @@
|
|
|
719
719
|
wasi_snapshot_preview1: wasip1.wasiImport,
|
|
720
720
|
};
|
|
721
721
|
vm.addToImports(imports);
|
|
722
|
-
(_a = options.addToImports) === null || _a ===
|
|
722
|
+
(_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
|
|
723
723
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
724
724
|
try {
|
|
725
725
|
await vm.setInstance(instance);
|
|
@@ -728,7 +728,7 @@
|
|
|
728
728
|
console.error("Failed to instantiate Ruby VM. Please make sure that you have added `gem \"js\"` to your Gemfile.");
|
|
729
729
|
throw e;
|
|
730
730
|
}
|
|
731
|
-
(_b = options.setMemory) === null || _b ===
|
|
731
|
+
(_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
|
|
732
732
|
wasip1.initialize(instance);
|
|
733
733
|
vm.initialize(options.args);
|
|
734
734
|
return { vm, instance };
|
|
@@ -847,7 +847,7 @@
|
|
|
847
847
|
}
|
|
848
848
|
return exports;
|
|
849
849
|
};
|
|
850
|
-
this.guest = proxyExports(binding !== null && binding !==
|
|
850
|
+
this.guest = proxyExports(binding !== null && binding !== void 0 ? binding : new LegacyBinding());
|
|
851
851
|
this.transport = new JsValueTransport();
|
|
852
852
|
this.exceptionFormatter = new RbExceptionFormatter();
|
|
853
853
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruby/wasm-wasi",
|
|
3
|
-
"version": "2.7.1-2025-
|
|
3
|
+
"version": "2.7.1-2025-03-01-a",
|
|
4
4
|
"description": "WebAssembly port of CRuby with WASI",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@bytecodealliance/jco": "1.8.1",
|
|
57
57
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
58
|
-
"@types/node": "22.13.
|
|
59
|
-
"prettier": "^3.
|
|
60
|
-
"typescript": "^5.
|
|
61
|
-
"vitest": "^3.0.
|
|
58
|
+
"@types/node": "22.13.7",
|
|
59
|
+
"prettier": "^3.5.2",
|
|
60
|
+
"typescript": "^5.8.2",
|
|
61
|
+
"vitest": "^3.0.7"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@bjorn3/browser_wasi_shim": "^0.3.0",
|