@bytecodealliance/jco 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/wasi_snapshot_preview1.command.wasm +0 -0
- package/lib/wasi_snapshot_preview1.reactor.wasm +0 -0
- package/obj/interfaces/wasi-io-streams.d.ts +5 -5
- package/obj/js-component-bindgen-component.component.wasm +0 -0
- package/obj/js-component-bindgen-component.core.wasm +0 -0
- package/obj/js-component-bindgen-component.core2.wasm +0 -0
- package/obj/js-component-bindgen-component.d.ts +14 -0
- package/obj/js-component-bindgen-component.js +1008 -752
- package/obj/wasm-tools.component.wasm +0 -0
- package/obj/wasm-tools.core.wasm +0 -0
- package/obj/wasm-tools.core2.wasm +0 -0
- package/obj/wasm-tools.js +1212 -935
- package/package.json +10 -10
- package/src/cmd/componentize.js +2 -2
- package/src/cmd/run.js +7 -3
- package/src/cmd/transpile.js +2 -0
- package/src/jco.js +4 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
## Overview
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Jco provides a fully native JS toolchain for working with [WebAssembly Components](https://github.com/WebAssembly/component-model) in JavaScript.
|
|
24
24
|
|
|
25
25
|
Features include:
|
|
26
26
|
|
|
@@ -40,7 +40,7 @@ For creating components in other languages, see the [Cargo Component](https://gi
|
|
|
40
40
|
npm install @bytecodealliance/jco
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Jco can be used as either a library import or as a CLI via the `jco` command.
|
|
44
44
|
|
|
45
45
|
## Example
|
|
46
46
|
|
|
@@ -96,7 +96,7 @@ fn();
|
|
|
96
96
|
Imports can be remapped using the `--map` flag, or to provide imports as an argument use the `--instantiation` option.
|
|
97
97
|
|
|
98
98
|
Components relying on WASI bindings will contain external WASI imports, which are automatically updated
|
|
99
|
-
to the `@bytecodealliance/
|
|
99
|
+
to the `@bytecodealliance/preview2-shim` package. This package can be installed from npm separately for
|
|
100
100
|
runtime usage. This shim layer supports both Node.js and browsers.
|
|
101
101
|
|
|
102
102
|
Options include:
|
|
Binary file
|
|
Binary file
|
|
@@ -13,14 +13,14 @@ export interface StreamErrorClosed {
|
|
|
13
13
|
tag: 'closed',
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export class InputStream {
|
|
17
|
-
read(len: bigint): Uint8Array;
|
|
18
|
-
blockingRead(len: bigint): Uint8Array;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
16
|
export class OutputStream {
|
|
22
17
|
checkWrite(): bigint;
|
|
23
18
|
write(contents: Uint8Array): void;
|
|
24
19
|
blockingWriteAndFlush(contents: Uint8Array): void;
|
|
25
20
|
blockingFlush(): void;
|
|
26
21
|
}
|
|
22
|
+
|
|
23
|
+
export class InputStream {
|
|
24
|
+
read(len: bigint): Uint8Array;
|
|
25
|
+
blockingRead(len: bigint): Uint8Array;
|
|
26
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -7,10 +7,24 @@ export interface InstantiationModeAsync {
|
|
|
7
7
|
export interface InstantiationModeSync {
|
|
8
8
|
tag: 'sync',
|
|
9
9
|
}
|
|
10
|
+
export type BindingsMode = BindingsModeJs | BindingsModeHybrid | BindingsModeOptimized | BindingsModeDirectOptimized;
|
|
11
|
+
export interface BindingsModeJs {
|
|
12
|
+
tag: 'js',
|
|
13
|
+
}
|
|
14
|
+
export interface BindingsModeHybrid {
|
|
15
|
+
tag: 'hybrid',
|
|
16
|
+
}
|
|
17
|
+
export interface BindingsModeOptimized {
|
|
18
|
+
tag: 'optimized',
|
|
19
|
+
}
|
|
20
|
+
export interface BindingsModeDirectOptimized {
|
|
21
|
+
tag: 'direct-optimized',
|
|
22
|
+
}
|
|
10
23
|
export interface GenerateOptions {
|
|
11
24
|
name: string,
|
|
12
25
|
noTypescript?: boolean,
|
|
13
26
|
instantiation?: InstantiationMode,
|
|
27
|
+
importBindings?: BindingsMode,
|
|
14
28
|
map?: Maps,
|
|
15
29
|
compat?: boolean,
|
|
16
30
|
noNodejsCompat?: boolean,
|