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

chore: fix compile fail when use cnpm installed #19282

Merged
merged 1 commit into from Oct 18, 2019
Merged

chore: fix compile fail when use cnpm installed #19282

merged 1 commit into from Oct 18, 2019

Conversation

shaodahong
Copy link
Member

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#19254

💡 Background and solution

when using cnpm install, and npm run compile, typescript compile fail by reference type error, so I use back declare module ...

Before:

antd-tools run compile
[Parallel] Compile to es...
[Parallel] Compile to js...
components/config-provider/context.ts(33,14): error TS2742: The inferred type of 'ConfigConsumer' cannot be named without a reference to '_@types_react-lifecycles-compat@3.0.1@@types/react-lifecycles-compat/node_modules/@types/react'. This is likely not portable. A type annotation is necessary.
components/config-provider/context.ts(33,14): error TS2742: The inferred type of 'ConfigConsumer' cannot be named without a reference to '_@types_react-lifecycles-compat@3.0.1@@types/react-lifecycles-compat/node_modules/@types/react'. This is likely not portable. A type annotation is necessary.
TypeScript: 1 declaration error

After:

> antd-tools run compile

antd-tools run compile
[Parallel] Compile to es...
[Parallel] Compile to js...
[Compile] Finalization...
Wrote version into lib/version/index.js
Wrote version into lib/version/index.d.ts

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

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

Could you please add tests to make sure this change works as expected?

@netlify
Copy link

netlify bot commented Oct 18, 2019

Deploy preview for ant-design ready!

Built with commit 0c97af3

https://deploy-preview-19282--ant-design.netlify.com

@shaodahong
Copy link
Member Author

@codecov
Copy link

codecov bot commented Oct 18, 2019

Codecov Report

Merging #19282 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #19282   +/-   ##
=======================================
  Coverage   97.78%   97.78%           
=======================================
  Files         282      282           
  Lines        7625     7625           
  Branches     2144     2144           
=======================================
  Hits         7456     7456           
  Misses        169      169
Impacted Files Coverage Δ
components/upload/UploadList.tsx 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40aca57...0c97af3. Read the comment docs.

@yoyo837
Copy link
Contributor

yoyo837 commented Oct 18, 2019

没错了

@afc163 afc163 merged commit b280b63 into ant-design:master Oct 18, 2019
@shaodahong shaodahong deleted the fix-cnpm-compile-fail branch October 18, 2019 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants