@next/swc-wasm-web 16.1.1-canary.16 → 16.1.1-canary.18

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/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-web",
3
- "type": "module",
4
- "version": "16.1.1-canary.16",
3
+ "version": "16.1.1-canary.18",
5
4
  "files": [
6
5
  "wasm_bg.wasm",
7
6
  "wasm.js",
8
7
  "wasm.d.ts"
9
8
  ],
10
- "main": "wasm.js",
9
+ "module": "wasm.js",
11
10
  "types": "wasm.d.ts",
12
11
  "sideEffects": [
13
12
  "./snippets/*"
package/wasm.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function mdxCompile(value: string, opts: any): Promise<any>;
4
3
  export function mdxCompileSync(value: string, opts: any): any;
5
- export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
4
+ export function mdxCompile(value: string, opts: any): Promise<any>;
5
+ export function minifySync(s: string, opts: any): any;
6
+ export function minify(s: string, opts: any): Promise<any>;
7
+ export function transformSync(s: any, opts: any): any;
6
8
  export function transform(s: any, opts: any): Promise<any>;
7
9
  export function parseSync(s: string, opts: any): any;
8
10
  export function parse(s: string, opts: any): Promise<any>;
9
- export function transformSync(s: any, opts: any): any;
10
- export function minifySync(s: string, opts: any): any;
11
- export function minify(s: string, opts: any): Promise<any>;
11
+ export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
12
12
 
13
13
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
14
14
 
@@ -31,8 +31,8 @@ export interface InitOutput {
31
31
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
32
32
  readonly __wbindgen_export_6: WebAssembly.Table;
33
33
  readonly __externref_table_dealloc: (a: number) => void;
34
- readonly closure1162_externref_shim: (a: number, b: number, c: any) => void;
35
- readonly closure126_externref_shim: (a: number, b: number, c: any, d: any) => void;
34
+ readonly closure1211_externref_shim: (a: number, b: number, c: any) => void;
35
+ readonly closure124_externref_shim: (a: number, b: number, c: any, d: any) => void;
36
36
  readonly __wbindgen_start: () => void;
37
37
  }
38
38
 
package/wasm.js CHANGED
@@ -212,15 +212,6 @@ function debugString(val) {
212
212
  // TODO we could test for more things here, like `Set`s and `Map`s.
213
213
  return className;
214
214
  }
215
- /**
216
- * @param {string} value
217
- * @param {any} opts
218
- * @returns {Promise<any>}
219
- */
220
- export function mdxCompile(value, opts) {
221
- const ret = wasm.mdxCompile(value, opts);
222
- return ret;
223
- }
224
215
 
225
216
  function takeFromExternrefTable0(idx) {
226
217
  const value = wasm.__wbindgen_export_4.get(idx);
@@ -240,44 +231,13 @@ export function mdxCompileSync(value, opts) {
240
231
  return takeFromExternrefTable0(ret[0]);
241
232
  }
242
233
 
243
- function passArray8ToWasm0(arg, malloc) {
244
- const ptr = malloc(arg.length * 1, 1) >>> 0;
245
- getUint8ArrayMemory0().set(arg, ptr / 1);
246
- WASM_VECTOR_LEN = arg.length;
247
- return ptr;
248
- }
249
- /**
250
- * @param {Uint8Array} content
251
- * @param {string} template_path
252
- * @param {string} next_package_dir_path
253
- * @param {any} replacements
254
- * @param {any} injections
255
- * @param {any} imports
256
- * @returns {string}
257
- */
258
- export function expandNextJsTemplate(content, template_path, next_package_dir_path, replacements, injections, imports) {
259
- const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
260
- const len0 = WASM_VECTOR_LEN;
261
- const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
262
- const len1 = WASM_VECTOR_LEN;
263
- const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
264
- const len2 = WASM_VECTOR_LEN;
265
- const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
266
- if (ret[3]) {
267
- throw takeFromExternrefTable0(ret[2]);
268
- }
269
- var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
270
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
271
- return v4;
272
- }
273
-
274
234
  /**
275
- * @param {any} s
235
+ * @param {string} value
276
236
  * @param {any} opts
277
237
  * @returns {Promise<any>}
278
238
  */
279
- export function transform(s, opts) {
280
- const ret = wasm.transform(s, opts);
239
+ export function mdxCompile(value, opts) {
240
+ const ret = wasm.mdxCompile(value, opts);
281
241
  return ret;
282
242
  }
283
243
 
@@ -286,8 +246,8 @@ export function transform(s, opts) {
286
246
  * @param {any} opts
287
247
  * @returns {any}
288
248
  */
289
- export function parseSync(s, opts) {
290
- const ret = wasm.parseSync(s, opts);
249
+ export function minifySync(s, opts) {
250
+ const ret = wasm.minifySync(s, opts);
291
251
  if (ret[2]) {
292
252
  throw takeFromExternrefTable0(ret[1]);
293
253
  }
@@ -299,8 +259,8 @@ export function parseSync(s, opts) {
299
259
  * @param {any} opts
300
260
  * @returns {Promise<any>}
301
261
  */
302
- export function parse(s, opts) {
303
- const ret = wasm.parse(s, opts);
262
+ export function minify(s, opts) {
263
+ const ret = wasm.minify(s, opts);
304
264
  return ret;
305
265
  }
306
266
 
@@ -317,13 +277,23 @@ export function transformSync(s, opts) {
317
277
  return takeFromExternrefTable0(ret[0]);
318
278
  }
319
279
 
280
+ /**
281
+ * @param {any} s
282
+ * @param {any} opts
283
+ * @returns {Promise<any>}
284
+ */
285
+ export function transform(s, opts) {
286
+ const ret = wasm.transform(s, opts);
287
+ return ret;
288
+ }
289
+
320
290
  /**
321
291
  * @param {string} s
322
292
  * @param {any} opts
323
293
  * @returns {any}
324
294
  */
325
- export function minifySync(s, opts) {
326
- const ret = wasm.minifySync(s, opts);
295
+ export function parseSync(s, opts) {
296
+ const ret = wasm.parseSync(s, opts);
327
297
  if (ret[2]) {
328
298
  throw takeFromExternrefTable0(ret[1]);
329
299
  }
@@ -335,17 +305,48 @@ export function minifySync(s, opts) {
335
305
  * @param {any} opts
336
306
  * @returns {Promise<any>}
337
307
  */
338
- export function minify(s, opts) {
339
- const ret = wasm.minify(s, opts);
308
+ export function parse(s, opts) {
309
+ const ret = wasm.parse(s, opts);
340
310
  return ret;
341
311
  }
342
312
 
313
+ function passArray8ToWasm0(arg, malloc) {
314
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
315
+ getUint8ArrayMemory0().set(arg, ptr / 1);
316
+ WASM_VECTOR_LEN = arg.length;
317
+ return ptr;
318
+ }
319
+ /**
320
+ * @param {Uint8Array} content
321
+ * @param {string} template_path
322
+ * @param {string} next_package_dir_path
323
+ * @param {any} replacements
324
+ * @param {any} injections
325
+ * @param {any} imports
326
+ * @returns {string}
327
+ */
328
+ export function expandNextJsTemplate(content, template_path, next_package_dir_path, replacements, injections, imports) {
329
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
330
+ const len0 = WASM_VECTOR_LEN;
331
+ const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
332
+ const len1 = WASM_VECTOR_LEN;
333
+ const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
+ const len2 = WASM_VECTOR_LEN;
335
+ const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
336
+ if (ret[3]) {
337
+ throw takeFromExternrefTable0(ret[2]);
338
+ }
339
+ var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
340
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
341
+ return v4;
342
+ }
343
+
343
344
  function __wbg_adapter_50(arg0, arg1, arg2) {
344
- wasm.closure1162_externref_shim(arg0, arg1, arg2);
345
+ wasm.closure1211_externref_shim(arg0, arg1, arg2);
345
346
  }
346
347
 
347
- function __wbg_adapter_79(arg0, arg1, arg2, arg3) {
348
- wasm.closure126_externref_shim(arg0, arg1, arg2, arg3);
348
+ function __wbg_adapter_89(arg0, arg1, arg2, arg3) {
349
+ wasm.closure124_externref_shim(arg0, arg1, arg2, arg3);
349
350
  }
350
351
 
351
352
  async function __wbg_load(module, imports) {
@@ -488,7 +489,7 @@ function __wbg_get_imports() {
488
489
  const a = state0.a;
489
490
  state0.a = 0;
490
491
  try {
491
- return __wbg_adapter_79(a, state0.b, arg0, arg1);
492
+ return __wbg_adapter_89(a, state0.b, arg0, arg1);
492
493
  } finally {
493
494
  state0.a = a;
494
495
  }
@@ -611,8 +612,8 @@ function __wbg_get_imports() {
611
612
  const ret = false;
612
613
  return ret;
613
614
  };
614
- imports.wbg.__wbindgen_closure_wrapper23447 = function(arg0, arg1, arg2) {
615
- const ret = makeMutClosure(arg0, arg1, 1163, __wbg_adapter_50);
615
+ imports.wbg.__wbindgen_closure_wrapper25315 = function(arg0, arg1, arg2) {
616
+ const ret = makeMutClosure(arg0, arg1, 1212, __wbg_adapter_50);
616
617
  return ret;
617
618
  };
618
619
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
package/wasm_bg.wasm CHANGED
Binary file