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.
- package/.github/workflows/ci.yaml +3 -3
- package/.husky/pre-push +1 -0
- package/eslint.config.js +56 -0
- package/example/assets/javascripts/app.js +1 -1
- package/package.json +18 -14
- package/test/helpers/request.js +1 -1
- package/test/helpers/response.js +1 -1
- package/.eslintignore +0 -4
- package/.eslintrc +0 -25
- package/example/.eslintignore +0 -3
- package/test/.eslintrc +0 -14
|
@@ -13,12 +13,12 @@ jobs:
|
|
|
13
13
|
|
|
14
14
|
strategy:
|
|
15
15
|
matrix:
|
|
16
|
-
node-version: [
|
|
16
|
+
node-version: [20.x, 22.x]
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
20
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
21
|
-
uses: actions/setup-node@
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
22
|
with:
|
|
23
23
|
node-version: ${{ matrix.node-version }}
|
|
24
24
|
- name: Install dependencies
|
package/.husky/pre-push
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npm test
|
package/eslint.config.js
ADDED
|
@@ -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": "
|
|
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": "
|
|
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.
|
|
27
|
+
"body-parser": "^1.20.3",
|
|
27
28
|
"csrf": "^3.1.0",
|
|
28
|
-
"debug": "^4.3.
|
|
29
|
+
"debug": "^4.3.7",
|
|
29
30
|
"deep-clone-merge": "^1.5.5",
|
|
30
|
-
"hmpo-model": "^
|
|
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": "^
|
|
41
|
-
"express": "^4.
|
|
41
|
+
"eslint": "^9.12.0",
|
|
42
|
+
"express": "^4.21.1",
|
|
42
43
|
"json5": "^2.2.3",
|
|
43
|
-
"mocha": "^10.7.
|
|
44
|
-
"nyc": "^17.
|
|
44
|
+
"mocha": "^10.7.3",
|
|
45
|
+
"nyc": "^17.1.0",
|
|
45
46
|
"proxyquire": "^2.1.3",
|
|
46
|
-
"reqres": "^
|
|
47
|
-
"sinon": "^
|
|
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,
|
package/test/helpers/request.js
CHANGED
package/test/helpers/response.js
CHANGED
package/.eslintignore
DELETED
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
|
-
}
|
package/example/.eslintignore
DELETED