Skip to content

lookup: add yargs#1106

Open
wesleytodd wants to merge 1 commit into
nodejs:mainfrom
wesleytodd:add-yargs
Open

lookup: add yargs#1106
wesleytodd wants to merge 1 commit into
nodejs:mainfrom
wesleytodd:add-yargs

Conversation

@wesleytodd
Copy link
Copy Markdown
Member

Due to yargs/yargs#2509 I believe yargs should be in CITM.

Currently it is failing because yargs does not ship a lockfile and uses prettier so it pulls in prettier breaking formatting changes into lint. I can open a PR to address this in yargs or we can exclude lint here whatever folks prefer (obviously easier to fix here).

Additionally, I think the issue that occurred was on yargs@17 not 18. Do we have precedent for testing multiple majors? I coudln't find any, but honestly express should have this as well until we can EOL v4. So any pointers on that would be great and I can open PRs for that.

Output from `citgm yargs`
./bin/citgm.js yargs
info: starting            | yargs
info: lookup              | yargs
info: lookup-found        | yargs
info: yargs lookup-replace| https://github.com/yargs/yargs/archive/3495aa675d57794a05e84429f3e62fd993009122.tar.gz
info: yargs npm:          | Downloading project: https://github.com/yargs/yargs/archive/3495aa675d57794a05e84429f3e62fd993009122.tar.gz
info: yargs npm:          | Project downloaded 3495aa675d57794a05e84429f3e62fd993009122.tar.gz
info: yargs npm:          | npm install started
info: yargs npm:          | npm install successfully completed
info: yargs npm:          | test suite started
error: failure             | The canary is dead:
error: failing module(s)   |
error: module name:        | yargs
error: version:            | 18.0.0
error: error:              | The canary is dead:
error: error:              | undefined
error:                     | > yargs@18.0.0 prepare
error:                     | > npm run compile
error:                     |
error:                     |
error:                     | > yargs@18.0.0 compile
error:                     | > rimraf build && tsc
error:                     |
error:                     |
error:                     | added 547 packages in 27s
error:                     |
error:                     | > yargs@18.0.0 pretest
error:                     | > npm run compile -- -p tsconfig.test.json
error:                     |
error:                     |
error:                     | > yargs@18.0.0 compile
error:                     | > rimraf build && tsc -p tsconfig.test.json
error:                     |
error:                     |
error:                     | > yargs@18.0.0 test
error:                     | > c8 mocha --enable-source-maps ./test/*.mjs --require ./test/before.mjs --timeout=24000 --check-leaks
error:                     |
error:                     |
error:                     |
error:                     | ✔ should expose yargs-parser as Parser
... <truncated for PR body limit> ...
error:                     | ✔ throws if any async method is used
error:                     |
error:                     |
error:                     | 826 passing (6s)
error:                     | 1 pending
error:                     |
error:                     | --------------------------|---------|----------|---------|---------|--------------------------------
error:                     | File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
error:                     | --------------------------|---------|----------|---------|---------|--------------------------------
error:                     | All files                 |     100 |    96.43 |     100 |     100 |
error:                     | yargs                    |     100 |      100 |     100 |     100 |
error:                     | index.mjs               |     100 |      100 |     100 |     100 |
error:                     | yargs/helpers            |     100 |      100 |     100 |     100 |
error:                     | helpers.mjs             |     100 |      100 |     100 |     100 |
error:                     | yargs/lib                |     100 |    96.59 |     100 |     100 |
error:                     | argsert.ts              |     100 |      100 |     100 |     100 |
error:                     | command.ts              |     100 |      100 |     100 |     100 |
error:                     | completion-templates.ts |     100 |      100 |     100 |     100 |
error:                     | completion.ts           |     100 |    93.84 |     100 |     100 | 45-46,98,260,265,343
error:                     | middleware.ts           |     100 |    97.22 |     100 |     100 | 54
error:                     | parse-command.ts        |     100 |      100 |     100 |     100 |
error:                     | usage.ts                |     100 |    95.85 |     100 |     100 | ...304,554,563,565,638,730,826
error:                     | validation.ts           |     100 |    98.42 |     100 |     100 | 69,355
error:                     | yargs-factory.ts        |     100 |    95.72 |     100 |     100 | ...64-2065,2069,2162,2218,2251
error:                     | yerror.ts               |     100 |      100 |     100 |     100 |
error:                     | yargs/lib/platform-shims |     100 |       90 |     100 |     100 |
error:                     | esm.mjs                 |     100 |       90 |     100 |     100 | 53
error:                     | yargs/lib/typings        |     100 |      100 |     100 |     100 |
error:                     | common-types.ts         |     100 |      100 |     100 |     100 |
error:                     | yargs/lib/utils          |     100 |    93.93 |     100 |     100 |
error:                     | apply-extends.ts        |     100 |    95.65 |     100 |     100 | 16
error:                     | is-promise.ts           |     100 |      100 |     100 |     100 |
error:                     | levenshtein.ts          |     100 |    85.71 |     100 |     100 | 28-29
error:                     | maybe-async-result.ts   |     100 |      100 |     100 |     100 |
error:                     | obj-filter.ts           |     100 |      100 |     100 |     100 |
error:                     | process-argv.ts         |     100 |      100 |     100 |     100 |
error:                     | set-blocking.ts         |     100 |       80 |     100 |     100 | 10
error:                     | --------------------------|---------|----------|---------|---------|--------------------------------
error:                     |
error:                     | > yargs@18.0.0 posttest
error:                     | > npm run check
error:                     |
error:                     |
error:                     | > yargs@18.0.0 check
error:                     | > gts lint && npm run check:js
error:                     |
error:                     | version: 24
error:                     |
error:                     | /private/var/folders/k6/4f4fv9855cl79n44vnt6bnxr0000gn/T/de027c5d/yargs/lib/command.ts
error:                     | 794:42  error  Delete `⏎·`                                                                                                                                                                                       prettier/pr
error:                     | 796:3   error  Replace `··Pick<⏎······CommandHandler,⏎······'deprecated'·|·'description'·|·'handler'·|·'middlewares'⏎····` with `Pick<CommandHandler,·'deprecated'·|·'description'·|·'handler'·|·'middlewares'`  prettier/pr
error:                     | 800:1   error  Delete `··`                                                                                                                                                                                       prettier/pr
error:                     |
error:                     | /private/var/folders/k6/4f4fv9855cl79n44vnt6bnxr0000gn/T/de027c5d/yargs/lib/yargs-factory.ts
error:                     | 2378:31  error  Delete `⏎·`  prettier/prettier
error:                     | 2380:1   error  Delete `··`  prettier/prettier
error:                     | 2381:3   error  Delete `··`  prettier/prettier
error:                     | 2382:1   error  Delete `··`  prettier/prettier
error:                     | 2383:3   error  Delete `··`  prettier/prettier
error:                     | 2384:1   error  Delete `··`  prettier/prettier
error:                     | 2385:3   error  Delete `··`  prettier/prettier
error:                     | 2386:1   error  Delete `··`  prettier/prettier
error:                     | 2387:3   error  Delete `··`  prettier/prettier
error:                     | 2388:1   error  Delete `··`  prettier/prettier
error:                     | 2389:3   error  Delete `··`  prettier/prettier
error:                     | 2390:1   error  Delete `··`  prettier/prettier
error:                     | 2391:3   error  Delete `··`  prettier/prettier
error: error:              | 2392:1   error  Delete `··`  prettier/prettier
error:                     | 2393:3   error  Delete `··`  prettier/prettier
error:                     | 2394:1   error  Delete `··`  prettier/prettier
error:                     |
error:                     | ✖ 19 problems (19 errors, 0 warnings)
error:                     | 19 errors and 0 warnings potentially fixable with the `--fix` option.
error:                     |
error:                     |
error:                     | (node:99625) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
error:                     | (Use `node --trace-deprecation ...` to show where the warning was created)
error: done                | The smoke test has failed.
info: duration            | test duration: 41149ms

cc @bcoe @shadowspawn @nicolo-ribaudo

Checklist
  • npm test passes
  • contribution guidelines followed
    here

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.36%. Comparing base (1cbcf4c) to head (f6408f4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1106   +/-   ##
=======================================
  Coverage   96.36%   96.36%           
=======================================
  Files          29       29           
  Lines        2203     2203           
=======================================
  Hits         2123     2123           
  Misses         80       80           

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

Copy link
Copy Markdown
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

good start; we should absolutely be testing yargs 16, 17, and 18 (any major that supports non-EOL nodes)

@shadowspawn
Copy link
Copy Markdown
Member

Realistically, I do not think Yargs 18 is currently a good candidate for CITGM. The combination of no lockfile and low activity means builds can be broken for long periods: yargs/yargs#2393

Hard Requirements

  • The tests pass on supported major release lines
  • The maintainers of the module remain responsive when there are problems

@ljharb
Copy link
Copy Markdown
Member

ljharb commented May 23, 2026

It's still pretty important to know when a new node release will break it - node 26 breaking yargs 16 and 17 should have delayed the release imo.

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