@moduk/frontend 0.4.1 → 1.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.
Files changed (2) hide show
  1. package/README.md +47 -157
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,183 +1,73 @@
1
1
  # MOD.UK Frontend
2
2
 
3
- The MOD.UK Frontend contains the code you need to start building a user
4
- interface for Ministry of Defence platforms and services.
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
- This library is currently under development and is not yet ready for use.
6
+ See
7
+ [guidance on the components with coded examples](https://design-system.service.mod.gov.uk/components/).
7
8
 
8
- The library contains a library of [Nunjucks](https://www.typescriptlang.org)
9
- components, a CSS stylesheet and a client-side JavaScript library.
9
+ ## Support
10
10
 
11
- ## Usage
11
+ You can
12
+ [report bugs or request new features](https://github.com/defencedigital/moduk-frontend/issues/new/choose).
12
13
 
13
- ### Importing Nunjucks configuration helpers
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
- ```typescript
16
- import { createNunjucksEnvironment /* ... */ } from '@moduk/frontend'
17
- ```
18
+ ## Get started
18
19
 
19
- ### Importing the client-side library
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
- If you’re using Webpack 5 or a similar bundler, the client-side library can be
22
- imported from `@moduk/frontend/client`:
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
- ```javascript
25
- import { initAll } from '@moduk/frontend/client'
27
+ ## Design library
26
28
 
27
- initAll()
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
- In older environments, you may need to import the client-side library from
31
- `@moduk/frontend/dist/client/moduk-frontend.umd.js`.
32
+ ## Browser and assistive technology support
32
33
 
33
- ### Importing the CSS
34
+ MOD.UK Frontend aims to support:
34
35
 
35
- #### Using Sass
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
- Dart Sass is required.
40
+ ## Accessibility
38
41
 
39
- You should ensure `node_modules` is resolvable by Sass. If using the `sass` CLI
40
- you can pass `--load-path=node_modules` to achieve this.
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
- ```scss
43
- @use '@moduk/frontend/src/css';
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
- #### Without Sass
51
+ ### Accessibility warnings: known issues
47
52
 
48
- If you aren’t using Sass, a compiled version of the CSS can be found at
49
- `node_modules/@moduk/frontend/dist/css/index.css`.
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
- ## Development
56
+ ## Getting updates
52
57
 
53
- The library uses [TypeScript](https://www.typescriptlang.org),
54
- [Sass](https://sass-lang.com), [ESLint](https://eslint.org),
55
- [dprint](https://dprint.dev) and [commitlint](https://commitlint.js.org). Git
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
- The unit test suite uses [Vitest](https://vitest.dev) and
59
- [Testing Library](https://testing-library.com).
62
+ ## Security
60
63
 
61
- The end-to-end test suite uses [Playwright](https://playwright.dev/). Tests are
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
- Local development requires Node.js 16 or 18 and npm 8.
66
+ [Report a vulnerability on an MOD system](https://www.gov.uk/guidance/report-a-vulnerability-on-an-mod-system).
67
67
 
68
- ### Setting up your development environment
68
+ ## Licence
69
69
 
70
- 1. Clone the repository:
71
-
72
- ```shell
73
- git clone https://github.com/defencedigital/moduk-frontend
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.4.1",
3
+ "version": "1.0.0",
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",