@nuxt/cli-nightly 3.30.0-20251028-094234-3afd02b → 3.30.0-20251030-113745-b8ea409

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 (35) hide show
  1. package/dist/{add-BGMHIn5L.mjs → add-CHVmfYrF.mjs} +1 -1
  2. package/dist/{add-CHYEpn7Y.mjs → add-DAUI-5jB.mjs} +1 -1
  3. package/dist/add-UF9L_ur5.mjs +10 -0
  4. package/dist/{analyze-Coe2kTBZ.mjs → analyze-B7ie7_6H.mjs} +3 -3
  5. package/dist/{banner-95R8hV4o.mjs → banner-CWBLwDiB.mjs} +1 -1
  6. package/dist/build-BEXmJONc.mjs +9 -0
  7. package/dist/{build-DkB8uZtZ.mjs → build-CVr-ruAe.mjs} +4 -4
  8. package/dist/{cleanup-8GRakeLu.mjs → cleanup-X4v95Xqm.mjs} +3 -3
  9. package/dist/dev/index.d.mts +10 -39
  10. package/dist/dev/index.mjs +5 -4
  11. package/dist/{dev-DsH3xiyp.mjs → dev-BYEMtZLe.mjs} +157 -161
  12. package/dist/dev-CD5a8ssT.mjs +8 -0
  13. package/dist/{dev-child-CJxOnht6.mjs → dev-child-Dcs4VQnN.mjs} +1 -1
  14. package/dist/dev-nr2jb3A5.mjs +278 -0
  15. package/dist/{generate-B328yidV.mjs → generate-DZJF1Xf_.mjs} +5 -5
  16. package/dist/index.mjs +16 -16
  17. package/dist/{info-B_wlb5Fu.mjs → info-CAy5OGO8.mjs} +2 -2
  18. package/dist/{init-CvLYtdn1.mjs → init-DxB4kjq8.mjs} +4 -4
  19. package/dist/{module-BUBa48Be.mjs → module-gIxjhGid.mjs} +2 -2
  20. package/dist/{nuxt-Cc9ZTk7m.mjs → nuxt-CfBR40hD.mjs} +1 -1
  21. package/dist/{prepare-xI978yFg.mjs → prepare-DjR-jyiQ.mjs} +2 -2
  22. package/dist/prepare-ZByeo9vQ.mjs +7 -0
  23. package/dist/{preview-BEqrL1ey.mjs → preview-CgpLKg-X.mjs} +1 -1
  24. package/dist/{search-DCyXfxzn.mjs → search-D_JLXbhF.mjs} +1 -1
  25. package/dist/{typecheck-DCWe7Iej.mjs → typecheck-egvrxpjV.mjs} +1 -1
  26. package/dist/{upgrade-BMSFcUWJ.mjs → upgrade-Bsj6DJXO.mjs} +3 -3
  27. package/package.json +2 -3
  28. package/dist/add-qJhPcmZB.mjs +0 -10
  29. package/dist/build-BebJ09xA.mjs +0 -9
  30. package/dist/dev-Bv3ZMKhd.mjs +0 -7
  31. package/dist/dev-lAMCAq4V.mjs +0 -344
  32. package/dist/prepare-B0KOhO-L.mjs +0 -7
  33. /package/dist/{env-Dz4K_NkM.mjs → env-CamzysGq.mjs} +0 -0
  34. /package/dist/{fs-ewAp6tjM.mjs → fs--ofMleGo.mjs} +0 -0
  35. /package/dist/{kit-xFxVGu6d.mjs → kit-f7zsnm10.mjs} +0 -0
@@ -1,344 +0,0 @@
1
- import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, r as envNameArgs, t as cwdArgs } from "./_shared-C3vB2YLc.mjs";
2
- import { t as logger } from "./logger-Dk0gkCkX.mjs";
3
- import { a as parseSocketURL, i as isSocketURL, n as resolveLoadingTemplate, r as renderError, t as initialize } from "./dev-DsH3xiyp.mjs";
4
- import "./fs-ewAp6tjM.mjs";
5
- import { t as loadKit } from "./kit-xFxVGu6d.mjs";
6
- import "./nuxt-Cc9ZTk7m.mjs";
7
- import { t as overrideEnv } from "./env-Dz4K_NkM.mjs";
8
- import { n as showVersionsFromConfig } from "./banner-95R8hV4o.mjs";
9
- import process from "node:process";
10
- import { defineCommand } from "citty";
11
- import { isBun, isDeno, isTest } from "std-env";
12
- import { listen } from "listhen";
13
- import { isSocketSupported } from "get-port-please";
14
- import { resolve } from "pathe";
15
- import { fork } from "node:child_process";
16
- import { createProxyServer } from "http-proxy-3";
17
- import { getArgs, parseArgs } from "listhen/cli";
18
- import { satisfies } from "semver";
19
-
20
- //#region ../nuxi/src/commands/dev.ts
21
- const startTime = Date.now();
22
- const forkSupported = !isTest && (!isBun || isBunForkSupported());
23
- const listhenArgs = getArgs();
24
- const command = defineCommand({
25
- meta: {
26
- name: "dev",
27
- description: "Run Nuxt development server"
28
- },
29
- args: {
30
- ...cwdArgs,
31
- ...logLevelArgs,
32
- ...dotEnvArgs,
33
- ...legacyRootDirArgs,
34
- ...envNameArgs,
35
- ...extendsArgs,
36
- clear: {
37
- type: "boolean",
38
- description: "Clear console on restart",
39
- default: false
40
- },
41
- fork: {
42
- type: "boolean",
43
- description: forkSupported ? "Disable forked mode" : "Enable forked mode",
44
- negativeDescription: "Disable forked mode",
45
- default: forkSupported,
46
- alias: ["f"]
47
- },
48
- ...listhenArgs,
49
- "port": {
50
- ...listhenArgs.port,
51
- description: "Port to listen on (default: `NUXT_PORT || NITRO_PORT || PORT || nuxtOptions.devServer.port`)",
52
- alias: ["p"]
53
- },
54
- "open": {
55
- ...listhenArgs.open,
56
- alias: ["o"],
57
- default: false
58
- },
59
- "host": {
60
- ...listhenArgs.host,
61
- alias: ["h"],
62
- description: "Host to listen on (default: `NUXT_HOST || NITRO_HOST || HOST || nuxtOptions.devServer?.host`)"
63
- },
64
- "clipboard": {
65
- ...listhenArgs.clipboard,
66
- default: false
67
- },
68
- "https.domains": {
69
- ...listhenArgs["https.domains"],
70
- description: "Comma separated list of domains and IPs, the autogenerated certificate should be valid for (https: true)"
71
- },
72
- sslCert: {
73
- type: "string",
74
- description: "(DEPRECATED) Use `--https.cert` instead."
75
- },
76
- sslKey: {
77
- type: "string",
78
- description: "(DEPRECATED) Use `--https.key` instead."
79
- }
80
- },
81
- async run(ctx) {
82
- overrideEnv("development");
83
- const cwd = resolve(ctx.args.cwd || ctx.args.rootDir);
84
- const { loadNuxtConfig } = await loadKit(cwd);
85
- const nuxtOptions = await loadNuxtConfig({
86
- cwd,
87
- dotenv: {
88
- cwd,
89
- fileName: ctx.args.dotenv
90
- },
91
- envName: ctx.args.envName,
92
- overrides: {
93
- dev: true,
94
- logLevel: ctx.args.logLevel,
95
- ...ctx.args.extends && { extends: ctx.args.extends },
96
- ...ctx.data?.overrides
97
- }
98
- });
99
- showVersionsFromConfig(cwd, nuxtOptions);
100
- const listenOptions = resolveListenOptions(nuxtOptions, ctx.args);
101
- if (!ctx.args.fork) {
102
- const { listener, close: close$1 } = await initialize({
103
- cwd,
104
- args: ctx.args,
105
- hostname: listenOptions.hostname,
106
- public: listenOptions.public,
107
- publicURLs: void 0,
108
- proxy: { https: listenOptions.https }
109
- }, { data: ctx.data }, listenOptions);
110
- return {
111
- listener,
112
- async close() {
113
- await close$1();
114
- await listener.close();
115
- }
116
- };
117
- }
118
- const devProxy = await createDevProxy(cwd, nuxtOptions, listenOptions);
119
- const useSocket = (process.env.NUXT_SOCKET ? process.env.NUXT_SOCKET === "1" : void 0) ?? (nuxtOptions._majorVersion === 4 && await isSocketSupported());
120
- const urls = await devProxy.listener.getURLs();
121
- const { onRestart, onReady, close } = await initialize({
122
- cwd,
123
- args: ctx.args,
124
- hostname: listenOptions.hostname,
125
- public: listenOptions.public,
126
- publicURLs: urls.map((r) => r.url),
127
- proxy: {
128
- url: devProxy.listener.url,
129
- urls,
130
- https: devProxy.listener.https,
131
- addr: devProxy.listener.address
132
- }
133
- }, {}, useSocket ? void 0 : true);
134
- onReady((address) => devProxy.setAddress(address));
135
- const fork$1 = startSubprocess(cwd, ctx.args, ctx.rawArgs, listenOptions);
136
- onRestart(async (devServer) => {
137
- const [subprocess] = await Promise.all([fork$1, devServer.close().catch(() => {})]);
138
- await subprocess.initialize(devProxy, useSocket);
139
- });
140
- return {
141
- listener: devProxy.listener,
142
- async close() {
143
- await close();
144
- (await fork$1).kill(0);
145
- await devProxy.listener.close();
146
- }
147
- };
148
- }
149
- });
150
- var dev_default = command;
151
- async function createDevProxy(cwd, nuxtOptions, listenOptions) {
152
- let loadingMessage = "Nuxt dev server is starting...";
153
- let error;
154
- let address;
155
- let loadingTemplate = nuxtOptions.devServer.loadingTemplate;
156
- const proxy = createProxyServer({});
157
- proxy.on("proxyReq", (proxyReq, req) => {
158
- if (!proxyReq.hasHeader("x-forwarded-for")) {
159
- const address$1 = req.socket.remoteAddress;
160
- if (address$1) proxyReq.appendHeader("x-forwarded-for", address$1);
161
- }
162
- if (!proxyReq.hasHeader("x-forwarded-port")) {
163
- const localPort = req?.socket?.localPort;
164
- if (localPort) proxyReq.setHeader("x-forwarded-port", localPort);
165
- }
166
- if (!proxyReq.hasHeader("x-forwarded-Proto")) {
167
- const encrypted = (req?.connection)?.encrypted;
168
- proxyReq.setHeader("x-forwarded-proto", encrypted ? "https" : "http");
169
- }
170
- });
171
- const listener = await listen((req, res) => {
172
- if (error) {
173
- renderError(req, res, error);
174
- return;
175
- }
176
- if (!address) {
177
- res.statusCode = 503;
178
- res.setHeader("Content-Type", "text/html");
179
- res.setHeader("Cache-Control", "no-store");
180
- if (loadingTemplate) {
181
- res.end(loadingTemplate({ loading: loadingMessage }));
182
- return;
183
- }
184
- async function resolveLoadingMessage() {
185
- loadingTemplate = await resolveLoadingTemplate(cwd);
186
- res.end(loadingTemplate({ loading: loadingMessage }));
187
- }
188
- return resolveLoadingMessage();
189
- }
190
- const target = isSocketURL(address) ? parseSocketURL(address) : address;
191
- proxy.web(req, res, { target });
192
- }, listenOptions);
193
- listener.server.on("upgrade", (req, socket, head) => {
194
- if (!address) {
195
- if (!socket.destroyed) socket.end();
196
- return;
197
- }
198
- const target = isSocketURL(address) ? parseSocketURL(address) : address;
199
- return proxy.ws(req, socket, head, {
200
- target,
201
- xfwd: true
202
- });
203
- });
204
- return {
205
- listener,
206
- setAddress: (_addr) => {
207
- address = _addr;
208
- },
209
- setLoadingMessage: (_msg) => {
210
- loadingMessage = _msg;
211
- },
212
- setError: (_error) => {
213
- error = _error;
214
- },
215
- clearError() {
216
- error = void 0;
217
- }
218
- };
219
- }
220
- async function startSubprocess(cwd, args, rawArgs, listenOptions) {
221
- let childProc;
222
- let devProxy;
223
- let ready;
224
- const kill = (signal) => {
225
- if (childProc) {
226
- childProc.kill(signal === 0 && isDeno ? "SIGTERM" : signal);
227
- childProc = void 0;
228
- }
229
- };
230
- async function initialize$1(proxy, socket) {
231
- devProxy = proxy;
232
- const urls = await devProxy.listener.getURLs();
233
- await ready;
234
- childProc.send({
235
- type: "nuxt:internal:dev:context",
236
- socket,
237
- context: {
238
- cwd,
239
- args,
240
- hostname: listenOptions.hostname,
241
- public: listenOptions.public,
242
- publicURLs: urls.map((r) => r.url),
243
- proxy: {
244
- url: devProxy.listener.url,
245
- urls,
246
- https: devProxy.listener.https
247
- }
248
- }
249
- });
250
- }
251
- async function restart() {
252
- devProxy?.clearError();
253
- if (!globalThis.__nuxt_cli__) return;
254
- if (process.platform === "win32") kill("SIGTERM");
255
- else kill("SIGHUP");
256
- childProc = fork(globalThis.__nuxt_cli__.devEntry, rawArgs, {
257
- execArgv: ["--enable-source-maps", process.argv.find((a) => a.includes("--inspect"))].filter(Boolean),
258
- env: {
259
- ...process.env,
260
- __NUXT__FORK: "true"
261
- }
262
- });
263
- childProc.on("close", (errorCode) => {
264
- if (errorCode) process.exit(errorCode);
265
- });
266
- ready = new Promise((resolve$1, reject) => {
267
- childProc.on("error", reject);
268
- childProc.on("message", (message) => {
269
- if (message.type === "nuxt:internal:dev:fork-ready") resolve$1();
270
- else if (message.type === "nuxt:internal:dev:ready") {
271
- devProxy.setAddress(message.address);
272
- if (startTime) logger.debug(`Dev server ready for connections in ${Date.now() - startTime}ms`);
273
- } else if (message.type === "nuxt:internal:dev:loading") {
274
- devProxy.setAddress(void 0);
275
- devProxy.setLoadingMessage(message.message);
276
- devProxy.clearError();
277
- } else if (message.type === "nuxt:internal:dev:loading:error") {
278
- devProxy.setAddress(void 0);
279
- devProxy.setError(message.error);
280
- } else if (message.type === "nuxt:internal:dev:restart") restart();
281
- else if (message.type === "nuxt:internal:dev:rejection") {
282
- logger.info(`Restarting Nuxt due to error: \`${message.message}\``);
283
- restart();
284
- }
285
- });
286
- });
287
- }
288
- for (const signal of [
289
- "exit",
290
- "SIGTERM",
291
- "SIGINT",
292
- "SIGQUIT"
293
- ]) process.once(signal, () => {
294
- kill(signal === "exit" ? 0 : signal);
295
- });
296
- await restart();
297
- return {
298
- initialize: initialize$1,
299
- restart,
300
- kill
301
- };
302
- }
303
- function resolveListenOptions(nuxtOptions, args) {
304
- const _port = args.port ?? args.p ?? process.env.NUXT_PORT ?? process.env.NITRO_PORT ?? process.env.PORT ?? nuxtOptions.devServer.port;
305
- 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;
306
- const _public = args.public ?? (_hostname && ![
307
- "localhost",
308
- "127.0.0.1",
309
- "::1"
310
- ].includes(_hostname)) ? true : void 0;
311
- 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 || "";
312
- 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 || "";
313
- const _httpsPfx = args["https.pfx"] || typeof nuxtOptions.devServer.https !== "boolean" && nuxtOptions.devServer.https && "pfx" in nuxtOptions.devServer.https && nuxtOptions.devServer.https.pfx || "";
314
- const _httpsPassphrase = args["https.passphrase"] || typeof nuxtOptions.devServer.https !== "boolean" && nuxtOptions.devServer.https && "passphrase" in nuxtOptions.devServer.https && nuxtOptions.devServer.https.passphrase || "";
315
- const httpsEnabled = !!(args.https ?? nuxtOptions.devServer.https);
316
- const _listhenOptions = parseArgs({
317
- ...args,
318
- "open": args.o || args.open,
319
- "https": httpsEnabled,
320
- "https.cert": _httpsCert,
321
- "https.key": _httpsKey,
322
- "https.pfx": _httpsPfx,
323
- "https.passphrase": _httpsPassphrase
324
- });
325
- const httpsOptions = httpsEnabled && {
326
- ...nuxtOptions.devServer.https,
327
- ..._listhenOptions.https
328
- };
329
- return {
330
- ..._listhenOptions,
331
- port: _port,
332
- hostname: _hostname,
333
- public: _public,
334
- https: httpsOptions,
335
- baseURL: nuxtOptions.app.baseURL.startsWith("./") ? nuxtOptions.app.baseURL.slice(1) : nuxtOptions.app.baseURL
336
- };
337
- }
338
- function isBunForkSupported() {
339
- const bunVersion = globalThis.Bun.version;
340
- return satisfies(bunVersion, ">=1.2");
341
- }
342
-
343
- //#endregion
344
- export { dev_default as default };
@@ -1,7 +0,0 @@
1
- import "./_shared-C3vB2YLc.mjs";
2
- import "./logger-Dk0gkCkX.mjs";
3
- import "./fs-ewAp6tjM.mjs";
4
- import "./kit-xFxVGu6d.mjs";
5
- import { t as prepare_default } from "./prepare-xI978yFg.mjs";
6
-
7
- export { prepare_default as default };
File without changes
File without changes
File without changes