@ukhomeoffice/formio-gds-template 1.0.13-alpha → 1.1.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.
@@ -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: 16
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
@@ -11,7 +11,7 @@ jobs:
11
11
  - uses: actions/checkout@v2
12
12
  - uses: actions/setup-node@v2
13
13
  with:
14
- node-version: 14
14
+ node-version: 16
15
15
  registry-url: 'https://registry.npmjs.org'
16
16
  - name: Install dependencies
17
17
  run: |
package/README.md CHANGED
@@ -1,22 +1,24 @@
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
 
10
-
11
9
  ### Installation
10
+
11
+ This library is compatible with Node 14-18.
12
+ For Node 17+, you may need to set the `NODE_OPTIONS` environment variable to include `--openssl-legacy-provider`
13
+
12
14
  ```bash
13
15
  npm install @ukhomeoffice/formio-gds-template
14
16
  ```
15
17
 
16
-
17
18
  ## Usage
18
19
 
19
20
  Using vanilla formio
21
+
20
22
  ```javascript
21
23
  import gds from '@ukhomeoffice/formio-gds-template';
22
24
  import {Formio} from 'formiojs';
@@ -32,3 +34,27 @@ import {Formio} from "react-formio";
32
34
 
33
35
  Formio.use(gds);
34
36
  ```
37
+
38
+ ## How to publish to NPM registry
39
+
40
+ 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.
41
+
42
+ 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/>
43
+ > [!NOTE]
44
+ > 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`
45
+
46
+ 1. Create a release through GitHub by going to <https://github.com/UKHomeOffice/formio-gds-template/releases/new>
47
+ 2. Create a new tag version to match the version in `package.json` prefixing with a `v` e.g. `v1.2.3-alpha`
48
+ 3. Title the release with the same tag version as created in the previous step
49
+ 4. Choose the appropriate branch, be it a feature branch or the primary branch as the target
50
+ 5. For simplicity, select the `Generate release notes` button or for more granularity, populate the release note as relevant
51
+ 6. Optionally, mark the release as a pre-release if publishing from a feature branch
52
+ 7. Click `publish release`. This will trigger a GitHub action workflow run
53
+ 8. Wait for the GitHub action to finish
54
+
55
+ > [!TIP]
56
+ > 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
57
+
58
+ ### Notes
59
+
60
+ 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)