[EuiIcon] Add generated file comment#5210
Merged
cee-chen merged 2 commits intoelastic:masterfrom Sep 22, 2021
Merged
Conversation
cee-chen
commented
Sep 22, 2021
| const iconFiles = glob.sync('**/*.svg', { cwd: iconsDir, realpath: true }); | ||
|
|
||
| iconFiles.forEach(async filePath => { | ||
| iconFiles.forEach(async (filePath) => { |
Contributor
Author
There was a problem hiding this comment.
This was a Prettier autofix on save
Comment on lines
+58
to
+59
| const comment = '// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY\n\n'; | ||
| fs.writeFileSync(outputFilePath, comment + jsxSource); |
Contributor
Author
There was a problem hiding this comment.
Comments in ast are a bit of a headache apparently (you have to pass in a custom preserveComments option, and then you have to use template.smart() instead of the template.ast shortcut, etc.) so I opted for the path of least resistance and just threw in the comment directly into the writeFile 🙃
7 tasks
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5210/ |
thompsongl
approved these changes
Sep 22, 2021
Contributor
thompsongl
left a comment
There was a problem hiding this comment.
just threw in the comment directly into the writeFile
I like it!
Contributor
Author
|
🐇 Goin' down that rabbit hole: I'll look at .tsx for icons in a follow up PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Per @thompsongl's comments in #5204 (comment), we should add a comment to note that our icon
.jsfiles are generated files and shouldn't be modified (I had previously thought the.svgfiles were the ones that were for reference/archival and shouldn't be touched 🙃)Checklist
N/A, internal/dev-only change