@nuxt/cli-nightly 3.31.0-20251111-164251-694e92b → 3.31.0-20251114-183659-ab4e0c6
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-B-g5qEtw.mjs +11 -0
- package/dist/{add-CHVmfYrF.mjs → add-DYl9eciR.mjs} +15 -6
- package/dist/{add-yCkF7lke.mjs → add-ZaZI_ZJH.mjs} +24 -23
- package/dist/{analyze-6tANI65A.mjs → analyze-DjqZOzwX.mjs} +18 -7
- package/dist/banner-DQx8x98i.mjs +42 -0
- package/dist/{build-CVr-ruAe.mjs → build-BaZrKRCS.mjs} +15 -9
- package/dist/build-Do6kFHyH.mjs +10 -0
- package/dist/{cleanup-X4v95Xqm.mjs → cleanup-BAQaKzUm.mjs} +4 -3
- package/dist/dev/index.mjs +6 -5
- package/dist/{dev-aS1afvp8.mjs → dev-BhmbxmPd.mjs} +13 -11
- package/dist/{dev-Bf9P_WmH.mjs → dev-DjmBDZYe.mjs} +3 -3
- package/dist/{dev-child-GqhyRU2G.mjs → dev-child-B9APIXlC.mjs} +1 -1
- package/dist/dev-pecSeV9d.mjs +9 -0
- package/dist/{devtools-BLGzUSNU.mjs → devtools-CbKpNDhe.mjs} +3 -2
- package/dist/{env-CamzysGq.mjs → env-N36fDvz0.mjs} +3 -2
- package/dist/formatting-CAvhu26Q.mjs +56 -0
- package/dist/{fs--ofMleGo.mjs → fs-CGUBNEba.mjs} +2 -2
- package/dist/{generate-DZJF1Xf_.mjs → generate-C7nZZjW0.mjs} +6 -5
- package/dist/index.mjs +21 -20
- package/dist/info-cPa08hVq.mjs +139 -0
- package/dist/{init-DX0yoR1B.mjs → init-D13kJvE3.mjs} +54 -41
- package/dist/logger-Dd47z9E7.mjs +9 -0
- package/dist/{module-t-MDBA3Y.mjs → module-D0pcWR-5.mjs} +2 -2
- package/dist/{nuxt-CfBR40hD.mjs → nuxt-8UELXZ2y.mjs} +2 -2
- package/dist/paths-C4ma0oRK.mjs +11 -0
- package/dist/prepare-Bp6yMU36.mjs +8 -0
- package/dist/{prepare-DjR-jyiQ.mjs → prepare-CWzUtiE9.mjs} +6 -4
- package/dist/{preview-CgpLKg-X.mjs → preview-DDiSySPF.mjs} +28 -18
- package/dist/{search-D_JLXbhF.mjs → search-D48sLs_4.mjs} +31 -24
- package/dist/{test-CBt1emEB.mjs → test-DKBo3m_m.mjs} +1 -1
- package/dist/{typecheck-egvrxpjV.mjs → typecheck-34AvFcmE.mjs} +1 -1
- package/dist/{upgrade-CblzcPw0.mjs → upgrade-BuybH3Cn.mjs} +66 -41
- package/dist/versions-CUHtwDOW.mjs +35 -0
- package/package.json +4 -2
- package/dist/add-CC8PhdIc.mjs +0 -10
- package/dist/banner-CWBLwDiB.mjs +0 -55
- package/dist/build-BEXmJONc.mjs +0 -9
- package/dist/dev-CNjdVPgl.mjs +0 -8
- package/dist/info-BY9WLJRm.mjs +0 -120
- package/dist/logger-Dk0gkCkX.mjs +0 -7
- package/dist/prepare-ZByeo9vQ.mjs +0 -7
- package/dist/versions-CSy_3o_-.mjs +0 -18
- /package/dist/{_utils-DTrPahho.mjs → _utils-B8YNEdpq.mjs} +0 -0
- /package/dist/{packageManagers-DbVB5cXf.mjs → packageManagers-Dd1BN02x.mjs} +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { t as cwdArgs } from "./_shared-C3vB2YLc.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { n as logger } from "./logger-Dd47z9E7.mjs";
|
|
3
|
+
import "./kit-f7zsnm10.mjs";
|
|
4
|
+
import { t as getNuxtVersion } from "./versions-CUHtwDOW.mjs";
|
|
5
|
+
import { t as formatInfoBox } from "./formatting-CAvhu26Q.mjs";
|
|
6
|
+
import { n as fetchModules, t as checkNuxtCompatibility } from "./_utils-B8YNEdpq.mjs";
|
|
5
7
|
import { defineCommand } from "citty";
|
|
6
8
|
import { colors } from "consola/utils";
|
|
9
|
+
import { box } from "@clack/prompts";
|
|
7
10
|
import { kebabCase, upperFirst } from "scule";
|
|
8
11
|
import Fuse from "fuse.js";
|
|
9
12
|
|
|
@@ -37,7 +40,7 @@ var search_default = defineCommand({
|
|
|
37
40
|
}
|
|
38
41
|
});
|
|
39
42
|
async function findModuleByKeywords(query, nuxtVersion) {
|
|
40
|
-
const
|
|
43
|
+
const results = new Fuse((await fetchModules()).filter((m) => checkNuxtCompatibility(m, nuxtVersion)), {
|
|
41
44
|
threshold: .1,
|
|
42
45
|
keys: [
|
|
43
46
|
{
|
|
@@ -73,39 +76,43 @@ async function findModuleByKeywords(query, nuxtVersion) {
|
|
|
73
76
|
weight: .5
|
|
74
77
|
}
|
|
75
78
|
]
|
|
76
|
-
})
|
|
77
|
-
const { bold, green, magenta, cyan, gray, yellow } = colors;
|
|
78
|
-
const results = fuse.search(query).map((result) => {
|
|
79
|
+
}).search(query).map((result) => {
|
|
79
80
|
const res = {
|
|
80
|
-
name:
|
|
81
|
-
|
|
81
|
+
name: result.item.name,
|
|
82
|
+
package: result.item.npm,
|
|
83
|
+
homepage: colors.cyan(result.item.website),
|
|
82
84
|
compatibility: `nuxt: ${result.item.compatibility?.nuxt || "*"}`,
|
|
83
|
-
repository:
|
|
84
|
-
description:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
monthlyDownloads: yellow(formatNumber(result.item.stats.downloads))
|
|
85
|
+
repository: result.item.github,
|
|
86
|
+
description: result.item.description,
|
|
87
|
+
install: `npx nuxt module add ${result.item.name}`,
|
|
88
|
+
stars: colors.yellow(formatNumber(result.item.stats.stars)),
|
|
89
|
+
monthlyDownloads: colors.yellow(formatNumber(result.item.stats.downloads))
|
|
89
90
|
};
|
|
90
91
|
if (result.item.github === result.item.website) delete res.homepage;
|
|
91
92
|
if (result.item.name === result.item.npm) delete res.packageName;
|
|
92
93
|
return res;
|
|
93
94
|
});
|
|
94
95
|
if (!results.length) {
|
|
95
|
-
logger.info(`No Nuxt modules found matching query ${magenta(query)} for Nuxt ${cyan(nuxtVersion)}`);
|
|
96
|
+
logger.info(`No Nuxt modules found matching query ${colors.magenta(query)} for Nuxt ${colors.cyan(nuxtVersion)}`);
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
|
-
logger.success(`Found ${results.length} Nuxt ${results.length > 1 ? "modules" : "module"} matching ${cyan(query)} ${nuxtVersion ? `for Nuxt ${cyan(nuxtVersion)}` : ""}:\n`);
|
|
99
|
+
logger.success(`Found ${results.length} Nuxt ${results.length > 1 ? "modules" : "module"} matching ${colors.cyan(query)} ${nuxtVersion ? `for Nuxt ${colors.cyan(nuxtVersion)}` : ""}:\n`);
|
|
99
100
|
for (const foundModule of results) {
|
|
100
|
-
|
|
101
|
-
const
|
|
101
|
+
const formattedModule = {};
|
|
102
|
+
for (const [key, val] of Object.entries(foundModule)) {
|
|
102
103
|
const label = upperFirst(kebabCase(key)).replace(/-/g, " ");
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
formattedModule[label] = val;
|
|
105
|
+
}
|
|
106
|
+
const title = formattedModule.Name || formattedModule.Package;
|
|
107
|
+
delete formattedModule.Name;
|
|
108
|
+
box(`\n${formatInfoBox(formattedModule)}`, ` ${title} `, {
|
|
109
|
+
contentAlign: "left",
|
|
110
|
+
titleAlign: "left",
|
|
111
|
+
width: "auto",
|
|
112
|
+
titlePadding: 2,
|
|
113
|
+
contentPadding: 2,
|
|
114
|
+
rounded: true
|
|
105
115
|
});
|
|
106
|
-
let infoStr = "";
|
|
107
|
-
for (const [label, value] of entries) infoStr += `${bold(label === "Install" ? "→ " : "- ") + green(label.padEnd(maxLength + 2)) + value}\n`;
|
|
108
|
-
logger.log(infoStr);
|
|
109
116
|
}
|
|
110
117
|
}
|
|
111
118
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, o as logLevelArgs, t as cwdArgs } from "./_shared-C3vB2YLc.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as logger } from "./logger-Dd47z9E7.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
import { resolve } from "pathe";
|
|
@@ -5,8 +5,8 @@ import { defineCommand } from "citty";
|
|
|
5
5
|
import { isBun } from "std-env";
|
|
6
6
|
import { resolveModulePath } from "exsolve";
|
|
7
7
|
import { resolve } from "pathe";
|
|
8
|
-
import { x } from "tinyexec";
|
|
9
8
|
import { readTSConfig } from "pkg-types";
|
|
9
|
+
import { x } from "tinyexec";
|
|
10
10
|
|
|
11
11
|
//#region ../nuxi/src/commands/typecheck.ts
|
|
12
12
|
var typecheck_default = defineCommand({
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, o as logLevelArgs, t as cwdArgs } from "./_shared-C3vB2YLc.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as logger } from "./logger-Dd47z9E7.mjs";
|
|
3
3
|
import { t as loadKit } from "./kit-f7zsnm10.mjs";
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
4
|
+
import { t as getNuxtVersion } from "./versions-CUHtwDOW.mjs";
|
|
5
|
+
import "./fs-CGUBNEba.mjs";
|
|
6
|
+
import { r as nuxtVersionToGitIdentifier, t as cleanupNuxtDirs } from "./nuxt-8UELXZ2y.mjs";
|
|
7
|
+
import { t as relativeToProcess } from "./paths-C4ma0oRK.mjs";
|
|
8
|
+
import { t as getPackageManagerVersion } from "./packageManagers-Dd1BN02x.mjs";
|
|
8
9
|
import process from "node:process";
|
|
9
10
|
import { defineCommand } from "citty";
|
|
11
|
+
import { colors } from "consola/utils";
|
|
12
|
+
import { cancel, intro, isCancel, note, outro, select, spinner, tasks } from "@clack/prompts";
|
|
10
13
|
import { existsSync } from "node:fs";
|
|
11
14
|
import { resolve } from "pathe";
|
|
12
|
-
import { colors } from "consola/utils";
|
|
13
|
-
import { addDependency, dedupeDependencies, detectPackageManager } from "nypm";
|
|
14
15
|
import { findWorkspaceDir, readPackageJSON } from "pkg-types";
|
|
15
|
-
import {
|
|
16
|
+
import { addDependency, dedupeDependencies, detectPackageManager } from "nypm";
|
|
16
17
|
|
|
17
18
|
//#region ../nuxi/src/commands/upgrade.ts
|
|
18
19
|
function checkNuxtDependencyType(pkg) {
|
|
@@ -28,7 +29,7 @@ function getNightlyDependency(dep, nuxtVersion) {
|
|
|
28
29
|
return `${dep}@npm:${dep}-nightly@${nuxtVersionTags[nuxtVersion]}`;
|
|
29
30
|
}
|
|
30
31
|
async function getNightlyVersion(packageNames) {
|
|
31
|
-
const
|
|
32
|
+
const nuxtVersion = await select({
|
|
32
33
|
message: "Which nightly Nuxt release channel do you want to install?",
|
|
33
34
|
options: [{
|
|
34
35
|
value: "3.x",
|
|
@@ -39,11 +40,10 @@ async function getNightlyVersion(packageNames) {
|
|
|
39
40
|
}],
|
|
40
41
|
initialValue: "4.x"
|
|
41
42
|
});
|
|
42
|
-
if (isCancel(
|
|
43
|
+
if (isCancel(nuxtVersion)) {
|
|
43
44
|
cancel("Operation cancelled.");
|
|
44
45
|
process.exit(1);
|
|
45
46
|
}
|
|
46
|
-
const nuxtVersion = result;
|
|
47
47
|
return {
|
|
48
48
|
npmPackages: packageNames.map((p) => getNightlyDependency(p, nuxtVersion)),
|
|
49
49
|
nuxtVersion
|
|
@@ -103,16 +103,18 @@ var upgrade_default = defineCommand({
|
|
|
103
103
|
},
|
|
104
104
|
async run(ctx) {
|
|
105
105
|
const cwd = resolve(ctx.args.cwd || ctx.args.rootDir);
|
|
106
|
+
intro(colors.cyan("Upgrading Nuxt ..."));
|
|
106
107
|
const [packageManager, workspaceDir = cwd] = await Promise.all([detectPackageManager(cwd), findWorkspaceDir(cwd, { try: true })]);
|
|
107
108
|
if (!packageManager) {
|
|
108
|
-
logger.error(`Unable to determine the package manager used by this project.\n\nNo lock files found in
|
|
109
|
+
logger.error(`Unable to determine the package manager used by this project.\n\nNo lock files found in ${colors.cyan(relativeToProcess(cwd))}, and no ${colors.cyan("packageManager")} field specified in ${colors.cyan("package.json")}.`);
|
|
110
|
+
logger.info(`Please either add the ${colors.cyan("packageManager")} field to ${colors.cyan("package.json")} or execute the installation command for your package manager. For example, you can use ${colors.cyan("pnpm i")}, ${colors.cyan("npm i")}, ${colors.cyan("bun i")}, or ${colors.cyan("yarn i")}, and then try again.`);
|
|
109
111
|
process.exit(1);
|
|
110
112
|
}
|
|
111
113
|
const { name: packageManagerName, lockFile: lockFileCandidates } = packageManager;
|
|
112
114
|
const packageManagerVersion = getPackageManagerVersion(packageManagerName);
|
|
113
|
-
logger.
|
|
115
|
+
logger.step(`Package manager: ${colors.cyan(packageManagerName)} ${packageManagerVersion}`);
|
|
114
116
|
const currentVersion = await getNuxtVersion(cwd, false) || "[unknown]";
|
|
115
|
-
logger.
|
|
117
|
+
logger.step(`Current Nuxt version: ${colors.cyan(currentVersion)}`);
|
|
116
118
|
const pkg = await readPackageJSON(cwd).catch(() => null);
|
|
117
119
|
const nuxtDependencyType = pkg ? checkNuxtDependencyType(pkg) : "dependencies";
|
|
118
120
|
const { npmPackages, nuxtVersion } = await getRequiredNewVersion(["nuxt", ...pkg ? [
|
|
@@ -129,7 +131,7 @@ var upgrade_default = defineCommand({
|
|
|
129
131
|
let method = ctx.args.force ? "force" : ctx.args.dedupe ? "dedupe" : void 0;
|
|
130
132
|
if (!method) {
|
|
131
133
|
const result = await select({
|
|
132
|
-
message: `Would you like to dedupe your lockfile
|
|
134
|
+
message: `Would you like to dedupe your lockfile, or recreate ${forceRemovals}? This can fix problems with hoisted dependency versions and ensure you have the most up-to-date dependencies.`,
|
|
133
135
|
options: [
|
|
134
136
|
{
|
|
135
137
|
label: "dedupe lockfile",
|
|
@@ -154,37 +156,60 @@ var upgrade_default = defineCommand({
|
|
|
154
156
|
method = result;
|
|
155
157
|
}
|
|
156
158
|
const versionType = ctx.args.channel === "nightly" ? "nightly" : `latest ${ctx.args.channel}`;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
159
|
+
const spin = spinner();
|
|
160
|
+
spin.start("Upgrading Nuxt");
|
|
161
|
+
await tasks([
|
|
162
|
+
{
|
|
163
|
+
title: `Installing ${versionType} Nuxt ${nuxtVersion} release`,
|
|
164
|
+
task: async () => {
|
|
165
|
+
await addDependency(npmPackages, {
|
|
166
|
+
cwd,
|
|
167
|
+
packageManager,
|
|
168
|
+
dev: nuxtDependencyType === "devDependencies",
|
|
169
|
+
workspace: packageManager?.name === "pnpm" && existsSync(resolve(cwd, "pnpm-workspace.yaml"))
|
|
170
|
+
});
|
|
171
|
+
return "Nuxt packages installed";
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
...method === "force" ? [{
|
|
175
|
+
title: `Recreating ${forceRemovals}`,
|
|
176
|
+
task: async () => {
|
|
177
|
+
await dedupeDependencies({ recreateLockfile: true });
|
|
178
|
+
return "Lockfile recreated";
|
|
179
|
+
}
|
|
180
|
+
}] : [],
|
|
181
|
+
...method === "dedupe" ? [{
|
|
182
|
+
title: "Deduping dependencies",
|
|
183
|
+
task: async () => {
|
|
184
|
+
await dedupeDependencies();
|
|
185
|
+
return "Dependencies deduped";
|
|
186
|
+
}
|
|
187
|
+
}] : [],
|
|
188
|
+
{
|
|
189
|
+
title: "Cleaning up build directories",
|
|
190
|
+
task: async () => {
|
|
191
|
+
let buildDir = ".nuxt";
|
|
192
|
+
try {
|
|
193
|
+
const { loadNuxtConfig } = await loadKit(cwd);
|
|
194
|
+
buildDir = (await loadNuxtConfig({ cwd })).buildDir;
|
|
195
|
+
} catch {}
|
|
196
|
+
await cleanupNuxtDirs(cwd, buildDir);
|
|
197
|
+
return "Build directories cleaned";
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
]);
|
|
201
|
+
spin.stop();
|
|
202
|
+
if (method === "force") logger.info(`If you encounter any issues, revert the changes and try with ${colors.cyan("--no-force")}`);
|
|
178
203
|
const upgradedVersion = await getNuxtVersion(cwd, false) || "[unknown]";
|
|
179
|
-
logger.info("Upgraded Nuxt version:", upgradedVersion);
|
|
180
204
|
if (upgradedVersion === "[unknown]") return;
|
|
181
|
-
if (upgradedVersion === currentVersion)
|
|
205
|
+
if (upgradedVersion === currentVersion) outro(`You were already using the latest version of Nuxt (${colors.green(currentVersion)})`);
|
|
182
206
|
else {
|
|
183
|
-
logger.success(
|
|
207
|
+
logger.success(`Successfully upgraded Nuxt from ${colors.cyan(currentVersion)} to ${colors.green(upgradedVersion)}`);
|
|
184
208
|
if (currentVersion === "[unknown]") return;
|
|
185
209
|
const commitA = nuxtVersionToGitIdentifier(currentVersion);
|
|
186
210
|
const commitB = nuxtVersionToGitIdentifier(upgradedVersion);
|
|
187
|
-
if (commitA && commitB)
|
|
211
|
+
if (commitA && commitB) note(`https://github.com/nuxt/nuxt/compare/${commitA}...${commitB}`, "Changelog");
|
|
212
|
+
outro("✨ Upgrade complete!");
|
|
188
213
|
}
|
|
189
214
|
}
|
|
190
215
|
});
|
|
@@ -192,7 +217,7 @@ function normaliseLockFile(cwd, lockFiles) {
|
|
|
192
217
|
if (typeof lockFiles === "string") lockFiles = [lockFiles];
|
|
193
218
|
const lockFile = lockFiles?.find((file) => existsSync(resolve(cwd, file)));
|
|
194
219
|
if (lockFile === void 0) {
|
|
195
|
-
logger.error(`Unable to find any lock files in ${cwd}
|
|
220
|
+
logger.error(`Unable to find any lock files in ${colors.cyan(relativeToProcess(cwd))}.`);
|
|
196
221
|
return;
|
|
197
222
|
}
|
|
198
223
|
return lockFile;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { n as tryResolveNuxt } from "./kit-f7zsnm10.mjs";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { resolveModulePath } from "exsolve";
|
|
4
|
+
import { readPackageJSON } from "pkg-types";
|
|
5
|
+
import { coerce } from "semver";
|
|
6
|
+
|
|
7
|
+
//#region ../nuxi/src/utils/versions.ts
|
|
8
|
+
async function getNuxtVersion(cwd, cache = true) {
|
|
9
|
+
const nuxtPkg = await readPackageJSON("nuxt", {
|
|
10
|
+
url: cwd,
|
|
11
|
+
try: true,
|
|
12
|
+
cache
|
|
13
|
+
});
|
|
14
|
+
if (nuxtPkg) return nuxtPkg.version;
|
|
15
|
+
const pkg = await readPackageJSON(cwd);
|
|
16
|
+
const pkgDep = pkg?.dependencies?.nuxt || pkg?.devDependencies?.nuxt;
|
|
17
|
+
return pkgDep && coerce(pkgDep)?.version || "3.0.0";
|
|
18
|
+
}
|
|
19
|
+
function getPkgVersion(cwd, pkg) {
|
|
20
|
+
return getPkgJSON(cwd, pkg)?.version ?? "";
|
|
21
|
+
}
|
|
22
|
+
function getPkgJSON(cwd, pkg) {
|
|
23
|
+
for (const url of [cwd, tryResolveNuxt(cwd)]) {
|
|
24
|
+
if (!url) continue;
|
|
25
|
+
const p = resolveModulePath(`${pkg}/package.json`, {
|
|
26
|
+
from: url,
|
|
27
|
+
try: true
|
|
28
|
+
});
|
|
29
|
+
if (p) return JSON.parse(readFileSync(p, "utf-8"));
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { getPkgJSON as n, getPkgVersion as r, getNuxtVersion as t };
|
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-20251114-183659-ab4e0c6",
|
|
5
5
|
"description": "Nuxt CLI",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -34,12 +34,13 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@bomb.sh/tab": "^0.0.9",
|
|
37
|
-
"@clack/prompts": "
|
|
37
|
+
"@clack/prompts": "1.0.0-alpha.6",
|
|
38
38
|
"c12": "^3.3.1",
|
|
39
39
|
"citty": "^0.1.6",
|
|
40
40
|
"confbox": "^0.2.2",
|
|
41
41
|
"consola": "^3.4.2",
|
|
42
42
|
"copy-paste": "^2.2.0",
|
|
43
|
+
"debug": "^4.4.3",
|
|
43
44
|
"defu": "^6.1.4",
|
|
44
45
|
"exsolve": "^1.0.7",
|
|
45
46
|
"fuse.js": "^7.1.0",
|
|
@@ -63,6 +64,7 @@
|
|
|
63
64
|
"devDependencies": {
|
|
64
65
|
"@nuxt/kit": "^4.2.0",
|
|
65
66
|
"@nuxt/schema": "^4.2.0",
|
|
67
|
+
"@types/debug": "^4.1.12",
|
|
66
68
|
"@types/node": "^24.10.0",
|
|
67
69
|
"get-port-please": "^3.2.0",
|
|
68
70
|
"h3": "^1.15.4",
|
package/dist/add-CC8PhdIc.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./_shared-C3vB2YLc.mjs";
|
|
2
|
-
import "./logger-Dk0gkCkX.mjs";
|
|
3
|
-
import "./kit-f7zsnm10.mjs";
|
|
4
|
-
import "./fs--ofMleGo.mjs";
|
|
5
|
-
import { t as add_default } from "./add-yCkF7lke.mjs";
|
|
6
|
-
import "./versions-CSy_3o_-.mjs";
|
|
7
|
-
import "./prepare-DjR-jyiQ.mjs";
|
|
8
|
-
import "./_utils-DTrPahho.mjs";
|
|
9
|
-
|
|
10
|
-
export { add_default as default };
|
package/dist/banner-CWBLwDiB.mjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { t as logger } from "./logger-Dk0gkCkX.mjs";
|
|
2
|
-
import { n as tryResolveNuxt } from "./kit-f7zsnm10.mjs";
|
|
3
|
-
import { readFileSync } from "node:fs";
|
|
4
|
-
import { resolveModulePath } from "exsolve";
|
|
5
|
-
import { colors } from "consola/utils";
|
|
6
|
-
|
|
7
|
-
//#region ../nuxi/src/utils/banner.ts
|
|
8
|
-
function showVersionsFromConfig(cwd, config) {
|
|
9
|
-
const { bold, gray, green } = colors;
|
|
10
|
-
function getBuilder() {
|
|
11
|
-
switch (config.builder) {
|
|
12
|
-
case "@nuxt/rspack-builder": return {
|
|
13
|
-
name: "Rspack",
|
|
14
|
-
version: getPkgVersion("@rspack/core")
|
|
15
|
-
};
|
|
16
|
-
case "@nuxt/webpack-builder": return {
|
|
17
|
-
name: "Webpack",
|
|
18
|
-
version: getPkgVersion("webpack")
|
|
19
|
-
};
|
|
20
|
-
case "@nuxt/vite-builder":
|
|
21
|
-
default: {
|
|
22
|
-
const pkgJSON = getPkgJSON("vite");
|
|
23
|
-
return {
|
|
24
|
-
name: pkgJSON.name.includes("rolldown") ? "Rolldown-Vite" : "Vite",
|
|
25
|
-
version: pkgJSON.version
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function getPkgJSON(pkg) {
|
|
31
|
-
for (const url of [cwd, tryResolveNuxt(cwd)]) {
|
|
32
|
-
if (!url) continue;
|
|
33
|
-
const p = resolveModulePath(`${pkg}/package.json`, {
|
|
34
|
-
from: url,
|
|
35
|
-
try: true
|
|
36
|
-
});
|
|
37
|
-
if (p) return JSON.parse(readFileSync(p, "utf-8"));
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
function getPkgVersion(pkg) {
|
|
42
|
-
return getPkgJSON(pkg)?.version ?? "";
|
|
43
|
-
}
|
|
44
|
-
const nuxtVersion = getPkgVersion("nuxt") || getPkgVersion("nuxt-nightly") || getPkgVersion("nuxt3") || getPkgVersion("nuxt-edge");
|
|
45
|
-
const nitroVersion = getPkgVersion("nitropack") || getPkgVersion("nitro") || getPkgVersion("nitropack-nightly") || getPkgVersion("nitropack-edge");
|
|
46
|
-
const builder = getBuilder();
|
|
47
|
-
const vueVersion = getPkgVersion("vue") || null;
|
|
48
|
-
logger.log(green(`Nuxt ${bold(nuxtVersion)}`) + gray(" (with ") + (nitroVersion ? gray(`Nitro ${bold(nitroVersion)}`) : "") + gray(`, ${builder.name} ${bold(builder.version)}`) + (vueVersion ? gray(` and Vue ${bold(vueVersion)}`) : "") + gray(")"));
|
|
49
|
-
}
|
|
50
|
-
async function showVersions(cwd, kit) {
|
|
51
|
-
return showVersionsFromConfig(cwd, await kit.loadNuxtConfig({ cwd }));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
export { showVersionsFromConfig as n, showVersions as t };
|
package/dist/build-BEXmJONc.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./_shared-C3vB2YLc.mjs";
|
|
2
|
-
import "./logger-Dk0gkCkX.mjs";
|
|
3
|
-
import "./kit-f7zsnm10.mjs";
|
|
4
|
-
import "./banner-CWBLwDiB.mjs";
|
|
5
|
-
import "./fs--ofMleGo.mjs";
|
|
6
|
-
import "./env-CamzysGq.mjs";
|
|
7
|
-
import { t as build_default } from "./build-CVr-ruAe.mjs";
|
|
8
|
-
|
|
9
|
-
export { build_default as default };
|
package/dist/dev-CNjdVPgl.mjs
DELETED
package/dist/info-BY9WLJRm.mjs
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { a as legacyRootDirArgs, t as cwdArgs } from "./_shared-C3vB2YLc.mjs";
|
|
2
|
-
import { t as logger } from "./logger-Dk0gkCkX.mjs";
|
|
3
|
-
import { n as tryResolveNuxt } from "./kit-f7zsnm10.mjs";
|
|
4
|
-
import { t as getPackageManagerVersion } from "./packageManagers-DbVB5cXf.mjs";
|
|
5
|
-
import process from "node:process";
|
|
6
|
-
import { defineCommand } from "citty";
|
|
7
|
-
import { isMinimal } from "std-env";
|
|
8
|
-
import { resolve } from "pathe";
|
|
9
|
-
import { splitByCase } from "scule";
|
|
10
|
-
import os from "node:os";
|
|
11
|
-
import { copy } from "copy-paste";
|
|
12
|
-
import { detectPackageManager } from "nypm";
|
|
13
|
-
import { readPackageJSON } from "pkg-types";
|
|
14
|
-
|
|
15
|
-
//#region ../nuxi/package.json
|
|
16
|
-
var version = "3.31.0-20251111-164240-694e92b";
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region ../nuxi/src/commands/info.ts
|
|
20
|
-
var info_default = defineCommand({
|
|
21
|
-
meta: {
|
|
22
|
-
name: "info",
|
|
23
|
-
description: "Get information about Nuxt project"
|
|
24
|
-
},
|
|
25
|
-
args: {
|
|
26
|
-
...cwdArgs,
|
|
27
|
-
...legacyRootDirArgs
|
|
28
|
-
},
|
|
29
|
-
async run(ctx) {
|
|
30
|
-
const cwd = resolve(ctx.args.cwd || ctx.args.rootDir);
|
|
31
|
-
const nuxtConfig = await getNuxtConfig(cwd);
|
|
32
|
-
const { dependencies = {}, devDependencies = {} } = await readPackageJSON(cwd).catch(() => ({}));
|
|
33
|
-
const nuxtPath = tryResolveNuxt(cwd);
|
|
34
|
-
async function getDepVersion(name) {
|
|
35
|
-
for (const url of [cwd, nuxtPath]) {
|
|
36
|
-
if (!url) continue;
|
|
37
|
-
const pkg = await readPackageJSON(name, { url }).catch(() => null);
|
|
38
|
-
if (pkg) return pkg.version;
|
|
39
|
-
}
|
|
40
|
-
return dependencies[name] || devDependencies[name];
|
|
41
|
-
}
|
|
42
|
-
async function listModules(arr = []) {
|
|
43
|
-
const info = [];
|
|
44
|
-
for (let m of arr) {
|
|
45
|
-
if (Array.isArray(m)) m = m[0];
|
|
46
|
-
const name = normalizeConfigModule(m, cwd);
|
|
47
|
-
if (name) {
|
|
48
|
-
const v = await getDepVersion(name.split("/").splice(0, 2).join("/"));
|
|
49
|
-
info.push(`\`${v ? `${name}@${v}` : name}\``);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return info.join(", ");
|
|
53
|
-
}
|
|
54
|
-
const nuxtVersion = await getDepVersion("nuxt") || await getDepVersion("nuxt-nightly") || await getDepVersion("nuxt-edge") || await getDepVersion("nuxt3") || "-";
|
|
55
|
-
const isLegacy = nuxtVersion.startsWith("2");
|
|
56
|
-
const builder = !isLegacy ? nuxtConfig.builder || "-" : nuxtConfig.bridge?.vite ? "vite" : nuxtConfig.buildModules?.includes("nuxt-vite") ? "vite" : "webpack";
|
|
57
|
-
let packageManager = (await detectPackageManager(cwd))?.name;
|
|
58
|
-
if (packageManager) packageManager += `@${getPackageManagerVersion(packageManager)}`;
|
|
59
|
-
const infoObj = {
|
|
60
|
-
OperatingSystem: os.type(),
|
|
61
|
-
NodeVersion: process.version,
|
|
62
|
-
NuxtVersion: nuxtVersion,
|
|
63
|
-
CLIVersion: version,
|
|
64
|
-
NitroVersion: await getDepVersion("nitropack") || await getDepVersion("nitro"),
|
|
65
|
-
PackageManager: packageManager ?? "unknown",
|
|
66
|
-
Builder: typeof builder === "string" ? builder : "custom",
|
|
67
|
-
UserConfig: Object.keys(nuxtConfig).map((key) => `\`${key}\``).join(", "),
|
|
68
|
-
Modules: await listModules(nuxtConfig.modules)
|
|
69
|
-
};
|
|
70
|
-
if (isLegacy) infoObj.BuildModules = await listModules(nuxtConfig.buildModules || []);
|
|
71
|
-
logger.log("Working directory:", cwd);
|
|
72
|
-
let maxLength = 0;
|
|
73
|
-
const entries = Object.entries(infoObj).map(([key, val]) => {
|
|
74
|
-
const label = splitByCase(key).join(" ");
|
|
75
|
-
if (label.length > maxLength) maxLength = label.length;
|
|
76
|
-
return [label, val || "-"];
|
|
77
|
-
});
|
|
78
|
-
let infoStr = "";
|
|
79
|
-
for (const [label, value] of entries) infoStr += `- ${`${label}: `.padEnd(maxLength + 2)}${value.includes("`") ? value : `\`${value}\``}\n`;
|
|
80
|
-
const copied = !isMinimal && await new Promise((resolve$1) => copy(infoStr, (err) => resolve$1(!err)));
|
|
81
|
-
const isNuxt3 = !isLegacy;
|
|
82
|
-
const isBridge = !isNuxt3 && infoObj.BuildModules?.includes("bridge");
|
|
83
|
-
const repo = isBridge ? "nuxt/bridge" : "nuxt/nuxt";
|
|
84
|
-
const log = [
|
|
85
|
-
(isNuxt3 || isBridge) && `👉 Report an issue: https://github.com/${repo}/issues/new?template=bug-report.yml`,
|
|
86
|
-
(isNuxt3 || isBridge) && `👉 Suggest an improvement: https://github.com/${repo}/discussions/new`,
|
|
87
|
-
`👉 Read documentation: ${isNuxt3 || isBridge ? "https://nuxt.com" : "https://v2.nuxt.com"}`
|
|
88
|
-
].filter(Boolean).join("\n");
|
|
89
|
-
const splitter = "------------------------------";
|
|
90
|
-
logger.log(`Nuxt project info: ${copied ? "(copied to clipboard)" : ""}\n\n${splitter}\n${infoStr}${splitter}\n\n${log}\n`);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
function normalizeConfigModule(module, rootDir) {
|
|
94
|
-
if (!module) return null;
|
|
95
|
-
if (typeof module === "string") return module.split(rootDir).pop().split("node_modules").pop().replace(/^\//, "");
|
|
96
|
-
if (typeof module === "function") return `${module.name}()`;
|
|
97
|
-
if (Array.isArray(module)) return normalizeConfigModule(module[0], rootDir);
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
async function getNuxtConfig(rootDir) {
|
|
101
|
-
try {
|
|
102
|
-
const { createJiti } = await import("jiti");
|
|
103
|
-
const jiti = createJiti(rootDir, {
|
|
104
|
-
interopDefault: true,
|
|
105
|
-
alias: {
|
|
106
|
-
"~": rootDir,
|
|
107
|
-
"@": rootDir
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
globalThis.defineNuxtConfig = (c) => c;
|
|
111
|
-
const result = await jiti.import("./nuxt.config", { default: true });
|
|
112
|
-
delete globalThis.defineNuxtConfig;
|
|
113
|
-
return result;
|
|
114
|
-
} catch {
|
|
115
|
-
return {};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
//#endregion
|
|
120
|
-
export { info_default as default };
|
package/dist/logger-Dk0gkCkX.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { coerce } from "semver";
|
|
2
|
-
import { readPackageJSON } from "pkg-types";
|
|
3
|
-
|
|
4
|
-
//#region ../nuxi/src/utils/versions.ts
|
|
5
|
-
async function getNuxtVersion(cwd, cache = true) {
|
|
6
|
-
const nuxtPkg = await readPackageJSON("nuxt", {
|
|
7
|
-
url: cwd,
|
|
8
|
-
try: true,
|
|
9
|
-
cache
|
|
10
|
-
});
|
|
11
|
-
if (nuxtPkg) return nuxtPkg.version;
|
|
12
|
-
const pkg = await readPackageJSON(cwd);
|
|
13
|
-
const pkgDep = pkg?.dependencies?.nuxt || pkg?.devDependencies?.nuxt;
|
|
14
|
-
return pkgDep && coerce(pkgDep)?.version || "3.0.0";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
export { getNuxtVersion as t };
|
|
File without changes
|
|
File without changes
|