Skip to content

Commit

Permalink
refactor: replace kolorist with kleur/colors
Browse files Browse the repository at this point in the history
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
  • Loading branch information
haoqunjiang committed Oct 11, 2024
1 parent a958510 commit 0395555
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 29 deletions.
28 changes: 0 additions & 28 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@
"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",
Expand Down
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0395555

Please sign in to comment.