chore(cli): replace chalk with picocolors (#10777)

This commit is contained in:
neverland
2022-07-02 22:51:53 +08:00
committed by GitHub
parent 8256fdc927
commit 28e8b72ccd
6 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -37,11 +37,11 @@
"typescript": "^4.7.4"
},
"dependencies": {
"chalk": "^4.1.2",
"consola": "^2.11.3",
"fast-glob": "^3.2.4",
"fs-extra": "^10.0.0",
"inquirer": "^8.0.0"
"inquirer": "^8.0.0",
"picocolors": "^1.0.0"
},
"release-it": {
"git": {
@@ -1,6 +1,6 @@
import fs from 'fs-extra';
import glob from 'fast-glob';
import chalk from 'chalk';
import color from 'picocolors';
import consola from 'consola';
import { prompt } from 'inquirer';
import { sep, join } from 'path';
@@ -64,7 +64,7 @@ export class VanGenerator {
writing() {
console.log();
consola.info(`Creating project in ${chalk.green(this.outputDir)}\n`);
consola.info(`Creating project in ${color.green(this.outputDir)}\n`);
// see https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows
const templatePath = join(GENERATOR_DIR, this.inputs.vueVersion).replace(
@@ -99,16 +99,16 @@ export class VanGenerator {
fs.writeFileSync(to, content);
const name = to.replace(this.outputDir + sep, '');
consola.success(`${chalk.green('create')} ${name}`);
consola.success(`${color.green('create')} ${name}`);
}
end() {
const { name } = this.inputs;
console.log();
consola.success(`Successfully created ${chalk.yellow(name)}.`);
consola.success(`Successfully created ${color.yellow(name)}.`);
consola.success(
`Run ${chalk.yellow(
`Run ${color.yellow(
`cd ${name} && git init && yarn && yarn dev`
)} to start development!`
);
+1 -1
View File
@@ -61,7 +61,6 @@
"@vitejs/plugin-vue-jsx": "^1.3.3",
"@vue/babel-plugin-jsx": "^1.1.1",
"autoprefixer": "^10.4.0",
"chalk": "^4.1.2",
"commander": "^8.3.0",
"consola": "^2.15.3",
"conventional-changelog": "^3.1.24",
@@ -82,6 +81,7 @@
"markdown-it": "^12.2.0",
"markdown-it-anchor": "^8.4.1",
"ora": "^6.0.1",
"picocolors": "^1.0.0",
"postcss": "^8.3.11",
"postcss-load-config": "^3.1.0",
"prettier": "^2.5.0",
+2 -2
View File
@@ -1,10 +1,10 @@
import ora from 'ora';
import chalk from 'chalk';
import color from 'picocolors';
import consola from 'consola';
import { ROOT } from '../common/constant.js';
export function slimPath(path: string) {
return chalk.yellow(path.replace(ROOT, ''));
return color.yellow(path.replace(ROOT, ''));
}
export { ora, consola };
@@ -1,4 +1,4 @@
import chalk from 'chalk';
import color from 'picocolors';
import { createRequire } from 'module';
import { createServer, build } from 'vite';
import {
@@ -38,8 +38,8 @@ export async function compileSite(production = false) {
const require = createRequire(import.meta.url);
const { version } = require('vite/package.json');
const viteInfo = chalk.cyan(`vite v${version}`);
console.log(`\n ${viteInfo}` + chalk.green(` dev server running at:\n`));
const viteInfo = color.cyan(`vite v${version}`);
console.log(`\n ${viteInfo}` + color.green(` dev server running at:\n`));
server.printUrls();
}
}