]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
refactor: replace kolorist with kleur/colors
authorHaoqun Jiang <haoqunjiang@gmail.com>
Fri, 11 Oct 2024 11:47:08 +0000 (19:47 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Fri, 11 Oct 2024 12:16:29 +0000 (20:16 +0800)
The size of `outfile.cjs` before the change:
143037 bytes

Ater the change:
141514 bytes

Saved 1523 bytes.

I didn't choose `picocolors` despite it being more popular because
it doesn't support tree-shaking and actually increases the bundle size
a bit.

I didn't choose `yoctocolors` because the resulting bundle is also a bit
larger than the one produced by `kleur/colors`.

Addressed the issue raised in #253

LICENSE
index.ts
package.json
pnpm-lock.yaml

diff --git a/LICENSE b/LICENSE
index 609a8694b511439fbbc29f2a5abeb82eee36d82a..8fd37997ad1fb27f4e001907eabb55471544d4d7 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -299,34 +299,6 @@ Repository: git+https://github.com/lukeed/kleur.git
 > THE SOFTWARE.
 >
 
-## kolorist
-
-License: MIT
-By: Marvin Hagemeister
-Repository: git+https://github.com/marvinhagemeister/kolorist.git
-
-> The MIT License (MIT)
->
-> Copyright (c) 2020-present Marvin Hagemeister
->
-> Permission is hereby granted, free of charge, to any person obtaining a copy
-> of this software and associated documentation files (the "Software"), to deal
-> in the Software without restriction, including without limitation the rights
-> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-> copies of the Software, and to permit persons to whom the Software is
-> furnished to do so, subject to the following conditions:
->
-> The above copyright notice and this permission notice shall be included in all
-> copies or substantial portions of the Software.
->
-> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-> SOFTWARE.
-
 ## prompts
 
 License: MIT
index 8e0e55c9e8428b3d476e5d33e4b97bcf2198354c..758694ad5822ca70d50e5f0420c512fb0394d687 100755 (executable)
--- a/index.ts
+++ b/index.ts
@@ -6,7 +6,7 @@ import * as path from 'node:path'
 import { parseArgs } from 'node:util'
 
 import prompts from 'prompts'
-import { red, green, bold } from 'kolorist'
+import { red, green, bold } from 'kleur/colors'
 
 import ejs from 'ejs'
 
index e2096187d974c6aaf88e56d8246bc01f021988ba..8da2801893991e680dfb85d085e7a1d584f9e298 100644 (file)
     "esbuild": "^0.24.0",
     "esbuild-plugin-license": "^1.2.3",
     "husky": "^9.1.6",
+    "kleur": "^4.1.5",
     "kolorist": "^1.8.0",
     "lint-staged": "^15.2.10",
+    "picocolors": "^1.1.0",
     "prettier": "^3.3.3",
     "prompts": "^2.4.2",
     "vitest": "^2.1.2",
index c5222696b4ec622106472165f1504d166f5ca318..20da0dad934d7672a79f471aab37f167af7064d7 100644 (file)
@@ -38,12 +38,18 @@ importers:
       husky:
         specifier: ^9.1.6
         version: 9.1.6
+      kleur:
+        specifier: ^4.1.5
+        version: 4.1.5
       kolorist:
         specifier: ^1.8.0
         version: 1.8.0
       lint-staged:
         specifier: ^15.2.10
         version: 15.2.10
+      picocolors:
+        specifier: ^1.1.0
+        version: 1.1.0
       prettier:
         specifier: ^3.3.3
         version: 3.3.3
@@ -2719,6 +2725,10 @@ packages:
     resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
     engines: {node: '>=6'}
 
+  kleur@4.1.5:
+    resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==}
+    engines: {node: '>=6'}
+
   kolorist@1.8.0:
     resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
 
@@ -6470,6 +6480,8 @@ snapshots:
 
   kleur@3.0.3: {}
 
+  kleur@4.1.5: {}
+
   kolorist@1.8.0: {}
 
   lazy-ass@1.6.0: {}