Skip to content

chore!: replace cosmiconfig with lilconfig in configuration handling#2286

Merged
andrii-bodnar merged 13 commits intolingui:nextfrom
yslpn:chore/replace-cosmiconfig-with-lilconfig
Jan 28, 2026
Merged

chore!: replace cosmiconfig with lilconfig in configuration handling#2286
andrii-bodnar merged 13 commits intolingui:nextfrom
yslpn:chore/replace-cosmiconfig-with-lilconfig

Conversation

@yslpn
Copy link
Contributor

@yslpn yslpn commented Jul 14, 2025

Description

  1. Replace cosmiconfig with lilconfig. A zero-dependency alternative with the same API. Comparison: https://node-modules.dev/#install=cosmiconfig vs https://node-modules.dev/#install=lilconfig

  2. Support for Yaml configs has been removed.

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
  • Examples update

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 the necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Jul 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
js-lingui Ready Ready Preview Jan 28, 2026 8:59am

Request Review

@codecov
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.82%. Comparing base (dd43fb0) to head (894470d).
⚠️ Report is 287 commits behind head on next.

Files with missing lines Patch % Lines
packages/conf/src/getConfig.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             next    #2286       +/-   ##
===========================================
+ Coverage   76.66%   87.82%   +11.15%     
===========================================
  Files          81      113       +32     
  Lines        2083     3301     +1218     
  Branches      532      969      +437     
===========================================
+ Hits         1597     2899     +1302     
+ Misses        375      362       -13     
+ Partials      111       40       -71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timofei-iatsenko
Copy link
Collaborator

Lilconfig is smaller mostly because it doesn't have a yaml parser in it. And it means no yaml configuration files would be supported. Despite the fact that i removed all mentions of yaml config from docs, technically it still a breaking change.

@yslpn
Copy link
Contributor Author

yslpn commented Jul 15, 2025

Despite the fact that i removed all mentions of yaml config from docs, technically it still a breaking change.

You are right. But then I suggest adding yaml support via a separate module and adding deprecation warning.

@timofei-iatsenko
Copy link
Collaborator

@yslpn i'm proposing to include this into upcoming v6. Please reopen that PR and change target to the "next" branch. Also it's now safe to drop yaml support.

@yslpn yslpn reopened this Jan 15, 2026
@vercel
Copy link

vercel bot commented Jan 15, 2026

@yslpn is attempting to deploy a commit to the Crowdin Team on Vercel.

A member of the Team first needs to authorize it.

@yslpn yslpn changed the base branch from main to next January 15, 2026 21:21
@yslpn yslpn marked this pull request as ready for review January 15, 2026 21:24
@timofei-iatsenko
Copy link
Collaborator

@yslpn i'm also looking into https://www.npmjs.com/package/c12 may be it worth changing? (mjs, ts, etc) supported out of the box, without extra configuration on lingui side, wdyt? Have you looked into this one?

@yslpn
Copy link
Contributor Author

yslpn commented Jan 27, 2026

@yslpn i'm also looking into https://www.npmjs.com/package/c12 may be it worth changing? (mjs, ts, etc) supported out of the box, without extra configuration on lingui side, wdyt? Have you looked into this one?

I haven't seen a package like this before. Thank you. But I like lilconfig because it doesn't have many features and no dependencies.

c12 has 12 dependencies. Furthermore, c12 has a fully asynchronous API, so a lot of changes will be required.

@timofei-iatsenko
Copy link
Collaborator

@yslpn could you rebase (or merge) this branch onto next and resolve conflicts

@yslpn
Copy link
Contributor Author

yslpn commented Jan 27, 2026

@yslpn could you rebase (or merge) this branch onto next and resolve conflicts

@timofei-iatsenko Done

@timofei-iatsenko
Copy link
Collaborator

@yslpn @andrii-bodnar LGTM, could be merged

@andrii-bodnar andrii-bodnar changed the title chore: replace cosmiconfig with lilconfig in configuration handling chore!: replace cosmiconfig with lilconfig in configuration handling Jan 28, 2026
@andrii-bodnar andrii-bodnar merged commit 83fa893 into lingui:next Jan 28, 2026
10 checks passed
@andrii-bodnar andrii-bodnar added this to the v6 milestone Jan 29, 2026
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