Skip to content

chore!: Replace nyc with c8 (with yargs v18 override)#198

Merged
breautek merged 2 commits into
apache:masterfrom
breautek:update-nyc
Jun 18, 2026
Merged

chore!: Replace nyc with c8 (with yargs v18 override)#198
breautek merged 2 commits into
apache:masterfrom
breautek:update-nyc

Conversation

@breautek

@breautek breautek commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Platforms affected

Motivation and Context

Updates nyc to the latest version which removes the uuid dependency, a source of audited vulnerabilities. v18 node engines is already satisfied with our engines that is committed into the master branch.

Description

This PR is built on top of #197 so once that PR is merged, the commit count in this PR should become 1.

Testing

npm test

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.50%. Comparing base (d769121) to head (31a819a).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #198       +/-   ##
===========================================
- Coverage   82.92%   64.50%   -18.43%     
===========================================
  Files           5        5               
  Lines          82      293      +211     
===========================================
+ Hits           68      189      +121     
- Misses         14      104       +90     

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

@breautek breautek mentioned this pull request Jun 17, 2026
5 tasks
@erisu

erisu commented Jun 18, 2026

Copy link
Copy Markdown
Member

We replaced nyc with c8 in the other repos, so I think we could do the same here. It should be a straightforward change. We only have to replace the package, then update the package.json configuration and command usage by changing nyc to c8.

Also, @dpogue had been overriding the yargs dependency in c8 recently, but I don't remember the exact reason.

"overrides": {
  "c8": {
    "yargs": "^18.0.0"
  }
}

For consistency, we could include the same override here.

One thing to be aware of is that yargs has a minimum Node.js version requirement of ^20.19.0 || ^22.12.0 || >=23, which is higher than what we had defined: >=20.17.0 || >=22.9.0. I believe its OK to keep our minimum since their requirements are development dependency. If we wanted to reflect that distinction in our package.json, I believe we could set the devEngines property.

@dpogue

dpogue commented Jun 18, 2026

Copy link
Copy Markdown
Member

yargs 17 (which c8 depends on) is not compatible with Node 26: yargs/yargs#2509

c8 is a devDependency, so we have a bit of flexibility in terms of upgrading without forcing a major version bump to our public API

@breautek
breautek marked this pull request as ready for review June 18, 2026 13:07
@breautek

Copy link
Copy Markdown
Contributor Author

definitely not a fan of using the overrides but I can replace nyc with c8 with the yargs override for the sake of consistency.

@breautek

Copy link
Copy Markdown
Contributor Author
norman@norman-workstation:/development/cordova/breautek/cordova-plugman$ npm ls yargs
plugman@4.0.0-dev /development/cordova/breautek/cordova-plugman
└─┬ c8@11.0.0 overridden
  └── yargs@18.0.0 overridden

Had to also run npm upgrade which might have updated other sub-packages otherwise it produced:

npm ls yargs
plugman@4.0.0-dev /development/cordova/breautek/cordova-plugman
└─┬ c8@11.0.0 overridden
  └── yargs@17.7.2 invalid: "^18.0.0" from node_modules/c8 overridden

npm error code ELSPROBLEMS
npm error invalid: yargs@17.7.2 /development/cordova/breautek/cordova-plugman/node_modules/c8/node_modules/yargs
npm error A complete log of this run can be found in: /home/norman/.npm/_logs/2026-06-18T13_13_03_088Z-debug-0.log

@breautek breautek changed the title chore: Update nyc chore!: Replace nyc with c8 (with yargs v18 override) Jun 18, 2026
@breautek

Copy link
Copy Markdown
Contributor Author

Didn't change branch names but did update the title and commit message accordingly.

@breautek
breautek requested review from dpogue and erisu June 18, 2026 13:18
Comment thread package.json Outdated
Co-authored-by: エリス <erisu@users.noreply.github.com>
@breautek
breautek merged commit aa2e0a4 into apache:master Jun 18, 2026
11 checks passed
@breautek
breautek deleted the update-nyc branch June 18, 2026 15:19
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.

4 participants