@ukhomeoffice/formio-gds-template 1.0.13-alpha → 2.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/build-and-test.yml +22 -0
- package/.github/workflows/publish-to-npm.yml +1 -1
- package/README.md +28 -3
- package/dist/gds.js +2 -298
- package/dist/gds.js.LICENSE.txt +41 -0
- package/lib/components/datamap/GDSDataMap.js +3 -1
- package/lib/components/datetime/GDSDatetimeComponent.js +21 -15
- package/lib/components/selectboxes/GDSCheckBoxes.js +3 -1
- package/lib/components/time/GDSTimeComponent.js +13 -9
- package/lib/templates/gds/iconClass.js +1 -1
- package/lib/templates/gds/template.css +95 -28
- package/lib/templates/gds/template.css.map +1 -0
- package/package.json +30 -30
- package/src/components/datetime/GDSDatetimeComponent.ts +2 -1
- package/src/templates/gds/template.scss +4 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Build and test
|
|
2
|
+
|
|
3
|
+
on: [pull_request, workflow_dispatch]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build_and_test:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v2
|
|
10
|
+
- uses: actions/setup-node@v2
|
|
11
|
+
with:
|
|
12
|
+
node-version: 14
|
|
13
|
+
- name: Install dependencies
|
|
14
|
+
run: |
|
|
15
|
+
rm -rf node_modules
|
|
16
|
+
npm ci
|
|
17
|
+
- name: Lint and test
|
|
18
|
+
run: |
|
|
19
|
+
npm run lint
|
|
20
|
+
npm run test
|
|
21
|
+
- name: Build package
|
|
22
|
+
run: npm run build
|
package/README.md
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
# GDS Design System Templates for Formio
|
|
2
2
|
|
|
3
|
-
This project provides the templates required to implement the GDS Design System for Formio form renderer.
|
|
4
|
-
|
|
3
|
+
This project provides the templates required to implement the GDS Design System for Formio form renderer.
|
|
5
4
|
|
|
6
5
|
## Set up and configuration
|
|
7
6
|
|
|
8
7
|
### Prerequisites
|
|
9
8
|
|
|
9
|
+
NodeJS version 14
|
|
10
10
|
|
|
11
11
|
### Installation
|
|
12
|
+
|
|
12
13
|
```bash
|
|
13
14
|
npm install @ukhomeoffice/formio-gds-template
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
Using vanilla formio
|
|
20
|
+
|
|
20
21
|
```javascript
|
|
21
22
|
import gds from '@ukhomeoffice/formio-gds-template';
|
|
22
23
|
import {Formio} from 'formiojs';
|
|
@@ -32,3 +33,27 @@ import {Formio} from "react-formio";
|
|
|
32
33
|
|
|
33
34
|
Formio.use(gds);
|
|
34
35
|
```
|
|
36
|
+
|
|
37
|
+
## How to publish to NPM registry
|
|
38
|
+
|
|
39
|
+
Publishing to the NPM registry is done through GitHub actions. This is triggered by creating a release through GitHub as documented in the steps below.
|
|
40
|
+
|
|
41
|
+
As a prerequisite, push a feature branch or merge into the `main` branch (providing the change has been tested). Ensure the `version` in `package.json` has been incremented accordingly. To follow best practices, use the semantic versioning system: <https://semver.org/>
|
|
42
|
+
> [!NOTE]
|
|
43
|
+
> Changes which are pre-releases i.e. changes in feature branches which are not ready to be released as general availability, should be [marked as a pre-release](https://semver.org/#spec-item-9) e.g. `1.2.3-alpha`
|
|
44
|
+
|
|
45
|
+
1. Create a release through GitHub by going to <https://github.com/UKHomeOffice/formio-gds-template/releases/new>
|
|
46
|
+
2. Create a new tag version to match the version in `package.json` prefixing with a `v` e.g. `v1.2.3-alpha`
|
|
47
|
+
3. Title the release with the same tag version as created in the previous step
|
|
48
|
+
4. Choose the appropriate branch, be it a feature branch or the primary branch as the target
|
|
49
|
+
5. For simplicity, select the `Generate release notes` button or for more granularity, populate the release note as relevant
|
|
50
|
+
6. Optionally, mark the release as a pre-release if publishing from a feature branch
|
|
51
|
+
7. Click `publish release`. This will trigger a GitHub action workflow run
|
|
52
|
+
8. Wait for the GitHub action to finish
|
|
53
|
+
|
|
54
|
+
> [!TIP]
|
|
55
|
+
> Optionally, verify the new version has been published by heading over to <https://www.npmjs.com/package/@ukhomeoffice/formio-gds-template> to check the new version is present (you may need to reload your browser cache when visiting <https://www.npmjs.com>). Alternatively, verify it exists through the CLI by running `npm view @ukhomeoffice/formio-gds-template versions` locally and checking to see if the new version exists
|
|
56
|
+
|
|
57
|
+
### Notes
|
|
58
|
+
|
|
59
|
+
For additional information on GitHub releases, [see the GitHub Documentation](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository?tool=webui#creating-a-release)
|