From e1fd111d6270cf50f903450339745a4550f30fb1 Mon Sep 17 00:00:00 2001 From: merceyz Date: Tue, 31 May 2022 19:12:33 +0200 Subject: [PATCH 1/2] fix(create-docusaurus): add missing dependencies to templates --- .github/workflows/tests-e2e.yml | 14 +++++--------- .../templates/classic-typescript/package.json | 7 +++++++ .../templates/classic/package.json | 3 ++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests-e2e.yml b/.github/workflows/tests-e2e.yml index ef3e2d103474..6005d73be8c8 100644 --- a/.github/workflows/tests-e2e.yml +++ b/.github/workflows/tests-e2e.yml @@ -89,25 +89,21 @@ jobs: # https://yarnpkg.com/features/pnp#fallback-mode yarn config set pnpFallbackMode none + # This has been fixed in unified@10 / will be set automatically in the next Yarn release. + # TODO: Remove when updating unified or after the next Yarn release. + yarn config set packageExtensions --json '{ "unified@<10": { "dependencies": { "@types/unist": "^2.0.6" } } }' + yarn install working-directory: ../test-website env: YARN_ENABLE_IMMUTABLE_INSTALLS: false # Yarn berry should create the lockfile, despite CI env - - name: Install missing dependencies - if: matrix.variant == '-st' && matrix.nodeLinker == 'pnp' - run: | - # These dependencies are referenced in the init project, not by our packages - yarn add @docusaurus/theme-classic @docusaurus/types @types/node - yarn config set packageExtensions --json '{ "unified@^9.2.2": { "dependencies": { "@types/unist": "^2.0.6" } } }' - working-directory: ../test-website - name: Start test-website project run: yarn start --no-open working-directory: ../test-website env: E2E_TEST: true - name: Type check - # TODO: there're some lingering issues with PnP + tsc. Enable tsc in PnP later. - if: matrix.variant == '-st' && matrix.nodeLinker != 'pnp' + if: matrix.variant == '-st' run: yarn typecheck working-directory: ../test-website - name: Build test-website project diff --git a/packages/create-docusaurus/templates/classic-typescript/package.json b/packages/create-docusaurus/templates/classic-typescript/package.json index 44ae46ef4e49..8bea006c5ee2 100644 --- a/packages/create-docusaurus/templates/classic-typescript/package.json +++ b/packages/create-docusaurus/templates/classic-typescript/package.json @@ -25,9 +25,16 @@ }, "devDependencies": { "@docusaurus/module-type-aliases": "2.0.0-beta.21", + "@docusaurus/theme-classic": "2.0.0-beta.21", + "@docusaurus/types": "2.0.0-beta.21", "@tsconfig/docusaurus": "^1.0.5", + "@types/node": "^16", + "@types/react": "^17", "typescript": "^4.6.4" }, + "resolutions": { + "@types/react": "^17" + }, "browserslist": { "production": [ ">0.5%", diff --git a/packages/create-docusaurus/templates/classic/package.json b/packages/create-docusaurus/templates/classic/package.json index 4eb48ab1e867..4676a35511ef 100644 --- a/packages/create-docusaurus/templates/classic/package.json +++ b/packages/create-docusaurus/templates/classic/package.json @@ -23,7 +23,8 @@ "react-dom": "^17.0.2" }, "devDependencies": { - "@docusaurus/module-type-aliases": "2.0.0-beta.21" + "@docusaurus/module-type-aliases": "2.0.0-beta.21", + "@docusaurus/types": "2.0.0-beta.21" }, "browserslist": { "production": [ From d052f7e80663af43626c4e7f21a51f334c2161a8 Mon Sep 17 00:00:00 2001 From: merceyz Date: Tue, 31 May 2022 19:35:45 +0200 Subject: [PATCH 2/2] chore: update lockfile --- yarn.lock | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/yarn.lock b/yarn.lock index abc15d47e10c..7483121c936e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3597,6 +3597,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.35.tgz#635b7586086d51fb40de0a2ec9d1014a5283ba4a" integrity sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg== +"@types/node@^16": + version "16.11.36" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.36.tgz#9ab9f8276987132ed2b225cace2218ba794fc751" + integrity sha512-FR5QJe+TaoZ2GsMHkjuwoNabr+UrJNRr2HNOo+r/7vhcuntM6Ee/pRPOnRhhL2XE9OOvX9VLEq+BcXl3VjNoWA== + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -3719,6 +3724,15 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^17": + version "17.0.45" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.45.tgz#9b3d5b661fd26365fefef0e766a1c6c30ccf7b3f" + integrity sha512-YfhQ22Lah2e3CHPsb93tRwIGNiSwkuz1/blk4e6QrWS0jQzCSNbGLtOEYhPg02W0yGTTmpajp7dCTbBAMN3qsg== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/relateurl@*": version "0.2.29" resolved "https://registry.yarnpkg.com/@types/relateurl/-/relateurl-0.2.29.tgz#68ccecec3d4ffdafb9c577fe764f912afc050fe6"