nuxt-nightly 4.2.2-29401219.f70b70c9 → 4.2.2-29401233.c82876fd

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 (2) hide show
  1. package/dist/index.mjs +12 -16
  2. package/package.json +9 -9
package/dist/index.mjs CHANGED
@@ -31,7 +31,7 @@ import { runInNewContext } from 'node:vm';
31
31
  import { klona } from 'klona';
32
32
  import { parseAndWalk, ScopeTracker, walk, isBindingIdentifier, getUndeclaredIdentifiersInFunction } from 'oxc-walker';
33
33
  import { parseSync } from 'oxc-parser';
34
- import { transform } from 'oxc-transform';
34
+ import { transformSync } from 'oxc-transform';
35
35
  import { splitByCase, kebabCase, pascalCase, camelCase } from 'scule';
36
36
  import { createUnplugin } from 'unplugin';
37
37
  import { findStaticImports, findExports, parseStaticImport, parseNodeModulePath, lookupNodeModuleSubpath } from 'mlly';
@@ -48,7 +48,7 @@ import { debounce } from 'perfect-debounce';
48
48
  import { resolveSchema, generateTypes } from 'untyped';
49
49
  import untypedPlugin from 'untyped/babel-plugin';
50
50
  import { createJiti } from 'jiti';
51
- import { minify } from 'oxc-minify';
51
+ import { minifySync } from 'oxc-minify';
52
52
  import { performance } from 'node:perf_hooks';
53
53
  import { resolve as resolve$1 } from 'node:path';
54
54
  import { parseTar, createTar } from 'nanotar';
@@ -417,7 +417,7 @@ function getRouteMeta(contents, absolutePath, extraExtractionKeys = /* @__PURE__
417
417
  let code = script.code;
418
418
  let pageExtractArgument = node.expression.arguments[0];
419
419
  if (/tsx?/.test(script.loader)) {
420
- const transformed = transform(absolutePath, script.code.slice(node.start, node.end), { lang: script.loader });
420
+ const transformed = transformSync(absolutePath, script.code.slice(node.start, node.end), { lang: script.loader });
421
421
  if (transformed.errors.length) {
422
422
  for (const error of transformed.errors) {
423
423
  logger.warn(`Error while transforming \`${fnName}()\`` + error.codeframe);
@@ -3835,7 +3835,7 @@ function addDeclarationTemplates(ctx, options) {
3835
3835
  });
3836
3836
  }
3837
3837
 
3838
- const version = "4.2.2-29401219.f70b70c9";
3838
+ const version = "4.2.2-29401233.c82876fd";
3839
3839
 
3840
3840
  function createImportProtectionPatterns(nuxt, options) {
3841
3841
  const patterns = [];
@@ -4713,8 +4713,8 @@ function ResolveExternalsPlugin(nuxt) {
4713
4713
 
4714
4714
  function transformAndMinify(input, options) {
4715
4715
  const oxcOptions = tryUseNuxt()?.options.oxc;
4716
- const transformResult = transform("", input, { ...oxcOptions?.transform.options, ...options });
4717
- const minifyResult = minify("", transformResult.code, { compress: { target: oxcOptions?.transform.options.target || "esnext" } });
4716
+ const transformResult = transformSync("", input, { ...oxcOptions?.transform.options, ...options });
4717
+ const minifyResult = minifySync("", transformResult.code, { compress: { target: oxcOptions?.transform.options.target || "esnext" } });
4718
4718
  return {
4719
4719
  ...transformResult,
4720
4720
  ...minifyResult
@@ -4746,17 +4746,13 @@ function PrehydrateTransformPlugin(options = {}) {
4746
4746
  return;
4747
4747
  }
4748
4748
  const needsAttr = callback.params.length > 0;
4749
- try {
4750
- const { code: result } = transformAndMinify(`forEach(${code.slice(callback.start, callback.end)})`, { lang: "ts" });
4751
- const cleaned = result.slice("forEach".length).replace(/;$/, "");
4752
- const args = [JSON.stringify(cleaned)];
4753
- if (needsAttr) {
4754
- args.push(JSON.stringify(hash(result).slice(0, 10)));
4755
- }
4756
- s.overwrite(callback.start, callback.end, args.join(", "));
4757
- } catch (e) {
4758
- console.error(`[nuxt] Could not transform onPrehydrate in \`${id}\`:`, e);
4749
+ const { code: result } = transformAndMinify(`forEach(${code.slice(callback.start, callback.end)})`, { lang: "ts" });
4750
+ const cleaned = result.slice("forEach".length).replace(/;$/, "");
4751
+ const args = [JSON.stringify(cleaned)];
4752
+ if (needsAttr) {
4753
+ args.push(JSON.stringify(hash(result).slice(0, 10)));
4759
4754
  }
4755
+ s.overwrite(callback.start, callback.end, args.join(", "));
4760
4756
  }
4761
4757
  });
4762
4758
  if (s.hasChanged()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-nightly",
3
- "version": "4.2.2-29401219.f70b70c9",
3
+ "version": "4.2.2-29401233.c82876fd",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -67,11 +67,11 @@
67
67
  "@dxup/nuxt": "^0.2.1",
68
68
  "@nuxt/cli": "npm:@nuxt/cli-nightly@latest",
69
69
  "@nuxt/devtools": "^3.1.0",
70
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.2-29401219.f70b70c9",
71
- "@nuxt/nitro-server": "npm:@nuxt/nitro-server-nightly@4.2.2-29401219.f70b70c9",
72
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.2-29401219.f70b70c9",
70
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.2-29401233.c82876fd",
71
+ "@nuxt/nitro-server": "npm:@nuxt/nitro-server-nightly@4.2.2-29401233.c82876fd",
72
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.2-29401233.c82876fd",
73
73
  "@nuxt/telemetry": "^2.6.6",
74
- "@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.2.2-29401219.f70b70c9",
74
+ "@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.2.2-29401233.c82876fd",
75
75
  "@unhead/vue": "^2.0.19",
76
76
  "@vue/shared": "^3.5.24",
77
77
  "c12": "^3.3.2",
@@ -99,10 +99,10 @@
99
99
  "ofetch": "^1.5.1",
100
100
  "ohash": "^2.0.11",
101
101
  "on-change": "^6.0.1",
102
- "oxc-minify": "^0.97.0",
103
- "oxc-parser": "^0.97.0",
104
- "oxc-transform": "^0.97.0",
105
- "oxc-walker": "^0.5.2",
102
+ "oxc-minify": "^0.98.0",
103
+ "oxc-parser": "^0.98.0",
104
+ "oxc-transform": "^0.98.0",
105
+ "oxc-walker": "^0.6.0",
106
106
  "pathe": "^2.0.3",
107
107
  "perfect-debounce": "^2.0.0",
108
108
  "pkg-types": "^2.3.0",