hmpo-form-wizard 13.0.2 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,12 +13,12 @@ jobs:
13
13
 
14
14
  strategy:
15
15
  matrix:
16
- node-version: [14.x, 16.x, 18.x, 20.x]
16
+ node-version: [20.x, 22.x]
17
17
 
18
18
  steps:
19
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v4
20
20
  - name: Use Node.js ${{ matrix.node-version }}
21
- uses: actions/setup-node@v2
21
+ uses: actions/setup-node@v4
22
22
  with:
23
23
  node-version: ${{ matrix.node-version }}
24
24
  - name: Install dependencies
@@ -0,0 +1 @@
1
+ npm test
@@ -0,0 +1,56 @@
1
+ const js = require('@eslint/js');
2
+ const globals = require('globals');
3
+
4
+
5
+ const styleRules = {
6
+ quotes: ['error', 'single', { avoidEscape: true }],
7
+ 'no-trailing-spaces': 'error',
8
+ indent: 'error',
9
+ 'linebreak-style': ['error', 'unix'],
10
+ semi: ['error', 'always'],
11
+ 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
12
+ 'keyword-spacing': 'error',
13
+ 'space-before-blocks': 'error',
14
+ 'space-before-function-paren': [
15
+ 'error',
16
+ { anonymous: 'always', named: 'never' },
17
+ ],
18
+ 'no-mixed-spaces-and-tabs': 'error',
19
+ 'comma-spacing': ['error', { before: false, after: true }],
20
+ 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
21
+ };
22
+
23
+
24
+ module.exports = [
25
+ js.configs.recommended,
26
+ {
27
+ languageOptions: {
28
+ ecmaVersion: 2022,
29
+ globals: {
30
+ ...globals.node,
31
+ }
32
+ },
33
+ rules: {
34
+ 'no-unused-vars': [
35
+ 'error',
36
+ { argsIgnorePattern: '^(err|req|res|next)$' },
37
+ ],
38
+ 'one-var': ['error', { initialized: 'never' }],
39
+ 'no-var': 'error',
40
+ ...styleRules,
41
+ },
42
+ },
43
+ // Unit tests
44
+ {
45
+ files: ['test/**'],
46
+ languageOptions: {
47
+ globals: {
48
+ ...globals.mocha,
49
+ sinon: 'readonly',
50
+ request: 'readonly',
51
+ response: 'readonly',
52
+ expect: 'readonly'
53
+ },
54
+ },
55
+ },
56
+ ];
@@ -1,2 +1,2 @@
1
-
1
+ /* eslint-disable no-undef */
2
2
  window.GOVUKFrontend.initAll();
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "hmpo-form-wizard",
3
- "version": "13.0.2",
3
+ "version": "14.0.0",
4
4
  "description": "Routing and request handling for a multi-step form processes",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "npm run test:lint && npm run test:unit && npm run test:cover && npm audit --production",
8
8
  "test:lint": "eslint .",
9
9
  "test:unit": "nyc --reporter=lcov --reporter=text-summary _mocha",
10
- "test:cover": "nyc check-coverage"
10
+ "test:cover": "nyc check-coverage",
11
+ "prepare": "husky"
11
12
  },
12
13
  "repository": {
13
14
  "type": "git",
@@ -16,18 +17,18 @@
16
17
  "author": "HMPO",
17
18
  "license": "MIT",
18
19
  "engines": {
19
- "node": ">=14"
20
+ "node": "20.x || 22.x"
20
21
  },
21
22
  "bugs": {
22
23
  "url": "https://github.com/HMPO/hmpo-form-wizard/issues"
23
24
  },
24
25
  "homepage": "https://github.com/HMPO/hmpo-form-wizard#readme",
25
26
  "dependencies": {
26
- "body-parser": "^1.20.2",
27
+ "body-parser": "^1.20.3",
27
28
  "csrf": "^3.1.0",
28
- "debug": "^4.3.6",
29
+ "debug": "^4.3.7",
29
30
  "deep-clone-merge": "^1.5.5",
30
- "hmpo-model": "^5.0.1",
31
+ "hmpo-model": "^6.0.1",
31
32
  "moment": "^2.30.1",
32
33
  "underscore": "^1.13.7"
33
34
  },
@@ -37,15 +38,17 @@
37
38
  },
38
39
  "devDependencies": {
39
40
  "chai": "^4.5.0",
40
- "eslint": "^8.57.0",
41
- "express": "^4.19.2",
41
+ "eslint": "^9.12.0",
42
+ "express": "^4.21.1",
42
43
  "json5": "^2.2.3",
43
- "mocha": "^10.7.0",
44
- "nyc": "^17.0.0",
44
+ "mocha": "^10.7.3",
45
+ "nyc": "^17.1.0",
45
46
  "proxyquire": "^2.1.3",
46
- "reqres": "^3.0.1",
47
- "sinon": "^18.0.0",
48
- "sinon-chai": "^3.7.0"
47
+ "hmpo-reqres": "^2.0.0",
48
+ "sinon": "^19.0.2",
49
+ "sinon-chai": "^3.7.0",
50
+ "husky": "^9.1.6",
51
+ "globals": "^15.11.0"
49
52
  },
50
53
  "mocha": {
51
54
  "require": "test/helpers",
@@ -57,7 +60,8 @@
57
60
  "bin/**",
58
61
  "coverage/**",
59
62
  "test/**",
60
- "example/**"
63
+ "example/**",
64
+ "eslint.config.js"
61
65
  ],
62
66
  "check-coverage": true,
63
67
  "skip-full": true,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const reqres = require('reqres');
3
+ const reqres = require('hmpo-reqres');
4
4
  const WizardModel = require('../../lib/wizard-model');
5
5
  const JourneyModel = require('../../lib/journey-model');
6
6
 
@@ -1,3 +1,3 @@
1
1
  'use strict';
2
2
 
3
- module.exports = require('reqres').res;
3
+ module.exports = require('hmpo-reqres').res;
package/.eslintignore DELETED
@@ -1,4 +0,0 @@
1
- /coverage/**
2
- **/node_modules/**
3
- **/assets/javascripts
4
- **/public
package/.eslintrc DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "env": {
3
- "node": true,
4
- "es6": true
5
- },
6
- "extends": "eslint:recommended",
7
- "rules": {
8
- "no-unused-vars": ["error", { "argsIgnorePattern": "^(err|req|res|next)$" }],
9
- "no-mixed-requires": ["error", { "allowCall": true }],
10
- "quotes": ["error", "single"],
11
- "no-trailing-spaces": "error",
12
- "indent": "error",
13
- "linebreak-style": ["error", "unix"],
14
- "semi": ["error", "always"],
15
- "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
16
- "keyword-spacing": "error",
17
- "space-before-blocks": "error",
18
- "space-before-function-paren": ["error", { "anonymous": "always", "named": "never" }],
19
- "no-mixed-spaces-and-tabs": "error",
20
- "comma-spacing": ["error", {"before": false, "after": true}],
21
- "key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
22
- "one-var": ["error", { "initialized": "never" }],
23
- "no-var": "error"
24
- }
25
- }
@@ -1,3 +0,0 @@
1
- node_modules
2
- assets/javascripts
3
- public
package/test/.eslintrc DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "env": {
3
- "node": true,
4
- "es6": true,
5
- "mocha": true
6
- },
7
- "globals": {
8
- "sinon": true,
9
- "should": true,
10
- "expect": true,
11
- "request": true,
12
- "response": true
13
- }
14
- }