badges / badges/shields

Expose the concept of logos, add SimpleIcons as an optional dependency

Open
#4,947 11 comments 4 reactions 0 assignees View on GitHub
npm-package
Dominant language
JavaScript
Stars
27.2k
Forks
5.6k
Avg merge
1d 8h
Merged PRs (30d)
46

Description

:clipboard: **Description**

Expose logo and logo-specific params (e.g: `logoColor`, `logoWidth`). There are 3 cases for logos:

- Named SimpleIcons logo
- Custom base64-encoded logo
- Named shields custom logo https://github.com/badges/shields/tree/master/logo

At a library level it probably makes sense to reduce that to two cases - SimpleIcons and base64. We can keep our handful of custom logos outside of badge-maker and just treat them as something we handle in server somewhere and pass to the renderer as custom base64.

This will allow us to remove final relative import to the package requiring anything other than `makeBadge()` https://github.com/badges/shields/blob/8621fe42d76b809e9ba4ae844920f8ed0373817a/lib/logos.js#L4

#4524 never happened, but there are some notes on testing code with peer dependencies in https://github.com/badges/shields/pull/4524#discussion_r365603567

This work should also remove all/most of the remaining code from https://github.com/badges/shields/tree/master/lib (and if there is anything left, we should work out where to move it to)

Contributor guide

Open the contributing guide

Research direction

Review lib/logos.js and the remaining lib/ directory, then trace the makeBadge() entry point to understand the current logo handling. Consult the linked #4524 discussion for peer-dependency testing context; done means the logo cases and logo-specific parameters are exposed and any remaining lib code has a clear destination.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.