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 `[email protected]` preview

Otherwise `[email protected]` is installed into created prototypes via the registry, despite not having this version locally
  • Loading branch information
colinrotherham committed Sep 1, 2023
1 parent dd6194b commit 4e782dc
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 4e782dc

Please sign in to comment.