Skip to content

feat: support loading config with array exports - #272

Merged
pi0 merged 5 commits into
unjs:mainfrom
carson2222:main
Sep 15, 2025
Merged

pi0 merged 5 commits into
unjs:mainfrom
carson2222:main

Conversation

@carson2222

Copy link
Copy Markdown
Contributor
  • Updated loadConfig to return arrays directly from the main config without merging.
  • Added error handling for required config files.
  • Modified ConfigLayer interface to allow optional config property.
  • Introduced tests to verify the new behavior with array configurations.

resolves #92

- Updated `loadConfig` to return arrays directly from the main config without merging.
- Added error handling for required config files.
- Modified `ConfigLayer` interface to allow optional config property.
- Introduced tests to verify the new behavior with array configurations.
Comment thread src/loader.ts Resolved
@pi0 pi0 changed the title feat: enhance config loading to support array exports without merging feat: support loading config with array exports Sep 11, 2025
@codecov

codecov Bot commented Sep 11, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.30%. Comparing base (42d9697) to head (c8706df).
⚠️ Report is 163 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #272      +/-   ##
==========================================
+ Coverage   76.92%   78.30%   +1.37%     
==========================================
  Files           7        6       -1     
  Lines         806      636     -170     
  Branches       80      129      +49     
==========================================
- Hits          620      498     -122     
+ Misses        184      138      -46     
+ Partials        2        0       -2     

☔ 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.

Comment thread src/loader.ts Resolved
Comment thread src/types.ts Resolved

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. I have slightly changed implementation so that in array case, we avoid merge and extend but still leverage rest of the features like rc loaded in layers (can still be enable/disabled) and hooks being called in place.

@pi0
pi0 merged commit b747561 into unjs:main Sep 15, 2025
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.

Support array configurations for multi config

2 participants