Socket
Book a DemoSign in
Socket

@bytecodealliance/componentize-js

Package Overview
Dependencies
Maintainers
4
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bytecodealliance/componentize-js - npm Package Compare versions

Comparing version
0.18.4-rc.0
to
0.18.4-rc.1
+3
-3
lib/interfaces/loc...ermonkey-embedding-splicer-splicer.d.ts
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>,

{
"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",

#! /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