@bytecodealliance/jco 1.18.1 → 1.20.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/LICENSE +220 -0
- package/README.md +1 -1
- package/obj/js-component-bindgen-component.core.wasm +0 -0
- package/obj/js-component-bindgen-component.d.ts +1 -0
- package/obj/js-component-bindgen-component.js +1481 -518
- package/obj/wasm-tools.core.wasm +0 -0
- package/obj/wasm-tools.js +1570 -519
- package/package.json +97 -96
- package/src/api.js +11 -16
- package/src/cmd/transpile.js +8 -0
- package/src/jco.js +1 -1
- package/types/api.d.ts +17 -23
- package/types/api.d.ts.map +1 -1
- package/{src → types}/cmd/componentize.d.ts +1 -1
- package/types/cmd/componentize.d.ts.map +1 -0
- package/{src → types}/cmd/opt.d.ts +7 -10
- package/types/cmd/opt.d.ts.map +1 -0
- package/{src → types}/cmd/run.d.ts +1 -1
- package/types/cmd/run.d.ts.map +1 -0
- package/types/cmd/transpile.d.ts +62 -0
- package/types/cmd/transpile.d.ts.map +1 -0
- package/types/cmd/types.d.ts +45 -0
- package/types/cmd/types.d.ts.map +1 -0
- package/{src → types}/cmd/wasm-tools.d.ts +1 -1
- package/types/cmd/wasm-tools.d.ts.map +1 -0
- package/src/cmd/componentize.d.ts.map +0 -1
- package/src/cmd/opt.d.ts.map +0 -1
- package/src/cmd/run.d.ts.map +0 -1
- package/src/cmd/transpile.d.ts +0 -138
- package/src/cmd/transpile.d.ts.map +0 -1
- package/src/cmd/types.d.ts +0 -38
- package/src/cmd/wasm-tools.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,100 +1,101 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"name": "@bytecodealliance/jco",
|
|
3
|
+
"version": "1.20.0",
|
|
4
|
+
"description": "JavaScript tooling for working with WebAssembly Components",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Component",
|
|
7
|
+
"Wasm",
|
|
8
|
+
"WebAssembly"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/bytecodealliance/jco#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/bytecodealliance/jco/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "(Apache-2.0 WITH LLVM-exception)",
|
|
15
|
+
"author": "Guy Bedford",
|
|
16
|
+
"contributors": [
|
|
17
|
+
{
|
|
18
|
+
"name": "Guy Bedford"
|
|
13
19
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
"exports": {
|
|
52
|
-
".": {
|
|
53
|
-
"types": "./types/api.d.ts",
|
|
54
|
-
"browser": "./src/browser.js",
|
|
55
|
-
"default": "./src/api.js"
|
|
56
|
-
},
|
|
57
|
-
"./component": {
|
|
58
|
-
"types": "./obj/js-component-bindgen-component.d.ts",
|
|
59
|
-
"default": "./src/browser.js"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"scripts": {
|
|
63
|
-
"build": "cargo xtask build debug",
|
|
64
|
-
"build:release": "cargo xtask build release",
|
|
65
|
-
"build:types:preview2-shim": "npm run build:types:preview2-shim --include-workspace-root",
|
|
66
|
-
"build:test:components": "cargo xtask build-test-components",
|
|
67
|
-
"fmt": "oxfmt",
|
|
68
|
-
"fmt:check": "oxfmt --check",
|
|
69
|
-
"lint": "oxlint",
|
|
70
|
-
"lint:fix": "npm run lint -- --fix",
|
|
71
|
-
"test": "vitest run -c test/vitest.ts",
|
|
72
|
-
"test:lts": "vitest run -c test/vitest.lts.ts",
|
|
73
|
-
"prepack": "cargo xtask build release"
|
|
74
|
-
},
|
|
75
|
-
"dependencies": {
|
|
76
|
-
"@bytecodealliance/componentize-js": "^0.20.0",
|
|
77
|
-
"@bytecodealliance/componentize-js-0-19-3": "npm:@bytecodealliance/componentize-js@^0.19.3",
|
|
78
|
-
"@bytecodealliance/preview2-shim": "^0.17.9",
|
|
79
|
-
"binaryen": "^123.0.0",
|
|
80
|
-
"commander": "^14",
|
|
81
|
-
"mkdirp": "^3",
|
|
82
|
-
"ora": "^8",
|
|
83
|
-
"terser": "^5"
|
|
20
|
+
{
|
|
21
|
+
"name": "Victor Adossi",
|
|
22
|
+
"email": "vadossi@cosmonic.com"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/bytecodealliance/jco.git"
|
|
28
|
+
},
|
|
29
|
+
"bin": {
|
|
30
|
+
"jco": "src/jco.js"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"lib",
|
|
34
|
+
"src",
|
|
35
|
+
"types",
|
|
36
|
+
"obj/*.core*.wasm",
|
|
37
|
+
"obj/*.js",
|
|
38
|
+
"obj/*.ts",
|
|
39
|
+
"obj/interfaces"
|
|
40
|
+
],
|
|
41
|
+
"type": "module",
|
|
42
|
+
"main": "src/jco.js",
|
|
43
|
+
"types": "types/jco.d.ts",
|
|
44
|
+
"imports": {
|
|
45
|
+
"#ora": {
|
|
46
|
+
"types": "./src/ora-shim.d.ts",
|
|
47
|
+
"browser": "./src/ora-shim.js",
|
|
48
|
+
"default": "ora"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"exports": {
|
|
52
|
+
".": {
|
|
53
|
+
"types": "./types/api.d.ts",
|
|
54
|
+
"browser": "./src/browser.js",
|
|
55
|
+
"default": "./src/api.js"
|
|
84
56
|
},
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"commitlint": "^19.8.1",
|
|
89
|
-
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
90
|
-
"mime": "^4.0.7",
|
|
91
|
-
"oxfmt": "^0.28.0",
|
|
92
|
-
"puppeteer": "^24.16.2",
|
|
93
|
-
"semver": "^7.7.1",
|
|
94
|
-
"smol-toml": "^1.4.2",
|
|
95
|
-
"typescript": "^5.9.2",
|
|
96
|
-
"vite": "^7.1.5",
|
|
97
|
-
"vitest": "^3.2.4",
|
|
98
|
-
"which": "^2.0.2"
|
|
57
|
+
"./component": {
|
|
58
|
+
"types": "./obj/js-component-bindgen-component.d.ts",
|
|
59
|
+
"default": "./src/browser.js"
|
|
99
60
|
}
|
|
100
|
-
}
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@bytecodealliance/componentize-js": "^0.21.0",
|
|
64
|
+
"@bytecodealliance/componentize-js-0-19-3": "npm:@bytecodealliance/componentize-js@^0.19.3",
|
|
65
|
+
"@bytecodealliance/preview2-shim": "^0.17.9",
|
|
66
|
+
"@bytecodealliance/preview3-shim": "^0.1.0",
|
|
67
|
+
"binaryen": "^123.0.0",
|
|
68
|
+
"commander": "^14",
|
|
69
|
+
"mkdirp": "^3",
|
|
70
|
+
"ora": "^8",
|
|
71
|
+
"terser": "^5"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
75
|
+
"@types/node": "^24.3.0",
|
|
76
|
+
"commitlint": "^19.8.1",
|
|
77
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
78
|
+
"mime": "^4.0.7",
|
|
79
|
+
"oxfmt": "^0.28.0",
|
|
80
|
+
"puppeteer": "^24.43.1",
|
|
81
|
+
"semver": "^7.7.1",
|
|
82
|
+
"smol-toml": "^1.4.2",
|
|
83
|
+
"typescript": "^5.9.2",
|
|
84
|
+
"vite": "^7.1.5",
|
|
85
|
+
"vitest": "^3.2.4",
|
|
86
|
+
"which": "^2.0.2"
|
|
87
|
+
},
|
|
88
|
+
"scripts": {
|
|
89
|
+
"build": "cargo xtask build debug",
|
|
90
|
+
"build:release": "cargo xtask build release",
|
|
91
|
+
"build:ts": "tsc -p tsconfig.json",
|
|
92
|
+
"build:types:preview2-shim": "pnpm run build:types:preview2-shim --include-workspace-root",
|
|
93
|
+
"build:test:components": "cargo xtask build-test-components",
|
|
94
|
+
"fmt": "oxfmt",
|
|
95
|
+
"fmt:check": "oxfmt --check",
|
|
96
|
+
"lint": "oxlint",
|
|
97
|
+
"lint:fix": "oxlint --fix",
|
|
98
|
+
"test": "vitest run -c test/vitest.ts",
|
|
99
|
+
"test:lts": "vitest run -c test/vitest.lts.ts"
|
|
100
|
+
}
|
|
101
|
+
}
|
package/src/api.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-check
|
|
1
2
|
export { optimizeComponent as opt } from "./cmd/opt.js";
|
|
2
3
|
export { transpileComponent as transpile, typesComponent as types } from "./cmd/transpile.js";
|
|
3
4
|
import { $init, tools } from "../obj/wasm-tools.js";
|
|
@@ -12,63 +13,57 @@ const {
|
|
|
12
13
|
} = tools;
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
|
-
* @param {
|
|
16
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').print>>}
|
|
16
|
+
* @param {Uint8Array} binary
|
|
17
17
|
*/
|
|
18
18
|
export async function print(binary) {
|
|
19
19
|
await $init;
|
|
20
20
|
return printFn(binary);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* @param {
|
|
24
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').parse>>}
|
|
23
|
+
* @param {string} wat
|
|
25
24
|
*/
|
|
26
25
|
export async function parse(wat) {
|
|
27
26
|
await $init;
|
|
28
27
|
return parseFn(wat);
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
|
-
* @param {
|
|
32
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentWit>>}
|
|
30
|
+
* @param {Uint8Array} binary
|
|
33
31
|
*/
|
|
34
32
|
export async function componentWit(binary) {
|
|
35
33
|
await $init;
|
|
36
34
|
return componentWitFn(binary);
|
|
37
35
|
}
|
|
38
36
|
/**
|
|
39
|
-
* @param {
|
|
40
|
-
* @param {
|
|
41
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentNew>>}
|
|
37
|
+
* @param {Uint8Array} binary
|
|
38
|
+
* @param {Array<[string, Uint8Array]>} [adapters]
|
|
42
39
|
*/
|
|
43
40
|
export async function componentNew(binary, adapters) {
|
|
44
41
|
await $init;
|
|
45
42
|
return componentNewFn(binary, adapters);
|
|
46
43
|
}
|
|
47
44
|
/**
|
|
48
|
-
* @param {
|
|
49
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentEmbed>>}
|
|
45
|
+
* @param {tools.EmbedOpts} embedOpts
|
|
50
46
|
*/
|
|
51
47
|
export async function componentEmbed(embedOpts) {
|
|
52
48
|
await $init;
|
|
53
49
|
return componentEmbedFn(embedOpts);
|
|
54
50
|
}
|
|
55
51
|
/**
|
|
56
|
-
* @param {
|
|
57
|
-
* @param {
|
|
58
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').metadataAdd>>}
|
|
52
|
+
* @param {Uint8Array} binary
|
|
53
|
+
* @param {tools.ProducersFields} metadata
|
|
59
54
|
*/
|
|
60
55
|
export async function metadataAdd(binary, metadata) {
|
|
61
56
|
await $init;
|
|
62
57
|
return metadataAddFn(binary, metadata);
|
|
63
58
|
}
|
|
64
59
|
/**
|
|
65
|
-
* @param {
|
|
66
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').metadataShow>>}
|
|
60
|
+
* @param {Uint8Array} binary
|
|
67
61
|
*/
|
|
68
62
|
export async function metadataShow(binary) {
|
|
69
63
|
await $init;
|
|
70
64
|
return metadataShowFn(binary);
|
|
71
65
|
}
|
|
66
|
+
|
|
72
67
|
export function preview1AdapterCommandPath() {
|
|
73
68
|
return new URL("../lib/wasi_snapshot_preview1.command.wasm", import.meta.url);
|
|
74
69
|
}
|
package/src/cmd/transpile.js
CHANGED
|
@@ -134,6 +134,7 @@ export async function transpileComponent(component, opts = {}) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
if (opts.wasiShim !== false) {
|
|
137
|
+
const p3VersionTag = "0.3.0-rc-2026-03-15";
|
|
137
138
|
opts.map = Object.assign(
|
|
138
139
|
{
|
|
139
140
|
"wasi:cli/*": "@bytecodealliance/preview2-shim/cli#*",
|
|
@@ -143,6 +144,12 @@ export async function transpileComponent(component, opts = {}) {
|
|
|
143
144
|
"wasi:io/*": "@bytecodealliance/preview2-shim/io#*",
|
|
144
145
|
"wasi:random/*": "@bytecodealliance/preview2-shim/random#*",
|
|
145
146
|
"wasi:sockets/*": "@bytecodealliance/preview2-shim/sockets#*",
|
|
147
|
+
[`wasi:cli/*@${p3VersionTag}`]: "@bytecodealliance/preview3-shim/cli#*",
|
|
148
|
+
[`wasi:clocks/*@${p3VersionTag}`]: "@bytecodealliance/preview3-shim/clocks#*",
|
|
149
|
+
[`wasi:filesystem/*@${p3VersionTag}`]: "@bytecodealliance/preview3-shim/filesystem#*",
|
|
150
|
+
[`wasi:http/*@${p3VersionTag}`]: "@bytecodealliance/preview3-shim/http#*",
|
|
151
|
+
[`wasi:random/*@${p3VersionTag}`]: "@bytecodealliance/preview3-shim/random#*",
|
|
152
|
+
[`wasi:sockets/*@${p3VersionTag}`]: "@bytecodealliance/preview3-shim/sockets#*",
|
|
146
153
|
},
|
|
147
154
|
opts.map || {},
|
|
148
155
|
);
|
|
@@ -200,6 +207,7 @@ export async function transpileComponent(component, opts = {}) {
|
|
|
200
207
|
multiMemory: opts.multiMemory === true,
|
|
201
208
|
idlImports: opts.experimentalIdlImports === true,
|
|
202
209
|
strict: opts.strict === true,
|
|
210
|
+
asmjs: opts.js === true,
|
|
203
211
|
});
|
|
204
212
|
|
|
205
213
|
let outDir = (opts.outDir ?? "").replace(/\\/g, "/");
|
package/src/jco.js
CHANGED
package/types/api.d.ts
CHANGED
|
@@ -1,42 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {
|
|
3
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').print>>}
|
|
2
|
+
* @param {Uint8Array} binary
|
|
4
3
|
*/
|
|
5
|
-
export function print(binary:
|
|
4
|
+
export function print(binary: Uint8Array): Promise<string>;
|
|
6
5
|
/**
|
|
7
|
-
* @param {
|
|
8
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').parse>>}
|
|
6
|
+
* @param {string} wat
|
|
9
7
|
*/
|
|
10
|
-
export function parse(wat:
|
|
8
|
+
export function parse(wat: string): Promise<Uint8Array<ArrayBufferLike>>;
|
|
11
9
|
/**
|
|
12
|
-
* @param {
|
|
13
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentWit>>}
|
|
10
|
+
* @param {Uint8Array} binary
|
|
14
11
|
*/
|
|
15
|
-
export function componentWit(binary:
|
|
12
|
+
export function componentWit(binary: Uint8Array): Promise<string>;
|
|
16
13
|
/**
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
19
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentNew>>}
|
|
14
|
+
* @param {Uint8Array} binary
|
|
15
|
+
* @param {Array<[string, Uint8Array]>} [adapters]
|
|
20
16
|
*/
|
|
21
|
-
export function componentNew(binary:
|
|
17
|
+
export function componentNew(binary: Uint8Array, adapters?: Array<[string, Uint8Array]>): Promise<Uint8Array<ArrayBufferLike>>;
|
|
22
18
|
/**
|
|
23
|
-
* @param {
|
|
24
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentEmbed>>}
|
|
19
|
+
* @param {tools.EmbedOpts} embedOpts
|
|
25
20
|
*/
|
|
26
|
-
export function componentEmbed(embedOpts:
|
|
21
|
+
export function componentEmbed(embedOpts: tools.EmbedOpts): Promise<Uint8Array<ArrayBufferLike>>;
|
|
27
22
|
/**
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {
|
|
30
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').metadataAdd>>}
|
|
23
|
+
* @param {Uint8Array} binary
|
|
24
|
+
* @param {tools.ProducersFields} metadata
|
|
31
25
|
*/
|
|
32
|
-
export function metadataAdd(binary:
|
|
26
|
+
export function metadataAdd(binary: Uint8Array, metadata: tools.ProducersFields): Promise<Uint8Array<ArrayBufferLike>>;
|
|
33
27
|
/**
|
|
34
|
-
* @param {
|
|
35
|
-
* @return {Promise<ReturnType<import('../obj/wasm-tools.js').metadataShow>>}
|
|
28
|
+
* @param {Uint8Array} binary
|
|
36
29
|
*/
|
|
37
|
-
export function metadataShow(binary:
|
|
30
|
+
export function metadataShow(binary: Uint8Array): Promise<tools.ModuleMetadata[]>;
|
|
38
31
|
export function preview1AdapterCommandPath(): URL;
|
|
39
32
|
export function preview1AdapterReactorPath(): URL;
|
|
40
33
|
export { optimizeComponent as opt } from "./cmd/opt.js";
|
|
34
|
+
import { tools } from "../obj/wasm-tools.js";
|
|
41
35
|
export { transpileComponent as transpile, typesComponent as types } from "./cmd/transpile.js";
|
|
42
36
|
//# sourceMappingURL=api.d.ts.map
|
package/types/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.js"],"names":[],"mappings":"AAcA;;GAEG;AACH,8BAFW,UAAU,mBAKpB;AACD;;GAEG;AACH,2BAFW,MAAM,wCAKhB;AACD;;GAEG;AACH,qCAFW,UAAU,mBAKpB;AACD;;;GAGG;AACH,qCAHW,UAAU,aACV,KAAK,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,wCAKrC;AACD;;GAEG;AACH,0CAFW,KAAK,CAAC,SAAS,wCAKzB;AACD;;;GAGG;AACH,oCAHW,UAAU,YACV,KAAK,CAAC,eAAe,wCAK/B;AACD;;GAEG;AACH,qCAFW,UAAU,mCAKpB;AAED,kDAEC;AACD,kDAEC;;sBApE4B,sBAAsB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export function componentize(jsSource: any, opts: any): Promise<void>;
|
|
2
|
-
//# sourceMappingURL=componentize.d.ts.map
|
|
2
|
+
//# sourceMappingURL=componentize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentize.d.ts","sourceRoot":"","sources":["../../src/cmd/componentize.js"],"names":[],"mappings":"AAoDA,sEAoEC"}
|
|
@@ -5,19 +5,16 @@ export function opt(componentPath: any, opts: any, program: any): Promise<void>;
|
|
|
5
5
|
* @param {{ quiet: boolean, asyncify?: boolean, optArgs?: string[], noVerify?: boolean }} opts?
|
|
6
6
|
* @returns {Promise<{ component: Uint8Array, compressionInfo: { beforeBytes: number, afterBytes: number }[] >}
|
|
7
7
|
*/
|
|
8
|
-
export function optimizeComponent(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
noVerify?: boolean;
|
|
15
|
-
},
|
|
16
|
-
): Promise<{
|
|
8
|
+
export function optimizeComponent(componentBytes: Uint8Array, opts: {
|
|
9
|
+
quiet: boolean;
|
|
10
|
+
asyncify?: boolean;
|
|
11
|
+
optArgs?: string[];
|
|
12
|
+
noVerify?: boolean;
|
|
13
|
+
}): Promise<{
|
|
17
14
|
component: Uint8Array;
|
|
18
15
|
compressionInfo: {
|
|
19
16
|
beforeBytes: number;
|
|
20
17
|
afterBytes: number;
|
|
21
18
|
}[];
|
|
22
19
|
}>;
|
|
23
|
-
//# sourceMappingURL=opt.d.ts.map
|
|
20
|
+
//# sourceMappingURL=opt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opt.d.ts","sourceRoot":"","sources":["../../src/cmd/opt.js"],"names":[],"mappings":"AAUA,gFAkDC;AAgBD;;;;;GAKG;AACH,kDAJW,UAAU,QACV;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5E,OAAO,CAAC;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,eAAe,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAA,CAAE,CAuJ7G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cmd/run.js"],"names":[],"mappings":"AAWA,6EAwBC;AAED,+EAqCC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export function transpile(witPath: any, opts: any, program: any): Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* Execute the bundled pre-transpiled component that can perform component transpilation,
|
|
4
|
+
* for the given component.
|
|
5
|
+
*
|
|
6
|
+
* @param {Uint8Array} component
|
|
7
|
+
* @param {{
|
|
8
|
+
* name: string,
|
|
9
|
+
* instantiation?: 'async' | 'sync',
|
|
10
|
+
* importBindings?: 'js' | 'optimized' | 'hybrid' | 'direct-optimized',
|
|
11
|
+
* map?: Record<string, string>,
|
|
12
|
+
* asyncMode?: string,
|
|
13
|
+
* asyncImports?: string[],
|
|
14
|
+
* asyncExports?: string[],
|
|
15
|
+
* validLiftingOptimization?: bool,
|
|
16
|
+
* tracing?: bool,
|
|
17
|
+
* nodejsCompat?: bool,
|
|
18
|
+
* tlaCompat?: bool,
|
|
19
|
+
* base64Cutoff?: bool,
|
|
20
|
+
* js?: bool,
|
|
21
|
+
* minify?: bool,
|
|
22
|
+
* optimize?: bool,
|
|
23
|
+
* namespacedExports?: bool,
|
|
24
|
+
* outDir?: string,
|
|
25
|
+
* multiMemory?: bool,
|
|
26
|
+
* experimentalIdlImports?: bool,
|
|
27
|
+
* optArgs?: string[],
|
|
28
|
+
* wasmOptBin?: string[],
|
|
29
|
+
* }} opts
|
|
30
|
+
* @returns {Promise<{ files: { [filename: string]: Uint8Array }, imports: string[], exports: [string, 'function' | 'instance'][] }>}
|
|
31
|
+
*/
|
|
32
|
+
export function transpileComponent(component: Uint8Array, opts?: {
|
|
33
|
+
name: string;
|
|
34
|
+
instantiation?: "async" | "sync";
|
|
35
|
+
importBindings?: "js" | "optimized" | "hybrid" | "direct-optimized";
|
|
36
|
+
map?: Record<string, string>;
|
|
37
|
+
asyncMode?: string;
|
|
38
|
+
asyncImports?: string[];
|
|
39
|
+
asyncExports?: string[];
|
|
40
|
+
validLiftingOptimization?: bool;
|
|
41
|
+
tracing?: bool;
|
|
42
|
+
nodejsCompat?: bool;
|
|
43
|
+
tlaCompat?: bool;
|
|
44
|
+
base64Cutoff?: bool;
|
|
45
|
+
js?: bool;
|
|
46
|
+
minify?: bool;
|
|
47
|
+
optimize?: bool;
|
|
48
|
+
namespacedExports?: bool;
|
|
49
|
+
outDir?: string;
|
|
50
|
+
multiMemory?: bool;
|
|
51
|
+
experimentalIdlImports?: bool;
|
|
52
|
+
optArgs?: string[];
|
|
53
|
+
wasmOptBin?: string[];
|
|
54
|
+
}): Promise<{
|
|
55
|
+
files: {
|
|
56
|
+
[filename: string]: Uint8Array;
|
|
57
|
+
};
|
|
58
|
+
imports: string[];
|
|
59
|
+
exports: [string, "function" | "instance"][];
|
|
60
|
+
}>;
|
|
61
|
+
export { types, guestTypes, typesComponent } from "./types.js";
|
|
62
|
+
//# sourceMappingURL=transpile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpile.d.ts","sourceRoot":"","sources":["../../src/cmd/transpile.js"],"names":[],"mappings":"AA+BA,gFAuCC;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,8CA1BW,UAAU,SACV;IACN,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,cAAc,CAAC,EAAE,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,kBAAkB,CAAC;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,wBAAwB,CAAC,EAAE,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,sBAAsB,CAAC,EAAE,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,GACS,OAAO,CAAC;IAAE,KAAK,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,EAAE,CAAA;CAAE,CAAC,CAyUnI"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function types(witPath: any, opts: any): Promise<void>;
|
|
2
|
+
export function guestTypes(witPath: any, opts: any): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} witPath
|
|
5
|
+
* @param {{
|
|
6
|
+
* name?: string,
|
|
7
|
+
* worldName?: string,
|
|
8
|
+
* instantiation?: 'async' | 'sync',
|
|
9
|
+
* tlaCompat?: bool,
|
|
10
|
+
* asyncMode?: string,
|
|
11
|
+
* asyncImports?: string[],
|
|
12
|
+
* asyncExports?: string[],
|
|
13
|
+
* outDir?: string,
|
|
14
|
+
* allFeatures?: bool,
|
|
15
|
+
* feature?: string[] | 'all', // backwards compat
|
|
16
|
+
* features?: string[] | 'all',
|
|
17
|
+
* asyncWasiImports?: string[],
|
|
18
|
+
* asyncWasiExports?: string[],
|
|
19
|
+
* asyncExports?: string[],
|
|
20
|
+
* asyncImports?: string[],
|
|
21
|
+
* guest?: bool,
|
|
22
|
+
* }} opts
|
|
23
|
+
* @returns {Promise<{ [filename: string]: Uint8Array }>}
|
|
24
|
+
*/
|
|
25
|
+
export function typesComponent(witPath: string, opts: {
|
|
26
|
+
name?: string;
|
|
27
|
+
worldName?: string;
|
|
28
|
+
instantiation?: "async" | "sync";
|
|
29
|
+
tlaCompat?: bool;
|
|
30
|
+
asyncMode?: string;
|
|
31
|
+
asyncImports?: string[];
|
|
32
|
+
asyncExports?: string[];
|
|
33
|
+
outDir?: string;
|
|
34
|
+
allFeatures?: bool;
|
|
35
|
+
feature?: string[] | "all";
|
|
36
|
+
features?: string[] | "all";
|
|
37
|
+
asyncWasiImports?: string[];
|
|
38
|
+
asyncWasiExports?: string[];
|
|
39
|
+
asyncExports?: string[];
|
|
40
|
+
asyncImports?: string[];
|
|
41
|
+
guest?: bool;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
[filename: string]: Uint8Array;
|
|
44
|
+
}>;
|
|
45
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cmd/types.js"],"names":[],"mappings":"AAqBA,8DAeC;AAED,mEAcC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wCArBW,MAAM,QACN;IACN,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,IAAI,CAAC;CACd,GACS,OAAO,CAAC;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC,CAmFvD"}
|
|
@@ -5,4 +5,4 @@ export function componentNew(file: any, opts: any): Promise<void>;
|
|
|
5
5
|
export function componentEmbed(file: any, opts: any): Promise<void>;
|
|
6
6
|
export function metadataAdd(file: any, opts: any): Promise<void>;
|
|
7
7
|
export function metadataShow(file: any, opts: any): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=wasm-tools.d.ts.map
|
|
8
|
+
//# sourceMappingURL=wasm-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm-tools.d.ts","sourceRoot":"","sources":["../../src/cmd/wasm-tools.js"],"names":[],"mappings":"AAeA,2DAKC;AAED,2DASC;AAED,kEASC;AAED,kEAwCC;AAED,oEAcC;AAED,iEAUC;AAED,kEAoCC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"componentize.d.ts","sourceRoot":"","sources":["componentize.js"],"names":[],"mappings":"AAIA,sEAkBC"}
|
package/src/cmd/opt.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opt.d.ts","sourceRoot":"","sources":["opt.js"],"names":[],"mappings":"AAgBA,gFA2CC;AAgBD;;;;;GAKG;AACH,kDAJW,UAAU,QACV;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5E,OAAO,CAAC;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,eAAe,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAA,CAAE,CAkK7G"}
|
package/src/cmd/run.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["run.js"],"names":[],"mappings":"AASA,6EAmBC;AAED,+EA2BC"}
|