Skip to content

Commit

Permalink
Added config file for prototype kit, fixed bug in package test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mat Carey committed Dec 20, 2018
1 parent fe36aa3 commit e627384
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions package/govuk-prototype-kit.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"nunjucksPaths": [
"/",
"/components"
],
"scripts": [
"/all.js"
],
"assets": [
{
"global": true,
"src": "/assets"
}
],
"sass": [
"/all.scss"
]
}
5 changes: 2 additions & 3 deletions tasks/gulp/__tests__/after-build-package.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,15 @@ describe('package/', () => {

const additionalFilesNotInSrc = [
'package.json',
'govuk-prototype-kit.config.json',
'**/macro-options.json'
]

return recursive(configPaths.src, filesToIgnore).then(
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
Expand Down
1 change: 1 addition & 0 deletions tasks/gulp/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ gulp.task('clean', () => {
`${destination}/**`,
`!${destination}`,
`!${destination}/package.json`,
`!${destination}/govuk-prototype-kit.config.json`,
`!${destination}/README.md`
])
} else {
Expand Down

0 comments on commit e627384

Please sign in to comment.