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(macro): add lingui peer dependencies #1187

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

ardeois
Copy link
Contributor

@ardeois ardeois commented Jan 7, 2022

When @lingui/macro generates code, it could create imports using @lingui/core
or @lingui/react
With PNPM dependency manager, we need those peer dependencies, otherwise the build
could fail as we'll have missing or wrong dependencies.

Currently in one of our monorepo using different versions of lingui (v2 and v3),
typescript gets confused when we use @lingui/macro@v3. It sometimes resolves
@lingui/core@v2 even if our package.json dependencies declare @lingui/core@v3.

By setting @lingui/macro peer dependencies, the problem disappears

When @lingui/macro generates code, it could create imports using `@lingui/core`
or `@lingui/react`
With PNPM dependency manager, we need those peer dependencies, otherwise the build
could fail as we'll have missing or wrong dependencies.

Currently in one of our monorepo using different versions of lingui (v2 and v3),
typescript gets confused when we use `@lingui/macro@v3`. It sometimes resolves
`@lingui/core@v2` even if our `package.json` dependencies declare `@lingui/core@v3`.

By setting `@lingui/macro` peer dependencies, the problem disappears
@vercel
Copy link

vercel bot commented Jan 7, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/lingui-js/js-lingui/9zAV2jrt8ndc2YuMeuEQeQe8e6YV
✅ Preview: Failed

@codecov
Copy link

codecov bot commented Jan 7, 2022

Codecov Report

Merging #1187 (5326d44) into main (e62a606) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1187   +/-   ##
=======================================
  Coverage   81.76%   81.76%           
=======================================
  Files          56       56           
  Lines        1766     1766           
  Branches      490      490           
=======================================
  Hits         1444     1444           
  Misses        192      192           
  Partials      130      130           

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 e62a606...5326d44. Read the comment docs.

@semoal semoal merged commit daaa773 into lingui:main Jan 21, 2022
@semoal
Copy link
Contributor

semoal commented Jan 21, 2022

Thanks mate, will try to release a new version today

@ardeois ardeois deleted the fix/lingui-macro-peer-deps branch January 21, 2022 15:36
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.

2 participants