@nuxt/cli-nightly 3.31.0-20251204-152235-b04de4f → 3.31.0-20251204-153044-8079cc1

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,5 @@
1
1
  import "../logger-B4ge7MhP.mjs";
2
- import { t as initialize } from "../dev-DtQo0jDZ.mjs";
2
+ import { t as initialize } from "../dev-BPdQ9vYt.mjs";
3
3
  import "../kit-CPEUdXTm.mjs";
4
4
  import "../versions-CTlxnxbH.mjs";
5
5
  import "../banner-drlfl0J-.mjs";
@@ -7,7 +7,7 @@ import { provider } from "std-env";
7
7
  import { pathToFileURL } from "node:url";
8
8
  import defu, { defu as defu$1 } from "defu";
9
9
  import EventEmitter from "node:events";
10
- import { existsSync, statSync, watch } from "node:fs";
10
+ import { existsSync, readdirSync, statSync, watch } from "node:fs";
11
11
  import { mkdir } from "node:fs/promises";
12
12
  import { resolveModulePath } from "exsolve";
13
13
  import { joinURL } from "ufo";
@@ -300,16 +300,33 @@ const RESTART_RE = /^(?:nuxt\.config\.[a-z0-9]+|\.nuxtignore|\.nuxtrc|\.config\/
300
300
  var FileChangeTracker = class {
301
301
  mtimes = /* @__PURE__ */ new Map();
302
302
  shouldEmitChange(filePath) {
303
+ const resolved = resolve(filePath);
303
304
  try {
304
- const currentMtime = statSync(filePath).mtimeMs;
305
- const lastMtime = this.mtimes.get(filePath);
306
- this.mtimes.set(filePath, currentMtime);
305
+ const currentMtime = statSync(resolved).mtimeMs;
306
+ const lastMtime = this.mtimes.get(resolved);
307
+ this.mtimes.set(resolved, currentMtime);
307
308
  return lastMtime === void 0 || currentMtime !== lastMtime;
308
309
  } catch {
309
- this.mtimes.delete(filePath);
310
+ this.mtimes.delete(resolved);
310
311
  return true;
311
312
  }
312
313
  }
314
+ prime(filePath, recursive = false) {
315
+ const resolved = resolve(filePath);
316
+ const stat = statSync(resolved);
317
+ this.mtimes.set(resolved, stat.mtimeMs);
318
+ if (stat.isDirectory()) {
319
+ const entries = readdirSync(resolved);
320
+ for (const entry of entries) {
321
+ const fullPath = resolve(resolved, entry);
322
+ try {
323
+ const stats = statSync(fullPath);
324
+ this.mtimes.set(fullPath, stats.mtimeMs);
325
+ if (recursive && stats.isDirectory()) this.prime(fullPath, recursive);
326
+ } catch {}
327
+ }
328
+ }
329
+ }
313
330
  };
314
331
  var NuxtDevServer = class extends EventEmitter {
315
332
  #handler;
@@ -503,6 +520,7 @@ var NuxtDevServer = class extends EventEmitter {
503
520
  if (!this.#currentNuxt.server) throw new Error("Nitro server has not been initialized.");
504
521
  const distDir = resolve(this.#currentNuxt.options.buildDir, "dist");
505
522
  await mkdir(distDir, { recursive: true });
523
+ this.#fileChangeTracker.prime(distDir);
506
524
  this.#distWatcher = watch(distDir);
507
525
  this.#distWatcher.on("change", (_event, file) => {
508
526
  if (!this.#fileChangeTracker.shouldEmitChange(resolve(distDir, file || ""))) return;
@@ -552,10 +570,11 @@ function resolveDevServerDefaults(listenOptions, urls = []) {
552
570
  return defaultConfig;
553
571
  }
554
572
  function createConfigWatcher(cwd, dotenvFileName = ".env", onRestart, onReload) {
573
+ const fileWatcher = new FileChangeTracker();
574
+ fileWatcher.prime(cwd);
555
575
  const configWatcher = watch(cwd);
556
576
  let configDirWatcher = existsSync(resolve(cwd, ".config")) ? createConfigDirWatcher(cwd, onReload) : void 0;
557
577
  const dotenvFileNames = new Set(Array.isArray(dotenvFileName) ? dotenvFileName : [dotenvFileName]);
558
- const fileWatcher = new FileChangeTracker();
559
578
  configWatcher.on("change", (_event, file) => {
560
579
  if (!fileWatcher.shouldEmitChange(resolve(cwd, file))) return;
561
580
  if (dotenvFileNames.has(file)) onRestart();
@@ -570,6 +589,7 @@ function createConfigWatcher(cwd, dotenvFileName = ".env", onRestart, onReload)
570
589
  function createConfigDirWatcher(cwd, onReload) {
571
590
  const configDir = resolve(cwd, ".config");
572
591
  const fileWatcher = new FileChangeTracker();
592
+ fileWatcher.prime(configDir);
573
593
  const configDirWatcher = watch(configDir);
574
594
  configDirWatcher.on("change", (_event, file) => {
575
595
  if (!fileWatcher.shouldEmitChange(resolve(configDir, file))) return;
@@ -1,5 +1,5 @@
1
1
  import "./logger-B4ge7MhP.mjs";
2
- import { t as initialize } from "./dev-DtQo0jDZ.mjs";
2
+ import { t as initialize } from "./dev-BPdQ9vYt.mjs";
3
3
  import "./kit-CPEUdXTm.mjs";
4
4
  import "./versions-CTlxnxbH.mjs";
5
5
  import "./banner-drlfl0J-.mjs";
@@ -1,6 +1,6 @@
1
1
  import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, r as envNameArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
2
2
  import { n as logger, t as debug } from "./logger-B4ge7MhP.mjs";
3
- import { t as initialize } from "./dev-DtQo0jDZ.mjs";
3
+ import { t as initialize } from "./dev-BPdQ9vYt.mjs";
4
4
  import "./kit-CPEUdXTm.mjs";
5
5
  import "./versions-CTlxnxbH.mjs";
6
6
  import "./banner-drlfl0J-.mjs";
@@ -25,7 +25,7 @@ var dev_child_default = defineCommand({
25
25
  async run(ctx) {
26
26
  if (!process.send && !isTest) console.warn("`nuxi _dev` is an internal command and should not be used directly. Please use `nuxi dev` instead.");
27
27
  const cwd = resolve(ctx.args.cwd || ctx.args.rootDir);
28
- const { initialize } = await import("./dev-CV0MMLTC.mjs");
28
+ const { initialize } = await import("./dev-BTtyQYdl.mjs");
29
29
  await initialize({
30
30
  cwd,
31
31
  args: ctx.args
package/dist/index.mjs CHANGED
@@ -17,11 +17,11 @@ const commands = {
17
17
  analyze: () => import("./analyze-C5qqTkhe.mjs").then(_rDefault),
18
18
  build: () => import("./build-Dx1VGivC.mjs").then(_rDefault),
19
19
  cleanup: () => import("./cleanup-CD3OpT9X.mjs").then(_rDefault),
20
- _dev: () => import("./dev-child-CJE2iuic.mjs").then(_rDefault),
21
- dev: () => import("./dev-DauHVvcO.mjs").then(_rDefault),
20
+ _dev: () => import("./dev-child-C02p1dAk.mjs").then(_rDefault),
21
+ dev: () => import("./dev-BjCHVbda.mjs").then(_rDefault),
22
22
  devtools: () => import("./devtools-BTYlIJMv.mjs").then(_rDefault),
23
23
  generate: () => import("./generate-DSEHRPYE.mjs").then(_rDefault),
24
- info: () => import("./info-DOdG2jU8.mjs").then(_rDefault),
24
+ info: () => import("./info-bBCe-0b_.mjs").then(_rDefault),
25
25
  init: () => import("./init-DvmnH01R.mjs").then(_rDefault),
26
26
  module: () => import("./module-dUoKC1O2.mjs").then(_rDefault),
27
27
  prepare: () => import("./prepare-DCVINTk-.mjs").then(_rDefault),
@@ -66,7 +66,7 @@ async function checkEngines() {
66
66
  //#endregion
67
67
  //#region package.json
68
68
  var name = "@nuxt/cli-nightly";
69
- var version = "3.31.0-20251204-152235-b04de4f";
69
+ var version = "3.31.0-20251204-153044-8079cc1";
70
70
  var description = "Nuxt CLI";
71
71
 
72
72
  //#endregion
@@ -17,7 +17,7 @@ import { copy } from "copy-paste";
17
17
  import { detectPackageManager } from "nypm";
18
18
 
19
19
  //#region ../nuxi/package.json
20
- var version = "3.31.0-20251204-152224-b04de4f";
20
+ var version = "3.31.0-20251204-153031-8079cc1";
21
21
 
22
22
  //#endregion
23
23
  //#region ../nuxi/src/commands/info.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/cli-nightly",
3
3
  "type": "module",
4
- "version": "3.31.0-20251204-152235-b04de4f",
4
+ "version": "3.31.0-20251204-153044-8079cc1",
5
5
  "description": "Nuxt CLI",
6
6
  "license": "MIT",
7
7
  "repository": {