create-vuetify 2.8.0-beta.1 → 2.8.0
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/index.mjs
CHANGED
|
@@ -774,14 +774,14 @@ async function executeCommand(command, args, options = {}) {
|
|
|
774
774
|
var NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG = "No package manager auto-detected.";
|
|
775
775
|
async function resolveOperationOptions(options = {}) {
|
|
776
776
|
const cwd2 = options.cwd || process.cwd();
|
|
777
|
-
const
|
|
777
|
+
const env2 = { ...process.env, ...options.env };
|
|
778
778
|
const packageManager2 = (typeof options.packageManager === "string" ? packageManagers.find((pm) => pm.name === options.packageManager) : options.packageManager) || await detectPackageManager(options.cwd || process.cwd());
|
|
779
779
|
if (!packageManager2) {
|
|
780
780
|
throw new Error(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG);
|
|
781
781
|
}
|
|
782
782
|
return {
|
|
783
783
|
cwd: cwd2,
|
|
784
|
-
env,
|
|
784
|
+
env: env2,
|
|
785
785
|
silent: options.silent ?? false,
|
|
786
786
|
packageManager: packageManager2,
|
|
787
787
|
dev: options.dev ?? false,
|
|
@@ -1060,7 +1060,7 @@ async function initPrompts(context) {
|
|
|
1060
1060
|
initial: 0,
|
|
1061
1061
|
choices: [
|
|
1062
1062
|
{ title: "Vuetify 3 (Stable)", value: "3.x" },
|
|
1063
|
-
{ title: "Vuetify 4 (
|
|
1063
|
+
{ title: "Vuetify 4 (Beta)", value: "4.x" }
|
|
1064
1064
|
]
|
|
1065
1065
|
},
|
|
1066
1066
|
{
|
|
@@ -1204,7 +1204,7 @@ function resolveNonInteractiveContext(context) {
|
|
|
1204
1204
|
// package.json
|
|
1205
1205
|
var package_default = {
|
|
1206
1206
|
name: "create-vuetify",
|
|
1207
|
-
version: "2.8.0
|
|
1207
|
+
version: "2.8.0",
|
|
1208
1208
|
author: "Elijah Kotyluk <elijah@elijahkotyluk.com>",
|
|
1209
1209
|
license: "MIT",
|
|
1210
1210
|
type: "module",
|
|
@@ -1253,10 +1253,11 @@ var package_default = {
|
|
|
1253
1253
|
release: "bumpp"
|
|
1254
1254
|
},
|
|
1255
1255
|
dependencies: {
|
|
1256
|
+
consola: "^3.4.2",
|
|
1256
1257
|
kolorist: "^1.8.0",
|
|
1257
1258
|
magicast: "^0.3.5",
|
|
1258
1259
|
minimist: "^1.2.8",
|
|
1259
|
-
"package-manager-detector": "^1.
|
|
1260
|
+
"package-manager-detector": "^1.6.0",
|
|
1260
1261
|
prompts: "^2.4.2",
|
|
1261
1262
|
tinyexec: "^1.0.1",
|
|
1262
1263
|
"validate-npm-package-name": "^6.0.2"
|
|
@@ -1290,7 +1291,7 @@ Options:
|
|
|
1290
1291
|
--nuxt-module Use vuetify-nuxt-module (for Nuxt presets)
|
|
1291
1292
|
--nuxt-ssr, --ssr Enable Nuxt SSR (for Nuxt presets)
|
|
1292
1293
|
--nuxt-ssr-client-hints Enable Nuxt SSR Client Hints (for Nuxt presets)
|
|
1293
|
-
--v4 Use Vuetify 4 (
|
|
1294
|
+
--v4 Use Vuetify 4 (Beta)
|
|
1294
1295
|
-h, --help Show help
|
|
1295
1296
|
-v, --version Show version
|
|
1296
1297
|
|
|
@@ -1318,7 +1319,7 @@ import minimist from "minimist";
|
|
|
1318
1319
|
var validPresets = ["base", "default", "essentials", "nuxt-base", "nuxt-default", "nuxt-essentials"];
|
|
1319
1320
|
var validPackageManagers = ["npm", "pnpm", "yarn", "bun", "none"];
|
|
1320
1321
|
function parseCliArgs(args) {
|
|
1321
|
-
const
|
|
1322
|
+
const argv2 = minimist(args, {
|
|
1322
1323
|
alias: {
|
|
1323
1324
|
typescript: ["ts"],
|
|
1324
1325
|
preset: ["p"],
|
|
@@ -1348,26 +1349,26 @@ function parseCliArgs(args) {
|
|
|
1348
1349
|
"packageManager"
|
|
1349
1350
|
]
|
|
1350
1351
|
});
|
|
1351
|
-
if (
|
|
1352
|
-
throw new Error(`'${
|
|
1352
|
+
if (argv2.preset && !validPresets.includes(argv2.preset)) {
|
|
1353
|
+
throw new Error(`'${argv2.preset}' is not a valid preset. Valid presets are: ${validPresets.join(", ")}.`);
|
|
1353
1354
|
}
|
|
1354
|
-
if (
|
|
1355
|
-
throw new Error(`'${
|
|
1355
|
+
if (argv2.packageManager && !validPackageManagers.includes(argv2.packageManager)) {
|
|
1356
|
+
throw new Error(`'${argv2.packageManager}' is not a valid package manager. Valid options are: ${validPackageManagers.join(", ")}.`);
|
|
1356
1357
|
}
|
|
1357
|
-
const projectName =
|
|
1358
|
+
const projectName = argv2._[0];
|
|
1358
1359
|
return {
|
|
1359
1360
|
projectName,
|
|
1360
|
-
preset:
|
|
1361
|
-
typescript:
|
|
1362
|
-
packageManager:
|
|
1363
|
-
installDependencies:
|
|
1364
|
-
overwrite:
|
|
1365
|
-
nuxtModule:
|
|
1366
|
-
nuxtSSR:
|
|
1367
|
-
nuxtSSRClientHints:
|
|
1368
|
-
v4:
|
|
1369
|
-
help:
|
|
1370
|
-
version:
|
|
1361
|
+
preset: argv2.preset,
|
|
1362
|
+
typescript: argv2.typescript,
|
|
1363
|
+
packageManager: argv2.packageManager,
|
|
1364
|
+
installDependencies: argv2.installDependencies,
|
|
1365
|
+
overwrite: argv2.overwrite,
|
|
1366
|
+
nuxtModule: argv2.nuxtModule,
|
|
1367
|
+
nuxtSSR: argv2.nuxtSSR,
|
|
1368
|
+
nuxtSSRClientHints: argv2.nuxtSSRClientHints,
|
|
1369
|
+
v4: argv2.v4,
|
|
1370
|
+
help: argv2.help,
|
|
1371
|
+
version: argv2.version
|
|
1371
1372
|
};
|
|
1372
1373
|
}
|
|
1373
1374
|
function cliOptionsToContext(cliOptions, cwd2) {
|
|
@@ -1391,99 +1392,8 @@ import { red as red3 } from "kolorist";
|
|
|
1391
1392
|
|
|
1392
1393
|
// src/utils/banner.ts
|
|
1393
1394
|
import { blue } from "kolorist";
|
|
1394
|
-
function supportsColor() {
|
|
1395
|
-
const testText = "test";
|
|
1396
|
-
const coloredText = blue(testText);
|
|
1397
|
-
return coloredText !== testText;
|
|
1398
|
-
}
|
|
1399
|
-
function createBanner() {
|
|
1400
|
-
if (!supportsColor()) {
|
|
1401
|
-
return createPlainBanner();
|
|
1402
|
-
}
|
|
1403
|
-
return "\x1B[38;2;22;151;246mV\x1B[39m\x1B[38;2;22;147;242mu\x1B[39m\x1B[38;2;22;144;238me\x1B[39m\x1B[38;2;22;140;234mt\x1B[39m\x1B[38;2;23;136;229mi\x1B[39m\x1B[38;2;23;133;225mf\x1B[39m\x1B[38;2;23;129;221my\x1B[39m\x1B[38;2;23;125;217m.\x1B[39m\x1B[38;2;23;121;213mj\x1B[39m\x1B[38;2;23;118;209ms\x1B[39m \x1B[38;2;24;114;204m-\x1B[39m \x1B[38;2;24;110;200mM\x1B[39m\x1B[38;2;24;107;196ma\x1B[39m\x1B[38;2;24;103;192mt\x1B[39m\x1B[38;2;32;110;197me\x1B[39m\x1B[38;2;39;118;202mr\x1B[39m\x1B[38;2;47;125;207mi\x1B[39m\x1B[38;2;54;132;211ma\x1B[39m\x1B[38;2;62;140;216ml\x1B[39m \x1B[38;2;70;147;221mC\x1B[39m\x1B[38;2;77;154;226mo\x1B[39m\x1B[38;2;85;161;231mm\x1B[39m\x1B[38;2;93;169;236mp\x1B[39m\x1B[38;2;100;176;240mo\x1B[39m\x1B[38;2;108;183;245mn\x1B[39m\x1B[38;2;115;191;250me\x1B[39m\x1B[38;2;123;198;255mn\x1B[39m\x1B[38;2;126;199;255mt\x1B[39m \x1B[38;2;129;201;255mF\x1B[39m\x1B[38;2;133;202;255mr\x1B[39m\x1B[38;2;136;204;255ma\x1B[39m\x1B[38;2;139;205;255mm\x1B[39m\x1B[38;2;142;207;255me\x1B[39m\x1B[38;2;145;208;255mw\x1B[39m\x1B[38;2;149;210;255mo\x1B[39m\x1B[38;2;152;211;255mr\x1B[39m\x1B[38;2;155;212;255mk\x1B[39m \x1B[38;2;158;214;255mf\x1B[39m\x1B[38;2;161;215;255mo\x1B[39m\x1B[38;2;164;217;255mr\x1B[39m \x1B[38;2;168;218;255mV\x1B[39m\x1B[38;2;171;220;255mu\x1B[39m\x1B[38;2;174;221;255me\x1B[39m";
|
|
1404
|
-
}
|
|
1405
|
-
function createPlainBanner() {
|
|
1406
|
-
return "Vuetify - Vue Component Framework";
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
// src/utils/deepMerge.ts
|
|
1410
|
-
var isObject = (v) => {
|
|
1411
|
-
return v === Object(v) && v !== null && !Array.isArray(v);
|
|
1412
|
-
};
|
|
1413
|
-
var deepMerge = (...sources) => sources.reduce((acc, curr) => {
|
|
1414
|
-
for (const key of Object.keys(curr)) {
|
|
1415
|
-
if (Array.isArray(acc[key]) && Array.isArray(curr[key])) {
|
|
1416
|
-
acc[key] = Array.from(new Set(acc[key].concat(curr[key])));
|
|
1417
|
-
} else if (isObject(acc[key]) && isObject(curr[key])) {
|
|
1418
|
-
acc[key] = deepMerge(acc[key], curr[key]);
|
|
1419
|
-
} else {
|
|
1420
|
-
acc[key] = curr[key];
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
return acc;
|
|
1424
|
-
}, {});
|
|
1425
1395
|
|
|
1426
|
-
//
|
|
1427
|
-
import { copyFileSync, mkdirSync, readdirSync as readdirSync3, readFileSync, statSync, writeFileSync, existsSync as existsSync4 } from "node:fs";
|
|
1428
|
-
import { basename as basename2, dirname as dirname2, extname as extname2, resolve as resolve5 } from "node:path";
|
|
1429
|
-
function mergePkg(source, destination) {
|
|
1430
|
-
const target = existsSync4(destination) ? JSON.parse(readFileSync(destination, "utf8")) : {};
|
|
1431
|
-
const src = JSON.parse(readFileSync(source, "utf8"));
|
|
1432
|
-
const mergedPkg = deepMerge(target, src);
|
|
1433
|
-
const keysToSort = ["devDependencies", "dependencies"];
|
|
1434
|
-
for (const k of keysToSort) {
|
|
1435
|
-
if (mergedPkg[k]) {
|
|
1436
|
-
mergedPkg[k] = Object.keys(mergedPkg[k]).toSorted().reduce((a, c) => (a[c] = mergedPkg[k][c], a), {});
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
writeFileSync(destination, JSON.stringify(mergedPkg, null, 2) + "\n");
|
|
1440
|
-
}
|
|
1441
|
-
function renderDirectory(source, destination, options) {
|
|
1442
|
-
mkdirSync(destination, { recursive: true });
|
|
1443
|
-
for (const path4 of readdirSync3(source)) {
|
|
1444
|
-
renderTemplate(resolve5(source, path4), resolve5(destination, path4), options);
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
var binaryExtensions = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".gif", ".ico", ".woff", ".woff2", ".ttf", ".eot", ".svg"]);
|
|
1448
|
-
function renderFile(source, destination, options) {
|
|
1449
|
-
const filename = basename2(source);
|
|
1450
|
-
if (filename.startsWith("_")) {
|
|
1451
|
-
destination = resolve5(dirname2(destination), filename.replace("_", "."));
|
|
1452
|
-
}
|
|
1453
|
-
if (filename === "package.json") {
|
|
1454
|
-
mergePkg(source, destination);
|
|
1455
|
-
return;
|
|
1456
|
-
}
|
|
1457
|
-
if (options?.replace && !binaryExtensions.has(extname2(filename))) {
|
|
1458
|
-
let content = readFileSync(source, "utf8");
|
|
1459
|
-
for (const [key, value] of Object.entries(options.replace)) {
|
|
1460
|
-
content = content.replaceAll(key, value);
|
|
1461
|
-
}
|
|
1462
|
-
writeFileSync(destination, content);
|
|
1463
|
-
return;
|
|
1464
|
-
}
|
|
1465
|
-
copyFileSync(source, destination);
|
|
1466
|
-
}
|
|
1467
|
-
function renderTemplate(source, destination, options) {
|
|
1468
|
-
if (statSync(source).isDirectory()) {
|
|
1469
|
-
renderDirectory(source, destination, options);
|
|
1470
|
-
} else {
|
|
1471
|
-
renderFile(source, destination, options);
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
// src/utils/nuxt/renderNuxtTemplate.ts
|
|
1476
|
-
import fs3 from "node:fs";
|
|
1477
|
-
import path3 from "node:path";
|
|
1478
|
-
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
1479
|
-
|
|
1480
|
-
// src/utils/nuxt/utils.ts
|
|
1481
|
-
import process2 from "node:process";
|
|
1482
|
-
import path from "node:path";
|
|
1483
|
-
import { spawnSync } from "node:child_process";
|
|
1484
|
-
import fs from "node:fs";
|
|
1485
|
-
|
|
1486
|
-
// node_modules/.pnpm/package-manager-detector@1.3.0/node_modules/package-manager-detector/dist/commands.mjs
|
|
1396
|
+
// node_modules/.pnpm/package-manager-detector@1.6.0/node_modules/package-manager-detector/dist/commands.mjs
|
|
1487
1397
|
function dashDashArg(agent, agentCommand) {
|
|
1488
1398
|
return (args) => {
|
|
1489
1399
|
if (args.length > 1) {
|
|
@@ -1507,6 +1417,7 @@ var npm = {
|
|
|
1507
1417
|
"add": ["npm", "i", 0],
|
|
1508
1418
|
"upgrade": ["npm", "update", 0],
|
|
1509
1419
|
"upgrade-interactive": null,
|
|
1420
|
+
"dedupe": ["npm", "dedupe", 0],
|
|
1510
1421
|
"execute": ["npx", 0],
|
|
1511
1422
|
"execute-local": ["npx", 0],
|
|
1512
1423
|
"uninstall": ["npm", "uninstall", 0],
|
|
@@ -1521,6 +1432,7 @@ var yarn2 = {
|
|
|
1521
1432
|
"add": ["yarn", "add", 0],
|
|
1522
1433
|
"upgrade": ["yarn", "upgrade", 0],
|
|
1523
1434
|
"upgrade-interactive": ["yarn", "upgrade-interactive", 0],
|
|
1435
|
+
"dedupe": null,
|
|
1524
1436
|
"execute": ["npx", 0],
|
|
1525
1437
|
"execute-local": dashDashArg("yarn", "exec"),
|
|
1526
1438
|
"uninstall": ["yarn", "remove", 0],
|
|
@@ -1531,6 +1443,7 @@ var yarnBerry = {
|
|
|
1531
1443
|
"frozen": ["yarn", "install", "--immutable", 0],
|
|
1532
1444
|
"upgrade": ["yarn", "up", 0],
|
|
1533
1445
|
"upgrade-interactive": ["yarn", "up", "-i", 0],
|
|
1446
|
+
"dedupe": ["yarn", "dedupe", 0],
|
|
1534
1447
|
"execute": ["yarn", "dlx", 0],
|
|
1535
1448
|
"execute-local": ["yarn", "exec", 0],
|
|
1536
1449
|
// Yarn 2+ removed 'global', see https://github.com/yarnpkg/berry/issues/821
|
|
@@ -1546,6 +1459,7 @@ var pnpm2 = {
|
|
|
1546
1459
|
"add": ["pnpm", "add", 0],
|
|
1547
1460
|
"upgrade": ["pnpm", "update", 0],
|
|
1548
1461
|
"upgrade-interactive": ["pnpm", "update", "-i", 0],
|
|
1462
|
+
"dedupe": ["pnpm", "dedupe", 0],
|
|
1549
1463
|
"execute": ["pnpm", "dlx", 0],
|
|
1550
1464
|
"execute-local": ["pnpm", "exec", 0],
|
|
1551
1465
|
"uninstall": ["pnpm", "remove", 0],
|
|
@@ -1559,7 +1473,8 @@ var bun = {
|
|
|
1559
1473
|
"global": ["bun", "add", "-g", 0],
|
|
1560
1474
|
"add": ["bun", "add", 0],
|
|
1561
1475
|
"upgrade": ["bun", "update", 0],
|
|
1562
|
-
"upgrade-interactive": ["bun", "update", 0],
|
|
1476
|
+
"upgrade-interactive": ["bun", "update", "-i", 0],
|
|
1477
|
+
"dedupe": null,
|
|
1563
1478
|
"execute": ["bun", "x", 0],
|
|
1564
1479
|
"execute-local": ["bun", "x", 0],
|
|
1565
1480
|
"uninstall": ["bun", "remove", 0],
|
|
@@ -1574,6 +1489,7 @@ var deno = {
|
|
|
1574
1489
|
"add": ["deno", "add", 0],
|
|
1575
1490
|
"upgrade": ["deno", "outdated", "--update", 0],
|
|
1576
1491
|
"upgrade-interactive": ["deno", "outdated", "--update", 0],
|
|
1492
|
+
"dedupe": null,
|
|
1577
1493
|
"execute": denoExecute(),
|
|
1578
1494
|
"execute-local": ["deno", "task", "--eval", 0],
|
|
1579
1495
|
"uninstall": ["deno", "remove", 0],
|
|
@@ -1610,84 +1526,7 @@ function constructCommand(value, args) {
|
|
|
1610
1526
|
};
|
|
1611
1527
|
}
|
|
1612
1528
|
|
|
1613
|
-
//
|
|
1614
|
-
function detectPkgInfo() {
|
|
1615
|
-
const userAgent2 = process2.env.npm_config_user_agent;
|
|
1616
|
-
if (!userAgent2) {
|
|
1617
|
-
return void 0;
|
|
1618
|
-
}
|
|
1619
|
-
const pkgSpec = userAgent2.split(" ")[0];
|
|
1620
|
-
const pkgSpecArr = pkgSpec.split("/");
|
|
1621
|
-
return {
|
|
1622
|
-
name: pkgSpecArr[0],
|
|
1623
|
-
version: pkgSpecArr[1]
|
|
1624
|
-
};
|
|
1625
|
-
}
|
|
1626
|
-
function addPackageObject(key, entry, pkg, sort = true) {
|
|
1627
|
-
pkg[key] ??= {};
|
|
1628
|
-
if (!sort) {
|
|
1629
|
-
for (const [name, value] of entry) {
|
|
1630
|
-
pkg[key][name] = value;
|
|
1631
|
-
}
|
|
1632
|
-
return;
|
|
1633
|
-
}
|
|
1634
|
-
const entries = Object.entries(pkg[key]);
|
|
1635
|
-
pkg[key] = {};
|
|
1636
|
-
for (const [name, value] of entry) {
|
|
1637
|
-
entries.push([name, value]);
|
|
1638
|
-
}
|
|
1639
|
-
for (const [k, v] of entries.toSorted(([a], [b]) => a.localeCompare(b))) {
|
|
1640
|
-
pkg[key][k] = v;
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
function runCommand(pmDetection, command, args, cwd2) {
|
|
1644
|
-
let runCommand2 = "npm";
|
|
1645
|
-
let runArgs = [command];
|
|
1646
|
-
if (pmDetection) {
|
|
1647
|
-
const prepare = resolveCommand(pmDetection.name, command, args);
|
|
1648
|
-
runCommand2 = prepare.command;
|
|
1649
|
-
runArgs = prepare.args;
|
|
1650
|
-
}
|
|
1651
|
-
const run2 = spawnSync(
|
|
1652
|
-
runCommand2,
|
|
1653
|
-
runArgs.filter(Boolean),
|
|
1654
|
-
{
|
|
1655
|
-
cwd: cwd2,
|
|
1656
|
-
stdio: ["inherit", "inherit", "pipe"],
|
|
1657
|
-
shell: true
|
|
1658
|
-
}
|
|
1659
|
-
);
|
|
1660
|
-
if (run2.error) {
|
|
1661
|
-
throw run2.error;
|
|
1662
|
-
}
|
|
1663
|
-
}
|
|
1664
|
-
function editFile(file, callback, destination) {
|
|
1665
|
-
const content = fs.readFileSync(file, "utf8");
|
|
1666
|
-
fs.writeFileSync(destination ?? file, callback(content), "utf8");
|
|
1667
|
-
}
|
|
1668
|
-
function getPaths(rootPath, templateDir) {
|
|
1669
|
-
return [path.join(rootPath, "app"), templateDir];
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
// src/utils/nuxt/versions.ts
|
|
1673
|
-
var versions = {
|
|
1674
|
-
"vuetify": "^3.9.1",
|
|
1675
|
-
"typescript": "^5.8.3",
|
|
1676
|
-
"vue-tsc": "^3.2.0",
|
|
1677
|
-
"sass-embedded": "^1.89.2",
|
|
1678
|
-
"@vuetify/loader-shared": "^2.1.0",
|
|
1679
|
-
"vite-plugin-vuetify": "^2.1.1",
|
|
1680
|
-
"vuetify-nuxt-module": "^0.19.1",
|
|
1681
|
-
"upath": "^2.0.1",
|
|
1682
|
-
"@mdi/font": "^7.4.47",
|
|
1683
|
-
"@nuxt/fonts": "^0.11.4"
|
|
1684
|
-
};
|
|
1685
|
-
var versionsV4 = {
|
|
1686
|
-
...versions,
|
|
1687
|
-
vuetify: "^4.0.0-alpha.1"
|
|
1688
|
-
};
|
|
1689
|
-
|
|
1690
|
-
// node_modules/.pnpm/package-manager-detector@1.3.0/node_modules/package-manager-detector/dist/constants.mjs
|
|
1529
|
+
// node_modules/.pnpm/package-manager-detector@1.6.0/node_modules/package-manager-detector/dist/constants.mjs
|
|
1691
1530
|
var AGENTS = [
|
|
1692
1531
|
"npm",
|
|
1693
1532
|
"yarn",
|
|
@@ -1723,38 +1562,47 @@ var INSTALL_METADATA = {
|
|
|
1723
1562
|
"bun.lockb": "bun"
|
|
1724
1563
|
};
|
|
1725
1564
|
|
|
1726
|
-
// node_modules/.pnpm/package-manager-detector@1.
|
|
1727
|
-
import
|
|
1728
|
-
import
|
|
1729
|
-
import
|
|
1565
|
+
// node_modules/.pnpm/package-manager-detector@1.6.0/node_modules/package-manager-detector/dist/detect.mjs
|
|
1566
|
+
import fs from "node:fs/promises";
|
|
1567
|
+
import path from "node:path";
|
|
1568
|
+
import process2 from "node:process";
|
|
1730
1569
|
async function pathExists(path22, type) {
|
|
1731
1570
|
try {
|
|
1732
|
-
const stat = await
|
|
1571
|
+
const stat = await fs.stat(path22);
|
|
1733
1572
|
return type === "file" ? stat.isFile() : stat.isDirectory();
|
|
1734
1573
|
} catch {
|
|
1735
1574
|
return false;
|
|
1736
1575
|
}
|
|
1737
1576
|
}
|
|
1738
|
-
function
|
|
1739
|
-
|
|
1740
|
-
|
|
1577
|
+
function getUserAgent() {
|
|
1578
|
+
const userAgent2 = process2.env.npm_config_user_agent;
|
|
1579
|
+
if (!userAgent2) {
|
|
1580
|
+
return null;
|
|
1581
|
+
}
|
|
1582
|
+
const name = userAgent2.split("/")[0];
|
|
1583
|
+
return AGENTS.includes(name) ? name : null;
|
|
1584
|
+
}
|
|
1585
|
+
function* lookup(cwd2 = process2.cwd()) {
|
|
1586
|
+
let directory = path.resolve(cwd2);
|
|
1587
|
+
const { root } = path.parse(directory);
|
|
1741
1588
|
while (directory && directory !== root) {
|
|
1742
1589
|
yield directory;
|
|
1743
|
-
directory =
|
|
1590
|
+
directory = path.dirname(directory);
|
|
1744
1591
|
}
|
|
1745
1592
|
}
|
|
1746
|
-
async function parsePackageJson(filepath,
|
|
1747
|
-
|
|
1593
|
+
async function parsePackageJson(filepath, options) {
|
|
1594
|
+
if (!filepath || !await pathExists(filepath, "file"))
|
|
1595
|
+
return null;
|
|
1596
|
+
return await handlePackageManager(filepath, options);
|
|
1748
1597
|
}
|
|
1749
1598
|
async function detect(options = {}) {
|
|
1750
1599
|
const {
|
|
1751
1600
|
cwd: cwd2,
|
|
1752
|
-
strategies = ["lockfile", "packageManager-field", "devEngines-field"]
|
|
1753
|
-
onUnknown
|
|
1601
|
+
strategies = ["lockfile", "packageManager-field", "devEngines-field"]
|
|
1754
1602
|
} = options;
|
|
1755
1603
|
let stopDir;
|
|
1756
1604
|
if (typeof options.stopDir === "string") {
|
|
1757
|
-
const resolved =
|
|
1605
|
+
const resolved = path.resolve(options.stopDir);
|
|
1758
1606
|
stopDir = (dir) => dir === resolved;
|
|
1759
1607
|
} else {
|
|
1760
1608
|
stopDir = options.stopDir;
|
|
@@ -1764,9 +1612,9 @@ async function detect(options = {}) {
|
|
|
1764
1612
|
switch (strategy) {
|
|
1765
1613
|
case "lockfile": {
|
|
1766
1614
|
for (const lock of Object.keys(LOCKS)) {
|
|
1767
|
-
if (await pathExists(
|
|
1615
|
+
if (await pathExists(path.join(directory, lock), "file")) {
|
|
1768
1616
|
const name = LOCKS[lock];
|
|
1769
|
-
const result = await parsePackageJson(
|
|
1617
|
+
const result = await parsePackageJson(path.join(directory, "package.json"), options);
|
|
1770
1618
|
if (result)
|
|
1771
1619
|
return result;
|
|
1772
1620
|
else
|
|
@@ -1777,7 +1625,7 @@ async function detect(options = {}) {
|
|
|
1777
1625
|
}
|
|
1778
1626
|
case "packageManager-field":
|
|
1779
1627
|
case "devEngines-field": {
|
|
1780
|
-
const result = await parsePackageJson(
|
|
1628
|
+
const result = await parsePackageJson(path.join(directory, "package.json"), options);
|
|
1781
1629
|
if (result)
|
|
1782
1630
|
return result;
|
|
1783
1631
|
break;
|
|
@@ -1785,7 +1633,7 @@ async function detect(options = {}) {
|
|
|
1785
1633
|
case "install-metadata": {
|
|
1786
1634
|
for (const metadata of Object.keys(INSTALL_METADATA)) {
|
|
1787
1635
|
const fileOrDir = metadata.endsWith("/") ? "dir" : "file";
|
|
1788
|
-
if (await pathExists(
|
|
1636
|
+
if (await pathExists(path.join(directory, metadata), fileOrDir)) {
|
|
1789
1637
|
const name = INSTALL_METADATA[metadata];
|
|
1790
1638
|
const agent = name === "yarn" ? isMetadataYarnClassic(metadata) ? "yarn" : "yarn@berry" : name;
|
|
1791
1639
|
return { name, agent };
|
|
@@ -1814,9 +1662,10 @@ function getNameAndVer(pkg) {
|
|
|
1814
1662
|
}
|
|
1815
1663
|
return void 0;
|
|
1816
1664
|
}
|
|
1817
|
-
async function handlePackageManager(filepath,
|
|
1665
|
+
async function handlePackageManager(filepath, options) {
|
|
1818
1666
|
try {
|
|
1819
|
-
const
|
|
1667
|
+
const content = await fs.readFile(filepath, "utf8");
|
|
1668
|
+
const pkg = options.packageJsonParser ? await options.packageJsonParser(content, filepath) : JSON.parse(content);
|
|
1820
1669
|
let agent;
|
|
1821
1670
|
const nameAndVer = getNameAndVer(pkg);
|
|
1822
1671
|
if (nameAndVer) {
|
|
@@ -1834,7 +1683,7 @@ async function handlePackageManager(filepath, onUnknown) {
|
|
|
1834
1683
|
agent = name;
|
|
1835
1684
|
return { name, agent, version };
|
|
1836
1685
|
} else {
|
|
1837
|
-
return onUnknown?.(pkg.packageManager) ?? null;
|
|
1686
|
+
return options.onUnknown?.(pkg.packageManager) ?? null;
|
|
1838
1687
|
}
|
|
1839
1688
|
}
|
|
1840
1689
|
} catch {
|
|
@@ -1845,6 +1694,414 @@ function isMetadataYarnClassic(metadataPath) {
|
|
|
1845
1694
|
return metadataPath.endsWith(".yarn_integrity");
|
|
1846
1695
|
}
|
|
1847
1696
|
|
|
1697
|
+
// node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
|
|
1698
|
+
import * as tty from "node:tty";
|
|
1699
|
+
var {
|
|
1700
|
+
env = {},
|
|
1701
|
+
argv = [],
|
|
1702
|
+
platform = ""
|
|
1703
|
+
} = typeof process === "undefined" ? {} : process;
|
|
1704
|
+
var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
1705
|
+
var isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
1706
|
+
var isWindows = platform === "win32";
|
|
1707
|
+
var isDumbTerminal = env.TERM === "dumb";
|
|
1708
|
+
var isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
1709
|
+
var isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
1710
|
+
var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
1711
|
+
function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
|
|
1712
|
+
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
1713
|
+
}
|
|
1714
|
+
function clearBleed(index, string, open, close, replace) {
|
|
1715
|
+
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
1716
|
+
}
|
|
1717
|
+
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
1718
|
+
return (string) => string || !(string === "" || string === void 0) ? clearBleed(
|
|
1719
|
+
("" + string).indexOf(close, at),
|
|
1720
|
+
string,
|
|
1721
|
+
open,
|
|
1722
|
+
close,
|
|
1723
|
+
replace
|
|
1724
|
+
) : "";
|
|
1725
|
+
}
|
|
1726
|
+
function init(open, close, replace) {
|
|
1727
|
+
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
1728
|
+
}
|
|
1729
|
+
var colorDefs = {
|
|
1730
|
+
reset: init(0, 0),
|
|
1731
|
+
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
1732
|
+
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
1733
|
+
italic: init(3, 23),
|
|
1734
|
+
underline: init(4, 24),
|
|
1735
|
+
inverse: init(7, 27),
|
|
1736
|
+
hidden: init(8, 28),
|
|
1737
|
+
strikethrough: init(9, 29),
|
|
1738
|
+
black: init(30, 39),
|
|
1739
|
+
red: init(31, 39),
|
|
1740
|
+
green: init(32, 39),
|
|
1741
|
+
yellow: init(33, 39),
|
|
1742
|
+
blue: init(34, 39),
|
|
1743
|
+
magenta: init(35, 39),
|
|
1744
|
+
cyan: init(36, 39),
|
|
1745
|
+
white: init(37, 39),
|
|
1746
|
+
gray: init(90, 39),
|
|
1747
|
+
bgBlack: init(40, 49),
|
|
1748
|
+
bgRed: init(41, 49),
|
|
1749
|
+
bgGreen: init(42, 49),
|
|
1750
|
+
bgYellow: init(43, 49),
|
|
1751
|
+
bgBlue: init(44, 49),
|
|
1752
|
+
bgMagenta: init(45, 49),
|
|
1753
|
+
bgCyan: init(46, 49),
|
|
1754
|
+
bgWhite: init(47, 49),
|
|
1755
|
+
blackBright: init(90, 39),
|
|
1756
|
+
redBright: init(91, 39),
|
|
1757
|
+
greenBright: init(92, 39),
|
|
1758
|
+
yellowBright: init(93, 39),
|
|
1759
|
+
blueBright: init(94, 39),
|
|
1760
|
+
magentaBright: init(95, 39),
|
|
1761
|
+
cyanBright: init(96, 39),
|
|
1762
|
+
whiteBright: init(97, 39),
|
|
1763
|
+
bgBlackBright: init(100, 49),
|
|
1764
|
+
bgRedBright: init(101, 49),
|
|
1765
|
+
bgGreenBright: init(102, 49),
|
|
1766
|
+
bgYellowBright: init(103, 49),
|
|
1767
|
+
bgBlueBright: init(104, 49),
|
|
1768
|
+
bgMagentaBright: init(105, 49),
|
|
1769
|
+
bgCyanBright: init(106, 49),
|
|
1770
|
+
bgWhiteBright: init(107, 49)
|
|
1771
|
+
};
|
|
1772
|
+
function createColors(useColor = isColorSupported) {
|
|
1773
|
+
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
1774
|
+
}
|
|
1775
|
+
var colors = createColors();
|
|
1776
|
+
function getColor(color, fallback = "reset") {
|
|
1777
|
+
return colors[color] || colors[fallback];
|
|
1778
|
+
}
|
|
1779
|
+
var ansiRegex = [
|
|
1780
|
+
String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
|
|
1781
|
+
String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
|
|
1782
|
+
].join("|");
|
|
1783
|
+
function stripAnsi(text) {
|
|
1784
|
+
return text.replace(new RegExp(ansiRegex, "g"), "");
|
|
1785
|
+
}
|
|
1786
|
+
var boxStylePresets = {
|
|
1787
|
+
solid: {
|
|
1788
|
+
tl: "\u250C",
|
|
1789
|
+
tr: "\u2510",
|
|
1790
|
+
bl: "\u2514",
|
|
1791
|
+
br: "\u2518",
|
|
1792
|
+
h: "\u2500",
|
|
1793
|
+
v: "\u2502"
|
|
1794
|
+
},
|
|
1795
|
+
double: {
|
|
1796
|
+
tl: "\u2554",
|
|
1797
|
+
tr: "\u2557",
|
|
1798
|
+
bl: "\u255A",
|
|
1799
|
+
br: "\u255D",
|
|
1800
|
+
h: "\u2550",
|
|
1801
|
+
v: "\u2551"
|
|
1802
|
+
},
|
|
1803
|
+
doubleSingle: {
|
|
1804
|
+
tl: "\u2553",
|
|
1805
|
+
tr: "\u2556",
|
|
1806
|
+
bl: "\u2559",
|
|
1807
|
+
br: "\u255C",
|
|
1808
|
+
h: "\u2500",
|
|
1809
|
+
v: "\u2551"
|
|
1810
|
+
},
|
|
1811
|
+
doubleSingleRounded: {
|
|
1812
|
+
tl: "\u256D",
|
|
1813
|
+
tr: "\u256E",
|
|
1814
|
+
bl: "\u2570",
|
|
1815
|
+
br: "\u256F",
|
|
1816
|
+
h: "\u2500",
|
|
1817
|
+
v: "\u2551"
|
|
1818
|
+
},
|
|
1819
|
+
singleThick: {
|
|
1820
|
+
tl: "\u250F",
|
|
1821
|
+
tr: "\u2513",
|
|
1822
|
+
bl: "\u2517",
|
|
1823
|
+
br: "\u251B",
|
|
1824
|
+
h: "\u2501",
|
|
1825
|
+
v: "\u2503"
|
|
1826
|
+
},
|
|
1827
|
+
singleDouble: {
|
|
1828
|
+
tl: "\u2552",
|
|
1829
|
+
tr: "\u2555",
|
|
1830
|
+
bl: "\u2558",
|
|
1831
|
+
br: "\u255B",
|
|
1832
|
+
h: "\u2550",
|
|
1833
|
+
v: "\u2502"
|
|
1834
|
+
},
|
|
1835
|
+
singleDoubleRounded: {
|
|
1836
|
+
tl: "\u256D",
|
|
1837
|
+
tr: "\u256E",
|
|
1838
|
+
bl: "\u2570",
|
|
1839
|
+
br: "\u256F",
|
|
1840
|
+
h: "\u2550",
|
|
1841
|
+
v: "\u2502"
|
|
1842
|
+
},
|
|
1843
|
+
rounded: {
|
|
1844
|
+
tl: "\u256D",
|
|
1845
|
+
tr: "\u256E",
|
|
1846
|
+
bl: "\u2570",
|
|
1847
|
+
br: "\u256F",
|
|
1848
|
+
h: "\u2500",
|
|
1849
|
+
v: "\u2502"
|
|
1850
|
+
}
|
|
1851
|
+
};
|
|
1852
|
+
var defaultStyle = {
|
|
1853
|
+
borderColor: "white",
|
|
1854
|
+
borderStyle: "rounded",
|
|
1855
|
+
valign: "center",
|
|
1856
|
+
padding: 2,
|
|
1857
|
+
marginLeft: 1,
|
|
1858
|
+
marginTop: 1,
|
|
1859
|
+
marginBottom: 1
|
|
1860
|
+
};
|
|
1861
|
+
function box(text, _opts = {}) {
|
|
1862
|
+
const opts = {
|
|
1863
|
+
..._opts,
|
|
1864
|
+
style: {
|
|
1865
|
+
...defaultStyle,
|
|
1866
|
+
..._opts.style
|
|
1867
|
+
}
|
|
1868
|
+
};
|
|
1869
|
+
const textLines = text.split("\n");
|
|
1870
|
+
const boxLines = [];
|
|
1871
|
+
const _color = getColor(opts.style.borderColor);
|
|
1872
|
+
const borderStyle = {
|
|
1873
|
+
...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
|
|
1874
|
+
};
|
|
1875
|
+
if (_color) {
|
|
1876
|
+
for (const key in borderStyle) {
|
|
1877
|
+
borderStyle[key] = _color(
|
|
1878
|
+
borderStyle[key]
|
|
1879
|
+
);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
1883
|
+
const height = textLines.length + paddingOffset;
|
|
1884
|
+
const width = Math.max(
|
|
1885
|
+
...textLines.map((line) => stripAnsi(line).length),
|
|
1886
|
+
opts.title ? stripAnsi(opts.title).length : 0
|
|
1887
|
+
) + paddingOffset;
|
|
1888
|
+
const widthOffset = width + paddingOffset;
|
|
1889
|
+
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
1890
|
+
if (opts.style.marginTop > 0) {
|
|
1891
|
+
boxLines.push("".repeat(opts.style.marginTop));
|
|
1892
|
+
}
|
|
1893
|
+
if (opts.title) {
|
|
1894
|
+
const title = _color ? _color(opts.title) : opts.title;
|
|
1895
|
+
const left = borderStyle.h.repeat(
|
|
1896
|
+
Math.floor((width - stripAnsi(opts.title).length) / 2)
|
|
1897
|
+
);
|
|
1898
|
+
const right = borderStyle.h.repeat(
|
|
1899
|
+
width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
|
|
1900
|
+
);
|
|
1901
|
+
boxLines.push(
|
|
1902
|
+
`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`
|
|
1903
|
+
);
|
|
1904
|
+
} else {
|
|
1905
|
+
boxLines.push(
|
|
1906
|
+
`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
|
|
1907
|
+
);
|
|
1908
|
+
}
|
|
1909
|
+
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
1910
|
+
for (let i = 0; i < height; i++) {
|
|
1911
|
+
if (i < valignOffset || i >= valignOffset + textLines.length) {
|
|
1912
|
+
boxLines.push(
|
|
1913
|
+
`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
|
|
1914
|
+
);
|
|
1915
|
+
} else {
|
|
1916
|
+
const line = textLines[i - valignOffset];
|
|
1917
|
+
const left = " ".repeat(paddingOffset);
|
|
1918
|
+
const right = " ".repeat(width - stripAnsi(line).length);
|
|
1919
|
+
boxLines.push(
|
|
1920
|
+
`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
|
|
1921
|
+
);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
boxLines.push(
|
|
1925
|
+
`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
|
|
1926
|
+
);
|
|
1927
|
+
if (opts.style.marginBottom > 0) {
|
|
1928
|
+
boxLines.push("".repeat(opts.style.marginBottom));
|
|
1929
|
+
}
|
|
1930
|
+
return boxLines.join("\n");
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
// src/utils/banner.ts
|
|
1934
|
+
function supportsColor() {
|
|
1935
|
+
const testText = "test";
|
|
1936
|
+
const coloredText = blue(testText);
|
|
1937
|
+
return coloredText !== testText;
|
|
1938
|
+
}
|
|
1939
|
+
function createBanner() {
|
|
1940
|
+
if (!supportsColor()) {
|
|
1941
|
+
return createPlainBanner();
|
|
1942
|
+
}
|
|
1943
|
+
return "\x1B[38;2;22;151;246mV\x1B[39m\x1B[38;2;22;147;242mu\x1B[39m\x1B[38;2;22;144;238me\x1B[39m\x1B[38;2;22;140;234mt\x1B[39m\x1B[38;2;23;136;229mi\x1B[39m\x1B[38;2;23;133;225mf\x1B[39m\x1B[38;2;23;129;221my\x1B[39m\x1B[38;2;23;125;217m.\x1B[39m\x1B[38;2;23;121;213mj\x1B[39m\x1B[38;2;23;118;209ms\x1B[39m \x1B[38;2;24;114;204m-\x1B[39m \x1B[38;2;24;110;200mM\x1B[39m\x1B[38;2;24;107;196ma\x1B[39m\x1B[38;2;24;103;192mt\x1B[39m\x1B[38;2;32;110;197me\x1B[39m\x1B[38;2;39;118;202mr\x1B[39m\x1B[38;2;47;125;207mi\x1B[39m\x1B[38;2;54;132;211ma\x1B[39m\x1B[38;2;62;140;216ml\x1B[39m \x1B[38;2;70;147;221mC\x1B[39m\x1B[38;2;77;154;226mo\x1B[39m\x1B[38;2;85;161;231mm\x1B[39m\x1B[38;2;93;169;236mp\x1B[39m\x1B[38;2;100;176;240mo\x1B[39m\x1B[38;2;108;183;245mn\x1B[39m\x1B[38;2;115;191;250me\x1B[39m\x1B[38;2;123;198;255mn\x1B[39m\x1B[38;2;126;199;255mt\x1B[39m \x1B[38;2;129;201;255mF\x1B[39m\x1B[38;2;133;202;255mr\x1B[39m\x1B[38;2;136;204;255ma\x1B[39m\x1B[38;2;139;205;255mm\x1B[39m\x1B[38;2;142;207;255me\x1B[39m\x1B[38;2;145;208;255mw\x1B[39m\x1B[38;2;149;210;255mo\x1B[39m\x1B[38;2;152;211;255mr\x1B[39m\x1B[38;2;155;212;255mk\x1B[39m \x1B[38;2;158;214;255mf\x1B[39m\x1B[38;2;161;215;255mo\x1B[39m\x1B[38;2;164;217;255mr\x1B[39m \x1B[38;2;168;218;255mV\x1B[39m\x1B[38;2;171;220;255mu\x1B[39m\x1B[38;2;174;221;255me\x1B[39m";
|
|
1944
|
+
}
|
|
1945
|
+
function createPlainBanner() {
|
|
1946
|
+
return "Vuetify - Vue Component Framework";
|
|
1947
|
+
}
|
|
1948
|
+
function createBetaBanner() {
|
|
1949
|
+
const packageManager2 = getUserAgent();
|
|
1950
|
+
return box(`${packageManager2 ?? "npm"} create vuetify@beta`, { title: "Try new vuetify-create with better customization and presets support!", style: { borderColor: "blueBright" } });
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
// src/utils/deepMerge.ts
|
|
1954
|
+
var isObject = (v) => {
|
|
1955
|
+
return v === Object(v) && v !== null && !Array.isArray(v);
|
|
1956
|
+
};
|
|
1957
|
+
var deepMerge = (...sources) => sources.reduce((acc, curr) => {
|
|
1958
|
+
for (const key of Object.keys(curr)) {
|
|
1959
|
+
if (Array.isArray(acc[key]) && Array.isArray(curr[key])) {
|
|
1960
|
+
acc[key] = Array.from(new Set(acc[key].concat(curr[key])));
|
|
1961
|
+
} else if (isObject(acc[key]) && isObject(curr[key])) {
|
|
1962
|
+
acc[key] = deepMerge(acc[key], curr[key]);
|
|
1963
|
+
} else {
|
|
1964
|
+
acc[key] = curr[key];
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
return acc;
|
|
1968
|
+
}, {});
|
|
1969
|
+
|
|
1970
|
+
// src/utils/renderTemplate.ts
|
|
1971
|
+
import { copyFileSync, mkdirSync, readdirSync as readdirSync3, readFileSync, statSync, writeFileSync, existsSync as existsSync4 } from "node:fs";
|
|
1972
|
+
import { basename as basename2, dirname as dirname2, extname as extname2, resolve as resolve5 } from "node:path";
|
|
1973
|
+
function mergePkg(source, destination) {
|
|
1974
|
+
const target = existsSync4(destination) ? JSON.parse(readFileSync(destination, "utf8")) : {};
|
|
1975
|
+
const src = JSON.parse(readFileSync(source, "utf8"));
|
|
1976
|
+
const mergedPkg = deepMerge(target, src);
|
|
1977
|
+
const keysToSort = ["devDependencies", "dependencies"];
|
|
1978
|
+
for (const k of keysToSort) {
|
|
1979
|
+
if (mergedPkg[k]) {
|
|
1980
|
+
mergedPkg[k] = Object.keys(mergedPkg[k]).toSorted().reduce((a, c) => (a[c] = mergedPkg[k][c], a), {});
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
writeFileSync(destination, JSON.stringify(mergedPkg, null, 2) + "\n");
|
|
1984
|
+
}
|
|
1985
|
+
function renderDirectory(source, destination, options) {
|
|
1986
|
+
mkdirSync(destination, { recursive: true });
|
|
1987
|
+
for (const path4 of readdirSync3(source)) {
|
|
1988
|
+
renderTemplate(resolve5(source, path4), resolve5(destination, path4), options);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
var binaryExtensions = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".gif", ".ico", ".woff", ".woff2", ".ttf", ".eot", ".svg"]);
|
|
1992
|
+
function renderFile(source, destination, options) {
|
|
1993
|
+
const filename = basename2(source);
|
|
1994
|
+
if (filename.startsWith("_")) {
|
|
1995
|
+
destination = resolve5(dirname2(destination), filename.replace("_", "."));
|
|
1996
|
+
}
|
|
1997
|
+
if (filename === "package.json") {
|
|
1998
|
+
mergePkg(source, destination);
|
|
1999
|
+
return;
|
|
2000
|
+
}
|
|
2001
|
+
if (options?.replace && !binaryExtensions.has(extname2(filename))) {
|
|
2002
|
+
let content = readFileSync(source, "utf8");
|
|
2003
|
+
for (const [key, value] of Object.entries(options.replace)) {
|
|
2004
|
+
content = content.replaceAll(key, value);
|
|
2005
|
+
}
|
|
2006
|
+
writeFileSync(destination, content);
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
copyFileSync(source, destination);
|
|
2010
|
+
}
|
|
2011
|
+
function renderTemplate(source, destination, options) {
|
|
2012
|
+
if (statSync(source).isDirectory()) {
|
|
2013
|
+
renderDirectory(source, destination, options);
|
|
2014
|
+
} else {
|
|
2015
|
+
renderFile(source, destination, options);
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
// src/utils/nuxt/renderNuxtTemplate.ts
|
|
2020
|
+
import fs3 from "node:fs";
|
|
2021
|
+
import path3 from "node:path";
|
|
2022
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
2023
|
+
|
|
2024
|
+
// src/utils/nuxt/utils.ts
|
|
2025
|
+
import process3 from "node:process";
|
|
2026
|
+
import path2 from "node:path";
|
|
2027
|
+
import { spawnSync } from "node:child_process";
|
|
2028
|
+
import fs2 from "node:fs";
|
|
2029
|
+
function detectPkgInfo() {
|
|
2030
|
+
const userAgent2 = process3.env.npm_config_user_agent;
|
|
2031
|
+
if (!userAgent2) {
|
|
2032
|
+
return void 0;
|
|
2033
|
+
}
|
|
2034
|
+
const pkgSpec = userAgent2.split(" ")[0];
|
|
2035
|
+
const pkgSpecArr = pkgSpec.split("/");
|
|
2036
|
+
return {
|
|
2037
|
+
name: pkgSpecArr[0],
|
|
2038
|
+
version: pkgSpecArr[1]
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
function addPackageObject(key, entry, pkg, sort = true) {
|
|
2042
|
+
pkg[key] ??= {};
|
|
2043
|
+
if (!sort) {
|
|
2044
|
+
for (const [name, value] of entry) {
|
|
2045
|
+
pkg[key][name] = value;
|
|
2046
|
+
}
|
|
2047
|
+
return;
|
|
2048
|
+
}
|
|
2049
|
+
const entries = Object.entries(pkg[key]);
|
|
2050
|
+
pkg[key] = {};
|
|
2051
|
+
for (const [name, value] of entry) {
|
|
2052
|
+
entries.push([name, value]);
|
|
2053
|
+
}
|
|
2054
|
+
for (const [k, v] of entries.toSorted(([a], [b]) => a.localeCompare(b))) {
|
|
2055
|
+
pkg[key][k] = v;
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
function runCommand(pmDetection, command, args, cwd2) {
|
|
2059
|
+
let runCommand2 = "npm";
|
|
2060
|
+
let runArgs = [command];
|
|
2061
|
+
if (pmDetection) {
|
|
2062
|
+
const prepare = resolveCommand(pmDetection.name, command, args);
|
|
2063
|
+
runCommand2 = prepare.command;
|
|
2064
|
+
runArgs = prepare.args;
|
|
2065
|
+
}
|
|
2066
|
+
const run2 = spawnSync(
|
|
2067
|
+
runCommand2,
|
|
2068
|
+
runArgs.filter(Boolean),
|
|
2069
|
+
{
|
|
2070
|
+
cwd: cwd2,
|
|
2071
|
+
stdio: ["inherit", "inherit", "pipe"],
|
|
2072
|
+
shell: true
|
|
2073
|
+
}
|
|
2074
|
+
);
|
|
2075
|
+
if (run2.error) {
|
|
2076
|
+
throw run2.error;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
function editFile(file, callback, destination) {
|
|
2080
|
+
const content = fs2.readFileSync(file, "utf8");
|
|
2081
|
+
fs2.writeFileSync(destination ?? file, callback(content), "utf8");
|
|
2082
|
+
}
|
|
2083
|
+
function getPaths(rootPath, templateDir) {
|
|
2084
|
+
return [path2.join(rootPath, "app"), templateDir];
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
// src/utils/nuxt/versions.ts
|
|
2088
|
+
var versions = {
|
|
2089
|
+
"vuetify": "^3.11.8",
|
|
2090
|
+
"typescript": "^5.8.3",
|
|
2091
|
+
"vue-tsc": "^3.2.0",
|
|
2092
|
+
"sass-embedded": "^1.89.2",
|
|
2093
|
+
"@vuetify/loader-shared": "^2.1.0",
|
|
2094
|
+
"vite-plugin-vuetify": "^2.1.3",
|
|
2095
|
+
"vuetify-nuxt-module": "^0.19.4",
|
|
2096
|
+
"upath": "^2.0.1",
|
|
2097
|
+
"@mdi/font": "^7.4.47",
|
|
2098
|
+
"@nuxt/fonts": "^0.11.4"
|
|
2099
|
+
};
|
|
2100
|
+
var versionsV4 = {
|
|
2101
|
+
...versions,
|
|
2102
|
+
vuetify: "^4.0.0-beta.1"
|
|
2103
|
+
};
|
|
2104
|
+
|
|
1848
2105
|
// src/utils/nuxt/renderNuxtTemplate.ts
|
|
1849
2106
|
import { generateCode, parseModule } from "magicast";
|
|
1850
2107
|
import { addNuxtModule, getDefaultExportOptions } from "magicast/helpers";
|
|
@@ -2117,10 +2374,11 @@ function prepareProject(ctx) {
|
|
|
2117
2374
|
async function run() {
|
|
2118
2375
|
const args = process.argv.slice(2).slice();
|
|
2119
2376
|
const banner = createBanner();
|
|
2377
|
+
const betaBanner = createBetaBanner();
|
|
2120
2378
|
if (args.length === 0) {
|
|
2121
2379
|
console.log(`
|
|
2122
2380
|
${banner}
|
|
2123
|
-
`);
|
|
2381
|
+
${betaBanner}`);
|
|
2124
2382
|
const initialContext2 = {
|
|
2125
2383
|
canOverwrite: false,
|
|
2126
2384
|
cwd: process.cwd(),
|
|
@@ -2141,7 +2399,7 @@ ${banner}
|
|
|
2141
2399
|
}
|
|
2142
2400
|
console.log(`
|
|
2143
2401
|
${banner}
|
|
2144
|
-
`);
|
|
2402
|
+
${betaBanner}`);
|
|
2145
2403
|
const cliContext = cliOptionsToContext(cliOptions, process.cwd());
|
|
2146
2404
|
const initialContext = {
|
|
2147
2405
|
cwd: cliContext.cwd,
|
|
@@ -2199,7 +2457,7 @@ async function createProject(finalContext) {
|
|
|
2199
2457
|
const jsOrTs = useTypeScript ? "typescript" : "javascript";
|
|
2200
2458
|
const templatePath = resolve6(dirname3(fileURLToPath(import.meta.url)), "../template", jsOrTs);
|
|
2201
2459
|
const replace = {
|
|
2202
|
-
"{{VUETIFY_VERSION}}": finalContext.vuetifyVersion === "4.x" ? "4 (
|
|
2460
|
+
"{{VUETIFY_VERSION}}": finalContext.vuetifyVersion === "4.x" ? "4 (Beta)" : "3"
|
|
2203
2461
|
};
|
|
2204
2462
|
renderTemplate(resolve6(templatePath, "default"), projectRoot, { replace });
|
|
2205
2463
|
if (["base", "essentials"].includes(usePreset)) {
|
|
@@ -2208,11 +2466,6 @@ async function createProject(finalContext) {
|
|
|
2208
2466
|
if (["essentials", "recommended"].includes(usePreset)) {
|
|
2209
2467
|
renderTemplate(resolve6(templatePath, "essentials"), projectRoot, { replace });
|
|
2210
2468
|
}
|
|
2211
|
-
if (usePackageManager && installDeps) {
|
|
2212
|
-
console.log(`\u25CC Installing dependencies with ${usePackageManager}...
|
|
2213
|
-
`);
|
|
2214
|
-
await installDependencies2(projectRoot, usePackageManager);
|
|
2215
|
-
}
|
|
2216
2469
|
if (finalContext.vuetifyVersion === "4.x") {
|
|
2217
2470
|
const packageJsonPath = resolve6(projectRoot, "package.json");
|
|
2218
2471
|
const packageJson = JSON.parse(readFileSync2(packageJsonPath, "utf8"));
|
|
@@ -2221,6 +2474,11 @@ async function createProject(finalContext) {
|
|
|
2221
2474
|
}
|
|
2222
2475
|
writeFileSync2(packageJsonPath, JSON.stringify(packageJson, null, 2) + "\n");
|
|
2223
2476
|
}
|
|
2477
|
+
if (usePackageManager && installDeps) {
|
|
2478
|
+
console.log(`\u25CC Installing dependencies with ${usePackageManager}...
|
|
2479
|
+
`);
|
|
2480
|
+
await installDependencies2(projectRoot, usePackageManager);
|
|
2481
|
+
}
|
|
2224
2482
|
}
|
|
2225
2483
|
console.log(`
|
|
2226
2484
|
${projectName} has been generated at ${projectRoot}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vuetify",
|
|
3
|
-
"version": "2.8.0
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"author": "Elijah Kotyluk <elijah@elijahkotyluk.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,10 +41,11 @@
|
|
|
41
41
|
"components"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
+
"consola": "^3.4.2",
|
|
44
45
|
"kolorist": "^1.8.0",
|
|
45
46
|
"magicast": "^0.3.5",
|
|
46
47
|
"minimist": "^1.2.8",
|
|
47
|
-
"package-manager-detector": "^1.
|
|
48
|
+
"package-manager-detector": "^1.6.0",
|
|
48
49
|
"prompts": "^2.4.2",
|
|
49
50
|
"tinyexec": "^1.0.1",
|
|
50
51
|
"validate-npm-package-name": "^6.0.2"
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@mdi/font": "7.4.47",
|
|
12
12
|
"@fontsource/roboto": "5.2.7",
|
|
13
|
-
"vue": "^3.5.
|
|
14
|
-
"vuetify": "^3.
|
|
13
|
+
"vue": "^3.5.28",
|
|
14
|
+
"vuetify": "^3.11.8"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
18
18
|
"sass-embedded": "^1.92.1",
|
|
19
19
|
"unplugin-fonts": "^1.4.0",
|
|
20
20
|
"unplugin-vue-components": "^29.0.0",
|
|
21
|
-
"vite-plugin-vuetify": "^2.1.
|
|
21
|
+
"vite-plugin-vuetify": "^2.1.3",
|
|
22
22
|
"vite": "^7.1.5"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@mdi/font": "7.4.47",
|
|
14
14
|
"@fontsource/roboto": "5.2.7",
|
|
15
|
-
"vue": "^3.5.
|
|
16
|
-
"vuetify": "^3.
|
|
15
|
+
"vue": "^3.5.28",
|
|
16
|
+
"vuetify": "^3.11.8"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@tsconfig/node22": "^22.0.0",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typescript": "~5.9.2",
|
|
26
26
|
"unplugin-fonts": "^1.4.0",
|
|
27
27
|
"unplugin-vue-components": "^29.0.0",
|
|
28
|
-
"vite-plugin-vuetify": "^2.1.
|
|
28
|
+
"vite-plugin-vuetify": "^2.1.3",
|
|
29
29
|
"vite": "^7.1.5",
|
|
30
30
|
"vue-tsc": "^3.2.0"
|
|
31
31
|
}
|