Skip to content

Conversation

@GitToTheHub
Copy link
Contributor

I find it better, when you can see the current package.json version of the repository in the title. I used shields.io for it. To not be confused with the current released npm package, I created a section Stable Release which shows the npm version. I removed the nodei.co badge because it was hard to read and showed npm install cordova-android though you should add a platform with cordova platform add android.

Platforms affected

Motivation and Context

Description

Testing

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

- Added current package version as badge in title
- Removed nodei.co badge
- Added npm version badge via shields.io in section `Stable Release`
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.79%. Comparing base (d7afba0) to head (81b22c3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1872   +/-   ##
=======================================
  Coverage   60.79%   60.79%           
=======================================
  Files          23       23           
  Lines        4811     4811           
=======================================
  Hits         2925     2925           
  Misses       1886     1886           

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

# Cordova Android

[![NPM](https://nodei.co/npm/cordova-android.png)](https://nodei.co/npm/cordova-android/)
# Cordova Android ![GitHub package.json version](https://img.shields.io/github/package-json/v/apache/cordova-android)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Cordova Android ![GitHub package.json version](https://img.shields.io/github/package-json/v/apache/cordova-android)
# Cordova Android
[![NPM](https://nodei.co/npm/cordova-android.svg?style=flat&data=n,v,u&color=blue)](https://www.npmjs.com/package/cordova-android)

Copy link
Member

@erisu erisu Nov 26, 2025

Choose a reason for hiding this comment

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

This is the new badge we’ve been applying to some repos. I’d like to avoid having too many different badge designs and layouts, but there would still be some degree of confusion.

I also don't think we should be showing the "GitHub package.json version." If we do show it, it should at least be placed some where else, not next to the title.Maybe at the bottom of the README, or below the exisiting badge but in a table format and declaring it as an active development version.

Including it might reduce confusion for people reading the README in the repo, but it would still cause confusion for people viewing the package on the npm registry.

For example, if the repo is tagged as 16.0.0-dev, and that badge appeared in the 14.0.1 release, anyone reading the 14.0.1 page on npm might wonder why it shows 16.0.0-dev at the top.

However, both the current badge and my suggested badge only report the latest official release. Even the current badge wouldnt accurately show the version that a user is installing.

Maybe the current badge I suggested should also include the label of "Latest Release" so its clear.

Copy link
Member

Choose a reason for hiding this comment

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

Here's another possible example: https://gist.github.com/erisu/2536f97976e64165c00a781888b0b6b4

Just ignore the two that displays as text. Some reason its not rendering correctly in the gist but renders OK in the repo.

Below the title, it shows the latest release on npm. The next row shows development related badges.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, the users on NPM would also see the development version in the title and would get confused. I started in my repos to manually add the current package version in the title like in https://github.com/katzer/cordova-plugin-local-notifications. But thought, maybe it could be made automatic, so you don't have to update it manually. This was my first try here to made it automatic and now see which disadvantage it have. I like your gist approach, but see you are using there also shields.io. I didn't see on nodei.co that it supports a label option. How would do you find it, to place manually the package version in the title? If the package gets published to npm the version would be correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What I like on your approach is, that the users see on NPM that there is a development version which has recent development.

Copy link
Member

@erisu erisu Nov 26, 2025

Choose a reason for hiding this comment

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

How would do you find it, to place manually the package version in the title?

I would personally prefer to avoid adding more places where version numbers need to be maintained within the repo.

We already have the version in package.json, package-lock.json, RELEASENOTES.md (updated during release), and other files depending on the package.

The more places we have to update, the higher the risk of forgetting one. I've had cases before—outside of Cordova—where I released a package and forgot to update a version in a file, simply because I didn't remember it existed. I ended up having to publish a patch just to fix that oversight.

If the badges are going to cause confusion, then I would rather remove them.

But this is just my opinion. You could try and ask if anyone else would be in favor of adding the version to the title or if they have any recommendations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The more places we have to update, the higher the risk of forgetting one. I've had cases before—outside of Cordova—where I released a package and forgot to update a version in a file, simply because I didn't remember it existed. I ended up having to publish a patch just to fix that oversight.

To avoid this, I always do a search in my IDE for the version i want to replace and this works very good. I don't have to remember all places, where to replace the version :)

What about your gist recommendation? I would take it over, but it's using shields.io not nodei.co

@erisu erisu changed the title Enhance README with github and npm version badges doc(readme): update github and npm version badges Nov 26, 2025
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