nuxt-nightly 4.2.2-29404491.1c73525a → 4.2.2-29413365.2a912219

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.
@@ -1,5 +1,6 @@
1
1
  import { useRouter } from "./router.js";
2
2
  import { useNuxtApp } from "../nuxt.js";
3
+ let _isHmrUpdating = false;
3
4
  export async function callOnce(...args) {
4
5
  const autoKey = typeof args[args.length - 1] === "string" ? args.pop() : void 0;
5
6
  if (typeof args[0] !== "string") {
@@ -24,7 +25,9 @@ export async function callOnce(...args) {
24
25
  cleanups.push(nuxtApp.hooks.hook("page:start", callback), useRouter().beforeResolve(callback));
25
26
  }
26
27
  if (nuxtApp.payload.once.has(_key)) {
27
- return;
28
+ if (!import.meta.dev || !_isHmrUpdating) {
29
+ return;
30
+ }
28
31
  }
29
32
  nuxtApp._once ||= {};
30
33
  nuxtApp._once[_key] ||= fn() || true;
@@ -32,3 +35,15 @@ export async function callOnce(...args) {
32
35
  nuxtApp.payload.once.add(_key);
33
36
  delete nuxtApp._once[_key];
34
37
  }
38
+ if (import.meta.hot) {
39
+ import.meta.hot.on("vite:beforeUpdate", (payload) => {
40
+ if (payload.updates.some((u) => u.type === "js-update")) {
41
+ _isHmrUpdating = true;
42
+ }
43
+ });
44
+ import.meta.hot.on("vite:afterUpdate", (payload) => {
45
+ if (payload.updates.some((u) => u.type === "js-update")) {
46
+ _isHmrUpdating = false;
47
+ }
48
+ });
49
+ }
package/dist/index.mjs CHANGED
@@ -3837,7 +3837,7 @@ function addDeclarationTemplates(ctx, options) {
3837
3837
  });
3838
3838
  }
3839
3839
 
3840
- const version = "4.2.2-29404491.1c73525a";
3840
+ const version = "4.2.2-29413365.2a912219";
3841
3841
 
3842
3842
  function createImportProtectionPatterns(nuxt, options) {
3843
3843
  const patterns = [];
@@ -3851,11 +3851,13 @@ function createImportProtectionPatterns(nuxt, options) {
3851
3851
  "Importing directly from a `nuxt.config` file is not allowed. Instead, use runtime config or a module."
3852
3852
  ]);
3853
3853
  patterns.push([/(^|node_modules\/)@vue\/composition-api/]);
3854
- for (const mod of nuxt.options.modules.filter((m) => typeof m === "string")) {
3855
- patterns.push([
3856
- new RegExp(`^${escapeRE(mod)}$`),
3857
- "Importing directly from module entry-points is not allowed."
3858
- ]);
3854
+ for (const mod of nuxt.options._installedModules) {
3855
+ if (mod.entryPath) {
3856
+ patterns.push([
3857
+ new RegExp(`^${escapeRE(mod.entryPath)}$`),
3858
+ "Importing directly from module entry-points is not allowed."
3859
+ ]);
3860
+ }
3859
3861
  }
3860
3862
  for (const i of [/(^|node_modules\/)@nuxt\/(cli|kit|test-utils)/, /(^|node_modules\/)nuxi/, /(^|node_modules\/)nitro(?:pack)?(?:-nightly)?(?:$|\/)(?!(?:dist\/)?(?:node_modules|presets|runtime|types))/, /(^|node_modules\/)nuxt\/(config|kit|schema)/]) {
3861
3863
  patterns.push([i, `This module cannot be imported in ${context}.`]);
@@ -5182,25 +5184,6 @@ Using \`${fallbackCompatibilityDate}\` as fallback. More info at: ${colors.under
5182
5184
  rootDir: nuxt.options.rootDir,
5183
5185
  composables: nuxt.options.optimization.keyedComposables
5184
5186
  }));
5185
- const sharedDir = withTrailingSlash(resolve(nuxt.options.rootDir, nuxt.options.dir.shared));
5186
- const relativeSharedDir = withTrailingSlash(relative(nuxt.options.rootDir, resolve(nuxt.options.rootDir, nuxt.options.dir.shared)));
5187
- const sharedPatterns = [/^#shared\//, new RegExp("^" + escapeRE(sharedDir)), new RegExp("^" + escapeRE(relativeSharedDir))];
5188
- const sharedProtectionConfig = {
5189
- cwd: nuxt.options.rootDir,
5190
- include: sharedPatterns,
5191
- patterns: createImportProtectionPatterns(nuxt, { context: "shared" })
5192
- };
5193
- addVitePlugin(() => ImpoundPlugin.vite(sharedProtectionConfig), { server: false });
5194
- addWebpackPlugin(() => ImpoundPlugin.webpack(sharedProtectionConfig), { server: false });
5195
- const nuxtProtectionConfig = {
5196
- cwd: nuxt.options.rootDir,
5197
- // Exclude top-level resolutions by plugins
5198
- exclude: [relative(nuxt.options.rootDir, join(nuxt.options.srcDir, "index.html")), ...sharedPatterns],
5199
- patterns: createImportProtectionPatterns(nuxt, { context: "nuxt-app" })
5200
- };
5201
- addVitePlugin(() => Object.assign(ImpoundPlugin.vite({ ...nuxtProtectionConfig, error: false }), { name: "nuxt:import-protection" }), { client: false });
5202
- addVitePlugin(() => Object.assign(ImpoundPlugin.vite({ ...nuxtProtectionConfig, error: true }), { name: "nuxt:import-protection" }), { server: false });
5203
- addWebpackPlugin(() => ImpoundPlugin.webpack(nuxtProtectionConfig));
5204
5187
  addVitePlugin(() => ResolveDeepImportsPlugin(nuxt));
5205
5188
  addVitePlugin(() => ResolveExternalsPlugin(nuxt), { prepend: true });
5206
5189
  addBuildPlugin(PrehydrateTransformPlugin({ sourcemap: !!nuxt.options.sourcemap.server || !!nuxt.options.sourcemap.client }));
@@ -5233,6 +5216,25 @@ Using \`${fallbackCompatibilityDate}\` as fallback. More info at: ${colors.under
5233
5216
  composables: nuxt.options.optimization.treeShake.composables.client
5234
5217
  }), { server: false });
5235
5218
  }
5219
+ const sharedDir = withTrailingSlash(resolve(nuxt.options.rootDir, nuxt.options.dir.shared));
5220
+ const relativeSharedDir = withTrailingSlash(relative(nuxt.options.rootDir, resolve(nuxt.options.rootDir, nuxt.options.dir.shared)));
5221
+ const sharedPatterns = [/^#shared\//, new RegExp("^" + escapeRE(sharedDir)), new RegExp("^" + escapeRE(relativeSharedDir))];
5222
+ const sharedProtectionConfig = {
5223
+ cwd: nuxt.options.rootDir,
5224
+ include: sharedPatterns,
5225
+ patterns: createImportProtectionPatterns(nuxt, { context: "shared" })
5226
+ };
5227
+ addVitePlugin(() => ImpoundPlugin.vite(sharedProtectionConfig), { server: false });
5228
+ addWebpackPlugin(() => ImpoundPlugin.webpack(sharedProtectionConfig), { server: false });
5229
+ const nuxtProtectionConfig = {
5230
+ cwd: nuxt.options.rootDir,
5231
+ // Exclude top-level resolutions by plugins
5232
+ exclude: [relative(nuxt.options.rootDir, join(nuxt.options.srcDir, "index.html")), ...sharedPatterns],
5233
+ patterns: createImportProtectionPatterns(nuxt, { context: "nuxt-app" })
5234
+ };
5235
+ addVitePlugin(() => Object.assign(ImpoundPlugin.vite({ ...nuxtProtectionConfig, error: false }), { name: "nuxt:import-protection" }), { client: false });
5236
+ addVitePlugin(() => Object.assign(ImpoundPlugin.vite({ ...nuxtProtectionConfig, error: true }), { name: "nuxt:import-protection" }), { server: false });
5237
+ addWebpackPlugin(() => ImpoundPlugin.webpack(nuxtProtectionConfig));
5236
5238
  });
5237
5239
  if (!nuxt.options.dev) {
5238
5240
  addBuildPlugin(DevOnlyPlugin({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-nightly",
3
- "version": "4.2.2-29404491.1c73525a",
3
+ "version": "4.2.2-29413365.2a912219",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -67,15 +67,15 @@
67
67
  "@dxup/nuxt": "^0.2.2",
68
68
  "@nuxt/cli": "npm:@nuxt/cli-nightly@latest",
69
69
  "@nuxt/devtools": "^3.1.1",
70
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.2-29404491.1c73525a",
71
- "@nuxt/nitro-server": "npm:@nuxt/nitro-server-nightly@4.2.2-29404491.1c73525a",
72
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.2-29404491.1c73525a",
70
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.2-29413365.2a912219",
71
+ "@nuxt/nitro-server": "npm:@nuxt/nitro-server-nightly@4.2.2-29413365.2a912219",
72
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.2-29413365.2a912219",
73
73
  "@nuxt/telemetry": "^2.6.6",
74
- "@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.2.2-29404491.1c73525a",
74
+ "@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.2.2-29413365.2a912219",
75
75
  "@unhead/vue": "^2.0.19",
76
76
  "@vue/shared": "^3.5.25",
77
77
  "c12": "^3.3.2",
78
- "chokidar": "^4.0.3",
78
+ "chokidar": "^5.0.0",
79
79
  "compatx": "^0.2.0",
80
80
  "consola": "^3.4.2",
81
81
  "cookie-es": "^2.0.0",