-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb45d4f
commit b3bcb98
Showing
15 changed files
with
190 additions
and
169 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: node ./node_modules/grunt-cli/bin/grunt --gruntfile Gruntfile.js generate-assets && node server.js | ||
web: node ./node_modules/gulp/bin/gulp generate-assets && node server.js |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
clear.js | ||
=========== | ||
removes public folder/govuk_modules folder | ||
*/ | ||
var config = require('./config.json') | ||
|
||
var gulp = require('gulp') | ||
var clean = require('gulp-clean') | ||
|
||
gulp.task('clear', function () { | ||
return gulp.src([config.assets.output + '/*', | ||
config.assets.govuk_modules + '/*'], {read: false}) | ||
.pipe(clean()) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"assets": { | ||
"output": "public/", | ||
"base" : "app/assets/", | ||
"govuk_modules": "govuk_modules/", | ||
"lib": "lib/" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
copy.js | ||
=========== | ||
copies images and javascript folders to public | ||
*/ | ||
|
||
var gulp = require('gulp') | ||
var config = require('./config.json') | ||
|
||
gulp.task('copy-assets', function () { | ||
return gulp.src(['!' + config.assets.base + 'sass{,/**/*}', config.assets.base + '/**']) | ||
.pipe(gulp.dest(config.assets.output)) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
copy-gov-modules.js | ||
=========== | ||
copies files for node_modules into govuk_modules | ||
*/ | ||
|
||
var gulp = require('gulp') | ||
var config = require('./config.json') | ||
|
||
gulp.task('copy-toolkit', function () { | ||
return gulp.src(['node_modules/govuk_frontend_toolkit/**']) | ||
.pipe(gulp.dest(config.assets.govuk_modules + '/govuk_frontend_toolkit/')) | ||
}) | ||
|
||
gulp.task('copy-template', function () { | ||
return gulp.src(['node_modules/govuk_template_jinja/views/layouts/**']) | ||
.pipe(gulp.dest(config.assets.govuk_modules + '/govuk_template/layouts/')) | ||
.pipe(gulp.dest(config.assets.lib)) | ||
}) | ||
|
||
gulp.task('copy-template-assets', function () { | ||
return gulp.src(['node_modules/govuk_template_jinja/assets/**']) | ||
.pipe(gulp.dest(config.assets.govuk_modules + '/govuk_template/assets/')) | ||
}) | ||
|
||
gulp.task('copy-elements-sass', function () { | ||
return gulp.src(['node_modules/govuk-elements-sass/public/sass/**']) | ||
.pipe(gulp.dest(config.assets.govuk_modules + '/govuk-elements-sass/')) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
nodemon.js | ||
=========== | ||
uses nodemon to run a server, watches for javascript and json changes | ||
*/ | ||
|
||
var gulp = require('gulp') | ||
var nodemon = require('gulp-nodemon') | ||
var config = require('./config.json') | ||
|
||
gulp.task('server', function () { | ||
nodemon({ignore: [config.assets.output + '*', config.assets.output + '*'], | ||
script: 'server.js', | ||
ext: 'js, json', | ||
env: {NODE_ENV: 'development'}}) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
sass.js | ||
=========== | ||
compiles sass from assets folder with the govuk_modules | ||
also includes sourcemaps | ||
*/ | ||
|
||
var gulp = require('gulp') | ||
var sass = require('gulp-sass') | ||
var sourcemaps = require('gulp-sourcemaps') | ||
|
||
var config = require('./config.json') | ||
|
||
gulp.task('sass', function () { | ||
return gulp.src(config.assets.base + '/sass/*.scss') | ||
.pipe(sass({outputStyle: 'expanded', | ||
includePaths: ['govuk_modules/govuk_frontend_toolkit/stylesheets', | ||
'govuk_modules/govuk_template/assets/stylesheets', | ||
'govuk_modules/govuk-elements-sass/']}).on('error', sass.logError)) | ||
.pipe(sourcemaps.init()) | ||
.pipe(sourcemaps.write()) | ||
.pipe(gulp.dest(config.assets.output + '/stylesheets/')) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
tasks.js | ||
=========== | ||
defaults wraps generate-assets, watch and server | ||
*/ | ||
|
||
var gulp = require('gulp') | ||
var gutil = require('gulp-util') | ||
var runSequence = require('run-sequence') | ||
|
||
gulp.task('default', function (done) { | ||
runSequence('generate-assets', | ||
'watch', | ||
'server', done) | ||
}) | ||
|
||
gulp.task('generate-assets', function (done) { | ||
runSequence('clear', | ||
'copy-govuk-modules', | ||
'sass', | ||
'copy-assets', done) | ||
}) | ||
|
||
gulp.task('copy-govuk-modules', function (done) { | ||
runSequence(['copy-toolkit', | ||
'copy-template-assets', | ||
'copy-elements-sass', | ||
'copy-template'], done) | ||
}) | ||
|
||
gulp.task('watch', function (done) { | ||
runSequence('watch-sass', | ||
'watch-assets', done) | ||
}) | ||
|
||
gulp.task('test', function (done) { | ||
gutil.log('Test that the app runs') | ||
done() | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
watch.js | ||
=========== | ||
watches sass/js/images | ||
*/ | ||
|
||
var gulp = require('gulp') | ||
var config = require('./config.json') | ||
|
||
gulp.task('watch-sass', function () { | ||
return gulp.watch(config.assets.base + 'sass/**', {cwd: './'}, ['sass']) | ||
}) | ||
|
||
gulp.task('watch-assets', function () { | ||
return gulp.watch([config.assets.base + 'images/**', | ||
config.assets.base + 'javascripts/**'], {cwd: './'}, ['copy']) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
gulpfile.js | ||
=========== | ||
Rather than manage one giant configuration file responsible | ||
for creating multiple tasks, each task has been broken out into | ||
its own file in `/gulp`. Any files in that directory | ||
get automatically required below. | ||
To add a new task, simply add a new task file that directory. | ||
`/gulp/tasks.js` specifies the default set of | ||
tasks to run when you run `gulp`. | ||
*/ | ||
|
||
var requireDir = require('require-dir') | ||
|
||
// Require all tasks in gulp/tasks, including subfolders | ||
requireDir('./gulp', {recurse: true}) |
Oops, something went wrong.