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: exports attribute on package.json, expo compat #997

Merged
merged 1 commit into from
Mar 7, 2021

Conversation

renchap
Copy link
Contributor

@renchap renchap commented Mar 7, 2021

React Native's Metro bundler expects all imports to be declared in the exports attribute when there is one defined.
Lingui imports it (to get the version I guess?) and Metro refuses it as it was not defined as a valid export.
See eemeli/make-plural#15 for a similar issue on the make-plural package

The main field for @babel/macro was also incorrect as there is no index.ts in this project.

These 2 changes allowed me to successfully use Lingui on a React Native project.

React Native's Metro bundler expects all imports to be declared in the `exports` attribute when there is one defined. Lingui imports it (to get the version I guess?) and Metro refuses it as it was not defined as a valid export.
See eemeli/make-plural#15 for a similar issue on the `make-plural` package

The `main` field for `@babel/macro` was also incorrect as there is no `index.ts` in this project.
@vercel
Copy link

vercel bot commented Mar 7, 2021

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/DWUmL7hxN5juBUKtQZriLtSdiJcZ
✅ Preview: https://js-lingui-git-fork-renchap-fix-package-json-react-n-8030e1.vercel.app

@codecov
Copy link

codecov bot commented Mar 7, 2021

Codecov Report

Merging #997 (6364b9e) into main (ecf83c3) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #997   +/-   ##
=======================================
  Coverage   83.24%   83.24%           
=======================================
  Files          53       53           
  Lines        1611     1611           
  Branches      432      432           
=======================================
  Hits         1341     1341           
  Misses        157      157           
  Partials      113      113           

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 b3d657c...6364b9e. Read the comment docs.

@semoal
Copy link
Contributor

semoal commented Mar 7, 2021

Ah super Renaud! thanks for the contribution :)

@semoal semoal changed the title Small fixes to packages.json for react-native compat fix: exports attribute on package.json, expo compat Mar 7, 2021
@semoal semoal merged commit 79aa509 into lingui:main Mar 7, 2021
@semoal
Copy link
Contributor

semoal commented Mar 7, 2021

Released 3.7.1 with this fix =)

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

2 participants