Socket
Socket
Sign inDemoInstall

@bytecodealliance/jco

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bytecodealliance/jco - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

8

obj/interfaces/wasi-filesystem-types.d.ts

@@ -148,2 +148,6 @@ export namespace WasiFilesystemTypes {

export class DirectoryEntryStream {
readDirectoryEntry(): DirectoryEntry | undefined;
}
export class Descriptor {

@@ -161,5 +165,1 @@ readViaStream(offset: Filesize): InputStream;

}
export class DirectoryEntryStream {
readDirectoryEntry(): DirectoryEntry | undefined;
}

@@ -16,7 +16,2 @@ export namespace WasiIoStreams {

export class InputStream {
read(len: bigint): Uint8Array;
blockingRead(len: bigint): Uint8Array;
}
export class OutputStream {

@@ -28,1 +23,6 @@ checkWrite(): bigint;

}
export class InputStream {
read(len: bigint): Uint8Array;
blockingRead(len: bigint): Uint8Array;
}

@@ -10,2 +10,15 @@ export type Files = [string, Uint8Array][];

}
export type BindingsMode = BindingsModeJs | BindingsModeHybrid | BindingsModeOptimized | BindingsModeDirectOptimized;
export interface BindingsModeJs {
tag: 'js',
}
export interface BindingsModeHybrid {
tag: 'hybrid',
}
export interface BindingsModeOptimized {
tag: 'optimized',
}
export interface BindingsModeDirectOptimized {
tag: 'direct-optimized',
}
export interface GenerateOptions {

@@ -15,2 +28,3 @@ name: string,

instantiation?: InstantiationMode,
importBindings?: BindingsMode,
map?: Maps,

@@ -17,0 +31,0 @@ compat?: boolean,

{
"name": "@bytecodealliance/jco",
"version": "1.0.2",
"version": "1.0.3",
"description": "JavaScript tooling for working with WebAssembly Components",

@@ -21,9 +21,9 @@ "author": "Guy Bedford",

"dependencies": {
"@bytecodealliance/preview2-shim": "0.15.1",
"binaryen": "^111.0.0",
"chalk-template": "^0.4.0",
"commander": "^9.4.1",
"mkdirp": "^1.0.4",
"ora": "^6.1.2",
"terser": "^5.16.1"
"@bytecodealliance/preview2-shim": "0.16.0",
"binaryen": "^116.0.0",
"chalk-template": "^1",
"commander": "^12",
"mkdirp": "^3",
"ora": "^8",
"terser": "^5"
},

@@ -30,0 +30,0 @@ "devDependencies": {

@@ -23,3 +23,3 @@ <div align="center">

JCO provides a fully native JS toolchain for working with [WebAssembly Components](https://github.com/WebAssembly/component-model) in JavaScript.
Jco provides a fully native JS toolchain for working with [WebAssembly Components](https://github.com/WebAssembly/component-model) in JavaScript.

@@ -44,3 +44,3 @@ Features include:

JCO can be used as either a library import or as a CLI via the `jco` command.
Jco can be used as either a library import or as a CLI via the `jco` command.

@@ -47,0 +47,0 @@ ## Example

import { readFile, writeFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import c from 'chalk-template';
import { isWindows } from '../common.js';

@@ -17,2 +16,3 @@ export async function componentize (jsSource, opts) {

const { component, imports } = await componentizeFn(source, {
sourceName: jsSource,
witPath: resolve(opts.wit),

@@ -19,0 +19,0 @@ worldName: opts.worldName,

@@ -5,3 +5,3 @@ import { getTmpDir } from '../common.js';

import { basename, resolve, extname } from 'node:path';
import { fork } from 'node:child_process';
import { spawn } from 'node:child_process';
import process from 'node:process';

@@ -79,3 +79,4 @@ import { fileURLToPath, pathToFileURL } from 'node:url';

tracing: opts.jcoTrace,
map: opts.jcoMap
map: opts.jcoMap,
importBindings: opts.jcoImportBindings,
});

@@ -117,2 +118,3 @@ }

${jcoImport ? `import ${JSON.stringify(pathToFileURL(jcoImport))}` : ''}
import process from 'node:process';
try {

@@ -125,4 +127,6 @@ process.argv[1] = "${name}";

const nodePath = process.env.JCO_RUN_PATH || process.argv[0];
process.exitCode = await new Promise((resolve, reject) => {
const cp = fork(runPath, args, { stdio: 'inherit' });
const cp = spawn(nodePath, [...process.env.JCO_RUN_ARGS ? process.env.JCO_RUN_ARGS.split(' ') : [], runPath, ...args], { stdio: 'inherit' });

@@ -129,0 +133,0 @@ cp.on('error', reject);

@@ -83,2 +83,3 @@ import { $init, generate } from '../../obj/js-component-bindgen-component.js';

* instantiation?: 'async' | 'sync',
* importBindings?: 'js' | 'optimized', 'hybrid', 'direct-optimized',
* map?: Record<string, string>,

@@ -137,2 +138,3 @@ * validLiftingOptimization?: bool,

instantiation,
importBindings: opts.importBindings ? { tag: opts.importBindings } : null,
validLiftingOptimization: opts.validLiftingOptimization ?? false,

@@ -139,0 +141,0 @@ tracing: opts.tracing ?? false,

@@ -14,3 +14,3 @@ #!/usr/bin/env node

.usage('<command> [options]')
.version('1.0.2');
.version('1.0.3');

@@ -42,2 +42,3 @@ function myParseInt(value) {

.option('--valid-lifting-optimization', 'optimize component binary validations assuming all lifted values are valid')
.addOption(new Option('--import-bindings [mode]', 'bindings mode for imports').choices(['js', 'optimized', 'hybrid', 'direct-optimized']).preset('js'))
.option('--tracing', 'emit `tracing` calls on function entry/exit')

@@ -69,2 +70,3 @@ .option('-b, --base64-cutoff <bytes>', 'set the byte size under which core Wasm binaries will be inlined as base64', myParseInt)

.option('--jco-map <mappings...>', 'specifier=./output custom mappings for the component imports')
.addOption(new Option('--jco-import-bindings [mode]', 'bindings mode for imports').choices(['js', 'optimized', 'hybrid', 'direct-optimized']).preset('js'))
.argument('[args...]', 'Any CLI arguments for the component')

@@ -92,2 +94,3 @@ .action(asyncAction(async function run (cmd, args, opts, command) {

.option('--jco-import <module>', 'Custom module to import before the server executes to support custom environment setup')
.addOption(new Option('--jco-import-bindings [mode]', 'bindings mode for imports').choices(['js', 'optimized', 'hybrid', 'direct-optimized']).preset('js'))
.option('--jco-map <mappings...>', 'specifier=./output custom mappings for the component imports')

@@ -94,0 +97,0 @@ .argument('[args...]', 'Any CLI arguments for the component')

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

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 too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc