@vuetify/cli 0.0.2 → 0.0.3
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.js +15 -109
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -30756,18 +30756,18 @@ const hasEslintConfig = await tryResolvePackage(ESLINT_CONFIG);
|
|
|
30756
30756
|
const isEslintVersionValid = isVersionAtLeast(eslintVersion, "9.5.0");
|
|
30757
30757
|
const isEslintSupportsConcurrency = isVersionAtLeast(eslintVersion, "9.34.0");
|
|
30758
30758
|
const isConfigVersionValid = isVersionAtLeast(configVersion, "4.0.0");
|
|
30759
|
-
const packagesToInstall
|
|
30760
|
-
const packagesToUpgrade
|
|
30761
|
-
function getActionMessage
|
|
30759
|
+
const packagesToInstall = [...hasEslint ? [] : [ESLINT], ...hasEslintConfig ? [] : [ESLINT_CONFIG]];
|
|
30760
|
+
const packagesToUpgrade = [...isEslintVersionValid ? [] : [ESLINT], ...isConfigVersionValid ? [] : [ESLINT_CONFIG]];
|
|
30761
|
+
function getActionMessage() {
|
|
30762
30762
|
const actions = [];
|
|
30763
|
-
if (packagesToInstall
|
|
30764
|
-
const pkgs = packagesToInstall
|
|
30763
|
+
if (packagesToInstall.length > 0) {
|
|
30764
|
+
const pkgs = packagesToInstall.map((pkg) => LINKS[pkg]).join(", ");
|
|
30765
30765
|
actions.push(i18n.t("commands.eslint.action.install", { pkgs }));
|
|
30766
30766
|
}
|
|
30767
|
-
if (packagesToUpgrade
|
|
30768
|
-
const pkgs = packagesToUpgrade
|
|
30767
|
+
if (packagesToUpgrade.length > 0) {
|
|
30768
|
+
const pkgs = packagesToUpgrade.map((pkg) => LINKS[pkg]).join(", ");
|
|
30769
30769
|
const upgradeAction = i18n.t("commands.eslint.action.upgrade", { pkgs });
|
|
30770
|
-
if (packagesToInstall
|
|
30770
|
+
if (packagesToInstall.length > 0) actions.push(`${i18n.t("common.and")} ${upgradeAction}`);
|
|
30771
30771
|
else actions.push(upgradeAction);
|
|
30772
30772
|
}
|
|
30773
30773
|
if (hasEslint || hasEslintConfig) {
|
|
@@ -30788,14 +30788,14 @@ async function addEslint() {
|
|
|
30788
30788
|
".mts",
|
|
30789
30789
|
".cts"
|
|
30790
30790
|
] });
|
|
30791
|
-
if (packagesToInstall
|
|
30792
|
-
M.info(getActionMessage
|
|
30791
|
+
if (packagesToInstall.length > 0 || packagesToUpgrade.length > 0) {
|
|
30792
|
+
M.info(getActionMessage());
|
|
30793
30793
|
if (await ye({ message: i18n.t("prompts.proceed") }) === true) {
|
|
30794
30794
|
const s$9 = Y();
|
|
30795
30795
|
s$9.start(i18n.t("spinners.eslint.installing_deps"));
|
|
30796
|
-
if (packagesToInstall
|
|
30797
|
-
if (packagesToUpgrade
|
|
30798
|
-
const upgradeCommand = resolveCommand((await getPackageManager()).agent, "upgrade", packagesToUpgrade
|
|
30796
|
+
if (packagesToInstall.length > 0) await addDevDependency(packagesToInstall, { silent: true });
|
|
30797
|
+
if (packagesToUpgrade.length > 0) {
|
|
30798
|
+
const upgradeCommand = resolveCommand((await getPackageManager()).agent, "upgrade", packagesToUpgrade);
|
|
30799
30799
|
await ve(upgradeCommand.command, upgradeCommand.args.concat(["--silent"]));
|
|
30800
30800
|
}
|
|
30801
30801
|
s$9.stop(i18n.t("spinners.eslint.deps_installed"));
|
|
@@ -31086,100 +31086,9 @@ async function upgradeSelf(pkgName) {
|
|
|
31086
31086
|
}
|
|
31087
31087
|
}
|
|
31088
31088
|
|
|
31089
|
-
//#endregion
|
|
31090
|
-
//#region ../shared/src/functions/unocss-next.ts
|
|
31091
|
-
const UNOCSS = "unocss";
|
|
31092
|
-
const UNOCSS_NEXT = "@unocss/next";
|
|
31093
|
-
const unoVersion = await getPackageVersion(UNOCSS);
|
|
31094
|
-
const unoNextVersion = await getPackageVersion(UNOCSS_NEXT);
|
|
31095
|
-
const hasUno = await tryResolvePackage(UNOCSS);
|
|
31096
|
-
const hasUnoNext = await tryResolvePackage(UNOCSS_NEXT);
|
|
31097
|
-
const packagesToInstall = [...hasUno ? [] : [UNOCSS], ...hasUnoNext ? [] : [UNOCSS_NEXT]];
|
|
31098
|
-
const packagesToUpgrade = [...unoVersion === "0.0.0" ? [] : [], ...unoNextVersion === "0.0.0" ? [] : []];
|
|
31099
|
-
function getActionMessage() {
|
|
31100
|
-
const actions = [];
|
|
31101
|
-
if (packagesToInstall.length > 0) {
|
|
31102
|
-
const pkgs = packagesToInstall.join(", ");
|
|
31103
|
-
actions.push(`install ${pkgs}`);
|
|
31104
|
-
}
|
|
31105
|
-
if (packagesToUpgrade.length > 0) {
|
|
31106
|
-
const upgradeAction = `upgrade ${packagesToUpgrade.join(", ")}`;
|
|
31107
|
-
if (packagesToInstall.length > 0) actions.push(`${i18n.t("common.and")} ${upgradeAction}`);
|
|
31108
|
-
else actions.push(upgradeAction);
|
|
31109
|
-
}
|
|
31110
|
-
if (hasUno || hasUnoNext) {
|
|
31111
|
-
actions.push(`(Currently:`);
|
|
31112
|
-
if (hasUno) actions.push(` ${UNOCSS}: ${unoVersion}`);
|
|
31113
|
-
if (hasUnoNext) actions.push(` ${UNOCSS_NEXT}: ${unoNextVersion}`);
|
|
31114
|
-
actions.push(")");
|
|
31115
|
-
}
|
|
31116
|
-
return i18n.t("commands.eslint.need_to", { actions: actions.join(" ") });
|
|
31117
|
-
}
|
|
31118
|
-
async function addNextUnoCSS() {
|
|
31119
|
-
Ie("Add UnoCSS integration for Next.js");
|
|
31120
|
-
const unoConfigUrl = tryResolveFilePath("uno.config", { extensions: [
|
|
31121
|
-
".ts",
|
|
31122
|
-
".js",
|
|
31123
|
-
".mjs",
|
|
31124
|
-
".cjs"
|
|
31125
|
-
] });
|
|
31126
|
-
const nextConfigUrl = tryResolveFilePath("next.config", { extensions: [
|
|
31127
|
-
".mjs",
|
|
31128
|
-
".js",
|
|
31129
|
-
".ts",
|
|
31130
|
-
".cjs"
|
|
31131
|
-
] });
|
|
31132
|
-
if (packagesToInstall.length > 0 || packagesToUpgrade.length > 0) {
|
|
31133
|
-
M.info(getActionMessage());
|
|
31134
|
-
if (await ye({ message: i18n.t("prompts.proceed") }) === true) {
|
|
31135
|
-
const s$9 = Y();
|
|
31136
|
-
s$9.start("Installing UnoCSS dependencies...");
|
|
31137
|
-
if (packagesToInstall.length > 0) await addDevDependency(packagesToInstall, { silent: true });
|
|
31138
|
-
if (packagesToUpgrade.length > 0) {
|
|
31139
|
-
const upgradeCommand = resolveCommand((await getPackageManager()).agent, "upgrade", packagesToUpgrade);
|
|
31140
|
-
await ve(upgradeCommand.command, upgradeCommand.args.concat(["--silent"]));
|
|
31141
|
-
}
|
|
31142
|
-
s$9.stop("Dependencies installed!");
|
|
31143
|
-
}
|
|
31144
|
-
}
|
|
31145
|
-
let overwriteUnoConfig = false;
|
|
31146
|
-
overwriteUnoConfig = await (unoConfigUrl ? ye({ message: `Found ${relative(process.cwd(), unoConfigUrl)}. Do you want to overwrite it?` }) : ye({ message: "No uno.config found. Do you want to create one?" }));
|
|
31147
|
-
if (overwriteUnoConfig === true) {
|
|
31148
|
-
const s$9 = Y();
|
|
31149
|
-
s$9.start("Setting up UnoCSS config...");
|
|
31150
|
-
await writeFile(unoConfigUrl ?? "uno.config.ts", `import { defineConfig, presetUno, presetIcons, presetAttributify } from 'unocss'
|
|
31151
|
-
|
|
31152
|
-
export default defineConfig({
|
|
31153
|
-
presets: [
|
|
31154
|
-
presetUno(),
|
|
31155
|
-
presetAttributify(),
|
|
31156
|
-
presetIcons(),
|
|
31157
|
-
],
|
|
31158
|
-
})
|
|
31159
|
-
`);
|
|
31160
|
-
s$9.stop("UnoCSS config setup complete!");
|
|
31161
|
-
}
|
|
31162
|
-
let overwriteNextConfig = false;
|
|
31163
|
-
overwriteNextConfig = await (nextConfigUrl ? ye({ message: `Found ${relative(process.cwd(), nextConfigUrl)}. Do you want to overwrite it to enable UnoCSS?` }) : ye({ message: "No next.config found. Do you want to create one with UnoCSS?" }));
|
|
31164
|
-
if (overwriteNextConfig === true) {
|
|
31165
|
-
const s$9 = Y();
|
|
31166
|
-
s$9.start("Setting up Next.js config with UnoCSS...");
|
|
31167
|
-
await writeFile(nextConfigUrl ?? "next.config.mjs", `import { withUnoCSS } from '@unocss/next'
|
|
31168
|
-
|
|
31169
|
-
const nextConfig = {}
|
|
31170
|
-
|
|
31171
|
-
export default withUnoCSS(nextConfig)
|
|
31172
|
-
`);
|
|
31173
|
-
s$9.stop("Next.js config setup complete!");
|
|
31174
|
-
}
|
|
31175
|
-
const pkgJson = await readPackage(await findPackage());
|
|
31176
|
-
if (Boolean(pkgJson?.name)) M.info("Tip: consider adding UnoCSS reset in your global CSS (e.g. @unocss/reset/tailwind-compat.css).");
|
|
31177
|
-
Se(i18n.t("messages.all_done"));
|
|
31178
|
-
}
|
|
31179
|
-
|
|
31180
31089
|
//#endregion
|
|
31181
31090
|
//#region ../shared/src/commands/add.ts
|
|
31182
|
-
const choices = ["eslint"
|
|
31091
|
+
const choices = ["eslint"];
|
|
31183
31092
|
const add = defineCommand({
|
|
31184
31093
|
meta: {
|
|
31185
31094
|
name: "add",
|
|
@@ -31206,9 +31115,6 @@ const add = defineCommand({
|
|
|
31206
31115
|
case "eslint":
|
|
31207
31116
|
addEslint();
|
|
31208
31117
|
break;
|
|
31209
|
-
case "next:unocss":
|
|
31210
|
-
addNextUnoCSS();
|
|
31211
|
-
break;
|
|
31212
31118
|
}
|
|
31213
31119
|
}
|
|
31214
31120
|
});
|
|
@@ -31227,7 +31133,7 @@ function commandUpgradeFabric(pkgName) {
|
|
|
31227
31133
|
|
|
31228
31134
|
//#endregion
|
|
31229
31135
|
//#region package.json
|
|
31230
|
-
var version = "0.0.
|
|
31136
|
+
var version = "0.0.2";
|
|
31231
31137
|
|
|
31232
31138
|
//#endregion
|
|
31233
31139
|
//#region ../shared/src/args.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuetify/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Vuetify CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"nypm": "^0.6.2",
|
|
17
17
|
"open": "^10.2.0",
|
|
18
18
|
"tsdown": "^0.15.11",
|
|
19
|
-
"@vuetify/cli-shared": "0.0.
|
|
19
|
+
"@vuetify/cli-shared": "0.0.3"
|
|
20
20
|
},
|
|
21
21
|
"main": "./dist/index.js",
|
|
22
22
|
"module": "./dist/index.js",
|