From 2440b783432e4928491207a3d385a79b3a5ce0be Mon Sep 17 00:00:00 2001 From: biodiscus Date: Tue, 11 Feb 2025 00:16:53 +0100 Subject: [PATCH] feat: switch from picocolors to ansis --- package.json | 2 +- pnpm-lock.yaml | 12 +++++++++--- scripts/buildFixtures.ts | 14 +++++++------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index bc302e25..a911e33c 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "@rspack/core": "^1.2.2", "@types/fs-extra": "^11.0.4", "@types/node": "^22.13.1", + "ansis": "^3.12.0", "bumpp": "^10.0.1", "esbuild": "^0.24.2", "esbuild-plugin-copy": "^2.1.1", @@ -64,7 +65,6 @@ "jiti": "^2.4.2", "lint-staged": "^15.4.3", "magic-string": "^0.30.17", - "picocolors": "^1.1.1", "rolldown": "^1.0.0-beta.3", "rollup": "^4.34.2", "simple-git-hooks": "^2.11.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 757925ca..5697bbd0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,6 +42,9 @@ importers: '@types/node': specifier: ^22.13.1 version: 22.13.1 + ansis: + specifier: ^3.12.0 + version: 3.12.0 bumpp: specifier: ^10.0.1 version: 10.0.1 @@ -69,9 +72,6 @@ importers: magic-string: specifier: ^0.30.17 version: 0.30.17 - picocolors: - specifier: ^1.1.1 - version: 1.1.1 rolldown: specifier: ^1.0.0-beta.3 version: 1.0.0-beta.3(@babel/runtime@7.26.7)(typescript@5.7.3) @@ -1941,6 +1941,10 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} + ansis@3.12.0: + resolution: {integrity: sha512-SxhlInpMkv9QCyI2yHyrhVrTF8dH93M/S86DT5f9brFgr92uJLOCg0RNmtx3YKWKcRmNAaU+gyUfHMdUiqxvFw==} + engines: {node: '>=14'} + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -7215,6 +7219,8 @@ snapshots: ansi-styles@6.2.1: {} + ansis@3.12.0: {} + anymatch@3.1.3: dependencies: normalize-path: 3.0.0 diff --git a/scripts/buildFixtures.ts b/scripts/buildFixtures.ts index 956946be..5a3eb186 100644 --- a/scripts/buildFixtures.ts +++ b/scripts/buildFixtures.ts @@ -1,8 +1,8 @@ import { execSync } from 'node:child_process' import { join, resolve } from 'node:path' import process from 'node:process' +import c from 'ansis' import fs from 'fs-extra' -import c from 'picocolors' async function run() { const dir = resolve(__dirname, '../test/fixtures') @@ -16,27 +16,27 @@ async function run() { if (fs.existsSync(join(path, 'dist'))) await fs.remove(join(path, 'dist')) - console.log(c.yellow(c.inverse(c.bold('\n Vite '))), name, '\n') + console.log(c.yellow.inverse.bold`\n Vite `, name, '\n') execSync('npx vite --version', { cwd: path, stdio: 'inherit' }) execSync('npx vite build', { cwd: path, stdio: 'inherit' }) - console.log(c.red(c.inverse(c.bold('\n Rollup '))), name, '\n') + console.log(c.red.inverse.bold`\n Rollup `, name, '\n') execSync('npx rollup --version', { cwd: path, stdio: 'inherit' }) execSync('npx rollup --bundleConfigAsCjs -c', { cwd: path, stdio: 'inherit' }) - console.log(c.blue(c.inverse(c.bold('\n Webpack '))), name, '\n') + console.log(c.blue.inverse.bold`\n Webpack `, name, '\n') execSync('npx webpack --version', { cwd: path, stdio: 'inherit' }) execSync('npx webpack', { cwd: path, stdio: 'inherit' }) - console.log(c.yellow(c.inverse(c.bold('\n Esbuild '))), name, '\n') + console.log(c.yellow.inverse.bold`\n Esbuild `, name, '\n') execSync('npx esbuild --version', { cwd: path, stdio: 'inherit' }) execSync('node esbuild.config.js', { cwd: path, stdio: 'inherit' }) - console.log(c.cyan(c.inverse(c.bold('\n Rspack '))), name, '\n') + console.log(c.cyan.inverse.bold`\n Rspack `, name, '\n') execSync('npx rspack --version', { cwd: path, stdio: 'inherit' }) execSync('npx rspack', { cwd: path, stdio: 'inherit' }) - console.log(c.magenta(c.inverse(c.bold('\n Farm '))), name, '\n') + console.log(c.magenta.inverse.bold`\n Farm `, name, '\n') execSync('npx farm --version', { cwd: path, stdio: 'inherit' }) execSync('npx farm build', { cwd: path, stdio: 'inherit' }) }