@next/swc-wasm-nodejs 15.6.0-canary.9 → 16.0.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-nodejs",
3
- "version": "15.6.0-canary.9",
3
+ "version": "16.0.0-beta.0",
4
4
  "files": [
5
5
  "wasm_bg.wasm",
6
6
  "wasm.js",
package/wasm.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function mdxCompileSync(value: string, opts: any): any;
4
- export function mdxCompile(value: string, opts: any): Promise<any>;
3
+ export function parse(s: string, opts: any): Promise<any>;
4
+ export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
5
+ export function transform(s: any, opts: any): Promise<any>;
6
+ export function transformSync(s: any, opts: any): any;
5
7
  export function minifySync(s: string, opts: any): any;
6
8
  export function minify(s: string, opts: any): Promise<any>;
7
- export function transformSync(s: any, opts: any): any;
8
- export function transform(s: any, opts: any): Promise<any>;
9
9
  export function parseSync(s: string, opts: any): any;
10
- export function parse(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;
10
+ export function mdxCompileSync(value: string, opts: any): any;
11
+ export function mdxCompile(value: string, opts: any): Promise<any>;
package/wasm.js CHANGED
@@ -216,6 +216,22 @@ function debugString(val) {
216
216
  // TODO we could test for more things here, like `Set`s and `Map`s.
217
217
  return className;
218
218
  }
219
+ /**
220
+ * @param {string} s
221
+ * @param {any} opts
222
+ * @returns {Promise<any>}
223
+ */
224
+ module.exports.parse = function(s, opts) {
225
+ const ret = wasm.parse(s, opts);
226
+ return ret;
227
+ };
228
+
229
+ function passArray8ToWasm0(arg, malloc) {
230
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
231
+ getUint8ArrayMemory0().set(arg, ptr / 1);
232
+ WASM_VECTOR_LEN = arg.length;
233
+ return ptr;
234
+ }
219
235
 
220
236
  function takeFromExternrefTable0(idx) {
221
237
  const value = wasm.__wbindgen_export_4.get(idx);
@@ -223,35 +239,47 @@ function takeFromExternrefTable0(idx) {
223
239
  return value;
224
240
  }
225
241
  /**
226
- * @param {string} value
227
- * @param {any} opts
228
- * @returns {any}
242
+ * @param {Uint8Array} content
243
+ * @param {string} template_path
244
+ * @param {string} next_package_dir_path
245
+ * @param {any} replacements
246
+ * @param {any} injections
247
+ * @param {any} imports
248
+ * @returns {string}
229
249
  */
230
- module.exports.mdxCompileSync = function(value, opts) {
231
- const ret = wasm.mdxCompileSync(value, opts);
232
- if (ret[2]) {
233
- throw takeFromExternrefTable0(ret[1]);
250
+ module.exports.expandNextJsTemplate = function(content, template_path, next_package_dir_path, replacements, injections, imports) {
251
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
252
+ const len0 = WASM_VECTOR_LEN;
253
+ const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
254
+ const len1 = WASM_VECTOR_LEN;
255
+ const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
256
+ const len2 = WASM_VECTOR_LEN;
257
+ const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
258
+ if (ret[3]) {
259
+ throw takeFromExternrefTable0(ret[2]);
234
260
  }
235
- return takeFromExternrefTable0(ret[0]);
261
+ var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
262
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
263
+ return v4;
236
264
  };
237
265
 
238
266
  /**
239
- * @param {string} value
267
+ * @param {any} s
240
268
  * @param {any} opts
241
269
  * @returns {Promise<any>}
242
270
  */
243
- module.exports.mdxCompile = function(value, opts) {
244
- const ret = wasm.mdxCompile(value, opts);
271
+ module.exports.transform = function(s, opts) {
272
+ const ret = wasm.transform(s, opts);
245
273
  return ret;
246
274
  };
247
275
 
248
276
  /**
249
- * @param {string} s
277
+ * @param {any} s
250
278
  * @param {any} opts
251
279
  * @returns {any}
252
280
  */
253
- module.exports.minifySync = function(s, opts) {
254
- const ret = wasm.minifySync(s, opts);
281
+ module.exports.transformSync = function(s, opts) {
282
+ const ret = wasm.transformSync(s, opts);
255
283
  if (ret[2]) {
256
284
  throw takeFromExternrefTable0(ret[1]);
257
285
  }
@@ -261,20 +289,10 @@ module.exports.minifySync = function(s, opts) {
261
289
  /**
262
290
  * @param {string} s
263
291
  * @param {any} opts
264
- * @returns {Promise<any>}
265
- */
266
- module.exports.minify = function(s, opts) {
267
- const ret = wasm.minify(s, opts);
268
- return ret;
269
- };
270
-
271
- /**
272
- * @param {any} s
273
- * @param {any} opts
274
292
  * @returns {any}
275
293
  */
276
- module.exports.transformSync = function(s, opts) {
277
- const ret = wasm.transformSync(s, opts);
294
+ module.exports.minifySync = function(s, opts) {
295
+ const ret = wasm.minifySync(s, opts);
278
296
  if (ret[2]) {
279
297
  throw takeFromExternrefTable0(ret[1]);
280
298
  }
@@ -282,12 +300,12 @@ module.exports.transformSync = function(s, opts) {
282
300
  };
283
301
 
284
302
  /**
285
- * @param {any} s
303
+ * @param {string} s
286
304
  * @param {any} opts
287
305
  * @returns {Promise<any>}
288
306
  */
289
- module.exports.transform = function(s, opts) {
290
- const ret = wasm.transform(s, opts);
307
+ module.exports.minify = function(s, opts) {
308
+ const ret = wasm.minify(s, opts);
291
309
  return ret;
292
310
  };
293
311
 
@@ -305,52 +323,34 @@ module.exports.parseSync = function(s, opts) {
305
323
  };
306
324
 
307
325
  /**
308
- * @param {string} s
326
+ * @param {string} value
309
327
  * @param {any} opts
310
- * @returns {Promise<any>}
328
+ * @returns {any}
311
329
  */
312
- module.exports.parse = function(s, opts) {
313
- const ret = wasm.parse(s, opts);
314
- return ret;
330
+ module.exports.mdxCompileSync = function(value, opts) {
331
+ const ret = wasm.mdxCompileSync(value, opts);
332
+ if (ret[2]) {
333
+ throw takeFromExternrefTable0(ret[1]);
334
+ }
335
+ return takeFromExternrefTable0(ret[0]);
315
336
  };
316
337
 
317
- function passArray8ToWasm0(arg, malloc) {
318
- const ptr = malloc(arg.length * 1, 1) >>> 0;
319
- getUint8ArrayMemory0().set(arg, ptr / 1);
320
- WASM_VECTOR_LEN = arg.length;
321
- return ptr;
322
- }
323
338
  /**
324
- * @param {Uint8Array} content
325
- * @param {string} template_path
326
- * @param {string} next_package_dir_path
327
- * @param {any} replacements
328
- * @param {any} injections
329
- * @param {any} imports
330
- * @returns {string}
339
+ * @param {string} value
340
+ * @param {any} opts
341
+ * @returns {Promise<any>}
331
342
  */
332
- module.exports.expandNextJsTemplate = function(content, template_path, next_package_dir_path, replacements, injections, imports) {
333
- const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
334
- const len0 = WASM_VECTOR_LEN;
335
- const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
336
- const len1 = WASM_VECTOR_LEN;
337
- const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
338
- const len2 = WASM_VECTOR_LEN;
339
- const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
340
- if (ret[3]) {
341
- throw takeFromExternrefTable0(ret[2]);
342
- }
343
- var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
344
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
345
- return v4;
343
+ module.exports.mdxCompile = function(value, opts) {
344
+ const ret = wasm.mdxCompile(value, opts);
345
+ return ret;
346
346
  };
347
347
 
348
348
  function __wbg_adapter_50(arg0, arg1, arg2) {
349
- wasm.closure1132_externref_shim(arg0, arg1, arg2);
349
+ wasm.closure1154_externref_shim(arg0, arg1, arg2);
350
350
  }
351
351
 
352
- function __wbg_adapter_101(arg0, arg1, arg2, arg3) {
353
- wasm.closure123_externref_shim(arg0, arg1, arg2, arg3);
352
+ function __wbg_adapter_81(arg0, arg1, arg2, arg3) {
353
+ wasm.closure122_externref_shim(arg0, arg1, arg2, arg3);
354
354
  }
355
355
 
356
356
  module.exports.__wbg_String_fed4d24b68977888 = function(arg0, arg1) {
@@ -480,7 +480,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
480
480
  const a = state0.a;
481
481
  state0.a = 0;
482
482
  try {
483
- return __wbg_adapter_101(a, state0.b, arg0, arg1);
483
+ return __wbg_adapter_81(a, state0.b, arg0, arg1);
484
484
  } finally {
485
485
  state0.a = a;
486
486
  }
@@ -630,8 +630,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
630
630
  return ret;
631
631
  };
632
632
 
633
- module.exports.__wbindgen_closure_wrapper23807 = function(arg0, arg1, arg2) {
634
- const ret = makeMutClosure(arg0, arg1, 1133, __wbg_adapter_50);
633
+ module.exports.__wbindgen_closure_wrapper24026 = function(arg0, arg1, arg2) {
634
+ const ret = makeMutClosure(arg0, arg1, 1155, __wbg_adapter_50);
635
635
  return ret;
636
636
  };
637
637
 
package/wasm_bg.wasm CHANGED
Binary file