ic-mops 2.0.0 → 2.0.1
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/commands/build.ts +40 -13
- package/dist/commands/build.js +36 -12
- package/dist/package.json +2 -2
- package/dist/types.d.ts +1 -0
- package/dist/wasm/pkg/nodejs/wasm.d.ts +3 -0
- package/dist/wasm/pkg/nodejs/wasm.js +323 -17
- package/dist/wasm/pkg/nodejs/wasm_bg.wasm +0 -0
- package/dist/wasm/pkg/nodejs/wasm_bg.wasm.d.ts +6 -1
- package/dist/wasm/pkg/web/wasm.d.ts +10 -1
- package/dist/wasm/pkg/web/wasm.js +300 -21
- package/dist/wasm/pkg/web/wasm_bg.wasm +0 -0
- package/dist/wasm/pkg/web/wasm_bg.wasm.d.ts +6 -1
- package/dist/wasm.d.ts +6 -1
- package/package.json +2 -2
- package/tests/__snapshots__/cli.test.ts.snap +16 -16
- package/tests/build/error/src/Bar.mo +2 -2
- package/tests/build/success/candid/bar.did +1 -0
- package/tests/build/success/mops.toml +8 -3
- package/types.ts +1 -0
- package/wasm/Cargo.toml +2 -5
- package/wasm/pkg/nodejs/wasm.d.ts +3 -0
- package/wasm/pkg/nodejs/wasm.js +323 -17
- package/wasm/pkg/nodejs/wasm_bg.wasm +0 -0
- package/wasm/pkg/nodejs/wasm_bg.wasm.d.ts +6 -1
- package/wasm/pkg/web/wasm.d.ts +10 -1
- package/wasm/pkg/web/wasm.js +300 -21
- package/wasm/pkg/web/wasm_bg.wasm +0 -0
- package/wasm/pkg/web/wasm_bg.wasm.d.ts +6 -1
- package/wasm/src/lib.rs +10 -5
- package/wasm/src/utils.rs +15 -0
- package/wasm/src/wasm_utils.rs +79 -0
- package/wasm.ts +10 -1
|
@@ -1,9 +1,95 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function addToExternrefTable0(obj) {
|
|
4
|
+
const idx = wasm.__externref_table_alloc();
|
|
5
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
6
|
+
return idx;
|
|
7
|
+
}
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
function debugString(val) {
|
|
10
|
+
// primitive types
|
|
11
|
+
const type = typeof val;
|
|
12
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
13
|
+
return `${val}`;
|
|
14
|
+
}
|
|
15
|
+
if (type == 'string') {
|
|
16
|
+
return `"${val}"`;
|
|
17
|
+
}
|
|
18
|
+
if (type == 'symbol') {
|
|
19
|
+
const description = val.description;
|
|
20
|
+
if (description == null) {
|
|
21
|
+
return 'Symbol';
|
|
22
|
+
} else {
|
|
23
|
+
return `Symbol(${description})`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (type == 'function') {
|
|
27
|
+
const name = val.name;
|
|
28
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
29
|
+
return `Function(${name})`;
|
|
30
|
+
} else {
|
|
31
|
+
return 'Function';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// objects
|
|
35
|
+
if (Array.isArray(val)) {
|
|
36
|
+
const length = val.length;
|
|
37
|
+
let debug = '[';
|
|
38
|
+
if (length > 0) {
|
|
39
|
+
debug += debugString(val[0]);
|
|
40
|
+
}
|
|
41
|
+
for(let i = 1; i < length; i++) {
|
|
42
|
+
debug += ', ' + debugString(val[i]);
|
|
43
|
+
}
|
|
44
|
+
debug += ']';
|
|
45
|
+
return debug;
|
|
46
|
+
}
|
|
47
|
+
// Test for built-in
|
|
48
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
49
|
+
let className;
|
|
50
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
51
|
+
className = builtInMatches[1];
|
|
52
|
+
} else {
|
|
53
|
+
// Failed to match the standard '[object ClassName]'
|
|
54
|
+
return toString.call(val);
|
|
55
|
+
}
|
|
56
|
+
if (className == 'Object') {
|
|
57
|
+
// we're a user defined class or Object
|
|
58
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
59
|
+
// easier than looping through ownProperties of `val`.
|
|
60
|
+
try {
|
|
61
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
62
|
+
} catch (_) {
|
|
63
|
+
return 'Object';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// errors
|
|
67
|
+
if (val instanceof Error) {
|
|
68
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
69
|
+
}
|
|
70
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
71
|
+
return className;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
75
|
+
ptr = ptr >>> 0;
|
|
76
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let cachedDataViewMemory0 = null;
|
|
80
|
+
function getDataViewMemory0() {
|
|
81
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
82
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
83
|
+
}
|
|
84
|
+
return cachedDataViewMemory0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getStringFromWasm0(ptr, len) {
|
|
88
|
+
ptr = ptr >>> 0;
|
|
89
|
+
return decodeText(ptr, len);
|
|
90
|
+
}
|
|
6
91
|
|
|
92
|
+
let cachedUint8ArrayMemory0 = null;
|
|
7
93
|
function getUint8ArrayMemory0() {
|
|
8
94
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
95
|
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
@@ -11,21 +97,27 @@ function getUint8ArrayMemory0() {
|
|
|
11
97
|
return cachedUint8ArrayMemory0;
|
|
12
98
|
}
|
|
13
99
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
read: arg.length,
|
|
22
|
-
written: buf.length
|
|
23
|
-
};
|
|
100
|
+
function handleError(f, args) {
|
|
101
|
+
try {
|
|
102
|
+
return f.apply(this, args);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
const idx = addToExternrefTable0(e);
|
|
105
|
+
wasm.__wbindgen_exn_store(idx);
|
|
24
106
|
}
|
|
25
107
|
}
|
|
26
108
|
|
|
27
|
-
function
|
|
109
|
+
function isLikeNone(x) {
|
|
110
|
+
return x === undefined || x === null;
|
|
111
|
+
}
|
|
28
112
|
|
|
113
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
114
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
115
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
116
|
+
WASM_VECTOR_LEN = arg.length;
|
|
117
|
+
return ptr;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
29
121
|
if (realloc === undefined) {
|
|
30
122
|
const buf = cachedTextEncoder.encode(arg);
|
|
31
123
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
@@ -46,7 +138,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
46
138
|
if (code > 0x7F) break;
|
|
47
139
|
mem[ptr + offset] = code;
|
|
48
140
|
}
|
|
49
|
-
|
|
50
141
|
if (offset !== len) {
|
|
51
142
|
if (offset !== 0) {
|
|
52
143
|
arg = arg.slice(offset);
|
|
@@ -62,6 +153,59 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
62
153
|
WASM_VECTOR_LEN = offset;
|
|
63
154
|
return ptr;
|
|
64
155
|
}
|
|
156
|
+
|
|
157
|
+
function takeFromExternrefTable0(idx) {
|
|
158
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
159
|
+
wasm.__externref_table_dealloc(idx);
|
|
160
|
+
return value;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
164
|
+
cachedTextDecoder.decode();
|
|
165
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
166
|
+
let numBytesDecoded = 0;
|
|
167
|
+
function decodeText(ptr, len) {
|
|
168
|
+
numBytesDecoded += len;
|
|
169
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
170
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
171
|
+
cachedTextDecoder.decode();
|
|
172
|
+
numBytesDecoded = len;
|
|
173
|
+
}
|
|
174
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const cachedTextEncoder = new TextEncoder();
|
|
178
|
+
|
|
179
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
180
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
181
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
182
|
+
view.set(buf);
|
|
183
|
+
return {
|
|
184
|
+
read: arg.length,
|
|
185
|
+
written: buf.length
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
let WASM_VECTOR_LEN = 0;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @param {Uint8Array} bytes
|
|
194
|
+
* @param {any} custom_sections
|
|
195
|
+
* @returns {Uint8Array}
|
|
196
|
+
*/
|
|
197
|
+
export function add_custom_sections(bytes, custom_sections) {
|
|
198
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
199
|
+
const len0 = WASM_VECTOR_LEN;
|
|
200
|
+
const ret = wasm.add_custom_sections(ptr0, len0, custom_sections);
|
|
201
|
+
if (ret[3]) {
|
|
202
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
203
|
+
}
|
|
204
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
205
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
206
|
+
return v2;
|
|
207
|
+
}
|
|
208
|
+
|
|
65
209
|
/**
|
|
66
210
|
* @param {string} new_interface
|
|
67
211
|
* @param {string} original_interface
|
|
@@ -83,7 +227,6 @@ async function __wbg_load(module, imports) {
|
|
|
83
227
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
84
228
|
try {
|
|
85
229
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
86
|
-
|
|
87
230
|
} catch (e) {
|
|
88
231
|
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
89
232
|
|
|
@@ -98,13 +241,11 @@ async function __wbg_load(module, imports) {
|
|
|
98
241
|
|
|
99
242
|
const bytes = await module.arrayBuffer();
|
|
100
243
|
return await WebAssembly.instantiate(bytes, imports);
|
|
101
|
-
|
|
102
244
|
} else {
|
|
103
245
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
104
246
|
|
|
105
247
|
if (instance instanceof WebAssembly.Instance) {
|
|
106
248
|
return { instance, module };
|
|
107
|
-
|
|
108
249
|
} else {
|
|
109
250
|
return instance;
|
|
110
251
|
}
|
|
@@ -114,6 +255,147 @@ async function __wbg_load(module, imports) {
|
|
|
114
255
|
function __wbg_get_imports() {
|
|
115
256
|
const imports = {};
|
|
116
257
|
imports.wbg = {};
|
|
258
|
+
imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
259
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
260
|
+
return ret;
|
|
261
|
+
};
|
|
262
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
263
|
+
const ret = String(arg1);
|
|
264
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
+
const len1 = WASM_VECTOR_LEN;
|
|
266
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
267
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
268
|
+
};
|
|
269
|
+
imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
270
|
+
const v = arg0;
|
|
271
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
272
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
273
|
+
};
|
|
274
|
+
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
275
|
+
const ret = debugString(arg1);
|
|
276
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
277
|
+
const len1 = WASM_VECTOR_LEN;
|
|
278
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
279
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
280
|
+
};
|
|
281
|
+
imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
282
|
+
const ret = arg0 in arg1;
|
|
283
|
+
return ret;
|
|
284
|
+
};
|
|
285
|
+
imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
|
|
286
|
+
const ret = typeof(arg0) === 'function';
|
|
287
|
+
return ret;
|
|
288
|
+
};
|
|
289
|
+
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
290
|
+
const val = arg0;
|
|
291
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
292
|
+
return ret;
|
|
293
|
+
};
|
|
294
|
+
imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
295
|
+
const ret = arg0 === undefined;
|
|
296
|
+
return ret;
|
|
297
|
+
};
|
|
298
|
+
imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
299
|
+
const ret = arg0 == arg1;
|
|
300
|
+
return ret;
|
|
301
|
+
};
|
|
302
|
+
imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
303
|
+
const obj = arg1;
|
|
304
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
305
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
306
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
307
|
+
};
|
|
308
|
+
imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
309
|
+
const obj = arg1;
|
|
310
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
311
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
312
|
+
var len1 = WASM_VECTOR_LEN;
|
|
313
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
314
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
315
|
+
};
|
|
316
|
+
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
317
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
318
|
+
};
|
|
319
|
+
imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
|
|
320
|
+
const ret = arg0.call(arg1);
|
|
321
|
+
return ret;
|
|
322
|
+
}, arguments) };
|
|
323
|
+
imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
324
|
+
const ret = arg0.done;
|
|
325
|
+
return ret;
|
|
326
|
+
};
|
|
327
|
+
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
328
|
+
const ret = arg0[arg1 >>> 0];
|
|
329
|
+
return ret;
|
|
330
|
+
};
|
|
331
|
+
imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
|
|
332
|
+
const ret = Reflect.get(arg0, arg1);
|
|
333
|
+
return ret;
|
|
334
|
+
}, arguments) };
|
|
335
|
+
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
336
|
+
const ret = arg0[arg1];
|
|
337
|
+
return ret;
|
|
338
|
+
};
|
|
339
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
340
|
+
let result;
|
|
341
|
+
try {
|
|
342
|
+
result = arg0 instanceof ArrayBuffer;
|
|
343
|
+
} catch (_) {
|
|
344
|
+
result = false;
|
|
345
|
+
}
|
|
346
|
+
const ret = result;
|
|
347
|
+
return ret;
|
|
348
|
+
};
|
|
349
|
+
imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
350
|
+
let result;
|
|
351
|
+
try {
|
|
352
|
+
result = arg0 instanceof Uint8Array;
|
|
353
|
+
} catch (_) {
|
|
354
|
+
result = false;
|
|
355
|
+
}
|
|
356
|
+
const ret = result;
|
|
357
|
+
return ret;
|
|
358
|
+
};
|
|
359
|
+
imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
|
|
360
|
+
const ret = Array.isArray(arg0);
|
|
361
|
+
return ret;
|
|
362
|
+
};
|
|
363
|
+
imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
|
|
364
|
+
const ret = Symbol.iterator;
|
|
365
|
+
return ret;
|
|
366
|
+
};
|
|
367
|
+
imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
368
|
+
const ret = arg0.length;
|
|
369
|
+
return ret;
|
|
370
|
+
};
|
|
371
|
+
imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
|
|
372
|
+
const ret = arg0.length;
|
|
373
|
+
return ret;
|
|
374
|
+
};
|
|
375
|
+
imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
376
|
+
const ret = new Uint8Array(arg0);
|
|
377
|
+
return ret;
|
|
378
|
+
};
|
|
379
|
+
imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
|
|
380
|
+
const ret = arg0.next;
|
|
381
|
+
return ret;
|
|
382
|
+
};
|
|
383
|
+
imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
|
|
384
|
+
const ret = arg0.next();
|
|
385
|
+
return ret;
|
|
386
|
+
}, arguments) };
|
|
387
|
+
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
388
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
389
|
+
};
|
|
390
|
+
imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
391
|
+
const ret = arg0.value;
|
|
392
|
+
return ret;
|
|
393
|
+
};
|
|
394
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
395
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
396
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
397
|
+
return ret;
|
|
398
|
+
};
|
|
117
399
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
118
400
|
const table = wasm.__wbindgen_externrefs;
|
|
119
401
|
const offset = table.grow(4);
|
|
@@ -122,7 +404,6 @@ function __wbg_get_imports() {
|
|
|
122
404
|
table.set(offset + 1, null);
|
|
123
405
|
table.set(offset + 2, true);
|
|
124
406
|
table.set(offset + 3, false);
|
|
125
|
-
;
|
|
126
407
|
};
|
|
127
408
|
|
|
128
409
|
return imports;
|
|
@@ -131,6 +412,7 @@ function __wbg_get_imports() {
|
|
|
131
412
|
function __wbg_finalize_init(instance, module) {
|
|
132
413
|
wasm = instance.exports;
|
|
133
414
|
__wbg_init.__wbindgen_wasm_module = module;
|
|
415
|
+
cachedDataViewMemory0 = null;
|
|
134
416
|
cachedUint8ArrayMemory0 = null;
|
|
135
417
|
|
|
136
418
|
|
|
@@ -151,13 +433,10 @@ function initSync(module) {
|
|
|
151
433
|
}
|
|
152
434
|
|
|
153
435
|
const imports = __wbg_get_imports();
|
|
154
|
-
|
|
155
436
|
if (!(module instanceof WebAssembly.Module)) {
|
|
156
437
|
module = new WebAssembly.Module(module);
|
|
157
438
|
}
|
|
158
|
-
|
|
159
439
|
const instance = new WebAssembly.Instance(module, imports);
|
|
160
|
-
|
|
161
440
|
return __wbg_finalize_init(instance, module);
|
|
162
441
|
}
|
|
163
442
|
|
|
Binary file
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const is_candid_compatible: (a: number, b: number, c: number, d: number) => number;
|
|
5
|
-
export const
|
|
5
|
+
export const add_custom_sections: (a: number, b: number, c: any) => [number, number, number, number];
|
|
6
6
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
7
7
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
8
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
9
|
+
export const __externref_table_alloc: () => number;
|
|
10
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
11
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
12
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
8
13
|
export const __wbindgen_start: () => void;
|
package/dist/wasm.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export interface CustomSection {
|
|
2
|
+
name: string;
|
|
3
|
+
data: string;
|
|
4
|
+
}
|
|
1
5
|
export interface WasmBindings {
|
|
2
|
-
is_candid_compatible: (
|
|
6
|
+
is_candid_compatible: (newCandid: string, originalCandid: string) => boolean;
|
|
7
|
+
add_custom_sections: (bytes: Uint8Array, customSections: CustomSection[]) => Uint8Array;
|
|
3
8
|
}
|
|
4
9
|
export declare function setWasmBindings(newBindings: WasmBindings): void;
|
|
5
10
|
export declare function getWasmBindings(): WasmBindings;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ic-mops",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mops": "dist/bin/mops.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"semver": "7.7.1",
|
|
92
92
|
"stream-to-promise": "3.0.0",
|
|
93
93
|
"string-width": "7.2.0",
|
|
94
|
-
"tar": "7.
|
|
94
|
+
"tar": "7.5.6",
|
|
95
95
|
"terminal-size": "4.0.0"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
@@ -5,7 +5,7 @@ exports[`mops build error 1`] = `
|
|
|
5
5
|
"exitCode": 0,
|
|
6
6
|
"stderr": "",
|
|
7
7
|
"stdout": "
|
|
8
|
-
> ic-mops@
|
|
8
|
+
> ic-mops@2.0.1 mops
|
|
9
9
|
> tsx ./environments/nodejs/cli build foo
|
|
10
10
|
|
|
11
11
|
build canister foo
|
|
@@ -19,7 +19,7 @@ exports[`mops build error 2`] = `
|
|
|
19
19
|
"exitCode": 1,
|
|
20
20
|
"stderr": "Candid compatibility check failed for canister bar",
|
|
21
21
|
"stdout": "
|
|
22
|
-
> ic-mops@
|
|
22
|
+
> ic-mops@2.0.1 mops
|
|
23
23
|
> tsx ./environments/nodejs/cli build bar
|
|
24
24
|
|
|
25
25
|
build canister bar",
|
|
@@ -31,7 +31,7 @@ exports[`mops build error 3`] = `
|
|
|
31
31
|
"exitCode": 1,
|
|
32
32
|
"stderr": "Candid compatibility check failed for canister bar",
|
|
33
33
|
"stdout": "
|
|
34
|
-
> ic-mops@
|
|
34
|
+
> ic-mops@2.0.1 mops
|
|
35
35
|
> tsx ./environments/nodejs/cli build foo bar
|
|
36
36
|
|
|
37
37
|
build canister foo
|
|
@@ -44,7 +44,7 @@ exports[`mops build success 1`] = `
|
|
|
44
44
|
"exitCode": 0,
|
|
45
45
|
"stderr": "",
|
|
46
46
|
"stdout": "
|
|
47
|
-
> ic-mops@
|
|
47
|
+
> ic-mops@2.0.1 mops
|
|
48
48
|
> tsx ./environments/nodejs/cli build
|
|
49
49
|
|
|
50
50
|
build canister foo
|
|
@@ -59,7 +59,7 @@ exports[`mops build success 2`] = `
|
|
|
59
59
|
"exitCode": 0,
|
|
60
60
|
"stderr": "",
|
|
61
61
|
"stdout": "
|
|
62
|
-
> ic-mops@
|
|
62
|
+
> ic-mops@2.0.1 mops
|
|
63
63
|
> tsx ./environments/nodejs/cli build foo
|
|
64
64
|
|
|
65
65
|
build canister foo
|
|
@@ -73,7 +73,7 @@ exports[`mops build success 3`] = `
|
|
|
73
73
|
"exitCode": 0,
|
|
74
74
|
"stderr": "",
|
|
75
75
|
"stdout": "
|
|
76
|
-
> ic-mops@
|
|
76
|
+
> ic-mops@2.0.1 mops
|
|
77
77
|
> tsx ./environments/nodejs/cli build bar
|
|
78
78
|
|
|
79
79
|
build canister bar
|
|
@@ -87,7 +87,7 @@ exports[`mops build success 4`] = `
|
|
|
87
87
|
"exitCode": 0,
|
|
88
88
|
"stderr": "",
|
|
89
89
|
"stdout": "
|
|
90
|
-
> ic-mops@
|
|
90
|
+
> ic-mops@2.0.1 mops
|
|
91
91
|
> tsx ./environments/nodejs/cli build foo bar
|
|
92
92
|
|
|
93
93
|
build canister foo
|
|
@@ -102,7 +102,7 @@ exports[`mops check-candid 1`] = `
|
|
|
102
102
|
"exitCode": 0,
|
|
103
103
|
"stderr": "",
|
|
104
104
|
"stdout": "
|
|
105
|
-
> ic-mops@
|
|
105
|
+
> ic-mops@2.0.1 mops
|
|
106
106
|
> tsx ./environments/nodejs/cli check-candid a.did a.did
|
|
107
107
|
|
|
108
108
|
✓ Candid compatibility check passed",
|
|
@@ -114,7 +114,7 @@ exports[`mops check-candid 2`] = `
|
|
|
114
114
|
"exitCode": 0,
|
|
115
115
|
"stderr": "",
|
|
116
116
|
"stdout": "
|
|
117
|
-
> ic-mops@
|
|
117
|
+
> ic-mops@2.0.1 mops
|
|
118
118
|
> tsx ./environments/nodejs/cli check-candid b.did b.did
|
|
119
119
|
|
|
120
120
|
✓ Candid compatibility check passed",
|
|
@@ -126,7 +126,7 @@ exports[`mops check-candid 3`] = `
|
|
|
126
126
|
"exitCode": 0,
|
|
127
127
|
"stderr": "",
|
|
128
128
|
"stdout": "
|
|
129
|
-
> ic-mops@
|
|
129
|
+
> ic-mops@2.0.1 mops
|
|
130
130
|
> tsx ./environments/nodejs/cli check-candid c.did c.did
|
|
131
131
|
|
|
132
132
|
✓ Candid compatibility check passed",
|
|
@@ -138,7 +138,7 @@ exports[`mops check-candid 4`] = `
|
|
|
138
138
|
"exitCode": 0,
|
|
139
139
|
"stderr": "",
|
|
140
140
|
"stdout": "
|
|
141
|
-
> ic-mops@
|
|
141
|
+
> ic-mops@2.0.1 mops
|
|
142
142
|
> tsx ./environments/nodejs/cli check-candid a.did b.did
|
|
143
143
|
|
|
144
144
|
✓ Candid compatibility check passed",
|
|
@@ -150,7 +150,7 @@ exports[`mops check-candid 5`] = `
|
|
|
150
150
|
"exitCode": 0,
|
|
151
151
|
"stderr": "",
|
|
152
152
|
"stdout": "
|
|
153
|
-
> ic-mops@
|
|
153
|
+
> ic-mops@2.0.1 mops
|
|
154
154
|
> tsx ./environments/nodejs/cli check-candid b.did a.did
|
|
155
155
|
|
|
156
156
|
✓ Candid compatibility check passed",
|
|
@@ -162,7 +162,7 @@ exports[`mops check-candid 6`] = `
|
|
|
162
162
|
"exitCode": 1,
|
|
163
163
|
"stderr": "✖ Candid compatibility check failed",
|
|
164
164
|
"stdout": "
|
|
165
|
-
> ic-mops@
|
|
165
|
+
> ic-mops@2.0.1 mops
|
|
166
166
|
> tsx ./environments/nodejs/cli check-candid a.did c.did
|
|
167
167
|
",
|
|
168
168
|
}
|
|
@@ -173,7 +173,7 @@ exports[`mops check-candid 7`] = `
|
|
|
173
173
|
"exitCode": 1,
|
|
174
174
|
"stderr": "✖ Candid compatibility check failed",
|
|
175
175
|
"stdout": "
|
|
176
|
-
> ic-mops@
|
|
176
|
+
> ic-mops@2.0.1 mops
|
|
177
177
|
> tsx ./environments/nodejs/cli check-candid c.did a.did
|
|
178
178
|
",
|
|
179
179
|
}
|
|
@@ -184,7 +184,7 @@ exports[`mops check-candid 8`] = `
|
|
|
184
184
|
"exitCode": 1,
|
|
185
185
|
"stderr": "✖ Candid compatibility check failed",
|
|
186
186
|
"stdout": "
|
|
187
|
-
> ic-mops@
|
|
187
|
+
> ic-mops@2.0.1 mops
|
|
188
188
|
> tsx ./environments/nodejs/cli check-candid b.did c.did
|
|
189
189
|
",
|
|
190
190
|
}
|
|
@@ -195,7 +195,7 @@ exports[`mops check-candid 9`] = `
|
|
|
195
195
|
"exitCode": 1,
|
|
196
196
|
"stderr": "✖ Candid compatibility check failed",
|
|
197
197
|
"stdout": "
|
|
198
|
-
> ic-mops@
|
|
198
|
+
> ic-mops@2.0.1 mops
|
|
199
199
|
> tsx ./environments/nodejs/cli check-candid c.did b.did
|
|
200
200
|
",
|
|
201
201
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
[dependencies]
|
|
2
2
|
core = "1.0.0"
|
|
3
3
|
|
|
4
|
-
[canisters]
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
[canisters.foo]
|
|
5
|
+
main = "src/Foo.mo"
|
|
6
|
+
|
|
7
|
+
[canisters.bar]
|
|
8
|
+
main = "src/Bar.mo"
|
|
9
|
+
args = ["--incremental-gc"]
|
|
10
|
+
candid = "candid/bar.did"
|
|
11
|
+
initArg = "(\"Custom text\")"
|
|
7
12
|
|
|
8
13
|
[build]
|
|
9
14
|
args = ["--release"]
|
package/types.ts
CHANGED
package/wasm/Cargo.toml
CHANGED
|
@@ -7,9 +7,6 @@ edition = "2018"
|
|
|
7
7
|
[lib]
|
|
8
8
|
crate-type = ["cdylib", "rlib"]
|
|
9
9
|
|
|
10
|
-
[features]
|
|
11
|
-
default = ["console_error_panic_hook"]
|
|
12
|
-
|
|
13
10
|
[dependencies]
|
|
14
11
|
serde = { version = "1.0", features = ["derive"] }
|
|
15
12
|
serde_json = "1.0"
|
|
@@ -17,8 +14,8 @@ wasm-bindgen = { version = "0.2" }
|
|
|
17
14
|
serde-wasm-bindgen = "0.6"
|
|
18
15
|
candid = "0.10"
|
|
19
16
|
candid_parser = "0.2"
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
walrus = "0.24.4"
|
|
18
|
+
libflate = "2.0"
|
|
22
19
|
|
|
23
20
|
[dev-dependencies]
|
|
24
21
|
wasm-bindgen-test = "0.3.49"
|