Commit 5a3a7633ac5c197615866f83a66ca06c186518c9

Authored by vben
1 parent 41410161

chore: chalk is replaced by piccolors

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