-
Notifications
You must be signed in to change notification settings - Fork 237
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
Use Gulp instead of Grunt #284
Conversation
856b076
to
33cb9cb
Compare
- Add new tasks to compile sass for the documentation and copy the documentation assets - Also rename the clear task to clean
This has been done so that the links at the bottom of the docs will work when navigating in GitHub. We need to strip these out when rendering these pages.
var config = require('./config.json') | ||
|
||
gulp.task('copy-assets', function () { | ||
return gulp.src(['!' + config.paths.assets + 'sass{,/**/*}', config.paths.assets + '/**']) |
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 would put a newline after the comma here so it doesn't look like one big rambling path, but feel free to ignore my nit.
}) | ||
|
||
gulp.task('copy-documentation-assets', function () { | ||
return gulp.src(['!' + config.paths.docsAssets + 'sass{,/**/*}', config.paths.docsAssets + '/**']) |
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.
Possible newline here as well.
var config = require('./config.json') | ||
|
||
gulp.task('server', function () { | ||
nodemon({ignore: [config.paths.public + '*', config.paths.public + '*'], |
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.
Same path twice?
runSequence(['copy-toolkit', | ||
'copy-template-assets', | ||
'copy-elements-sass', | ||
'copy-template'], 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.
Do these all actually need to run sequentially, or can they run concurrently? I think this could be:
gulp.task('copy-govuk-modules', ['copy-toolkit', 'copy-template-assets', 'copy-elements-sass', 'copy-template'])
This would run a lot faster since it would spin up parallel threads for all the separate copying tasks. You can apply this to the other tasks in this file too; I think that with task dependencies (the optional array argument I used above) you shouldn't, in theory, need to ever use runSequence
, though sometimes it can mean you have to do:
gulp.task('the-first-thing', foo)
gulp.task('a-thing-before-others', ['the-first-thing'], bar)
gulp.task('earlierer-thing', ['a-thing-before-others'], baz)
gulp.task('earlier-thing', ['earlierer-thing'], qux)
gulp.task('thing', ['earlier-thing'], blah)
Which is an edge case that is obviously better suited to runSequence
.
These can happen at the same time.
cba3375
to
237a3b0
Compare
This reverts commit cba3375.
@htmlandbacon I might be misreading, but I think theres something wrong here. The old start sequence was: npm start .port.tmp is created if the kit has to use a port other than 3000 (ie multiple kits are running), so when server.js automatically restarts it uses the same port the new sequence is: npm start the problem is with nothing listening for ctrl c, when a kit starts on another port, it writes .port.tmp to the filesystem but when it stops, theres nothing to delete that file. It's not a major problem, but its not really right. is it possible to kick off gulp from start.js as before? |
Looks like we can http://stackoverflow.com/a/28493832 |
I'll take a look, I had a few quirks with running it from within a js file. |
I've made start.js run the gulp default task, and updated nodemon to ignore changes in assets, and to stop setting NODE_ENV |
fdfaf15
to
09122d5
Compare
a47a529
to
09122d5
Compare
- This way we can check for the node_modules folder and warn if it isn’t install - By removing Gulp from start.js (now renamed to prestart.js) we get the full output from Gulp when the app is run.
I’m happy with this. |
This PR rebases #282 on top of master and fixes the conflicts.
cc. @robinwhittleton, @joelanman, @edwardhorsford.
Copied from #282 (thanks @htmlandbacon) 💯
This pull request moves from grunt to gulp scripts, this should remove warnings (#89) from the build.
I've kept the functionality of the tasks largely the same, I've split out some tasks a little more where I thought it made sense but happy to take feedback on them, I've also structured this into smaller files.
A couple of things outside the core gulp scripts :
Be good to get some eyes on this, as it is quite a big change 👏