-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Created scripts to update the current devicon.json and generate css files based on the new json file #290
Conversation
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.
Looks good to me @Thomas-Boi! :) I would suggest to clean up the artifacts, no longer required routines and change the build output to our known format "devicon.json" and "devicon.min.css" instead of your testing values.
I would also suggest that you provide a updated README.md on how to use the devicon.json in the future (and removing the alias.css and colors.css). Ok? :)
Maybe we should change the target branch to develop?
Hey @amacado, Thanks for looking at my change! I will address all of your suggestions in the next commit to the branch. Unfortunately, I am little busy with school right now so I will hopefully get it in by the weekends. I will also publish our discussions last week so everyone can see what we talked about as well. Cheers, |
Hey @amacado, I have removed all unnecessary files from the repo (test files, unneeded tasks) and rename the built files to Regarding the Cheers, |
Created scripts to update the current devicon.json and generate css files based on the new json file
Hello @amacado,
Here are the contents for this PR:
Summary:
upgradeDev.js
would create anewDevicon.json
that has thecolor
andaliases
attributeupdateCss
andcleanUp
are used to create the css files.updateCss
task used Sass to help with creating thedevicon-alias.css
, concatenation, and minification. We can remove the other gulp tasks that did these jobs.min.css
created byupdateCss
might look weird but it works.mocha, clojure, clojurescript, redux, yunohost
.The upgrade
devicon.json
script:upgradeDev.js
. This is what it does:devicon.json
,devicon-colors.css
and thedevicon-alias.css
.deviconJson
in memorydeviconJson
to a new file callednewDevicon.json
.contentMap.json
: created fromdevicon.css
and maps a class name to thecontent
propertyaliasMap.json
: created fromdevicon-alias.css
and maps the content property to an array of aliasescolorsMap.json
: created fromdevicon-colors.css
and maps a class name to thecolor
propertyfont
version (aka no aliases) or acolor
attribute. See line 137 to see the filter.dot-net
in thenewDevicon.json
generated by the script doesn't have a color. This is due to the regexp that I used. It's faster if we just add the colors in manually afterwards, which is what I did for the
newDevicon.json`.The css-generating scripts:
devicon.json
or in this case, thenewDevicon.json
.devicon-colors.css
, it generates css as read from thedeviconJson
. It skips any objects that doesn't have a color or fonts.devicon-alias.css
, it generates css for the aliases using the@extend
syntax from Sass. Whenever a selector@extend
another selector, Sass knows to generate the same css for both of them. You can see the result in themin.css
.min.scss
where it imports the above files. I then usegulp
to process this file, creating themin.css
file (the file extension.scss
means a Sass file).css
file. To see a minify version, go to line 37 and follow the instructions there. This means that we can remove thegulp-concat
andgulp-minify
dependencies.min.css
has thecontent
property as squares (see below).This is fine and doesn't create a problem (see this). You can test it by:
index.html
located at the root dir.<link>
that imports thedevicon.min.css
href
tomin.css
You can run this gulp task by typing
npm run build
. For this task, I chaingulp tasks
together rather than using thegulp.series()
. This is because of a weird bug:gulpfile.js
, there's a task at the bottom calledtest
which usesgulp.series()
. Try running this task.min.css
is generated correctly and thecleanUp()
removed all artifacts.min.scss
file is not found. The source of this is from a package calledduplexify
, which might be fromgulp
orsass
. In thecleanUp()
function, I have tried changingunlink()
toaccess()
and things work fine (no errors).gulp.series()
is only faster than&&
chaining by a few seconds.Let me know what you think. Also, I'd need to clean up the branch before we merge it.