From 9426a0b1f56043195853131737fde18fbad55bd4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 7 Jan 2021 19:18:56 -0500 Subject: [PATCH 1/3] docs: document preact templates --- docs/guide/index.md | 3 +++ packages/create-app/README.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/docs/guide/index.md b/docs/guide/index.md index 190b17ff87bf39..63962ea9169742 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -30,10 +30,13 @@ npm init @vitejs/app my-vue-app --template vue Supported template presets include: +- `vanilla` - `vue` - `vue-ts` - `react` - `react-ts` +- `preact` +- `preact-ts` See [@vitejs/create-app](https://github.com/vitejs/vite/tree/main/packages/create-app) for more details on each template. diff --git a/packages/create-app/README.md b/packages/create-app/README.md index 37fa3c9fbd5cbd..577292bc09dcc5 100644 --- a/packages/create-app/README.md +++ b/packages/create-app/README.md @@ -32,3 +32,5 @@ Currently supported template presets include: - `vue-ts` - `react` - `react-ts` +- `preact` +- `preact-ts` \ No newline at end of file From 870f57a0a67b0ee854b67b40e2c7b9dad58b4004 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 7 Jan 2021 19:28:09 -0500 Subject: [PATCH 2/3] feat: add colors to create-app options --- packages/create-app/index.js | 17 +++++++++-------- packages/create-app/package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/create-app/index.js b/packages/create-app/index.js index 6706f74c9b7d20..d3b2f56118ca26 100755 --- a/packages/create-app/index.js +++ b/packages/create-app/index.js @@ -5,17 +5,18 @@ const fs = require('fs') const path = require('path') const argv = require('minimist')(process.argv.slice(2)) const { prompt } = require('enquirer') +const { yellow, green, cyan, magenta, stripColors } = require('kolorist') const cwd = process.cwd() const TEMPLATES = [ - 'vanilla', - 'vue', - 'vue-ts', - 'react', - 'react-ts', - 'preact', - 'preact-ts' + yellow('vanilla'), + green('vue'), + green('vue-ts'), + cyan('react'), + cyan('react-ts'), + magenta('preact'), + magenta('preact-ts') ] const renameFiles = { @@ -76,7 +77,7 @@ async function init() { message: `Select a template:`, choices: TEMPLATES }) - template = t + template = stripColors(t) } const templateDir = path.join(__dirname, `template-${template}`) diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 5ada5f78481b99..f522f07111a806 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -29,6 +29,7 @@ "homepage": "https://github.com/vitejs/vite/tree/main/packages/create-app#readme", "dependencies": { "enquirer": "^2.3.6", + "kolorist": "^1.2.9", "minimist": "^1.2.5" } } diff --git a/yarn.lock b/yarn.lock index 0f83ded9b511f7..38b353366783f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4669,6 +4669,11 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +kolorist@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.2.9.tgz#ccd5c68827c0385f0b26588321c3b6c4433dd2ab" + integrity sha512-mba6w9rkNlcMSSsGM1Xb9rgGFCDEL1APijLIkgtjsORyr9bKaSvQg/2fP8k7lwEiTh8WlMCHWREvf1ndguIKIQ== + launch-editor-middleware@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/launch-editor-middleware/-/launch-editor-middleware-2.2.1.tgz#e14b07e6c7154b0a4b86a0fd345784e45804c157" From 4be540a1505c51c51719150b2cbbc6e26126d1c3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 7 Jan 2021 19:28:18 -0500 Subject: [PATCH 3/3] release: create-app@1.2.0 --- packages/create-app/CHANGELOG.md | 9 +++++++++ packages/create-app/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md index 48e1df4c04c448..c62317f2c64534 100644 --- a/packages/create-app/CHANGELOG.md +++ b/packages/create-app/CHANGELOG.md @@ -1,3 +1,12 @@ +# [1.2.0](https://github.com/vitejs/vite/compare/create-app@1.1.0...create-app@1.2.0) (2021-01-08) + + +### Features + +* add colors to create-app options ([870f57a](https://github.com/vitejs/vite/commit/870f57a0a67b0ee854b67b40e2c7b9dad58b4004)) + + + # [1.1.0](https://github.com/vitejs/vite/compare/create-app@1.0.6...create-app@1.1.0) (2021-01-08) diff --git a/packages/create-app/package.json b/packages/create-app/package.json index f522f07111a806..d18be56e6c33f2 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@vitejs/create-app", - "version": "1.1.0", + "version": "1.2.0", "license": "MIT", "author": "Evan You", "bin": {