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
Add add-icon-data
script
#7849
Add add-icon-data
script
#7849
Conversation
I don't have a good idea to implement the UX for aliases. Any ideas? |
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.
Thanks for working on this 👍🏼
I think that the current implementation solves mainly the problem of the ordering in the data file. It does not validate so many things. Additionally, add-icon
is really confusing, should be renamed to add-icon-data
as the script is not adding an icon, only their object to the data file?
Also, I think that we should standarize the assertions done to our data in tests and reuse them in other parts of the project like this script, but that could be in a separate PR.
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.
As you're adding a terminal color formatting library we can replace the unicode characters used in scripts/lint/ourlint.js:
simple-icons/scripts/lint/ourlint.js
Line 72 in d5444f6
errors.forEach((error) => console.error(`\u001b[31m${error}\u001b[0m`)); |
Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>
Are you planning to add the rest of the fields @LitoMore? |
Let me try. |
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.
Done a couple of changes. Now looks good to me 🌠
Can be improved in the future though, feel free to merge it!
Resolves #7848
I used a simplelocaleCompare
on titles. So it's valid when we addsimple icons
(the lowercase). I may need to check the duplication of their slugs. Seemsour-lint
has the same issue.Overview
Command
Prompts
title
Not empty
The title should be unique
Its slug should be unique
hex
/^#?[a-f0-9]{3,8}$/i
source
/^https:\/\/[^\s]+$/
The confirm prompt is inspired by
npm init
command.Preview