Skip to content

Commit

Permalink
DD-272
Browse files Browse the repository at this point in the history
Drop Node 14, 16 and 18 and allowing only 20.x || 22.x and updating the following dependencies:
async ^3.2.5 -> ^3.2.6
body-parser ^1.20.2 -> ^2.0.1
debug ^4.3.4 -> ^4.3.7
helmet ^6.2.0 -> ^8.0.0
uuid ^9.0.1 -> ^10.0.0

devDependencies:
eslint ^8.57.0 -> ^9.11.1
express ^4.19.2 -> ^4.21.0
hmpo-components ^6.5.1 -> ^7.0.0
hmpo-config ^3.0.1 -> ^4.0.0
hmpo-i18n ^6.0.2 -> ^7.0.0
hmpo-logger ^7.0.2 -> ^8.0.0
husky ^8.0.3 -> ^9.1.6
mocha ^10.7.0 -> ^10.7.3
nyc ^17.0.0 -> ^17.1.0
Replacing reqres ^3.0.1 with hmpo-reqres 2.0.0
sinon ^18.0.0 -> ^19.0.2

peerDependencies:
hmpo-components >=6 -> >=7
hmpo-config >=3 -> >=4
hmpo-i18n >=6 -> >=7
hmpo-logger >=7 -> >=8
  • Loading branch information
KLV96 committed Oct 28, 2024
1 parent 68c241f commit 0a82ef1
Show file tree
Hide file tree
Showing 14 changed files with 1,184 additions and 1,156 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

28 changes: 0 additions & 28 deletions .eslintrc

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
58 changes: 58 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const js = require('@eslint/js');
const globals = require('globals');

const styleRules = {
quotes: ['error', 'single', { avoidEscape: true }],
'no-trailing-spaces': 'error',
indent: 'error',
'linebreak-style': ['error', 'unix'],
semi: ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'keyword-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': [
'error',
{ anonymous: 'always', named: 'never' },
],
'no-mixed-spaces-and-tabs': 'error',
'comma-spacing': ['error', { before: false, after: true }],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
};

module.exports = [
js.configs.recommended,
{
ignores: ['example/public/**'],
},
{
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.node,
},
},
rules: {
'no-unused-vars': [
'error',
{ argsIgnorePattern: '^(err|req|res|next)$' },
],
'one-var': ['error', { initialized: 'never' }],
'no-var': 'error',
...styleRules,
},
},
// Unit tests
{
files: ['test/**'],
languageOptions: {
globals: {
...globals.mocha,
sinon: 'readonly',
APP_ROOT: 'readonly',
expect: 'readonly',
LOGGER_RESET: 'readonly',
CONFIG_RESET: 'readonly',
},
},
},
];
4 changes: 2 additions & 2 deletions middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const middleware = {
const bodyParser = require('body-parser');
const translation = require('./translation');
const hmpoComponents = require('hmpo-components');
const public = require('./public');
const publicMiddleware = require('./public');
const nunjucks = require('./nunjucks');
const headers = require('./headers');

Expand Down Expand Up @@ -64,7 +64,7 @@ const middleware = {
if (urls.healthcheck) app.get(urls.healthcheck, healthcheck.middleware());

// public static assets
if (publicOptions !== false) app.use(public.middleware({
if (publicOptions !== false) app.use(publicMiddleware.middleware({
urls,
publicDirs,
publicImagesDirs,
Expand Down
Loading

0 comments on commit 0a82ef1

Please sign in to comment.