Resolves #38850 - Add Icons package build process #61169
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Currently a draft. See #38850 for the end goal.
In its final configuration, one can add an icon SVG to the package's
./svg
folder, and it will build the needed React/JS files.Currently if one adds SVGs to said folder, they can run
./tools/clean-svgs.js
to clean SVG files in place, or./tools/svg-to-react.js
to generate "source" React files.There are a few hiccups I'll need to work out:
<svg>
or<path>
tags, and instead forces use of its own<SVG>
and<Path>
React primitives. Given the simplicity of these SVGs, I currently just replace the tag names, but I'll need to see if this has further implications.src
folder, which largely won't exist anymore. I'm not sure the best way to handle this; in its current state it causes linting errors that I've suppressed.src
folder, and from there they buildbuild
,build-module
andbuild-types
. Again, given that much of thesrc
folder will be dynamically generated, I'm not sure the best way to handle this. Some ideas:./src/library
dir and./src.index.js
file from the SVGs, followed by the normal build, and finally a cleanup/post-build script to remove those generated "source" files. Given the infrequency of icon changes, it seems a bit much to me../src
files committed as they have been historically, and allow a manually-run script to regenerate those files on demand (basically what I've got committed in this PR).Note that I currently use
src
as the generated file destination for legacy reasons, but this will likely need to change.Will think on this more, but pushing the PR in the meantime.
@jasmussen if you want to take a look.
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast