Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make type-checking work in Yarn PnP #7521

Merged
merged 8 commits into from
May 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ jobs:
matrix:
nodeLinker: [pnp, node-modules]
variant: [-s, -st]
exclude:
# Running tsc on PnP requires additional installations, which is not
# worthwhile for a simple E2E test
- variant: -st
nodeLinker: pnp
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3
Expand Down Expand Up @@ -98,13 +93,21 @@ jobs:
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
if: matrix.variant == '-st'
# TODO: there're some lingering issues with PnP + tsc. Enable tsc in PnP later.
if: matrix.variant == '-st' && matrix.nodeLinker != 'pnp'
run: yarn typecheck
working-directory: ../test-website
- name: Build test-website project
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-mdx-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"remark-emoji": "^2.2.0",
"stringify-object": "^3.3.0",
"tslib": "^2.4.0",
"unified": "^9.2.2",
"unist-util-visit": "^2.0.3",
"url-loader": "^4.1.1",
"webpack": "^5.72.1"
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-mdx-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"declarationMap": true,
"module": "commonjs",
"rootDir": "src",
"outDir": "lib"
"outDir": "lib",
"types": []
},
"include": ["src"],
"exclude": ["**/__tests__/**"]
Expand Down
5 changes: 4 additions & 1 deletion packages/docusaurus-module-type-aliases/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
"directory": "packages/docusaurus-module-type-aliases"
},
"dependencies": {
"@docusaurus/react-loadable": "5.5.2",
"@docusaurus/types": "2.0.0-beta.21",
"@types/history": "^4.7.11",
"@types/react": "*",
"@types/react-router-config": "*",
"@types/react-router-dom": "*",
"react-helmet-async": "*"
"react-helmet-async": "*",
"react-loadable": "npm:@docusaurus/[email protected]"
},
"peerDependencies": {
"react": "*",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-content-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/logger": "2.0.0-beta.21",
"@docusaurus/mdx-loader": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils": "2.0.0-beta.21",
"@docusaurus/utils-common": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
Expand Down
7 changes: 4 additions & 3 deletions packages/docusaurus-plugin-content-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/logger": "2.0.0-beta.21",
"@docusaurus/mdx-loader": "2.0.0-beta.21",
"@docusaurus/module-type-aliases": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
"@types/react-router-config": "^5.0.6",
"combine-promises": "^1.1.0",
"fs-extra": "^10.1.0",
"import-fresh": "^3.3.0",
Expand All @@ -41,15 +44,13 @@
"webpack": "^5.72.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@types/js-yaml": "^4.0.5",
"@types/picomatch": "^2.3.0",
"commander": "^5.1.0",
"escape-string-regexp": "^4.0.0",
"picomatch": "^2.3.1",
"shelljs": "^0.8.5",
"utility-types": "^3.10.0"
"shelljs": "^0.8.5"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-content-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"dependencies": {
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/mdx-loader": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
"fs-extra": "^10.1.0",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils": "2.0.0-beta.21",
"fs-extra": "^10.1.0",
"react-json-view": "^1.21.3",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
"tslib": "^2.4.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-google-gtag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
"tslib": "^2.4.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-ideal-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@docusaurus/lqip-loader": "2.0.0-beta.21",
"@docusaurus/responsive-loader": "^1.7.0",
"@docusaurus/theme-translations": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
"@endiliey/react-ideal-image": "^0.0.11",
"react-waypoint": "^10.1.0",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/theme-common": "2.0.0-beta.21",
"@docusaurus/theme-translations": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
"babel-loader": "^8.2.5",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"dependencies": {
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/logger": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils": "2.0.0-beta.21",
"@docusaurus/utils-common": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-preset-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"@docusaurus/plugin-sitemap": "2.0.0-beta.21",
"@docusaurus/theme-classic": "2.0.0-beta.21",
"@docusaurus/theme-common": "2.0.0-beta.21",
"@docusaurus/theme-search-algolia": "2.0.0-beta.21"
"@docusaurus/theme-search-algolia": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/docusaurus-theme-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/mdx-loader": "2.0.0-beta.21",
"@docusaurus/module-type-aliases": "2.0.0-beta.21",
"@docusaurus/plugin-content-blog": "2.0.0-beta.21",
"@docusaurus/plugin-content-docs": "2.0.0-beta.21",
"@docusaurus/plugin-content-pages": "2.0.0-beta.21",
"@docusaurus/theme-common": "2.0.0-beta.21",
"@docusaurus/theme-translations": "2.0.0-beta.21",
"@docusaurus/types": "2.0.0-beta.21",
"@docusaurus/utils": "2.0.0-beta.21",
"@docusaurus/utils-common": "2.0.0-beta.21",
"@docusaurus/utils-validation": "2.0.0-beta.21",
Expand All @@ -40,7 +43,8 @@
"prismjs": "^1.28.0",
"react-router-dom": "^5.3.3",
"rtlcss": "^3.5.0",
"tslib": "^2.4.0"
"tslib": "^2.4.0",
"utility-types": "^3.10.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.21",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-theme-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/mdx-loader": "2.0.0-beta.21",
"@docusaurus/module-type-aliases": "2.0.0-beta.21",
"@docusaurus/plugin-content-blog": "2.0.0-beta.21",
"@docusaurus/plugin-content-docs": "2.0.0-beta.21",
"@docusaurus/plugin-content-pages": "2.0.0-beta.21",
"@docusaurus/utils": "2.0.0-beta.21",
"@types/history": "^4.7.11",
"@types/react": "*",
"@types/react-router-config": "*",
"clsx": "^1.1.1",
"parse-numeric-range": "^1.3.0",
"prism-react-renderer": "^1.3.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"license": "MIT",
"dependencies": {
"@types/history": "^4.7.11",
"commander": "^5.1.0",
"history": "^4.9.0",
"joi": "^17.6.0",
"react-helmet-async": "^1.3.0",
"utility-types": "^3.10.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/docusaurus-utils-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@
"dependencies": {
"tslib": "^2.4.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.21"
"peerDependencies": {
"@docusaurus/types": "*"
},
"peerDependenciesMeta": {
"@docusaurus/types": {
"optional": true
}
},
"engines": {
"node": ">=16.14"
Expand Down
8 changes: 8 additions & 0 deletions packages/docusaurus-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,13 @@
"@types/micromatch": "^4.0.2",
"@types/react-dom": "^18.0.5",
"dedent": "^0.7.0"
},
"peerDependencies": {
"@docusaurus/types": "*"
},
"peerDependenciesMeta": {
"@docusaurus/types": {
"optional": true
}
}
}