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

FSR-1387 - upgrade node to 20 #899

Open
wants to merge 11 commits into
base: development
Choose a base branch
from
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set node version
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV

- name: Install nodejs
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: ${{ env.NODE_VERSION }}

- name: Install node dependencies
run: npm ci
run: npm ci --engine-strict

- name: Run linting
run: npm run lint
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.16.1
v20.18.2
4 changes: 2 additions & 2 deletions build/build
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

npm run build:clean && npm run build:js && npm run build:css && npm run build:cp-assets
npm run build:clean && npm run build:js && npm run build:css && npm run build:cp-assets
2 changes: 1 addition & 1 deletion build/build-css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

sass --style=compressed \
--load-path=node_modules \
Expand Down
4 changes: 2 additions & 2 deletions build/build-js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#!/bin/sh

mkdir -p server/dist/js
nunjucks-precompile server/src/templates > server/dist/js/templates.js
webpack
webpack
57 changes: 3 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"main": "index.js",
"repository": "github:defra/flood-app",
"engines": {
"node": ">=18"
"node": "20.18.2"
},
"browserslist": [
"IE 11"
],
"scripts": {
"start": "pm2 start config/pm2.json",
"start:local": "nodemon -r dotenv/config index.js",
"start:local": "nodemon --ext js,json,html,env -r dotenv/config index.js",
"start:local:no-watch": "node -r dotenv/config index.js",
"build:clean": "build/clean-src",
"build:cp-assets": "build/cp-assets",
"build:js": "build/build-js",
Expand Down Expand Up @@ -40,9 +41,7 @@
"@hapi/code": "^9.0.3",
"@hapi/h2o2": "^10.0.4",
"@hapi/hapi": "^21.3.2",
"@hapi/hoek": "^11.0.2",
"@hapi/inert": "^7.1.0",
"@hapi/joi": "^17.1.1",
"@hapi/lab": "^25.1.3",
"@hapi/vision": "^7.0.3",
"@hapi/wreck": "^18.0.1",
Expand All @@ -67,6 +66,7 @@
"govuk-frontend": "^5.4.0",
"hapi-pino": "^12.1.0",
"hapi-rate-limit": "^7.1.0",
"joi": "^17.13.3",
"jquery": "^3.7.1",
"lodash.isequal": "^4.5.0",
"micromatch": "^4.0.8",
Expand Down
5 changes: 2 additions & 3 deletions release-docs/CFF-8.12.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@


1 - Execute LFW_{STAGE}_04_UPDATE_FLOOD_APP_AND_SERVICE_PIPELINE


Execute smoke tests and forward results

2 - Execute smoke tests and forward results

## Notes

Expand Down
2 changes: 1 addition & 1 deletion server/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const joi = require('@hapi/joi')
const joi = require('joi')
const pkg = require('../package.json')

const defaultPort = 3009
Expand Down
2 changes: 1 addition & 1 deletion server/routes/alerts-and-warnings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const joi = require('@hapi/joi')
const joi = require('joi')
const ViewModel = require('../models/views/alerts-and-warnings')
const Floods = require('../models/floods')
const locationService = require('../services/location')
Expand Down
2 changes: 1 addition & 1 deletion server/routes/api/warnings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Joi = require('@hapi/joi')
const Joi = require('joi')
const Floods = require('../../models/floods')
const floodsMessage = require('../../models/floods-message')
const locationService = require('../../services/location')
Expand Down
2 changes: 1 addition & 1 deletion server/routes/location.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const joi = require('@hapi/joi')
const joi = require('joi')
const boom = require('@hapi/boom')
const ViewModel = require('../models/views/location')
const OutlookTabsModel = require('../models/outlook-tabs')
Expand Down
2 changes: 1 addition & 1 deletion server/routes/national.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const joi = require('@hapi/joi')
const joi = require('joi')
const OutlookModel = require('../models/outlook')
const FloodsModel = require('../models/floods')
const ViewModel = require('../models/views/national')
Expand Down
2 changes: 1 addition & 1 deletion server/routes/rainfall-station.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const joi = require('@hapi/joi')
const joi = require('joi')
const boom = require('@hapi/boom')
const ViewModel = require('../models/views/rainfall')

Expand Down
2 changes: 1 addition & 1 deletion server/routes/river-and-sea-levels.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const joi = require('@hapi/joi')
const joi = require('joi')
const boom = require('@hapi/boom')
const {
riverViewModel,
Expand Down
2 changes: 1 addition & 1 deletion server/routes/station-csv.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const floodService = require('../services/flood')
const moment = require('moment-timezone')
const boom = require('@hapi/boom')
const joi = require('@hapi/joi')
const joi = require('joi')

const maxId = 999

Expand Down
2 changes: 1 addition & 1 deletion server/routes/station.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const joi = require('@hapi/joi')
const joi = require('joi')
const boom = require('@hapi/boom')
const ViewModel = require('../models/views/station')
const additionalWelshStations = [4162, 4170, 4173, 4174, 4176]
Expand Down
2 changes: 1 addition & 1 deletion server/routes/target-area.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const joi = require('@hapi/joi')
const joi = require('joi')
const ViewModel = require('../models/views/target-area')

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion server/services/location.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const joi = require('@hapi/joi')
const joi = require('joi')
const { bingKeyLocation, bingUrl } = require('../config')
const { getJson } = require('../util')
const util = require('util')
Expand Down