Skip to content

SWC Based Extractor POC#200

Draft
timofei-iatsenko wants to merge 34 commits intomainfrom
extractor
Draft

SWC Based Extractor POC#200
timofei-iatsenko wants to merge 34 commits intomainfrom
extractor

Conversation

@timofei-iatsenko
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko commented Feb 22, 2026

This PR:

  • turn this repo into a monorepo with a few crates and few packages
  • add a crate with extractor Visitor for SWC + function to run this visitor over program
  • Add napi-rs for JS bindings
  • existing macro plugin moved into a subfolder inside crates
  • Tests are added to cover extractor and different edge cases.

TODO:

  • more error handling cases in extractor - show codeframe for unknown nodes, parsing errors, etc
  • decide where and how this repo should be organized:
    • Should it be moved to the main repo.
    • Should this repo be renamed to reflect the fact that now it holds more tools
  • setup a build pipeline:
    • bump version for packages in the monorepo - rust cargo and package.json
    • publish crates
    • publish js packages to npm
    • publish platform specific binaries

napi-rs shipped with a built in github pipelines to produce and publish platform specific binaries. However it doesn't created for monorepos, it assumes that the whole repo holds only on package. So manual work still needed.

I want to have lingui plugin and extractor close together so they always in sync, so we at minumum should be able to release these 2 from a monorepo.

At maximum it would be good to also publish rust crates, so other developers may use them in their tooling if they want.

@timofei-iatsenko timofei-iatsenko changed the title SWC Based Extractor SWC Based Extractor POC Feb 22, 2026
@timofei-iatsenko timofei-iatsenko force-pushed the extractor branch 4 times, most recently from 611bfe1 to a2045d4 Compare February 25, 2026 10:04
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 78.17797% with 103 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.65%. Comparing base (7981816) to head (a1d819d).

Files with missing lines Patch % Lines
napi-rs/src/lib.rs 0.00% 67 Missing ⚠️
.../lingui_extractor/src/message_extractor_visitor.rs 90.50% 32 Missing ⚠️
crates/lingui_extractor/src/message_extractor.rs 93.93% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
- Coverage   92.69%   88.65%   -4.04%     
==========================================
  Files           8       11       +3     
  Lines        1465     1737     +272     
==========================================
+ Hits         1358     1540     +182     
- Misses        107      197      +90     
Flag Coverage Δ
unittests 88.65% <78.17%> (-4.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/lingui_macro/src/ast_utils.rs 83.82% <ø> (ø)
crates/lingui_macro/src/builder.rs 98.78% <ø> (ø)
crates/lingui_macro/src/generate_id.rs 100.00% <ø> (ø)
crates/lingui_macro/src/js_macro_folder.rs 98.02% <ø> (ø)
crates/lingui_macro/src/jsx_visitor.rs 88.41% <ø> (ø)
crates/lingui_macro/src/lib.rs 91.91% <100.00%> (ø)
crates/lingui_macro/src/macro_utils.rs 87.93% <ø> (ø)
crates/lingui_macro/src/options.rs 100.00% <ø> (ø)
crates/lingui_extractor/src/message_extractor.rs 93.93% <93.93%> (ø)
.../lingui_extractor/src/message_extractor_visitor.rs 90.50% <90.50%> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant