From 5633e7b4d4202f38c7f1a98df47ba57217fa029e Mon Sep 17 00:00:00 2001 From: K3A Date: Sun, 3 Jun 2018 21:07:09 +0200 Subject: [PATCH 1/2] TypeScript project generation in @vue/cli 3.0 update information about generating TypeScript project using new @vue/cli 3.0 --- src/v2/guide/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/guide/typescript.md b/src/v2/guide/typescript.md index d65676dfc0..ce620e7f20 100644 --- a/src/v2/guide/typescript.md +++ b/src/v2/guide/typescript.md @@ -12,7 +12,7 @@ A static type system can help prevent many potential runtime errors, especially Since these are [published on NPM](https://cdn.jsdelivr.net/npm/vue/types/), and the latest TypeScript knows how to resolve type declarations in NPM packages, this means when installed via NPM, you don't need any additional tooling to use TypeScript with Vue. -We also plan to provide an option to scaffold a ready-to-go Vue + TypeScript project in `vue-cli` in the near future. +Vue CLI (@vue/cli NPM package) is able to generate TypeScript project since version 3.0. To create a new project, start with `vue create ` and select `Manually select features`. ## Recommended Configuration From b010320c9d23828c812e08be47a86d8f0be90e6f Mon Sep 17 00:00:00 2001 From: Chris Fritz Date: Sun, 3 Jun 2018 15:42:50 -0400 Subject: [PATCH 2/2] tweaks to Vue CLI 3 TypeScript support docs --- src/v2/guide/typescript.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/v2/guide/typescript.md b/src/v2/guide/typescript.md index ce620e7f20..80a13033ce 100644 --- a/src/v2/guide/typescript.md +++ b/src/v2/guide/typescript.md @@ -12,8 +12,6 @@ A static type system can help prevent many potential runtime errors, especially Since these are [published on NPM](https://cdn.jsdelivr.net/npm/vue/types/), and the latest TypeScript knows how to resolve type declarations in NPM packages, this means when installed via NPM, you don't need any additional tooling to use TypeScript with Vue. -Vue CLI (@vue/cli NPM package) is able to generate TypeScript project since version 3.0. To create a new project, start with `vue create ` and select `Manually select features`. - ## Recommended Configuration ``` js @@ -37,11 +35,23 @@ See [TypeScript compiler options docs](https://www.typescriptlang.org/docs/handb ## Development Tooling -For developing Vue applications with TypeScript, we strongly recommend using [Visual Studio Code](https://code.visualstudio.com/), which provides great out-of-the-box support for TypeScript. +## Project Creation + +[Vue CLI 3](https://github.com/vuejs/vue-cli) can generate new projects that use TypeScript. To get started: + +```bash +# 1. Install Vue CLI, if it's not already installed +npm install --global @vue/cli + +# 2. Create a new project, then choose the "Manually select features" option +vue create my-project-name +``` + +## Editor Support -If you are using [single-file components](./single-file-components.html) (SFCs), get the awesome [Vetur extension](https://github.com/vuejs/vetur), which provides TypeScript inference inside SFCs and many other great features. +For developing Vue applications with TypeScript, we strongly recommend using [Visual Studio Code](https://code.visualstudio.com/), which provides great out-of-the-box support for TypeScript. If you are using [single-file components](./single-file-components.html) (SFCs), get the awesome [Vetur extension](https://github.com/vuejs/vetur), which provides TypeScript inference inside SFCs and many other great features. -[WebStorm](https://www.jetbrains.com/webstorm/) also provides out-of-the-box support for both TypeScript and Vue.js. +[WebStorm](https://www.jetbrains.com/webstorm/) also provides out-of-the-box support for both TypeScript and Vue. ## Basic Usage