Skip to content

Commit

Permalink
Merge pull request #54 from pattern-lab/dev
Browse files Browse the repository at this point in the history
Patternlab Node 1.3
  • Loading branch information
Brian Muenzenmeyer committed Aug 14, 2014
2 parents 7f037ca + 7d473f1 commit 26aaeb1
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 105 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.

PL-node-v0.1.3
- ADD: Pattern states
- ADD: Ships with grunt connect if you are into that kinda thing
- FIX: Removed all grunt dependencies from patternlab.js
- FIX: Ignore dotfiles
- THX: thanks @bramsmulders for suggestion and help with mac

PL-node-v0.1.2
- ADD: Abstracted template rendering into a function for easier swapping of rendering engine
- ADD: Smarter filtering of files to support other templates Thanks
Expand Down
40 changes: 28 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ module.exports = function(grunt) {
copy: {
main: {
files: [
{ expand: true, cwd: './source/js/', src: '*', dest: './public/js/'},
{ expand: true, cwd: './source/css/', src: 'style.css', dest: './public/css/' },
{ expand: true, cwd: './source/images/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/' },
{ expand: true, cwd: './source/images/sample/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/sample/'},
{ expand: true, cwd: './source/fonts/', src: '*', dest: './public/fonts/'},
{ expand: true, cwd: './source/_data/', src: 'annotations.js', dest: './public/data/' }
{ expand: true, cwd: './source/js/', src: '*', dest: './public/js/'},
{ expand: true, cwd: './source/css/', src: 'style.css', dest: './public/css/' },
{ expand: true, cwd: './source/images/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/' },
{ expand: true, cwd: './source/images/sample/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/sample/'},
{ expand: true, cwd: './source/fonts/', src: '*', dest: './public/fonts/'},
{ expand: true, cwd: './source/_data/', src: 'annotations.js', dest: './public/data/' }
]
}
},
Expand All @@ -50,12 +50,12 @@ module.exports = function(grunt) {
// files: ['source/css/**/*.scss', 'public/styleguide/css/*.scss'],
// tasks: ['default']
// },
mustache: {
files: ['source/_patterns/**/*.mustache'],
tasks: ['default']
},
data: {
files: ['source/_patterns/**/*.json', 'source/_data/*.json'],
all: {
files: [
'source/_patterns/**/*.mustache',
'source/_patterns/**/*.json',
'source/_data/*.json'
],
tasks: ['default']
}
},
Expand All @@ -74,6 +74,16 @@ module.exports = function(grunt) {
},
nodeunit: {
all: ['test/*_tests.js']
},
connect: {
app:{
options: {
port: 9001,
base: './public',
hostname: 'localhost',
keepalive: true
}
}
}
});

Expand All @@ -88,4 +98,10 @@ module.exports = function(grunt) {

//travis CI task
grunt.registerTask('travis', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'nodeunit']);

grunt.registerTask('serve', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'connect:app']);
//need to get livereload working
//http://www.thecrumb.com/2014/03/16/using-grunt-for-live-reload-revisited/
//http://rhumaric.com/2013/07/renewing-the-grunt-livereload-magic/

};
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ The current selection is as follows. It reflects support versus patternlab-php.
##### Verbose Mode
`patternlab.json` is a file created for debugging purposes. Set `debug` to true in `.config.json` to see all the secrets.

##### Pattern States
You can set the state of a pattern by including it in `config.json` too. The out of the box styles are in progress (orange), in review (yellow), and complete (green).
Pattern states should be lowercase and use hyphens where spaces are present.
```
"patternStates": {
"colors" : "inprogress",
"fonts" : "inreview",
"three-up" : "complete"
}
```

##### Server
Running `grunt serve` will compile the patternlab front end and host it on <a href="http://localhost:9001">http://localhost:9001</a> by default. This can be changed in the `Gruntfile.js`

**Next steps: Livereload and watches**

### Under Active Development

[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer) and contributors. Pull requests welcome, but please take a moment to read the [guidelines](https://github.com/pattern-lab/patternlab-node/blob/master/CONTRIBUTING.md).
Expand Down
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.2 - 2014
* patternlab-node - v0.1.3 - 2014
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
30 changes: 30 additions & 0 deletions builder/patternlab-grunt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var patternlab_engine = require('./patternlab.js');

module.exports = function(grunt) {
grunt.registerTask('patternlab', 'create design systems with atomic design', function(arg) {

var patternlab = patternlab_engine();

if(arguments.length === 0){
patternlab.build();
}

if(arg && arg === 'v'){
patternlab.version();
}

if(arg && arg === "only_patterns"){
patternlab.build_patterns_only();
}

if(arg && arg === "help"){
patternlab.help();
}

if(arg && (arg !== "v" && arg !=="only_patterns" && arg !=="help")){
patternlab.help();
}

});

};
Loading

0 comments on commit 26aaeb1

Please sign in to comment.