-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Refactor named logo handling into badge-maker #10955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
removed tests as the directory is removed
after moving simple-icons to badge-maker, shields only uses simple-icons in tests. the rest are functions from simple-icons-util and dont use the simple-icons lib
|
I would like some help regarding my next step.
|
|
When we originally migrated the main codebase from CommonJS to ESM, ESModules was still quite new. There were a lot of projects still using CommonJS. At that point in time, it wasn't really reasonable for us to move badge-maker to ESM just yet. Today, things have moved on. That is not really true and it is entirely reasonable to release an ESM version of badge-maker. It will require a major version bump because it is a breaking change, but that is fine. We can use the opportunity to drop compatibility with a bunch of unsupported node versions at the same time which is another breaking change we need to do in the next major. So in principle it is fine to migrate badge-maker to ESM. That said.. There is already a lot happening in this PR, and I don't want to scope-creep it to include "migrate badge-maker to ESM". It is just going to make the whole thing too much of a giant PITA to review. So I think we should either:
Both add some complexity, but I think option 1 is probably the approach I would go for. Option 2 feels like unnecessary churn. |
merged changes that made badge-maker esm module. mjs is not required anymore for migrated util files
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Please let me know if you need help. I can help make the API standard/convention for optional packages. For example, we can expose an async resolver function for loading external icons: import {makeBadge} from 'badge-maker';
const badge = await makeBadge({
message: 'external',
iconSetResolver: async () => {
const simpleIcons = await import('simple-icons');
const customIcons = await import('custom-icons');
return {...simpleIcons, ...customIcons};
}
});What do you think? |
|
I wasn't able to get back to this for some time, I hoped to be able to work on this during this weekend. If you wish to, you could fork my work or start another PR if you find that better for you'r approach. Just tag me so I can notice your WIP so we don't end up with a conflict/working on same thing twice. Please note that there is no agreement yet about support for other icons libs other then simpleicons, so while it could be fine to code with that in mind, I prefer if you did not include that in the code yet. |
TODO