@nuxt/cli-nightly 3.31.0-20251103-131136-f9de385 → 3.31.0-20251104-171725-fd1747f
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.
- package/dist/{add-CBEUvaze.mjs → add-CC8PhdIc.mjs} +1 -1
- package/dist/{add-kZRi0oTW.mjs → add-yCkF7lke.mjs} +33 -27
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +141 -6
- package/dist/{info-CYawH8qz.mjs → info-CMV1qV_q.mjs} +1 -1
- package/dist/{init-BQkH4r8t.mjs → init-DX0yoR1B.mjs} +97 -46
- package/dist/{module-DLtKXRxA.mjs → module-t-MDBA3Y.mjs} +1 -1
- package/dist/{upgrade-knZur6qb.mjs → upgrade-DGXExT1z.mjs} +43 -26
- package/package.json +5 -3
|
@@ -2,7 +2,7 @@ import "./_shared-C3vB2YLc.mjs";
|
|
|
2
2
|
import "./logger-Dk0gkCkX.mjs";
|
|
3
3
|
import "./kit-f7zsnm10.mjs";
|
|
4
4
|
import "./fs--ofMleGo.mjs";
|
|
5
|
-
import { t as add_default } from "./add-
|
|
5
|
+
import { t as add_default } from "./add-yCkF7lke.mjs";
|
|
6
6
|
import "./versions-CSy_3o_-.mjs";
|
|
7
7
|
import "./prepare-DjR-jyiQ.mjs";
|
|
8
8
|
import "./_utils-DTrPahho.mjs";
|
|
@@ -16,6 +16,7 @@ import { satisfies } from "semver";
|
|
|
16
16
|
import { homedir } from "node:os";
|
|
17
17
|
import { addDependency, detectPackageManager } from "nypm";
|
|
18
18
|
import { readPackageJSON } from "pkg-types";
|
|
19
|
+
import { confirm, isCancel, select } from "@clack/prompts";
|
|
19
20
|
import { $fetch } from "ofetch";
|
|
20
21
|
import { updateConfig } from "c12/update";
|
|
21
22
|
|
|
@@ -95,11 +96,11 @@ var add_default = defineCommand({
|
|
|
95
96
|
const projectPkg = await readPackageJSON(cwd).catch(() => ({}));
|
|
96
97
|
if (!projectPkg.dependencies?.nuxt && !projectPkg.devDependencies?.nuxt) {
|
|
97
98
|
logger.warn(`No \`nuxt\` dependency detected in \`${cwd}\`.`);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const shouldContinue = await confirm({
|
|
100
|
+
message: `Do you want to continue anyway?`,
|
|
101
|
+
initialValue: false
|
|
102
|
+
});
|
|
103
|
+
if (isCancel(shouldContinue) || shouldContinue !== true) process.exit(1);
|
|
103
104
|
}
|
|
104
105
|
const resolvedModules = (await Promise.all(modules.map((moduleName) => resolveModule(moduleName, cwd)))).filter((x) => x != null);
|
|
105
106
|
logger.info(`Resolved \`${resolvedModules.map((x) => x.pkgName).join("`, `")}\`, adding module${resolvedModules.length > 1 ? "s" : ""}...`);
|
|
@@ -135,15 +136,14 @@ async function addModules(modules, { skipInstall, skipConfig, cwd, dev }, projec
|
|
|
135
136
|
installPeerDependencies: true,
|
|
136
137
|
packageManager,
|
|
137
138
|
workspace: packageManager?.name === "pnpm" && existsSync(resolve$1(cwd, "pnpm-workspace.yaml"))
|
|
138
|
-
}).then(() => true).catch((error) => {
|
|
139
|
+
}).then(() => true).catch(async (error) => {
|
|
139
140
|
logger.error(error);
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
type: "confirm",
|
|
144
|
-
initial: false,
|
|
145
|
-
cancel: "default"
|
|
141
|
+
const result = await confirm({
|
|
142
|
+
message: `Install failed for \`${notInstalledModules.map((module) => colors.cyan(module.pkg)).join("`, `")}\`. Do you want to continue adding the module${notInstalledModules.length > 1 ? "s" : ""} to ${colors.cyan("nuxt.config")}?`,
|
|
143
|
+
initialValue: false
|
|
146
144
|
});
|
|
145
|
+
if (isCancel(result)) return false;
|
|
146
|
+
return result;
|
|
147
147
|
}) !== true) return;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
@@ -201,11 +201,11 @@ async function resolveModule(moduleName, cwd) {
|
|
|
201
201
|
const nuxtVersion = await getNuxtVersion(cwd);
|
|
202
202
|
if (!checkNuxtCompatibility(matchedModule, nuxtVersion)) {
|
|
203
203
|
logger.warn(`The module \`${pkgName}\` is not compatible with Nuxt \`${nuxtVersion}\` (requires \`${matchedModule.compatibility.nuxt}\`)`);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
const shouldContinue = await confirm({
|
|
205
|
+
message: "Do you want to continue installing incompatible version?",
|
|
206
|
+
initialValue: false
|
|
207
|
+
});
|
|
208
|
+
if (isCancel(shouldContinue) || !shouldContinue) return false;
|
|
209
209
|
}
|
|
210
210
|
const versionMap = matchedModule.compatibility.versionMap;
|
|
211
211
|
if (versionMap) {
|
|
@@ -213,12 +213,18 @@ async function resolveModule(moduleName, cwd) {
|
|
|
213
213
|
if (!pkgVersion) pkgVersion = _moduleVersion;
|
|
214
214
|
else {
|
|
215
215
|
logger.warn(`Recommended version of \`${pkgName}\` for Nuxt \`${nuxtVersion}\` is \`${_moduleVersion}\` but you have requested \`${pkgVersion}\``);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
options: [
|
|
219
|
-
|
|
216
|
+
const result = await select({
|
|
217
|
+
message: "Choose a version:",
|
|
218
|
+
options: [{
|
|
219
|
+
value: _moduleVersion,
|
|
220
|
+
label: _moduleVersion
|
|
221
|
+
}, {
|
|
222
|
+
value: pkgVersion,
|
|
223
|
+
label: pkgVersion
|
|
224
|
+
}]
|
|
220
225
|
});
|
|
221
|
-
if (
|
|
226
|
+
if (isCancel(result)) return false;
|
|
227
|
+
pkgVersion = result;
|
|
222
228
|
}
|
|
223
229
|
break;
|
|
224
230
|
}
|
|
@@ -235,11 +241,11 @@ async function resolveModule(moduleName, cwd) {
|
|
|
235
241
|
const pkgDependencies = Object.assign(pkg.dependencies || {}, pkg.devDependencies || {});
|
|
236
242
|
if (!pkgDependencies.nuxt && !pkgDependencies["nuxt-edge"] && !pkgDependencies["@nuxt/kit"]) {
|
|
237
243
|
logger.warn(`It seems that \`${pkgName}\` is not a Nuxt module.`);
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
244
|
+
const shouldContinue = await confirm({
|
|
245
|
+
message: `Do you want to continue installing ${colors.cyan(pkgName)} anyway?`,
|
|
246
|
+
initialValue: false
|
|
247
|
+
});
|
|
248
|
+
if (isCancel(shouldContinue) || !shouldContinue) return false;
|
|
243
249
|
}
|
|
244
250
|
return {
|
|
245
251
|
nuxtModule: matchedModule,
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { CommandDef } from "citty";
|
|
|
4
4
|
declare const main: CommandDef<any>;
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/run.d.ts
|
|
7
|
-
declare
|
|
7
|
+
declare function runMain(): Promise<void>;
|
|
8
8
|
declare function runCommand(name: string, argv?: string[], data?: {
|
|
9
9
|
overrides?: Record<string, any>;
|
|
10
10
|
}): Promise<{
|
package/dist/index.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { defineCommand, runCommand as runCommand$1, runMain as runMain$1 } from
|
|
|
6
6
|
import { provider } from "std-env";
|
|
7
7
|
import { consola } from "consola";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
|
+
import tab from "@bomb.sh/tab/citty";
|
|
9
10
|
|
|
10
11
|
//#region ../nuxi/src/commands/index.ts
|
|
11
12
|
const _rDefault = (r) => r.default || r;
|
|
@@ -18,15 +19,15 @@ const commands = {
|
|
|
18
19
|
dev: () => import("./dev-nr2jb3A5.mjs").then(_rDefault),
|
|
19
20
|
devtools: () => import("./devtools-BLGzUSNU.mjs").then(_rDefault),
|
|
20
21
|
generate: () => import("./generate-DZJF1Xf_.mjs").then(_rDefault),
|
|
21
|
-
info: () => import("./info-
|
|
22
|
-
init: () => import("./init-
|
|
23
|
-
module: () => import("./module-
|
|
22
|
+
info: () => import("./info-CMV1qV_q.mjs").then(_rDefault),
|
|
23
|
+
init: () => import("./init-DX0yoR1B.mjs").then(_rDefault),
|
|
24
|
+
module: () => import("./module-t-MDBA3Y.mjs").then(_rDefault),
|
|
24
25
|
prepare: () => import("./prepare-ZByeo9vQ.mjs").then(_rDefault),
|
|
25
26
|
preview: () => import("./preview-CgpLKg-X.mjs").then(_rDefault),
|
|
26
27
|
start: () => import("./preview-CgpLKg-X.mjs").then(_rDefault),
|
|
27
28
|
test: () => import("./test-CBt1emEB.mjs").then(_rDefault),
|
|
28
29
|
typecheck: () => import("./typecheck-egvrxpjV.mjs").then(_rDefault),
|
|
29
|
-
upgrade: () => import("./upgrade-
|
|
30
|
+
upgrade: () => import("./upgrade-DGXExT1z.mjs").then(_rDefault)
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
//#endregion
|
|
@@ -63,7 +64,7 @@ async function checkEngines() {
|
|
|
63
64
|
//#endregion
|
|
64
65
|
//#region package.json
|
|
65
66
|
var name = "@nuxt/cli-nightly";
|
|
66
|
-
var version = "3.31.0-
|
|
67
|
+
var version = "3.31.0-20251104-171725-fd1747f";
|
|
67
68
|
var description = "Nuxt CLI";
|
|
68
69
|
|
|
69
70
|
//#endregion
|
|
@@ -108,6 +109,137 @@ const _main = defineCommand({
|
|
|
108
109
|
});
|
|
109
110
|
const main = _main;
|
|
110
111
|
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region ../nuxi/src/utils/completions-data.ts
|
|
114
|
+
/** Auto-generated file */
|
|
115
|
+
const nitroPresets = [
|
|
116
|
+
"alwaysdata",
|
|
117
|
+
"aws-amplify",
|
|
118
|
+
"aws-lambda",
|
|
119
|
+
"azure-functions",
|
|
120
|
+
"azure-swa",
|
|
121
|
+
"bun",
|
|
122
|
+
"cleavr",
|
|
123
|
+
"cli",
|
|
124
|
+
"cloudflare-dev",
|
|
125
|
+
"cloudflare-durable",
|
|
126
|
+
"cloudflare-module",
|
|
127
|
+
"cloudflare-module-legacy",
|
|
128
|
+
"cloudflare-pages",
|
|
129
|
+
"cloudflare-pages-static",
|
|
130
|
+
"cloudflare-worker",
|
|
131
|
+
"deno-deploy",
|
|
132
|
+
"deno-server",
|
|
133
|
+
"deno-server-legacy",
|
|
134
|
+
"digital-ocean",
|
|
135
|
+
"edgio",
|
|
136
|
+
"firebase",
|
|
137
|
+
"firebase-app-hosting",
|
|
138
|
+
"flight-control",
|
|
139
|
+
"genezio",
|
|
140
|
+
"github-pages",
|
|
141
|
+
"gitlab-pages",
|
|
142
|
+
"heroku",
|
|
143
|
+
"iis-handler",
|
|
144
|
+
"iis-node",
|
|
145
|
+
"koyeb",
|
|
146
|
+
"netlify",
|
|
147
|
+
"netlify-builder",
|
|
148
|
+
"netlify-edge",
|
|
149
|
+
"netlify-legacy",
|
|
150
|
+
"netlify-static",
|
|
151
|
+
"node-cluster",
|
|
152
|
+
"node-listener",
|
|
153
|
+
"node-server",
|
|
154
|
+
"platform-sh",
|
|
155
|
+
"render-com",
|
|
156
|
+
"service-worker",
|
|
157
|
+
"static",
|
|
158
|
+
"stormkit",
|
|
159
|
+
"vercel",
|
|
160
|
+
"vercel-edge",
|
|
161
|
+
"vercel-static",
|
|
162
|
+
"winterjs",
|
|
163
|
+
"zeabur",
|
|
164
|
+
"zeabur-static",
|
|
165
|
+
"zerops",
|
|
166
|
+
"zerops-static"
|
|
167
|
+
];
|
|
168
|
+
const templates = [
|
|
169
|
+
"doc-driven",
|
|
170
|
+
"hub",
|
|
171
|
+
"layer",
|
|
172
|
+
"module",
|
|
173
|
+
"module-devtools",
|
|
174
|
+
"ui",
|
|
175
|
+
"ui-vue",
|
|
176
|
+
"v2-bridge",
|
|
177
|
+
"v3",
|
|
178
|
+
"v4",
|
|
179
|
+
"v4-compat"
|
|
180
|
+
];
|
|
181
|
+
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region ../nuxi/src/completions.ts
|
|
184
|
+
async function initCompletions(command) {
|
|
185
|
+
const completion = await tab(command);
|
|
186
|
+
const devCommand = completion.commands.get("dev");
|
|
187
|
+
if (devCommand) {
|
|
188
|
+
const portOption = devCommand.options.get("port");
|
|
189
|
+
if (portOption) portOption.handler = (complete) => {
|
|
190
|
+
complete("3000", "Default development port");
|
|
191
|
+
complete("3001", "Alternative port");
|
|
192
|
+
complete("8080", "Common alternative port");
|
|
193
|
+
};
|
|
194
|
+
const hostOption = devCommand.options.get("host");
|
|
195
|
+
if (hostOption) hostOption.handler = (complete) => {
|
|
196
|
+
complete("localhost", "Local development");
|
|
197
|
+
complete("0.0.0.0", "Listen on all interfaces");
|
|
198
|
+
complete("127.0.0.1", "Loopback address");
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const buildCommand = completion.commands.get("build");
|
|
202
|
+
if (buildCommand) {
|
|
203
|
+
const presetOption = buildCommand.options.get("preset");
|
|
204
|
+
if (presetOption) presetOption.handler = (complete) => {
|
|
205
|
+
for (const preset of nitroPresets) complete(preset, "");
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const initCommand = completion.commands.get("init");
|
|
209
|
+
if (initCommand) {
|
|
210
|
+
const templateOption = initCommand.options.get("template");
|
|
211
|
+
if (templateOption) templateOption.handler = (complete) => {
|
|
212
|
+
for (const template of templates) complete(template, "");
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const addCommand = completion.commands.get("add");
|
|
216
|
+
if (addCommand) {
|
|
217
|
+
const cwdOption = addCommand.options.get("cwd");
|
|
218
|
+
if (cwdOption) cwdOption.handler = (complete) => {
|
|
219
|
+
complete(".", "Current directory");
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
for (const cmdName of [
|
|
223
|
+
"dev",
|
|
224
|
+
"build",
|
|
225
|
+
"generate",
|
|
226
|
+
"preview",
|
|
227
|
+
"prepare",
|
|
228
|
+
"init"
|
|
229
|
+
]) {
|
|
230
|
+
const cmd = completion.commands.get(cmdName);
|
|
231
|
+
if (cmd) {
|
|
232
|
+
const logLevelOption = cmd.options.get("logLevel");
|
|
233
|
+
if (logLevelOption) logLevelOption.handler = (complete) => {
|
|
234
|
+
complete("silent", "No logs");
|
|
235
|
+
complete("info", "Standard logging");
|
|
236
|
+
complete("verbose", "Detailed logging");
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return completion;
|
|
241
|
+
}
|
|
242
|
+
|
|
111
243
|
//#endregion
|
|
112
244
|
//#region src/run.ts
|
|
113
245
|
globalThis.__nuxt_cli__ = globalThis.__nuxt_cli__ || {
|
|
@@ -115,7 +247,10 @@ globalThis.__nuxt_cli__ = globalThis.__nuxt_cli__ || {
|
|
|
115
247
|
entry: fileURLToPath(new URL("../../bin/nuxi.mjs", import.meta.url)),
|
|
116
248
|
devEntry: fileURLToPath(new URL("../dev/index.mjs", import.meta.url))
|
|
117
249
|
};
|
|
118
|
-
|
|
250
|
+
async function runMain() {
|
|
251
|
+
await initCompletions(main);
|
|
252
|
+
return runMain$1(main);
|
|
253
|
+
}
|
|
119
254
|
async function runCommand(name$1, argv = process.argv.slice(2), data = {}) {
|
|
120
255
|
argv.push("--no-clear");
|
|
121
256
|
if (!(name$1 in commands)) throw new Error(`Invalid command ${name$1}`);
|
|
@@ -13,7 +13,7 @@ import { detectPackageManager } from "nypm";
|
|
|
13
13
|
import { readPackageJSON } from "pkg-types";
|
|
14
14
|
|
|
15
15
|
//#region ../nuxi/package.json
|
|
16
|
-
var version = "3.31.0-
|
|
16
|
+
var version = "3.31.0-20251104-171713-fd1747f";
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region ../nuxi/src/commands/info.ts
|
|
@@ -2,7 +2,7 @@ import { o as logLevelArgs, t as cwdArgs } from "./_shared-C3vB2YLc.mjs";
|
|
|
2
2
|
import { t as logger } from "./logger-Dk0gkCkX.mjs";
|
|
3
3
|
import "./kit-f7zsnm10.mjs";
|
|
4
4
|
import "./fs--ofMleGo.mjs";
|
|
5
|
-
import { n as runCommand$1, t as add_default } from "./add-
|
|
5
|
+
import { n as runCommand$1, t as add_default } from "./add-yCkF7lke.mjs";
|
|
6
6
|
import "./versions-CSy_3o_-.mjs";
|
|
7
7
|
import "./prepare-DjR-jyiQ.mjs";
|
|
8
8
|
import "./_utils-DTrPahho.mjs";
|
|
@@ -15,6 +15,7 @@ import { colors } from "consola/utils";
|
|
|
15
15
|
import { x } from "tinyexec";
|
|
16
16
|
import { installDependencies } from "nypm";
|
|
17
17
|
import { findFile, readPackageJSON, writePackageJSON } from "pkg-types";
|
|
18
|
+
import { box as box$1, cancel, confirm, isCancel, multiselect, outro, select, text } from "@clack/prompts";
|
|
18
19
|
import { downloadTemplate, startShell } from "giget";
|
|
19
20
|
import { $fetch } from "ofetch";
|
|
20
21
|
|
|
@@ -151,12 +152,18 @@ var init_default = defineCommand({
|
|
|
151
152
|
async run(ctx) {
|
|
152
153
|
if (hasTTY) process.stdout.write(`\n${nuxtIcon}\n\n`);
|
|
153
154
|
logger.info(colors.bold(`Welcome to Nuxt!`.split("").map((m) => `${themeColor}${m}`).join("")));
|
|
154
|
-
if (ctx.args.dir === "")
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
if (ctx.args.dir === "") {
|
|
156
|
+
const result = await text({
|
|
157
|
+
message: "Where would you like to create your project?",
|
|
158
|
+
placeholder: "./nuxt-app",
|
|
159
|
+
defaultValue: "nuxt-app"
|
|
160
|
+
});
|
|
161
|
+
if (isCancel(result)) {
|
|
162
|
+
cancel("Operation cancelled.");
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
ctx.args.dir = result;
|
|
166
|
+
}
|
|
160
167
|
const cwd = resolve(ctx.args.cwd);
|
|
161
168
|
let templateDownloadPath = resolve(cwd, ctx.args.dir);
|
|
162
169
|
logger.info(`Creating a new project in ${colors.cyan(relative(cwd, templateDownloadPath) || templateDownloadPath)}.`);
|
|
@@ -166,24 +173,44 @@ var init_default = defineCommand({
|
|
|
166
173
|
process.exit(1);
|
|
167
174
|
}
|
|
168
175
|
let shouldForce = Boolean(ctx.args.force);
|
|
169
|
-
if (!shouldForce && existsSync(templateDownloadPath))
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
176
|
+
if (!shouldForce && existsSync(templateDownloadPath)) {
|
|
177
|
+
const selectedAction = await select({
|
|
178
|
+
message: `The directory ${colors.cyan(templateDownloadPath)} already exists. What would you like to do?`,
|
|
179
|
+
options: [
|
|
180
|
+
{
|
|
181
|
+
value: "override",
|
|
182
|
+
label: "Override its contents"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
value: "different",
|
|
186
|
+
label: "Select different directory"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
value: "abort",
|
|
190
|
+
label: "Abort"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
if (isCancel(selectedAction)) {
|
|
195
|
+
cancel("Operation cancelled.");
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}
|
|
198
|
+
switch (selectedAction) {
|
|
199
|
+
case "override":
|
|
200
|
+
shouldForce = true;
|
|
201
|
+
break;
|
|
202
|
+
case "different": {
|
|
203
|
+
const result = await text({ message: "Please specify a different directory:" });
|
|
204
|
+
if (isCancel(result)) {
|
|
205
|
+
cancel("Operation cancelled.");
|
|
206
|
+
process.exit(1);
|
|
207
|
+
}
|
|
208
|
+
templateDownloadPath = resolve(cwd, result);
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
case "abort":
|
|
212
|
+
default: process.exit(1);
|
|
213
|
+
}
|
|
187
214
|
}
|
|
188
215
|
let template;
|
|
189
216
|
try {
|
|
@@ -247,12 +274,20 @@ var init_default = defineCommand({
|
|
|
247
274
|
value: pm,
|
|
248
275
|
hint: currentPackageManager === pm ? "current" : void 0
|
|
249
276
|
}));
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
277
|
+
let selectedPackageManager;
|
|
278
|
+
if (packageManagerOptions.includes(packageManagerArg)) selectedPackageManager = packageManagerArg;
|
|
279
|
+
else {
|
|
280
|
+
const result = await select({
|
|
281
|
+
message: "Which package manager would you like to use?",
|
|
282
|
+
options: packageManagerSelectOptions,
|
|
283
|
+
initialValue: currentPackageManager
|
|
284
|
+
});
|
|
285
|
+
if (isCancel(result)) {
|
|
286
|
+
cancel("Operation cancelled.");
|
|
287
|
+
process.exit(1);
|
|
288
|
+
}
|
|
289
|
+
selectedPackageManager = result;
|
|
290
|
+
}
|
|
256
291
|
if (ctx.args.install === false) logger.info("Skipping install dependencies step.");
|
|
257
292
|
else {
|
|
258
293
|
logger.start("Installing dependencies...");
|
|
@@ -271,10 +306,14 @@ var init_default = defineCommand({
|
|
|
271
306
|
}
|
|
272
307
|
logger.success("Installation completed.");
|
|
273
308
|
}
|
|
274
|
-
if (ctx.args.gitInit === void 0)
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
309
|
+
if (ctx.args.gitInit === void 0) {
|
|
310
|
+
const result = await confirm({ message: "Initialize git repository?" });
|
|
311
|
+
if (isCancel(result)) {
|
|
312
|
+
cancel("Operation cancelled.");
|
|
313
|
+
process.exit(1);
|
|
314
|
+
}
|
|
315
|
+
ctx.args.gitInit = result;
|
|
316
|
+
}
|
|
278
317
|
if (ctx.args.gitInit) {
|
|
279
318
|
logger.info("Initializing git repository...\n");
|
|
280
319
|
try {
|
|
@@ -290,24 +329,28 @@ var init_default = defineCommand({
|
|
|
290
329
|
if (ctx.args.modules !== void 0) modulesToAdd.push(...(ctx.args.modules || "").split(",").map((module) => module.trim()).filter(Boolean));
|
|
291
330
|
else if (!ctx.args.offline && !ctx.args.preferOffline) {
|
|
292
331
|
const modulesPromise = $fetch("https://api.nuxt.com/modules");
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
332
|
+
const wantsUserModules = await confirm({
|
|
333
|
+
message: `Would you like to install any of the official modules?`,
|
|
334
|
+
initialValue: false
|
|
335
|
+
});
|
|
336
|
+
if (isCancel(wantsUserModules)) {
|
|
337
|
+
cancel("Operation cancelled.");
|
|
338
|
+
process.exit(1);
|
|
339
|
+
}
|
|
340
|
+
if (wantsUserModules) {
|
|
298
341
|
const [response, templateDeps] = await Promise.all([modulesPromise, getTemplateDependencies(template.dir)]);
|
|
299
342
|
const officialModules = response.modules.filter((module) => module.type === "official" && module.npm !== "@nuxt/devtools").filter((module) => !templateDeps.includes(module.npm));
|
|
300
343
|
if (officialModules.length === 0) logger.info("All official modules are already included in this template.");
|
|
301
344
|
else {
|
|
302
|
-
const selectedOfficialModules = await
|
|
303
|
-
|
|
345
|
+
const selectedOfficialModules = await multiselect({
|
|
346
|
+
message: "Pick the modules to install:",
|
|
304
347
|
options: officialModules.map((module) => ({
|
|
305
348
|
label: `${colors.bold(colors.greenBright(module.npm))} – ${module.description.replace(/\.$/, "")}`,
|
|
306
349
|
value: module.npm
|
|
307
350
|
})),
|
|
308
351
|
required: false
|
|
309
352
|
});
|
|
310
|
-
if (selectedOfficialModules
|
|
353
|
+
if (isCancel(selectedOfficialModules)) process.exit(1);
|
|
311
354
|
if (selectedOfficialModules.length > 0) {
|
|
312
355
|
const modules = selectedOfficialModules;
|
|
313
356
|
const { toInstall, skipped } = filterModules(modules, Object.fromEntries(await Promise.all(modules.map(async (module) => [module, await getModuleDependencies(module)]))));
|
|
@@ -323,11 +366,19 @@ var init_default = defineCommand({
|
|
|
323
366
|
ctx.args.install ? "" : "--skipInstall",
|
|
324
367
|
ctx.args.logLevel ? `--logLevel=${ctx.args.logLevel}` : ""
|
|
325
368
|
].filter(Boolean));
|
|
326
|
-
|
|
369
|
+
outro(`✨ Nuxt project has been created with the \`${template.name}\` template.`);
|
|
327
370
|
const relativeTemplateDir = relative(process.cwd(), template.dir) || ".";
|
|
328
371
|
const runCmd = selectedPackageManager === "deno" ? "task" : "run";
|
|
329
|
-
|
|
330
|
-
|
|
372
|
+
box$1(`\n${[!ctx.args.shell && relativeTemplateDir.length > 1 && colors.cyan(`cd ${relativeTemplateDir}`), colors.cyan(`${selectedPackageManager} ${runCmd} dev`)].filter(Boolean).map((step) => ` › ${step}`).join("\n")}\n`, ` 👉 Next steps `, {
|
|
373
|
+
contentAlign: "left",
|
|
374
|
+
titleAlign: "left",
|
|
375
|
+
width: "auto",
|
|
376
|
+
titlePadding: 2,
|
|
377
|
+
contentPadding: 2,
|
|
378
|
+
rounded: true,
|
|
379
|
+
includePrefix: false,
|
|
380
|
+
formatBorder: (text$1) => `${themeColor + text$1}\x1B[0m`
|
|
381
|
+
});
|
|
331
382
|
if (ctx.args.shell) startShell(template.dir);
|
|
332
383
|
}
|
|
333
384
|
});
|
|
@@ -8,7 +8,7 @@ var module_default = defineCommand({
|
|
|
8
8
|
},
|
|
9
9
|
args: {},
|
|
10
10
|
subCommands: {
|
|
11
|
-
add: () => import("./add-
|
|
11
|
+
add: () => import("./add-CC8PhdIc.mjs").then((r) => r.default || r),
|
|
12
12
|
search: () => import("./search-D_JLXbhF.mjs").then((r) => r.default || r)
|
|
13
13
|
}
|
|
14
14
|
});
|
|
@@ -12,6 +12,7 @@ import { resolve } from "pathe";
|
|
|
12
12
|
import { colors } from "consola/utils";
|
|
13
13
|
import { addDependency, dedupeDependencies, detectPackageManager } from "nypm";
|
|
14
14
|
import { readPackageJSON } from "pkg-types";
|
|
15
|
+
import { cancel, isCancel, select } from "@clack/prompts";
|
|
15
16
|
|
|
16
17
|
//#region ../nuxi/src/commands/upgrade.ts
|
|
17
18
|
function checkNuxtDependencyType(pkg) {
|
|
@@ -27,12 +28,22 @@ function getNightlyDependency(dep, nuxtVersion) {
|
|
|
27
28
|
return `${dep}@npm:${dep}-nightly@${nuxtVersionTags[nuxtVersion]}`;
|
|
28
29
|
}
|
|
29
30
|
async function getNightlyVersion(packageNames) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
options: [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const result = await select({
|
|
32
|
+
message: "Which nightly Nuxt release channel do you want to install?",
|
|
33
|
+
options: [{
|
|
34
|
+
value: "3.x",
|
|
35
|
+
label: "3.x"
|
|
36
|
+
}, {
|
|
37
|
+
value: "4.x",
|
|
38
|
+
label: "4.x"
|
|
39
|
+
}],
|
|
40
|
+
initialValue: "4.x"
|
|
41
|
+
});
|
|
42
|
+
if (isCancel(result)) {
|
|
43
|
+
cancel("Operation cancelled.");
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
const nuxtVersion = result;
|
|
36
47
|
return {
|
|
37
48
|
npmPackages: packageNames.map((p) => getNightlyDependency(p, nuxtVersion)),
|
|
38
49
|
nuxtVersion
|
|
@@ -116,26 +127,32 @@ var upgrade_default = defineCommand({
|
|
|
116
127
|
if (lockFile) toRemove.push(lockFile);
|
|
117
128
|
const forceRemovals = toRemove.map((p) => colors.cyan(p)).join(" and ");
|
|
118
129
|
let method = ctx.args.force ? "force" : ctx.args.dedupe ? "dedupe" : void 0;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
if (!method) {
|
|
131
|
+
const result = await select({
|
|
132
|
+
message: `Would you like to dedupe your lockfile (recommended) or recreate ${forceRemovals}? This can fix problems with hoisted dependency versions and ensure you have the most up-to-date dependencies.`,
|
|
133
|
+
options: [
|
|
134
|
+
{
|
|
135
|
+
label: "dedupe lockfile",
|
|
136
|
+
value: "dedupe",
|
|
137
|
+
hint: "recommended"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
label: `recreate ${forceRemovals}`,
|
|
141
|
+
value: "force"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: "skip",
|
|
145
|
+
value: "skip"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
initialValue: "dedupe"
|
|
149
|
+
});
|
|
150
|
+
if (isCancel(result)) {
|
|
151
|
+
cancel("Operation cancelled.");
|
|
152
|
+
process.exit(1);
|
|
153
|
+
}
|
|
154
|
+
method = result;
|
|
155
|
+
}
|
|
139
156
|
const versionType = ctx.args.channel === "nightly" ? "nightly" : `latest ${ctx.args.channel}`;
|
|
140
157
|
logger.info(`Installing ${versionType} Nuxt ${nuxtVersion} release...`);
|
|
141
158
|
await addDependency(npmPackages, {
|
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-
|
|
4
|
+
"version": "3.31.0-20251104-171725-fd1747f",
|
|
5
5
|
"description": "Nuxt CLI",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"prepack": "tsdown"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"@bomb.sh/tab": "^0.0.9",
|
|
37
|
+
"@clack/prompts": "^1.0.0-alpha.6",
|
|
36
38
|
"c12": "^3.3.1",
|
|
37
39
|
"citty": "^0.1.6",
|
|
38
40
|
"confbox": "^0.2.2",
|
|
@@ -59,8 +61,8 @@
|
|
|
59
61
|
"youch": "^4.1.0-beta.12"
|
|
60
62
|
},
|
|
61
63
|
"devDependencies": {
|
|
62
|
-
"@nuxt/kit": "^4.
|
|
63
|
-
"@nuxt/schema": "^4.
|
|
64
|
+
"@nuxt/kit": "^4.2.0",
|
|
65
|
+
"@nuxt/schema": "^4.2.0",
|
|
64
66
|
"@types/node": "^24.10.0",
|
|
65
67
|
"get-port-please": "^3.2.0",
|
|
66
68
|
"h3": "^1.15.4",
|