@nuxt/cli-nightly 3.32.0-20251204-165525-40c967f → 3.32.0-20260106-121815-562abd5
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-DLobtPIm.mjs → add-CIAi6Dmn.mjs} +10 -6
- package/dist/add-DXIjAzbd.mjs +10 -0
- package/dist/add-template-BqK8C-av.mjs +80 -0
- package/dist/{analyze-C5qqTkhe.mjs → analyze-gZGHJ1Fr.mjs} +14 -10
- package/dist/{banner-drlfl0J-.mjs → banner-BrAj2w2K.mjs} +1 -1
- package/dist/{build-ChMzq018.mjs → build-DF96Rh_E.mjs} +6 -5
- package/dist/{cleanup-CD3OpT9X.mjs → cleanup-viSjdn1J.mjs} +3 -3
- package/dist/dev/index.mjs +7 -6
- package/dist/{dev-BjCHVbda.mjs → dev-CsAvgRwH.mjs} +8 -9
- package/dist/dev-D9us4AeN.mjs +10 -0
- package/dist/{dev-BPdQ9vYt.mjs → dev-KB30iboK.mjs} +12 -10
- package/dist/{dev-child-C02p1dAk.mjs → dev-child-D_yO61Et.mjs} +1 -1
- package/dist/{fs-B_hD5MnA.mjs → fs-BNfOTIDu.mjs} +1 -1
- package/dist/{generate-DSEHRPYE.mjs → generate-eutQA4iL.mjs} +6 -6
- package/dist/index.mjs +73 -62
- package/dist/{info-Cgh4x28b.mjs → info-CUYRtF1o.mjs} +7 -7
- package/dist/{init-CUkHvr29.mjs → init-VER7CzSl.mjs} +17 -12
- package/dist/{kit-CPEUdXTm.mjs → kit-4LNqcmNp.mjs} +1 -1
- package/dist/{module-dUoKC1O2.mjs → module-C5J-stzm.mjs} +2 -2
- package/dist/{nuxt-Bkosdz43.mjs → nuxt-4ILhz74C.mjs} +2 -2
- package/dist/{prepare-DU15fbIh.mjs → prepare-CQwaXQtb.mjs} +2 -2
- package/dist/prepare-D99IJFcY.mjs +7 -0
- package/dist/{preview-D2Y29Rfc.mjs → preview-C4zyHtv2.mjs} +2 -2
- package/dist/{search-JRE-pvWm.mjs → search--NGnNBGz.mjs} +3 -3
- package/dist/templates-BqauPpL_.mjs +3 -0
- package/dist/{add-BRBkCPhK.mjs → templates-CCEGPE6-.mjs} +21 -79
- package/dist/{typecheck-CLdIBKcn.mjs → typecheck-B-jIcMjP.mjs} +2 -2
- package/dist/{upgrade-fEGIXDnO.mjs → upgrade-DaYhC23f.mjs} +5 -5
- package/dist/{versions-CTlxnxbH.mjs → versions-DD7jbeRR.mjs} +1 -1
- package/package.json +12 -12
- package/dist/add-CHNLu2Nh.mjs +0 -10
- package/dist/build-Dx1VGivC.mjs +0 -10
- package/dist/dev-BTtyQYdl.mjs +0 -9
- package/dist/prepare-DCVINTk-.mjs +0 -7
- package/dist/templates-FddTjK4U.mjs +0 -3
- /package/dist/{env-kdrdHqLf.mjs → env-BRiVSJMz.mjs} +0 -0
- /package/dist/{templates-C0gAD--n.mjs → templates-DR3hjht5.mjs} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { o as logLevelArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { r as relativeToProcess } from "./kit-
|
|
4
|
-
import { t as getNuxtVersion } from "./versions-
|
|
3
|
+
import { r as relativeToProcess } from "./kit-4LNqcmNp.mjs";
|
|
4
|
+
import { t as getNuxtVersion } from "./versions-DD7jbeRR.mjs";
|
|
5
5
|
import { n as fetchModules, r as getRegistryFromContent, t as checkNuxtCompatibility } from "./_utils-B8YNEdpq.mjs";
|
|
6
|
-
import { t as prepare_default } from "./prepare-
|
|
6
|
+
import { t as prepare_default } from "./prepare-CQwaXQtb.mjs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import process from "node:process";
|
|
9
9
|
import { defineCommand, runCommand } from "citty";
|
|
10
10
|
import { colors } from "consola/utils";
|
|
11
|
-
import { confirm, isCancel, select } from "@clack/prompts";
|
|
11
|
+
import { cancel, confirm, isCancel, select } from "@clack/prompts";
|
|
12
|
+
import { resolve as resolve$1 } from "pathe";
|
|
12
13
|
import { fileURLToPath } from "node:url";
|
|
13
14
|
import * as fs from "node:fs";
|
|
14
15
|
import { existsSync } from "node:fs";
|
|
15
16
|
import { joinURL } from "ufo";
|
|
16
|
-
import { resolve as resolve$1 } from "pathe";
|
|
17
17
|
import { readPackageJSON } from "pkg-types";
|
|
18
18
|
import { satisfies } from "semver";
|
|
19
19
|
import { homedir } from "node:os";
|
|
@@ -103,7 +103,11 @@ var add_default = defineCommand({
|
|
|
103
103
|
});
|
|
104
104
|
if (isCancel(shouldContinue) || shouldContinue !== true) process.exit(1);
|
|
105
105
|
}
|
|
106
|
-
const resolvedModules = (await Promise.all(modules.map((moduleName) => resolveModule(moduleName, cwd)))).filter((x) => x
|
|
106
|
+
const resolvedModules = (await Promise.all(modules.map((moduleName) => resolveModule(moduleName, cwd)))).filter((x) => !!x);
|
|
107
|
+
if (!resolvedModules.length) {
|
|
108
|
+
cancel("No modules to add.");
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
107
111
|
logger.info(`Resolved ${resolvedModules.map((x) => colors.cyan(x.pkgName)).join(", ")}, adding module${resolvedModules.length > 1 ? "s" : ""}...`);
|
|
108
112
|
await addModules(resolvedModules, {
|
|
109
113
|
...ctx.args,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./_shared-BCYCnX0T.mjs";
|
|
2
|
+
import "./logger-B4ge7MhP.mjs";
|
|
3
|
+
import "./kit-4LNqcmNp.mjs";
|
|
4
|
+
import "./versions-DD7jbeRR.mjs";
|
|
5
|
+
import "./fs-BNfOTIDu.mjs";
|
|
6
|
+
import { t as add_default } from "./add-CIAi6Dmn.mjs";
|
|
7
|
+
import "./_utils-B8YNEdpq.mjs";
|
|
8
|
+
import "./prepare-CQwaXQtb.mjs";
|
|
9
|
+
|
|
10
|
+
export { add_default as default };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { o as logLevelArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
|
+
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
+
import { n as templates, t as templateNames } from "./templates-CCEGPE6-.mjs";
|
|
4
|
+
import { r as relativeToProcess, t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
5
|
+
import process from "node:process";
|
|
6
|
+
import { defineCommand } from "citty";
|
|
7
|
+
import { colors } from "consola/utils";
|
|
8
|
+
import { cancel, intro, outro } from "@clack/prompts";
|
|
9
|
+
import { dirname, extname, resolve } from "pathe";
|
|
10
|
+
import { existsSync, promises } from "node:fs";
|
|
11
|
+
|
|
12
|
+
//#region ../nuxi/src/commands/add-template.ts
|
|
13
|
+
var add_template_default = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: "add-template",
|
|
16
|
+
description: "Create a new template file."
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
...cwdArgs,
|
|
20
|
+
...logLevelArgs,
|
|
21
|
+
force: {
|
|
22
|
+
type: "boolean",
|
|
23
|
+
description: "Force override file if it already exists",
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
template: {
|
|
27
|
+
type: "positional",
|
|
28
|
+
required: true,
|
|
29
|
+
valueHint: templateNames.join("|"),
|
|
30
|
+
description: `Specify which template to generate`
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
type: "positional",
|
|
34
|
+
required: true,
|
|
35
|
+
description: "Specify name of the generated file"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
async run(ctx) {
|
|
39
|
+
const cwd = resolve(ctx.args.cwd);
|
|
40
|
+
intro(colors.cyan("Adding template..."));
|
|
41
|
+
const templateName = ctx.args.template;
|
|
42
|
+
if (!templateNames.includes(templateName)) {
|
|
43
|
+
const templateNames$1 = Object.keys(templates).map((name$1) => colors.cyan(name$1));
|
|
44
|
+
const lastTemplateName = templateNames$1.pop();
|
|
45
|
+
logger.error(`Template ${colors.cyan(templateName)} is not supported.`);
|
|
46
|
+
logger.info(`Possible values are ${templateNames$1.join(", ")} or ${lastTemplateName}.`);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
const ext = extname(ctx.args.name);
|
|
50
|
+
const name = ext === ".vue" || ext === ".ts" ? ctx.args.name.replace(ext, "") : ctx.args.name;
|
|
51
|
+
if (!name) {
|
|
52
|
+
cancel("name argument is missing!");
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
const config = await (await loadKit(cwd)).loadNuxtConfig({ cwd });
|
|
56
|
+
const template = templates[templateName];
|
|
57
|
+
const res = template({
|
|
58
|
+
name,
|
|
59
|
+
args: ctx.args,
|
|
60
|
+
nuxtOptions: config
|
|
61
|
+
});
|
|
62
|
+
if (!ctx.args.force && existsSync(res.path)) {
|
|
63
|
+
logger.error(`File exists at ${colors.cyan(relativeToProcess(res.path))}.`);
|
|
64
|
+
logger.info(`Use ${colors.cyan("--force")} to override or use a different name.`);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
const parentDir = dirname(res.path);
|
|
68
|
+
if (!existsSync(parentDir)) {
|
|
69
|
+
logger.step(`Creating directory ${colors.cyan(relativeToProcess(parentDir))}.`);
|
|
70
|
+
if (templateName === "page") logger.info("This enables vue-router functionality!");
|
|
71
|
+
await promises.mkdir(parentDir, { recursive: true });
|
|
72
|
+
}
|
|
73
|
+
await promises.writeFile(res.path, `${res.contents.trim()}\n`);
|
|
74
|
+
logger.success(`Created ${colors.cyan(relativeToProcess(res.path))}.`);
|
|
75
|
+
outro(`Generated a new ${colors.cyan(templateName)}!`);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
export { add_template_default as default };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { t as overrideEnv } from "./env-BRiVSJMz.mjs";
|
|
4
|
+
import { r as relativeToProcess, t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
5
|
+
import { n as clearDir } from "./fs-BNfOTIDu.mjs";
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import { defineCommand } from "citty";
|
|
8
8
|
import { colors } from "consola/utils";
|
|
9
9
|
import { intro, note, outro, taskLog } from "@clack/prompts";
|
|
10
|
+
import { join, resolve } from "pathe";
|
|
10
11
|
import { defu as defu$1 } from "defu";
|
|
11
12
|
import { promises } from "node:fs";
|
|
12
|
-
import { join, resolve } from "pathe";
|
|
13
13
|
import { FastResponse, FastURL, serve } from "srvx";
|
|
14
14
|
|
|
15
|
-
//#region ../../node_modules/.pnpm/rou3@0.7.
|
|
15
|
+
//#region ../../node_modules/.pnpm/rou3@0.7.12/node_modules/rou3/dist/index.mjs
|
|
16
16
|
const NullProtoObj = /* @__PURE__ */ (() => {
|
|
17
17
|
const e = function() {};
|
|
18
18
|
return e.prototype = Object.create(null), Object.freeze(e.prototype), e;
|
|
@@ -33,7 +33,7 @@ function splitPath(path) {
|
|
|
33
33
|
function getMatchParams(segments, paramsMap) {
|
|
34
34
|
const params = new NullProtoObj();
|
|
35
35
|
for (const [index, name] of paramsMap) {
|
|
36
|
-
const segment = index < 0 ? segments.slice(-
|
|
36
|
+
const segment = index < 0 ? segments.slice(-(index + 1)).join("/") : segments[index];
|
|
37
37
|
if (typeof name === "string") params[name] = segment;
|
|
38
38
|
else {
|
|
39
39
|
const match = segment.match(name);
|
|
@@ -48,18 +48,19 @@ function getMatchParams(segments, paramsMap) {
|
|
|
48
48
|
function addRoute(ctx, method = "", path, data) {
|
|
49
49
|
method = method.toUpperCase();
|
|
50
50
|
if (path.charCodeAt(0) !== 47) path = `/${path}`;
|
|
51
|
+
path = path.replace(/\\:/g, "%3A");
|
|
51
52
|
const segments = splitPath(path);
|
|
52
53
|
let node = ctx.root;
|
|
53
54
|
let _unnamedParamIndex = 0;
|
|
54
55
|
const paramsMap = [];
|
|
55
56
|
const paramsRegexp = [];
|
|
56
57
|
for (let i = 0; i < segments.length; i++) {
|
|
57
|
-
|
|
58
|
+
let segment = segments[i];
|
|
58
59
|
if (segment.startsWith("**")) {
|
|
59
60
|
if (!node.wildcard) node.wildcard = { key: "**" };
|
|
60
61
|
node = node.wildcard;
|
|
61
62
|
paramsMap.push([
|
|
62
|
-
-i,
|
|
63
|
+
-(i + 1),
|
|
63
64
|
segment.split(":")[1] || "_",
|
|
64
65
|
segment.length === 2
|
|
65
66
|
]);
|
|
@@ -89,6 +90,8 @@ function addRoute(ctx, method = "", path, data) {
|
|
|
89
90
|
]);
|
|
90
91
|
continue;
|
|
91
92
|
}
|
|
93
|
+
if (segment === "\\*") segment = segments[i] = "*";
|
|
94
|
+
else if (segment === "\\*\\*") segment = segments[i] = "**";
|
|
92
95
|
const child = node.static?.[segment];
|
|
93
96
|
if (child) node = child;
|
|
94
97
|
else {
|
|
@@ -106,7 +109,7 @@ function addRoute(ctx, method = "", path, data) {
|
|
|
106
109
|
paramsRegexp,
|
|
107
110
|
paramsMap: hasParams ? paramsMap : void 0
|
|
108
111
|
});
|
|
109
|
-
if (!hasParams) ctx.static[
|
|
112
|
+
if (!hasParams) ctx.static["/" + segments.join("/")] = node;
|
|
110
113
|
}
|
|
111
114
|
function getParamRegexp(segment) {
|
|
112
115
|
const regex = segment.replace(/:(\w+)/g, (_, id) => `(?<${id}>[^/]+)`).replace(/\./g, "\\.");
|
|
@@ -187,7 +190,7 @@ function routeToRegExp(route = "/") {
|
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
//#endregion
|
|
190
|
-
//#region ../../node_modules/.pnpm/h3@2.0.1-rc.
|
|
193
|
+
//#region ../../node_modules/.pnpm/h3@2.0.1-rc.7_crossws@0.4.1_srvx@0.10.0_/node_modules/h3/dist/h3.mjs
|
|
191
194
|
const kEventNS = "h3.internal.event.";
|
|
192
195
|
const kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`);
|
|
193
196
|
const kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`);
|
|
@@ -369,6 +372,7 @@ function prepareResponse(val, event, config, nested) {
|
|
|
369
372
|
}
|
|
370
373
|
const preparedRes = event[kEventRes];
|
|
371
374
|
const preparedHeaders = preparedRes?.[kEventResHeaders];
|
|
375
|
+
event[kEventRes] = void 0;
|
|
372
376
|
if (!(val instanceof Response)) {
|
|
373
377
|
const res = prepareResponseBody(val, event, config);
|
|
374
378
|
const status = res.status || preparedRes?.status;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
2
|
-
import { n as getPkgJSON, r as getPkgVersion } from "./versions-
|
|
2
|
+
import { n as getPkgJSON, r as getPkgVersion } from "./versions-DD7jbeRR.mjs";
|
|
3
3
|
import { colors } from "consola/utils";
|
|
4
4
|
|
|
5
5
|
//#region ../nuxi/src/utils/banner.ts
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, r as envNameArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
3
|
+
import { t as overrideEnv } from "./env-BRiVSJMz.mjs";
|
|
4
|
+
import { t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
5
|
+
import "./versions-DD7jbeRR.mjs";
|
|
6
|
+
import { n as showVersions } from "./banner-BrAj2w2K.mjs";
|
|
7
|
+
import { t as clearBuildDir } from "./fs-BNfOTIDu.mjs";
|
|
7
8
|
import process from "node:process";
|
|
8
9
|
import { defineCommand } from "citty";
|
|
9
10
|
import { colors } from "consola/utils";
|
|
@@ -81,4 +82,4 @@ var build_default = defineCommand({
|
|
|
81
82
|
});
|
|
82
83
|
|
|
83
84
|
//#endregion
|
|
84
|
-
export { build_default as
|
|
85
|
+
export { build_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { t as loadKit } from "./kit-
|
|
4
|
-
import "./fs-
|
|
5
|
-
import { t as cleanupNuxtDirs } from "./nuxt-
|
|
3
|
+
import { t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
4
|
+
import "./fs-BNfOTIDu.mjs";
|
|
5
|
+
import { t as cleanupNuxtDirs } from "./nuxt-4ILhz74C.mjs";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
import { resolve } from "pathe";
|
|
8
8
|
|
package/dist/dev/index.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "../logger-B4ge7MhP.mjs";
|
|
2
|
-
import
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
7
|
-
import "../
|
|
2
|
+
import "../env-BRiVSJMz.mjs";
|
|
3
|
+
import { t as initialize } from "../dev-KB30iboK.mjs";
|
|
4
|
+
import "../kit-4LNqcmNp.mjs";
|
|
5
|
+
import "../versions-DD7jbeRR.mjs";
|
|
6
|
+
import "../banner-BrAj2w2K.mjs";
|
|
7
|
+
import "../fs-BNfOTIDu.mjs";
|
|
8
|
+
import "../nuxt-4ILhz74C.mjs";
|
|
8
9
|
|
|
9
10
|
export { initialize };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, r as envNameArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger, t as debug } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import
|
|
3
|
+
import "./env-BRiVSJMz.mjs";
|
|
4
|
+
import { t as initialize } from "./dev-KB30iboK.mjs";
|
|
5
|
+
import "./kit-4LNqcmNp.mjs";
|
|
6
|
+
import "./versions-DD7jbeRR.mjs";
|
|
7
|
+
import "./banner-BrAj2w2K.mjs";
|
|
8
|
+
import "./fs-BNfOTIDu.mjs";
|
|
9
|
+
import "./nuxt-4ILhz74C.mjs";
|
|
10
10
|
import process from "node:process";
|
|
11
11
|
import { defineCommand } from "citty";
|
|
12
|
-
import { isBun, isDeno, isTest } from "std-env";
|
|
13
12
|
import { colors } from "consola/utils";
|
|
13
|
+
import { isBun, isDeno, isTest } from "std-env";
|
|
14
14
|
import { resolve } from "pathe";
|
|
15
15
|
import { satisfies } from "semver";
|
|
16
16
|
import { getArgs, parseArgs } from "listhen/cli";
|
|
@@ -200,7 +200,6 @@ const command = defineCommand({
|
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
202
|
async run(ctx) {
|
|
203
|
-
overrideEnv("development");
|
|
204
203
|
const cwd = resolve(ctx.args.cwd || ctx.args.rootDir);
|
|
205
204
|
const listenOverrides = resolveListenOverrides(ctx.args);
|
|
206
205
|
const { listener, close, onRestart, onReady } = await initialize({
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./logger-B4ge7MhP.mjs";
|
|
2
|
+
import "./env-BRiVSJMz.mjs";
|
|
3
|
+
import { t as initialize } from "./dev-KB30iboK.mjs";
|
|
4
|
+
import "./kit-4LNqcmNp.mjs";
|
|
5
|
+
import "./versions-DD7jbeRR.mjs";
|
|
6
|
+
import "./banner-BrAj2w2K.mjs";
|
|
7
|
+
import "./fs-BNfOTIDu.mjs";
|
|
8
|
+
import "./nuxt-4ILhz74C.mjs";
|
|
9
|
+
|
|
10
|
+
export { initialize };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as overrideEnv } from "./env-BRiVSJMz.mjs";
|
|
2
|
+
import { i as withNodePath, t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
3
|
+
import { r as showVersionsFromConfig } from "./banner-BrAj2w2K.mjs";
|
|
4
|
+
import { t as clearBuildDir } from "./fs-BNfOTIDu.mjs";
|
|
5
|
+
import { a as writeNuxtManifest, i as resolveNuxtManifest, n as loadNuxtManifest } from "./nuxt-4ILhz74C.mjs";
|
|
5
6
|
import process from "node:process";
|
|
6
7
|
import { provider } from "std-env";
|
|
8
|
+
import { join, resolve } from "pathe";
|
|
7
9
|
import { pathToFileURL } from "node:url";
|
|
8
10
|
import defu, { defu as defu$1 } from "defu";
|
|
9
11
|
import EventEmitter from "node:events";
|
|
@@ -12,7 +14,6 @@ import { mkdir } from "node:fs/promises";
|
|
|
12
14
|
import { resolveModulePath } from "exsolve";
|
|
13
15
|
import { joinURL } from "ufo";
|
|
14
16
|
import { listen } from "listhen";
|
|
15
|
-
import { resolve } from "pathe";
|
|
16
17
|
import { debounce } from "perfect-debounce";
|
|
17
18
|
import { toNodeHandler } from "srvx/node";
|
|
18
19
|
import { Youch } from "youch";
|
|
@@ -516,9 +517,10 @@ var NuxtDevServer = class extends EventEmitter {
|
|
|
516
517
|
this.#currentNuxt.options.devServer.https = this.listener.https;
|
|
517
518
|
if (this.listener.https && !process.env.NODE_TLS_REJECT_UNAUTHORIZED) console.warn("You might need `NODE_TLS_REJECT_UNAUTHORIZED=0` environment variable to make https work.");
|
|
518
519
|
const kit = await loadKit(this.options.cwd);
|
|
519
|
-
|
|
520
|
+
const typesPromise = existsSync(join(this.#currentNuxt.options.buildDir, "tsconfig.json")) ? kit.writeTypes(this.#currentNuxt).catch(console.error) : await kit.writeTypes(this.#currentNuxt).catch(console.error);
|
|
521
|
+
await Promise.all([typesPromise, kit.buildNuxt(this.#currentNuxt)]);
|
|
520
522
|
if (!this.#currentNuxt.server) throw new Error("Nitro server has not been initialized.");
|
|
521
|
-
const distDir =
|
|
523
|
+
const distDir = join(this.#currentNuxt.options.buildDir, "dist");
|
|
522
524
|
await mkdir(distDir, { recursive: true });
|
|
523
525
|
this.#fileChangeTracker.prime(distDir);
|
|
524
526
|
this.#distWatcher = watch(distDir);
|
|
@@ -573,7 +575,7 @@ function createConfigWatcher(cwd, dotenvFileName = ".env", onRestart, onReload)
|
|
|
573
575
|
const fileWatcher = new FileChangeTracker();
|
|
574
576
|
fileWatcher.prime(cwd);
|
|
575
577
|
const configWatcher = watch(cwd);
|
|
576
|
-
let configDirWatcher = existsSync(
|
|
578
|
+
let configDirWatcher = existsSync(join(cwd, ".config")) ? createConfigDirWatcher(cwd, onReload) : void 0;
|
|
577
579
|
const dotenvFileNames = new Set(Array.isArray(dotenvFileName) ? dotenvFileName : [dotenvFileName]);
|
|
578
580
|
configWatcher.on("change", (_event, file) => {
|
|
579
581
|
if (!fileWatcher.shouldEmitChange(resolve(cwd, file))) return;
|
|
@@ -587,7 +589,7 @@ function createConfigWatcher(cwd, dotenvFileName = ".env", onRestart, onReload)
|
|
|
587
589
|
};
|
|
588
590
|
}
|
|
589
591
|
function createConfigDirWatcher(cwd, onReload) {
|
|
590
|
-
const configDir =
|
|
592
|
+
const configDir = join(cwd, ".config");
|
|
591
593
|
const fileWatcher = new FileChangeTracker();
|
|
592
594
|
fileWatcher.prime(configDir);
|
|
593
595
|
const configDirWatcher = watch(configDir);
|
|
@@ -614,7 +616,6 @@ function isPublicHostname(hostname) {
|
|
|
614
616
|
//#endregion
|
|
615
617
|
//#region ../nuxi/src/dev/index.ts
|
|
616
618
|
const start = Date.now();
|
|
617
|
-
process.env.NODE_ENV = "development";
|
|
618
619
|
var IPC = class {
|
|
619
620
|
enabled = !!process.send && !process.title?.includes("vitest") && process.env.__NUXT__FORK;
|
|
620
621
|
constructor() {
|
|
@@ -636,6 +637,7 @@ var IPC = class {
|
|
|
636
637
|
};
|
|
637
638
|
const ipc = new IPC();
|
|
638
639
|
async function initialize(devContext, ctx = {}) {
|
|
640
|
+
overrideEnv("development");
|
|
639
641
|
const devServer = new NuxtDevServer({
|
|
640
642
|
cwd: devContext.cwd,
|
|
641
643
|
overrides: defu(ctx.data?.overrides, { extends: devContext.args.extends }),
|
|
@@ -25,7 +25,7 @@ var dev_child_default = defineCommand({
|
|
|
25
25
|
async run(ctx) {
|
|
26
26
|
if (!process.send && !isTest) console.warn("`nuxi _dev` is an internal command and should not be used directly. Please use `nuxi dev` instead.");
|
|
27
27
|
const cwd = resolve(ctx.args.cwd || ctx.args.rootDir);
|
|
28
|
-
const { initialize } = await import("./dev-
|
|
28
|
+
const { initialize } = await import("./dev-D9us4AeN.mjs");
|
|
29
29
|
await initialize({
|
|
30
30
|
cwd,
|
|
31
31
|
args: ctx.args
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, r as envNameArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
3
|
+
import "./env-BRiVSJMz.mjs";
|
|
4
|
+
import "./kit-4LNqcmNp.mjs";
|
|
5
|
+
import "./versions-DD7jbeRR.mjs";
|
|
6
|
+
import "./banner-BrAj2w2K.mjs";
|
|
7
|
+
import "./fs-BNfOTIDu.mjs";
|
|
8
|
+
import build_default from "./build-DF96Rh_E.mjs";
|
|
9
9
|
import { defineCommand } from "citty";
|
|
10
10
|
|
|
11
11
|
//#region ../nuxi/src/commands/generate.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
import { t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { t as
|
|
3
|
+
import { t as templateNames } from "./templates-CCEGPE6-.mjs";
|
|
4
|
+
import { t as templates } from "./templates-DR3hjht5.mjs";
|
|
4
5
|
import { resolve } from "node:path";
|
|
5
6
|
import process from "node:process";
|
|
6
7
|
import { defineCommand, runCommand as runCommand$1, runMain as runMain$1 } from "citty";
|
|
8
|
+
import { colors } from "consola/utils";
|
|
7
9
|
import { provider } from "std-env";
|
|
8
10
|
import { consola } from "consola";
|
|
9
|
-
import { colors } from "consola/utils";
|
|
10
11
|
import { fileURLToPath } from "node:url";
|
|
11
12
|
import tab from "@bomb.sh/tab/citty";
|
|
12
13
|
|
|
13
14
|
//#region ../nuxi/src/commands/index.ts
|
|
14
15
|
const _rDefault = (r) => r.default || r;
|
|
15
16
|
const commands = {
|
|
16
|
-
add: () => import("./add-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
"add": () => import("./add-DXIjAzbd.mjs").then(_rDefault),
|
|
18
|
+
"add-template": () => import("./add-template-BqK8C-av.mjs").then(_rDefault),
|
|
19
|
+
"analyze": () => import("./analyze-gZGHJ1Fr.mjs").then(_rDefault),
|
|
20
|
+
"build": () => import("./build-DF96Rh_E.mjs").then(_rDefault),
|
|
21
|
+
"cleanup": () => import("./cleanup-viSjdn1J.mjs").then(_rDefault),
|
|
22
|
+
"_dev": () => import("./dev-child-D_yO61Et.mjs").then(_rDefault),
|
|
23
|
+
"dev": () => import("./dev-CsAvgRwH.mjs").then(_rDefault),
|
|
24
|
+
"devtools": () => import("./devtools-BTYlIJMv.mjs").then(_rDefault),
|
|
25
|
+
"generate": () => import("./generate-eutQA4iL.mjs").then(_rDefault),
|
|
26
|
+
"info": () => import("./info-CUYRtF1o.mjs").then(_rDefault),
|
|
27
|
+
"init": () => import("./init-VER7CzSl.mjs").then(_rDefault),
|
|
28
|
+
"module": () => import("./module-C5J-stzm.mjs").then(_rDefault),
|
|
29
|
+
"prepare": () => import("./prepare-D99IJFcY.mjs").then(_rDefault),
|
|
30
|
+
"preview": () => import("./preview-C4zyHtv2.mjs").then(_rDefault),
|
|
31
|
+
"start": () => import("./preview-C4zyHtv2.mjs").then(_rDefault),
|
|
32
|
+
"test": () => import("./test-D9z67EJZ.mjs").then(_rDefault),
|
|
33
|
+
"typecheck": () => import("./typecheck-B-jIcMjP.mjs").then(_rDefault),
|
|
34
|
+
"upgrade": () => import("./upgrade-DaYhC23f.mjs").then(_rDefault)
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
//#endregion
|
|
@@ -66,51 +68,9 @@ async function checkEngines() {
|
|
|
66
68
|
//#endregion
|
|
67
69
|
//#region package.json
|
|
68
70
|
var name = "@nuxt/cli-nightly";
|
|
69
|
-
var version = "3.32.0-
|
|
71
|
+
var version = "3.32.0-20260106-121815-562abd5";
|
|
70
72
|
var description = "Nuxt CLI";
|
|
71
73
|
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/main.ts
|
|
74
|
-
const _main = defineCommand({
|
|
75
|
-
meta: {
|
|
76
|
-
name: name.endsWith("nightly") ? name : "nuxi",
|
|
77
|
-
version,
|
|
78
|
-
description
|
|
79
|
-
},
|
|
80
|
-
args: {
|
|
81
|
-
...cwdArgs,
|
|
82
|
-
command: {
|
|
83
|
-
type: "positional",
|
|
84
|
-
required: false
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
subCommands: commands,
|
|
88
|
-
async setup(ctx) {
|
|
89
|
-
const command = ctx.args._[0];
|
|
90
|
-
setupGlobalConsole({ dev: command === "dev" });
|
|
91
|
-
let backgroundTasks;
|
|
92
|
-
if (command !== "_dev" && provider !== "stackblitz") backgroundTasks = Promise.all([checkEngines()]).catch((err) => logger.error(err));
|
|
93
|
-
if (command === "init") await backgroundTasks;
|
|
94
|
-
if (ctx.args.command && !(ctx.args.command in commands)) {
|
|
95
|
-
const cwd = resolve(ctx.args.cwd);
|
|
96
|
-
try {
|
|
97
|
-
const { x } = await import("tinyexec");
|
|
98
|
-
await x(`nuxt-${ctx.args.command}`, ctx.rawArgs.slice(1), {
|
|
99
|
-
nodeOptions: {
|
|
100
|
-
stdio: "inherit",
|
|
101
|
-
cwd
|
|
102
|
-
},
|
|
103
|
-
throwOnError: true
|
|
104
|
-
});
|
|
105
|
-
} catch (err) {
|
|
106
|
-
if (err instanceof Error && "code" in err && err.code === "ENOENT") return;
|
|
107
|
-
}
|
|
108
|
-
process.exit();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
const main = _main;
|
|
113
|
-
|
|
114
74
|
//#endregion
|
|
115
75
|
//#region ../nuxi/src/data/nitro-presets.ts
|
|
116
76
|
const nitroPresets = [
|
|
@@ -248,5 +208,56 @@ async function runCommand(name$1, argv = process.argv.slice(2), data = {}) {
|
|
|
248
208
|
});
|
|
249
209
|
}
|
|
250
210
|
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/main.ts
|
|
213
|
+
const _main = defineCommand({
|
|
214
|
+
meta: {
|
|
215
|
+
name: name.endsWith("nightly") ? name : "nuxi",
|
|
216
|
+
version,
|
|
217
|
+
description
|
|
218
|
+
},
|
|
219
|
+
args: {
|
|
220
|
+
...cwdArgs,
|
|
221
|
+
command: {
|
|
222
|
+
type: "positional",
|
|
223
|
+
required: false
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
subCommands: commands,
|
|
227
|
+
async setup(ctx) {
|
|
228
|
+
const command = ctx.args._[0];
|
|
229
|
+
setupGlobalConsole({ dev: command === "dev" });
|
|
230
|
+
let backgroundTasks;
|
|
231
|
+
if (command !== "_dev" && provider !== "stackblitz") backgroundTasks = Promise.all([checkEngines()]).catch((err) => logger.error(err));
|
|
232
|
+
if (command === "init") await backgroundTasks;
|
|
233
|
+
if (command === "add" && ctx.rawArgs[1] && templateNames.includes(ctx.rawArgs[1])) {
|
|
234
|
+
logger.warn(`${colors.yellow("Deprecated:")} Using ${colors.cyan("nuxt add <template> <name>")} is deprecated.`);
|
|
235
|
+
logger.info(`Please use ${colors.cyan("nuxt add-template <template> <name>")} instead.`);
|
|
236
|
+
await runCommand("add-template", [...ctx.rawArgs.slice(1)]).catch((err) => {
|
|
237
|
+
console.error(err.message);
|
|
238
|
+
process.exit(1);
|
|
239
|
+
});
|
|
240
|
+
process.exit(0);
|
|
241
|
+
}
|
|
242
|
+
if (ctx.args.command && !(ctx.args.command in commands)) {
|
|
243
|
+
const cwd = resolve(ctx.args.cwd);
|
|
244
|
+
try {
|
|
245
|
+
const { x } = await import("tinyexec");
|
|
246
|
+
await x(`nuxt-${ctx.args.command}`, ctx.rawArgs.slice(1), {
|
|
247
|
+
nodeOptions: {
|
|
248
|
+
stdio: "inherit",
|
|
249
|
+
cwd
|
|
250
|
+
},
|
|
251
|
+
throwOnError: true
|
|
252
|
+
});
|
|
253
|
+
} catch (err) {
|
|
254
|
+
if (err instanceof Error && "code" in err && err.code === "ENOENT") return;
|
|
255
|
+
}
|
|
256
|
+
process.exit();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
const main = _main;
|
|
261
|
+
|
|
251
262
|
//#endregion
|
|
252
263
|
export { main, runCommand, runMain };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { n as tryResolveNuxt } from "./kit-
|
|
4
|
-
import "./versions-
|
|
5
|
-
import { t as getBuilder } from "./banner-
|
|
3
|
+
import { n as tryResolveNuxt } from "./kit-4LNqcmNp.mjs";
|
|
4
|
+
import "./versions-DD7jbeRR.mjs";
|
|
5
|
+
import { t as getBuilder } from "./banner-BrAj2w2K.mjs";
|
|
6
6
|
import { t as formatInfoBox } from "./formatting-PESozNtr.mjs";
|
|
7
7
|
import { t as getPackageManagerVersion } from "./packageManagers-BX7-V04a.mjs";
|
|
8
8
|
import process from "node:process";
|
|
9
9
|
import { defineCommand } from "citty";
|
|
10
|
-
import { isBun, isDeno, isMinimal } from "std-env";
|
|
11
10
|
import { colors } from "consola/utils";
|
|
11
|
+
import { isBun, isDeno, isMinimal } from "std-env";
|
|
12
12
|
import { box } from "@clack/prompts";
|
|
13
13
|
import { resolve } from "pathe";
|
|
14
14
|
import { readPackageJSON } from "pkg-types";
|
|
@@ -17,7 +17,7 @@ import { copy } from "copy-paste";
|
|
|
17
17
|
import { detectPackageManager } from "nypm";
|
|
18
18
|
|
|
19
19
|
//#region ../nuxi/package.json
|
|
20
|
-
var version = "3.32.0-
|
|
20
|
+
var version = "3.32.0-20260106-121804-562abd5";
|
|
21
21
|
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region ../nuxi/src/commands/info.ts
|
|
@@ -89,8 +89,7 @@ var info_default = defineCommand({
|
|
|
89
89
|
});
|
|
90
90
|
let copyStr = `| ${" ".repeat(firstColumnLength)} | ${" ".repeat(secondColumnLength)} |\n| ${"-".repeat(firstColumnLength)} | ${"-".repeat(secondColumnLength)} |\n`;
|
|
91
91
|
for (const [label, value] of entries) if (!isMinimal) copyStr += `| ${`**${label}**`.padEnd(firstColumnLength)} | ${(value.includes("`") ? value : `\`${value}\``).padEnd(secondColumnLength)} |\n`;
|
|
92
|
-
|
|
93
|
-
box(`\n${boxStr}`, ` Nuxt project info ${copied ? colors.gray("(copied to clipboard) ") : ""}`, {
|
|
92
|
+
if (!isMinimal && await new Promise((resolve$1) => copy(copyStr, (err) => resolve$1(!err)))) box(`\n${boxStr}`, ` Nuxt project info ${colors.gray("(copied to clipboard) ")}`, {
|
|
94
93
|
contentAlign: "left",
|
|
95
94
|
titleAlign: "left",
|
|
96
95
|
width: "auto",
|
|
@@ -98,6 +97,7 @@ var info_default = defineCommand({
|
|
|
98
97
|
contentPadding: 2,
|
|
99
98
|
rounded: true
|
|
100
99
|
});
|
|
100
|
+
else logger.info(`Nuxt project info:\n${copyStr}`, { withGuide: false });
|
|
101
101
|
const isNuxt3 = !isLegacy;
|
|
102
102
|
const isBridge = !isNuxt3 && infoObj["Build modules"]?.includes("bridge");
|
|
103
103
|
const repo = isBridge ? "nuxt/bridge" : "nuxt/nuxt";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { o as logLevelArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { r as relativeToProcess } from "./kit-
|
|
4
|
-
import "./versions-
|
|
5
|
-
import "./fs-
|
|
6
|
-
import { n as runCommand$1, t as add_default } from "./add-
|
|
7
|
-
import { n as fetchModules } from "./_utils-B8YNEdpq.mjs";
|
|
8
|
-
import "./prepare-
|
|
3
|
+
import { r as relativeToProcess } from "./kit-4LNqcmNp.mjs";
|
|
4
|
+
import { t as getNuxtVersion } from "./versions-DD7jbeRR.mjs";
|
|
5
|
+
import "./fs-BNfOTIDu.mjs";
|
|
6
|
+
import { n as runCommand$1, t as add_default } from "./add-CIAi6Dmn.mjs";
|
|
7
|
+
import { n as fetchModules, t as checkNuxtCompatibility } from "./_utils-B8YNEdpq.mjs";
|
|
8
|
+
import "./prepare-CQwaXQtb.mjs";
|
|
9
9
|
import process from "node:process";
|
|
10
10
|
import { defineCommand } from "citty";
|
|
11
|
-
import { hasTTY } from "std-env";
|
|
12
11
|
import { colors } from "consola/utils";
|
|
12
|
+
import { hasTTY } from "std-env";
|
|
13
13
|
import { box, cancel, confirm, intro, isCancel, multiselect, outro, select, spinner, tasks, text } from "@clack/prompts";
|
|
14
|
-
import { existsSync } from "node:fs";
|
|
15
14
|
import { basename, join, relative, resolve } from "pathe";
|
|
15
|
+
import { existsSync } from "node:fs";
|
|
16
16
|
import { findFile, readPackageJSON, writePackageJSON } from "pkg-types";
|
|
17
17
|
import { x } from "tinyexec";
|
|
18
18
|
import { installDependencies } from "nypm";
|
|
@@ -153,7 +153,7 @@ var init_default = defineCommand({
|
|
|
153
153
|
intro(colors.bold(`Welcome to Nuxt!`.split("").map((m) => `${themeColor}${m}`).join("")));
|
|
154
154
|
let availableTemplates = {};
|
|
155
155
|
if (!ctx.args.template || !ctx.args.dir) {
|
|
156
|
-
const defaultTemplates = await import("./templates-
|
|
156
|
+
const defaultTemplates = await import("./templates-BqauPpL_.mjs").then((r) => r.templates);
|
|
157
157
|
if (ctx.args.offline || ctx.args.preferOffline) availableTemplates = defaultTemplates;
|
|
158
158
|
else {
|
|
159
159
|
const templatesSpinner = spinner();
|
|
@@ -344,7 +344,8 @@ var init_default = defineCommand({
|
|
|
344
344
|
packageManager: {
|
|
345
345
|
name: selectedPackageManager,
|
|
346
346
|
command: selectedPackageManager
|
|
347
|
-
}
|
|
347
|
+
},
|
|
348
|
+
silent: true
|
|
348
349
|
});
|
|
349
350
|
return "Dependencies installed";
|
|
350
351
|
}
|
|
@@ -389,9 +390,13 @@ var init_default = defineCommand({
|
|
|
389
390
|
if (wantsUserModules) {
|
|
390
391
|
const modulesSpinner = spinner();
|
|
391
392
|
modulesSpinner.start("Fetching available modules");
|
|
392
|
-
const [response, templateDeps] = await Promise.all([
|
|
393
|
+
const [response, templateDeps, nuxtVersion] = await Promise.all([
|
|
394
|
+
modulesPromise,
|
|
395
|
+
getTemplateDependencies(template.dir),
|
|
396
|
+
getNuxtVersion(template.dir)
|
|
397
|
+
]);
|
|
393
398
|
modulesSpinner.stop("Modules loaded");
|
|
394
|
-
const officialModules = response.filter((module) => module.type === "official" && module.npm !== "@nuxt/devtools" && !templateDeps.includes(module.npm));
|
|
399
|
+
const officialModules = response.filter((module) => module.type === "official" && module.npm !== "@nuxt/devtools" && !templateDeps.includes(module.npm) && (!module.compatibility.nuxt || checkNuxtCompatibility(module, nuxtVersion)));
|
|
395
400
|
if (officialModules.length === 0) logger.info("All official modules are already included in this template.");
|
|
396
401
|
else {
|
|
397
402
|
const selectedOfficialModules = await multiselect({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
|
+
import { relative } from "pathe";
|
|
2
3
|
import { pathToFileURL } from "node:url";
|
|
3
4
|
import { resolveModulePath } from "exsolve";
|
|
4
|
-
import { relative } from "pathe";
|
|
5
5
|
|
|
6
6
|
//#region ../nuxi/src/utils/paths.ts
|
|
7
7
|
const cwd = process.cwd();
|
|
@@ -8,8 +8,8 @@ var module_default = defineCommand({
|
|
|
8
8
|
},
|
|
9
9
|
args: {},
|
|
10
10
|
subCommands: {
|
|
11
|
-
add: () => import("./add-
|
|
12
|
-
search: () => import("./search
|
|
11
|
+
add: () => import("./add-DXIjAzbd.mjs").then((r) => r.default || r),
|
|
12
|
+
search: () => import("./search--NGnNBGz.mjs").then((r) => r.default || r)
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
2
|
-
import { r as rmRecursive } from "./fs-
|
|
3
|
-
import { promises } from "node:fs";
|
|
2
|
+
import { r as rmRecursive } from "./fs-BNfOTIDu.mjs";
|
|
4
3
|
import { dirname, resolve } from "pathe";
|
|
4
|
+
import { promises } from "node:fs";
|
|
5
5
|
import { hash } from "ohash";
|
|
6
6
|
|
|
7
7
|
//#region ../nuxi/src/utils/nuxt.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, r as envNameArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { r as relativeToProcess, t as loadKit } from "./kit-
|
|
4
|
-
import { t as clearBuildDir } from "./fs-
|
|
3
|
+
import { r as relativeToProcess, t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
4
|
+
import { t as clearBuildDir } from "./fs-BNfOTIDu.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
import { colors } from "consola/utils";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, r as envNameArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { r as relativeToProcess, t as loadKit } from "./kit-
|
|
3
|
+
import { r as relativeToProcess, t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
4
4
|
import { dirname } from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
import { colors } from "consola/utils";
|
|
8
8
|
import { box, outro } from "@clack/prompts";
|
|
9
|
-
import { existsSync, promises } from "node:fs";
|
|
10
9
|
import { resolve as resolve$1 } from "pathe";
|
|
10
|
+
import { existsSync, promises } from "node:fs";
|
|
11
11
|
import { x } from "tinyexec";
|
|
12
12
|
import { setupDotenv } from "c12";
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import "./kit-
|
|
4
|
-
import { t as getNuxtVersion } from "./versions-
|
|
3
|
+
import "./kit-4LNqcmNp.mjs";
|
|
4
|
+
import { t as getNuxtVersion } from "./versions-DD7jbeRR.mjs";
|
|
5
5
|
import { t as formatInfoBox } from "./formatting-PESozNtr.mjs";
|
|
6
6
|
import { n as fetchModules, t as checkNuxtCompatibility } from "./_utils-B8YNEdpq.mjs";
|
|
7
7
|
import { defineCommand } from "citty";
|
|
@@ -84,7 +84,7 @@ async function findModuleByKeywords(query, nuxtVersion) {
|
|
|
84
84
|
compatibility: `nuxt: ${result.item.compatibility?.nuxt || "*"}`,
|
|
85
85
|
repository: result.item.github,
|
|
86
86
|
description: result.item.description,
|
|
87
|
-
install: `npx nuxt
|
|
87
|
+
install: `npx nuxt add ${result.item.name}`,
|
|
88
88
|
stars: colors.yellow(formatNumber(result.item.stats.stars)),
|
|
89
89
|
monthlyDownloads: colors.yellow(formatNumber(result.item.stats.downloads))
|
|
90
90
|
};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { r as relativeToProcess, t as loadKit } from "./kit-CPEUdXTm.mjs";
|
|
4
|
-
import process from "node:process";
|
|
5
|
-
import { defineCommand } from "citty";
|
|
6
|
-
import { colors } from "consola/utils";
|
|
7
|
-
import { cancel, intro, outro } from "@clack/prompts";
|
|
8
|
-
import { existsSync, promises } from "node:fs";
|
|
9
|
-
import { dirname, extname, resolve } from "pathe";
|
|
1
|
+
import { resolve } from "pathe";
|
|
10
2
|
import { camelCase, pascalCase } from "scule";
|
|
11
3
|
|
|
12
4
|
//#region ../nuxi/src/utils/templates/api.ts
|
|
@@ -261,6 +253,25 @@ const templates = {
|
|
|
261
253
|
"server-route": serverRoute,
|
|
262
254
|
"server-util": serverUtil
|
|
263
255
|
};
|
|
256
|
+
const _templateNames = {
|
|
257
|
+
"api": void 0,
|
|
258
|
+
"app": void 0,
|
|
259
|
+
"app-config": void 0,
|
|
260
|
+
"component": void 0,
|
|
261
|
+
"composable": void 0,
|
|
262
|
+
"error": void 0,
|
|
263
|
+
"layer": void 0,
|
|
264
|
+
"layout": void 0,
|
|
265
|
+
"middleware": void 0,
|
|
266
|
+
"module": void 0,
|
|
267
|
+
"page": void 0,
|
|
268
|
+
"plugin": void 0,
|
|
269
|
+
"server-middleware": void 0,
|
|
270
|
+
"server-plugin": void 0,
|
|
271
|
+
"server-route": void 0,
|
|
272
|
+
"server-util": void 0
|
|
273
|
+
};
|
|
274
|
+
const templateNames = Object.keys(_templateNames);
|
|
264
275
|
function applySuffix(args, suffixes, unwrapFrom) {
|
|
265
276
|
let suffix = "";
|
|
266
277
|
for (const s of suffixes) if (args[s]) suffix += `.${s}`;
|
|
@@ -269,73 +280,4 @@ function applySuffix(args, suffixes, unwrapFrom) {
|
|
|
269
280
|
}
|
|
270
281
|
|
|
271
282
|
//#endregion
|
|
272
|
-
|
|
273
|
-
const templateNames = Object.keys(templates);
|
|
274
|
-
var add_default = defineCommand({
|
|
275
|
-
meta: {
|
|
276
|
-
name: "add",
|
|
277
|
-
description: "Create a new template file."
|
|
278
|
-
},
|
|
279
|
-
args: {
|
|
280
|
-
...cwdArgs,
|
|
281
|
-
...logLevelArgs,
|
|
282
|
-
force: {
|
|
283
|
-
type: "boolean",
|
|
284
|
-
description: "Force override file if it already exists",
|
|
285
|
-
default: false
|
|
286
|
-
},
|
|
287
|
-
template: {
|
|
288
|
-
type: "positional",
|
|
289
|
-
required: true,
|
|
290
|
-
valueHint: templateNames.join("|"),
|
|
291
|
-
description: `Specify which template to generate`
|
|
292
|
-
},
|
|
293
|
-
name: {
|
|
294
|
-
type: "positional",
|
|
295
|
-
required: true,
|
|
296
|
-
description: "Specify name of the generated file"
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
async run(ctx) {
|
|
300
|
-
const cwd = resolve(ctx.args.cwd);
|
|
301
|
-
intro(colors.cyan("Adding template..."));
|
|
302
|
-
const templateName = ctx.args.template;
|
|
303
|
-
if (!templateNames.includes(templateName)) {
|
|
304
|
-
const templateNames$1 = Object.keys(templates).map((name$1) => colors.cyan(name$1));
|
|
305
|
-
const lastTemplateName = templateNames$1.pop();
|
|
306
|
-
logger.error(`Template ${colors.cyan(templateName)} is not supported.`);
|
|
307
|
-
logger.info(`Possible values are ${templateNames$1.join(", ")} or ${lastTemplateName}.`);
|
|
308
|
-
process.exit(1);
|
|
309
|
-
}
|
|
310
|
-
const ext = extname(ctx.args.name);
|
|
311
|
-
const name = ext === ".vue" || ext === ".ts" ? ctx.args.name.replace(ext, "") : ctx.args.name;
|
|
312
|
-
if (!name) {
|
|
313
|
-
cancel("name argument is missing!");
|
|
314
|
-
process.exit(1);
|
|
315
|
-
}
|
|
316
|
-
const config = await (await loadKit(cwd)).loadNuxtConfig({ cwd });
|
|
317
|
-
const template = templates[templateName];
|
|
318
|
-
const res = template({
|
|
319
|
-
name,
|
|
320
|
-
args: ctx.args,
|
|
321
|
-
nuxtOptions: config
|
|
322
|
-
});
|
|
323
|
-
if (!ctx.args.force && existsSync(res.path)) {
|
|
324
|
-
logger.error(`File exists at ${colors.cyan(relativeToProcess(res.path))}.`);
|
|
325
|
-
logger.info(`Use ${colors.cyan("--force")} to override or use a different name.`);
|
|
326
|
-
process.exit(1);
|
|
327
|
-
}
|
|
328
|
-
const parentDir = dirname(res.path);
|
|
329
|
-
if (!existsSync(parentDir)) {
|
|
330
|
-
logger.step(`Creating directory ${colors.cyan(relativeToProcess(parentDir))}.`);
|
|
331
|
-
if (templateName === "page") logger.info("This enables vue-router functionality!");
|
|
332
|
-
await promises.mkdir(parentDir, { recursive: true });
|
|
333
|
-
}
|
|
334
|
-
await promises.writeFile(res.path, `${res.contents.trim()}\n`);
|
|
335
|
-
logger.success(`Created ${colors.cyan(relativeToProcess(res.path))}.`);
|
|
336
|
-
outro(`Generated a new ${colors.cyan(templateName)}!`);
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
//#endregion
|
|
341
|
-
export { add_default as default };
|
|
283
|
+
export { templates as n, templateNames as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, i as extendsArgs, n as dotEnvArgs, o as logLevelArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
|
-
import { t as loadKit } from "./kit-
|
|
2
|
+
import { t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
import { isBun } from "std-env";
|
|
6
|
-
import { resolveModulePath } from "exsolve";
|
|
7
6
|
import { resolve } from "pathe";
|
|
7
|
+
import { resolveModulePath } from "exsolve";
|
|
8
8
|
import { readTSConfig } from "pkg-types";
|
|
9
9
|
import { x } from "tinyexec";
|
|
10
10
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as legacyRootDirArgs, o as logLevelArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
|
|
2
2
|
import { n as logger } from "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import { r as relativeToProcess, t as loadKit } from "./kit-
|
|
4
|
-
import { t as getNuxtVersion } from "./versions-
|
|
5
|
-
import "./fs-
|
|
6
|
-
import { r as nuxtVersionToGitIdentifier, t as cleanupNuxtDirs } from "./nuxt-
|
|
3
|
+
import { r as relativeToProcess, t as loadKit } from "./kit-4LNqcmNp.mjs";
|
|
4
|
+
import { t as getNuxtVersion } from "./versions-DD7jbeRR.mjs";
|
|
5
|
+
import "./fs-BNfOTIDu.mjs";
|
|
6
|
+
import { r as nuxtVersionToGitIdentifier, t as cleanupNuxtDirs } from "./nuxt-4ILhz74C.mjs";
|
|
7
7
|
import { t as getPackageManagerVersion } from "./packageManagers-BX7-V04a.mjs";
|
|
8
8
|
import process from "node:process";
|
|
9
9
|
import { defineCommand } from "citty";
|
|
10
10
|
import { colors } from "consola/utils";
|
|
11
11
|
import { cancel, intro, isCancel, note, outro, select, spinner, tasks } from "@clack/prompts";
|
|
12
|
-
import { existsSync } from "node:fs";
|
|
13
12
|
import { resolve } from "pathe";
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
14
|
import { findWorkspaceDir, readPackageJSON } from "pkg-types";
|
|
15
15
|
import { addDependency, dedupeDependencies, detectPackageManager } from "nypm";
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/cli-nightly",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.32.0-
|
|
4
|
+
"version": "3.32.0-20260106-121815-562abd5",
|
|
5
5
|
"description": "Nuxt CLI",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"prepack": "tsdown"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@bomb.sh/tab": "^0.0.
|
|
37
|
-
"@clack/prompts": "1.0.0-alpha.
|
|
38
|
-
"c12": "^3.3.
|
|
36
|
+
"@bomb.sh/tab": "^0.0.11",
|
|
37
|
+
"@clack/prompts": "1.0.0-alpha.9",
|
|
38
|
+
"c12": "^3.3.3",
|
|
39
39
|
"citty": "^0.1.6",
|
|
40
40
|
"confbox": "^0.2.2",
|
|
41
41
|
"consola": "^3.4.2",
|
|
@@ -55,27 +55,27 @@
|
|
|
55
55
|
"pkg-types": "^2.3.0",
|
|
56
56
|
"scule": "^1.3.0",
|
|
57
57
|
"semver": "^7.7.3",
|
|
58
|
-
"srvx": "^0.
|
|
58
|
+
"srvx": "^0.10.0",
|
|
59
59
|
"std-env": "^3.10.0",
|
|
60
60
|
"tinyexec": "^1.0.2",
|
|
61
61
|
"ufo": "^1.6.1",
|
|
62
62
|
"youch": "^4.1.0-beta.13"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@nuxt/kit": "^4.2.
|
|
66
|
-
"@nuxt/schema": "^4.2.
|
|
65
|
+
"@nuxt/kit": "^4.2.2",
|
|
66
|
+
"@nuxt/schema": "^4.2.2",
|
|
67
67
|
"@types/debug": "^4.1.12",
|
|
68
|
-
"@types/node": "^24.10.
|
|
68
|
+
"@types/node": "^24.10.4",
|
|
69
69
|
"get-port-please": "^3.2.0",
|
|
70
70
|
"h3": "^1.15.4",
|
|
71
|
-
"h3-next": "npm:h3@^2.0.1-rc.
|
|
71
|
+
"h3-next": "npm:h3@^2.0.1-rc.7",
|
|
72
72
|
"nitro": "^3.0.1-alpha.1",
|
|
73
73
|
"nitropack": "^2.12.9",
|
|
74
|
-
"rollup": "^4.
|
|
74
|
+
"rollup": "^4.55.1",
|
|
75
75
|
"rollup-plugin-visualizer": "^6.0.5",
|
|
76
|
-
"tsdown": "^0.
|
|
76
|
+
"tsdown": "^0.18.4",
|
|
77
77
|
"typescript": "^5.9.3",
|
|
78
|
-
"undici": "^7.
|
|
78
|
+
"undici": "^7.17.0",
|
|
79
79
|
"unplugin-purge-polyfills": "^0.1.0",
|
|
80
80
|
"vitest": "^3.2.4",
|
|
81
81
|
"youch": "^4.1.0-beta.13"
|
package/dist/add-CHNLu2Nh.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./_shared-BCYCnX0T.mjs";
|
|
2
|
-
import "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import "./kit-CPEUdXTm.mjs";
|
|
4
|
-
import "./versions-CTlxnxbH.mjs";
|
|
5
|
-
import "./fs-B_hD5MnA.mjs";
|
|
6
|
-
import { t as add_default } from "./add-DLobtPIm.mjs";
|
|
7
|
-
import "./_utils-B8YNEdpq.mjs";
|
|
8
|
-
import "./prepare-DU15fbIh.mjs";
|
|
9
|
-
|
|
10
|
-
export { add_default as default };
|
package/dist/build-Dx1VGivC.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./_shared-BCYCnX0T.mjs";
|
|
2
|
-
import "./logger-B4ge7MhP.mjs";
|
|
3
|
-
import "./kit-CPEUdXTm.mjs";
|
|
4
|
-
import "./versions-CTlxnxbH.mjs";
|
|
5
|
-
import "./banner-drlfl0J-.mjs";
|
|
6
|
-
import "./fs-B_hD5MnA.mjs";
|
|
7
|
-
import "./env-kdrdHqLf.mjs";
|
|
8
|
-
import { t as build_default } from "./build-ChMzq018.mjs";
|
|
9
|
-
|
|
10
|
-
export { build_default as default };
|
package/dist/dev-BTtyQYdl.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./logger-B4ge7MhP.mjs";
|
|
2
|
-
import { t as initialize } from "./dev-BPdQ9vYt.mjs";
|
|
3
|
-
import "./kit-CPEUdXTm.mjs";
|
|
4
|
-
import "./versions-CTlxnxbH.mjs";
|
|
5
|
-
import "./banner-drlfl0J-.mjs";
|
|
6
|
-
import "./fs-B_hD5MnA.mjs";
|
|
7
|
-
import "./nuxt-Bkosdz43.mjs";
|
|
8
|
-
|
|
9
|
-
export { initialize };
|
|
File without changes
|
|
File without changes
|