-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
#1127 #1126 #1125 #1139 Icon builder tests, grunt, templating #1130
Conversation
Finishing this tomorrow. |
@hai-cea : Ok, updated the original post with the changes. This preserves current functionality and adds test to back it. What do you think? |
1dd6409
to
a8ac948
Compare
@tony I'm trying to run the default build and am getting some weird results. Are you seeing the same?
Here's the JSX that it's currently generating:
Here's what it should generate:
|
- Add grunt, mocha. - Modularize functions in build. - Tests for functions and types. - Grunt watch for rerunning tests on file save. - Wrap argv in main() + only run when executing as a script. - main() now accepts parameterized object literal for simulating args. - mui#1139 split file renaming into module / argument. - Tests + Fixture for result output.
@hai-cea: Good catch, Fixed template and added a test for output. |
- Search through files via node-glob - Use _.defaults for default options - Custom filters are now more flexible, output relative to options.outputDir / --output-dir - mui-icons no longer needs --file-suffix, _24px.svg -> .jsx happens in filter. - pascalCase now capitalizes first letter of recursive directories and dashes.
The last commit I made simplified things a lot. It handle svg icons for my other icon sets as well as the project's.
|
Thanks @tony - I'm getting build error when trying to
|
@hai-cea Give it a shot now. It was missing a package. |
@tony Beautiful - thanks! 👍 |
All prior behavior works as intended. Plus:
main()
now accepts aopts
, this is used inside oftest/index.js
and makes the builder usable as an API in user made scripts.argv
in a function +require..main === module
so it's not ran whenbuild.js
is imported as a library--renameFilter
that can pass in module/js file to rename stuff.grunt watch
to rerun tests on savegrunt mochaTest
to run mocha testsSvgIcon
's in the project)Helpful for #1064