badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
23.38k stars 5.49k forks source link

`packageManager` field #9514

Open arcanis opened 1 year ago

arcanis commented 1 year ago

📋 Description

The package.json files accepts a packageManager field that is used by Corepack to install and select the right package manager for the right project.

Ref https://github.com/badges/shields/issues/7515; since this issue the format of the thing slightly changed, and it's now meant to also include the package manager's checksum:

https://github.com/nodejs/corepack/blob/main/package.json#L19C22-L19C102

This makes the general package.json badge very difficult to grasp:

https://img.shields.io/github/package-json/packageManager/nodejs/corepack

As a side note, I feel like it could be nice to also use a custom color depending on the package manager:

🔗 Data

GitHub, same as the package-json endpoint but with a slightly different formatting to trim the + suffix.

🎤 Motivation

See above

chris48s commented 1 year ago

It is a little bit "magical", but I think I'd be in favour of making /github/package-json/packageManager/:user/:repo a special case and stripping the build suffix, rather than adding a special route or param for this.

On the colours, we don't generally apply "brand" colours by default, but users are welcome to customise if they want.

calebcartwright commented 11 months ago

Strongly agree with Chris on all fronts.

For anyone interested in working on this the starting point in the code would be around here:

https://github.com/badges/shields/blob/f53e478b0be6a5f911f7304292640b5d2fa32dee/services/github/github-package-json.service.js#L240-L261