From 43f3c408fa88c1ff30e19c8b46747d4e5984248c Mon Sep 17 00:00:00 2001 From: Mat Carey Date: Thu, 7 Feb 2019 19:18:38 +0000 Subject: [PATCH] Added config file for integration points with govuk-prototype-kit. To accompany the extensions proposal this config allows govuk-frontend to be an extension in the prototype kit. Implementation details can be found here https://github.com/alphagov/govuk-prototype-kit/pull/613 Proposal details can be found here https://github.com/alphagov/govuk-design-system-architecture/pull/9 --- package/govuk-prototype-kit.config.json | 15 +++++++++++++++ tasks/gulp/__tests__/after-build-package.test.js | 5 ++--- tasks/gulp/clean.js | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 package/govuk-prototype-kit.config.json diff --git a/package/govuk-prototype-kit.config.json b/package/govuk-prototype-kit.config.json new file mode 100644 index 0000000000..c530f3a0d5 --- /dev/null +++ b/package/govuk-prototype-kit.config.json @@ -0,0 +1,15 @@ +{ + "nunjucksPaths": [ + "/", + "/components" + ], + "scripts": [ + "/all.js" + ], + "assets": [ + "/assets" + ], + "sass": [ + "/all.scss" + ] +} diff --git a/tasks/gulp/__tests__/after-build-package.test.js b/tasks/gulp/__tests__/after-build-package.test.js index cbdd3cb29b..c5b97c0c95 100644 --- a/tasks/gulp/__tests__/after-build-package.test.js +++ b/tasks/gulp/__tests__/after-build-package.test.js @@ -44,6 +44,7 @@ describe('package/', () => { const additionalFilesNotInSrc = [ 'package.json', + 'govuk-prototype-kit.config.json', '**/macro-options.json' ] @@ -51,9 +52,7 @@ describe('package/', () => { files => { let filesNotInSrc = files // Use glob to generate an array of files that accounts for wildcards in filenames - filesNotInSrc = glob.sync('{' + additionalFilesNotInSrc.join(',') + '}') - // Remove /package prefix from filenames - .map(file => file.replace(/^package\//, '')) + filesNotInSrc = glob.sync('{' + additionalFilesNotInSrc.join(',') + '}', { cwd: 'package' }) return files // Remove /src prefix from filenames diff --git a/tasks/gulp/clean.js b/tasks/gulp/clean.js index b7fd3743ff..82b8994e1c 100644 --- a/tasks/gulp/clean.js +++ b/tasks/gulp/clean.js @@ -17,6 +17,7 @@ gulp.task('clean', () => { `${destination}/**`, `!${destination}`, `!${destination}/package.json`, + `!${destination}/govuk-prototype-kit.config.json`, `!${destination}/README.md` ]) } else {