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: stripping origin if line numbers already strippped #1143

Conversation

luludan
Copy link
Contributor

@luludan luludan commented Oct 2, 2021

Given config with lineNumbers: false, if you run extract, and then subsequently run extract with the watcher on the entire origin is stripped.

Line 30 in po.ts was slicing regardless of the length of the array.

Modified this to destructure the array and remove the unnecessary joinOrigin call.

Added a new test as I wasn't quite sure how to modify the existing one to include this case 🤔

@vercel
Copy link

vercel bot commented Oct 2, 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/CZecCXTQikx4PhxnRqM3WWHFPvHm
✅ Preview: https://js-lingui-git-fork-luludan-fix-stripping-origi-754076-lingui-js.vercel.app

@codecov
Copy link

codecov bot commented Oct 2, 2021

Codecov Report

Merging #1143 (c1063f6) into main (a9bffdd) will not change coverage.
The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1143   +/-   ##
=======================================
  Coverage   82.34%   82.34%           
=======================================
  Files          56       56           
  Lines        1705     1705           
  Branches      469      469           
=======================================
  Hits         1404     1404           
  Misses        176      176           
  Partials      125      125           
Impacted Files Coverage Δ
packages/cli/src/api/catalog.ts 81.48% <ø> (ø)
packages/cli/src/api/formats/po-gettext.ts 83.73% <0.00%> (ø)
packages/cli/src/api/formats/po.ts 100.00% <100.00%> (ø)

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 5c5c8a7...c1063f6. Read the comment docs.

@semoal
Copy link
Contributor

semoal commented Oct 4, 2021

Thx for the contribution!!

@luludan
Copy link
Contributor Author

luludan commented Oct 8, 2021

Thanks for merging @semoal! Any idea when this might get shipped to npm?

@garcia206
Copy link

@semoal Any update on when this is going to be released?

@semoal
Copy link
Contributor

semoal commented Nov 26, 2021

Released with 3.13.0, enjoy it!
Sorry for the late release, has been really busy lately.
https://github.com/lingui/js-lingui/releases/tag/v3.13.0

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.

3 participants