Skip to content
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

Update dependencies #557

Merged
merged 16 commits into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Unreleased

New features:

- [#557 Bump outdated dependencies](https://github.com/alphagov/govuk-prototype-kit/pull/557):
- Update standard from 10.0.2 to 11.0.1 and fix violations
- Update run-sequence from 1.2.2 to 2.2.1
- Update require-dir from 0.3.2 to 1.0.0
- Update notifications-node-client from 3.0.0 to 4.1.0
- Update marked from 0.3.6 to 0.4.0
- Update gulp-sass from 3.1.0 to 4.0.1
- Update gulp-mocha from v4.3.1 to v6.0.0
- Update gulp-clean from 0.3.2 to 0.4.0
- Update express from 4.15.2 to 4.16.3
- Update dotenv from 4.0.0 to 6.0.0
- Update cross-spawn from 5.0.0 to 6.0.5
- Update basic-auth from 1.0.3 to 2.0.0
- [#557 Remove unused readdir dependency](https://github.com/alphagov/govuk-prototype-kit/pull/557)
- [#557 Fix a broken link in an error message](https://github.com/alphagov/govuk-prototype-kit/pull/557)

Bug fixes:
- [#556 Update branching example](https://github.com/alphagov/govuk-prototype-kit/pull/556)
- [#536 Import missing component macros](https://github.com/alphagov/govuk_prototype_kit/pull/536)
Expand Down
2 changes: 1 addition & 1 deletion gulp/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ const config = require('./config.json')
gulp.task('clean', function () {
return gulp.src([config.paths.public + '/*',
'.port.tmp'], {read: false})
.pipe(clean())
.pipe(clean())
})
4 changes: 2 additions & 2 deletions gulp/copy-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const config = require('./config.json')
gulp.task('copy-assets', function () {
return gulp.src(['!' + config.paths.assets + 'sass{,/**/*}',
config.paths.assets + '/**'])
.pipe(gulp.dest(config.paths.public))
.pipe(gulp.dest(config.paths.public))
})

gulp.task('copy-documentation-assets', function () {
return gulp.src(['!' + config.paths.docsAssets + 'sass{,/**/*}',
config.paths.docsAssets + '/**'])
.pipe(gulp.dest(config.paths.public))
.pipe(gulp.dest(config.paths.public))
})
16 changes: 8 additions & 8 deletions gulp/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ const config = require('./config.json')

gulp.task('sass', function () {
return gulp.src(config.paths.assets + '/sass/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.paths.public + '/stylesheets/'))
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.paths.public + '/stylesheets/'))
})

gulp.task('sass-documentation', function () {
return gulp.src(config.paths.docsAssets + '/sass/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.paths.public + '/stylesheets/'))
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.paths.public + '/stylesheets/'))
})
25 changes: 10 additions & 15 deletions gulp/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,30 @@ const runSequence = require('run-sequence')

gulp.task('default', function (done) {
runSequence('generate-assets',
'watch',
'server', done)
'watch',
'server', done)
})

gulp.task('generate-assets', function (done) {
runSequence('clean',
'sass',
'sass-documentation',
'copy-assets',
'copy-documentation-assets', done)
'sass',
'sass-documentation',
'copy-assets',
'copy-documentation-assets', done)
})

gulp.task('watch', function (done) {
runSequence('watch-sass',
'watch-assets', done)
'watch-assets', done)
})

gulp.task('test', function () {
runSequence('generate-assets',
'mocha')
'mocha')
})

gulp.task('mocha', function () {
return gulp.src(['test/**/*.js'], { read: false })
.pipe(mocha({ reporter: 'spec' }))
.once('error', () => {
process.exit(1)
})
.once('end', () => {
process.exit()
})
.pipe(mocha({ reporter: 'spec', exit: true }))
.on('error', console.error)
})
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ exports.basicAuth = function (username, password) {
return function (req, res, next) {
if (!username || !password) {
console.log('Username or password is not set.')
return res.send('<h1>Error:</h1><p>Username or password not set. <a href="https://govuk-prototype-kit.herokuapp.com/docs/publishing-on-heroku#5-set-a-username-and-password">See guidance for setting these</a>.</p>')
return res.send('<h1>Error:</h1><p>Username or password not set. <a href="https://govuk-prototype-kit.herokuapp.com/docs/publishing-on-heroku#6-set-a-username-and-password">See guidance for setting these</a>.</p>')
}

var user = basicAuth(req)
Expand Down
27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,35 @@
"test": "gulp test && npm run lint"
},
"dependencies": {
"basic-auth": "^1.0.3",
"basic-auth": "^2.0.0",
"basic-auth-connect": "^1.0.0",
"body-parser": "^1.14.1",
"browser-sync": "^2.11.1",
"cookie-parser": "^1.4.3",
"cross-spawn": "^5.0.0",
"dotenv": "^4.0.0",
"express": "4.15.2",
"cross-spawn": "^6.0.5",
"dotenv": "^6.0.0",
"express": "4.16.3",
"express-session": "^1.13.0",
"express-writer": "0.0.4",
"govuk-frontend": "^1.0.0",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-mocha": "^4.3.1",
"gulp-clean": "^0.4.0",
"gulp-mocha": "^6.0.0",
"gulp-nodemon": "^2.1.0",
"gulp-sass": "3.1.0",
"gulp-sass": "^4.0.1",
"gulp-sourcemaps": "^2.6.0",
"gulp-util": "^3.0.7",
"marked": "^0.3.6",
"marked": "^0.4.0",
"minimist": "1.2.0",
"notifications-node-client": "^3.0.0",
"notifications-node-client": "^4.1.0",
"nunjucks": "^3.1.3",
"portscanner": "^2.1.1",
"prompt": "^1.0.0",
"readdir": "0.0.13",
"require-dir": "^0.3.0",
"run-sequence": "^1.2.2",
"standard": "^10.0.2",
"require-dir": "^1.0.0",
"run-sequence": "^2.2.1",
"standard": "^11.0.1",
"supertest": "^3.0.0",
"sync-request": "^4.0.3",
"sync-request": "^6.0.0",
"universal-analytics": "^0.4.16",
"uuid": "^3.2.1"
},
Expand Down
4 changes: 2 additions & 2 deletions start.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function checkFiles () {
const envExists = fs.existsSync(path.join(__dirname, '/.env'))
if (!envExists) {
fs.createReadStream(path.join(__dirname, '/lib/template.env'))
.pipe(fs.createWriteStream(path.join(__dirname, '/.env')))
.pipe(fs.createWriteStream(path.join(__dirname, '/.env')))
}
}

Expand All @@ -63,7 +63,7 @@ if (!sessionDataDefaultsFileExists) {
}

fs.createReadStream(path.join(__dirname, '/lib/template.session-data-defaults.js'))
.pipe(fs.createWriteStream(sessionDataDefaultsFile))
.pipe(fs.createWriteStream(sessionDataDefaultsFile))
}

// Run gulp
Expand Down