Skip to content

Commit ba37df0

Browse files
authored
refactor(create-vite): use picocolors (#18085)
1 parent a2c375d commit ba37df0

File tree

5 files changed

+51
-60
lines changed

5 files changed

+51
-60
lines changed

packages/create-vite/LICENSE

+23-29
Original file line numberDiff line numberDiff line change
@@ -109,35 +109,6 @@ Repository: lukeed/kleur
109109

110110
---------------------------------------
111111

112-
## kolorist
113-
License: MIT
114-
By: Marvin Hagemeister
115-
Repository: https://github.com/marvinhagemeister/kolorist.git
116-
117-
> The MIT License (MIT)
118-
>
119-
> Copyright (c) 2020-present Marvin Hagemeister
120-
>
121-
> Permission is hereby granted, free of charge, to any person obtaining a copy
122-
> of this software and associated documentation files (the "Software"), to deal
123-
> in the Software without restriction, including without limitation the rights
124-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
125-
> copies of the Software, and to permit persons to whom the Software is
126-
> furnished to do so, subject to the following conditions:
127-
>
128-
> The above copyright notice and this permission notice shall be included in all
129-
> copies or substantial portions of the Software.
130-
>
131-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
132-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
133-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
134-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
135-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
136-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
137-
> SOFTWARE.
138-
139-
---------------------------------------
140-
141112
## minimist
142113
License: MIT
143114
By: James Halliday
@@ -181,6 +152,29 @@ Repository: sindresorhus/path-key
181152

182153
---------------------------------------
183154

155+
## picocolors
156+
License: ISC
157+
By: Alexey Raspopov
158+
Repository: alexeyraspopov/picocolors
159+
160+
> ISC License
161+
>
162+
> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
163+
>
164+
> Permission to use, copy, modify, and/or distribute this software for any
165+
> purpose with or without fee is hereby granted, provided that the above
166+
> copyright notice and this permission notice appear in all copies.
167+
>
168+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
169+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
170+
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
171+
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
172+
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
173+
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
174+
> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
175+
176+
---------------------------------------
177+
184178
## prompts
185179
License: MIT
186180
By: Terkel Gjervig

packages/create-vite/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"@types/minimist": "^1.2.5",
3737
"@types/prompts": "^2.4.9",
3838
"cross-spawn": "^7.0.3",
39-
"kolorist": "^1.8.0",
4039
"minimist": "^1.2.8",
40+
"picocolors": "^1.1.0",
4141
"prompts": "^2.4.2",
4242
"unbuild": "^2.0.0"
4343
}

packages/create-vite/src/index.ts

+21-19
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ import { fileURLToPath } from 'node:url'
44
import spawn from 'cross-spawn'
55
import minimist from 'minimist'
66
import prompts from 'prompts'
7-
import {
7+
import colors from 'picocolors'
8+
9+
const {
810
blue,
11+
blueBright,
912
cyan,
1013
green,
11-
lightBlue,
12-
lightGreen,
13-
lightRed,
14+
greenBright,
1415
magenta,
1516
red,
17+
redBright,
1618
reset,
1719
yellow,
18-
} from 'kolorist'
20+
} = colors
1921

2022
// Avoids autoconversion to number of the project name by defining that the args
2123
// non associated with an option ( _ ) needs to be parsed as a string. See #4606
@@ -40,15 +42,15 @@ Options:
4042
-t, --template NAME use a specific template
4143
4244
Available templates:
43-
${yellow ('vanilla-ts vanilla' )}
44-
${green ('vue-ts vue' )}
45-
${cyan ('react-ts react' )}
46-
${cyan ('react-swc-ts react-swc')}
47-
${magenta ('preact-ts preact' )}
48-
${lightRed ('lit-ts lit' )}
49-
${red ('svelte-ts svelte' )}
50-
${blue ('solid-ts solid' )}
51-
${lightBlue('qwik-ts qwik' )}`
45+
${yellow ('vanilla-ts vanilla' )}
46+
${green ('vue-ts vue' )}
47+
${cyan ('react-ts react' )}
48+
${cyan ('react-swc-ts react-swc')}
49+
${magenta ('preact-ts preact' )}
50+
${redBright ('lit-ts lit' )}
51+
${red ('svelte-ts svelte' )}
52+
${blue ('solid-ts solid' )}
53+
${blueBright('qwik-ts qwik' )}`
5254

5355
type ColorFunc = (str: string | number) => string
5456
type Framework = {
@@ -106,7 +108,7 @@ const FRAMEWORKS: Framework[] = [
106108
{
107109
name: 'custom-nuxt',
108110
display: 'Nuxt ↗',
109-
color: lightGreen,
111+
color: greenBright,
110112
customCommand: 'npm exec nuxi init TARGET_DIR',
111113
},
112114
],
@@ -170,7 +172,7 @@ const FRAMEWORKS: Framework[] = [
170172
{
171173
name: 'lit',
172174
display: 'Lit',
173-
color: lightRed,
175+
color: redBright,
174176
variants: [
175177
{
176178
name: 'lit-ts',
@@ -227,12 +229,12 @@ const FRAMEWORKS: Framework[] = [
227229
{
228230
name: 'qwik',
229231
display: 'Qwik',
230-
color: lightBlue,
232+
color: blueBright,
231233
variants: [
232234
{
233235
name: 'qwik-ts',
234236
display: 'TypeScript',
235-
color: lightBlue,
237+
color: blueBright,
236238
},
237239
{
238240
name: 'qwik',
@@ -242,7 +244,7 @@ const FRAMEWORKS: Framework[] = [
242244
{
243245
name: 'custom-qwik-city',
244246
display: 'QwikCity ↗',
245-
color: lightBlue,
247+
color: blueBright,
246248
customCommand: 'npm create qwik@latest basic TARGET_DIR',
247249
},
248250
],

packages/vite/LICENSE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2156,11 +2156,11 @@ Repository: lukeed/mrmime
21562156

21572157
## ms
21582158
License: MIT
2159-
Repository: zeit/ms
2159+
Repository: vercel/ms
21602160

21612161
> The MIT License (MIT)
21622162
>
2163-
> Copyright (c) 2016 Zeit, Inc.
2163+
> Copyright (c) 2020 Vercel, Inc.
21642164
>
21652165
> Permission is hereby granted, free of charge, to any person obtaining a copy
21662166
> of this software and associated documentation files (the "Software"), to deal
@@ -2447,7 +2447,7 @@ Repository: alexeyraspopov/picocolors
24472447

24482448
> ISC License
24492449
>
2450-
> Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov
2450+
> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
24512451
>
24522452
> Permission to use, copy, modify, and/or distribute this software for any
24532453
> purpose with or without fee is hereby granted, provided that the above

pnpm-lock.yaml

+3-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)