-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
refactor(icon-build-helpers): update metadata generation #5372
refactor(icon-build-helpers): update metadata generation #5372
Conversation
…refactor/update-icon-metadata
Deploy preview for carbon-elements ready! Built with commit d08fc30 |
Deploy preview for carbon-components-react ready! Built with commit d08fc30 https://deploy-preview-5372--carbon-components-react.netlify.com |
cc @vpicone! |
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.
Seems real cool -- thanks for walking me through this earlier today @joshblack
Thank you for the work @joshblack - Great if the new file format for each |
@asudoh agreed! Each extension should have a corresponding schema field that will validate the file format: carbon/packages/icon-build-helpers/src/metadata/extensions/icons.js Lines 24 to 34 in 638b72c
This structure corresponds to what we receive after the YML file is transformed into JS 👍 |
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.
LGTM 👍 ✅
Thanks a lot for the detailed PR / README file!
This PR closes several long-standing issues we've had with our metadata generation as consumed by the website group. In particular:
metadata.yml
is no longer nested and is now a flat fileThe majority of this diff is consumed by the generation of
pictograms.yml
andicons.yml
files, feel free to ignore them! In addition, changes in this PR should have no impact on public API of our icons or component packages so changes should be reserved to internal-only build tooling.Feel free to reach out if you would like a quick run-through of the PR! There is also a README with a quick explainer over here.
The main interface for working with these changes is discoverable through
packages/icons/tasks/{build,ci-check,scaffold}.js
which use the newly createdpackages/icon-build-helpers/src/metadata/index.js
entrypoint.The most common use-cases include:
build
: generate ametadata.json
file to be consumed by the website. This file is generated from several data sources, including icon, category, deprecation, and module name infoci-check
: verify that all assets in thesvg
folder match what is written in metadata, and vice-versascaffold
: help scaffold out metadata information for designers contributing iconographyThese commands are powered by some of the following concepts (also explained in the README!)
icons
array with all the icons availabledeprecated
field on deprecated iconsChangelog
New
icon-build-helpers
that powers building, checking, and scaffolding metadata information about icons and pictogramsmetadata/migrations
folder that hosts migration scripts that are run to convert one metadata file format to anotherChanged
metadata.yml
files to flaticons.yml
andpictograms.yml
filesRemoved