alphagov / govuk-prototype-kit

Rapidly create HTML prototypes of GOV.UK services
https://prototype-kit.service.gov.uk
MIT License
302 stars 236 forks source link

Locate GOV.UK Frontend using `require.resolve()` #2306

Closed colinrotherham closed 12 months ago

colinrotherham commented 1 year ago

This PR ensures we locate all previously hard-coded GOV.UK Frontend paths

This is in preparation for path changes between v4 (current) and v5 (upcoming) releases:

GOV.UK Frontend v4

  1. Base path: node_modules/govuk-frontend
  2. Entry path: node_modules/govuk-frontend/govuk/all.js
  3. Include path: node_modules/govuk-frontend/govuk

GOV.UK Frontend v5

  1. Base path: node_modules/govuk-frontend
  2. Entry path: node_modules/govuk-frontend/dist/govuk/all.bundle.js
  3. Include path: node_modules/govuk-frontend/dist/govuk

Partially closes https://github.com/alphagov/govuk-prototype-kit/issues/2293 and resolves https://github.com/alphagov/govuk-frontend/issues/3759

colinrotherham commented 1 year ago

I've moved the GOV.UK Frontend v5 preview commits to another branch

Installing the preview from GitHub via npm install was causing test issues:

npm install --save "alphagov/govuk-frontend#6d1a4ef0a"

Not sure if a few sleep() or cy.wait() commands were expecting it to take so long?

Test output is looking a lot better now with some new changes pushed

colinrotherham commented 1 year ago

Pushed again with the GOV.UK Frontend v5 preview

nataliecarey commented 12 months ago

Looks good to me, just needs a changelog entry.