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(compile): remove verbose output when using template (*.pot) #1388

Conversation

timofei-iatsenko
Copy link
Collaborator

Description

When using flow with ".pot" file it generates unneeded log entries on every catalog load.
This was done unintentional and fixed in this PR.

I also added integration test for the compile cli command covering this and related cases.

There is also a growing problem with @lingui/conf package. Typings in src and and index.d.ts are mismatched, and bringing potential problems and blocking from implementing standard flow. I hope i will take this into work in the near future.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Fixes # (issue)

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Jan 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 6, 2023 at 0:34AM (UTC)

@github-actions
Copy link

github-actions bot commented Jan 31, 2023

size-limit report 📦

Path Size
./packages/core/build/esm/index.js 1.76 KB (0%)
./packages/detect-locale/build/esm/index.js 812 B (0%)
./packages/react/build/esm/index.js 1.79 KB (0%)
./packages/remote-loader/build/esm/index.js 7.29 KB (0%)

packages/cli/src/lingui-compile.ts Show resolved Hide resolved
packages/cli/src/lingui-compile.ts Show resolved Hide resolved
packages/cli/src/lingui-compile.ts Show resolved Hide resolved
packages/cli/src/lingui-compile.ts Outdated Show resolved Hide resolved
packages/cli/src/test/compile.test.ts Show resolved Hide resolved
packages/conf/src/index.ts Show resolved Hide resolved
@timofei-iatsenko timofei-iatsenko changed the title fix(compile): remove verbose output when using flow with template fix(compile): remove verbose output when using template flow (*.pot) Jan 31, 2023
@timofei-iatsenko timofei-iatsenko changed the title fix(compile): remove verbose output when using template flow (*.pot) fix(compile): remove verbose output when using template (*.pot) Jan 31, 2023
@timofei-iatsenko
Copy link
Collaborator Author

@andrii-bodnar any doubts here?

@andrii-bodnar
Copy link
Contributor

@andrii-bodnar any doubts here?

Will finish the review today

packages/cli/src/api/catalog.ts Show resolved Hide resolved
packages/cli/src/test/compile.test.ts Show resolved Hide resolved
packages/cli/src/lingui-compile.ts Outdated Show resolved Hide resolved
packages/cli/src/lingui-compile.ts Show resolved Hide resolved
@timofei-iatsenko timofei-iatsenko force-pushed the fix/verbose-logging-with-pot-file branch 2 times, most recently from 991a17c to a65d662 Compare February 3, 2023 13:13
@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Base: 68.40% // Head: 69.75% // Increases project coverage by +1.35% 🎉

Coverage data is based on head (231e0d0) compared to base (8579090).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1388      +/-   ##
==========================================
+ Coverage   68.40%   69.75%   +1.35%     
==========================================
  Files          72       72              
  Lines        2124     2123       -1     
  Branches      573      572       -1     
==========================================
+ Hits         1453     1481      +28     
+ Misses        542      507      -35     
- Partials      129      135       +6     
Impacted Files Coverage Δ
packages/cli/src/api/catalog.ts 85.77% <ø> (+0.69%) ⬆️
packages/jest-mocks/index.ts 95.83% <ø> (ø)
packages/cli/src/lingui-compile.ts 30.58% <100.00%> (+30.58%) ⬆️
packages/conf/src/index.ts 85.18% <100.00%> (+0.37%) ⬆️
packages/cli/src/api/help.ts 10.00% <0.00%> (+10.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@timofei-iatsenko
Copy link
Collaborator Author

What's left to merge this pr?

@andrii-bodnar
Copy link
Contributor

@thekip the codecov reports a 2.70% coverage decrease, could you please check why this is happening?

@timofei-iatsenko
Copy link
Collaborator Author

Because codecov incorrectly calculate coverage. It calculates how many procents of imported files are covered. So if you have 100 files and 1 test which imports exactly one file and cover all lines in that file. codecov will show 100% coverage even when other 99 files not touched at all.

Exactly that is happened here, I added to test file which was never tested and imported in suite before and this file expanded "base" for a coverage.

@timofei-iatsenko
Copy link
Collaborator Author

It's not related to codecov itself, it related to how coverage tools works in general. They know only about files which were included in program when coverage was collected

@andrii-bodnar
Copy link
Contributor

@thekip thank you!

packages/conf/index.d.ts Outdated Show resolved Hide resolved
packages/cli/src/lingui-compile.ts Outdated Show resolved Hide resolved
@timofei-iatsenko
Copy link
Collaborator Author

rebased and updated

@timofei-iatsenko
Copy link
Collaborator Author

timofei-iatsenko commented Feb 6, 2023

I have no idea why windows tests a failing. There nothing related in this PR

May be simple rerun will help

@andrii-bodnar
Copy link
Contributor

@thekip it happens sometimes for unknown reason 😬
just restarted the job

@andrii-bodnar andrii-bodnar merged commit 31316f9 into lingui:main Feb 6, 2023
@timofei-iatsenko timofei-iatsenko deleted the fix/verbose-logging-with-pot-file branch February 6, 2023 13:28
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