Skip to content

refactor: replace yargs-parser with Node.js util.parseArgs#348

Open
ilteoood wants to merge 5 commits into
fastify:mainfrom
ilteoood:chore/parseargs
Open

refactor: replace yargs-parser with Node.js util.parseArgs#348
ilteoood wants to merge 5 commits into
fastify:mainfrom
ilteoood:chore/parseargs

Conversation

@ilteoood

Copy link
Copy Markdown
Contributor

Summary

  • Replace yargs-parser dependency with Node.js built-in util.parseArgs
  • Reduces external dependencies

Test plan

  • All 58 tests pass
  • Lint passes

ilteoood added 2 commits May 26, 2026 15:36
Use Node.js built-in util.parseArgs instead of yargs-parser dependency.
This reduces external dependencies while maintaining the same argument
parsing behavior.
- Remove no- prefix boolean handling (never used)
- Remove single-quote stripping (never exercised)
@Tony133 Tony133 requested a review from Eomm May 28, 2026 09:00
Comment thread lib/args.js Outdated
Comment thread lib/args.js Outdated
ilteoood added 2 commits May 29, 2026 08:49
…onsConfig

Replace the hardcoded booleanOptions Set with a derived check from optionsConfig,
and generate module.exports.argsNames dynamically by filtering optionsConfig
instead of maintaining duplicate hardcoded arrays.

Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com>
Single pass over optionsConfig to build argsNames object.

Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com>
@ilteoood ilteoood requested a review from Eomm May 29, 2026 09:17
Comment thread lib/args.js
Drop the normalizeArgs helper and rely on util.parseArgs clean format
(--flag=value). Boolean values are still converted to native booleans by
the post-processing loop, so --help=true keeps working.

BREAKING CHANGE: passing boolean options as a separate value is no longer
supported. Use --help=true (or just --help) instead of --help true.
@Tony133 Tony133 requested a review from Eomm June 7, 2026 14:26
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