From e1f4677d049ef91a99d33e5602b5a17d2bfe9aa7 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Wed, 22 Sep 2021 20:49:25 +0800 Subject: [PATCH] fix(module-type-aliases): move @type packages to dependencies (#5601) * Move devDeps to deps Signed-off-by: Josh-Cena * Update docs Signed-off-by: Josh-Cena * Update init template Signed-off-by: Josh-Cena --- .../templates/classic-typescript/package.json | 3 --- packages/docusaurus-module-type-aliases/package.json | 2 +- packages/docusaurus-types/package.json | 1 - packages/docusaurus-types/src/index.js | 10 ---------- website/docs/typescript-support.md | 4 ++-- yarn.lock | 6 +++--- 6 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 packages/docusaurus-types/src/index.js diff --git a/packages/docusaurus-init/templates/classic-typescript/package.json b/packages/docusaurus-init/templates/classic-typescript/package.json index 50610d8402..43a691e1fd 100644 --- a/packages/docusaurus-init/templates/classic-typescript/package.json +++ b/packages/docusaurus-init/templates/classic-typescript/package.json @@ -29,9 +29,6 @@ "devDependencies": { "@docusaurus/module-type-aliases": "2.0.0-beta.6", "@tsconfig/docusaurus": "^1.0.4", - "@types/react": "^17.0.14", - "@types/react-helmet": "^6.1.2", - "@types/react-router-dom": "^5.1.8", "typescript": "^4.3.5" }, "browserslist": { diff --git a/packages/docusaurus-module-type-aliases/package.json b/packages/docusaurus-module-type-aliases/package.json index 756e27f78d..92add41d7d 100644 --- a/packages/docusaurus-module-type-aliases/package.json +++ b/packages/docusaurus-module-type-aliases/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/facebook/docusaurus.git", "directory": "packages/docusaurus-module-type-aliases" }, - "devDependencies": { + "dependencies": { "@types/react": "*", "@types/react-helmet": "*", "@types/react-loadable": "*", diff --git a/packages/docusaurus-types/package.json b/packages/docusaurus-types/package.json index b2ae8bfe04..2dd66cd327 100644 --- a/packages/docusaurus-types/package.json +++ b/packages/docusaurus-types/package.json @@ -2,7 +2,6 @@ "name": "@docusaurus/types", "version": "2.0.0-beta.6", "description": "Common types for Docusaurus packages.", - "main": "./src/index.js", "types": "./src/index.d.ts", "publishConfig": { "access": "public" diff --git a/packages/docusaurus-types/src/index.js b/packages/docusaurus-types/src/index.js deleted file mode 100644 index b9cc611912..0000000000 --- a/packages/docusaurus-types/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/* eslint-disable */ -'use strict'; -Object.defineProperty(exports, '__esModule', {value: true}); diff --git a/website/docs/typescript-support.md b/website/docs/typescript-support.md index 22aa54cef2..31c093d724 100644 --- a/website/docs/typescript-support.md +++ b/website/docs/typescript-support.md @@ -17,10 +17,10 @@ Below are some guides on how to migrate an existing project to TypeScript. ## Setup {#setup} -To start using TypeScript, add `@docusaurus/module-type-aliases` and some `@types` dependencies to your project: +To start using TypeScript, add `@docusaurus/module-type-aliases` and the base TS config to your project: ```bash npm2yarn -npm install --save-dev typescript @docusaurus/module-type-aliases @types/react @types/react-router-dom @types/react-helmet @tsconfig/docusaurus +npm install --save-dev typescript @docusaurus/module-type-aliases @tsconfig/docusaurus ``` Then add `tsconfig.json` to your project root with the following content: diff --git a/yarn.lock b/yarn.lock index 81744ec1b8..455ba7a57f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4357,7 +4357,7 @@ "@types/webpack" "^4" "@types/webpack-dev-server" "*" -"@types/react-helmet@*", "@types/react-helmet@^6.0.0", "@types/react-helmet@^6.1.2": +"@types/react-helmet@*", "@types/react-helmet@^6.0.0": version "6.1.2" resolved "https://registry.yarnpkg.com/@types/react-helmet/-/react-helmet-6.1.2.tgz#e9d7d16b29e4ec5716711c52c35c3cec45819eac" integrity sha512-dcfAZNlWb5JYFbO9CGfrPWLJAyFcT6UeR3u35eBbv8liY2Rg4K7fM1G5+HnwVgot+C+kVwXAZ8pLEn2jsMfTDg== @@ -4381,7 +4381,7 @@ "@types/react" "*" "@types/react-router" "*" -"@types/react-router-dom@*", "@types/react-router-dom@^5.1.8": +"@types/react-router-dom@*": version "5.1.8" resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.1.8.tgz#bf3e1c8149b3d62eaa206d58599de82df0241192" integrity sha512-03xHyncBzG0PmDmf8pf3rehtjY0NpUj7TIN46FrT5n1ZWHPZvXz32gUyNboJ+xsL8cpg8bQVLcllptcQHvocrw== @@ -4398,7 +4398,7 @@ "@types/history" "*" "@types/react" "*" -"@types/react@*", "@types/react@^17.0.14", "@types/react@^17.0.2": +"@types/react@*", "@types/react@^17.0.2": version "17.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.15.tgz#c7533dc38025677e312606502df7656a6ea626d0" integrity sha512-uTKHDK9STXFHLaKv6IMnwp52fm0hwU+N89w/p9grdUqcFA6WuqDyPhaWopbNyE1k/VhgzmHl8pu1L4wITtmlLw==