Skip to content

build: replace cosmiconfig with lilconfig - #219

Open
stianjensen wants to merge 2 commits into
lirantal:mainfrom
stianjensen:build/replace-cosmiconfig-with-lilconfig
Open

build: replace cosmiconfig with lilconfig#219
stianjensen wants to merge 2 commits into
lirantal:mainfrom
stianjensen:build/replace-cosmiconfig-with-lilconfig

Conversation

@stianjensen

@stianjensen stianjensen commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Swaps cosmiconfig (26 transitive packages, ~1.1MB) for lilconfig + yaml (2 zero-dependency packages, ~714KB) in the lockfile-lint CLI.

Config file loading behavior is preserved: YAML loaders are wired up for .lockfile-lintrc.yaml/.yml and the extension-less .lockfile-lintrc, and stopDir pins the search to the starting directory, matching cosmiconfig@9's default of not traversing up the directory tree.

Types of changes

  • Bug fix (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 change)

Related Issue

Motivation and Context

Helps reduce supply chain risk and high dependency count of installing this package by using slimmer, more modern dependencies.

How Has This Been Tested?

Ran test suite locally, and verified config with both json and yaml-based config.

Screenshots (if appropriate):

Checklist:

  • I have updated the documentation (if required).
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I added a picture of a cute animal cause it's fun

I hope it's okay I just opened this PR without no issue / prior discussion! I may want to look into a few of the other dependencies as well, if there's interest.


Summary by cubic

Replaced cosmiconfig with lilconfig + yaml in the CLI to cut dependencies without changing config behavior. Search is pinned to the start directory, and .lockfile-lintrc, .lockfile-lintrc.yaml/.yml, and extension-less configs are parsed as YAML.

  • Dependencies
    • Removed cosmiconfig; added lilconfig and yaml.
    • Reduced transitive deps from 26 (~1.1 MB) to 2 zero-dep packages (~714 KB).

Written for commit 64c225f. Summary will update on new commits.

Review in cubic

Swaps cosmiconfig (26 transitive packages, ~1.1MB) for lilconfig + yaml
(2 zero-dependency packages, ~714KB) in the lockfile-lint CLI.

Config file loading behavior is preserved: YAML loaders are wired up for
.lockfile-lintrc.yaml/.yml and the extension-less .lockfile-lintrc, and
stopDir pins the search to the starting directory, matching
cosmiconfig@9's default of not traversing up the directory tree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.02%. Comparing base (72a368d) to head (64c225f).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #219   +/-   ##
=======================================
  Coverage   98.01%   98.02%           
=======================================
  Files          13       13           
  Lines         404      406    +2     
  Branches       96       96           
=======================================
+ Hits          396      398    +2     
  Misses          8        8           

☔ View full report in Codecov by Harness.
📢 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Re-trigger cubic

@lirantal
lirantal self-requested a review July 23, 2026 16:50
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