@bytecodealliance/jco 1.10.2 → 1.11.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.
Files changed (52) hide show
  1. package/package.json +18 -6
  2. package/src/cmd/componentize.js +64 -18
  3. package/src/cmd/opt.js +233 -202
  4. package/src/cmd/run.js +117 -73
  5. package/src/cmd/transpile.js +643 -530
  6. package/src/cmd/wasm-tools.js +130 -95
  7. package/src/jco.js +5 -1
  8. package/obj/interfaces/local-wasm-tools-tools.d.ts +0 -52
  9. package/obj/interfaces/wasi-cli-environment.d.ts +0 -2
  10. package/obj/interfaces/wasi-cli-exit.d.ts +0 -3
  11. package/obj/interfaces/wasi-cli-stderr.d.ts +0 -3
  12. package/obj/interfaces/wasi-cli-stdin.d.ts +0 -3
  13. package/obj/interfaces/wasi-cli-stdout.d.ts +0 -3
  14. package/obj/interfaces/wasi-cli-terminal-input.d.ts +0 -8
  15. package/obj/interfaces/wasi-cli-terminal-output.d.ts +0 -8
  16. package/obj/interfaces/wasi-cli-terminal-stderr.d.ts +0 -3
  17. package/obj/interfaces/wasi-cli-terminal-stdin.d.ts +0 -3
  18. package/obj/interfaces/wasi-cli-terminal-stdout.d.ts +0 -3
  19. package/obj/interfaces/wasi-clocks-wall-clock.d.ts +0 -5
  20. package/obj/interfaces/wasi-filesystem-preopens.d.ts +0 -3
  21. package/obj/interfaces/wasi-filesystem-types.d.ts +0 -164
  22. package/obj/interfaces/wasi-io-error.d.ts +0 -8
  23. package/obj/interfaces/wasi-io-streams.d.ts +0 -30
  24. package/obj/interfaces/wasi-random-random.d.ts +0 -2
  25. package/obj/js-component-bindgen-component.core.wasm +0 -0
  26. package/obj/js-component-bindgen-component.core2.wasm +0 -0
  27. package/obj/js-component-bindgen-component.d.ts +0 -116
  28. package/obj/js-component-bindgen-component.js +0 -4302
  29. package/obj/wasm-tools.core.wasm +0 -0
  30. package/obj/wasm-tools.core2.wasm +0 -0
  31. package/obj/wasm-tools.d.ts +0 -20
  32. package/obj/wasm-tools.js +0 -4369
  33. package/src/api.d.ts +0 -42
  34. package/src/api.d.ts.map +0 -1
  35. package/src/browser.d.ts +0 -4
  36. package/src/browser.d.ts.map +0 -1
  37. package/src/cmd/componentize.d.ts +0 -2
  38. package/src/cmd/componentize.d.ts.map +0 -1
  39. package/src/cmd/opt.d.ts +0 -20
  40. package/src/cmd/opt.d.ts.map +0 -1
  41. package/src/cmd/run.d.ts +0 -3
  42. package/src/cmd/run.d.ts.map +0 -1
  43. package/src/cmd/transpile.d.ts +0 -89
  44. package/src/cmd/transpile.d.ts.map +0 -1
  45. package/src/cmd/wasm-tools.d.ts +0 -8
  46. package/src/cmd/wasm-tools.d.ts.map +0 -1
  47. package/src/common.d.ts +0 -16
  48. package/src/common.d.ts.map +0 -1
  49. package/src/jco.d.ts +0 -3
  50. package/src/jco.d.ts.map +0 -1
  51. package/src/ora-shim.d.ts +0 -7
  52. package/src/ora-shim.d.ts.map +0 -1
package/src/api.d.ts DELETED
@@ -1,42 +0,0 @@
1
- /**
2
- * @param {Parameters<import('../obj/wasm-tools.js').print>[0]} binary
3
- * @return {Promise<ReturnType<import('../obj/wasm-tools.js').print>>}
4
- */
5
- export function print(binary: Parameters<import("../obj/wasm-tools.js").print>[0]): Promise<ReturnType<import("../obj/wasm-tools.js").print>>;
6
- /**
7
- * @param {Parameters<import('../obj/wasm-tools.js').parse>[0]} wat
8
- * @return {Promise<ReturnType<import('../obj/wasm-tools.js').parse>>}
9
- */
10
- export function parse(wat: Parameters<import("../obj/wasm-tools.js").parse>[0]): Promise<ReturnType<import("../obj/wasm-tools.js").parse>>;
11
- /**
12
- * @param {Parameters<import('../obj/wasm-tools.js').componentWit>[0]} binary
13
- * @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentWit>>}
14
- */
15
- export function componentWit(binary: Parameters<import("../obj/wasm-tools.js").componentWit>[0]): Promise<ReturnType<import("../obj/wasm-tools.js").componentWit>>;
16
- /**
17
- * @param {Parameters<import('../obj/wasm-tools.js').componentNew>[0]} binary
18
- * @param {Parameters<import('../obj/wasm-tools.js').componentNew>[1]} adapters
19
- * @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentNew>>}
20
- */
21
- export function componentNew(binary: Parameters<import("../obj/wasm-tools.js").componentNew>[0], adapters: Parameters<import("../obj/wasm-tools.js").componentNew>[1]): Promise<ReturnType<import("../obj/wasm-tools.js").componentNew>>;
22
- /**
23
- * @param {Parameters<import('../obj/wasm-tools.js').componentEmbed>[0]} embedOpts
24
- * @return {Promise<ReturnType<import('../obj/wasm-tools.js').componentEmbed>>}
25
- */
26
- export function componentEmbed(embedOpts: Parameters<import("../obj/wasm-tools.js").componentEmbed>[0]): Promise<ReturnType<import("../obj/wasm-tools.js").componentEmbed>>;
27
- /**
28
- * @param {Parameters<import('../obj/wasm-tools.js').metadataAdd>[0]} binary
29
- * @param {Parameters<import('../obj/wasm-tools.js').metadataAdd>[1]} metadata
30
- * @return {Promise<ReturnType<import('../obj/wasm-tools.js').metadataAdd>>}
31
- */
32
- export function metadataAdd(binary: Parameters<import("../obj/wasm-tools.js").metadataAdd>[0], metadata: Parameters<import("../obj/wasm-tools.js").metadataAdd>[1]): Promise<ReturnType<import("../obj/wasm-tools.js").metadataAdd>>;
33
- /**
34
- * @param {Parameters<import('../obj/wasm-tools.js').metadataShow>[0]} binary
35
- * @return {Promise<ReturnType<import('../obj/wasm-tools.js').metadataShow>>}
36
- */
37
- export function metadataShow(binary: Parameters<import("../obj/wasm-tools.js").metadataShow>[0]): Promise<ReturnType<import("../obj/wasm-tools.js").metadataShow>>;
38
- export function preview1AdapterCommandPath(): URL;
39
- export function preview1AdapterReactorPath(): URL;
40
- export { optimizeComponent as opt } from "./cmd/opt.js";
41
- export { transpileComponent as transpile, typesComponent as types } from "./cmd/transpile.js";
42
- //# sourceMappingURL=api.d.ts.map
package/src/api.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["api.js"],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OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAK3E;AACD,kDAEC;AACD,kDAEC"}
package/src/browser.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export function generate(...args: any[]): Promise<any>;
2
- export function generateTypes(...args: any[]): Promise<any>;
3
- export { generate as transpile };
4
- //# sourceMappingURL=browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["browser.js"],"names":[],"mappings":"AAEA,uDAGC;AAED,4DAGC"}
@@ -1,2 +0,0 @@
1
- export function componentize(jsSource: any, opts: any): Promise<void>;
2
- //# sourceMappingURL=componentize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentize.d.ts","sourceRoot":"","sources":["componentize.js"],"names":[],"mappings":"AAIA,sEAkBC"}
package/src/cmd/opt.d.ts DELETED
@@ -1,20 +0,0 @@
1
- export function opt(componentPath: any, opts: any, program: any): Promise<void>;
2
- /**
3
- *
4
- * @param {Uint8Array} componentBytes
5
- * @param {{ quiet: boolean, asyncify?: boolean, optArgs?: string[], noVerify?: boolean }} opts?
6
- * @returns {Promise<{ component: Uint8Array, compressionInfo: { beforeBytes: number, afterBytes: number }[] >}
7
- */
8
- export function optimizeComponent(componentBytes: Uint8Array, opts: {
9
- quiet: boolean;
10
- asyncify?: boolean;
11
- optArgs?: string[];
12
- noVerify?: boolean;
13
- }): Promise<{
14
- component: Uint8Array;
15
- compressionInfo: {
16
- beforeBytes: number;
17
- afterBytes: number;
18
- }[];
19
- }>;
20
- //# sourceMappingURL=opt.d.ts.map
@@ -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 DELETED
@@ -1,3 +0,0 @@
1
- export function run(componentPath: any, args: any, opts: any): Promise<void>;
2
- export function serve(componentPath: any, args: any, opts: any): Promise<void>;
3
- //# sourceMappingURL=run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["run.js"],"names":[],"mappings":"AASA,6EAmBC;AAED,+EA2BC"}
@@ -1,89 +0,0 @@
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
- * features?: string[] | 'all',
15
- * guest?: bool,
16
- * }} opts
17
- * @returns {Promise<{ [filename: string]: Uint8Array }>}
18
- */
19
- export function typesComponent(witPath: string, opts: {
20
- name?: string;
21
- worldName?: string;
22
- instantiation?: "async" | "sync";
23
- tlaCompat?: bool;
24
- asyncMode?: string;
25
- asyncImports?: string[];
26
- asyncExports?: string[];
27
- outDir?: string;
28
- features?: string[] | "all";
29
- guest?: bool;
30
- }): Promise<{
31
- [filename: string]: Uint8Array;
32
- }>;
33
- export function transpile(componentPath: any, opts: any, program: any): Promise<void>;
34
- /**
35
- *
36
- * @param {Uint8Array} component
37
- * @param {{
38
- * name: string,
39
- * instantiation?: 'async' | 'sync',
40
- * importBindings?: 'js' | 'optimized' | 'hybrid' | 'direct-optimized',
41
- * map?: Record<string, string>,
42
- * asyncMode?: string,
43
- * asyncImports?: string[],
44
- * asyncExports?: string[],
45
- * validLiftingOptimization?: bool,
46
- * tracing?: bool,
47
- * nodejsCompat?: bool,
48
- * tlaCompat?: bool,
49
- * base64Cutoff?: bool,
50
- * js?: bool,
51
- * minify?: bool,
52
- * optimize?: bool,
53
- * namespacedExports?: bool,
54
- * outDir?: string,
55
- * multiMemory?: bool,
56
- * experimentalIdlImports?: bool,
57
- * optArgs?: string[],
58
- * }} opts
59
- * @returns {Promise<{ files: { [filename: string]: Uint8Array }, imports: string[], exports: [string, 'function' | 'instance'][] }>}
60
- */
61
- export function transpileComponent(component: Uint8Array, opts?: {
62
- name: string;
63
- instantiation?: "async" | "sync";
64
- importBindings?: "js" | "optimized" | "hybrid" | "direct-optimized";
65
- map?: Record<string, string>;
66
- asyncMode?: string;
67
- asyncImports?: string[];
68
- asyncExports?: string[];
69
- validLiftingOptimization?: bool;
70
- tracing?: bool;
71
- nodejsCompat?: bool;
72
- tlaCompat?: bool;
73
- base64Cutoff?: bool;
74
- js?: bool;
75
- minify?: bool;
76
- optimize?: bool;
77
- namespacedExports?: bool;
78
- outDir?: string;
79
- multiMemory?: bool;
80
- experimentalIdlImports?: bool;
81
- optArgs?: string[];
82
- }): Promise<{
83
- files: {
84
- [filename: string]: Uint8Array;
85
- };
86
- imports: string[];
87
- exports: [string, "function" | "instance"][];
88
- }>;
89
- //# sourceMappingURL=transpile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transpile.d.ts","sourceRoot":"","sources":["transpile.js"],"names":[],"mappings":"AAgCA,8DAGC;AAED,mEAGC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wCAfW,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,CA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AC;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,CAgTnI"}
@@ -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":["wasm-tools.js"],"names":[],"mappings":"AAOA,2DAKC;AAED,2DASC;AAED,kEASC;AAED,kEAsBC;AAED,oEAaC;AAED,iEAUC;AAED,kEAiCC"}
package/src/common.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export function setShowSpinner(val: any): void;
2
- export function getShowSpinner(): boolean;
3
- export function sizeStr(num: any): string;
4
- export function fixedDigitDisplay(num: any, maxChars: any): string;
5
- export function table(data: any, align?: any[]): string;
6
- /**
7
- * Securely creates a temporary directory and returns its path.
8
- *
9
- * The new directory is created using `fsPromises.mkdtemp()`.
10
- */
11
- export function getTmpDir(): Promise<string>;
12
- export function spawnIOTmp(cmd: any, input: any, args: any): Promise<Buffer<ArrayBufferLike>>;
13
- export const isWindows: boolean;
14
- export { readFileCli as readFile };
15
- declare function readFileCli(file: any, encoding: any): Promise<Buffer<ArrayBufferLike>>;
16
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.js"],"names":[],"mappings":"AAWA,+CAEC;AACD,0CAIC;AAED,0CAOC;AAED,mEAaC;AAED,wDAcC;AAED;;;;GAIG;AACH,6CAEC;AAYD,8FA8BC;AArGD,gCAA8C;;AA6D9C,yFAOC"}
package/src/jco.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=jco.d.ts.map
package/src/jco.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"jco.d.ts","sourceRoot":"","sources":["jco.js"],"names":[],"mappings":""}
package/src/ora-shim.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export default function ora(): Ora;
2
- declare class Ora {
3
- start(): void;
4
- stop(): void;
5
- }
6
- export {};
7
- //# sourceMappingURL=ora-shim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ora-shim.d.ts","sourceRoot":"","sources":["ora-shim.js"],"names":[],"mappings":"AACA,mCAEC;AAED;IACE,cAAW;IACX,aAAU;CACX"}