From 0d3f0ad0420cb892dcb460f38d6e479f16c9dd15 Mon Sep 17 00:00:00 2001 From: terrablue <102580937+terrablue@users.noreply.github.com> Date: Sat, 10 Aug 2024 15:08:08 +0200 Subject: [PATCH] ruby: reexpose default vm --- packages/ruby/package.json | 2 +- packages/ruby/src/default-ruby-vm.js | 1 + packages/ruby/src/private/build.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 packages/ruby/src/default-ruby-vm.js diff --git a/packages/ruby/package.json b/packages/ruby/package.json index 0e2c6a75..7b9bef23 100644 --- a/packages/ruby/package.json +++ b/packages/ruby/package.json @@ -1,6 +1,6 @@ { "name": "@primate/ruby", - "version": "0.1.2", + "version": "0.1.3", "description": "Primate Ruby backend", "homepage": "https://primatejs.com/modules/ruby", "bugs": "https://github.com/primatejs/primate/issues", diff --git a/packages/ruby/src/default-ruby-vm.js b/packages/ruby/src/default-ruby-vm.js new file mode 100644 index 00000000..9d9bfa7c --- /dev/null +++ b/packages/ruby/src/default-ruby-vm.js @@ -0,0 +1 @@ +export { DefaultRubyVM as default } from "@ruby/wasm-wasi/dist/node"; diff --git a/packages/ruby/src/private/build.js b/packages/ruby/src/private/build.js index 6335460e..75a71709 100644 --- a/packages/ruby/src/private/build.js +++ b/packages/ruby/src/private/build.js @@ -50,11 +50,11 @@ end`); return ` import to_response from "@primate/ruby/to-response"; import helpers from "@primate/ruby/helpers"; - import { DefaultRubyVM } from "@ruby/wasm-wasi/dist/node"; + import default_ruby_vm from "@primate/ruby/default-ruby-vm"; import ruby from "@primate/ruby/ruby"; - import file from "@rcompat/fs/file"; + import file from "primate/runtime/file"; -const { vm } = await DefaultRubyVM(ruby); +const { vm } = await default_ruby_vm(ruby); const code = await file(${JSON.stringify(path)}).text(); const wrappers = ${JSON.stringify(create_ruby_wrappers(routes))}; const request = ${JSON.stringify(request