-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
109 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "@primate/ruby", | ||
"version": "0.1.0", | ||
"description": "Primate Ruby module", | ||
"homepage": "https://primatejs.com/modules/ruby", | ||
"bugs": "https://github.com/primatejs/primate/issues", | ||
"license": "MIT", | ||
"files": [ | ||
"src/**/*.rb", | ||
"src/**/*.js", | ||
"!src/**/*.spec.js" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/primatejs/primate", | ||
"directory": "packages/ruby" | ||
}, | ||
"dependencies": { | ||
"@primate/core": "workspace:^" | ||
}, | ||
"peerDependencies": { | ||
"@ruby/head-wasm-wasi": "2", | ||
"@ruby/wasm-wasi": "2", | ||
"primate": "workspace:^" | ||
}, | ||
"type": "module", | ||
"imports": { | ||
"#*": { | ||
"@primate/lt": "./src/private/*.js", | ||
"default": "./src/private/*.js" | ||
}, | ||
"#error/*": { | ||
"@primate/lt": "./src/private/error/*.js", | ||
"default": "./src/private/error/*.js" | ||
} | ||
}, | ||
"exports": { | ||
".": { | ||
"runtime": "./src/runtime.js", | ||
"default": "./src/default.js" | ||
}, | ||
"./*": "./src/*.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import build from "#build"; | ||
import default_extension from "#extension"; | ||
import name from "#name"; | ||
|
||
export default ({ extension = default_extension, packages = [] } = {}) => ({ | ||
name, | ||
build: build({ name, extension, packages }), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
export default { | ||
wrap(value) { | ||
if (typeof value === "number") { | ||
if (Number.isInteger(value)) { | ||
return "integer"; | ||
} | ||
return "float"; | ||
} | ||
if (typeof value === "boolean") { | ||
return "boolean"; | ||
} | ||
if (typeof value === "string") { | ||
return "string"; | ||
} | ||
|
||
if (typeof value === "object") { | ||
if (Array.isArray(value)) { | ||
return "array"; | ||
} | ||
|
||
if (value === "null") { | ||
return "nil"; | ||
} | ||
|
||
return "object"; | ||
} | ||
|
||
return undefined; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default ".rb"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default "@primate/ruby"; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import file from "@rcompat/fs/file"; | ||
import root from "@rcompat/package/root"; | ||
|
||
const ruby_path = (await root()) | ||
.join("node_modules/@ruby/head-wasm-wasi/dist/ruby+stdlib.wasm"); | ||
const ruby_wasm = await file(ruby_path).arrayBuffer(); | ||
|
||
export default await WebAssembly.compile(ruby_wasm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import name from "#name"; | ||
|
||
export default () => ({ name }); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json" | ||
} |