From e62738403184c06f82da0ec0ab8a99d0f0c6286f Mon Sep 17 00:00:00 2001 From: Mat Carey Date: Thu, 20 Dec 2018 14:53:06 +0000 Subject: [PATCH] Added config file for prototype kit, fixed bug in package test. --- package/govuk-prototype-kit.config.json | 18 ++++++++++++++++++ .../gulp/__tests__/after-build-package.test.js | 5 ++--- tasks/gulp/clean.js | 1 + 3 files changed, 21 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..ff30bdbb1f --- /dev/null +++ b/package/govuk-prototype-kit.config.json @@ -0,0 +1,18 @@ +{ + "nunjucksPaths": [ + "/", + "/components" + ], + "scripts": [ + "/all.js" + ], + "assets": [ + { + "global": true, + "src": "/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..e0c31a16be 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 {