Commit 5a3a7633ac5c197615866f83a66ca06c186518c9

Authored by vben
1 parent 41410161

chore: chalk is replaced by piccolors

build/generate/icon/index.ts
1 1 import path from 'path';
2 2 import fs from 'fs-extra';
3 3 import inquirer from 'inquirer';
4   -import chalk from 'chalk';
  4 +import colors from 'picocolors';
5 5 import pkg from '../../../package.json';
6 6  
7 7 async function generateIcon() {
... ... @@ -64,7 +64,7 @@ async function generateIcon() {
64 64 }
65 65 fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite'));
66 66 console.log(
67   - `✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`,
  67 + `✨ ${colors.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`,
68 68 );
69 69 });
70 70 }
... ...
build/script/buildConf.ts
... ... @@ -3,7 +3,7 @@
3 3 */
4 4 import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant';
5 5 import fs, { writeFileSync } from 'fs-extra';
6   -import chalk from 'chalk';
  6 +import colors from 'picocolors';
7 7  
8 8 import { getEnvConfig, getRootPath } from '../utils';
9 9 import { getConfigFileName } from '../getConfigFileName';
... ... @@ -31,10 +31,10 @@ function createConfig(params: CreateConfigParams) {
31 31 fs.mkdirp(getRootPath(OUTPUT_DIR));
32 32 writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);
33 33  
34   - console.log(chalk.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
35   - console.log(chalk.gray(OUTPUT_DIR + '/' + chalk.green(configFileName)) + '\n');
  34 + console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
  35 + console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n');
36 36 } catch (error) {
37   - console.log(chalk.red('configuration file configuration file failed to package:\n' + error));
  37 + console.log(colors.red('configuration file configuration file failed to package:\n' + error));
38 38 }
39 39 }
40 40  
... ...
build/script/postBuild.ts
1 1 // #!/usr/bin/env node
2 2  
3 3 import { runBuildConfig } from './buildConf';
4   -import chalk from 'chalk';
  4 +import colors from 'picocolors';
5 5  
6 6 import pkg from '../../package.json';
7 7  
... ... @@ -14,9 +14,9 @@ export const runBuild = async () => {
14 14 runBuildConfig();
15 15 }
16 16  
17   - console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
  17 + console.log(`✨ ${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
18 18 } catch (error) {
19   - console.log(chalk.red('vite build error:\n' + error));
  19 + console.log(colors.red('vite build error:\n' + error));
20 20 process.exit(1);
21 21 }
22 22 };
... ...
package.json
... ... @@ -111,6 +111,7 @@
111 111 "less": "^4.1.2",
112 112 "lint-staged": "12.3.7",
113 113 "npm-run-all": "^4.1.5",
  114 + "picocolors": "^1.0.0",
114 115 "postcss": "^8.4.12",
115 116 "postcss-html": "^1.3.0",
116 117 "postcss-less": "^6.0.0",
... ...
pnpm-lock.yaml
... ... @@ -68,6 +68,7 @@ specifiers:
68 68 npm-run-all: ^4.1.5
69 69 nprogress: ^0.2.0
70 70 path-to-regexp: ^6.2.0
  71 + picocolors: ^1.0.0
71 72 pinia: 2.0.12
72 73 postcss: ^8.4.12
73 74 postcss-html: ^1.3.0
... ... @@ -196,6 +197,7 @@ devDependencies:
196 197 less: 4.1.2
197 198 lint-staged: 12.3.7
198 199 npm-run-all: 4.1.5
  200 + picocolors: 1.0.0
199 201 postcss: 8.4.12
200 202 postcss-html: 1.3.0
201 203 postcss-less: 6.0.0_postcss@8.4.12
... ...