-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDT-644 design pattern library #822
Conversation
This PR relies on an update to the component-library-template. I'll add the link here when it's open. |
badbb76
to
5b46cd3
Compare
Here's the PR for the template hmrc/component-library-template#37 |
5b46cd3
to
5cbd64b
Compare
@@ -1,7 +1,7 @@ | |||
var test = require('tape') | |||
var prepareAssetPaths = require('../util/component-library/prepareAssetPaths') | |||
|
|||
test('prepareAssetPaths - Creates links from an array of css paths', function (t) { | |||
test.skip('prepareAssetPaths - Creates links from an array of css paths', function (t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these skipped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. prepareAssetPaths
doesn't exist anymore so we can scrap these tests altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does exist, my bad. It's part of the component library, not the design pattern library
var mkdirp = require('mkdirp') | ||
|
||
var writeFiles = function (config, files) { | ||
if (!config.dest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check whether config is defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Good point
throw new Error('Handlebars helpers directory must be a string or an array.') | ||
} | ||
|
||
if (typeof helpersDirectoryPaths === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the isString
variable
}) | ||
}) | ||
}) | ||
.then((stuff) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the variable name :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha. Good point 😄
gulpfile.js/tasks/pattern-library.js
Outdated
|
||
// gulp.task('pattern-library', ['clean-pattern-library', 'sass', 'images', 'browserify'], function () { | ||
gulp.task('pattern-library', ['clean-pattern-library'], function () { | ||
var env = global.runmode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is runmode
always defined?
) | ||
}) | ||
|
||
compileTemplate(existingTemplate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was to make sure that we're returning the result of Handlebars.compile
without coupling the test to Handlebars
, but maybe we should just mock the dependency instead.
var path = require('path') | ||
|
||
var addFileType = function (config, files) { | ||
if (!Array.isArray(config.src)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have config
at this point for sure? if so should we rely on a previous step to verify?
a8d65da
to
28a4760
Compare
Also disable the tests.
28a4760
to
f8d7495
Compare
…rary generated from commit fe5de19
This PR builds a Design Systerm (based on the GOV.UK Design System) from our components and patterns.
Problem
Our component library isn't aligned with GOV.UK and has a lot of cruft in there that should be deprecated.
Example Screenshot
Solution
Generate a new Design System that only consists of the components and patterns that adhere to the new directory structure.
Example Screenshot