Skip to content

Commit c8fb8df

Browse files
Update paths
1 parent 44a54a1 commit c8fb8df

File tree

27 files changed

+201
-159
lines changed

27 files changed

+201
-159
lines changed

.github/workflows/actions/build/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ runs:
3737
uses: actions/cache/restore@v4
3838
id: cache-build
3939
with:
40-
path: dist/
4140
key: build-${{ inputs.ref || github.sha }}
41+
path: |
42+
dist
43+
packages/*/dist
4244
4345
- name: Install dependencies only
4446
if: ${{ steps.cache-build.outputs.cache-hit == 'true' }}
@@ -56,8 +58,10 @@ runs:
5658
if: ${{ steps.cache-build.outputs.cache-hit != 'true' }}
5759
uses: actions/cache/save@v4
5860
with:
59-
path: dist/
6061
key: build-${{ inputs.ref || github.sha }}
62+
path: |
63+
dist
64+
packages/*/dist
6165
6266
- name: Restore branch or SHA
6367
if: ${{ !cancelled() && inputs.ref }}

.github/workflows/actions/diff/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
- name: Commit base build for comparison
2424
shell: bash
2525
run: |
26-
git add --force dist/
26+
git add --force packages/nhsuk-frontend-review/dist
2727
git commit --allow-empty -m "Build output for '${{ github.base_ref }}'" --no-verify
2828
2929
- name: Install and build head
@@ -32,14 +32,14 @@ runs:
3232
- name: Commit head build for comparison
3333
shell: bash
3434
run: |
35-
git add --force dist/
35+
git add --force packages/nhsuk-frontend-review/dist
3636
git commit --allow-empty -m "Build output for '${{ github.head_ref }}'" --no-verify
3737
3838
- name: Check for changes
3939
id: diff
4040
shell: bash
4141
run: |
4242
set +e
43-
git diff HEAD^ --exit-code --quiet -- 'dist/**/*'
43+
git diff HEAD^ --exit-code --quiet -- 'packages/nhsuk-frontend-review/dist/**/*'
4444
[ $? -eq 0 ] && echo "changes=false" >> "${GITHUB_OUTPUT}"
4545
exit 0

.github/workflows/pull-request.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ jobs:
5757
- name: Restore build (from cache)
5858
uses: actions/cache/restore@v4
5959
with:
60-
path: dist/
6160
key: build-${{ github.sha }}
61+
path: |
62+
dist
63+
packages/*/dist
6264
6365
- name: Setup Node
6466
uses: actions/setup-node@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
uses: JamesIves/github-pages-deploy-action@v4
6666
with:
6767
token: ${{ secrets.GITHUB_TOKEN }}
68-
folder: ./dist/app
68+
folder: ./packages/nhsuk-frontend-review/dist
6969
clean: true
7070

7171
- name: Publish NPM package

.github/workflows/sass.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ jobs:
4141
- name: Check compilation
4242
run: |
4343
mkdir -p .tmp
44-
time sass packages/nhsuk.scss > .tmp/check.css
44+
time sass packages/nhsuk-frontend/src/nhsuk.scss > .tmp/check.css
4545
4646
- name: Check load paths
4747
run: |
4848
mkdir -p .tmp
49-
time sh -c 'echo "@import "\""nhsuk"\"";" | sass --stdin --load-path packages > .tmp/check1.css'
50-
time sh -c 'echo "@forward "\""nhsuk"\"";" | sass --stdin --load-path packages > .tmp/check2.css'
51-
time sh -c 'echo "@use "\""nhsuk"\"" as *;" | sass --stdin --load-path packages > .tmp/check3.css'
49+
time sh -c 'echo "@import "\""nhsuk"\"";" | sass --stdin --load-path packages/nhsuk-frontend/src > .tmp/check1.css'
50+
time sh -c 'echo "@forward "\""nhsuk"\"";" | sass --stdin --load-path packages/nhsuk-frontend/src > .tmp/check2.css'
51+
time sh -c 'echo "@use "\""nhsuk"\"" as *;" | sass --stdin --load-path packages/nhsuk-frontend/src > .tmp/check3.css'
5252
5353
# Check output for uncompiled Sass
5454
- name: Check output

docs/contributing/application-architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Application architecture
22

3-
The application generates static HTML pages to preview components, with each component having their own page, these files can be found in `app/`. To make changes to components, you will have to edit the individual components files within `packages/nhsuk-frontend/`. These are usually the only 2 folders that you will need.
3+
The application generates static HTML pages to preview components, with each component having their own page, these files can be found in `packages/nhsuk-frontend-review/`. To make changes to components, you will have to edit the individual components files within `packages/nhsuk-frontend/`. These are usually the only 2 folders that you will need.
44

55
---
66

gulpfile.mjs

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import { join } from 'path'
2+
13
import browserSync from 'browser-sync'
24
import gulp from 'gulp'
35

6+
import * as config from './shared/config/index.mjs'
47
import {
58
buildHTML,
69
validateHTML,
@@ -24,11 +27,14 @@ import { compileCSS, minifyCSS } from './shared/tasks/styles.mjs'
2427
*/
2528

2629
gulp.task('clean', async () => {
27-
return clean(['dist/**/*'])
30+
return clean([join(config.paths.root, 'dist/**/*')])
2831
})
2932

3033
gulp.task('clean:zip', async () => {
31-
return clean(['dist/{assets,css,js}', 'dist/*.zip'])
34+
return clean([
35+
join(config.paths.root, 'dist/{assets,css,js}'),
36+
join(config.paths.root, 'dist/*.zip')
37+
])
3238
})
3339

3440
gulp.task('style', gulp.series([compileCSS, minifyCSS]))
@@ -47,8 +53,11 @@ gulp.task(
4753

4854
gulp.task('watch', () =>
4955
Promise.all([
50-
gulp.watch(['packages/**/*.scss'], gulp.series(['style'])),
51-
gulp.watch(['packages/**/*.js'], gulp.series(['script']))
56+
gulp.watch(
57+
[join(config.paths.pkg, 'src/**/*.scss')],
58+
gulp.series(['style'])
59+
),
60+
gulp.watch([join(config.paths.pkg, 'src/**/*.js')], gulp.series(['script']))
5261
])
5362
)
5463

@@ -63,11 +72,19 @@ gulp.task(
6372

6473
gulp.task('docs:watch', () =>
6574
Promise.all([
66-
gulp.watch(['**/*.njk'], buildHTML),
67-
gulp.watch(['dist/**/*.html']).on('change', browserSync.reload),
68-
gulp.watch(['dist/*.min.{css,css.map}'], copyCSS),
69-
gulp.watch(['dist/*.min.{js,js.map}'], copyJS),
70-
gulp.watch(['packages/assets/**/*'], copyBinaryAssets)
75+
gulp.watch(
76+
[
77+
join(config.paths.app, 'src/**/*.njk'),
78+
join(config.paths.pkg, 'src/**/*.njk')
79+
],
80+
buildHTML
81+
),
82+
gulp
83+
.watch([join(config.paths.root, 'dist/**/*.html')])
84+
.on('change', browserSync.reload),
85+
gulp.watch([join(config.paths.root, 'dist/*.min.{css,css.map}')], copyCSS),
86+
gulp.watch([join(config.paths.root, 'dist/*.min.{js,js.map}')], copyJS),
87+
gulp.watch([join(config.paths.pkg, 'src/assets/**/*')], copyBinaryAssets)
7188
])
7289
)
7390

packages/nhsuk-frontend/src/components/character-count/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,22 +146,22 @@ Find out more about the character component and when to use it in the [NHS digit
146146

147147
The character count Nunjucks macro takes the following arguments:
148148

149-
| Name | Type | Required | Description |
150-
| ------------------------ | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
151-
| **id** | string | Yes | The id of the textarea. |
152-
| **describedBy** | string | No | Text or element id to add to the `aria-describedby` attribute to provide description for screenreader users. |
153-
| **name** | string | Yes | The name of the textarea, which is submitted with the form data. |
154-
| **rows** | string | No | Optional number of textarea rows (default is 5 rows). |
155-
| **value** | string | No | Optional initial value of the textarea. |
156-
| **label** | object | Yes | Arguments for the label component. See [label](https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/label) component. |
157-
| **hint** | object | No | Arguments for the hint component (e.g. text). See [hint](https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/hint) component. |
158-
| **errorMessage** | object | No | Arguments for the error message component (e.g. text). See [error message](https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/error-message) component. |
159-
| **classes** | string | No | Optional additional classes to add to the textarea tag. Separate each class with a space. |
160-
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the textarea tag. |
161-
| **maxlength** | string | No. | If maxwords is set, this is not required. The maximum number of characters. If maxwords is provided, the maxlength argument will be ignored. |
162-
| **maxwords** | string | No. | If maxlength is set, this is not required. The maximum number of words. If maxwords is provided, the maxlength argument will be ignored. |
163-
| **threshold** | string | No | The percentage value of the limit at which point the count message is displayed. If this attribute is set, the count message will be hidden by default. |
164-
| **countMessage.classes** | string | No | Classes to add to the count message. |
149+
| Name | Type | Required | Description |
150+
| ------------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
151+
| **id** | string | Yes | The id of the textarea. |
152+
| **describedBy** | string | No | Text or element id to add to the `aria-describedby` attribute to provide description for screenreader users. |
153+
| **name** | string | Yes | The name of the textarea, which is submitted with the form data. |
154+
| **rows** | string | No | Optional number of textarea rows (default is 5 rows). |
155+
| **value** | string | No | Optional initial value of the textarea. |
156+
| **label** | object | Yes | Arguments for the label component. See [label](/packages/nhsuk-frontend/src/components/label) component. |
157+
| **hint** | object | No | Arguments for the hint component (e.g. text). See [hint](/packages/nhsuk-frontend/src/components/hint) component. |
158+
| **errorMessage** | object | No | Arguments for the error message component (e.g. text). See [error message](/packages/nhsuk-frontend/src/components/error-message) component. |
159+
| **classes** | string | No | Optional additional classes to add to the textarea tag. Separate each class with a space. |
160+
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the textarea tag. |
161+
| **maxlength** | string | No. | If maxwords is set, this is not required. The maximum number of characters. If maxwords is provided, the maxlength argument will be ignored. |
162+
| **maxwords** | string | No. | If maxlength is set, this is not required. The maximum number of words. If maxwords is provided, the maxlength argument will be ignored. |
163+
| **threshold** | string | No | The percentage value of the limit at which point the count message is displayed. If this attribute is set, the count message will be hidden by default. |
164+
| **countMessage.classes** | string | No | Classes to add to the count message. |
165165

166166
If you are using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting). Read more about this in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).
167167

0 commit comments

Comments
 (0)