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(module-type-aliases): move @type packages to dependencies #5601

Merged
merged 3 commits into from
Sep 22, 2021

Conversation

Josh-Cena
Copy link
Collaborator

Motivation

Should fix #5463. It seems we can also update the docs since installing @docusaurus/module-type-aliases would install all the @types/* dependencies so they no longer need to be installed separately?

Also removed index.js file from docusaurus-types as it doesn't really make sense.

Have you read the Contributing Guidelines on pull requests?

Yes

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 22, 2021
@netlify
Copy link

netlify bot commented Sep 22, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: 14cc853

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/614ad3a6e4b86f00073b7b0d

😎 Browse the preview: https://deploy-preview-5601--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Sep 22, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 92
🟢 Accessibility 98
🟢 Best practices 93
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5601--docusaurus-2.netlify.app/

@netlify
Copy link

netlify bot commented Sep 22, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: e3a3cff

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/614b0c2655799c0007486391

😎 Browse the preview: https://deploy-preview-5601--docusaurus-2.netlify.app

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks, just missing ts template update?


```bash npm2yarn
npm install --save-dev typescript @docusaurus/module-type-aliases @types/react @types/react-router-dom @types/react-helmet @tsconfig/docusaurus
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove those from the TS template as well?

Are you sure it works? I don't think we have any e2e test on this yet

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependencies will be installed transitively but devDependencies don't, so afaik it should work. I'll update the template and check it out

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, let me know if the TS template still works

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking longer than I thought🧐 Tried to set up a verdaccio registry locally, but when I npm_config_registry=http://localhost:4873 yarn install, I still get the real 2.0.0-beta.6 version on npm

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slorber Tested, it's working🎉

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

FYI I added a readme in init package with simpler local testing instructions without Verdaccio:


@docusaurus/init

Create Docusaurus apps easily.

Usage

Please see the installation documentation.

For maintainers

For Docusaurus maintainers, templates can be tested with:

cd `git rev-parse --show-toplevel` # Back to repo root
rm -rf test-website
yarn docusaurus-init init test-website classic
cd test-website
yarn start

Note: test-website is not part of the workspace and use packages from npm.

Use the following to test the templates against local packages:

cd `git rev-parse --show-toplevel` # Back to repo root
rm -rf test-website-in-workspace
yarn docusaurus-init init test-website-in-workspace classic
cd test-website-in-workspace
yarn start

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, the problem here is whether npm installs @types/ dependencies transitively, so I do need to mock that process of running the whole yarn install process

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see 😅

packages/docusaurus-types/src/index.js Show resolved Hide resolved
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module '"@docusaurus/router"' has no exported member 'matchPath'
3 participants