-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix: remove gulp from dist folder build pipeline #1385
Conversation
Test Version for this PR was deployed Built with commit b14b220 |
@@ -51,71 +41,5 @@ const sassTask = () => { | |||
}; | |||
gulp.task('pkg-sass', sassTask); |
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.
This task is still needed for the docs site build.
@jbadan Is there a story (or stories) created for the 5 follow-up tasks? |
"style:minify": "foreach -t -g \"dist/*.css\" -x \"cleancss -O1 specialComments:1 #{path} -o #{dir}/#{name}.min.css\" --no-c && foreach -t -g \"dist/components/*.css\" -x \"cleancss -O1 specialComments:1 #{path} -o #{dir}/#{name}.min.css\" --no-c", | ||
"style:postCSS": "postcss --config config/postcss.config.js --replace dist/**/*.css && postcss --config config/postcss.config.js --replace dist/*.css", | ||
"style:remove": "if [ -d dist/ ]; then rm -rf dist/; fi", | ||
"style:rename": "mv dist/all.css dist/fiori-fundamentals.css && mv dist/all-ie11.css dist/fiori-fundamentals-ie11.css && rm dist/fundamentals-ie11.less.css dist/fundamentals.less.css", |
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.
I see why all these were created, but would they ever be run on their own? For debugging, I suppose, but this clutters the scripts
section quite a bit for items that theoretically are just steps of a larger script and probably shouldn't be run on their own. Because I'm assuming if you run them out of sequence, you'll get unexpected results and/or errors.
I'm not totally against this, but just making a note to see if anyone else has thoughts or opinions.
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.
These would definitely break if run out of order. This is the path that the bootstrap repo takes, but I'm totally open to other opinions! https://github.com/twbs/bootstrap/blob/master/package.json#L24
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.
Also my overarching plan is to get rid of style:rename
, style:less
and style:assets
in the future.
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.
I think these are okay to leave for now since this PR is about achieving parity. It might be a nice follow-up task to optimize all this once it's all done.
|
||
for file in scss/icons/*.{eot,svg,ttf,woff}; do cp "$file" dist; done | ||
|
||
for file in scss/fonts/72/*.{eot,svg,ttf,woff,woff2}; do cp "$file" dist/fonts/72/; done |
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.
Would there ever be other file extensions we'd want to move? Or maybe better asked ... are there certain extensions we are omitting such that we can't just copy all the file from one directory to the other?
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.
Each of these has some .scss
files that we want to omit
|
||
mkdir -p -- dist/{fonts,images} dist/fonts/72 | ||
|
||
for file in scss/icons/*.{eot,svg,ttf,woff}; do cp "$file" dist; done |
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.
Would there ever be other file extensions we'd want to move? Or maybe better asked ... are there certain extensions we are omitting such that we can't just copy all the file from one directory to the other?
We have stories in the COREUI backlog, but I haven't opened issues on the repo yet. I wanted to see how this pr went over first :) |
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. 🚢
Deploy preview for fundamental ready! Built with commit 42f2cf9 |
This pr removes gulp from the
dist
folder creation pipeline. To test that the output was the same, I used an AST diffing tool. Results can be seen here: https://gist.github.com/jbadan/b3599f727927ddfc9e93d149d297d794There is also a branch available that creates a new
dist2
folder that can be used to compare and run the diffs yourself,npm run build:dist:prod
,npm run build:dist2:prod
andnpm run diff:forEach
on branchdiff-compare-dist-dist2
. This branch isn't quite as organized, but the scripts are doing the same thing.Previous gulp tasks and their replacements are as follows:
pkg-clean
:npm run style:remove
pkg-fonts
,pkg-icons
,pkg-images
:npm run style:assets
pkg-css
:sassTask
andcomponentTask
:npm run style:compile
darkSassTask
: never run, removedminifyTask
:npm run style:minify
bannerTask
and the autoprefix and cleanCSS steps in the previouspkg-css
tasks:npm run style:postCSS
npm run style:rename
Note:
error-handling
was only checking docs site so should not have been part of this workflow.There are several followup tasks to completely remove gulp:
less
folder build gulp taskOnce complete, we can remove the following from
package.json
: