Skip to content

Commit

Permalink
Temporarily override GOV.UK Frontend install
Browse files Browse the repository at this point in the history
I’ve also had to temporarily adjust `npmInstall()` to install the `govuk-frontend@5.0.0-testing` preview

Otherwise `govuk-frontend@4.7.0` is installed into created prototypes via the registry, despite not having this version locally
  • Loading branch information
colinrotherham committed Sep 4, 2023
1 parent 94b0698 commit e5d6c76
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ const packageJsonFormat = { encoding: 'utf8', spaces: 2 }

async function npmInstall (cwd, dependencies) {
dependencies.push('--save-exact')

// Temporarily override to GOV.UK Frontend v5 preview (via GitHub)
const dependenciesMapped = dependencies
.map((packageName) => packageName === 'govuk-frontend'
? 'alphagov/govuk-frontend#6d1a4ef0a'
: packageName)

return spawn(
'npm', [
'install',
...dependencies
...dependenciesMapped
], {
cwd,
stderr: 'inherit'
})
.catch(e => {
console.error('Failed to install dependencies: ', dependencies.join(', '))
console.error('Failed to install dependencies: ', dependenciesMapped.join(', '))
console.error(e)
process.exit(0)
})
Expand Down

0 comments on commit e5d6c76

Please sign in to comment.