@nuxt/cli-nightly 3.26.0-20250607-210256-59f83b1 → 3.26.0-20250607-223602-1089c0e

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 (36) hide show
  1. package/bin/nuxi.mjs +1 -0
  2. package/dist/chunks/add.mjs +308 -290
  3. package/dist/chunks/add2.mjs +291 -307
  4. package/dist/chunks/analyze.mjs +8 -7
  5. package/dist/chunks/build.mjs +11 -11
  6. package/dist/chunks/cleanup.mjs +8 -7
  7. package/dist/chunks/dev-child.mjs +11 -71
  8. package/dist/chunks/dev.mjs +142 -117
  9. package/dist/chunks/devtools.mjs +3 -2
  10. package/dist/chunks/generate.mjs +8 -8
  11. package/dist/chunks/index.mjs +379 -12
  12. package/dist/chunks/index2.mjs +15 -0
  13. package/dist/chunks/info.mjs +8 -6
  14. package/dist/chunks/init.mjs +7 -5
  15. package/dist/chunks/prepare.mjs +7 -6
  16. package/dist/chunks/preview.mjs +6 -5
  17. package/dist/chunks/search.mjs +3 -2
  18. package/dist/chunks/test.mjs +3 -2
  19. package/dist/chunks/typecheck.mjs +6 -6
  20. package/dist/chunks/upgrade.mjs +9 -8
  21. package/dist/dev/index.d.mts +75 -0
  22. package/dist/dev/index.d.ts +75 -0
  23. package/dist/dev/index.mjs +21 -0
  24. package/dist/index.mjs +2 -1
  25. package/dist/shared/cli-nightly.B9AmABr3.mjs +5 -0
  26. package/dist/shared/{cli-nightly.DPQxxyDx.mjs → cli-nightly.BUFTQIaz.mjs} +1 -1
  27. package/dist/shared/{cli-nightly.DlcAx0De.mjs → cli-nightly.BrKZotr9.mjs} +11 -9
  28. package/dist/shared/{cli-nightly.DDBHWicM.mjs → cli-nightly.Bu_9IHj2.mjs} +2 -2
  29. package/dist/shared/{cli-nightly.DTVmTXKJ.mjs → cli-nightly.Cq6GVhe3.mjs} +7 -6
  30. package/dist/shared/{cli-nightly.BnfAj4iy.mjs → cli-nightly.DPmMxQ6h.mjs} +1 -1
  31. package/dist/shared/{cli-nightly.CjK7ZDKA.mjs → cli-nightly.DSXVWJCf.mjs} +9 -10
  32. package/dist/shared/cli-nightly.Dc8ncNQ_.mjs +27 -0
  33. package/dist/shared/{cli-nightly.DdmGgrsK.mjs → cli-nightly.DkO5RR_e.mjs} +1 -1
  34. package/package.json +2 -1
  35. package/dist/chunks/dev2.mjs +0 -293
  36. package/dist/shared/cli-nightly.COGWopdX.mjs +0 -26
@@ -0,0 +1,75 @@
1
+ import * as listhen from 'listhen';
2
+ import { ListenURL, HTTPSOptions, Listener, ListenOptions } from 'listhen';
3
+ import { NuxtConfig } from '@nuxt/schema';
4
+ import { DotenvOptions } from 'c12';
5
+ import { RequestListener, IncomingMessage, ServerResponse } from 'node:http';
6
+ import EventEmitter from 'node:events';
7
+
8
+ interface NuxtDevContext {
9
+ cwd: string;
10
+ public?: boolean;
11
+ hostname?: string;
12
+ publicURLs?: string[];
13
+ args: {
14
+ clear: boolean;
15
+ logLevel: string;
16
+ dotenv: string;
17
+ envName: string;
18
+ };
19
+ proxy?: {
20
+ url?: string;
21
+ urls?: ListenURL[];
22
+ https?: boolean | HTTPSOptions;
23
+ };
24
+ }
25
+ interface NuxtDevServerOptions {
26
+ cwd: string;
27
+ logLevel?: 'silent' | 'info' | 'verbose';
28
+ dotenv: DotenvOptions;
29
+ envName?: string;
30
+ clear?: boolean;
31
+ defaults: NuxtConfig;
32
+ overrides: NuxtConfig;
33
+ port?: string | number;
34
+ loadingTemplate?: ({ loading }: {
35
+ loading: string;
36
+ }) => string;
37
+ devContext: NuxtDevContext;
38
+ }
39
+ declare class NuxtDevServer extends EventEmitter {
40
+ private options;
41
+ private _handler?;
42
+ private _distWatcher?;
43
+ private _currentNuxt?;
44
+ private _loadingMessage?;
45
+ private _loadingError?;
46
+ private cwd;
47
+ loadDebounced: (reload?: boolean, reason?: string) => void;
48
+ handler: RequestListener;
49
+ listener: Listener;
50
+ constructor(options: NuxtDevServerOptions);
51
+ _renderError(req: IncomingMessage, res: ServerResponse): void;
52
+ resolveLoadingTemplate(): Promise<(params: {
53
+ loading: string;
54
+ }) => string>;
55
+ _renderLoadingScreen(req: IncomingMessage, res: ServerResponse): Promise<void>;
56
+ init(): Promise<void>;
57
+ load(reload?: boolean, reason?: string): Promise<void>;
58
+ close(): Promise<void>;
59
+ _load(reload?: boolean, reason?: string): Promise<void>;
60
+ _watchConfig(): Promise<void>;
61
+ }
62
+
63
+ interface InitializeOptions {
64
+ data?: {
65
+ overrides?: NuxtConfig;
66
+ };
67
+ }
68
+ declare function initialize(devContext: NuxtDevContext, ctx?: InitializeOptions, listenOptions?: Partial<ListenOptions>): Promise<{
69
+ listener: listhen.Listener;
70
+ close: () => Promise<void>;
71
+ onReady: (callback: (port: number) => void) => void;
72
+ onRestart: (callback: (devServer: NuxtDevServer) => void) => void;
73
+ }>;
74
+
75
+ export { initialize };
@@ -0,0 +1,75 @@
1
+ import * as listhen from 'listhen';
2
+ import { ListenURL, HTTPSOptions, Listener, ListenOptions } from 'listhen';
3
+ import { NuxtConfig } from '@nuxt/schema';
4
+ import { DotenvOptions } from 'c12';
5
+ import { RequestListener, IncomingMessage, ServerResponse } from 'node:http';
6
+ import EventEmitter from 'node:events';
7
+
8
+ interface NuxtDevContext {
9
+ cwd: string;
10
+ public?: boolean;
11
+ hostname?: string;
12
+ publicURLs?: string[];
13
+ args: {
14
+ clear: boolean;
15
+ logLevel: string;
16
+ dotenv: string;
17
+ envName: string;
18
+ };
19
+ proxy?: {
20
+ url?: string;
21
+ urls?: ListenURL[];
22
+ https?: boolean | HTTPSOptions;
23
+ };
24
+ }
25
+ interface NuxtDevServerOptions {
26
+ cwd: string;
27
+ logLevel?: 'silent' | 'info' | 'verbose';
28
+ dotenv: DotenvOptions;
29
+ envName?: string;
30
+ clear?: boolean;
31
+ defaults: NuxtConfig;
32
+ overrides: NuxtConfig;
33
+ port?: string | number;
34
+ loadingTemplate?: ({ loading }: {
35
+ loading: string;
36
+ }) => string;
37
+ devContext: NuxtDevContext;
38
+ }
39
+ declare class NuxtDevServer extends EventEmitter {
40
+ private options;
41
+ private _handler?;
42
+ private _distWatcher?;
43
+ private _currentNuxt?;
44
+ private _loadingMessage?;
45
+ private _loadingError?;
46
+ private cwd;
47
+ loadDebounced: (reload?: boolean, reason?: string) => void;
48
+ handler: RequestListener;
49
+ listener: Listener;
50
+ constructor(options: NuxtDevServerOptions);
51
+ _renderError(req: IncomingMessage, res: ServerResponse): void;
52
+ resolveLoadingTemplate(): Promise<(params: {
53
+ loading: string;
54
+ }) => string>;
55
+ _renderLoadingScreen(req: IncomingMessage, res: ServerResponse): Promise<void>;
56
+ init(): Promise<void>;
57
+ load(reload?: boolean, reason?: string): Promise<void>;
58
+ close(): Promise<void>;
59
+ _load(reload?: boolean, reason?: string): Promise<void>;
60
+ _watchConfig(): Promise<void>;
61
+ }
62
+
63
+ interface InitializeOptions {
64
+ data?: {
65
+ overrides?: NuxtConfig;
66
+ };
67
+ }
68
+ declare function initialize(devContext: NuxtDevContext, ctx?: InitializeOptions, listenOptions?: Partial<ListenOptions>): Promise<{
69
+ listener: listhen.Listener;
70
+ close: () => Promise<void>;
71
+ onReady: (callback: (port: number) => void) => void;
72
+ onRestart: (callback: (devServer: NuxtDevServer) => void) => void;
73
+ }>;
74
+
75
+ export { initialize };
@@ -0,0 +1,21 @@
1
+ export { i as initialize } from '../chunks/index.mjs';
2
+ import 'node:process';
3
+ import 'defu';
4
+ import 'node:events';
5
+ import 'chokidar';
6
+ import 'h3';
7
+ import 'listhen';
8
+ import 'pathe';
9
+ import 'perfect-debounce';
10
+ import 'std-env';
11
+ import 'ufo';
12
+ import '../shared/cli-nightly.DPmMxQ6h.mjs';
13
+ import 'node:fs';
14
+ import '../shared/cli-nightly.B9AmABr3.mjs';
15
+ import 'consola';
16
+ import '../shared/cli-nightly.BrKZotr9.mjs';
17
+ import 'node:url';
18
+ import 'exsolve';
19
+ import '../shared/cli-nightly.Bu_9IHj2.mjs';
20
+ import 'ohash';
21
+ import 'youch';
package/dist/index.mjs CHANGED
@@ -1,7 +1,8 @@
1
- export { m as main, r as runCommand, h as runMain } from './shared/cli-nightly.CjK7ZDKA.mjs';
1
+ export { m as main, r as runCommand, g as runMain } from './shared/cli-nightly.DSXVWJCf.mjs';
2
2
  import 'node:path';
3
3
  import 'node:process';
4
4
  import 'citty';
5
5
  import 'std-env';
6
6
  import 'consola';
7
+ import './shared/cli-nightly.B9AmABr3.mjs';
7
8
  import 'node:url';
@@ -0,0 +1,5 @@
1
+ import { consola } from 'consola';
2
+
3
+ const logger = consola.withTag("nuxi");
4
+
5
+ export { logger as l };
@@ -1,5 +1,5 @@
1
1
  const name = "nuxi-nightly";
2
- const version = "3.26.0-20250607-210236-59f83b1";
2
+ const version = "3.26.0-20250607-223541-1089c0e";
3
3
  const description = "Nuxt CLI";
4
4
 
5
5
  export { description as d, name as n, version as v };
@@ -1,11 +1,14 @@
1
- import { createJiti } from 'jiti';
1
+ import { pathToFileURL } from 'node:url';
2
+ import { resolveModulePath } from 'exsolve';
2
3
 
3
4
  async function loadKit(rootDir) {
4
- const jiti = createJiti(rootDir);
5
5
  try {
6
- const localKit = jiti.esmResolve("@nuxt/kit", { try: true });
7
- const rootURL = localKit ? rootDir : await tryResolveNuxt(rootDir) || rootDir;
8
- let kit = await jiti.import("@nuxt/kit", { parentURL: rootURL });
6
+ let kitPath = resolveModulePath("@nuxt/kit", { try: true, from: rootDir });
7
+ if (!kitPath) {
8
+ const nuxtPath = tryResolveNuxt(rootDir);
9
+ kitPath = resolveModulePath("@nuxt/kit", { from: nuxtPath || rootDir });
10
+ }
11
+ let kit = await import(pathToFileURL(kitPath).href);
9
12
  if (!kit.writeTypes) {
10
13
  kit = {
11
14
  ...kit,
@@ -18,16 +21,15 @@ async function loadKit(rootDir) {
18
21
  } catch (e) {
19
22
  if (e.toString().includes("Cannot find module '@nuxt/kit'")) {
20
23
  throw new Error(
21
- "nuxi requires `@nuxt/kit` to be installed in your project. Try installing `nuxt` v3 or `@nuxt/bridge` first."
24
+ "nuxi requires `@nuxt/kit` to be installed in your project. Try installing `nuxt` v3+ or `@nuxt/bridge` first."
22
25
  );
23
26
  }
24
27
  throw e;
25
28
  }
26
29
  }
27
- async function tryResolveNuxt(rootDir) {
28
- const jiti = createJiti(rootDir);
30
+ function tryResolveNuxt(rootDir) {
29
31
  for (const pkg of ["nuxt-nightly", "nuxt", "nuxt3", "nuxt-edge"]) {
30
- const path = jiti.esmResolve(pkg, { try: true });
32
+ const path = resolveModulePath(pkg, { from: rootDir, try: true });
31
33
  if (path) {
32
34
  return path;
33
35
  }
@@ -1,8 +1,8 @@
1
1
  import { promises } from 'node:fs';
2
2
  import { hash } from 'ohash';
3
3
  import { resolve, dirname } from 'pathe';
4
- import { a as logger } from './cli-nightly.CjK7ZDKA.mjs';
5
- import { r as rmRecursive } from './cli-nightly.BnfAj4iy.mjs';
4
+ import { l as logger } from './cli-nightly.B9AmABr3.mjs';
5
+ import { r as rmRecursive } from './cli-nightly.DPmMxQ6h.mjs';
6
6
 
7
7
  async function cleanupNuxtDirs(rootDir, buildDir) {
8
8
  logger.info("Cleaning up generated Nuxt files and caches...");
@@ -1,11 +1,12 @@
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, a as logger, s as setupGlobalConsole, g as checkEngines } from './cli-nightly.CjK7ZDKA.mjs';
4
+ import { b as commands, c as cwdArgs, s as setupGlobalConsole, f as checkEngines } from './cli-nightly.DSXVWJCf.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.DPQxxyDx.mjs';
8
+ import { d as description, v as version, n as name } from './cli-nightly.BUFTQIaz.mjs';
9
+ import { l as logger } from './cli-nightly.B9AmABr3.mjs';
9
10
 
10
11
  if (!globalThis.crypto) {
11
12
  globalThis.crypto = nodeCrypto;
@@ -60,10 +61,10 @@ globalThis.__nuxt_cli__ = globalThis.__nuxt_cli__ || {
60
61
  // Programmatic usage fallback
61
62
  startTime: Date.now(),
62
63
  entry: fileURLToPath(
63
- new URL(
64
- import.meta.url.endsWith(".ts") ? "../bin/nuxi.mjs" : "../../bin/nuxi.mjs",
65
- import.meta.url
66
- )
64
+ new URL("../../bin/nuxi.mjs", import.meta.url)
65
+ ),
66
+ devEntry: fileURLToPath(
67
+ new URL("../dev/index.mjs", import.meta.url)
67
68
  )
68
69
  };
69
70
  async function runCommand(name, argv = process.argv.slice(2), data = {}) {
@@ -1,6 +1,6 @@
1
1
  import { promises, existsSync } from 'node:fs';
2
2
  import { join } from 'pathe';
3
- import { a as logger } from './cli-nightly.CjK7ZDKA.mjs';
3
+ import { l as logger } from './cli-nightly.B9AmABr3.mjs';
4
4
 
5
5
  async function clearDir(path, exclude) {
6
6
  if (!exclude) {
@@ -3,11 +3,12 @@ import process from 'node:process';
3
3
  import { defineCommand, runMain as runMain$1, runCommand as runCommand$1 } from 'citty';
4
4
  import { provider } from 'std-env';
5
5
  import { consola } from 'consola';
6
+ import { l as logger } from './cli-nightly.B9AmABr3.mjs';
6
7
  import { fileURLToPath } from 'node:url';
7
8
 
8
9
  const _rDefault = (r) => r.default || r;
9
10
  const commands = {
10
- add: () => import('../chunks/add.mjs').then(_rDefault),
11
+ add: () => import('../chunks/add2.mjs').then(_rDefault),
11
12
  analyze: () => import('../chunks/analyze.mjs').then(_rDefault),
12
13
  build: () => import('../chunks/build.mjs').then(_rDefault),
13
14
  cleanup: () => import('../chunks/cleanup.mjs').then(_rDefault),
@@ -17,7 +18,7 @@ const commands = {
17
18
  generate: () => import('../chunks/generate.mjs').then(_rDefault),
18
19
  info: () => import('../chunks/info.mjs').then(_rDefault),
19
20
  init: () => import('../chunks/init.mjs').then(_rDefault),
20
- module: () => import('../chunks/index.mjs').then(_rDefault),
21
+ module: () => import('../chunks/index2.mjs').then(_rDefault),
21
22
  prepare: () => import('../chunks/prepare.mjs').then(_rDefault),
22
23
  preview: () => import('../chunks/preview.mjs').then(_rDefault),
23
24
  start: () => import('../chunks/preview.mjs').then(_rDefault),
@@ -105,8 +106,6 @@ function setupGlobalConsole(opts = {}) {
105
106
  process.on("uncaughtException", (err) => consola.error("[uncaughtException]", err));
106
107
  }
107
108
 
108
- const logger = consola.withTag("nuxi");
109
-
110
109
  async function checkEngines() {
111
110
  const satisfies = await import('semver/functions/satisfies.js').then(
112
111
  (r) => r.default || r
@@ -122,7 +121,7 @@ async function checkEngines() {
122
121
  }
123
122
 
124
123
  const name = "@nuxt/cli-nightly";
125
- const version = "3.26.0-20250607-210256-59f83b1";
124
+ const version = "3.26.0-20250607-223602-1089c0e";
126
125
  const description = "Nuxt CLI";
127
126
 
128
127
  const main = defineCommand({
@@ -174,10 +173,10 @@ globalThis.__nuxt_cli__ = globalThis.__nuxt_cli__ || {
174
173
  // Programmatic usage fallback
175
174
  startTime: Date.now(),
176
175
  entry: fileURLToPath(
177
- new URL(
178
- import.meta.url.endsWith(".ts") ? "../bin/nuxi.mjs" : "../../bin/nuxi.mjs",
179
- import.meta.url
180
- )
176
+ new URL("../../bin/nuxi.mjs", import.meta.url)
177
+ ),
178
+ devEntry: fileURLToPath(
179
+ new URL("../dev/index.mjs", import.meta.url)
181
180
  )
182
181
  };
183
182
  const runMain = () => runMain$1(main);
@@ -194,4 +193,4 @@ async function runCommand(name, argv = process.argv.slice(2), data = {}) {
194
193
  });
195
194
  }
196
195
 
197
- export { logger as a, legacyRootDirArgs as b, cwdArgs as c, dotEnvArgs as d, envNameArgs as e, commands as f, checkEngines as g, runMain as h, logLevelArgs as l, main as m, runCommand as r, setupGlobalConsole as s };
196
+ export { logLevelArgs as a, commands as b, cwdArgs as c, dotEnvArgs as d, envNameArgs as e, checkEngines as f, runMain as g, legacyRootDirArgs as l, main as m, runCommand as r, setupGlobalConsole as s };
@@ -0,0 +1,27 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { colors } from 'consola/utils';
3
+ import { resolveModulePath } from 'exsolve';
4
+ import { t as tryResolveNuxt } from './cli-nightly.BrKZotr9.mjs';
5
+ import { l as logger } from './cli-nightly.B9AmABr3.mjs';
6
+
7
+ function showVersions(cwd) {
8
+ const { bold, gray, green } = colors;
9
+ const nuxtDir = tryResolveNuxt(cwd);
10
+ function getPkgVersion(pkg) {
11
+ for (const url of [cwd, nuxtDir]) {
12
+ if (!url) {
13
+ continue;
14
+ }
15
+ const p = resolveModulePath(`${pkg}/package.json`, { from: url, try: true });
16
+ if (p) {
17
+ return JSON.parse(readFileSync(p, "utf-8")).version;
18
+ }
19
+ }
20
+ return "";
21
+ }
22
+ const nuxtVersion = getPkgVersion("nuxt") || getPkgVersion("nuxt-nightly") || getPkgVersion("nuxt3") || getPkgVersion("nuxt-edge");
23
+ const nitroVersion = getPkgVersion("nitropack") || getPkgVersion("nitropack-nightly") || getPkgVersion("nitropack-edge");
24
+ logger.log(gray(green(`Nuxt ${bold(nuxtVersion)}`) + (nitroVersion ? ` with Nitro ${bold(nitroVersion)}` : "")));
25
+ }
26
+
27
+ export { showVersions as s };
@@ -1,5 +1,5 @@
1
1
  import process from 'node:process';
2
- import { a as logger } from './cli-nightly.CjK7ZDKA.mjs';
2
+ import { l as logger } from './cli-nightly.B9AmABr3.mjs';
3
3
 
4
4
  function overrideEnv(targetEnv) {
5
5
  const currentEnv = process.env.NODE_ENV;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/cli-nightly",
3
3
  "type": "module",
4
- "version": "3.26.0-20250607-210256-59f83b1",
4
+ "version": "3.26.0-20250607-223602-1089c0e",
5
5
  "description": "Nuxt CLI",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -39,6 +39,7 @@
39
39
  "clipboardy": "^4.0.0",
40
40
  "consola": "^3.4.2",
41
41
  "defu": "^6.1.4",
42
+ "exsolve": "^1.0.5",
42
43
  "fuse.js": "^7.1.0",
43
44
  "giget": "^2.0.0",
44
45
  "h3": "^1.15.3",