feat(deps): upgrade cosmiconfig to 7.1.0#573
Conversation
Switch to the named cosmiconfig export, tighten buildConfig typing for v7 results, and load configFile paths without a redundant search() call. Rebases the original itgalaxy#573 upgrade onto current master with cosmiconfig coverage tests from itgalaxy#655. Closes itgalaxy#572 Co-authored-by: Cursor <cursoragent@cursor.com>
f6bae90 to
861569d
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s configuration-loading dependency (cosmiconfig) to v7 and adjusts the standalone entrypoint to compile against the new module export shape.
Changes:
- Bump
cosmiconfigto^7.0.1. - Update the
cosmiconfigimport usage insrc/standalone/index.ts. - Regenerate lockfile entries consistent with the updated dependency tree.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/standalone/index.ts |
Updates cosmiconfig import; adjusts config-loading behavior (but introduces/retains issues around search(null) and any casting). |
package.json |
Updates cosmiconfig dependency range to ^7.0.1. |
package-lock.json |
Updates resolved dependency graph for cosmiconfig v7 and related transitive dependencies. |
Comments suppressed due to low confidence (1)
src/standalone/index.ts:6
- This import uses spacing that differs from the surrounding imports in this file (which use
{foo, bar}with no inner spaces). Keeping it consistent reduces noisy diffs when formatting is applied.
import path from "path";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!config) { | ||
| return {}; | ||
| return {} as any; | ||
| } |
| if (!config) { | ||
| return {}; | ||
| return {} as any; | ||
| } |
|
Added advanced YAML regression coverage in `d17f926` on `itgalaxy/webfont@update-consmiconfig-7` (push to the original fork branch was denied). The new test fixture exercises anchors, aliases, flow collections, and YAML 1.1 truthy scalars (`yes`/`on`) under cosmiconfig v7's `yaml` parser, and asserts woff2 generation still works. |
Summary
cosmiconfigfrom 5.2.x to 7.1.0 (named export API).buildConfigwith proper v7 result typing and loadconfigFilewithout a redundantsearch()call.master(includes cosmiconfig coverage from test: expand cosmiconfig coverage before upgrade #655, Release Please ADR, Lefthook, etc.).Supersedes the original 2022 draft; all 66 tests pass, including
src/standalone/cosmiconfig.test.ts.Closes #572
Test plan
npm test— 66 tests passingwebfont.config.js,package.json, walk-up--configrelative, absolute, andnode_modulespackage nameresult.config.filePathoutput metadata unchanged