@companieshouse/ch-node-utils 2.0.0 → 2.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companieshouse/ch-node-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"author": "companieshouse",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
"@types/ioredis": "4.28.10",
|
|
42
42
|
"@types/jest": "^29.5.14",
|
|
43
43
|
"@types/node": "^20.11.28",
|
|
44
|
+
"govuk-frontend-4-10-0": "npm:govuk-frontend@^4.10.0",
|
|
45
|
+
"govuk-frontend-5-10-2": "npm:govuk-frontend@^5.10.2",
|
|
44
46
|
"jest": "^29.7.0",
|
|
45
47
|
"jest-environment-jsdom": "^29.7.0",
|
|
46
48
|
"nunjucks": "^3.2.4",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"typescript": "^5.4.2"
|
|
49
51
|
},
|
|
50
52
|
"peerDependencies": {
|
|
51
|
-
"govuk-frontend": "5.
|
|
53
|
+
"govuk-frontend": "^4.10.0, ^5.10.0"
|
|
52
54
|
},
|
|
53
55
|
"bugs": {
|
|
54
56
|
"url": "https://github.com/companieshouse/ch-node-utils/issues"
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
{# Extends the GOV.UK Design System page template https://design-system.service.gov.uk/styles/page-template #}
|
|
2
2
|
{% extends "govuk/template.njk" %}
|
|
3
3
|
|
|
4
|
-
{
|
|
4
|
+
{% set _cdnImageRootPath = cdnHost + "/images/govuk-frontend/v" + govukFrontendVersion %}
|
|
5
|
+
{% if govukRebrand %}
|
|
6
|
+
{% set _cdnImageRootPath = _cdnImageRootPath + "/rebrand" %}
|
|
7
|
+
{% endif %}
|
|
8
|
+
|
|
9
|
+
{# GOV.UK Frontend Page Template option for Open Graph https://design-system.service.gov.uk/styles/page-template/#options #}
|
|
10
|
+
{% set opengraphImageUrl = _cdnImageRootPath + "/govuk-opengraph-image.png" %}
|
|
11
|
+
|
|
12
|
+
{# Based on https://github.com/alphagov/govuk-frontend/blob/v5.10.2/packages/govuk-frontend/src/govuk/template.njk#L21-L24 #}
|
|
5
13
|
{% block headIcons %}
|
|
6
|
-
<link rel="icon" sizes="48x48" href="{{
|
|
7
|
-
<link rel="icon" sizes="any" href="{{
|
|
8
|
-
<link rel="mask-icon" href="{{
|
|
9
|
-
<link rel="apple-touch-icon" href="{{
|
|
14
|
+
<link rel="icon" sizes="48x48" href="{{ _cdnImageRootPath }}/favicon.ico">
|
|
15
|
+
<link rel="icon" sizes="any" href="{{ _cdnImageRootPath }}/favicon.svg" type="image/svg+xml">
|
|
16
|
+
<link rel="mask-icon" href="{{ _cdnImageRootPath }}/govuk-icon-mask.svg" color="{{ themeColor }}">
|
|
17
|
+
<link rel="apple-touch-icon" href="{{ _cdnImageRootPath }}/govuk-icon-180.png">
|
|
10
18
|
{% endblock %}
|
|
11
19
|
|
|
12
20
|
{% block head %}
|
|
@@ -15,8 +23,14 @@
|
|
|
15
23
|
|
|
16
24
|
{% block bodyEnd %}
|
|
17
25
|
{# Run JavaScript at end of the <body>, to avoid blocking the initial render. #}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
{# Starting in GOV.UK Frontend version 5, JavaScript is only loaded in modern browsers using ES6 Module imports. #}
|
|
27
|
+
{% if govukFrontendVersion | first >= "5" %}
|
|
28
|
+
<script type="module">
|
|
29
|
+
import { initAll } from '{{ cdnHost }}/javascripts/govuk-frontend/v{{ govukFrontendVersion }}/govuk-frontend-{{ govukFrontendVersion }}.min.js'
|
|
30
|
+
initAll()
|
|
31
|
+
</script>
|
|
32
|
+
{% else %}
|
|
33
|
+
<script src="{{ cdnHost }}/javascripts/govuk-frontend/v{{ govukFrontendVersion }}/govuk-frontend-{{ govukFrontendVersion }}.min.js"></script>
|
|
34
|
+
<script>window.GOVUKFrontend.initAll()</script>
|
|
35
|
+
{% endif %}
|
|
22
36
|
{% endblock %}
|