From f78f9b6e1b6572fb5e045563963b7a9bd2539db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Brekke=20Skj=C3=B8tskift?= Date: Tue, 2 Sep 2014 11:50:20 +0200 Subject: [PATCH 1/4] added forward slash to pattern flatPatternName --- builder/patternlab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/patternlab.js b/builder/patternlab.js index 37d75805b..76f9e3003 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -81,7 +81,7 @@ var patternlab_engine = function(){ } //make a new Pattern Object - var flatPatternName = subdir.replace(/\\/g, '-') + '-' + patternName; + var flatPatternName = subdir.replace(/[\/\\]/g, '-') + '-' + patternName; flatPatternName = flatPatternName.replace(/\\/g, '-'); currentPattern = new of.oPattern(flatPatternName, subdir, filename, {}); From 13e2bfadf1029ed48b0ef6a0adc7b6dea42f3a3e Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Wed, 17 Sep 2014 22:25:11 -0500 Subject: [PATCH 2/4] fixed path finder fixes #61 first cut of media hunter #46. --- builder/media_hunter.js | 24 ++++++++++++++++++++++++ builder/patternlab.js | 10 ++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 builder/media_hunter.js diff --git a/builder/media_hunter.js b/builder/media_hunter.js new file mode 100644 index 000000000..dc9cadcb9 --- /dev/null +++ b/builder/media_hunter.js @@ -0,0 +1,24 @@ +(function () { + "use strict"; + + var media_hunter = function(){ + + function findMediaQueries(patternlab){ + patternlab.mediaQueries = []; + + + + + } + + return { + find_media_queries: function(patternlab){ + findMediaQueries(patternlab); + } + }; + + }; + + module.exports = media_hunter; + +}()); \ No newline at end of file diff --git a/builder/patternlab.js b/builder/patternlab.js index 37d75805b..ee38b4d7a 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -15,6 +15,7 @@ var patternlab_engine = function(){ mustache = require('mustache'), of = require('./object_factory'), pa = require('./pattern_assembler'), + mh = require('./media_hunter'), patternlab = {}; patternlab.package =fs.readJSONSync('./package.json'); @@ -81,7 +82,7 @@ var patternlab_engine = function(){ } //make a new Pattern Object - var flatPatternName = subdir.replace(/\\/g, '-') + '-' + patternName; + var flatPatternName = subdir.replace(/[\/\\]/g, '-') + '-' + patternName; flatPatternName = flatPatternName.replace(/\\/g, '-'); currentPattern = new of.oPattern(flatPatternName, subdir, filename, {}); @@ -122,7 +123,7 @@ var patternlab_engine = function(){ //add as a partial in case this is referenced later. convert to syntax needed by existing patterns var sub = subdir.substring(subdir.indexOf('-') + 1); - var folderIndex = sub.indexOf('/'); //THIS IS MOST LIKELY WINDOWS ONLY. path.sep not working yet + var folderIndex = sub.indexOf(path.sep); var cleanSub = sub.substring(0, folderIndex); //add any templates found to an object of partials, so downstream templates may use them too @@ -148,6 +149,11 @@ var patternlab_engine = function(){ patternlab.patternPaths = {}; patternlab.viewAllPaths = {}; + //find mediaQueries + // var media_hunter = new mh(); + // media_hunter.find_media_queries(patternlab); + // console.log(patternlab.mediaQueries); + //build the styleguide var styleguideTemplate = fs.readFileSync('./source/_patternlab-files/styleguide.mustache', 'utf8'); var styleguideHtml = renderPattern(styleguideTemplate, {partials: patternlab.patterns}); From 424503e5a38d4aa35c27a1fe3a1345ac8cfbe3fe Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Wed, 17 Sep 2014 22:36:04 -0500 Subject: [PATCH 3/4] undoing a change i didn't mean to commit --- builder/patternlab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/patternlab.js b/builder/patternlab.js index ee38b4d7a..91b77f1ea 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -82,7 +82,7 @@ var patternlab_engine = function(){ } //make a new Pattern Object - var flatPatternName = subdir.replace(/[\/\\]/g, '-') + '-' + patternName; + var flatPatternName = subdir.replace(/\\/g, '-') + '-' + patternName; flatPatternName = flatPatternName.replace(/\\/g, '-'); currentPattern = new of.oPattern(flatPatternName, subdir, filename, {}); From 0a822630b70deae4bb0c4157463cedb9c51abbe3 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Wed, 17 Sep 2014 22:40:39 -0500 Subject: [PATCH 4/4] prepping for 0.1.4 release --- CHANGELOG | 5 +++++ builder/object_factory.js | 2 +- builder/patternlab.js | 2 +- package.json | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9d61789b3..8737c945a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT. +PL-node-v0.1.4 + - FIX: Resolved issue with nested pattern rendering + - FIX: Supporting flat pattern name regex's in unix-systems + - THX: thanks @torbs for the issue and pull request + PL-node-v0.1.3 - ADD: Pattern states - ADD: Ships with grunt connect if you are into that kinda thing diff --git a/builder/object_factory.js b/builder/object_factory.js index 8788e73ba..ab95fafc5 100644 --- a/builder/object_factory.js +++ b/builder/object_factory.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.3 - 2014 + * patternlab-node - v0.1.4 - 2014 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. diff --git a/builder/patternlab.js b/builder/patternlab.js index 91b77f1ea..bb82eaded 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.3 - 2014 + * patternlab-node - v0.1.4 - 2014 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. diff --git a/package.json b/package.json index 6d8487426..57f9cf18e 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": "0.1.3", + "version": "0.1.4", "devDependencies": { "grunt": "~0.4.0", "grunt-contrib-watch": "~0.2.0",