@bytecodealliance/componentize-js
Advanced tools
| export namespace LocalSpidermonkeyEmbeddingSplicerSplicer { | ||
| export function stubWasi(engine: Uint8Array, features: Array<Features>, witWorld: string | undefined, witPath: string | undefined, worldName: string | undefined): Uint8Array; | ||
| export function spliceBindings(spidermonkeyEngine: Uint8Array, features: Array<Features>, witWorld: string | undefined, witPath: string | undefined, worldName: string | undefined, debug: boolean): SpliceResult; | ||
| export function stubWasi(engine: Uint8Array, features: Array<Feature>, witWorld: string | undefined, witPath: string | undefined, worldName: string | undefined): Uint8Array; | ||
| export function spliceBindings(spidermonkeyEngine: Uint8Array, features: Array<Feature>, witWorld: string | undefined, witPath: string | undefined, worldName: string | undefined, debug: boolean): SpliceResult; | ||
| } | ||
@@ -30,3 +30,3 @@ /** | ||
| */ | ||
| export type Features = 'stdio' | 'clocks' | 'random' | 'http' | 'fetch-event'; | ||
| export type Feature = 'stdio' | 'clocks' | 'random' | 'http' | 'fetch-event'; | ||
| export interface CoreFn { | ||
@@ -33,0 +33,0 @@ params: Array<CoreTy>, |
+2
-2
| { | ||
| "name": "@bytecodealliance/componentize-js", | ||
| "version": "0.18.4-rc.0", | ||
| "version": "0.18.4-rc.1", | ||
| "homepage": "https://github.com/bytecodealliance/componentize-js#readme", | ||
@@ -25,3 +25,3 @@ "description": "ESM -> WebAssembly Component creator, via a SpiderMonkey JS engine embedding", | ||
| "@bytecodealliance/jco": "^1.9.1", | ||
| "@bytecodealliance/weval": "^0.3.3", | ||
| "@bytecodealliance/weval": "^0.3.4", | ||
| "@bytecodealliance/wizer": "^7.0.5", | ||
@@ -28,0 +28,0 @@ "es-module-lexer": "^1.6.0", |
+18
-9
| #! /usr/bin/env node | ||
| import { program, Option } from 'commander'; | ||
| import { componentize } from "./componentize.js"; | ||
| import { componentize, DEFAULT_FEATURES } from './componentize.js'; | ||
| import { writeFile } from 'node:fs/promises'; | ||
| import { resolve } from 'node:path'; | ||
| export async function componentizeCmd (jsSource, opts) { | ||
| const { component } = await componentize( { | ||
| export async function componentizeCmd(jsSource, opts) { | ||
| const { component } = await componentize({ | ||
| sourcePath: jsSource, | ||
@@ -25,3 +25,3 @@ witPath: resolve(opts.wit), | ||
| program | ||
| .version('0.18.4-rc.0') | ||
| .version('0.18.4-rc.1') | ||
| .description('Create a component from a JavaScript module') | ||
@@ -34,11 +34,20 @@ .usage('<js-source> --wit wit-world.wit -o <component-path>') | ||
| .option('--aot', 'enable AOT compilation') | ||
| .addOption(new Option('-d, --disable <feature...>', 'disable WASI features').choices(['stdio', 'random', 'clocks', 'http'])) | ||
| .option('--preview2-adapter <adapter>', 'provide a custom preview2 adapter path') | ||
| .addOption( | ||
| new Option('-d, --disable <feature...>', 'disable WASI features').choices( | ||
| DEFAULT_FEATURES, | ||
| ), | ||
| ) | ||
| .option( | ||
| '--preview2-adapter <adapter>', | ||
| 'provide a custom preview2 adapter path', | ||
| ) | ||
| .option('--use-debug-build', 'use a debug build of StarlingMonkey') | ||
| .option('--debug-bindings', 'enable debug logging for bindings generation') | ||
| .option('--enable-wizer-logging', 'enable debug logging for calls in the generated component') | ||
| .option( | ||
| '--enable-wizer-logging', | ||
| 'enable debug logging for calls in the generated component', | ||
| ) | ||
| .requiredOption('-o, --out <out>', 'output component file') | ||
| .action(asyncAction(componentizeCmd)); | ||
| program.showHelpAfterError(); | ||
@@ -48,3 +57,3 @@ | ||
| function asyncAction (cmd) { | ||
| function asyncAction(cmd) { | ||
| return function () { | ||
@@ -51,0 +60,0 @@ const args = [...arguments]; |
@@ -64,3 +64,3 @@ import { freemem } from 'node:os'; | ||
| /** Features that are used by default if not explicitly disabled */ | ||
| const DEFAULT_FEATURES = ['stdio', 'random', 'clocks', 'http', 'fetch-event']; | ||
| export const DEFAULT_FEATURES = ['stdio', 'random', 'clocks', 'http', 'fetch-event']; | ||
@@ -67,0 +67,0 @@ export async function componentize( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
5149
0.19%7
-12.5%43212993
0