@nuxt/cli-nightly 3.27.0-20250714-092854-c7c4dd1 → 3.27.0-20250722-151444-b45a23d

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.
@@ -11,14 +11,14 @@ import { resolve } from 'pathe';
11
11
  import { readPackageJSON } from 'pkg-types';
12
12
  import { satisfies } from 'semver';
13
13
  import { joinURL } from 'ufo';
14
- import { r as runCommand } from '../shared/cli-nightly.70suO2DD.mjs';
14
+ import { r as runCommand } from '../shared/cli-nightly.q0DqILa8.mjs';
15
15
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
16
- import { a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
16
+ import { a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
17
17
  import { f as fetchModules, g as getNuxtVersion, c as checkNuxtCompatibility, a as getRegistryFromContent } from '../shared/cli-nightly.jA1DRKbi.mjs';
18
18
  import 'node:url';
19
19
  import 'node:crypto';
20
20
  import 'std-env';
21
- import '../shared/cli-nightly.O7BoJVjz.mjs';
21
+ import '../shared/cli-nightly.BUNTKlM5.mjs';
22
22
  import 'consola';
23
23
  import 'confbox';
24
24
 
@@ -5,7 +5,7 @@ import { resolve, extname, dirname } from 'pathe';
5
5
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
6
6
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
7
7
  import { pascalCase, camelCase } from 'scule';
8
- import { a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
8
+ import { a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
9
9
  import 'node:url';
10
10
  import 'exsolve';
11
11
  import 'consola';
@@ -9,7 +9,7 @@ import { o as overrideEnv } from '../shared/cli-nightly.DkO5RR_e.mjs';
9
9
  import { c as clearDir } from '../shared/cli-nightly.DPmMxQ6h.mjs';
10
10
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
11
11
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
12
- import { e as extendsArgs, d as dotEnvArgs, l as legacyRootDirArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
12
+ import { e as extendsArgs, d as dotEnvArgs, l as legacyRootDirArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
13
13
  import 'node:url';
14
14
  import 'exsolve';
15
15
  import 'consola';
@@ -6,7 +6,7 @@ import { o as overrideEnv } from '../shared/cli-nightly.DkO5RR_e.mjs';
6
6
  import { a as clearBuildDir } from '../shared/cli-nightly.DPmMxQ6h.mjs';
7
7
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
8
8
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
9
- import { l as legacyRootDirArgs, e as extendsArgs, b as envNameArgs, d as dotEnvArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
9
+ import { l as legacyRootDirArgs, e as extendsArgs, b as envNameArgs, d as dotEnvArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
10
10
  import 'node:fs';
11
11
  import 'consola/utils';
12
12
  import 'exsolve';
@@ -2,7 +2,7 @@ import { defineCommand } from 'citty';
2
2
  import { resolve } from 'pathe';
3
3
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
4
4
  import { c as cleanupNuxtDirs } from '../shared/cli-nightly.Bu_9IHj2.mjs';
5
- import { l as legacyRootDirArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
5
+ import { l as legacyRootDirArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
6
6
  import 'node:url';
7
7
  import 'exsolve';
8
8
  import 'node:fs';
@@ -2,7 +2,7 @@ import process from 'node:process';
2
2
  import { defineCommand } from 'citty';
3
3
  import { resolve } from 'pathe';
4
4
  import { isTest } from 'std-env';
5
- import { l as legacyRootDirArgs, d as dotEnvArgs, b as envNameArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
5
+ import { l as legacyRootDirArgs, d as dotEnvArgs, b as envNameArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
6
6
  import 'node:path';
7
7
  import 'consola';
8
8
  import '../shared/cli-nightly.B9AmABr3.mjs';
@@ -7,14 +7,15 @@ import { listen } from 'listhen';
7
7
  import { getArgs, parseArgs } from 'listhen/cli';
8
8
  import { resolve } from 'pathe';
9
9
  import { satisfies } from 'semver';
10
- import { isTest, isBun } from 'std-env';
10
+ import { isTest, isBun, isDeno } from 'std-env';
11
11
  import { i as initialize, r as resolveLoadingTemplate, a as renderError, b as isSocketURL, p as parseSocketURL } from './index.mjs';
12
12
  import { s as showVersions } from '../shared/cli-nightly.DltNmcvh.mjs';
13
13
  import { o as overrideEnv } from '../shared/cli-nightly.DkO5RR_e.mjs';
14
14
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
15
15
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
16
- import { e as extendsArgs, b as envNameArgs, l as legacyRootDirArgs, d as dotEnvArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
16
+ import { e as extendsArgs, b as envNameArgs, l as legacyRootDirArgs, d as dotEnvArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
17
17
  import 'defu';
18
+ import 'node:http';
18
19
  import 'node:events';
19
20
  import 'node:fs';
20
21
  import 'node:fs/promises';
@@ -27,7 +28,6 @@ import '../shared/cli-nightly.DPmMxQ6h.mjs';
27
28
  import '../shared/cli-nightly.Bu_9IHj2.mjs';
28
29
  import 'ohash';
29
30
  import 'youch';
30
- import 'node:http';
31
31
  import 'consola/utils';
32
32
  import 'consola';
33
33
  import 'node:path';
@@ -141,7 +141,8 @@ const command = defineCommand({
141
141
  proxy: {
142
142
  url: devProxy.listener.url,
143
143
  urls,
144
- https: devProxy.listener.https
144
+ https: devProxy.listener.https,
145
+ addr: devProxy.listener.address
145
146
  }
146
147
  // if running with nuxt v4 or `NUXT_SOCKET=1`, we use the socket listener
147
148
  // otherwise pass 'true' to listen on a random port instead
@@ -149,8 +150,11 @@ const command = defineCommand({
149
150
  onReady((address) => devProxy.setAddress(address));
150
151
  const fork2 = startSubprocess(cwd, ctx.args, ctx.rawArgs, listenOptions);
151
152
  onRestart(async (devServer) => {
152
- await devServer.close();
153
- const subprocess = await fork2;
153
+ const [subprocess] = await Promise.all([
154
+ fork2,
155
+ devServer.close().catch(() => {
156
+ })
157
+ ]);
154
158
  await subprocess.initialize(devProxy, useSocket);
155
159
  });
156
160
  return {
@@ -240,7 +244,7 @@ async function startSubprocess(cwd, args, rawArgs, listenOptions) {
240
244
  let ready;
241
245
  const kill = (signal) => {
242
246
  if (childProc) {
243
- childProc.kill(signal);
247
+ childProc.kill(signal === 0 && isDeno ? "SIGTERM" : signal);
244
248
  childProc = void 0;
245
249
  }
246
250
  };
@@ -329,7 +333,7 @@ async function startSubprocess(cwd, args, rawArgs, listenOptions) {
329
333
  }
330
334
  function resolveListenOptions(nuxtOptions, args) {
331
335
  const _port = args.port ?? args.p ?? process.env.NUXT_PORT ?? process.env.NITRO_PORT ?? process.env.PORT ?? nuxtOptions.devServer.port;
332
- const _hostname = typeof args.host === "string" ? args.host : (args.host === true ? "" : void 0);
336
+ const _hostname = typeof args.host === "string" ? args.host : args.host === true ? "" : process.env.NUXT_HOST ?? process.env.NITRO_HOST ?? process.env.HOST ?? (nuxtOptions.devServer?.host || void 0) ?? void 0;
333
337
  const _public = args.public ?? (_hostname && !["localhost", "127.0.0.1", "::1"].includes(_hostname)) ? true : void 0;
334
338
  const _httpsCert = args["https.cert"] || args.sslCert || process.env.NUXT_SSL_CERT || process.env.NITRO_SSL_CERT || typeof nuxtOptions.devServer.https !== "boolean" && nuxtOptions.devServer.https && "cert" in nuxtOptions.devServer.https && nuxtOptions.devServer.https.cert || "";
335
339
  const _httpsKey = args["https.key"] || args.sslKey || process.env.NUXT_SSL_KEY || process.env.NITRO_SSL_KEY || typeof nuxtOptions.devServer.https !== "boolean" && nuxtOptions.devServer.https && "key" in nuxtOptions.devServer.https && nuxtOptions.devServer.https.key || "";
@@ -3,7 +3,7 @@ import { defineCommand } from 'citty';
3
3
  import { resolve } from 'pathe';
4
4
  import { x } from 'tinyexec';
5
5
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
6
- import { l as legacyRootDirArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
6
+ import { l as legacyRootDirArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
7
7
  import 'consola';
8
8
  import 'node:path';
9
9
  import 'std-env';
@@ -1,5 +1,5 @@
1
1
  import { defineCommand } from 'citty';
2
- import { l as legacyRootDirArgs, e as extendsArgs, b as envNameArgs, d as dotEnvArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
2
+ import { l as legacyRootDirArgs, e as extendsArgs, b as envNameArgs, d as dotEnvArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
3
3
  import buildCommand from './build.mjs';
4
4
  import 'node:path';
5
5
  import 'node:process';
@@ -1,12 +1,14 @@
1
1
  import process from 'node:process';
2
2
  import defu from 'defu';
3
+ import { listen } from 'listhen';
4
+ import { Server } from 'node:http';
5
+ import { getSocketAddress, cleanSocket } from 'get-port-please';
3
6
  import EventEmitter from 'node:events';
4
7
  import { watch, existsSync } from 'node:fs';
5
8
  import { mkdir } from 'node:fs/promises';
6
9
  import { pathToFileURL } from 'node:url';
7
10
  import { resolveModulePath } from 'exsolve';
8
11
  import { toNodeListener } from 'h3';
9
- import { listen } from 'listhen';
10
12
  import { resolve } from 'pathe';
11
13
  import { debounce } from 'perfect-debounce';
12
14
  import { provider } from 'std-env';
@@ -15,30 +17,11 @@ import { a as clearBuildDir } from '../shared/cli-nightly.DPmMxQ6h.mjs';
15
17
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
16
18
  import { l as loadNuxtManifest, r as resolveNuxtManifest, w as writeNuxtManifest } from '../shared/cli-nightly.Bu_9IHj2.mjs';
17
19
  import { Youch } from 'youch';
18
- import { Server } from 'node:http';
19
- import { getSocketAddress, cleanSocket } from 'get-port-please';
20
-
21
- async function renderError(req, res, error) {
22
- const youch = new Youch();
23
- res.statusCode = 500;
24
- res.setHeader("Content-Type", "text/html");
25
- const html = await youch.toHTML(error, {
26
- request: {
27
- url: req.url,
28
- method: req.method,
29
- headers: req.headers
30
- }
31
- });
32
- res.end(html);
33
- }
34
20
 
35
21
  function formatSocketURL(socketPath, ssl = false) {
36
22
  const protocol = ssl ? "https" : "http";
37
- if (process.platform === "win32") {
38
- const encodedPath = encodeURIComponent(socketPath);
39
- return `${protocol}+unix://${encodedPath}`;
40
- }
41
- return `${protocol}+unix://${socketPath.replace(/\//g, "%2F")}`;
23
+ const encodedPath = process.platform === "win32" ? encodeURIComponent(socketPath) : socketPath.replace(/\//g, "%2F");
24
+ return `${protocol}+unix://${encodedPath}`;
42
25
  }
43
26
  function isSocketURL(url) {
44
27
  return url.startsWith("http+unix://") || url.startsWith("https+unix://");
@@ -52,7 +35,7 @@ function parseSocketURL(url) {
52
35
  const socketPath = decodeURIComponent(path.replace(/%2F/g, "/"));
53
36
  return { socketPath, protocol: ssl ? "https" : "http" };
54
37
  }
55
- async function createSocketListener(handler, ssl = false) {
38
+ async function createSocketListener(handler, proxyAddress) {
56
39
  const socketPath = getSocketAddress({
57
40
  name: "nuxt-dev",
58
41
  random: true
@@ -60,14 +43,10 @@ async function createSocketListener(handler, ssl = false) {
60
43
  const server = new Server(handler);
61
44
  await cleanSocket(socketPath);
62
45
  await new Promise((resolve) => server.listen({ path: socketPath }, resolve));
63
- const url = formatSocketURL(socketPath, ssl);
46
+ const url = formatSocketURL(socketPath);
64
47
  return {
65
48
  url,
66
- address: {
67
- socketPath,
68
- address: "localhost",
69
- port: 3e3
70
- },
49
+ address: { address: "localhost", port: 3e3, ...proxyAddress, socketPath },
71
50
  async close() {
72
51
  try {
73
52
  server.removeAllListeners();
@@ -82,22 +61,20 @@ async function createSocketListener(handler, ssl = false) {
82
61
  };
83
62
  }
84
63
 
85
- async function createNuxtDevServer(options, listenOptions) {
86
- const devServer = new NuxtDevServer(options);
87
- devServer.listener = listenOptions ? await listen(devServer.handler, typeof listenOptions === "object" ? listenOptions : { port: options.port ?? 0, hostname: "127.0.0.1", showURL: false }) : await createSocketListener(devServer.handler);
88
- if (process.env.DEBUG) {
89
- console.debug(`Using ${listenOptions ? "network" : "socket"} listener for Nuxt dev server.`);
90
- }
91
- devServer.listener._url = devServer.listener.url;
92
- if (options.devContext.proxy?.url) {
93
- devServer.listener.url = options.devContext.proxy.url;
94
- }
95
- if (options.devContext.proxy?.urls) {
96
- const _getURLs = devServer.listener.getURLs.bind(devServer.listener);
97
- devServer.listener.getURLs = async () => Array.from(/* @__PURE__ */ new Set([...options.devContext.proxy?.urls || [], ...await _getURLs()]));
98
- }
99
- return devServer;
64
+ async function renderError(req, res, error) {
65
+ const youch = new Youch();
66
+ res.statusCode = 500;
67
+ res.setHeader("Content-Type", "text/html");
68
+ const html = await youch.toHTML(error, {
69
+ request: {
70
+ url: req.url,
71
+ method: req.method,
72
+ headers: req.headers
73
+ }
74
+ });
75
+ res.end(html);
100
76
  }
77
+
101
78
  const RESTART_RE = /^(?:nuxt\.config\.[a-z0-9]+|\.nuxtignore|\.nuxtrc|\.config\/nuxt(?:\.config)?\.[a-z0-9]+)$/;
102
79
  class NuxtDevServer extends EventEmitter {
103
80
  constructor(options) {
@@ -153,6 +130,10 @@ class NuxtDevServer extends EventEmitter {
153
130
  await this.load();
154
131
  this._watchConfig();
155
132
  }
133
+ closeWatchers() {
134
+ this._distWatcher?.close();
135
+ this._configWatcher?.();
136
+ }
156
137
  async load(reload, reason) {
157
138
  try {
158
139
  await this._load(reload, reason);
@@ -166,8 +147,6 @@ class NuxtDevServer extends EventEmitter {
166
147
  }
167
148
  }
168
149
  async close() {
169
- this._distWatcher?.close();
170
- this._configWatcher?.();
171
150
  if (this._currentNuxt) {
172
151
  await this._currentNuxt.close();
173
152
  }
@@ -195,7 +174,6 @@ class NuxtDevServer extends EventEmitter {
195
174
  defaults: defu(this.options.defaults, devServerDefaults),
196
175
  overrides: {
197
176
  logLevel: this.options.logLevel,
198
- ...this.options.devContext.args.extends && { extends: this.options.devContext.args.extends },
199
177
  ...this.options.overrides,
200
178
  vite: {
201
179
  clearScreen: this.options.clear,
@@ -258,7 +236,7 @@ class NuxtDevServer extends EventEmitter {
258
236
  const addr = this.listener.address;
259
237
  this._currentNuxt.options.devServer.host = addr.address;
260
238
  this._currentNuxt.options.devServer.port = addr.port;
261
- this._currentNuxt.options.devServer.url = "socketPath" in addr ? this.options.devContext.proxy?.url || getAddressURL(addr, !!this.listener.https) : getAddressURL(addr, !!this.listener.https);
239
+ this._currentNuxt.options.devServer.url = getAddressURL(addr, !!this.listener.https);
262
240
  this._currentNuxt.options.devServer.https = this.options.devContext.proxy?.https;
263
241
  if (this.listener.https && !process.env.NODE_TLS_REJECT_UNAUTHORIZED) {
264
242
  console.warn("You might need `NODE_TLS_REJECT_UNAUTHORIZED=0` environment variable to make https work.");
@@ -309,7 +287,11 @@ function resolveDevServerOverrides(listenOptions) {
309
287
  function resolveDevServerDefaults(listenOptions, urls = []) {
310
288
  const defaultConfig = {};
311
289
  if (urls) {
312
- defaultConfig.vite = { server: { allowedHosts: urls.map((u) => new URL(u).hostname) } };
290
+ defaultConfig.vite = {
291
+ server: {
292
+ allowedHosts: urls.filter((u) => !isSocketURL(u)).map((u) => new URL(u).hostname)
293
+ }
294
+ };
313
295
  }
314
296
  if (listenOptions.hostname) {
315
297
  const protocol = listenOptions.https ? "https" : "http";
@@ -359,10 +341,12 @@ process.env.NODE_ENV = "development";
359
341
  class IPC {
360
342
  enabled = !!process.send && !process.title?.includes("vitest") && process.env.__NUXT__FORK;
361
343
  constructor() {
362
- process.once("unhandledRejection", (reason) => {
363
- this.send({ type: "nuxt:internal:dev:rejection", message: reason instanceof Error ? reason.toString() : "Unhandled Rejection" });
364
- process.exit();
365
- });
344
+ if (this.enabled) {
345
+ process.once("unhandledRejection", (reason) => {
346
+ this.send({ type: "nuxt:internal:dev:rejection", message: reason instanceof Error ? reason.toString() : "Unhandled Rejection" });
347
+ process.exit();
348
+ });
349
+ }
366
350
  process.on("message", (message) => {
367
351
  if (message.type === "nuxt:internal:dev:context") {
368
352
  initialize(message.context, {}, message.socket ? void 0 : true);
@@ -385,17 +369,35 @@ async function initialize(devContext, ctx = {}, _listenOptions) {
385
369
  hostname: devContext.hostname,
386
370
  https: devContext.proxy?.https
387
371
  }, devContext.publicURLs);
388
- const listenOptions = _listenOptions === true || process.env._PORT ? { port: process.env._PORT ?? 0, hostname: "127.0.0.1", showURL: false } : _listenOptions;
389
- const devServer = await createNuxtDevServer({
372
+ const devServer = new NuxtDevServer({
390
373
  cwd: devContext.cwd,
391
- overrides: defu(ctx.data?.overrides, devServerOverrides),
374
+ overrides: defu(
375
+ ctx.data?.overrides,
376
+ { extends: devContext.args.extends },
377
+ devServerOverrides
378
+ ),
392
379
  defaults: devServerDefaults,
393
380
  logLevel: devContext.args.logLevel,
394
381
  clear: !!devContext.args.clear,
395
382
  dotenv: { cwd: devContext.cwd, fileName: devContext.args.dotenv },
396
383
  envName: devContext.args.envName,
397
- devContext
398
- }, listenOptions);
384
+ devContext: {
385
+ proxy: devContext.proxy
386
+ }
387
+ });
388
+ const listenOptions = _listenOptions === true || process.env._PORT ? { port: process.env._PORT ?? 0, hostname: "127.0.0.1", showURL: false } : _listenOptions;
389
+ devServer.listener = listenOptions ? await listen(devServer.handler, listenOptions) : await createSocketListener(devServer.handler, devContext.proxy?.addr);
390
+ if (process.env.DEBUG) {
391
+ console.debug(`Using ${listenOptions ? "network" : "socket"} listener for Nuxt dev server.`);
392
+ }
393
+ devServer.listener._url = devServer.listener.url;
394
+ if (devContext.proxy?.url) {
395
+ devServer.listener.url = devContext.proxy.url;
396
+ }
397
+ if (devContext.proxy?.urls) {
398
+ const _getURLs = devServer.listener.getURLs.bind(devServer.listener);
399
+ devServer.listener.getURLs = async () => Array.from(/* @__PURE__ */ new Set([...devContext.proxy?.urls || [], ...await _getURLs()]));
400
+ }
399
401
  let address;
400
402
  if (ipc.enabled) {
401
403
  devServer.on("loading:error", (_error) => {
@@ -429,7 +431,10 @@ async function initialize(devContext, ctx = {}, _listenOptions) {
429
431
  }
430
432
  return {
431
433
  listener: devServer.listener,
432
- close: () => devServer.close(),
434
+ close: async () => {
435
+ devServer.closeWatchers();
436
+ await devServer.close();
437
+ },
433
438
  onReady: (callback) => {
434
439
  if (address) {
435
440
  callback(address);
@@ -438,7 +443,16 @@ async function initialize(devContext, ctx = {}, _listenOptions) {
438
443
  }
439
444
  },
440
445
  onRestart: (callback) => {
441
- devServer.once("restart", () => callback(devServer));
446
+ let restarted = false;
447
+ function restart() {
448
+ if (!restarted) {
449
+ restarted = true;
450
+ callback(devServer);
451
+ }
452
+ }
453
+ devServer.once("restart", restart);
454
+ process.once("uncaughtException", restart);
455
+ process.once("unhandledRejection", restart);
442
456
  }
443
457
  };
444
458
  }
@@ -7,11 +7,11 @@ import { resolve } from 'pathe';
7
7
  import { readPackageJSON } from 'pkg-types';
8
8
  import { splitByCase } from 'scule';
9
9
  import { isMinimal } from 'std-env';
10
- import { v as version } from '../shared/cli-nightly.O7BoJVjz.mjs';
10
+ import { v as version } from '../shared/cli-nightly.BUNTKlM5.mjs';
11
11
  import { t as tryResolveNuxt } from '../shared/cli-nightly.qKvs7FJ2.mjs';
12
12
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
13
13
  import { g as getPackageManagerVersion } from '../shared/cli-nightly.BSm0_9Hr.mjs';
14
- import { l as legacyRootDirArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
14
+ import { l as legacyRootDirArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
15
15
  import 'node:url';
16
16
  import 'exsolve';
17
17
  import 'consola';
@@ -8,13 +8,13 @@ import { $fetch } from 'ofetch';
8
8
  import { resolve, relative, join } from 'pathe';
9
9
  import { hasTTY } from 'std-env';
10
10
  import { x } from 'tinyexec';
11
- import { r as runCommand } from '../shared/cli-nightly.70suO2DD.mjs';
11
+ import { r as runCommand } from '../shared/cli-nightly.q0DqILa8.mjs';
12
12
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
13
- import { a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
13
+ import { a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
14
14
  import 'node:url';
15
15
  import 'node:crypto';
16
16
  import 'node:path';
17
- import '../shared/cli-nightly.O7BoJVjz.mjs';
17
+ import '../shared/cli-nightly.BUNTKlM5.mjs';
18
18
  import 'consola';
19
19
 
20
20
  const themeColor = "\x1B[38;2;0;220;130m";
@@ -31,7 +31,7 @@ const icon = [
31
31
  const nuxtIcon = icon.map((line) => line.split("").join(themeColor)).join("\n");
32
32
 
33
33
  const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/nuxt/starter/templates/templates";
34
- const DEFAULT_TEMPLATE_NAME = "v3";
34
+ const DEFAULT_TEMPLATE_NAME = "v4";
35
35
  const pms = {
36
36
  npm: void 0,
37
37
  pnpm: void 0,
@@ -4,7 +4,7 @@ import { resolve, relative } from 'pathe';
4
4
  import { a as clearBuildDir } from '../shared/cli-nightly.DPmMxQ6h.mjs';
5
5
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
6
6
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
7
- import { l as legacyRootDirArgs, e as extendsArgs, b as envNameArgs, a as logLevelArgs, c as cwdArgs, d as dotEnvArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
7
+ import { l as legacyRootDirArgs, e as extendsArgs, b as envNameArgs, a as logLevelArgs, c as cwdArgs, d as dotEnvArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
8
8
  import 'node:fs';
9
9
  import 'node:url';
10
10
  import 'exsolve';
@@ -9,7 +9,7 @@ import { resolve } from 'pathe';
9
9
  import { x } from 'tinyexec';
10
10
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
11
11
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
12
- import { d as dotEnvArgs, l as legacyRootDirArgs, e as extendsArgs, b as envNameArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
12
+ import { d as dotEnvArgs, l as legacyRootDirArgs, e as extendsArgs, b as envNameArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
13
13
  import 'node:url';
14
14
  import 'exsolve';
15
15
  import 'consola';
@@ -3,7 +3,7 @@ import { colors } from 'consola/utils';
3
3
  import Fuse from 'fuse.js';
4
4
  import { upperFirst, kebabCase } from 'scule';
5
5
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
6
- import { c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
6
+ import { c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
7
7
  import { g as getNuxtVersion, f as fetchModules, c as checkNuxtCompatibility } from '../shared/cli-nightly.jA1DRKbi.mjs';
8
8
  import 'consola';
9
9
  import 'node:path';
@@ -2,7 +2,7 @@ import process from 'node:process';
2
2
  import { defineCommand } from 'citty';
3
3
  import { resolve } from 'pathe';
4
4
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
5
- import { l as legacyRootDirArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
5
+ import { l as legacyRootDirArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
6
6
  import 'consola';
7
7
  import 'node:path';
8
8
  import 'std-env';
@@ -6,7 +6,7 @@ import { readTSConfig } from 'pkg-types';
6
6
  import { isBun } from 'std-env';
7
7
  import { x } from 'tinyexec';
8
8
  import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
9
- import { l as legacyRootDirArgs, e as extendsArgs, d as dotEnvArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
9
+ import { l as legacyRootDirArgs, e as extendsArgs, d as dotEnvArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
10
10
  import 'node:url';
11
11
  import 'node:path';
12
12
  import 'consola';
@@ -9,7 +9,7 @@ import { l as loadKit } from '../shared/cli-nightly.qKvs7FJ2.mjs';
9
9
  import { l as logger } from '../shared/cli-nightly.B9AmABr3.mjs';
10
10
  import { c as cleanupNuxtDirs, n as nuxtVersionToGitIdentifier } from '../shared/cli-nightly.Bu_9IHj2.mjs';
11
11
  import { g as getPackageManagerVersion } from '../shared/cli-nightly.BSm0_9Hr.mjs';
12
- import { l as legacyRootDirArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.BlsQXvtd.mjs';
12
+ import { l as legacyRootDirArgs, a as logLevelArgs, c as cwdArgs } from '../shared/cli-nightly.CJTIJXNl.mjs';
13
13
  import 'node:url';
14
14
  import 'exsolve';
15
15
  import 'consola';
@@ -49,7 +49,7 @@ async function getNightlyVersion(packageNames) {
49
49
  {
50
50
  type: "select",
51
51
  options: ["3.x", "4.x"],
52
- default: "3.x",
52
+ default: "4.x",
53
53
  cancel: "reject"
54
54
  }
55
55
  ).catch(() => process.exit(1));
@@ -60,7 +60,7 @@ async function getRequiredNewVersion(packageNames, channel) {
60
60
  if (channel === "nightly") {
61
61
  return getNightlyVersion(packageNames);
62
62
  }
63
- return { npmPackages: packageNames.map((p) => `${p}@latest`), nuxtVersion: "3" };
63
+ return { npmPackages: packageNames.map((p) => `${p}@latest`), nuxtVersion: "4" };
64
64
  }
65
65
  const upgrade = defineCommand({
66
66
  meta: {
@@ -23,6 +23,7 @@ interface NuxtDevContext {
23
23
  url?: string;
24
24
  urls?: ListenURL[];
25
25
  https?: boolean | HTTPSOptions;
26
+ addr?: AddressInfo;
26
27
  };
27
28
  }
28
29
  interface NuxtDevServerOptions {
@@ -33,11 +34,10 @@ interface NuxtDevServerOptions {
33
34
  clear?: boolean;
34
35
  defaults: NuxtConfig;
35
36
  overrides: NuxtConfig;
36
- port?: string | number;
37
37
  loadingTemplate?: ({ loading }: {
38
38
  loading: string;
39
39
  }) => string;
40
- devContext: NuxtDevContext;
40
+ devContext: Pick<NuxtDevContext, 'proxy'>;
41
41
  }
42
42
  interface DevServerEventMap {
43
43
  'loading:error': [error: Error];
@@ -58,16 +58,15 @@ declare class NuxtDevServer extends EventEmitter<DevServerEventMap> {
58
58
  handler: RequestListener;
59
59
  listener: Pick<Listener, 'server' | 'getURLs' | 'https' | 'url' | 'close'> & {
60
60
  _url?: string;
61
- address: {
61
+ address: Omit<AddressInfo, 'family'> & {
62
62
  socketPath: string;
63
- port: number;
64
- address: string;
65
63
  } | AddressInfo;
66
64
  };
67
65
  constructor(options: NuxtDevServerOptions);
68
66
  _renderError(req: IncomingMessage, res: ServerResponse): void;
69
67
  _renderLoadingScreen(req: IncomingMessage, res: ServerResponse): Promise<void>;
70
68
  init(): Promise<void>;
69
+ closeWatchers(): void;
71
70
  load(reload?: boolean, reason?: string): Promise<void>;
72
71
  close(): Promise<void>;
73
72
  _load(reload?: boolean, reason?: string): Promise<void>;
@@ -80,13 +79,11 @@ interface InitializeOptions {
80
79
  };
81
80
  }
82
81
  declare function initialize(devContext: NuxtDevContext, ctx?: InitializeOptions, _listenOptions?: true | Partial<ListenOptions>): Promise<{
83
- listener: Pick<listhen.Listener, "server" | "getURLs" | "https" | "url" | "close"> & {
82
+ listener: Pick<listhen.Listener, "https" | "server" | "url" | "getURLs" | "close"> & {
84
83
  _url?: string;
85
- address: {
84
+ address: (Omit<net.AddressInfo, "family"> & {
86
85
  socketPath: string;
87
- port: number;
88
- address: string;
89
- } | net.AddressInfo;
86
+ }) | net.AddressInfo;
90
87
  };
91
88
  close: () => Promise<void>;
92
89
  onReady: (callback: (address: string) => void) => void;
@@ -23,6 +23,7 @@ interface NuxtDevContext {
23
23
  url?: string;
24
24
  urls?: ListenURL[];
25
25
  https?: boolean | HTTPSOptions;
26
+ addr?: AddressInfo;
26
27
  };
27
28
  }
28
29
  interface NuxtDevServerOptions {
@@ -33,11 +34,10 @@ interface NuxtDevServerOptions {
33
34
  clear?: boolean;
34
35
  defaults: NuxtConfig;
35
36
  overrides: NuxtConfig;
36
- port?: string | number;
37
37
  loadingTemplate?: ({ loading }: {
38
38
  loading: string;
39
39
  }) => string;
40
- devContext: NuxtDevContext;
40
+ devContext: Pick<NuxtDevContext, 'proxy'>;
41
41
  }
42
42
  interface DevServerEventMap {
43
43
  'loading:error': [error: Error];
@@ -58,16 +58,15 @@ declare class NuxtDevServer extends EventEmitter<DevServerEventMap> {
58
58
  handler: RequestListener;
59
59
  listener: Pick<Listener, 'server' | 'getURLs' | 'https' | 'url' | 'close'> & {
60
60
  _url?: string;
61
- address: {
61
+ address: Omit<AddressInfo, 'family'> & {
62
62
  socketPath: string;
63
- port: number;
64
- address: string;
65
63
  } | AddressInfo;
66
64
  };
67
65
  constructor(options: NuxtDevServerOptions);
68
66
  _renderError(req: IncomingMessage, res: ServerResponse): void;
69
67
  _renderLoadingScreen(req: IncomingMessage, res: ServerResponse): Promise<void>;
70
68
  init(): Promise<void>;
69
+ closeWatchers(): void;
71
70
  load(reload?: boolean, reason?: string): Promise<void>;
72
71
  close(): Promise<void>;
73
72
  _load(reload?: boolean, reason?: string): Promise<void>;
@@ -80,13 +79,11 @@ interface InitializeOptions {
80
79
  };
81
80
  }
82
81
  declare function initialize(devContext: NuxtDevContext, ctx?: InitializeOptions, _listenOptions?: true | Partial<ListenOptions>): Promise<{
83
- listener: Pick<listhen.Listener, "server" | "getURLs" | "https" | "url" | "close"> & {
82
+ listener: Pick<listhen.Listener, "https" | "server" | "url" | "getURLs" | "close"> & {
84
83
  _url?: string;
85
- address: {
84
+ address: (Omit<net.AddressInfo, "family"> & {
86
85
  socketPath: string;
87
- port: number;
88
- address: string;
89
- } | net.AddressInfo;
86
+ }) | net.AddressInfo;
90
87
  };
91
88
  close: () => Promise<void>;
92
89
  onReady: (callback: (address: string) => void) => void;
@@ -1,13 +1,15 @@
1
1
  export { i as initialize } from '../chunks/index.mjs';
2
2
  import 'node:process';
3
3
  import 'defu';
4
+ import 'listhen';
5
+ import 'node:http';
6
+ import 'get-port-please';
4
7
  import 'node:events';
5
8
  import 'node:fs';
6
9
  import 'node:fs/promises';
7
10
  import 'node:url';
8
11
  import 'exsolve';
9
12
  import 'h3';
10
- import 'listhen';
11
13
  import 'pathe';
12
14
  import 'perfect-debounce';
13
15
  import 'std-env';
@@ -19,5 +21,3 @@ import '../shared/cli-nightly.qKvs7FJ2.mjs';
19
21
  import '../shared/cli-nightly.Bu_9IHj2.mjs';
20
22
  import 'ohash';
21
23
  import 'youch';
22
- import 'node:http';
23
- import 'get-port-please';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { m as main, r as runCommand, h as runMain } from './shared/cli-nightly.BlsQXvtd.mjs';
1
+ export { m as main, r as runCommand, h as runMain } from './shared/cli-nightly.CJTIJXNl.mjs';
2
2
  import 'node:path';
3
3
  import 'node:process';
4
4
  import 'citty';
@@ -1,5 +1,5 @@
1
1
  const name = "nuxi-nightly";
2
- const version = "3.27.0-20250714-092833-c7c4dd1";
2
+ const version = "3.27.0-20250722-151425-b45a23d";
3
3
  const description = "Nuxt CLI";
4
4
 
5
5
  export { description as d, name as n, version as v };
@@ -58,7 +58,8 @@ const extendsArgs = {
58
58
  extends: {
59
59
  type: "string",
60
60
  description: "Extend from a Nuxt layer",
61
- valueHint: "layer-name"
61
+ valueHint: "layer-name",
62
+ alias: ["e"]
62
63
  }
63
64
  };
64
65
  const legacyRootDirArgs = {
@@ -128,7 +129,7 @@ async function checkEngines() {
128
129
  }
129
130
 
130
131
  const name = "@nuxt/cli-nightly";
131
- const version = "3.27.0-20250714-092854-c7c4dd1";
132
+ const version = "3.27.0-20250722-151444-b45a23d";
132
133
  const description = "Nuxt CLI";
133
134
 
134
135
  const main = defineCommand({
@@ -1,11 +1,11 @@
1
1
  import process from 'node:process';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import { defineCommand, runCommand as runCommand$1 } from 'citty';
4
- import { f as commands, c as cwdArgs, s as setupGlobalConsole, g as checkEngines } from './cli-nightly.BlsQXvtd.mjs';
4
+ import { f as commands, c as cwdArgs, s as setupGlobalConsole, g as checkEngines } from './cli-nightly.CJTIJXNl.mjs';
5
5
  import nodeCrypto from 'node:crypto';
6
6
  import { resolve } from 'node:path';
7
7
  import { provider } from 'std-env';
8
- import { d as description, v as version, n as name } from './cli-nightly.O7BoJVjz.mjs';
8
+ import { d as description, v as version, n as name } from './cli-nightly.BUNTKlM5.mjs';
9
9
  import { l as logger } from './cli-nightly.B9AmABr3.mjs';
10
10
 
11
11
  if (!globalThis.crypto) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/cli-nightly",
3
3
  "type": "module",
4
- "version": "3.27.0-20250714-092854-c7c4dd1",
4
+ "version": "3.27.0-20250722-151444-b45a23d",
5
5
  "description": "Nuxt CLI",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -61,9 +61,10 @@
61
61
  "youch": "^4.1.0-beta.10"
62
62
  },
63
63
  "devDependencies": {
64
- "@nuxt/schema": "^3.17.7",
65
- "@types/node": "^22.16.3",
66
- "rollup": "^4.45.0",
64
+ "@nuxt/kit": "^4.0.1",
65
+ "@nuxt/schema": "^4.0.1",
66
+ "@types/node": "^22.16.5",
67
+ "rollup": "^4.45.1",
67
68
  "rollup-plugin-visualizer": "^6.0.3",
68
69
  "typescript": "^5.8.3",
69
70
  "unbuild": "^3.5.0",