GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: ensure `--version` prints the CLI's own version by andreww2012 · Pull Request #698 · all-contributors/cli

Conversation

@andreww2012

@andreww2012 andreww2012 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

What:

Fixes #692

Why:

How:

yargs' .version() was previously called without an argument, so it guessed the version from the closest package.json. Now it takes the version from our own package.json.

Why it worked before (AI analysis)

Up to v6, the CLI was CommonJS and used yargs 15, with the same .version() call and no argument. yargs 15 started its search from require.main.filename, which is the CLI's own entry file, node_modules/all-contributors-cli/dist/cli.js. Going up from there, the first package.json it reaches is the CLI's own, so the version was right.

Since v7, yargs 18 runs as ESM, where require.main doesn't exist. So it guesses the start folder from its own path: everything before the last node_modules part. When the CLI is installed in a project, that's the project folder, so the first package.json it finds is the project's.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
michaelfaith
michaelfaith approved these changes Nov 23, 2026
View reviewed changes

@michaelfaith michaelfaith left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Good stuff (as always)! Looks like there's a merge conflict that needs to be cleared, and one minor (non-blocking) nit from me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/e2e/fixtures.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@michaelfaith
michaelfaith requested a review from a team November 23, 2026 22:23
@andreww2012
fix: ensure --version prints the CLI's own version
25361f0
@andreww2012
andreww2012 force-pushed the fix/version-flag branch from 4f9c696 to 25361f0 Compare November 25, 2026 14:59
@michaelfaith
michaelfaith merged commit 3808ad4 into all-contributors:main Nov 25, 2026
52 of 53 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@a-c-slater a-c-slater Bot mentioned this pull request Nov 25, 2026
chore(main): release 7.0.5 #728
Closed
@michaelfaith

michaelfaith commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@andreww2012 thanks again! Just a clerical note: this will be release in our 7.1.0 release, which will be under the new package name: @all-contributors/cli. (there's already a 7.0.3 under that name, which is equivalent to the 7.0.3 of all-contributors-cli). You caught us mid-package rename 😅

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@a-c-slater a-c-slater Bot mentioned this pull request Nov 25, 2026
chore(main): release 7.1.0 #730
Merged
michaelfaith pushed a commit that referenced this pull request Nov 25, 2026
@a-c-slater
chore(main): release 7.1.0 (#730)
c81c114
🤖 I have created a release *beep* *boop*
---


##
[7.1.0](v7.0.4...v7.1.0)
(2026-11-25)


### 🚀 Features

* rename the package to `@all-contributors/cli`
([#703](#703))
([0055e94](0055e94))


### 🩹 Bug Fixes

* ensure `--version` prints the CLI's own version
([#698](#698))
([3808ad4](3808ad4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: a-c-slater[bot] <354703433+a-c-slater[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@michaelfaith michaelfaith michaelfaith approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

🐛 Bug: --version prints the version of the project instead of the package's own version

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@andreww2012 @michaelfaith
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.