@bytecodealliance/jco 0.11.0 → 0.11.2
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 +15 -2
- package/lib/wasi_snapshot_preview1.command.wasm +0 -0
- package/lib/wasi_snapshot_preview1.reactor.wasm +0 -0
- package/obj/exports/local-wasm-tools-tools.d.ts +43 -0
- package/obj/exports/wasi-cli-terminal-input.d.ts +1 -1
- package/obj/exports/wasi-cli-terminal-output.d.ts +1 -1
- package/obj/exports/wasi-filesystem-types.d.ts +9 -9
- package/obj/exports/wasi-io-streams.d.ts +6 -6
- package/obj/imports/wasi-cli-environment.d.ts +1 -1
- package/obj/imports/wasi-cli-exit.d.ts +1 -1
- package/obj/imports/wasi-cli-stderr.d.ts +1 -1
- package/obj/imports/wasi-cli-stdin.d.ts +1 -1
- package/obj/imports/wasi-cli-stdout.d.ts +1 -1
- package/obj/imports/wasi-cli-terminal-input.d.ts +2 -2
- package/obj/imports/wasi-cli-terminal-output.d.ts +2 -2
- package/obj/imports/wasi-cli-terminal-stderr.d.ts +1 -1
- package/obj/imports/wasi-cli-terminal-stdin.d.ts +1 -1
- package/obj/imports/wasi-cli-terminal-stdout.d.ts +1 -1
- package/obj/imports/wasi-clocks-wall-clock.d.ts +1 -1
- package/obj/imports/wasi-filesystem-preopens.d.ts +1 -1
- package/obj/imports/wasi-filesystem-types.d.ts +10 -10
- package/obj/imports/wasi-io-streams.d.ts +7 -7
- package/obj/imports/wasi-random-random.d.ts +1 -1
- 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 +15 -15
- package/obj/js-component-bindgen-component.js +2 -2
- 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.d.ts +17 -56
- package/obj/wasm-tools.js +23 -12
- package/package.json +7 -4
- package/src/api.js +2 -1
- package/src/browser.js +3 -0
- package/src/cmd/opt.js +2 -1
- package/src/cmd/run.js +103 -0
- package/src/cmd/transpile.js +3 -2
- package/src/cmd/wasm-tools.js +10 -3
- package/src/jco.js +11 -1
- package/obj/exports/wasi-cli-base-environment.d.ts +0 -3
- package/obj/exports/wasi-cli-base-exit.d.ts +0 -4
- package/obj/exports/wasi-cli-base-preopens.d.ts +0 -5
- package/obj/exports/wasi-cli-base-stderr.d.ts +0 -5
- package/obj/exports/wasi-cli-base-stdin.d.ts +0 -5
- package/obj/exports/wasi-cli-base-stdout.d.ts +0 -5
- package/obj/exports/wasi-filesystem-filesystem.d.ts +0 -152
- package/obj/imports/wasi-cli-base-environment.d.ts +0 -3
- package/obj/imports/wasi-cli-base-exit.d.ts +0 -4
- package/obj/imports/wasi-cli-base-preopens.d.ts +0 -5
- package/obj/imports/wasi-cli-base-stderr.d.ts +0 -5
- package/obj/imports/wasi-cli-base-stdin.d.ts +0 -5
- package/obj/imports/wasi-cli-base-stdout.d.ts +0 -5
- package/obj/imports/wasi-filesystem-filesystem.d.ts +0 -152
- package/obj/interfaces/environment.d.ts +0 -3
- package/obj/interfaces/exit.d.ts +0 -4
- package/obj/interfaces/filesystem.d.ts +0 -152
- package/obj/interfaces/preopens.d.ts +0 -5
- package/obj/interfaces/random.d.ts +0 -3
- package/obj/interfaces/stderr.d.ts +0 -5
- package/obj/interfaces/stdin.d.ts +0 -5
- package/obj/interfaces/stdout.d.ts +0 -5
- package/obj/interfaces/streams.d.ts +0 -21
- package/obj/interfaces/wall-clock.d.ts +0 -6
- package/obj/interfaces/wasi-cli-base-environment.d.ts +0 -3
- package/obj/interfaces/wasi-cli-base-exit.d.ts +0 -4
- package/obj/interfaces/wasi-cli-base-preopens.d.ts +0 -5
- package/obj/interfaces/wasi-cli-base-stderr.d.ts +0 -5
- package/obj/interfaces/wasi-cli-base-stdin.d.ts +0 -5
- package/obj/interfaces/wasi-cli-base-stdout.d.ts +0 -5
- package/obj/interfaces/wasi-clocks-wall-clock.d.ts +0 -6
- package/obj/interfaces/wasi-filesystem-filesystem.d.ts +0 -152
- package/obj/interfaces/wasi-io-streams.d.ts +0 -21
- package/obj/interfaces/wasi-random-random.d.ts +0 -3
package/README.md
CHANGED
|
@@ -54,6 +54,7 @@ Options:
|
|
|
54
54
|
Commands:
|
|
55
55
|
componentize [options] <js-source> Create a component from a JavaScript module
|
|
56
56
|
transpile [options] <component-path> Transpile a WebAssembly Component to JS + core Wasm for JavaScript execution
|
|
57
|
+
run <command> [args...] Run a WebAssembly Command component
|
|
57
58
|
opt [options] <component-file> optimizes a Wasm component, including running wasm-opt Binaryen optimizations
|
|
58
59
|
wit [options] <component-path> extract the WIT from a WebAssembly Component [wasm-tools component wit]
|
|
59
60
|
print [options] <input> print the WebAssembly WAT text for a binary file [wasm-tools print]
|
|
@@ -98,7 +99,7 @@ Options include:
|
|
|
98
99
|
* `--js`: Converts core Wasm files to JavaScript for environments that don't even support core Wasm.
|
|
99
100
|
* `--base64-cutoff=<number>`: Sets the maximum number of bytes for inlining Wasm files into the JS using base64 encoding. Set to zero to disable base64 inlining entirely.
|
|
100
101
|
* `--no-wasi-shim`: Disable the WASI shim mapping to `@bytecodealliance/preview2-shim`.
|
|
101
|
-
* `--map`: Provide custom mappings for world imports. Supports both wildcard mappings (`*` similarly as in the package.json "exports" field) as well as `#` mappings for targetting exported interfaces. For example, the WASI mappings are internally defined with mappings like `--map wasi:filesystem/*=@bytecodealliance/preview2-shim/filesystem#*` to map `import as * filesystem from 'wasi:filesystem/
|
|
102
|
+
* `--map`: Provide custom mappings for world imports. Supports both wildcard mappings (`*` similarly as in the package.json "exports" field) as well as `#` mappings for targetting exported interfaces. For example, the WASI mappings are internally defined with mappings like `--map wasi:filesystem/*=@bytecodealliance/preview2-shim/filesystem#*` to map `import as * filesystem from 'wasi:filesystem/types'` to `import { types } from '@bytecodealliance/preview2-shim/filesystem`.
|
|
102
103
|
* `--no-nodejs-compat`: Disables Node.js compat in the output to load core Wasm with FS methods.
|
|
103
104
|
* `--instantiation`: Instead of a direct ES module, export an `instantiate` function which can take the imports as an argument instead of implicit imports.
|
|
104
105
|
* `--valid-lifting-optimization`: Internal validations are removed assuming that core Wasm binaries are valid components, providing a minor output size saving.
|
|
@@ -123,6 +124,18 @@ See [ComponentizeJS](https://github.com/bytecodealliance/componentize-js) for mo
|
|
|
123
124
|
|
|
124
125
|
> Additional engines may be supported in future via an `--engine` field or otherwise.
|
|
125
126
|
|
|
127
|
+
### Run
|
|
128
|
+
|
|
129
|
+
For Wasm components that implement the WASI Command world, a `jco run` utility is provided to run these applications in Node.js:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
jco run cowasy.component.wasm hello
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Using the preview2-shim WASI implementation, full access to the underlying system primitives is provided, including filesystem and environment variable permissions.
|
|
136
|
+
|
|
137
|
+
> Since [preview2-shim](packages/preview2-shim) is an experimental work-in-progress implementation, there will likely be bugs.
|
|
138
|
+
|
|
126
139
|
## API
|
|
127
140
|
|
|
128
141
|
#### `transpile(component: Uint8Array, opts?): Promise<{ files: Record<string, Uint8Array> }>`
|
|
@@ -178,4 +191,4 @@ See [LICENSE](LICENSE) for more details.
|
|
|
178
191
|
|
|
179
192
|
Unless you explicitly state otherwise, any contribution intentionally submitted
|
|
180
193
|
for inclusion in this project by you, as defined in the Apache-2.0 license,
|
|
181
|
-
shall be licensed as above, without any additional terms or conditions.
|
|
194
|
+
shall be licensed as above, without any additional terms or conditions.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export namespace LocalWasmToolsTools {
|
|
2
|
+
export function parse(wat: string): Uint8Array;
|
|
3
|
+
export function print(binary: Uint8Array | ArrayBuffer): string;
|
|
4
|
+
export function componentNew(binary: Uint8Array | ArrayBuffer, adapters: [string, Uint8Array | ArrayBuffer][] | null): Uint8Array;
|
|
5
|
+
export function componentWit(binary: Uint8Array | ArrayBuffer): string;
|
|
6
|
+
export function componentEmbed(embedOpts: EmbedOpts): Uint8Array;
|
|
7
|
+
export function metadataShow(binary: Uint8Array | ArrayBuffer): ModuleMetadata[];
|
|
8
|
+
export function metadataAdd(binary: Uint8Array | ArrayBuffer, metadata: ProducersFields): Uint8Array;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* # Variants
|
|
12
|
+
*
|
|
13
|
+
* ## `"utf8"`
|
|
14
|
+
*
|
|
15
|
+
* ## `"utf16"`
|
|
16
|
+
*
|
|
17
|
+
* ## `"compact-utf16"`
|
|
18
|
+
*/
|
|
19
|
+
export type StringEncoding = 'utf8' | 'utf16' | 'compact-utf16';
|
|
20
|
+
export type ProducersFields = [string, [string, string][]][];
|
|
21
|
+
export interface EmbedOpts {
|
|
22
|
+
binary?: Uint8Array,
|
|
23
|
+
witSource?: string,
|
|
24
|
+
witPath?: string,
|
|
25
|
+
stringEncoding?: StringEncoding,
|
|
26
|
+
dummy?: boolean,
|
|
27
|
+
world?: string,
|
|
28
|
+
metadata?: ProducersFields,
|
|
29
|
+
}
|
|
30
|
+
export type ModuleMetaType = ModuleMetaTypeModule | ModuleMetaTypeComponent;
|
|
31
|
+
export interface ModuleMetaTypeModule {
|
|
32
|
+
tag: 'module',
|
|
33
|
+
}
|
|
34
|
+
export interface ModuleMetaTypeComponent {
|
|
35
|
+
tag: 'component',
|
|
36
|
+
val: number,
|
|
37
|
+
}
|
|
38
|
+
export interface ModuleMetadata {
|
|
39
|
+
name?: string,
|
|
40
|
+
metaType: ModuleMetaType,
|
|
41
|
+
range: [number, number],
|
|
42
|
+
producers: ProducersFields,
|
|
43
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export namespace WasiFilesystemTypes {
|
|
2
|
-
export function readViaStream(
|
|
3
|
-
export function writeViaStream(
|
|
4
|
-
export function appendViaStream(
|
|
5
|
-
export function getType(
|
|
6
|
-
export function stat(
|
|
7
|
-
export function openAt(
|
|
8
|
-
export function dropDescriptor(
|
|
9
|
-
export function dropDirectoryEntryStream(
|
|
10
|
-
export function metadataHash(
|
|
2
|
+
export function readViaStream(this_: Descriptor, offset: Filesize): InputStream;
|
|
3
|
+
export function writeViaStream(this_: Descriptor, offset: Filesize): OutputStream;
|
|
4
|
+
export function appendViaStream(this_: Descriptor): OutputStream;
|
|
5
|
+
export function getType(this_: Descriptor): DescriptorType;
|
|
6
|
+
export function stat(this_: Descriptor): DescriptorStat;
|
|
7
|
+
export function openAt(this_: Descriptor, pathFlags: PathFlags, path: string, openFlags: OpenFlags, flags: DescriptorFlags, modes: Modes): Descriptor;
|
|
8
|
+
export function dropDescriptor(this_: Descriptor): void;
|
|
9
|
+
export function dropDirectoryEntryStream(this_: DirectoryEntryStream): void;
|
|
10
|
+
export function metadataHash(this_: Descriptor): MetadataHashValue;
|
|
11
11
|
}
|
|
12
12
|
export type Descriptor = number;
|
|
13
13
|
export type Filesize = bigint;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export namespace WasiIoStreams {
|
|
2
|
-
export function read(
|
|
3
|
-
export function blockingRead(
|
|
4
|
-
export function dropInputStream(
|
|
5
|
-
export function write(
|
|
6
|
-
export function blockingWrite(
|
|
7
|
-
export function dropOutputStream(
|
|
2
|
+
export function read(this_: InputStream, len: bigint): [Uint8Array, StreamStatus];
|
|
3
|
+
export function blockingRead(this_: InputStream, len: bigint): [Uint8Array, StreamStatus];
|
|
4
|
+
export function dropInputStream(this_: InputStream): void;
|
|
5
|
+
export function write(this_: OutputStream, buf: Uint8Array | ArrayBuffer): [bigint, StreamStatus];
|
|
6
|
+
export function blockingWrite(this_: OutputStream, buf: Uint8Array | ArrayBuffer): [bigint, StreamStatus];
|
|
7
|
+
export function dropOutputStream(this_: OutputStream): void;
|
|
8
8
|
}
|
|
9
9
|
export type InputStream = number;
|
|
10
10
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export namespace
|
|
2
|
-
export function readViaStream(
|
|
3
|
-
export function writeViaStream(
|
|
4
|
-
export function appendViaStream(
|
|
5
|
-
export function getType(
|
|
6
|
-
export function stat(
|
|
7
|
-
export function openAt(
|
|
8
|
-
export function dropDescriptor(
|
|
9
|
-
export function dropDirectoryEntryStream(
|
|
10
|
-
export function metadataHash(
|
|
1
|
+
export namespace WasiFilesystemTypes {
|
|
2
|
+
export function readViaStream(this_: Descriptor, offset: Filesize): InputStream;
|
|
3
|
+
export function writeViaStream(this_: Descriptor, offset: Filesize): OutputStream;
|
|
4
|
+
export function appendViaStream(this_: Descriptor): OutputStream;
|
|
5
|
+
export function getType(this_: Descriptor): DescriptorType;
|
|
6
|
+
export function stat(this_: Descriptor): DescriptorStat;
|
|
7
|
+
export function openAt(this_: Descriptor, pathFlags: PathFlags, path: string, openFlags: OpenFlags, flags: DescriptorFlags, modes: Modes): Descriptor;
|
|
8
|
+
export function dropDescriptor(this_: Descriptor): void;
|
|
9
|
+
export function dropDirectoryEntryStream(this_: DirectoryEntryStream): void;
|
|
10
|
+
export function metadataHash(this_: Descriptor): MetadataHashValue;
|
|
11
11
|
}
|
|
12
12
|
export type Descriptor = number;
|
|
13
13
|
export type Filesize = bigint;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export namespace
|
|
2
|
-
export function read(
|
|
3
|
-
export function blockingRead(
|
|
4
|
-
export function dropInputStream(
|
|
5
|
-
export function write(
|
|
6
|
-
export function blockingWrite(
|
|
7
|
-
export function dropOutputStream(
|
|
1
|
+
export namespace WasiIoStreams {
|
|
2
|
+
export function read(this_: InputStream, len: bigint): [Uint8Array | ArrayBuffer, StreamStatus];
|
|
3
|
+
export function blockingRead(this_: InputStream, len: bigint): [Uint8Array | ArrayBuffer, StreamStatus];
|
|
4
|
+
export function dropInputStream(this_: InputStream): void;
|
|
5
|
+
export function write(this_: OutputStream, buf: Uint8Array): [bigint, StreamStatus];
|
|
6
|
+
export function blockingWrite(this_: OutputStream, buf: Uint8Array): [bigint, StreamStatus];
|
|
7
|
+
export function dropOutputStream(this_: OutputStream): void;
|
|
8
8
|
}
|
|
9
9
|
export type InputStream = number;
|
|
10
10
|
/**
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -44,21 +44,21 @@ export interface Transpiled {
|
|
|
44
44
|
imports: string[],
|
|
45
45
|
exports: [string, ExportType][],
|
|
46
46
|
}
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
47
|
+
import { WasiCliEnvironment } from './imports/wasi-cli-environment';
|
|
48
|
+
import { WasiCliExit } from './imports/wasi-cli-exit';
|
|
49
|
+
import { WasiCliStderr } from './imports/wasi-cli-stderr';
|
|
50
|
+
import { WasiCliStdin } from './imports/wasi-cli-stdin';
|
|
51
|
+
import { WasiCliStdout } from './imports/wasi-cli-stdout';
|
|
52
|
+
import { WasiCliTerminalInput } from './imports/wasi-cli-terminal-input';
|
|
53
|
+
import { WasiCliTerminalOutput } from './imports/wasi-cli-terminal-output';
|
|
54
|
+
import { WasiCliTerminalStderr } from './imports/wasi-cli-terminal-stderr';
|
|
55
|
+
import { WasiCliTerminalStdin } from './imports/wasi-cli-terminal-stdin';
|
|
56
|
+
import { WasiCliTerminalStdout } from './imports/wasi-cli-terminal-stdout';
|
|
57
|
+
import { WasiClocksWallClock } from './imports/wasi-clocks-wall-clock';
|
|
58
|
+
import { WasiFilesystemPreopens } from './imports/wasi-filesystem-preopens';
|
|
59
|
+
import { WasiFilesystemTypes } from './imports/wasi-filesystem-types';
|
|
60
|
+
import { WasiIoStreams } from './imports/wasi-io-streams';
|
|
61
|
+
import { WasiRandomRandom } from './imports/wasi-random-random';
|
|
62
62
|
export function generate(component: Uint8Array | ArrayBuffer, options: GenerateOptions): Transpiled;
|
|
63
63
|
export function generateTypes(name: string, options: TypeGenerationOptions): Files;
|
|
64
64
|
|
|
@@ -2242,8 +2242,8 @@ let _initialized = false;
|
|
|
2242
2242
|
export const $init = (async() => {
|
|
2243
2243
|
const module0 = fetchCompile(new URL('./js-component-bindgen-component.core.wasm', import.meta.url));
|
|
2244
2244
|
const module1 = fetchCompile(new URL('./js-component-bindgen-component.core2.wasm', import.meta.url));
|
|
2245
|
-
const module2 = base64Compile('AGFzbQEAAAABUgxgAX8AYAN/fn8AYAJ/fwBgCH9/f39/f39/AGACfn8AYAR/f39/AGACf38Bf2AEf39/fwF/YAl/f39/f35+f38Bf2ABfwF/YAN/
|
|
2246
|
-
const module3 = base64Compile('AGFzbQEAAAABUgxgAX8AYAN/fn8AYAJ/fwBgCH9/f39/f39/AGACfn8AYAR/f39/AGACf38Bf2AEf39/fwF/YAl/f39/f35+f38Bf2ABfwF/YAN/
|
|
2245
|
+
const module2 = base64Compile('AGFzbQEAAAABUgxgAX8AYAN/fn8AYAJ/fwBgCH9/f39/f39/AGACfn8AYAR/f39/AGACf38Bf2AEf39/fwF/YAl/f39/f35+f38Bf2ABfwF/YAN/f38Bf2ABfwADHRwAAQECAgIDAgQAAQEFBQAAAAYHBwgGBgYJBgoLBAUBcAEcHAeOAR0BMAAAATEAAQEyAAIBMwADATQABAE1AAUBNgAGATcABwE4AAgBOQAJAjEwAAoCMTEACwIxMgAMAjEzAA0CMTQADgIxNQAPAjE2ABACMTcAEQIxOAASAjE5ABMCMjAAFAIyMQAVAjIyABYCMjMAFwIyNAAYAjI1ABkCMjYAGgIyNwAbCCRpbXBvcnRzAQAK9wIcCQAgAEEAEQAACw0AIAAgASACQQERAQALDQAgACABIAJBAhEBAAsLACAAIAFBAxECAAsLACAAIAFBBBECAAsLACAAIAFBBRECAAsXACAAIAEgAiADIAQgBSAGIAdBBhEDAAsLACAAIAFBBxECAAsLACAAIAFBCBEEAAsJACAAQQkRAAAL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/f39/AGACf38Bf2AEf39/fwF/YAl/f39/f35+f38Bf2ABfwF/YAN/f38Bf2ABfwACrgEdAAEwAAAAATEAAQABMgABAAEzAAIAATQAAgABNQACAAE2AAMAATcAAgABOAAEAAE5AAAAAjEwAAEAAjExAAEAAjEyAAUAAjEzAAUAAjE0AAAAAjE1AAAAAjE2AAAAAjE3AAYAAjE4AAcAAjE5AAcAAjIwAAgAAjIxAAYAAjIyAAYAAjIzAAYAAjI0AAkAAjI1AAYAAjI2AAoAAjI3AAsACCRpbXBvcnRzAXABHBwJIgEAQQALHAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhsALglwcm9kdWNlcnMBDHByb2Nlc3NlZC1ieQENd2l0LWNvbXBvbmVudAYwLjE0LjAAHARuYW1lABUUd2l0LWNvbXBvbmVudDpmaXh1cHM');
|
|
2247
2247
|
const instanceFlags0 = new WebAssembly.Global({ value: "i32", mutable: true }, 3);
|
|
2248
2248
|
Promise.all([module0, module1, module2, module3]).catch(() => {});
|
|
2249
2249
|
({ exports: exports0 } = await instantiateCore(await module2));
|
|
Binary file
|
package/obj/wasm-tools.core.wasm
CHANGED
|
Binary file
|
|
Binary file
|
package/obj/wasm-tools.d.ts
CHANGED
|
@@ -1,58 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
world?: string,
|
|
19
|
-
metadata?: ProducersFields,
|
|
20
|
-
}
|
|
21
|
-
export type ModuleMetaType = ModuleMetaTypeModule | ModuleMetaTypeComponent;
|
|
22
|
-
export interface ModuleMetaTypeModule {
|
|
23
|
-
tag: 'module',
|
|
24
|
-
}
|
|
25
|
-
export interface ModuleMetaTypeComponent {
|
|
26
|
-
tag: 'component',
|
|
27
|
-
val: number,
|
|
28
|
-
}
|
|
29
|
-
export interface ModuleMetadata {
|
|
30
|
-
name?: string,
|
|
31
|
-
metaType: ModuleMetaType,
|
|
32
|
-
range: [number, number],
|
|
33
|
-
producers: ProducersFields,
|
|
34
|
-
}
|
|
35
|
-
import { WasiCliEnvironment1 } from './imports/wasi-cli-environment';
|
|
36
|
-
import { WasiCliExit1 } from './imports/wasi-cli-exit';
|
|
37
|
-
import { WasiCliStderr1 } from './imports/wasi-cli-stderr';
|
|
38
|
-
import { WasiCliStdin1 } from './imports/wasi-cli-stdin';
|
|
39
|
-
import { WasiCliStdout1 } from './imports/wasi-cli-stdout';
|
|
40
|
-
import { WasiCliTerminalInput1 } from './imports/wasi-cli-terminal-input';
|
|
41
|
-
import { WasiCliTerminalOutput1 } from './imports/wasi-cli-terminal-output';
|
|
42
|
-
import { WasiCliTerminalStderr1 } from './imports/wasi-cli-terminal-stderr';
|
|
43
|
-
import { WasiCliTerminalStdin1 } from './imports/wasi-cli-terminal-stdin';
|
|
44
|
-
import { WasiCliTerminalStdout1 } from './imports/wasi-cli-terminal-stdout';
|
|
45
|
-
import { WasiClocksWallClock1 } from './imports/wasi-clocks-wall-clock';
|
|
46
|
-
import { WasiFilesystemPreopens1 } from './imports/wasi-filesystem-preopens';
|
|
47
|
-
import { WasiFilesystemTypes1 } from './imports/wasi-filesystem-types';
|
|
48
|
-
import { WasiIoStreams1 } from './imports/wasi-io-streams';
|
|
49
|
-
import { WasiRandomRandom1 } from './imports/wasi-random-random';
|
|
50
|
-
export function parse(wat: string): Uint8Array;
|
|
51
|
-
export function print(binary: Uint8Array | ArrayBuffer): string;
|
|
52
|
-
export function componentNew(binary: Uint8Array | ArrayBuffer, adapters: [string, Uint8Array | ArrayBuffer][] | null): Uint8Array;
|
|
53
|
-
export function componentWit(binary: Uint8Array | ArrayBuffer): string;
|
|
54
|
-
export function componentEmbed(embedOpts: EmbedOpts): Uint8Array;
|
|
55
|
-
export function metadataShow(binary: Uint8Array | ArrayBuffer): ModuleMetadata[];
|
|
56
|
-
export function metadataAdd(binary: Uint8Array | ArrayBuffer, metadata: ProducersFields): Uint8Array;
|
|
1
|
+
import { WasiCliEnvironment } from './imports/wasi-cli-environment';
|
|
2
|
+
import { WasiCliExit } from './imports/wasi-cli-exit';
|
|
3
|
+
import { WasiCliStderr } from './imports/wasi-cli-stderr';
|
|
4
|
+
import { WasiCliStdin } from './imports/wasi-cli-stdin';
|
|
5
|
+
import { WasiCliStdout } from './imports/wasi-cli-stdout';
|
|
6
|
+
import { WasiCliTerminalInput } from './imports/wasi-cli-terminal-input';
|
|
7
|
+
import { WasiCliTerminalOutput } from './imports/wasi-cli-terminal-output';
|
|
8
|
+
import { WasiCliTerminalStderr } from './imports/wasi-cli-terminal-stderr';
|
|
9
|
+
import { WasiCliTerminalStdin } from './imports/wasi-cli-terminal-stdin';
|
|
10
|
+
import { WasiCliTerminalStdout } from './imports/wasi-cli-terminal-stdout';
|
|
11
|
+
import { WasiClocksWallClock } from './imports/wasi-clocks-wall-clock';
|
|
12
|
+
import { WasiFilesystemPreopens } from './imports/wasi-filesystem-preopens';
|
|
13
|
+
import { WasiFilesystemTypes } from './imports/wasi-filesystem-types';
|
|
14
|
+
import { WasiIoStreams } from './imports/wasi-io-streams';
|
|
15
|
+
import { WasiRandomRandom } from './imports/wasi-random-random';
|
|
16
|
+
import { LocalWasmToolsTools } from './exports/local-wasm-tools-tools';
|
|
17
|
+
export const tools: typeof LocalWasmToolsTools;
|
|
57
18
|
|
|
58
19
|
export const $init: Promise<void>;
|
package/obj/wasm-tools.js
CHANGED
|
@@ -1910,7 +1910,7 @@ function parse(arg0) {
|
|
|
1910
1910
|
if (!_initialized) throwUninitialized();
|
|
1911
1911
|
const ptr0 = utf8Encode(arg0, realloc1, memory0);
|
|
1912
1912
|
const len0 = utf8EncodedLen;
|
|
1913
|
-
const ret = exports1
|
|
1913
|
+
const ret = exports1['local:wasm-tools/tools#parse'](ptr0, len0);
|
|
1914
1914
|
let variant3;
|
|
1915
1915
|
switch (dataView(memory0).getUint8(ret + 0, true)) {
|
|
1916
1916
|
case 0: {
|
|
@@ -1951,7 +1951,7 @@ function print(arg0) {
|
|
|
1951
1951
|
const ptr0 = realloc1(0, 0, 1, len0 * 1);
|
|
1952
1952
|
const src0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, len0 * 1);
|
|
1953
1953
|
(new Uint8Array(memory0.buffer, ptr0, len0 * 1)).set(src0);
|
|
1954
|
-
const ret = exports1
|
|
1954
|
+
const ret = exports1['local:wasm-tools/tools#print'](ptr0, len0);
|
|
1955
1955
|
let variant3;
|
|
1956
1956
|
switch (dataView(memory0).getUint8(ret + 0, true)) {
|
|
1957
1957
|
case 0: {
|
|
@@ -2024,7 +2024,7 @@ function componentNew(arg0, arg1) {
|
|
|
2024
2024
|
variant5_1 = result4;
|
|
2025
2025
|
variant5_2 = len4;
|
|
2026
2026
|
}
|
|
2027
|
-
const ret = exports1['component-new'](ptr0, len0, variant5_0, variant5_1, variant5_2);
|
|
2027
|
+
const ret = exports1['local:wasm-tools/tools#component-new'](ptr0, len0, variant5_0, variant5_1, variant5_2);
|
|
2028
2028
|
let variant8;
|
|
2029
2029
|
switch (dataView(memory0).getUint8(ret + 0, true)) {
|
|
2030
2030
|
case 0: {
|
|
@@ -2065,7 +2065,7 @@ function componentWit(arg0) {
|
|
|
2065
2065
|
const ptr0 = realloc1(0, 0, 1, len0 * 1);
|
|
2066
2066
|
const src0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, len0 * 1);
|
|
2067
2067
|
(new Uint8Array(memory0.buffer, ptr0, len0 * 1)).set(src0);
|
|
2068
|
-
const ret = exports1['component-wit'](ptr0, len0);
|
|
2068
|
+
const ret = exports1['local:wasm-tools/tools#component-wit'](ptr0, len0);
|
|
2069
2069
|
let variant3;
|
|
2070
2070
|
switch (dataView(memory0).getUint8(ret + 0, true)) {
|
|
2071
2071
|
case 0: {
|
|
@@ -2226,7 +2226,7 @@ function componentEmbed(arg0) {
|
|
|
2226
2226
|
dataView(memory0).setInt32(ptr0 + 60, len19, true);
|
|
2227
2227
|
dataView(memory0).setInt32(ptr0 + 56, result19, true);
|
|
2228
2228
|
}
|
|
2229
|
-
const ret = exports1['component-embed'](ptr0);
|
|
2229
|
+
const ret = exports1['local:wasm-tools/tools#component-embed'](ptr0);
|
|
2230
2230
|
let variant23;
|
|
2231
2231
|
switch (dataView(memory0).getUint8(ret + 0, true)) {
|
|
2232
2232
|
case 0: {
|
|
@@ -2267,7 +2267,7 @@ function metadataShow(arg0) {
|
|
|
2267
2267
|
const ptr0 = realloc1(0, 0, 1, len0 * 1);
|
|
2268
2268
|
const src0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, len0 * 1);
|
|
2269
2269
|
(new Uint8Array(memory0.buffer, ptr0, len0 * 1)).set(src0);
|
|
2270
|
-
const ret = exports1['metadata-show'](ptr0, len0);
|
|
2270
|
+
const ret = exports1['local:wasm-tools/tools#metadata-show'](ptr0, len0);
|
|
2271
2271
|
let variant11;
|
|
2272
2272
|
switch (dataView(memory0).getUint8(ret + 0, true)) {
|
|
2273
2273
|
case 0: {
|
|
@@ -2404,7 +2404,7 @@ function metadataAdd(arg0, arg1) {
|
|
|
2404
2404
|
dataView(memory0).setInt32(base + 12, len6, true);
|
|
2405
2405
|
dataView(memory0).setInt32(base + 8, result6, true);
|
|
2406
2406
|
}
|
|
2407
|
-
const ret = exports1['metadata-add'](ptr0, len0, result7, len7);
|
|
2407
|
+
const ret = exports1['local:wasm-tools/tools#metadata-add'](ptr0, len0, result7, len7);
|
|
2408
2408
|
let variant10;
|
|
2409
2409
|
switch (dataView(memory0).getUint8(ret + 0, true)) {
|
|
2410
2410
|
case 0: {
|
|
@@ -2442,9 +2442,10 @@ let _initialized = false;
|
|
|
2442
2442
|
export const $init = (async() => {
|
|
2443
2443
|
const module0 = fetchCompile(new URL('./wasm-tools.core.wasm', import.meta.url));
|
|
2444
2444
|
const module1 = fetchCompile(new URL('./wasm-tools.core2.wasm', import.meta.url));
|
|
2445
|
-
const module2 = base64Compile('AGFzbQEAAAABUgxgAX8AYAN/fn8AYAJ/fwBgCH9/f39/f39/AGACfn8AYAR/f39/AGACf38Bf2AEf39/fwF/YAl/f39/f35+f38Bf2ABfwF/YAN/
|
|
2446
|
-
const module3 = base64Compile('AGFzbQEAAAABUgxgAX8AYAN/fn8AYAJ/fwBgCH9/f39/f39/AGACfn8AYAR/f39/AGACf38Bf2AEf39/fwF/YAl/f39/f35+f38Bf2ABfwF/YAN/
|
|
2445
|
+
const module2 = base64Compile('AGFzbQEAAAABUgxgAX8AYAN/fn8AYAJ/fwBgCH9/f39/f39/AGACfn8AYAR/f39/AGACf38Bf2AEf39/fwF/YAl/f39/f35+f38Bf2ABfwF/YAN/f38Bf2ABfwADHRwAAQECAgIDAgQAAQEFBQAAAAYHBwgGBgYJBgoLBAUBcAEcHAeOAR0BMAAAATEAAQEyAAIBMwADATQABAE1AAUBNgAGATcABwE4AAgBOQAJAjEwAAoCMTEACwIxMgAMAjEzAA0CMTQADgIxNQAPAjE2ABACMTcAEQIxOAASAjE5ABMCMjAAFAIyMQAVAjIyABYCMjMAFwIyNAAYAjI1ABkCMjYAGgIyNwAbCCRpbXBvcnRzAQAK9wIcCQAgAEEAEQAACw0AIAAgASACQQERAQALDQAgACABIAJBAhEBAAsLACAAIAFBAxECAAsLACAAIAFBBBECAAsLACAAIAFBBRECAAsXACAAIAEgAiADIAQgBSAGIAdBBhEDAAsLACAAIAFBBxECAAsLACAAIAFBCBEEAAsJACAAQQkRAAALDQAgACABIAJBChEBAAsNACAAIAEgAkELEQEACw8AIAAgASACIANBDBEFAAsPACAAIAEgAiADQQ0RBQALCQAgAEEOEQAACwkAIABBDxEAAAsJACAAQRARAAALCwAgACABQRERBgALDwAgACABIAIgA0ESEQcACw8AIAAgASACIANBExEHAAsZACAAIAEgAiADIAQgBSAGIAcgCEEUEQgACwsAIAAgAUEVEQYACwsAIAAgAUEWEQYACwsAIAAgAUEXEQY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jIzAAYAAjI0AAkAAjI1AAYAAjI2AAoAAjI3AAsACCRpbXBvcnRzAXABHBwJIgEAQQALHAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhsALglwcm9kdWNlcnMBDHByb2Nlc3NlZC1ieQENd2l0LWNvbXBvbmVudAYwLjE0LjAAHARuYW1lABUUd2l0LWNvbXBvbmVudDpmaXh1cHM');
|
|
2447
2447
|
const instanceFlags0 = new WebAssembly.Global({ value: "i32", mutable: true }, 3);
|
|
2448
|
+
const instanceFlags1 = new WebAssembly.Global({ value: "i32", mutable: true }, 3);
|
|
2448
2449
|
Promise.all([module0, module1, module2, module3]).catch(() => {});
|
|
2449
2450
|
({ exports: exports0 } = await instantiateCore(await module2));
|
|
2450
2451
|
({ exports: exports1 } = await instantiateCore(await module0, {
|
|
@@ -2561,9 +2562,19 @@ export const $init = (async() => {
|
|
|
2561
2562
|
},
|
|
2562
2563
|
}));
|
|
2563
2564
|
realloc1 = exports1.cabi_realloc;
|
|
2564
|
-
postReturn0 = exports1['
|
|
2565
|
-
postReturn1 = exports1['
|
|
2565
|
+
postReturn0 = exports1['cabi_post_local:wasm-tools/tools#component-embed'];
|
|
2566
|
+
postReturn1 = exports1['cabi_post_local:wasm-tools/tools#metadata-show'];
|
|
2566
2567
|
_initialized = true;
|
|
2567
2568
|
})();
|
|
2569
|
+
const tools = {
|
|
2570
|
+
componentEmbed: componentEmbed,
|
|
2571
|
+
componentNew: componentNew,
|
|
2572
|
+
componentWit: componentWit,
|
|
2573
|
+
metadataAdd: metadataAdd,
|
|
2574
|
+
metadataShow: metadataShow,
|
|
2575
|
+
parse: parse,
|
|
2576
|
+
print: print,
|
|
2577
|
+
|
|
2578
|
+
};
|
|
2568
2579
|
|
|
2569
|
-
export {
|
|
2580
|
+
export { tools, tools as 'local:wasm-tools/tools' }
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytecodealliance/jco",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "JavaScript tooling for working with WebAssembly Components",
|
|
5
5
|
"author": "Guy Bedford",
|
|
6
6
|
"bin": {
|
|
7
7
|
"jco": "src/jco.js"
|
|
8
8
|
},
|
|
9
|
-
"exports":
|
|
9
|
+
"exports": {
|
|
10
|
+
"browser": "./src/browser.js",
|
|
11
|
+
"default": "./src/api.js"
|
|
12
|
+
},
|
|
10
13
|
"imports": {
|
|
11
14
|
"#ora": {
|
|
12
15
|
"browser": "./src/ora-shim.js",
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
},
|
|
16
19
|
"type": "module",
|
|
17
20
|
"dependencies": {
|
|
18
|
-
"@bytecodealliance/preview2-shim": "0.0.
|
|
21
|
+
"@bytecodealliance/preview2-shim": "0.0.14",
|
|
19
22
|
"binaryen": "^111.0.0",
|
|
20
23
|
"chalk-template": "^0.4.0",
|
|
21
24
|
"commander": "^9.4.1",
|
|
@@ -24,7 +27,7 @@
|
|
|
24
27
|
"terser": "^5.16.1"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|
|
27
|
-
"@bytecodealliance/componentize-js": "^0.
|
|
30
|
+
"@bytecodealliance/componentize-js": "^0.2.0",
|
|
28
31
|
"@types/node": "^18.11.17",
|
|
29
32
|
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
|
30
33
|
"@typescript-eslint/parser": "^5.41.0",
|
package/src/api.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { optimizeComponent as opt } from './cmd/opt.js';
|
|
2
2
|
export { transpileComponent as transpile } from './cmd/transpile.js';
|
|
3
|
-
import { $init,
|
|
3
|
+
import { $init, tools } from "../obj/wasm-tools.js";
|
|
4
|
+
const { print: printFn, parse: parseFn, componentWit: componentWitFn, componentNew: componentNewFn, componentEmbed: componentEmbedFn, metadataAdd: metadataAddFn, metadataShow: metadataShowFn } = tools;
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @param {Parameters<import('../obj/wasm-tools.js').print>[0]} binary
|
package/src/browser.js
ADDED
package/src/cmd/opt.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { $init,
|
|
1
|
+
import { $init, tools } from '../../obj/wasm-tools.js';
|
|
2
|
+
const { metadataShow, print } = tools;
|
|
2
3
|
import { writeFile } from 'fs/promises';
|
|
3
4
|
import { fileURLToPath } from 'url';
|
|
4
5
|
import c from 'chalk-template';
|