Skip to content

Commit

Permalink
Updating dependencies and adding slack notifications to outdated chec…
Browse files Browse the repository at this point in the history
…ks (#27)

* Updating dependencies and adding slack notifications to outdated checks

* Add slack orb
  • Loading branch information
andrewrlee authored May 24, 2021
1 parent e7df526 commit a2d85cd
Show file tree
Hide file tree
Showing 10 changed files with 4,536 additions and 15,608 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: 2.1

orbs:
hmpps: ministryofjustice/[email protected]
slack: circleci/[email protected]

executors:
integration-tests:
Expand Down Expand Up @@ -66,6 +67,10 @@ jobs:
- run:
name: Run check
command: 'npm outdated typescript govuk-frontend'
- slack/notify:
event: fail
channel: hmpps_typescript_notifications
template: basic_fail_1

unit_test:
executor:
Expand Down
20,046 changes: 4,485 additions & 15,561 deletions package-lock.json

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,31 @@
]
},
"dependencies": {
"@ministryofjustice/frontend": "^0.2.1",
"@ministryofjustice/frontend": "^0.2.4",
"agentkeepalive": "^4.1.4",
"applicationinsights": "^1.8.10",
"applicationinsights": "^2.0.0",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
"bunyan-format": "^0.2.1",
"compression": "^1.7.4",
"connect-flash": "^0.1.1",
"connect-redis": "^5.1.0",
"connect-redis": "^5.2.0",
"cookie-session": "^1.4.0",
"csurf": "^1.11.0",
"dotenv": "^8.2.0",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"express-request-id": "^1.4.1",
"express-session": "^1.17.1",
"govuk-frontend": "^3.11.0",
"helmet": "^4.4.1",
"express-session": "^1.17.2",
"govuk-frontend": "^3.12.0",
"helmet": "^4.6.0",
"http-errors": "^1.8.0",
"jquery": "^3.6.0",
"jwt-decode": "^3.1.2",
"nocache": "^2.1.0",
"nunjucks": "^3.2.3",
"passport": "^0.4.1",
"passport-oauth2": "^1.5.0",
"redis": "^3.0.2",
"redis": "^3.1.2",
"superagent": "^6.1.0"
},
"devDependencies": {
Expand All @@ -118,44 +118,44 @@
"@types/connect-flash": "0.0.36",
"@types/connect-redis": "^0.0.16",
"@types/cookie-session": "^2.0.42",
"@types/csurf": "^1.11.0",
"@types/csurf": "^1.11.1",
"@types/express-request-id": "^1.4.1",
"@types/express-session": "^1.17.3",
"@types/http-errors": "^1.8.0",
"@types/jest": "^26.0.20",
"@types/jsonwebtoken": "^8.5.0",
"@types/node": "^14.14.31",
"@types/jest": "^26.0.23",
"@types/jsonwebtoken": "^8.5.1",
"@types/node": "^14.14.41",
"@types/nunjucks": "^3.1.4",
"@types/passport": "^1.0.6",
"@types/passport-oauth2": "^1.4.10",
"@types/redis": "^2.8.28",
"@types/superagent": "^4.1.10",
"@types/supertest": "^2.0.10",
"@typescript-eslint/eslint-plugin": "^4.16.1",
"@typescript-eslint/parser": "^4.16.1",
"concurrently": "^6.0.0",
"cypress": "^6.6.0",
"cypress-multi-reporters": "^1.4.0",
"eslint": "^7.21.0",
"@types/superagent": "^4.1.11",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^4.24.0",
"@typescript-eslint/parser": "^4.24.0",
"concurrently": "^6.1.0",
"cypress": "^7.3.0",
"cypress-multi-reporters": "^1.5.0",
"eslint": "^7.27.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.3.1",
"husky": "^5.1.3",
"eslint-plugin-cypress": "^2.11.3",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^6.0.0",
"jest": "^26.6.3",
"jest-html-reporter": "^3.3.0",
"jest-html-reporter": "^3.4.0",
"jest-junit": "^12.0.0",
"jsonwebtoken": "^8.5.1",
"lint-staged": "^10.5.4",
"lint-staged": "^11.0.0",
"mocha-junit-reporter": "^2.0.0",
"nock": "^13.0.10",
"nock": "^13.0.11",
"nodemon": "^2.0.7",
"prettier": "^2.2.1",
"sass": "^1.32.8",
"prettier": "^2.3.0",
"sass": "^1.34.0",
"supertest": "^6.1.3",
"ts-jest": "^26.5.3",
"typescript": "^4.2.3"
"ts-jest": "^26.5.6",
"typescript": "^4.2.4"
}
}
3 changes: 1 addition & 2 deletions server/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as dotenv from 'dotenv'
import 'dotenv/config'

dotenv.config()
const production = process.env.NODE_ENV === 'production'

function get<T>(name: string, fallback: T, options = { requireInProduction: false }): T | string {
Expand Down
2 changes: 1 addition & 1 deletion server/data/tokenStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('tokenStore', () => {
let tokenStore: TokenStore

beforeEach(() => {
tokenStore = new TokenStore((redisClient as unknown) as RedisClient)
tokenStore = new TokenStore(redisClient as unknown as RedisClient)
})

afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion server/data/tokenVerification.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import superagent from 'superagent'
import { Request } from 'express'
import type { Request } from 'express'
import getSanitisedError from '../sanitisedError'
import config from '../config'
import logger from '../../logger'
Expand Down
2 changes: 1 addition & 1 deletion server/errorHandler.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Express } from 'express'
import type { Express } from 'express'
import request from 'supertest'
import appWithAllRoutes from './routes/testutils/appSetup'

Expand Down
2 changes: 1 addition & 1 deletion server/middleware/asyncMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction, RequestHandler } from 'express'
import type { Request, Response, NextFunction, RequestHandler } from 'express'

export default function asyncMiddleware(fn: RequestHandler) {
return (req: Request, res: Response, next: NextFunction): void => {
Expand Down
6 changes: 3 additions & 3 deletions server/middleware/authorisationMiddleware.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import jwt from 'jsonwebtoken'
import { Request, Response } from 'express'
import type { Request, Response } from 'express'

import authorisationMiddleware from './authorisationMiddleware'

Expand All @@ -21,7 +21,7 @@ describe('authorisationMiddleware', () => {
const next = jest.fn()

function createResWithToken({ authorities }: { authorities: string[] }): Response {
return ({
return {
locals: {
user: {
token: createToken(authorities),
Expand All @@ -30,7 +30,7 @@ describe('authorisationMiddleware', () => {
redirect: (redirectUrl: string) => {
return redirectUrl
},
} as unknown) as Response
} as unknown as Response
}

it('should return next when no required roles', () => {
Expand Down
12 changes: 6 additions & 6 deletions server/sanitisedError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sanitisedError, { UnsanitisedError } from './sanitisedError'

describe('sanitised error', () => {
it('it should omit the request headers from the error object ', () => {
const error = ({
const error = {
name: '',
status: 404,
response: {
Expand All @@ -23,7 +23,7 @@ describe('sanitised error', () => {
},
message: 'Not Found',
stack: 'stack description',
} as unknown) as UnsanitisedError
} as unknown as UnsanitisedError

expect(sanitisedError(error)).toEqual({
headers: { date: 'Tue, 19 May 2020 15:16:20 GMT' },
Expand All @@ -36,18 +36,18 @@ describe('sanitised error', () => {
})

it('it should return the error message ', () => {
const error = ({
const error = {
message: 'error description',
} as unknown) as UnsanitisedError
} as unknown as UnsanitisedError
expect(sanitisedError(error)).toEqual({
message: 'error description',
})
})

it('it should return an empty object for an unknown error structure', () => {
const error = ({
const error = {
property: 'unknown',
} as unknown) as UnsanitisedError
} as unknown as UnsanitisedError
expect(sanitisedError(error)).toEqual({})
})
})

0 comments on commit a2d85cd

Please sign in to comment.