-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Prototype Kit has a hardcoded reference to the assets folder which has moved in v5 #3759
Comments
There's a suggested approach from @nataliecarey where the Prototype Kit adds support for a new top-level "constants": [
{
"name": "govukAssetPath",
"value": "/plugin-assets/govuk-frontend/dist/govuk/assets"
}
] There's a branch of the Prototype Kit with the proposed changes we can use for testing: mkdir kit-integration-demo
cd kit-integration-demo
npx govuk-prototype-kit create --version=alphagov/govuk-prototype-kit#frontend-v5-compatibility
npm install alphagov/govuk-frontend#pre-release-delete-package-dist # or npm link We'll need the Prototype team to confirm they're happy with this approach and update the kit before we merge any changes on our side. She has also flagged that in her testing the font CSS path was wrong, which can be fixed by adding |
Linking this alternative idea for For ES modules we also have |
@colinrotherham Sorry, I stepped a bit on this piece of work. To facilitate discussions for the Prototype Kit team, I quickly spiked the approach described by Ollie in spike-prototype-kit-constant to check that it did indeed solve the 404 when used with @nataliecarey's branch, which it does 🥳. It's just a spike branch, with preview-spike-prototype-kit-constant so very throwaway, just to validate things work. |
Also a few thoughts from that quick spike:
|
Thanks @romaricpascal, no that's great Here's the part I've been working on, running the Prototype Kit with our local GOV.UK Frontend: |
I've been working on path changes in this PR: @romaricpascal Your comments regarding E.g. Prototype management pages use GOV.UK Frontend pathsThe following paths are used currently in various places:
|
PR ready for review Some tests are failing because scripts aren't waiting for the GitHub preview to finish installing |
Happy to say this is now closed in alphagov/govuk-prototype-kit#2306 The Prototype Kit supports Instead we simply join const { dirname, join } = require('path')
// `govuk-frontend@4` /path/to/project/node_modules/govuk-frontend/govuk/assets
// `govuk-frontend@5` /path/to/project/node_modules/govuk-frontend/dist/govuk/assets
const assetsPath = join(dirname(require.resolve('govuk-frontend')), 'assets') |
What
The changes to our repo structure in #3498 mean that the structure of the published package will change in v5. Most files have moved inside a top-level
dist
folder. For example, the favicon has moved fromgovuk/assets/images/favicon.ico
todist/govuk/assets/images/favicon.ico
.However, the govuk-branded layout in the Prototype Kit includes a hardcoded
assetPath
that references the old assets location.Work with the prototype team to support passing the asset path as part of the Prototype Kit config file.
Why
We need a way for the Prototype Kit to know where to find the assets in v5, whilst still allowing it to work with older releases of GOV.UK Frontend.
Who needs to work on this
Developers, Developers from the Prototype team
Who needs to review this
Developers, Developers from the Prototype team
Done when
The text was updated successfully, but these errors were encountered: