diff --git a/.github/workflows/actions/build/action.yml b/.github/workflows/actions/build/action.yml index 622eaa777e..9dbdd30d7c 100644 --- a/.github/workflows/actions/build/action.yml +++ b/.github/workflows/actions/build/action.yml @@ -11,7 +11,9 @@ runs: with: # Restore build cache (unless commit SHA changes) key: build-cache-${{ runner.os }}-${{ github.sha }} - path: app/dist + path: | + app/dist + package/dist - name: Install dependencies uses: ./.github/workflows/actions/install-node @@ -26,4 +28,6 @@ runs: if: steps.build-cache.outputs.cache-hit != 'true' shell: bash - run: npm run build:app + run: | + npm run build:package + npm run build:app diff --git a/app/nodemon.json b/app/nodemon.json index 897d4f4059..64f22679e9 100644 --- a/app/nodemon.json +++ b/app/nodemon.json @@ -1,6 +1,6 @@ { "watch": ["./src", "../package/src/govuk/**/*.{json,yaml}"], - "ignore": ["**/*.test.*"], + "ignore": ["./src/javascripts/**", "**/*.test.*"], "ext": "mjs,json,yaml", "quiet": true } diff --git a/app/package.json b/app/package.json index ae5c2b5a21..ea26b1fc45 100644 --- a/app/package.json +++ b/app/package.json @@ -24,6 +24,7 @@ "govuk_frontend_toolkit": "^9.0.1", "govuk_template_jinja": "^0.26.0", "govuk-elements-sass": "3.1.3", + "govuk-frontend": "*", "gulp": "^4.0.2", "gulp-cli": "^2.3.0", "highlight.js": "^11.7.0", diff --git a/app/src/javascripts/main.mjs b/app/src/javascripts/main.mjs new file mode 100644 index 0000000000..07a39e7ac0 --- /dev/null +++ b/app/src/javascripts/main.mjs @@ -0,0 +1,6 @@ +import * as GOVUKFrontend from 'govuk-frontend' + +// Manually window global for tests +window.GOVUKFrontend = GOVUKFrontend + +GOVUKFrontend.initAll() diff --git a/app/src/stylesheets/app-ie8.scss b/app/src/stylesheets/app-ie8.scss index b58b049a27..cd0449d64c 100644 --- a/app/src/stylesheets/app-ie8.scss +++ b/app/src/stylesheets/app-ie8.scss @@ -1,3 +1,3 @@ -@import "../../../package/src/govuk/all-ie8"; +@import "govuk/all-ie8"; @import "partials/app"; @import "partials/banner"; diff --git a/app/src/stylesheets/app.scss b/app/src/stylesheets/app.scss index 1203c6b050..e8c8d4222e 100644 --- a/app/src/stylesheets/app.scss +++ b/app/src/stylesheets/app.scss @@ -1,7 +1,7 @@ $govuk-show-breakpoints: true; $govuk-new-link-styles: true; -@import "../../../package/src/govuk/all"; +@import "govuk/all"; @import "partials/app"; @import "partials/code"; @import "partials/banner"; diff --git a/app/src/stylesheets/full-page-examples/campaign-page.scss b/app/src/stylesheets/full-page-examples/campaign-page.scss index 79c69cdaf1..9be877bba7 100644 --- a/app/src/stylesheets/full-page-examples/campaign-page.scss +++ b/app/src/stylesheets/full-page-examples/campaign-page.scss @@ -1,6 +1,6 @@ -@import "../../../../package/src/govuk/base"; +@import "govuk/base"; $govuk-new-link-styles: true; -@import "../../../../package/src/govuk/core/all"; +@import "govuk/core/all"; .app-header--campaign { padding-bottom: govuk-spacing(2); diff --git a/app/src/stylesheets/full-page-examples/search.scss b/app/src/stylesheets/full-page-examples/search.scss index 8758f018b2..e5d4f03944 100644 --- a/app/src/stylesheets/full-page-examples/search.scss +++ b/app/src/stylesheets/full-page-examples/search.scss @@ -1,6 +1,6 @@ -@import "../../../../package/src/govuk/base"; +@import "govuk/base"; $govuk-new-link-styles: true; -@import "../../../../package/src/govuk/core/all"; +@import "govuk/core/all"; .app-document-list > li { padding-top: govuk-spacing(4); diff --git a/app/src/views/layouts/_generic.njk b/app/src/views/layouts/_generic.njk index 8966d9b324..168f279321 100644 --- a/app/src/views/layouts/_generic.njk +++ b/app/src/views/layouts/_generic.njk @@ -42,6 +42,5 @@ {% include "partials/legacyJavaScript.njk" %} {% endif %} - - + {% endblock %} diff --git a/app/src/views/layouts/legacy.njk b/app/src/views/layouts/legacy.njk index d458a8ba97..5c571ec75e 100644 --- a/app/src/views/layouts/legacy.njk +++ b/app/src/views/layouts/legacy.njk @@ -22,6 +22,5 @@ {% block body_end %} {% include "partials/legacyJavaScript.njk" %} - - + {% endblock %} diff --git a/app/src/views/tests/boilerplate.njk b/app/src/views/tests/boilerplate.njk index 7f94afb486..e0efe6f2cb 100644 --- a/app/src/views/tests/boilerplate.njk +++ b/app/src/views/tests/boilerplate.njk @@ -12,6 +12,6 @@ Used during testing to inject rendered components and test specific configurations
- +