@bytecodealliance/jco 1.25.2 → 1.26.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 +27 -4
- package/dist/api.d.ts +6 -0
- package/dist/api.d.ts.map +1 -0
- package/{src → dist}/api.js +2 -12
- package/dist/api.js.map +1 -0
- package/dist/browser.d.ts +5 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +12 -0
- package/dist/browser.js.map +1 -0
- package/dist/bundle.d.ts +42 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +124 -0
- package/dist/bundle.js.map +1 -0
- package/dist/cmd/componentize.d.ts +34 -0
- package/dist/cmd/componentize.d.ts.map +1 -0
- package/dist/cmd/componentize.js +243 -0
- package/dist/cmd/componentize.js.map +1 -0
- package/{types → dist}/cmd/opt.d.ts +17 -12
- package/dist/cmd/opt.d.ts.map +1 -0
- package/{src → dist}/cmd/opt.js +53 -87
- package/dist/cmd/opt.js.map +1 -0
- package/dist/cmd/run.d.ts +3 -0
- package/dist/cmd/run.d.ts.map +1 -0
- package/{src → dist}/cmd/run.js +24 -54
- package/dist/cmd/run.js.map +1 -0
- package/dist/cmd/transpile.d.ts +48 -0
- package/dist/cmd/transpile.d.ts.map +1 -0
- package/{src → dist}/cmd/transpile.js +1 -36
- package/dist/cmd/transpile.js.map +1 -0
- package/{types → dist}/cmd/types.d.ts +21 -22
- package/dist/cmd/types.d.ts.map +1 -0
- package/{src → dist}/cmd/types.js +27 -51
- package/dist/cmd/types.js.map +1 -0
- package/dist/cmd/wasm-tools.d.ts +8 -0
- package/dist/cmd/wasm-tools.d.ts.map +1 -0
- package/{src → dist}/cmd/wasm-tools.js +28 -42
- package/dist/cmd/wasm-tools.js.map +1 -0
- package/{types → dist}/common.d.ts +27 -25
- package/dist/common.d.ts.map +1 -0
- package/{src → dist}/common.js +19 -44
- package/dist/common.js.map +1 -0
- package/{types → dist}/jco.d.ts.map +1 -1
- package/{src → dist}/jco.js +74 -149
- package/dist/jco.js.map +1 -0
- package/dist/ora-shim.d.ts +9 -0
- package/dist/ora-shim.d.ts.map +1 -0
- package/dist/ora-shim.js +10 -0
- package/dist/ora-shim.js.map +1 -0
- package/package.json +22 -22
- package/src/browser.js +0 -18
- package/src/cmd/componentize.js +0 -170
- package/src/ora-shim.js +0 -9
- package/types/api.d.ts +0 -6
- package/types/api.d.ts.map +0 -1
- package/types/browser.d.ts +0 -4
- package/types/browser.d.ts.map +0 -1
- package/types/cmd/componentize.d.ts +0 -2
- package/types/cmd/componentize.d.ts.map +0 -1
- package/types/cmd/opt.d.ts.map +0 -1
- package/types/cmd/run.d.ts +0 -3
- package/types/cmd/run.d.ts.map +0 -1
- package/types/cmd/transpile.d.ts +0 -72
- package/types/cmd/transpile.d.ts.map +0 -1
- package/types/cmd/types.d.ts.map +0 -1
- package/types/cmd/wasm-tools.d.ts +0 -8
- package/types/cmd/wasm-tools.d.ts.map +0 -1
- package/types/common.d.ts.map +0 -1
- package/types/ora-shim.d.ts +0 -8
- package/types/ora-shim.d.ts.map +0 -1
- /package/{types → dist}/jco.d.ts +0 -0
package/dist/ora-shim.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ora-shim.js","sourceRoot":"","sources":["../src/ora-shim.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,QAAkB;IAC1C,OAAO,IAAI,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,MAAM,GAAG;IACL,IAAI,GAAG,EAAE,CAAC;IACV,KAAK,KAAI,CAAC;IACV,IAAI,KAAI,CAAC;CACZ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytecodealliance/jco",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "JavaScript tooling for working with WebAssembly Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Component",
|
|
@@ -27,44 +27,45 @@
|
|
|
27
27
|
"url": "git+https://github.com/bytecodealliance/jco.git"
|
|
28
28
|
},
|
|
29
29
|
"bin": {
|
|
30
|
-
"jco": "
|
|
30
|
+
"jco": "dist/jco.js"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"types"
|
|
33
|
+
"dist",
|
|
34
|
+
"lib"
|
|
36
35
|
],
|
|
37
36
|
"type": "module",
|
|
38
|
-
"main": "
|
|
39
|
-
"types": "
|
|
37
|
+
"main": "dist/jco.js",
|
|
38
|
+
"types": "dist/jco.d.ts",
|
|
40
39
|
"imports": {
|
|
41
40
|
"#ora": {
|
|
42
|
-
"types": "./
|
|
43
|
-
"browser": "./
|
|
41
|
+
"types": "./dist/ora-shim.d.ts",
|
|
42
|
+
"browser": "./dist/ora-shim.js",
|
|
44
43
|
"default": "ora"
|
|
45
44
|
}
|
|
46
45
|
},
|
|
47
46
|
"exports": {
|
|
48
47
|
".": {
|
|
49
|
-
"types": "./
|
|
50
|
-
"browser": "./
|
|
51
|
-
"default": "./
|
|
48
|
+
"types": "./dist/api.d.ts",
|
|
49
|
+
"browser": "./dist/browser.js",
|
|
50
|
+
"default": "./dist/api.js"
|
|
52
51
|
},
|
|
53
52
|
"./component": {
|
|
54
|
-
"types": "./
|
|
55
|
-
"default": "./
|
|
53
|
+
"types": "./dist/browser.d.ts",
|
|
54
|
+
"default": "./dist/browser.js"
|
|
56
55
|
}
|
|
57
56
|
},
|
|
58
57
|
"dependencies": {
|
|
59
58
|
"@bytecodealliance/componentize-js": "^0.21.0",
|
|
60
59
|
"@bytecodealliance/componentize-js-0-19-3": "npm:@bytecodealliance/componentize-js@^0.19.3",
|
|
61
|
-
"@bytecodealliance/jco-transpile": "^0.
|
|
60
|
+
"@bytecodealliance/jco-transpile": "^0.5.1",
|
|
62
61
|
"@bytecodealliance/preview2-shim": "^0.17.9",
|
|
63
62
|
"@bytecodealliance/preview3-shim": "^0.1.2",
|
|
64
63
|
"binaryen": "^130.0.0",
|
|
65
64
|
"commander": "^14",
|
|
65
|
+
"componentize-qjs": "^0.4.2",
|
|
66
66
|
"mkdirp": "^3",
|
|
67
|
-
"ora": "^8"
|
|
67
|
+
"ora": "^8",
|
|
68
|
+
"rolldown": "^1.1.0"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@commitlint/config-conventional": "^19.8.1",
|
|
@@ -75,15 +76,14 @@
|
|
|
75
76
|
"oxfmt": "^0.28.0",
|
|
76
77
|
"puppeteer": "^25.1.0",
|
|
77
78
|
"semver": "^7.7.1",
|
|
78
|
-
"smol-toml": "^1.4.2",
|
|
79
79
|
"typescript": "^5.9.2",
|
|
80
80
|
"vite": "^7.1.5",
|
|
81
81
|
"vitest": "^4.1.0",
|
|
82
82
|
"which": "^2.0.2"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
|
-
"build": "cargo xtask build debug",
|
|
86
|
-
"build:release": "cargo xtask build release",
|
|
85
|
+
"build": "cargo xtask build debug && npm run build:ts",
|
|
86
|
+
"build:release": "cargo xtask build release && npm run build:ts",
|
|
87
87
|
"build:ts": "tsc -p tsconfig.json",
|
|
88
88
|
"build:types:preview2-shim": "pnpm run build:types:preview2-shim --include-workspace-root",
|
|
89
89
|
"build:test:components": "cargo xtask build-test-components",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"fmt:check": "oxfmt --check",
|
|
92
92
|
"lint": "oxlint",
|
|
93
93
|
"lint:fix": "oxlint --fix",
|
|
94
|
-
"test": "vitest run -c test/vitest.ts",
|
|
95
|
-
"test:lts": "vitest run -c test/vitest.lts.ts",
|
|
96
|
-
"test:extended": "vitest run -c test/vitest.extended.ts"
|
|
94
|
+
"test": "pnpm run build:ts && vitest run -c test/vitest.ts",
|
|
95
|
+
"test:lts": "pnpm run build:ts && vitest run -c test/vitest.lts.ts",
|
|
96
|
+
"test:extended": "pnpm run build:ts && vitest run -c test/vitest.extended.ts"
|
|
97
97
|
}
|
|
98
98
|
}
|
package/src/browser.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
$init,
|
|
3
|
-
generate as _generate,
|
|
4
|
-
generateTypes as _generateTypes,
|
|
5
|
-
} from "../obj/js-component-bindgen-component.js";
|
|
6
|
-
|
|
7
|
-
export async function generate() {
|
|
8
|
-
await $init;
|
|
9
|
-
return _generate.apply(this, arguments);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export async function generateTypes() {
|
|
13
|
-
await $init;
|
|
14
|
-
return _generateTypes.apply(this, arguments);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// for backwards compat
|
|
18
|
-
export { generate as transpile };
|
package/src/cmd/componentize.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { stat, readFile, writeFile } from "node:fs/promises";
|
|
2
|
-
import { resolve, basename } from "node:path";
|
|
3
|
-
|
|
4
|
-
import { componentWitMetadataForWorld } from "@bytecodealliance/jco-transpile";
|
|
5
|
-
|
|
6
|
-
import { styleText, isWindows } from "../common.js";
|
|
7
|
-
|
|
8
|
-
/** All features that can be enabled/disabled */
|
|
9
|
-
const ALL_FEATURES = ["clocks", "http", "random", "stdio", "fetch-event"];
|
|
10
|
-
|
|
11
|
-
/** Features that should be used for --debug mode */
|
|
12
|
-
const DEBUG_FEATURES = ["stdio"];
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Detect whether the WIT of a given component contains an older version of
|
|
16
|
-
* `wasi:http` which necessitates an older version of `componentize-js`
|
|
17
|
-
*
|
|
18
|
-
* @param {string} witPath
|
|
19
|
-
* @returns bool
|
|
20
|
-
*/
|
|
21
|
-
async function usesOlderWasiHTTP(witPath, worldName) {
|
|
22
|
-
witPath = (isWindows ? "//?/" : "") + resolve(witPath);
|
|
23
|
-
const worldMetadata = await componentWitMetadataForWorld({ tag: "path", val: witPath }, worldName ?? null);
|
|
24
|
-
|
|
25
|
-
// Check if the an old `wasi:http/incoming-handler` version is exported
|
|
26
|
-
const exportsOldIncomingHandler = worldMetadata.exports.some((iface) => {
|
|
27
|
-
return (
|
|
28
|
-
iface.namespace === "wasi" &&
|
|
29
|
-
iface.version !== null &&
|
|
30
|
-
iface.version.major === 0n &&
|
|
31
|
-
iface.version.minor < 3n &&
|
|
32
|
-
iface.version.patch < 10n
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const importsOldFetch = worldMetadata.imports.some((iface) => {
|
|
37
|
-
return (
|
|
38
|
-
iface.namespace === "wasi" &&
|
|
39
|
-
iface.version !== null &&
|
|
40
|
-
iface.version.major === 0n &&
|
|
41
|
-
iface.version.minor < 3n &&
|
|
42
|
-
iface.version.patch < 10n
|
|
43
|
-
);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
return exportsOldIncomingHandler || importsOldFetch;
|
|
47
|
-
}
|
|
48
|
-
export async function componentize(jsSource, opts) {
|
|
49
|
-
const { disableFeatures, enableFeatures } = calculateFeatureSet(opts);
|
|
50
|
-
|
|
51
|
-
const source = await readFile(jsSource, "utf8");
|
|
52
|
-
const witPath = resolve(opts.wit);
|
|
53
|
-
const sourceName = basename(jsSource);
|
|
54
|
-
|
|
55
|
-
// Load an older version of componentize-js if we detect an older version of WASI HTTP in use
|
|
56
|
-
// as the version that is usable is baked into the StarlingMonkey version provided by a given version
|
|
57
|
-
// of componentize-js
|
|
58
|
-
let componentizeJSModule;
|
|
59
|
-
const useOldComponentizeJS = await usesOlderWasiHTTP(witPath, opts.worldName);
|
|
60
|
-
if (useOldComponentizeJS) {
|
|
61
|
-
// NOTE: if we were to use a version of componentize-js 0.20.0 or newer here,
|
|
62
|
-
// the build would fail, as newer versions do not support wasi:http < 0.2.10
|
|
63
|
-
// for fetch.
|
|
64
|
-
console.error(
|
|
65
|
-
`${styleText(["yellow", "bold"], "warning")} Falling back to componentize-js 0.19.3 because this component requests Preview 2 WASI packages older than 0.2.10. See https://bytecodealliance.github.io/jco/troubleshooting/common-issues.html#componentize-js-0193-fallback for details and upgrade steps.`,
|
|
66
|
-
);
|
|
67
|
-
componentizeJSModule = await eval('import("@bytecodealliance/componentize-js-0-19-3")');
|
|
68
|
-
} else {
|
|
69
|
-
componentizeJSModule = await eval('import("@bytecodealliance/componentize-js")');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
let component;
|
|
73
|
-
try {
|
|
74
|
-
const result = await componentizeJSModule.componentize(source, {
|
|
75
|
-
enableAot: opts.aot,
|
|
76
|
-
aotMinStackSizeBytes: opts.aotMinStackSizeBytes,
|
|
77
|
-
wevalBin: opts.wevalBin,
|
|
78
|
-
sourceName,
|
|
79
|
-
witPath,
|
|
80
|
-
worldName: opts.worldName,
|
|
81
|
-
disableFeatures,
|
|
82
|
-
enableFeatures,
|
|
83
|
-
preview2Adapter: opts.preview2Adapter,
|
|
84
|
-
debugBuild: opts.debugStarlingmonkeyBuild,
|
|
85
|
-
engine: opts.engine,
|
|
86
|
-
debug: {
|
|
87
|
-
bindings: opts.debugBindings,
|
|
88
|
-
bindingsDir: opts.debugBindingsDir,
|
|
89
|
-
binary: opts.debugBinary,
|
|
90
|
-
binaryPath: opts.debugBinaryPath,
|
|
91
|
-
enableWizerLogging: opts.debugEnableWizerLogging,
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
if (result.debug) {
|
|
95
|
-
console.error(`${styleText("cyan", "DEBUG")} Debug output\n${JSON.stringify(result.debug, null, 2)}\n`);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
component = result.component;
|
|
99
|
-
} catch (err) {
|
|
100
|
-
// Detect package resolution issues that usually mean a misconfigured "witPath"
|
|
101
|
-
if (err.toString().includes("no known packages")) {
|
|
102
|
-
const isFile = await stat(witPath).then((s) => s.isFile());
|
|
103
|
-
if (isFile) {
|
|
104
|
-
const hint = await printWITPathHint(witPath);
|
|
105
|
-
if (err.message) {
|
|
106
|
-
err.message += `\n${hint}`;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
throw err;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
await writeFile(opts.out, component);
|
|
114
|
-
|
|
115
|
-
console.log(`${styleText("green", "OK")} Successfully written ${styleText("bold", opts.out)}.`);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Print a hint about the witPath option that may be incorrect
|
|
120
|
-
*
|
|
121
|
-
* @param {string} witPath - witPath option that was used (which is a path that resolves to a file or directory)
|
|
122
|
-
* @returns {string} user-visible, highlighted output that can be printed
|
|
123
|
-
*/
|
|
124
|
-
async function printWITPathHint(witPath) {
|
|
125
|
-
const warningPrefix = styleText(["yellow", "bold"], "warning");
|
|
126
|
-
const pathMeta = await stat(witPath);
|
|
127
|
-
let output = "\n";
|
|
128
|
-
if (!pathMeta.isFile() && !pathMeta.isDirectory()) {
|
|
129
|
-
output += `${warningPrefix} The supplited WIT path [${witPath}] is neither a file or directory.\n`;
|
|
130
|
-
return output;
|
|
131
|
-
}
|
|
132
|
-
output += `${warningPrefix} Your WIT path option [${witPath}] may be incorrect\n`;
|
|
133
|
-
output += `${warningPrefix} When using a world with dependencies, you must pass the enclosing WIT folder, not a single file.\n`;
|
|
134
|
-
output += `${warningPrefix} (e.g. 'wit/', rather than 'wit/component.wit').\n`;
|
|
135
|
-
return output;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Build set of disabled features
|
|
140
|
-
*
|
|
141
|
-
* At present, `componentize-js` does not use enabled features but exclusively
|
|
142
|
-
* takes into account disabled features.
|
|
143
|
-
*
|
|
144
|
-
* @param {{ debug: boolean, disable: string[], enable: string[] }} opts
|
|
145
|
-
* @returns {{ disableFeatures: string[], enableFeatures: string[] }}
|
|
146
|
-
*/
|
|
147
|
-
function calculateFeatureSet(opts) {
|
|
148
|
-
const disableFeatures = new Set(opts?.debug ? DEBUG_FEATURES : []);
|
|
149
|
-
const disable = opts?.disable ?? [];
|
|
150
|
-
const enable = opts?.enable ?? [];
|
|
151
|
-
|
|
152
|
-
// Process disabled features
|
|
153
|
-
if (disable.includes("all")) {
|
|
154
|
-
ALL_FEATURES.forEach((v) => disableFeatures.add(v));
|
|
155
|
-
} else {
|
|
156
|
-
disable.forEach((v) => disableFeatures.add(v));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Process enabled features
|
|
160
|
-
if (enable.includes("all")) {
|
|
161
|
-
ALL_FEATURES.forEach((v) => disableFeatures.delete(v));
|
|
162
|
-
} else {
|
|
163
|
-
enable.forEach((v) => disableFeatures.delete(v));
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return {
|
|
167
|
-
disableFeatures: [...disableFeatures],
|
|
168
|
-
enableFeatures: ALL_FEATURES.filter((v) => !disableFeatures.has(v)),
|
|
169
|
-
};
|
|
170
|
-
}
|
package/src/ora-shim.js
DELETED
package/types/api.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export function preview1AdapterCommandPath(): URL;
|
|
2
|
-
export function preview1AdapterReactorPath(): URL;
|
|
3
|
-
export { optimizeComponent as opt } from "./cmd/opt.js";
|
|
4
|
-
export { transpileComponent as transpile, typesComponent as types } from "./cmd/transpile.js";
|
|
5
|
-
export { print, parse, componentWit, componentNew, componentEmbed, metadataAdd, metadataShow } from "@bytecodealliance/jco-transpile/wasm-tools";
|
|
6
|
-
//# sourceMappingURL=api.d.ts.map
|
package/types/api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.js"],"names":[],"mappings":"AAcA,kDAEC;AACD,kDAEC"}
|
package/types/browser.d.ts
DELETED
package/types/browser.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.js"],"names":[],"mappings":"AAMA,uDAGC;AAED,4DAGC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"componentize.d.ts","sourceRoot":"","sources":["../../src/cmd/componentize.js"],"names":[],"mappings":"AA+CA,sEAoEC"}
|
package/types/cmd/opt.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opt.d.ts","sourceRoot":"","sources":["../../src/cmd/opt.js"],"names":[],"mappings":"AAUA,gFAiDC;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,CAsJ7G"}
|
package/types/cmd/run.d.ts
DELETED
package/types/cmd/run.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cmd/run.js"],"names":[],"mappings":"AAWA,6EAwBC;AAED,+EAqCC"}
|
package/types/cmd/transpile.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {{
|
|
3
|
-
* name: string,
|
|
4
|
-
* instantiation?: 'async' | 'sync',
|
|
5
|
-
* importBindings?: 'js' | 'optimized' | 'hybrid' | 'direct-optimized',
|
|
6
|
-
* map?: Record<string, string>,
|
|
7
|
-
* asyncMode?: string,
|
|
8
|
-
* asyncImports?: string[],
|
|
9
|
-
* asyncExports?: string[],
|
|
10
|
-
* validLiftingOptimization?: bool,
|
|
11
|
-
* tracing?: bool,
|
|
12
|
-
* nodejsCompat?: bool,
|
|
13
|
-
* tlaCompat?: bool,
|
|
14
|
-
* base64Cutoff?: bool,
|
|
15
|
-
* js?: bool,
|
|
16
|
-
* minify?: bool,
|
|
17
|
-
* optimize?: bool,
|
|
18
|
-
* namespacedExports?: bool,
|
|
19
|
-
* outDir?: string,
|
|
20
|
-
* multiMemory?: bool,
|
|
21
|
-
* experimentalIdlImports?: bool,
|
|
22
|
-
* optArgs?: string[],
|
|
23
|
-
* wasmOptBin?: string[],
|
|
24
|
-
* }} TranspileOpts
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* Transpile a component, given a path.
|
|
28
|
-
*
|
|
29
|
-
* @param {string} componentPath
|
|
30
|
-
* @param {TranspileOpts} opts
|
|
31
|
-
* @param {object} comander `Program` object
|
|
32
|
-
*/
|
|
33
|
-
export function transpileCmd(componentPath: string, opts: TranspileOpts, program: any): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Transpile a component, given WebAssembly bytes.
|
|
36
|
-
*
|
|
37
|
-
* @param {Uint8Array} component
|
|
38
|
-
* @param {TranspileOpts} [opts]
|
|
39
|
-
* @returns {Promise<{ files: { [filename: string]: Uint8Array }, imports: string[], exports: [string, 'function' | 'instance'][] }>}
|
|
40
|
-
*/
|
|
41
|
-
export function transpileComponent(component: Uint8Array, opts?: TranspileOpts): Promise<{
|
|
42
|
-
files: {
|
|
43
|
-
[filename: string]: Uint8Array;
|
|
44
|
-
};
|
|
45
|
-
imports: string[];
|
|
46
|
-
exports: [string, "function" | "instance"][];
|
|
47
|
-
}>;
|
|
48
|
-
export type TranspileOpts = {
|
|
49
|
-
name: string;
|
|
50
|
-
instantiation?: "async" | "sync";
|
|
51
|
-
importBindings?: "js" | "optimized" | "hybrid" | "direct-optimized";
|
|
52
|
-
map?: Record<string, string>;
|
|
53
|
-
asyncMode?: string;
|
|
54
|
-
asyncImports?: string[];
|
|
55
|
-
asyncExports?: string[];
|
|
56
|
-
validLiftingOptimization?: bool;
|
|
57
|
-
tracing?: bool;
|
|
58
|
-
nodejsCompat?: bool;
|
|
59
|
-
tlaCompat?: bool;
|
|
60
|
-
base64Cutoff?: bool;
|
|
61
|
-
js?: bool;
|
|
62
|
-
minify?: bool;
|
|
63
|
-
optimize?: bool;
|
|
64
|
-
namespacedExports?: bool;
|
|
65
|
-
outDir?: string;
|
|
66
|
-
multiMemory?: bool;
|
|
67
|
-
experimentalIdlImports?: bool;
|
|
68
|
-
optArgs?: string[];
|
|
69
|
-
wasmOptBin?: string[];
|
|
70
|
-
};
|
|
71
|
-
export { types, guestTypes, typesComponent } from "./types.js";
|
|
72
|
-
//# sourceMappingURL=transpile.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transpile.d.ts","sourceRoot":"","sources":["../../src/cmd/transpile.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;GAMG;AACH,4CAJW,MAAM,QACN,aAAa,+BAMvB;AAED;;;;;;GAMG;AACH,8CAJW,UAAU,SACV,aAAa,GACX,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,CAInI;4BA9CY;IACR,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"}
|
package/types/cmd/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cmd/types.js"],"names":[],"mappings":"AAoBA,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,CA6FvD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function parse(file: any, opts: any): Promise<void>;
|
|
2
|
-
export function print(file: any, opts: any): Promise<void>;
|
|
3
|
-
export function componentWit(file: any, opts: any): Promise<void>;
|
|
4
|
-
export function componentNew(file: any, opts: any): Promise<void>;
|
|
5
|
-
export function componentEmbed(file: any, opts: any): Promise<void>;
|
|
6
|
-
export function metadataAdd(file: any, opts: any): Promise<void>;
|
|
7
|
-
export function metadataShow(file: any, opts: any): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=wasm-tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wasm-tools.d.ts","sourceRoot":"","sources":["../../src/cmd/wasm-tools.js"],"names":[],"mappings":"AAeA,2DAIC;AAED,2DAQC;AAED,kEAQC;AAED,kEAuCC;AAED,oEAaC;AAED,iEASC;AAED,kEAmCC"}
|
package/types/common.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.js"],"names":[],"mappings":"AA6BA,+CAEC;AACD,0CAIC;AAED,0CASC;AAED,mEAcC;AAED;;;;;;GAMG;AACH,4BAJW,MAAM,EAAE,EAAE,UACV,MAAM,EAAE,UAuBlB;AAED;;;;;;GAMG;AACH,6BAFa,OAAO,CAAC,MAAM,CAAC,CAI3B;AAkBD;;;;;;;;;;;;;;;GAeG;AACH,gCALW,MAAM,kBACN,MAAM,CAAC,eAAe,CAAC,QACvB,MAAM,EAAE,GACN,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAmC5C;AAED;;;;;;;;;;GAUG;AACH,kCALW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,gBACtB,OAAO,GACL,OAAO,CAAC,IAAI,CAAC,CAsBzB;AAED;;;;;GAKG;AACH,gDAHW,MAAM,GAAG,SAAS,GAChB,OAAO,CAAC,MAAM,CAAC,CAiB3B;AAED;;;;;;GAMG;AACH,kCAJW,MAAM,GAAG,MAAM,EAAE,QACjB,MAAM,GACJ,MAAM,CAOlB;AAvOD,gCAA8C;AAE9C,0CASE;AAEF,0CAA4F;AAE5F,iCAAkC,MAAM,CAAC;AAEzC,6DAA6D;AAC7D,+BAAgC,OAAO,CAAC;;AA+ExC;;;;;;GAMG;AACH,uCAJW,MAAM,kBAEJ,OAAO,CAAC,MAAM,CAAC,CAQ3B"}
|
package/types/ora-shim.d.ts
DELETED
package/types/ora-shim.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ora-shim.d.ts","sourceRoot":"","sources":["../src/ora-shim.js"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,mCAEC;AAED;IACI,cAAU;IACV,aAAS;CACZ"}
|
/package/{types → dist}/jco.d.ts
RENAMED
|
File without changes
|