@nuxt/cli-nightly 3.31.0-20251204-171225-fae1e55 → 3.31.1-20251205-110915-3da220c

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-8TMjshXb.mjs";
3
3
  import "../kit-CPEUdXTm.mjs";
4
4
  import "../versions-CTlxnxbH.mjs";
5
5
  import "../banner-drlfl0J-.mjs";
@@ -7,12 +7,12 @@ 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";
14
14
  import { listen } from "listhen";
15
- import { resolve } from "pathe";
15
+ import { join, resolve } from "pathe";
16
16
  import { debounce } from "perfect-debounce";
17
17
  import { toNodeHandler } from "srvx/node";
18
18
  import { Youch } from "youch";
@@ -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;
@@ -499,10 +516,12 @@ var NuxtDevServer = class extends EventEmitter {
499
516
  this.#currentNuxt.options.devServer.https = this.listener.https;
500
517
  if (this.listener.https && !process.env.NODE_TLS_REJECT_UNAUTHORIZED) console.warn("You might need `NODE_TLS_REJECT_UNAUTHORIZED=0` environment variable to make https work.");
501
518
  const kit = await loadKit(this.options.cwd);
502
- await Promise.all([kit.writeTypes(this.#currentNuxt).catch(console.error), kit.buildNuxt(this.#currentNuxt)]);
519
+ const typesPromise = existsSync(join(this.#currentNuxt.options.buildDir, "tsconfig.json")) ? kit.writeTypes(this.#currentNuxt).catch(console.error) : await kit.writeTypes(this.#currentNuxt).catch(console.error);
520
+ await Promise.all([typesPromise, kit.buildNuxt(this.#currentNuxt)]);
503
521
  if (!this.#currentNuxt.server) throw new Error("Nitro server has not been initialized.");
504
522
  const distDir = resolve(this.#currentNuxt.options.buildDir, "dist");
505
523
  await mkdir(distDir, { recursive: true });
524
+ this.#fileChangeTracker.prime(distDir);
506
525
  this.#distWatcher = watch(distDir);
507
526
  this.#distWatcher.on("change", (_event, file) => {
508
527
  if (!this.#fileChangeTracker.shouldEmitChange(resolve(distDir, file || ""))) return;
@@ -552,10 +571,11 @@ function resolveDevServerDefaults(listenOptions, urls = []) {
552
571
  return defaultConfig;
553
572
  }
554
573
  function createConfigWatcher(cwd, dotenvFileName = ".env", onRestart, onReload) {
574
+ const fileWatcher = new FileChangeTracker();
575
+ fileWatcher.prime(cwd);
555
576
  const configWatcher = watch(cwd);
556
577
  let configDirWatcher = existsSync(resolve(cwd, ".config")) ? createConfigDirWatcher(cwd, onReload) : void 0;
557
578
  const dotenvFileNames = new Set(Array.isArray(dotenvFileName) ? dotenvFileName : [dotenvFileName]);
558
- const fileWatcher = new FileChangeTracker();
559
579
  configWatcher.on("change", (_event, file) => {
560
580
  if (!fileWatcher.shouldEmitChange(resolve(cwd, file))) return;
561
581
  if (dotenvFileNames.has(file)) onRestart();
@@ -570,6 +590,7 @@ function createConfigWatcher(cwd, dotenvFileName = ".env", onRestart, onReload)
570
590
  function createConfigDirWatcher(cwd, onReload) {
571
591
  const configDir = resolve(cwd, ".config");
572
592
  const fileWatcher = new FileChangeTracker();
593
+ fileWatcher.prime(configDir);
573
594
  const configDirWatcher = watch(configDir);
574
595
  configDirWatcher.on("change", (_event, file) => {
575
596
  if (!fileWatcher.shouldEmitChange(resolve(configDir, file))) return;
@@ -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-8TMjshXb.mjs";
4
4
  import "./kit-CPEUdXTm.mjs";
5
5
  import "./versions-CTlxnxbH.mjs";
6
6
  import "./banner-drlfl0J-.mjs";
@@ -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-8TMjshXb.mjs";
3
3
  import "./kit-CPEUdXTm.mjs";
4
4
  import "./versions-CTlxnxbH.mjs";
5
5
  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-BW_ssTuF.mjs");
29
29
  await initialize({
30
30
  cwd,
31
31
  args: ctx.args
package/dist/index.mjs CHANGED
@@ -17,16 +17,16 @@ 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-BACowzO5.mjs").then(_rDefault),
21
+ dev: () => import("./dev-BVK4HLnB.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-Dmll3Y8f.mjs").then(_rDefault),
25
- init: () => import("./init--rim7tGt.mjs").then(_rDefault),
24
+ info: () => import("./info-BieOv5cu.mjs").then(_rDefault),
25
+ init: () => import("./init-CUkHvr29.mjs").then(_rDefault),
26
26
  module: () => import("./module-dUoKC1O2.mjs").then(_rDefault),
27
27
  prepare: () => import("./prepare-DCVINTk-.mjs").then(_rDefault),
28
- preview: () => import("./preview-CwSDIjlH.mjs").then(_rDefault),
29
- start: () => import("./preview-CwSDIjlH.mjs").then(_rDefault),
28
+ preview: () => import("./preview-D2Y29Rfc.mjs").then(_rDefault),
29
+ start: () => import("./preview-D2Y29Rfc.mjs").then(_rDefault),
30
30
  test: () => import("./test-D9z67EJZ.mjs").then(_rDefault),
31
31
  typecheck: () => import("./typecheck-CLdIBKcn.mjs").then(_rDefault),
32
32
  upgrade: () => import("./upgrade-fEGIXDnO.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-171225-fae1e55";
69
+ var version = "3.31.1-20251205-110915-3da220c";
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-171214-fae1e55";
20
+ var version = "3.31.1-20251205-110903-3da220c";
21
21
 
22
22
  //#endregion
23
23
  //#region ../nuxi/src/commands/info.ts
@@ -53,7 +53,10 @@ const hiddenTemplates = [
53
53
  const fetchOptions = {
54
54
  timeout: 3e3,
55
55
  responseType: "json",
56
- headers: { "user-agent": "@nuxt/cli" }
56
+ headers: {
57
+ "user-agent": "@nuxt/cli",
58
+ ...process.env.GITHUB_TOKEN ? { authorization: `token ${process.env.GITHUB_TOKEN}` } : {}
59
+ }
57
60
  };
58
61
  let templatesCache = null;
59
62
  async function getTemplates() {
@@ -273,7 +276,7 @@ var init_default = defineCommand({
273
276
  }
274
277
  downloadSpinner.stop(`Downloaded ${colors.cyan(template.name)} template`);
275
278
  } catch (err) {
276
- downloadSpinner.stop("Template download failed", 1);
279
+ downloadSpinner.error("Template download failed");
277
280
  if (process.env.DEBUG) throw err;
278
281
  logger.error(err.toString());
279
282
  process.exit(1);
@@ -284,13 +287,13 @@ var init_default = defineCommand({
284
287
  const response = await $fetch("https://registry.npmjs.org/nuxt-nightly");
285
288
  const nightlyChannelTag = ctx.args.nightly || "latest";
286
289
  if (!nightlyChannelTag) {
287
- nightlySpinner.stop("Failed to get nightly channel tag", 1);
290
+ nightlySpinner.error("Failed to get nightly channel tag");
288
291
  logger.error(`Error getting nightly channel tag.`);
289
292
  process.exit(1);
290
293
  }
291
294
  const nightlyChannelVersion = response["dist-tags"][nightlyChannelTag];
292
295
  if (!nightlyChannelVersion) {
293
- nightlySpinner.stop("Nightly version not found", 1);
296
+ nightlySpinner.error("Nightly version not found");
294
297
  logger.error(`Nightly channel version for tag ${colors.cyan(nightlyChannelTag)} not found.`);
295
298
  process.exit(1);
296
299
  }
@@ -425,7 +428,7 @@ var init_default = defineCommand({
425
428
  titlePadding: 2,
426
429
  contentPadding: 2,
427
430
  rounded: true,
428
- includePrefix: false,
431
+ withGuide: false,
429
432
  formatBorder: (text$1) => `${themeColor + text$1}\x1B[0m`
430
433
  });
431
434
  if (ctx.args.shell) startShell(template.dir);
@@ -85,7 +85,7 @@ const command = defineCommand({
85
85
  titlePadding: 2,
86
86
  contentPadding: 2,
87
87
  rounded: true,
88
- includePrefix: true,
88
+ withGuide: true,
89
89
  formatBorder: (text$1) => colors.yellow(text$1)
90
90
  });
91
91
  const envFileName = ctx.args.dotenv || ".env";
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-171225-fae1e55",
4
+ "version": "3.31.1-20251205-110915-3da220c",
5
5
  "description": "Nuxt CLI",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@bomb.sh/tab": "^0.0.9",
37
- "@clack/prompts": "1.0.0-alpha.6",
37
+ "@clack/prompts": "1.0.0-alpha.7",
38
38
  "c12": "^3.3.2",
39
39
  "citty": "^0.1.6",
40
40
  "confbox": "^0.2.2",
@@ -55,7 +55,7 @@
55
55
  "pkg-types": "^2.3.0",
56
56
  "scule": "^1.3.0",
57
57
  "semver": "^7.7.3",
58
- "srvx": "^0.9.6",
58
+ "srvx": "^0.9.7",
59
59
  "std-env": "^3.10.0",
60
60
  "tinyexec": "^1.0.2",
61
61
  "ufo": "^1.6.1",
@@ -73,7 +73,7 @@
73
73
  "nitropack": "^2.12.9",
74
74
  "rollup": "^4.53.3",
75
75
  "rollup-plugin-visualizer": "^6.0.5",
76
- "tsdown": "^0.16.6",
76
+ "tsdown": "^0.16.8",
77
77
  "typescript": "^5.9.3",
78
78
  "undici": "^7.16.0",
79
79
  "unplugin-purge-polyfills": "^0.1.0",