@ruby/wasm-wasi 2.7.1 → 2.7.2

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.
@@ -773,7 +773,13 @@
773
773
  vm.addToImports(imports);
774
774
  (_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
775
775
  const instance = await WebAssembly.instantiate(module, imports);
776
- await vm.setInstance(instance);
776
+ try {
777
+ await vm.setInstance(instance);
778
+ }
779
+ catch (e) {
780
+ console.error("Failed to instantiate Ruby VM. Please make sure that you have added `gem \"js\"` to your Gemfile.");
781
+ throw e;
782
+ }
777
783
  (_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
778
784
  wasip1.initialize(instance);
779
785
  vm.initialize(options.args);
@@ -731,7 +731,13 @@
731
731
  vm.addToImports(imports);
732
732
  (_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
733
733
  const instance = await WebAssembly.instantiate(module, imports);
734
- await vm.setInstance(instance);
734
+ try {
735
+ await vm.setInstance(instance);
736
+ }
737
+ catch (e) {
738
+ console.error("Failed to instantiate Ruby VM. Please make sure that you have added `gem \"js\"` to your Gemfile.");
739
+ throw e;
740
+ }
735
741
  (_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
736
742
  wasip1.initialize(instance);
737
743
  vm.initialize(options.args);
package/dist/cjs/vm.js CHANGED
@@ -36,7 +36,13 @@ class RubyVM {
36
36
  vm.addToImports(imports);
37
37
  (_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
38
38
  const instance = await WebAssembly.instantiate(module, imports);
39
- await vm.setInstance(instance);
39
+ try {
40
+ await vm.setInstance(instance);
41
+ }
42
+ catch (e) {
43
+ console.error("Failed to instantiate Ruby VM. Please make sure that you have added `gem \"js\"` to your Gemfile.");
44
+ throw e;
45
+ }
40
46
  (_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
41
47
  wasip1.initialize(instance);
42
48
  vm.initialize(options.args);
package/dist/esm/vm.js CHANGED
@@ -32,7 +32,13 @@ export class RubyVM {
32
32
  vm.addToImports(imports);
33
33
  (_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
34
34
  const instance = await WebAssembly.instantiate(module, imports);
35
- await vm.setInstance(instance);
35
+ try {
36
+ await vm.setInstance(instance);
37
+ }
38
+ catch (e) {
39
+ console.error("Failed to instantiate Ruby VM. Please make sure that you have added `gem \"js\"` to your Gemfile.");
40
+ throw e;
41
+ }
36
42
  (_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
37
43
  wasip1.initialize(instance);
38
44
  vm.initialize(options.args);
package/dist/index.umd.js CHANGED
@@ -721,7 +721,13 @@
721
721
  vm.addToImports(imports);
722
722
  (_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
723
723
  const instance = await WebAssembly.instantiate(module, imports);
724
- await vm.setInstance(instance);
724
+ try {
725
+ await vm.setInstance(instance);
726
+ }
727
+ catch (e) {
728
+ console.error("Failed to instantiate Ruby VM. Please make sure that you have added `gem \"js\"` to your Gemfile.");
729
+ throw e;
730
+ }
725
731
  (_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
726
732
  wasip1.initialize(instance);
727
733
  vm.initialize(options.args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruby/wasm-wasi",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "WebAssembly port of CRuby with WASI",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -54,11 +54,11 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@bytecodealliance/jco": "1.8.1",
57
- "@rollup/plugin-typescript": "^12.1.1",
58
- "@types/node": "22.10.1",
59
- "prettier": "^3.4.1",
60
- "typescript": "^5.7.2",
61
- "vitest": "^2.1.6"
57
+ "@rollup/plugin-typescript": "^12.1.4",
58
+ "@types/node": "24.1.0",
59
+ "prettier": "^3.6.2",
60
+ "typescript": "^5.9.2",
61
+ "vitest": "^3.2.4"
62
62
  },
63
63
  "dependencies": {
64
64
  "@bjorn3/browser_wasi_shim": "^0.3.0",