@moduk/frontend 0.4.1 → 1.0.1
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/README.md +47 -157
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,183 +1,73 @@
|
|
|
1
1
|
# MOD.UK Frontend
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
MOD.UK Frontend contains the code for components you’ll need to build user
|
|
4
|
+
interfaces for Defence products and services.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
See
|
|
7
|
+
[guidance on the components with coded examples](https://design-system.service.mod.gov.uk/components/).
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
components, a CSS stylesheet and a client-side JavaScript library.
|
|
9
|
+
## Support
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
You can
|
|
12
|
+
[report bugs or request new features](https://github.com/defencedigital/moduk-frontend/issues/new/choose).
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
Email [design-system@digital.mod.uk](mailto:design-system@digital.mod.uk) if you
|
|
15
|
+
have questions or any feedback. Please share examples of how you are using
|
|
16
|
+
MOD.UK Frontend.
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
import { createNunjucksEnvironment /* ... */ } from '@moduk/frontend'
|
|
17
|
-
```
|
|
18
|
+
## Get started
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
You need to install MOD.UK Frontend to use the components in the MOD.UK Design
|
|
21
|
+
System in your production environment.
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
See
|
|
24
|
+
[setup guide for developers](https://design-system.service.mod.gov.uk/get-started/setup-guide-for-developers/)
|
|
25
|
+
which shows you how to start using MOD.UK Frontend.
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
import { initAll } from '@moduk/frontend/client'
|
|
27
|
+
## Design library
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
Design and prototype your Defence project with our
|
|
30
|
+
[component design library in Figma](https://design-system.dev.service.mod.gov.uk/get-started/design-library/).
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
`@moduk/frontend/dist/client/moduk-frontend.umd.js`.
|
|
32
|
+
## Browser and assistive technology support
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
MOD.UK Frontend aims to support:
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
- [recommended browsers](https://www.gov.uk/service-manual/technology/designing-for-different-browsers-and-devices#browsers-to-test-in)
|
|
37
|
+
- [recommended assistive technologies](https://www.gov.uk/service-manual/technology/testing-with-assistive-technologies#which-assistive-technologies-to-test-with)
|
|
38
|
+
- your users overriding colours in Windows, Firefox and Chrome
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
## Accessibility
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
Using MOD.UK Frontend will help your service meet
|
|
43
|
+
[level AA of WCAG 2.1](https://www.gov.uk/service-manual/helping-people-to-use-your-service/understanding-wcag).
|
|
44
|
+
But you must still
|
|
45
|
+
[check that your service meets accessibility requirements](https://www.gov.uk/service-manual/helping-people-to-use-your-service/making-your-service-accessible-an-introduction),
|
|
46
|
+
especially if you extend or modify components.
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```
|
|
48
|
+
You should also use the
|
|
49
|
+
[JavaScript from MOD.UK Frontend](https://design-system.service.mod.gov.uk/get-started/setup-guide-for-developers/#5.-load-the-javascript).
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
### Accessibility warnings: known issues
|
|
47
52
|
|
|
48
|
-
If you
|
|
49
|
-
|
|
53
|
+
If you get a warning from a linter or accessibility checker, check a list of
|
|
54
|
+
[issues you should not need to fix](https://github.com/alphagov/govuk-frontend/issues/1280#issuecomment-509588851).
|
|
50
55
|
|
|
51
|
-
##
|
|
56
|
+
## Getting updates
|
|
52
57
|
|
|
53
|
-
|
|
54
|
-
[
|
|
55
|
-
|
|
56
|
-
hooks are used for enforcing linting and formatting rules.
|
|
58
|
+
To be notified when there’s a new release you can
|
|
59
|
+
[watch the moduk-frontend repository](https://docs.github.com/en/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications#configuring-your-watch-settings-for-an-individual-repository).
|
|
60
|
+
(After selecting ‘Watch’, choose the ‘Custom’ option and select ‘Releases’.)
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
[Testing Library](https://testing-library.com).
|
|
62
|
+
## Security
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
run across a variety of browsers and configurations against a local web server
|
|
63
|
-
that serves examples of components. This includes accessibility checks using
|
|
64
|
-
[axe](https://www.deque.com/axe/) and visual regression tests.
|
|
64
|
+
If you have found a security vulnerability, please let us know so we can fix it.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
[Report a vulnerability on an MOD system](https://www.gov.uk/guidance/report-a-vulnerability-on-an-mod-system).
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
## Licence
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
cd moduk-frontend
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
2. Install dependencies:
|
|
78
|
-
|
|
79
|
-
```shell
|
|
80
|
-
npm install
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
3. Install Playwright browsers and system dependencies:
|
|
84
|
-
|
|
85
|
-
```shell
|
|
86
|
-
npm run playwright-install
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
4. Install Podman using
|
|
90
|
-
[the instructions for your platform](https://podman.io/getting-started/installation).
|
|
91
|
-
|
|
92
|
-
Podman is required only for running visual regression tests.
|
|
93
|
-
|
|
94
|
-
5. Ensure jq is installed. On macOS it can be installed using
|
|
95
|
-
[Homebrew](https://brew.sh/):
|
|
96
|
-
|
|
97
|
-
jq is required only for running visual regression tests.
|
|
98
|
-
|
|
99
|
-
```shell
|
|
100
|
-
brew install jq
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Commands
|
|
104
|
-
|
|
105
|
-
#### Lint all files
|
|
106
|
-
|
|
107
|
-
```shell
|
|
108
|
-
npm run lint
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
#### Reformat all files
|
|
112
|
-
|
|
113
|
-
```shell
|
|
114
|
-
npm run format
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
#### Build the library ready for publishing
|
|
118
|
-
|
|
119
|
-
```shell
|
|
120
|
-
npm run build
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
#### Run all unit tests
|
|
124
|
-
|
|
125
|
-
```shell
|
|
126
|
-
npm run test
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
#### Run the examples web server
|
|
130
|
-
|
|
131
|
-
```shell
|
|
132
|
-
npm run serve
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
#### Run end-to-end tests
|
|
136
|
-
|
|
137
|
-
```shell
|
|
138
|
-
npm run test:e2e
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
##### Run specific files using a regex
|
|
142
|
-
|
|
143
|
-
```shell
|
|
144
|
-
npm run test:e2e <regex>
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
##### Run tests with tracing
|
|
148
|
-
|
|
149
|
-
```shell
|
|
150
|
-
npm run test:e2e:trace
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
#### Run visual regression tests in a container
|
|
154
|
-
|
|
155
|
-
Visual regression tests run in a container, using Podman, to ensure screenshots
|
|
156
|
-
are taken in a consistent environment.
|
|
157
|
-
|
|
158
|
-
To run the visual regression tests:
|
|
159
|
-
|
|
160
|
-
```shell
|
|
161
|
-
npm run test:visual
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
This will also generate any missing screenshots.
|
|
165
|
-
|
|
166
|
-
#### Update visual regression snapshots
|
|
167
|
-
|
|
168
|
-
To update any screenshots that have changed:
|
|
169
|
-
|
|
170
|
-
```shell
|
|
171
|
-
npm run test:visual:refresh
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
#### Delete all visual regression snapshots
|
|
175
|
-
|
|
176
|
-
To delete all existing screenshots:
|
|
177
|
-
|
|
178
|
-
```shell
|
|
179
|
-
npm run test:visual:clean
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
This can be useful after renaming or deleting visual regression tests or
|
|
183
|
-
component examples.
|
|
70
|
+
Unless stated otherwise, the codebase is released under the MIT License. This
|
|
71
|
+
covers both the codebase and any sample code in the documentation. The
|
|
72
|
+
documentation is © Crown copyright and available under the terms of the Open
|
|
73
|
+
Government 3.0 licence.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moduk/frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The MOD.UK Frontend contains the code you need to start building a user interface for Ministry of Defence platforms and services.",
|
|
5
5
|
"main": "dist/lib/index.js",
|
|
6
6
|
"sass": "src/css/index.scss",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@babel/preset-typescript": "^7.18.6",
|
|
88
88
|
"@commitlint/cli": "^17.4.2",
|
|
89
89
|
"@commitlint/config-conventional": "^17.4.3",
|
|
90
|
-
"@playwright/test": "^1.
|
|
90
|
+
"@playwright/test": "^1.30.0",
|
|
91
91
|
"@release-it/conventional-changelog": "^5.1.1",
|
|
92
92
|
"@testing-library/dom": "^8.20.0",
|
|
93
93
|
"@testing-library/jest-dom": "^5.16.5",
|