Skip to content

Commit

Permalink
refactor(create-vite): use picocolors (#18085)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Sep 12, 2024
1 parent a2c375d commit ba37df0
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 60 deletions.
52 changes: 23 additions & 29 deletions packages/create-vite/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -109,35 +109,6 @@ Repository: lukeed/kleur

---------------------------------------

## kolorist
License: MIT
By: Marvin Hagemeister
Repository: 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.

---------------------------------------

## minimist
License: MIT
By: James Halliday
Expand Down Expand Up @@ -181,6 +152,29 @@ Repository: sindresorhus/path-key

---------------------------------------

## picocolors
License: ISC
By: Alexey Raspopov
Repository: alexeyraspopov/picocolors

> ISC License
>
> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
>
> Permission to use, copy, modify, and/or distribute this software for any
> purpose with or without fee is hereby granted, provided that the above
> copyright notice and this permission notice appear in all copies.
>
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---------------------------------------

## prompts
License: MIT
By: Terkel Gjervig
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"@types/minimist": "^1.2.5",
"@types/prompts": "^2.4.9",
"cross-spawn": "^7.0.3",
"kolorist": "^1.8.0",
"minimist": "^1.2.8",
"picocolors": "^1.1.0",
"prompts": "^2.4.2",
"unbuild": "^2.0.0"
}
Expand Down
40 changes: 21 additions & 19 deletions packages/create-vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ import { fileURLToPath } from 'node:url'
import spawn from 'cross-spawn'
import minimist from 'minimist'
import prompts from 'prompts'
import {
import colors from 'picocolors'

const {
blue,
blueBright,
cyan,
green,
lightBlue,
lightGreen,
lightRed,
greenBright,
magenta,
red,
redBright,
reset,
yellow,
} from 'kolorist'
} = colors

// Avoids autoconversion to number of the project name by defining that the args
// non associated with an option ( _ ) needs to be parsed as a string. See #4606
Expand All @@ -40,15 +42,15 @@ Options:
-t, --template NAME use a specific template
Available templates:
${yellow ('vanilla-ts vanilla' )}
${green ('vue-ts vue' )}
${cyan ('react-ts react' )}
${cyan ('react-swc-ts react-swc')}
${magenta ('preact-ts preact' )}
${lightRed ('lit-ts lit' )}
${red ('svelte-ts svelte' )}
${blue ('solid-ts solid' )}
${lightBlue('qwik-ts qwik' )}`
${yellow ('vanilla-ts vanilla' )}
${green ('vue-ts vue' )}
${cyan ('react-ts react' )}
${cyan ('react-swc-ts react-swc')}
${magenta ('preact-ts preact' )}
${redBright ('lit-ts lit' )}
${red ('svelte-ts svelte' )}
${blue ('solid-ts solid' )}
${blueBright('qwik-ts qwik' )}`

type ColorFunc = (str: string | number) => string
type Framework = {
Expand Down Expand Up @@ -106,7 +108,7 @@ const FRAMEWORKS: Framework[] = [
{
name: 'custom-nuxt',
display: 'Nuxt ↗',
color: lightGreen,
color: greenBright,
customCommand: 'npm exec nuxi init TARGET_DIR',
},
],
Expand Down Expand Up @@ -170,7 +172,7 @@ const FRAMEWORKS: Framework[] = [
{
name: 'lit',
display: 'Lit',
color: lightRed,
color: redBright,
variants: [
{
name: 'lit-ts',
Expand Down Expand Up @@ -227,12 +229,12 @@ const FRAMEWORKS: Framework[] = [
{
name: 'qwik',
display: 'Qwik',
color: lightBlue,
color: blueBright,
variants: [
{
name: 'qwik-ts',
display: 'TypeScript',
color: lightBlue,
color: blueBright,
},
{
name: 'qwik',
Expand All @@ -242,7 +244,7 @@ const FRAMEWORKS: Framework[] = [
{
name: 'custom-qwik-city',
display: 'QwikCity ↗',
color: lightBlue,
color: blueBright,
customCommand: 'npm create qwik@latest basic TARGET_DIR',
},
],
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2156,11 +2156,11 @@ Repository: lukeed/mrmime

## ms
License: MIT
Repository: zeit/ms
Repository: vercel/ms

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

> ISC License
>
> Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov
> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
>
> Permission to use, copy, modify, and/or distribute this software for any
> purpose with or without fee is hereby granted, provided that the above
Expand Down
11 changes: 3 additions & 8 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 ba37df0

Please sign in to comment.