diff --git a/packages/create-vant-cli-app/package.json b/packages/create-vant-cli-app/package.json index 17055f045..e04f80b47 100644 --- a/packages/create-vant-cli-app/package.json +++ b/packages/create-vant-cli-app/package.json @@ -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": { diff --git a/packages/create-vant-cli-app/src/generator.ts b/packages/create-vant-cli-app/src/generator.ts index 7c3ecaa3e..59b10c940 100644 --- a/packages/create-vant-cli-app/src/generator.ts +++ b/packages/create-vant-cli-app/src/generator.ts @@ -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!` ); diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json index 6316ed3d9..f6cabf7d8 100644 --- a/packages/vant-cli/package.json +++ b/packages/vant-cli/package.json @@ -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", diff --git a/packages/vant-cli/src/common/logger.ts b/packages/vant-cli/src/common/logger.ts index 23553e594..5e3f12720 100644 --- a/packages/vant-cli/src/common/logger.ts +++ b/packages/vant-cli/src/common/logger.ts @@ -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 }; diff --git a/packages/vant-cli/src/compiler/compile-site.ts b/packages/vant-cli/src/compiler/compile-site.ts index 5e58c30da..26c19360f 100644 --- a/packages/vant-cli/src/compiler/compile-site.ts +++ b/packages/vant-cli/src/compiler/compile-site.ts @@ -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(); } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b0eb913b..17562d943 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,19 +28,19 @@ importers: specifiers: '@types/fs-extra': ^9.0.13 '@types/inquirer': ^8.1.3 - chalk: ^4.1.2 consola: ^2.11.3 fast-glob: ^3.2.4 fs-extra: ^10.0.0 inquirer: ^8.0.0 + picocolors: ^1.0.0 release-it: ^15.1.1 typescript: ^4.7.4 dependencies: - chalk: 4.1.2 consola: 2.15.3 fast-glob: 3.2.11 fs-extra: 10.1.0 inquirer: 8.2.4 + picocolors: 1.0.0 devDependencies: '@types/fs-extra': 9.0.13 '@types/inquirer': 8.2.1 @@ -105,7 +105,6 @@ importers: '@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 @@ -126,6 +125,7 @@ importers: 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 @@ -154,7 +154,6 @@ importers: '@vitejs/plugin-vue-jsx': 1.3.10 '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.18.6 autoprefixer: 10.4.7_postcss@8.4.14 - chalk: 4.1.2 commander: 8.3.0 consola: 2.15.3 conventional-changelog: 3.1.25 @@ -175,6 +174,7 @@ importers: markdown-it: 12.3.2 markdown-it-anchor: 8.6.4_d643ca6eb40ae68ab966a77bead78073 ora: 6.1.2 + picocolors: 1.0.0 postcss: 8.4.14 postcss-load-config: 3.1.4_postcss@8.4.14 prettier: 2.7.1