From 4e782dce03a785258c5a9681d50656b9b7728cf3 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Tue, 22 Aug 2023 19:39:02 +0100 Subject: [PATCH] Temporarily override GOV.UK Frontend install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- bin/utils/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/utils/index.js b/bin/utils/index.js index f501030e01..2503a71380 100644 --- a/bin/utils/index.js +++ b/bin/utils/index.js @@ -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) })