@hmlr/govuk-react-components-library 1.2.1 → 1.2.3
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/.prettierignore +2 -0
- package/README.md +1 -1
- package/assets/uml-diagram.svg +4 -4
- package/dist/PDFViewerCanvas.cjs.js +13 -1980
- package/dist/PDFViewerCanvas.cjs.js.map +1 -1
- package/dist/PDFViewerCanvas.esm.js +2 -1951
- package/dist/PDFViewerCanvas.esm.js.map +1 -1
- package/dist/index.cjs.css +127 -134
- package/dist/index.cjs.js +97 -2020
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.css +127 -134
- package/dist/index.esm.js +78 -2001
- package/dist/index.esm.js.map +1 -1
- package/package.json +75 -58
- package/scripts/generateStories.mjs +19 -1
- package/bundle-analysis-main.html +0 -4949
- package/bundle-analysis-pdfvc.html +0 -4949
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmlr/govuk-react-components-library",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "These are common component use for React applications based on GDS and govuk-frontend",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
"storybook": "storybook dev -p 6006 --debug-webpack",
|
|
25
25
|
"build-storybook": "storybook build --debug-webpack",
|
|
26
26
|
"test-storybook": "test-storybook",
|
|
27
|
-
"
|
|
27
|
+
"test-storybook:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"http-server storybook-static --port 6006 --silent\" \"wait-on tcp:6006 && npm run test-storybook -- --maxWorkers=2\"",
|
|
28
|
+
"format:check": "prettier --ignore-path .gitignore --ignore-path .prettierignore --check '**/*.+(js|mjs|ts|tsx|json|css|scss|html|md)'",
|
|
28
29
|
"lint": "eslint 'src/**/*.ts*' && npm run format:check && stylelint 'src/**/*.{css,scss,less}'",
|
|
29
|
-
"format": "prettier --ignore-path .gitignore --write '**/*.+(js|mjs|ts|tsx|json|css|scss|html|md)'",
|
|
30
|
+
"format": "prettier --ignore-path .gitignore --ignore-path .prettierignore --write '**/*.+(js|mjs|ts|tsx|json|css|scss|html|md)'",
|
|
30
31
|
"lint-fix": "eslint --fix 'src/**/*.ts*' && npm run format && stylelint --fix 'src/**/*.{css,scss,less}' ",
|
|
31
32
|
"prepare": "husky",
|
|
32
33
|
"release": "standard-version",
|
|
@@ -55,93 +56,97 @@
|
|
|
55
56
|
"author": "Cyril Adelekan",
|
|
56
57
|
"license": "MIT",
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"@babel/core": "^7.29.
|
|
59
|
-
"@babel/preset-env": "^7.29.
|
|
60
|
-
"@babel/preset-react": "^7.
|
|
61
|
-
"@babel/preset-typescript": "^7.
|
|
62
|
-
"@chromatic-com/storybook": "^5.
|
|
63
|
-
"@commitlint/cli": "^
|
|
64
|
-
"@commitlint/config-conventional": "^
|
|
65
|
-
"@eslint/js": "^9.
|
|
66
|
-
"@jest/globals": "^30.
|
|
67
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
59
|
+
"@babel/core": "^7.29.7",
|
|
60
|
+
"@babel/preset-env": "^7.29.7",
|
|
61
|
+
"@babel/preset-react": "^7.29.7",
|
|
62
|
+
"@babel/preset-typescript": "^7.29.7",
|
|
63
|
+
"@chromatic-com/storybook": "^5.3.1",
|
|
64
|
+
"@commitlint/cli": "^21.2.2",
|
|
65
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
66
|
+
"@eslint/js": "^9.39.5",
|
|
67
|
+
"@jest/globals": "^30.5.1",
|
|
68
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
68
69
|
"@rollup/plugin-json": "^6.1.0",
|
|
69
70
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
70
71
|
"@rollup/plugin-terser": "^1.0.0",
|
|
71
72
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
72
|
-
"@storybook/addon-a11y": "^10.
|
|
73
|
-
"@storybook/addon-
|
|
74
|
-
"@storybook/addon-
|
|
73
|
+
"@storybook/addon-a11y": "^10.6.0",
|
|
74
|
+
"@storybook/addon-docs": "^10.6.0",
|
|
75
|
+
"@storybook/addon-links": "^10.6.0",
|
|
76
|
+
"@storybook/addon-styling-webpack": "^3.0.2",
|
|
75
77
|
"@storybook/addon-webpack5-compiler-swc": "^4.0.3",
|
|
76
|
-
"@storybook/react-vite": "^10.
|
|
77
|
-
"@storybook/react-webpack5": "^10.
|
|
78
|
-
"@storybook/test-runner": "^0.24.
|
|
79
|
-
"@testing-library/jest-dom": "^
|
|
80
|
-
"@testing-library/react": "^16.3.
|
|
78
|
+
"@storybook/react-vite": "^10.6.0",
|
|
79
|
+
"@storybook/react-webpack5": "^10.6.0",
|
|
80
|
+
"@storybook/test-runner": "^0.24.5",
|
|
81
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
82
|
+
"@testing-library/react": "^16.3.3",
|
|
81
83
|
"@types/govuk-frontend": "^5.11.0",
|
|
82
84
|
"@types/jest": "^30.0.0",
|
|
83
|
-
"@types/react": "^19.2.
|
|
84
|
-
"@types/react-dom": "^19.2.
|
|
85
|
+
"@types/react": "^19.2.18",
|
|
86
|
+
"@types/react-dom": "^19.2.7",
|
|
85
87
|
"assert": "^2.1.0",
|
|
86
|
-
"autoprefixer": "^10.
|
|
87
|
-
"babel-jest": "^30.
|
|
88
|
+
"autoprefixer": "^10.5.5",
|
|
89
|
+
"babel-jest": "^30.5.1",
|
|
88
90
|
"bootstrap": "^5.3.8",
|
|
89
|
-
"chromatic": "^
|
|
90
|
-
"
|
|
91
|
+
"chromatic": "^18.7.2",
|
|
92
|
+
"concurrently": "^10.0.5",
|
|
93
|
+
"css-loader": "^7.1.5",
|
|
91
94
|
"deep-iterator": "^1.1.0",
|
|
92
|
-
"eslint": "^9.
|
|
95
|
+
"eslint": "^9.39.5",
|
|
93
96
|
"eslint-plugin-react": "^7.37.5",
|
|
94
|
-
"eslint-plugin-storybook": "^10.
|
|
95
|
-
"globals": "^17.
|
|
96
|
-
"govuk-frontend": "^6.
|
|
97
|
+
"eslint-plugin-storybook": "^10.6.0",
|
|
98
|
+
"globals": "^17.12.0",
|
|
99
|
+
"govuk-frontend": "^6.5.0",
|
|
97
100
|
"html-react-parser": "^5.2.17",
|
|
101
|
+
"http-server": "^14.1.1",
|
|
98
102
|
"husky": "^9.1.7",
|
|
99
103
|
"identity-obj-proxy": "^3.0.0",
|
|
100
|
-
"jest": "^30.
|
|
101
|
-
"jest-environment-jsdom": "^30.
|
|
102
|
-
"magicast": "^0.5.
|
|
103
|
-
"pdfjs-dist": "^
|
|
104
|
-
"postcss": "^8.5.
|
|
105
|
-
"prettier": "^3.
|
|
106
|
-
"react": "^19.2.
|
|
104
|
+
"jest": "^30.5.1",
|
|
105
|
+
"jest-environment-jsdom": "^30.5.1",
|
|
106
|
+
"magicast": "^0.5.4",
|
|
107
|
+
"pdfjs-dist": "^6.3.289",
|
|
108
|
+
"postcss": "^8.5.28",
|
|
109
|
+
"prettier": "^3.9.6",
|
|
110
|
+
"react": "^19.2.8",
|
|
107
111
|
"react-bootstrap": "^2.10.10",
|
|
108
|
-
"react-dom": "^19.2.
|
|
112
|
+
"react-dom": "^19.2.8",
|
|
109
113
|
"react-element-to-jsx-string": "^17.0.1",
|
|
110
|
-
"react-router": "^7.
|
|
111
|
-
"react-router-dom": "^7.
|
|
114
|
+
"react-router": "^7.18.3",
|
|
115
|
+
"react-router-dom": "^7.18.3",
|
|
112
116
|
"rimraf": "^6.1.3",
|
|
113
|
-
"rollup": "^4.
|
|
117
|
+
"rollup": "^4.63.1",
|
|
114
118
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
115
|
-
"rollup-plugin-dts": "^6.
|
|
119
|
+
"rollup-plugin-dts": "^6.5.1",
|
|
116
120
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
117
121
|
"rollup-plugin-postcss": "^4.0.2",
|
|
118
|
-
"rollup-plugin-visualizer": "^6.0.
|
|
119
|
-
"sass": "^1.
|
|
120
|
-
"sass-loader": "^
|
|
122
|
+
"rollup-plugin-visualizer": "^6.0.11",
|
|
123
|
+
"sass": "^1.104.0",
|
|
124
|
+
"sass-loader": "^17.0.1",
|
|
121
125
|
"standard-version": "^9.5.0",
|
|
122
|
-
"storybook": "^10.
|
|
126
|
+
"storybook": "^10.6.0",
|
|
123
127
|
"style-loader": "^4.0.0",
|
|
124
|
-
"stylelint": "^17.
|
|
125
|
-
"stylelint-config-recess-order": "^7.
|
|
128
|
+
"stylelint": "^17.15.0",
|
|
129
|
+
"stylelint-config-recess-order": "^7.8.0",
|
|
126
130
|
"stylelint-config-standard": "^40.0.0",
|
|
127
131
|
"stylelint-config-standard-scss": "^17.0.0",
|
|
128
|
-
"stylelint-order": "^
|
|
132
|
+
"stylelint-order": "^8.1.1",
|
|
129
133
|
"tslib": "^2.8.1",
|
|
130
134
|
"tsuml2": "^0.17.1",
|
|
131
|
-
"typescript": "^
|
|
132
|
-
"typescript-eslint": "^8.
|
|
133
|
-
"unplugin": "^3.
|
|
134
|
-
"
|
|
135
|
-
"
|
|
135
|
+
"typescript": "^6.0.3",
|
|
136
|
+
"typescript-eslint": "^8.70.0",
|
|
137
|
+
"unplugin": "^3.3.0",
|
|
138
|
+
"wait-on": "^9.1.0",
|
|
139
|
+
"webpack": "^5.110.3"
|
|
136
140
|
},
|
|
137
141
|
"peerDependencies": {
|
|
138
142
|
"govuk-frontend": ">=5.14.0",
|
|
139
143
|
"react": ">=18.2.0",
|
|
140
144
|
"react-dom": ">=18.2.0",
|
|
145
|
+
"react-router": ">=6.30.0",
|
|
141
146
|
"react-router-dom": ">=6.30.0"
|
|
142
147
|
},
|
|
143
148
|
"optionalDependencies": {
|
|
144
|
-
"pdfjs-dist": ">=
|
|
149
|
+
"pdfjs-dist": ">=6.3.289"
|
|
145
150
|
},
|
|
146
151
|
"jest": {
|
|
147
152
|
"testEnvironment": "jsdom",
|
|
@@ -155,7 +160,10 @@
|
|
|
155
160
|
"customExportConditions": [
|
|
156
161
|
"react-native"
|
|
157
162
|
]
|
|
158
|
-
}
|
|
163
|
+
},
|
|
164
|
+
"transformIgnorePatterns": [
|
|
165
|
+
"node_modules/(?!(html-react-parser|domhandler|domelementtype|dom-serializer|entities|html-dom-parser)/)"
|
|
166
|
+
]
|
|
159
167
|
},
|
|
160
168
|
"babel": {
|
|
161
169
|
"presets": [
|
|
@@ -170,6 +178,15 @@
|
|
|
170
178
|
]
|
|
171
179
|
},
|
|
172
180
|
"dependencies": {
|
|
173
|
-
"ts-dedent": "^2.
|
|
181
|
+
"ts-dedent": "^2.3.0"
|
|
182
|
+
},
|
|
183
|
+
"allowScripts": {
|
|
184
|
+
"@parcel/watcher@2.6.0": true,
|
|
185
|
+
"@swc/core@1.16.1": true,
|
|
186
|
+
"core-js@2.6.12": true,
|
|
187
|
+
"fsevents@2.3.2": true,
|
|
188
|
+
"fsevents@2.3.3": true,
|
|
189
|
+
"esbuild@0.27.7": true,
|
|
190
|
+
"unrs-resolver@1.12.2": true
|
|
174
191
|
}
|
|
175
192
|
}
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
import fs from "fs";
|
|
29
29
|
import path from "path";
|
|
30
30
|
import { fileURLToPath } from "url";
|
|
31
|
+
import * as prettier from "prettier";
|
|
31
32
|
|
|
32
33
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
33
34
|
const ROOT = path.resolve(__dirname, "..");
|
|
@@ -369,7 +370,24 @@ for (const componentName of srcComponentNames) {
|
|
|
369
370
|
`${componentName}.stories.tsx`,
|
|
370
371
|
);
|
|
371
372
|
|
|
372
|
-
|
|
373
|
+
// Formatted here (rather than left for a separate `npm run format` pass)
|
|
374
|
+
// so the output always matches what `npm run lint` expects - this script
|
|
375
|
+
// runs on every `npm run storybook` via the `prestorybook` hook, and
|
|
376
|
+
// unformatted output would fail lint the moment someone commits it.
|
|
377
|
+
const formatted = await prettier.format(
|
|
378
|
+
generateFile(componentName, fixtures),
|
|
379
|
+
{ parser: "typescript", filepath: outputPath },
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
// Skip the write when content is unchanged, so a plain `npm run storybook`
|
|
383
|
+
// restart doesn't touch every story file's mtime (noisy for file watchers
|
|
384
|
+
// and git status) when nothing upstream has actually changed.
|
|
385
|
+
const existing = fs.existsSync(outputPath)
|
|
386
|
+
? fs.readFileSync(outputPath, "utf8")
|
|
387
|
+
: null;
|
|
388
|
+
if (existing !== formatted) {
|
|
389
|
+
fs.writeFileSync(outputPath, formatted, "utf8");
|
|
390
|
+
}
|
|
373
391
|
results.generated.push({ componentName, count: fixtures.length });
|
|
374
392
|
}
|
|
375
393
|
|