@onda-lang/wasm-compiler 0.7.4 → 0.8.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 +47 -0
- package/api.md +407 -0
- package/dist/backend/constants.js +1 -1
- package/dist/backend/index.js +991 -31
- package/dist/build.json +3 -3
- package/dist/frontend/README.md +8 -5
- package/dist/frontend/onda_compiler_web.d.ts +21 -12
- package/dist/frontend/onda_compiler_web.js +118 -10
- package/dist/frontend/onda_compiler_web_bg.wasm +0 -0
- package/dist/frontend/onda_compiler_web_bg.wasm.d.ts +10 -7
- package/dist/frontend/package.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -5
- package/src/index.d.ts +61 -1
- package/src/index.js +307 -24
- package/src/worker.js +31 -0
package/dist/build.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"ondaVersion": "0.
|
|
2
|
+
"ondaVersion": "0.8.0",
|
|
3
3
|
"binaryenVersion": "130.0.0",
|
|
4
4
|
"frontendPackage": "onda_compiler_web",
|
|
5
5
|
"frontendOptimization": {
|
|
6
6
|
"tool": "wasm-opt",
|
|
7
7
|
"binaryenVersion": "130.0.0",
|
|
8
8
|
"optimizeLevel": 4,
|
|
9
|
-
"inputBytes":
|
|
10
|
-
"outputBytes":
|
|
9
|
+
"inputBytes": 9547769,
|
|
10
|
+
"outputBytes": 7075855
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/frontend/README.md
CHANGED
|
@@ -14,11 +14,14 @@ The package build runs `wasm-pack --release` and then the workspace-pinned Binar
|
|
|
14
14
|
`wasm-opt -O4`. Its internal `--no-opt` argument only disables wasm-pack's separately bundled
|
|
15
15
|
optimizer so every local, CI, website, and npm build uses the same Binaryen release.
|
|
16
16
|
|
|
17
|
-
The production exports
|
|
18
|
-
`
|
|
19
|
-
`
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
The production exports
|
|
18
|
+
`compile_to_mir_messagepack(source, sampleRate, blockSize, constantsJson)` and
|
|
19
|
+
`compile_source_workspace_to_mir_messagepack(entryPath, sourcesJson, sampleRate, blockSize,
|
|
20
|
+
constantsJson)`. They return a `FrontendMessagePackCompilation` containing compact
|
|
21
|
+
schema-versioned bytes plus the ordered contributing project paths. `constantsJson` is the typed,
|
|
22
|
+
lossless internal transport for immutable `config const` inputs supplied by the public npm package.
|
|
23
|
+
JSON variants return the equivalent `FrontendJsonCompilation` for inspection and tooling. Both
|
|
24
|
+
result types expose the source list and exact portable source image.
|
|
22
25
|
Workspace
|
|
23
26
|
compilation accepts a JSON object of project-relative paths to source strings, resolving imports and
|
|
24
27
|
includes entirely in memory. Paths cannot escape the virtual project root. Embedded
|
|
@@ -74,15 +74,15 @@ export class WebProjectMaterializationPlan {
|
|
|
74
74
|
|
|
75
75
|
export function buffer_asset_format_version(): number;
|
|
76
76
|
|
|
77
|
-
export function compile_project_image_to_mir_messagepack(image_bytes: Uint8Array, sample_rate: number, block_size: number): FrontendMessagePackCompilation;
|
|
77
|
+
export function compile_project_image_to_mir_messagepack(image_bytes: Uint8Array, sample_rate: number, block_size: number, constants_json: string): FrontendMessagePackCompilation;
|
|
78
78
|
|
|
79
|
-
export function compile_source_workspace_to_mir_json(entry_path: string, sources_json: string, sample_rate: number, block_size: number): FrontendJsonCompilation;
|
|
79
|
+
export function compile_source_workspace_to_mir_json(entry_path: string, sources_json: string, sample_rate: number, block_size: number, constants_json: string): FrontendJsonCompilation;
|
|
80
80
|
|
|
81
|
-
export function compile_source_workspace_to_mir_messagepack(entry_path: string, sources_json: string, sample_rate: number, block_size: number): FrontendMessagePackCompilation;
|
|
81
|
+
export function compile_source_workspace_to_mir_messagepack(entry_path: string, sources_json: string, sample_rate: number, block_size: number, constants_json: string): FrontendMessagePackCompilation;
|
|
82
82
|
|
|
83
|
-
export function compile_to_mir_json(source: string, sample_rate: number, block_size: number): FrontendJsonCompilation;
|
|
83
|
+
export function compile_to_mir_json(source: string, sample_rate: number, block_size: number, constants_json: string): FrontendJsonCompilation;
|
|
84
84
|
|
|
85
|
-
export function compile_to_mir_messagepack(source: string, sample_rate: number, block_size: number): FrontendMessagePackCompilation;
|
|
85
|
+
export function compile_to_mir_messagepack(source: string, sample_rate: number, block_size: number, constants_json: string): FrontendMessagePackCompilation;
|
|
86
86
|
|
|
87
87
|
export function current_stdlib_digest(): string;
|
|
88
88
|
|
|
@@ -94,6 +94,12 @@ export function encode_buffer_asset(element: string, frames: number, channels: n
|
|
|
94
94
|
|
|
95
95
|
export function inspect_project_image(image_bytes: Uint8Array): string;
|
|
96
96
|
|
|
97
|
+
export function inspect_project_image_compile_constants(image_bytes: Uint8Array, sample_rate: number, block_size: number, constants_json: string): string;
|
|
98
|
+
|
|
99
|
+
export function inspect_source_compile_constants(source: string, sample_rate: number, block_size: number, constants_json: string): string;
|
|
100
|
+
|
|
101
|
+
export function inspect_source_workspace_compile_constants(entry_path: string, sources_json: string, sample_rate: number, block_size: number, constants_json: string): string;
|
|
102
|
+
|
|
97
103
|
export function materialize_project_image(image_bytes: Uint8Array, asset_file_names_json: string): WebProjectMaterializationPlan;
|
|
98
104
|
|
|
99
105
|
export function mir_schema_version(): number;
|
|
@@ -112,11 +118,11 @@ export interface InitOutput {
|
|
|
112
118
|
readonly __wbg_webprojectimagebuilder_free: (a: number, b: number) => void;
|
|
113
119
|
readonly __wbg_webprojectmaterializationplan_free: (a: number, b: number) => void;
|
|
114
120
|
readonly buffer_asset_format_version: () => number;
|
|
115
|
-
readonly compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
116
|
-
readonly compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
117
|
-
readonly compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
118
|
-
readonly compile_to_mir_json: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
119
|
-
readonly compile_to_mir_messagepack: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
121
|
+
readonly compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
122
|
+
readonly compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
123
|
+
readonly compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
124
|
+
readonly compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
125
|
+
readonly compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
120
126
|
readonly current_stdlib_digest: () => [number, number];
|
|
121
127
|
readonly decode_buffer_asset: (a: number, b: number) => [number, number, number];
|
|
122
128
|
readonly decode_buffer_file: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -127,11 +133,15 @@ export interface InitOutput {
|
|
|
127
133
|
readonly frontendmessagepackcompilation_source_files_json: (a: number) => [number, number];
|
|
128
134
|
readonly frontendmessagepackcompilation_source_image_json: (a: number) => [number, number];
|
|
129
135
|
readonly inspect_project_image: (a: number, b: number) => [number, number, number, number];
|
|
136
|
+
readonly inspect_project_image_compile_constants: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
137
|
+
readonly inspect_source_compile_constants: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
138
|
+
readonly inspect_source_workspace_compile_constants: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
130
139
|
readonly materialize_project_image: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
131
140
|
readonly mir_schema_version: () => number;
|
|
132
141
|
readonly ondalsp_handle_message: (a: number, b: number, c: number) => [number, number, number, number];
|
|
133
142
|
readonly ondalsp_new: () => number;
|
|
134
143
|
readonly ondalsp_set_analysis_options: (a: number, b: number, c: number) => [number, number];
|
|
144
|
+
readonly project_image_format_version: () => number;
|
|
135
145
|
readonly webdecodedbufferasset_canonical_payload: (a: number) => [number, number];
|
|
136
146
|
readonly webdecodedbufferasset_channels: (a: number) => number;
|
|
137
147
|
readonly webdecodedbufferasset_element: (a: number) => [number, number];
|
|
@@ -148,12 +158,11 @@ export interface InitOutput {
|
|
|
148
158
|
readonly webprojectmaterializationplan_file_bytes: (a: number, b: number) => [number, number];
|
|
149
159
|
readonly webprojectmaterializationplan_file_count: (a: number) => number;
|
|
150
160
|
readonly webprojectmaterializationplan_file_path: (a: number, b: number) => [number, number];
|
|
151
|
-
readonly project_image_format_version: () => number;
|
|
152
161
|
readonly frontendmessagepackcompilation_take_mir: (a: number) => [number, number];
|
|
153
162
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
154
163
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
155
|
-
readonly __externref_table_dealloc: (a: number) => void;
|
|
156
164
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
165
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
157
166
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
158
167
|
readonly __wbindgen_start: () => void;
|
|
159
168
|
}
|
|
@@ -443,12 +443,15 @@ export function buffer_asset_format_version() {
|
|
|
443
443
|
* @param {Uint8Array} image_bytes
|
|
444
444
|
* @param {number} sample_rate
|
|
445
445
|
* @param {number} block_size
|
|
446
|
+
* @param {string} constants_json
|
|
446
447
|
* @returns {FrontendMessagePackCompilation}
|
|
447
448
|
*/
|
|
448
|
-
export function compile_project_image_to_mir_messagepack(image_bytes, sample_rate, block_size) {
|
|
449
|
+
export function compile_project_image_to_mir_messagepack(image_bytes, sample_rate, block_size, constants_json) {
|
|
449
450
|
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
450
451
|
const len0 = WASM_VECTOR_LEN;
|
|
451
|
-
const
|
|
452
|
+
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
453
|
+
const len1 = WASM_VECTOR_LEN;
|
|
454
|
+
const ret = wasm.compile_project_image_to_mir_messagepack(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
452
455
|
if (ret[2]) {
|
|
453
456
|
throw takeFromExternrefTable0(ret[1]);
|
|
454
457
|
}
|
|
@@ -460,14 +463,17 @@ export function compile_project_image_to_mir_messagepack(image_bytes, sample_rat
|
|
|
460
463
|
* @param {string} sources_json
|
|
461
464
|
* @param {number} sample_rate
|
|
462
465
|
* @param {number} block_size
|
|
466
|
+
* @param {string} constants_json
|
|
463
467
|
* @returns {FrontendJsonCompilation}
|
|
464
468
|
*/
|
|
465
|
-
export function compile_source_workspace_to_mir_json(entry_path, sources_json, sample_rate, block_size) {
|
|
469
|
+
export function compile_source_workspace_to_mir_json(entry_path, sources_json, sample_rate, block_size, constants_json) {
|
|
466
470
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
467
471
|
const len0 = WASM_VECTOR_LEN;
|
|
468
472
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
469
473
|
const len1 = WASM_VECTOR_LEN;
|
|
470
|
-
const
|
|
474
|
+
const ptr2 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
475
|
+
const len2 = WASM_VECTOR_LEN;
|
|
476
|
+
const ret = wasm.compile_source_workspace_to_mir_json(ptr0, len0, ptr1, len1, sample_rate, block_size, ptr2, len2);
|
|
471
477
|
if (ret[2]) {
|
|
472
478
|
throw takeFromExternrefTable0(ret[1]);
|
|
473
479
|
}
|
|
@@ -479,14 +485,17 @@ export function compile_source_workspace_to_mir_json(entry_path, sources_json, s
|
|
|
479
485
|
* @param {string} sources_json
|
|
480
486
|
* @param {number} sample_rate
|
|
481
487
|
* @param {number} block_size
|
|
488
|
+
* @param {string} constants_json
|
|
482
489
|
* @returns {FrontendMessagePackCompilation}
|
|
483
490
|
*/
|
|
484
|
-
export function compile_source_workspace_to_mir_messagepack(entry_path, sources_json, sample_rate, block_size) {
|
|
491
|
+
export function compile_source_workspace_to_mir_messagepack(entry_path, sources_json, sample_rate, block_size, constants_json) {
|
|
485
492
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
486
493
|
const len0 = WASM_VECTOR_LEN;
|
|
487
494
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
488
495
|
const len1 = WASM_VECTOR_LEN;
|
|
489
|
-
const
|
|
496
|
+
const ptr2 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
497
|
+
const len2 = WASM_VECTOR_LEN;
|
|
498
|
+
const ret = wasm.compile_source_workspace_to_mir_messagepack(ptr0, len0, ptr1, len1, sample_rate, block_size, ptr2, len2);
|
|
490
499
|
if (ret[2]) {
|
|
491
500
|
throw takeFromExternrefTable0(ret[1]);
|
|
492
501
|
}
|
|
@@ -497,12 +506,15 @@ export function compile_source_workspace_to_mir_messagepack(entry_path, sources_
|
|
|
497
506
|
* @param {string} source
|
|
498
507
|
* @param {number} sample_rate
|
|
499
508
|
* @param {number} block_size
|
|
509
|
+
* @param {string} constants_json
|
|
500
510
|
* @returns {FrontendJsonCompilation}
|
|
501
511
|
*/
|
|
502
|
-
export function compile_to_mir_json(source, sample_rate, block_size) {
|
|
512
|
+
export function compile_to_mir_json(source, sample_rate, block_size, constants_json) {
|
|
503
513
|
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
504
514
|
const len0 = WASM_VECTOR_LEN;
|
|
505
|
-
const
|
|
515
|
+
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
516
|
+
const len1 = WASM_VECTOR_LEN;
|
|
517
|
+
const ret = wasm.compile_to_mir_json(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
506
518
|
if (ret[2]) {
|
|
507
519
|
throw takeFromExternrefTable0(ret[1]);
|
|
508
520
|
}
|
|
@@ -513,12 +525,15 @@ export function compile_to_mir_json(source, sample_rate, block_size) {
|
|
|
513
525
|
* @param {string} source
|
|
514
526
|
* @param {number} sample_rate
|
|
515
527
|
* @param {number} block_size
|
|
528
|
+
* @param {string} constants_json
|
|
516
529
|
* @returns {FrontendMessagePackCompilation}
|
|
517
530
|
*/
|
|
518
|
-
export function compile_to_mir_messagepack(source, sample_rate, block_size) {
|
|
531
|
+
export function compile_to_mir_messagepack(source, sample_rate, block_size, constants_json) {
|
|
519
532
|
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
520
533
|
const len0 = WASM_VECTOR_LEN;
|
|
521
|
-
const
|
|
534
|
+
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
535
|
+
const len1 = WASM_VECTOR_LEN;
|
|
536
|
+
const ret = wasm.compile_to_mir_messagepack(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
522
537
|
if (ret[2]) {
|
|
523
538
|
throw takeFromExternrefTable0(ret[1]);
|
|
524
539
|
}
|
|
@@ -619,6 +634,99 @@ export function inspect_project_image(image_bytes) {
|
|
|
619
634
|
}
|
|
620
635
|
}
|
|
621
636
|
|
|
637
|
+
/**
|
|
638
|
+
* @param {Uint8Array} image_bytes
|
|
639
|
+
* @param {number} sample_rate
|
|
640
|
+
* @param {number} block_size
|
|
641
|
+
* @param {string} constants_json
|
|
642
|
+
* @returns {string}
|
|
643
|
+
*/
|
|
644
|
+
export function inspect_project_image_compile_constants(image_bytes, sample_rate, block_size, constants_json) {
|
|
645
|
+
let deferred4_0;
|
|
646
|
+
let deferred4_1;
|
|
647
|
+
try {
|
|
648
|
+
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
649
|
+
const len0 = WASM_VECTOR_LEN;
|
|
650
|
+
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
651
|
+
const len1 = WASM_VECTOR_LEN;
|
|
652
|
+
const ret = wasm.inspect_project_image_compile_constants(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
653
|
+
var ptr3 = ret[0];
|
|
654
|
+
var len3 = ret[1];
|
|
655
|
+
if (ret[3]) {
|
|
656
|
+
ptr3 = 0; len3 = 0;
|
|
657
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
658
|
+
}
|
|
659
|
+
deferred4_0 = ptr3;
|
|
660
|
+
deferred4_1 = len3;
|
|
661
|
+
return getStringFromWasm0(ptr3, len3);
|
|
662
|
+
} finally {
|
|
663
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* @param {string} source
|
|
669
|
+
* @param {number} sample_rate
|
|
670
|
+
* @param {number} block_size
|
|
671
|
+
* @param {string} constants_json
|
|
672
|
+
* @returns {string}
|
|
673
|
+
*/
|
|
674
|
+
export function inspect_source_compile_constants(source, sample_rate, block_size, constants_json) {
|
|
675
|
+
let deferred4_0;
|
|
676
|
+
let deferred4_1;
|
|
677
|
+
try {
|
|
678
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
679
|
+
const len0 = WASM_VECTOR_LEN;
|
|
680
|
+
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
681
|
+
const len1 = WASM_VECTOR_LEN;
|
|
682
|
+
const ret = wasm.inspect_source_compile_constants(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
683
|
+
var ptr3 = ret[0];
|
|
684
|
+
var len3 = ret[1];
|
|
685
|
+
if (ret[3]) {
|
|
686
|
+
ptr3 = 0; len3 = 0;
|
|
687
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
688
|
+
}
|
|
689
|
+
deferred4_0 = ptr3;
|
|
690
|
+
deferred4_1 = len3;
|
|
691
|
+
return getStringFromWasm0(ptr3, len3);
|
|
692
|
+
} finally {
|
|
693
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* @param {string} entry_path
|
|
699
|
+
* @param {string} sources_json
|
|
700
|
+
* @param {number} sample_rate
|
|
701
|
+
* @param {number} block_size
|
|
702
|
+
* @param {string} constants_json
|
|
703
|
+
* @returns {string}
|
|
704
|
+
*/
|
|
705
|
+
export function inspect_source_workspace_compile_constants(entry_path, sources_json, sample_rate, block_size, constants_json) {
|
|
706
|
+
let deferred5_0;
|
|
707
|
+
let deferred5_1;
|
|
708
|
+
try {
|
|
709
|
+
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
710
|
+
const len0 = WASM_VECTOR_LEN;
|
|
711
|
+
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
712
|
+
const len1 = WASM_VECTOR_LEN;
|
|
713
|
+
const ptr2 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
714
|
+
const len2 = WASM_VECTOR_LEN;
|
|
715
|
+
const ret = wasm.inspect_source_workspace_compile_constants(ptr0, len0, ptr1, len1, sample_rate, block_size, ptr2, len2);
|
|
716
|
+
var ptr4 = ret[0];
|
|
717
|
+
var len4 = ret[1];
|
|
718
|
+
if (ret[3]) {
|
|
719
|
+
ptr4 = 0; len4 = 0;
|
|
720
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
721
|
+
}
|
|
722
|
+
deferred5_0 = ptr4;
|
|
723
|
+
deferred5_1 = len4;
|
|
724
|
+
return getStringFromWasm0(ptr4, len4);
|
|
725
|
+
} finally {
|
|
726
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
622
730
|
/**
|
|
623
731
|
* @param {Uint8Array} image_bytes
|
|
624
732
|
* @param {string} asset_file_names_json
|
|
Binary file
|
|
@@ -9,11 +9,11 @@ export const __wbg_webmaterializedprojectbuilder_free: (a: number, b: number) =>
|
|
|
9
9
|
export const __wbg_webprojectimagebuilder_free: (a: number, b: number) => void;
|
|
10
10
|
export const __wbg_webprojectmaterializationplan_free: (a: number, b: number) => void;
|
|
11
11
|
export const buffer_asset_format_version: () => number;
|
|
12
|
-
export const compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
13
|
-
export const compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
14
|
-
export const compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
15
|
-
export const compile_to_mir_json: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
16
|
-
export const compile_to_mir_messagepack: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
12
|
+
export const compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
13
|
+
export const compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
14
|
+
export const compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
15
|
+
export const compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
16
|
+
export const compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
17
17
|
export const current_stdlib_digest: () => [number, number];
|
|
18
18
|
export const decode_buffer_asset: (a: number, b: number) => [number, number, number];
|
|
19
19
|
export const decode_buffer_file: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -24,11 +24,15 @@ export const frontendjsoncompilation_take_mir: (a: number) => [number, number];
|
|
|
24
24
|
export const frontendmessagepackcompilation_source_files_json: (a: number) => [number, number];
|
|
25
25
|
export const frontendmessagepackcompilation_source_image_json: (a: number) => [number, number];
|
|
26
26
|
export const inspect_project_image: (a: number, b: number) => [number, number, number, number];
|
|
27
|
+
export const inspect_project_image_compile_constants: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
28
|
+
export const inspect_source_compile_constants: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
29
|
+
export const inspect_source_workspace_compile_constants: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
27
30
|
export const materialize_project_image: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
28
31
|
export const mir_schema_version: () => number;
|
|
29
32
|
export const ondalsp_handle_message: (a: number, b: number, c: number) => [number, number, number, number];
|
|
30
33
|
export const ondalsp_new: () => number;
|
|
31
34
|
export const ondalsp_set_analysis_options: (a: number, b: number, c: number) => [number, number];
|
|
35
|
+
export const project_image_format_version: () => number;
|
|
32
36
|
export const webdecodedbufferasset_canonical_payload: (a: number) => [number, number];
|
|
33
37
|
export const webdecodedbufferasset_channels: (a: number) => number;
|
|
34
38
|
export const webdecodedbufferasset_element: (a: number) => [number, number];
|
|
@@ -45,11 +49,10 @@ export const webprojectmaterializationplan_directories_json: (a: number) => [num
|
|
|
45
49
|
export const webprojectmaterializationplan_file_bytes: (a: number, b: number) => [number, number];
|
|
46
50
|
export const webprojectmaterializationplan_file_count: (a: number) => number;
|
|
47
51
|
export const webprojectmaterializationplan_file_path: (a: number, b: number) => [number, number];
|
|
48
|
-
export const project_image_format_version: () => number;
|
|
49
52
|
export const frontendmessagepackcompilation_take_mir: (a: number) => [number, number];
|
|
50
53
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
51
54
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
52
|
-
export const __externref_table_dealloc: (a: number) => void;
|
|
53
55
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
56
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
54
57
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
55
58
|
export const __wbindgen_start: () => void;
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ONDA_VERSION = "0.
|
|
1
|
+
export const ONDA_VERSION = "0.8.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onda-lang/wasm-compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Onda source-to-WebAssembly compiler for browsers and Node.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"bin",
|
|
45
45
|
"dist",
|
|
46
46
|
"src",
|
|
47
|
+
"api.md",
|
|
47
48
|
"LICENSE",
|
|
48
49
|
"README.md",
|
|
49
50
|
"THIRD_PARTY_NOTICES.md"
|
|
@@ -54,12 +55,12 @@
|
|
|
54
55
|
"check:versions": "node ../../scripts/sync-package-versions.mjs --check",
|
|
55
56
|
"test": "npm run build && npm run test:built",
|
|
56
57
|
"test:built": "node --test ./test/*.test.js",
|
|
57
|
-
"test:pack": "node ./scripts/test-package.mjs",
|
|
58
|
-
"test:pack:built": "node ./scripts/test-package.mjs --skip-build",
|
|
59
|
-
"prepack": "npm run build"
|
|
58
|
+
"test:pack": "node ../../scripts/stage-web-api-docs.mjs && node ./scripts/test-package.mjs",
|
|
59
|
+
"test:pack:built": "node ../../scripts/stage-web-api-docs.mjs && node ./scripts/test-package.mjs --skip-build",
|
|
60
|
+
"prepack": "npm run build && node ../../scripts/stage-web-api-docs.mjs"
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
62
|
-
"@onda-lang/processor-abi": "0.
|
|
63
|
+
"@onda-lang/processor-abi": "0.8.0",
|
|
63
64
|
"binaryen": "130.0.0"
|
|
64
65
|
},
|
|
65
66
|
"publishConfig": {
|
package/src/index.d.ts
CHANGED
|
@@ -47,9 +47,56 @@ export interface OndaCodegenOptions {
|
|
|
47
47
|
export interface OndaCompileOptions {
|
|
48
48
|
sampleRate?: number;
|
|
49
49
|
blockSize?: number;
|
|
50
|
+
constants?: Map<string, OndaCompileConstValue>
|
|
51
|
+
| Record<string, OndaCompileConstValue>;
|
|
50
52
|
codegen?: OndaCodegenOptions;
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
export interface OndaCompileConstInspectionOptions {
|
|
56
|
+
sampleRate?: number;
|
|
57
|
+
blockSize?: number;
|
|
58
|
+
/** Optional partial overrides; omitted declarations retain their authored values. */
|
|
59
|
+
constants?: Map<string, OndaCompileConstValue>
|
|
60
|
+
| Record<string, OndaCompileConstValue>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface OndaLspAnalysisOptions {
|
|
64
|
+
sampleRate?: number;
|
|
65
|
+
blockSize?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type OndaCompileConstValue =
|
|
69
|
+
| boolean
|
|
70
|
+
| number
|
|
71
|
+
| bigint
|
|
72
|
+
| boolean[]
|
|
73
|
+
| Uint8Array
|
|
74
|
+
| Int32Array
|
|
75
|
+
| BigInt64Array
|
|
76
|
+
| Float32Array
|
|
77
|
+
| Float64Array;
|
|
78
|
+
|
|
79
|
+
export type OndaCompileConstElement = "bool" | "i32" | "i64" | "f32" | "f64";
|
|
80
|
+
export type OndaCompileConstKind = "scalar" | "fixed-array" | "array";
|
|
81
|
+
export type OndaResolvedCompileConstValue =
|
|
82
|
+
| boolean
|
|
83
|
+
| number
|
|
84
|
+
| bigint
|
|
85
|
+
| Uint8Array
|
|
86
|
+
| Int32Array
|
|
87
|
+
| BigInt64Array
|
|
88
|
+
| Float32Array
|
|
89
|
+
| Float64Array;
|
|
90
|
+
|
|
91
|
+
export interface OndaCompileConstDescriptor {
|
|
92
|
+
name: string;
|
|
93
|
+
element: OndaCompileConstElement;
|
|
94
|
+
kind: OndaCompileConstKind;
|
|
95
|
+
/** One for scalars; the resolved length for either array kind. */
|
|
96
|
+
elementCount: number;
|
|
97
|
+
value: OndaResolvedCompileConstValue;
|
|
98
|
+
}
|
|
99
|
+
|
|
53
100
|
export interface OndaSourceWorkspace {
|
|
54
101
|
entry: string;
|
|
55
102
|
sources: Record<string, string>;
|
|
@@ -141,14 +188,26 @@ export interface OndaCompilerInstance {
|
|
|
141
188
|
source: string,
|
|
142
189
|
options?: OndaCompileOptions,
|
|
143
190
|
): Promise<OndaCompilationResult>;
|
|
191
|
+
inspectSourceConstants(
|
|
192
|
+
source: string,
|
|
193
|
+
options?: OndaCompileConstInspectionOptions,
|
|
194
|
+
): Promise<OndaCompileConstDescriptor[]>;
|
|
144
195
|
compileWorkspace(
|
|
145
196
|
workspace: OndaSourceWorkspace,
|
|
146
197
|
options?: OndaCompileOptions,
|
|
147
198
|
): Promise<OndaCompilationResult>;
|
|
199
|
+
inspectWorkspaceConstants(
|
|
200
|
+
workspace: OndaSourceWorkspace,
|
|
201
|
+
options?: OndaCompileConstInspectionOptions,
|
|
202
|
+
): Promise<OndaCompileConstDescriptor[]>;
|
|
148
203
|
compileProjectImage(
|
|
149
204
|
imageBytes: ArrayBuffer | ArrayBufferView,
|
|
150
205
|
options?: OndaCompileOptions,
|
|
151
206
|
): Promise<OndaCompilationResult>;
|
|
207
|
+
inspectProjectImageConstants(
|
|
208
|
+
imageBytes: ArrayBuffer | ArrayBufferView,
|
|
209
|
+
options?: OndaCompileConstInspectionOptions,
|
|
210
|
+
): Promise<OndaCompileConstDescriptor[]>;
|
|
152
211
|
createProjectImage(
|
|
153
212
|
sourceGraph: OndaSourceGraph,
|
|
154
213
|
buffers?: Map<string, ArrayBuffer | ArrayBufferView>
|
|
@@ -174,7 +233,8 @@ export interface OndaCompilerInstance {
|
|
|
174
233
|
): Promise<OndaBufferAssetBinding>;
|
|
175
234
|
projectCapabilities(): Promise<OndaProjectCapabilities>;
|
|
176
235
|
sendLspMessage(message: OndaLspMessage): Promise<OndaLspMessage[]>;
|
|
177
|
-
setLspAnalysisOptions(options?:
|
|
236
|
+
setLspAnalysisOptions(options?: OndaLspAnalysisOptions): Promise<void>;
|
|
237
|
+
/** Idempotently releases compiler resources. All subsequent operations reject. */
|
|
178
238
|
dispose(): Promise<void>;
|
|
179
239
|
}
|
|
180
240
|
|