Skip to content

Patternlab Node 1.4 #62

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

Merged
merged 5 commits into from
Sep 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 24 additions & 0 deletions builder/media_hunter.js
Original file line number Diff line number Diff line change
@@ -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;

}());
2 changes: 1 addition & 1 deletion builder/object_factory.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
12 changes: 9 additions & 3 deletions builder/patternlab.js
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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');
Expand Down Expand Up @@ -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, {});
Expand Down Expand Up @@ -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
Expand All @@ -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});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down