From d9a487597c7dc90401143b79742c2c65f64e85c7 Mon Sep 17 00:00:00 2001 From: Evan Lovely Date: Tue, 20 Jun 2017 23:21:29 -0700 Subject: [PATCH 1/9] Fixing URL in Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 942921085..17af07b7c 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Please read the guidelines: https://github.com/pattern-lab/patternlab-node/blob/ The Pattern Lab Node team uses [our gitter.im channel, pattern-lab/node](https://gitter.im/pattern-lab/node) to keep in sync, share updates, and talk shop. Please stop by to say hello or as a first place to turn if stuck. Other channels in the Pattern Lab organization can be found on gitter too. -There is also a dedicated Pattern Lab channel on the [design system slack](designsystems.herokuapp.com) run by [@jina](https://twitter.com/jina). +There is also a dedicated Pattern Lab channel on the [design system slack](http://designsystems.herokuapp.com) run by [@jina](https://twitter.com/jina). Ask or answer Pattern Lab questions on Stack Overflow: http://stackoverflow.com/questions/tagged/patternlab.io From 77a8fb41ddb260e2636906722d2ce7c631e02197 Mon Sep 17 00:00:00 2001 From: Brian Muenzenmeyer Date: Fri, 7 Jul 2017 08:36:29 -0500 Subject: [PATCH 2/9] Create CODE_OF_CONDUCT.md closes #661 --- CODE_OF_CONDUCT.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..9f536bcc4 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at brian.muenzenmeyer@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ From cac28757a9bb5ed7ec3c385895d83831292743f2 Mon Sep 17 00:00:00 2001 From: Brian Muenzenmeyer Date: Fri, 7 Jul 2017 10:07:12 -0500 Subject: [PATCH 3/9] update readme with new supporter --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 942921085..0562b2d4f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ Pattern Lab Node wouldn't be what it is today without the support of the communi **:100: Thanks for support from the following:** * **[Brad Frost](http://bradfrost.com/)** -* Marcos Peebles +* [Marcos Peebles](https://twitter.com/marcospeebles) +* [Susan Simkins](https://twitter.com/susanmsimkins) ## Installation From e008fa025431d2a18f80885453a37eb396546261 Mon Sep 17 00:00:00 2001 From: Joachim Dagerot Date: Wed, 16 Aug 2017 20:35:15 +0200 Subject: [PATCH 4/9] Title is now read from the markdown file, overrides file name. Also adds the whole parsed markdown object to the pattern Title in md-files Front Matter is now working as the documentation claims. The whole parsed md-file is now stored in currentPattern.allMarkdown. All Front Matter keys, can be accessed in the patternSection.mustache with

{{ allMarkdown.preamble }}

--- core/lib/pattern_assembler.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/lib/pattern_assembler.js b/core/lib/pattern_assembler.js index dc76832a6..2448f632d 100644 --- a/core/lib/pattern_assembler.js +++ b/core/lib/pattern_assembler.js @@ -166,6 +166,11 @@ var pattern_assembler = function () { currentPattern.patternDescExists = true; currentPattern.patternDesc = markdownObject.markdown; + + //Add all markdown to the currentPattern, including frontmatter + currentPattern.allMarkdown = markdownObject; + + //consider looping through all keys eventually. would need to blacklist some properties and whitelist others if (markdownObject.state) { currentPattern.patternState = markdownObject.state; @@ -182,6 +187,9 @@ var pattern_assembler = function () { if (markdownObject.tags) { currentPattern.tags = markdownObject.tags; } + if (markdownObject.title) { + currentPattern.patternName = markdownObject.title; + } if (markdownObject.links) { currentPattern.links = markdownObject.links; } From cefce0d6f02292ec405c69b7e32f26b47de57502 Mon Sep 17 00:00:00 2001 From: Brian Muenzenmeyer Date: Fri, 1 Sep 2017 05:34:28 -0500 Subject: [PATCH 5/9] remove whitespace --- core/lib/pattern_assembler.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/lib/pattern_assembler.js b/core/lib/pattern_assembler.js index 2448f632d..45082fcf4 100644 --- a/core/lib/pattern_assembler.js +++ b/core/lib/pattern_assembler.js @@ -166,11 +166,9 @@ var pattern_assembler = function () { currentPattern.patternDescExists = true; currentPattern.patternDesc = markdownObject.markdown; - //Add all markdown to the currentPattern, including frontmatter currentPattern.allMarkdown = markdownObject; - //consider looping through all keys eventually. would need to blacklist some properties and whitelist others if (markdownObject.state) { currentPattern.patternState = markdownObject.state; From cebf84f9a995a46a77245c28bddd186ae42aa0b5 Mon Sep 17 00:00:00 2001 From: Brian Muenzenmeyer Date: Fri, 1 Sep 2017 05:34:59 -0500 Subject: [PATCH 6/9] assign extra markdown keys to extraOutput, the PL PHP mechanism (finally!) --- core/lib/patternlab.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/lib/patternlab.js b/core/lib/patternlab.js index 49641b820..d4134378b 100644 --- a/core/lib/patternlab.js +++ b/core/lib/patternlab.js @@ -388,6 +388,13 @@ var patternlab_engine = function (config) { // stringify this data for individual pattern rendering and use on the styleguide // see if patternData really needs these other duped values + + // construct our extraOutput dump + var extraOutput = Object.assign({}, pattern.extraOutput, pattern.allMarkdown); + delete(extraOutput.title); + delete(extraOutput.state); + delete(extraOutput.markdown); + pattern.patternData = JSON.stringify({ cssEnabled: false, patternLineageExists: pattern.patternLineageExists, @@ -410,7 +417,7 @@ var patternlab_engine = function (config) { patternPartial: pattern.patternPartial, patternState: pattern.patternState, patternEngineName: pattern.engine.engineName, - extraOutput: {} + extraOutput: extraOutput }); //set the pattern-specific footer by compiling the general-footer with data, and then adding it to the meta footer From 81f9eb6850b9737c679ee210161ece8ecdf0dba4 Mon Sep 17 00:00:00 2001 From: Brian Muenzenmeyer Date: Fri, 1 Sep 2017 05:35:14 -0500 Subject: [PATCH 7/9] test coverage for new keys --- test/files/_patterns/00-test/01-bar.md | 2 ++ test/pattern_assembler_tests.js | 36 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/test/files/_patterns/00-test/01-bar.md b/test/files/_patterns/00-test/01-bar.md index d4fd865a2..755aa5799 100644 --- a/test/files/_patterns/00-test/01-bar.md +++ b/test/files/_patterns/00-test/01-bar.md @@ -1,5 +1,7 @@ --- status: complete +title: An Atom Walks Into a Bar +joke: bad --- ## A Simple Bit of Markup diff --git a/test/pattern_assembler_tests.js b/test/pattern_assembler_tests.js index fa1cf92d2..bb92d1d91 100644 --- a/test/pattern_assembler_tests.js +++ b/test/pattern_assembler_tests.js @@ -768,3 +768,39 @@ tap.test('hidden patterns can be called by their nice names', function(test){ test.equals(util.sanitized(testPattern.render()), util.sanitized('Hello there! Here\'s the hidden atom: [This is the hidden atom]'), 'hidden pattern rendered output not as expected'); test.end(); }); + +tap.test('parses pattern title correctly when frontmatter present', function(test){ + var util = require('./util/test_utils.js'); + + //arrange + var testPatternsPath = path.resolve(__dirname, 'files', '_patterns'); + var pl = util.fakePatternLab(testPatternsPath); + var pattern_assembler = new pa(); + + //act + var testPatternPath = path.join('00-test', '01-bar.mustache'); + var testPattern = pattern_assembler.process_pattern_iterative(testPatternPath, pl); + pattern_assembler.process_pattern_recursive(testPatternPath, pl); + + //assert + test.equals(testPattern.patternName, 'An Atom Walks Into a Bar','patternName not overridden'); + test.end(); +}); + +tap.test('parses pattern extra frontmatter correctly when frontmatter present', function(test){ + var util = require('./util/test_utils.js'); + + //arrange + var testPatternsPath = path.resolve(__dirname, 'files', '_patterns'); + var pl = util.fakePatternLab(testPatternsPath); + var pattern_assembler = new pa(); + + //act + var testPatternPath = path.join('00-test', '01-bar.mustache'); + var testPattern = pattern_assembler.process_pattern_iterative(testPatternPath, pl); + pattern_assembler.process_pattern_recursive(testPatternPath, pl); + + //assert + test.equals(testPattern.allMarkdown.joke, 'bad','extra key not added'); + test.end(); +}); \ No newline at end of file From 3b6a08c4986026a6ec89f0af4bbe4480171da4d7 Mon Sep 17 00:00:00 2001 From: Brian Muenzenmeyer Date: Fri, 1 Sep 2017 05:39:34 -0500 Subject: [PATCH 8/9] fix unit test failing due to CR/LF --- test/parameter_hunter_tests.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/parameter_hunter_tests.js b/test/parameter_hunter_tests.js index a94e42e75..6ca9359b5 100644 --- a/test/parameter_hunter_tests.js +++ b/test/parameter_hunter_tests.js @@ -7,6 +7,7 @@ var CompileState = require('../core/lib/object_factory').CompileState; var PatternGraph = require('../core/lib/pattern_graph').PatternGraph; var fs = require('fs-extra'); +var util = require('./util/test_utils.js'); var ph = require('../core/lib/parameter_hunter'); @@ -112,16 +113,12 @@ tap.test('parameter hunter finds partials with their own parameters and renders parameter_hunter.find_parameters(currentPattern, pl); //assert - test.equals(currentPattern.extendedTemplate, - `c + test.equals(util.sanitized(currentPattern.extendedTemplate), + util.sanitized(`c b b! a -a! - - -`); - +a!`)); test.end(); }); From 8fe4577894d2e814d8ea3fe4e275bb3b38baec11 Mon Sep 17 00:00:00 2001 From: Brian Muenzenmeyer Date: Fri, 1 Sep 2017 05:45:00 -0500 Subject: [PATCH 9/9] bump version! --- core/lib/patternlab.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/lib/patternlab.js b/core/lib/patternlab.js index d4134378b..33d253fb7 100644 --- a/core/lib/patternlab.js +++ b/core/lib/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v2.9.3 - 2017 + * patternlab-node - v2.10.0 - 2017 * * Brian Muenzenmeyer, Geoff Pursell, Raphael Okon, tburny and the web community. * Licensed under the MIT license. diff --git a/package.json b/package.json index 9d4357750..6bca18c71 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "patternlab-node", "description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).", - "version": "2.9.3", + "version": "2.10.0", "main": "./core/lib/patternlab.js", "dependencies": { "chalk": "^1.1.3",