Skip to content

Commit eeb9980

Browse files
Brian Muenzenmeyergeoffp
authored andcommitted
Merge pull request #54 from pattern-lab/dev
Patternlab Node 1.3
1 parent 1027953 commit eeb9980

File tree

10 files changed

+178
-105
lines changed

10 files changed

+178
-105
lines changed

packages/patternengine-node-mustache/CHANGELOG

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

3+
PL-node-v0.1.3
4+
- ADD: Pattern states
5+
- ADD: Ships with grunt connect if you are into that kinda thing
6+
- FIX: Removed all grunt dependencies from patternlab.js
7+
- FIX: Ignore dotfiles
8+
- THX: thanks @bramsmulders for suggestion and help with mac
9+
310
PL-node-v0.1.2
411
- ADD: Abstracted template rendering into a function for easier swapping of rendering engine
512
- ADD: Smarter filtering of files to support other templates Thanks

packages/patternengine-node-mustache/Gruntfile.js

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ module.exports = function(grunt) {
2424
copy: {
2525
main: {
2626
files: [
27-
{ expand: true, cwd: './source/js/', src: '*', dest: './public/js/'},
28-
{ expand: true, cwd: './source/css/', src: 'style.css', dest: './public/css/' },
29-
{ expand: true, cwd: './source/images/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/' },
30-
{ expand: true, cwd: './source/images/sample/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/sample/'},
31-
{ expand: true, cwd: './source/fonts/', src: '*', dest: './public/fonts/'},
32-
{ expand: true, cwd: './source/_data/', src: 'annotations.js', dest: './public/data/' }
27+
{ expand: true, cwd: './source/js/', src: '*', dest: './public/js/'},
28+
{ expand: true, cwd: './source/css/', src: 'style.css', dest: './public/css/' },
29+
{ expand: true, cwd: './source/images/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/' },
30+
{ expand: true, cwd: './source/images/sample/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/sample/'},
31+
{ expand: true, cwd: './source/fonts/', src: '*', dest: './public/fonts/'},
32+
{ expand: true, cwd: './source/_data/', src: 'annotations.js', dest: './public/data/' }
3333
]
3434
}
3535
},
@@ -50,12 +50,12 @@ module.exports = function(grunt) {
5050
// files: ['source/css/**/*.scss', 'public/styleguide/css/*.scss'],
5151
// tasks: ['default']
5252
// },
53-
mustache: {
54-
files: ['source/_patterns/**/*.mustache'],
55-
tasks: ['default']
56-
},
57-
data: {
58-
files: ['source/_patterns/**/*.json', 'source/_data/*.json'],
53+
all: {
54+
files: [
55+
'source/_patterns/**/*.mustache',
56+
'source/_patterns/**/*.json',
57+
'source/_data/*.json'
58+
],
5959
tasks: ['default']
6060
}
6161
},
@@ -74,6 +74,16 @@ module.exports = function(grunt) {
7474
},
7575
nodeunit: {
7676
all: ['test/*_tests.js']
77+
},
78+
connect: {
79+
app:{
80+
options: {
81+
port: 9001,
82+
base: './public',
83+
hostname: 'localhost',
84+
keepalive: true
85+
}
86+
}
7787
}
7888
});
7989

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

8999
//travis CI task
90100
grunt.registerTask('travis', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'nodeunit']);
101+
102+
grunt.registerTask('serve', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'connect:app']);
103+
//need to get livereload working
104+
//http://www.thecrumb.com/2014/03/16/using-grunt-for-live-reload-revisited/
105+
//http://rhumaric.com/2013/07/renewing-the-grunt-livereload-magic/
106+
91107
};

packages/patternengine-node-mustache/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ The current selection is as follows. It reflects support versus patternlab-php.
6464
##### Verbose Mode
6565
`patternlab.json` is a file created for debugging purposes. Set `debug` to true in `.config.json` to see all the secrets.
6666

67+
##### Pattern States
68+
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).
69+
Pattern states should be lowercase and use hyphens where spaces are present.
70+
```
71+
"patternStates": {
72+
"colors" : "inprogress",
73+
"fonts" : "inreview",
74+
"three-up" : "complete"
75+
}
76+
```
77+
78+
##### Server
79+
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`
80+
81+
**Next steps: Livereload and watches**
82+
6783
### Under Active Development
6884

6985
[![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).

packages/patternengine-node-mustache/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.2 - 2014
2+
* patternlab-node - v0.1.3 - 2014
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var patternlab_engine = require('./patternlab.js');
2+
3+
module.exports = function(grunt) {
4+
grunt.registerTask('patternlab', 'create design systems with atomic design', function(arg) {
5+
6+
var patternlab = patternlab_engine();
7+
8+
if(arguments.length === 0){
9+
patternlab.build();
10+
}
11+
12+
if(arg && arg === 'v'){
13+
patternlab.version();
14+
}
15+
16+
if(arg && arg === "only_patterns"){
17+
patternlab.build_patterns_only();
18+
}
19+
20+
if(arg && arg === "help"){
21+
patternlab.help();
22+
}
23+
24+
if(arg && (arg !== "v" && arg !=="only_patterns" && arg !=="help")){
25+
patternlab.help();
26+
}
27+
28+
});
29+
30+
};

0 commit comments

Comments
 (0)