Skip to content

Commit fadde70

Browse files
author
Brian Muenzenmeyer
committed
Merge pull request #62 from pattern-lab/plnode1-4
Patternlab Node 1.4
2 parents 26aaeb1 + 70b6015 commit fadde70

File tree

5 files changed

+40
-5
lines changed

5 files changed

+40
-5
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
22

3+
PL-node-v0.1.4
4+
- FIX: Resolved issue with nested pattern rendering
5+
- FIX: Supporting flat pattern name regex's in unix-systems
6+
- THX: thanks @torbs for the issue and pull request
7+
38
PL-node-v0.1.3
49
- ADD: Pattern states
510
- ADD: Ships with grunt connect if you are into that kinda thing

builder/media_hunter.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(function () {
2+
"use strict";
3+
4+
var media_hunter = function(){
5+
6+
function findMediaQueries(patternlab){
7+
patternlab.mediaQueries = [];
8+
9+
10+
11+
12+
}
13+
14+
return {
15+
find_media_queries: function(patternlab){
16+
findMediaQueries(patternlab);
17+
}
18+
};
19+
20+
};
21+
22+
module.exports = media_hunter;
23+
24+
}());

builder/object_factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v0.1.3 - 2014
2+
* patternlab-node - v0.1.4 - 2014
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.

builder/patternlab.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v0.1.3 - 2014
2+
* patternlab-node - v0.1.4 - 2014
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.
@@ -15,6 +15,7 @@ var patternlab_engine = function(){
1515
mustache = require('mustache'),
1616
of = require('./object_factory'),
1717
pa = require('./pattern_assembler'),
18+
mh = require('./media_hunter'),
1819
patternlab = {};
1920

2021
patternlab.package =fs.readJSONSync('./package.json');
@@ -81,7 +82,7 @@ var patternlab_engine = function(){
8182
}
8283

8384
//make a new Pattern Object
84-
var flatPatternName = subdir.replace(/\\/g, '-') + '-' + patternName;
85+
var flatPatternName = subdir.replace(/[\/\\]/g, '-') + '-' + patternName;
8586

8687
flatPatternName = flatPatternName.replace(/\\/g, '-');
8788
currentPattern = new of.oPattern(flatPatternName, subdir, filename, {});
@@ -122,7 +123,7 @@ var patternlab_engine = function(){
122123

123124
//add as a partial in case this is referenced later. convert to syntax needed by existing patterns
124125
var sub = subdir.substring(subdir.indexOf('-') + 1);
125-
var folderIndex = sub.indexOf('/'); //THIS IS MOST LIKELY WINDOWS ONLY. path.sep not working yet
126+
var folderIndex = sub.indexOf(path.sep);
126127
var cleanSub = sub.substring(0, folderIndex);
127128

128129
//add any templates found to an object of partials, so downstream templates may use them too
@@ -148,6 +149,11 @@ var patternlab_engine = function(){
148149
patternlab.patternPaths = {};
149150
patternlab.viewAllPaths = {};
150151

152+
//find mediaQueries
153+
// var media_hunter = new mh();
154+
// media_hunter.find_media_queries(patternlab);
155+
// console.log(patternlab.mediaQueries);
156+
151157
//build the styleguide
152158
var styleguideTemplate = fs.readFileSync('./source/_patternlab-files/styleguide.mustache', 'utf8');
153159
var styleguideHtml = renderPattern(styleguideTemplate, {partials: patternlab.patterns});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "patternlab-node",
33
"description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).",
4-
"version": "0.1.3",
4+
"version": "0.1.4",
55
"devDependencies": {
66
"grunt": "~0.4.0",
77
"grunt-contrib-watch": "~0.2.0",

0 commit comments

Comments
 (0)