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(v2): Add all webpack module aliases to type declaration file #2687

Merged
merged 1 commit into from
Apr 28, 2020
Merged

fix(v2): Add all webpack module aliases to type declaration file #2687

merged 1 commit into from
Apr 28, 2020

Conversation

SamChou19815
Copy link
Contributor

Motivation

With these additions, all typescript red squiggly lines will be gone once user install @docusaurus/module-type-aliases and create a types.d.ts that references @docusaurus/module-type-aliases.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  1. Add types.d.ts with content /// <reference types="@docusaurus/module-type-aliases" /> to the root of packages/docusaurus-theme-classic.
  2. Change some components' extension to tsx
  3. Imports that contains @docusaurus/..., styles.module.css and styles.css no longer has red squiggly lines.

Screen Shot 2020-04-27 at 21 58 32

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 28, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Apr 28, 2020

Deploy preview for docusaurus-2 ready!

Built with commit f1242b1

https://deploy-preview-2687--docusaurus-2.netlify.app

@lex111
Copy link
Contributor

lex111 commented Apr 28, 2020

@SamChou19815 will your PR solve this issue? #2675

@SamChou19815
Copy link
Contributor Author

@SamChou19815 will your PR solve this issue? #2675

Yes, but we will need another publish to include this change.

@lex111
Copy link
Contributor

lex111 commented Apr 28, 2020

@SamChou19815 excellent, I will make a new release of course!

@lex111 lex111 added this to the v2.0.0-alpha.54 milestone Apr 28, 2020
@lex111 lex111 added the pr: bug fix This PR fixes a bug in a past release. label Apr 28, 2020
@lex111 lex111 merged commit 94b712d into facebook:master Apr 28, 2020
@lex111
Copy link
Contributor

lex111 commented Apr 28, 2020

@SamChou19815 thank you!

@Ehesp
Copy link

Ehesp commented Apr 28, 2020

@lex111 have all of these changes been published?

I only have the declare module '@theme/*' within module-type-aliases, not the declare module '@docusaurus/*' ones? Version: "2.0.0-alpha.51":

image

@lex111
Copy link
Contributor

lex111 commented Apr 28, 2020

@Ehesp yes, I published a new version of D2 - v2.0.0-alpha.54, use it please.

@Ehesp
Copy link

Ehesp commented Apr 28, 2020

Ah thanks - that version wasn't showing on npm - updated and works. Thanks!

@SamChou19815 SamChou19815 deleted the add-all-modules-aliases branch May 9, 2020 17:41
yechs added a commit to Computerization/computerization.github.io that referenced this pull request May 10, 2020
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.

5 participants