Skip to content

Commit 2006ef1

Browse files
author
Brian Muenzenmeyer
committed
Merge pull request #39 from pattern-lab/plnode1-1
PL Node 1.1
2 parents 4b5e4e2 + 0edeb39 commit 2006ef1

11 files changed

+46
-69
lines changed

CHANGELOG

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

3+
PL-node-v0.1.1
4+
- FIX: Removed View All Pattern SubItem Link Logic, no longer in reference implementation
5+
- ADD: Flag for generating debug file
6+
- ADD: Travis CI test support!
7+
- ADD: Contributing file
8+
- ADD: Repository to package.json
9+
- THX: thank you @tbranyen for tip on repository, and NPM
10+
311
PL-node-v0.1.0
412
- FIX: Links to patterns did not work when visited from a server
513
- FIX: Patterns with hyphens in the name were breaking the iframe messaging

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#Contributing to Patternlab - Node
2+
If you'd like to contribute to patternlab - node, please do so! There is always a lot of ground to cover, with patternlab - php being so feature-rich.
3+
4+
No pull request is too small.
5+
6+
##Guidelines
7+
1. Please keep your pull requests concise
8+
2. _ALWAYS_ submit it against the [dev branch](https://github.com/pattern-lab/patternlab-node/tree/dev). If this does not occur, I will first, try to redirect you gently, second, port over your contribution manually if time allows, and/or third, close your pull request.

Gruntfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ module.exports = function(grunt) {
33
// Project configuration.
44
grunt.initConfig({
55
pkg: grunt.file.readJSON('package.json'),
6-
clean: ['./public/patterns'],
6+
clean: {
7+
options: { force: true },
8+
files: ['./public/patterns']
9+
},
710
concat: {
811
options: {
912
stripBanners: true,

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
The Node version of Pattern Lab is, at its core, a static site generator. It combines platform-agnostic assets, like the [Mustache](http://mustache.github.io/)-based patterns and the JavaScript-based viewer, with a Node-based "builder" that transforms and dynamically builds the Pattern Lab site. By making it a static site generator, the Node version of Pattern Lab strongly separates patterns, data, and presentation from build logic. The Node version is a work in progress, the [PHP version](https://github.com/pattern-lab/patternlab-php) should be seen as a reference for other developers to improve upon as they build their own Pattern Lab Builders in their language of choice.
44

5-
## Under Active Development
6-
7-
[![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). Contributions welcome!
8-
95
### Getting Started
106

117
To run patternlab-node, just do the following from the command line at the root of patternlab-node:
@@ -14,18 +10,22 @@ To run patternlab-node, just do the following from the command line at the root
1410
2. `npm install -g grunt-cli`
1511
3. `grunt`
1612

17-
This creates all patterns, the styleguide, and the patternlab site. `patternlab.json` is a file created for debugging purposes. It tells you all the secrets in tidy json.
13+
This creates all patterns, the styleguide, and the pattern lab site. `patternlab.json` is a file created for debugging purposes. It tells you all the secrets in tidy json.
1814

1915
To have patternlab-node watch for changes to either a mustache template, data, or stylesheets, run `grunt watch`. The `Gruntfile` governs what is watched. It should be easy to add scss or whatever preprocessor you fancy.
2016

21-
#### Watching Progress
17+
### Under Active Development
18+
19+
[![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).
20+
21+
#### Forward, To the Specification!
22+
23+
Dave Olsen has published the [specification](https://github.com/pattern-lab/the-spec/blob/draft/SPEC.md) for Pattern Lab ports. Development will be oriented toward compliance with this as the spec and the port mature together.
24+
25+
#### Is Pattern Lab a Platform or a Build Tool?
2226

23-
Patternlab Node has reached [minimum viable product](http://en.wikipedia.org/wiki/Minimum_viable_product) status. The main branch will always have the most up to date version of patternlab-node. Watch the dev branch for what it coming next!
27+
A lot of good conversation has revolved around whether Pattern Lab is a platform or a tool in the toolbox, part of a larger solution. It's my goal to #1) adhere to the specification and #2) meet the needs of both use cases.
2428

25-
#### Roadmap
26-
* DRY & Testing.
27-
* Lineage
28-
* Documentation
2929

3030
**THE FOLLOWING IS FROM THE PATTERNLAB-PHP PROJECT. A LOT STILL APPLIES TO PATTERNLAB-NODE, BUT IT HAS NOT BEEN ADAPTED YET. USE AT YOUR OWN PERIL**
3131

builder/patternlab.js

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v0.1.0 - 2014-01-21
2+
* patternlab-node - v0.1.1 - 2014-05-05
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.
@@ -57,7 +57,9 @@ var mustache = require('./lib/Mustache/mustache.js');
5757
module.exports = function(grunt) {
5858
grunt.registerTask('patternlab', 'create design systems with atomic design', function(arg) {
5959

60+
6061
var patternlab = {};
62+
patternlab.package = grunt.file.readJSON('package.json');
6163
patternlab.data = grunt.file.readJSON('./source/_data/data.json');
6264
patternlab.listitems = grunt.file.readJSON('./source/_data/listitems.json');
6365
patternlab.header = grunt.file.read('./source/_patternlab-files/pattern-header-footer/header.html');
@@ -286,40 +288,8 @@ module.exports = function(grunt) {
286288

287289
}
288290

289-
//check to see if this bucket has a View All yet. If not, add it.
290-
// var navItem = bucket.navItems[navItemIndex];
291-
// if(navItem){
292-
// var hasViewAll = navItem.navSubItemsIndex.indexOf('View All');
293-
// if(hasViewAll === -1){
294-
// console.log('add a view all pattern');
295-
296-
// var navSubItem = new oNavSubItem('View All');
297-
// navSubItem.patternPath = pattern.flatPatternPath + '/index.html'; //this is likely wrong
298-
// navSubItem.patternPartial = 'viewall-' + bucketName + '-' + pattern.patternSubGroup;
299-
300-
// //add the navSubItem
301-
// console.log(navSubItem);
302-
// navItem.navSubItems.push(navSubItem);
303-
// navItem.navSubItemsIndex.push('View All');
304-
// }
305-
// }
306291
}
307292

308-
//VIEW ALL LOGIC CAN LOOP THROUGH PATTERNS TOO
309-
//only add if it's an atom, molecule, or organism
310-
// if(pattern.patternGroup === 'atoms' || pattern.patternGroup === 'molecules' || pattern.patternGroup === 'organisms'){
311-
// if(patternlab.viewAllPaths[pattern.patternGroup]){
312-
313-
// //add the pattern sub-group
314-
// patternlab.viewAllPaths[pattern.patternGroup][pattern.patternSubGroup] = pattern.flatPatternPath;
315-
// }
316-
// else{
317-
// //add the new group then the subgroup
318-
// patternlab.viewAllPaths[pattern.patternGroup] = {};
319-
// patternlab.viewAllPaths[pattern.patternGroup][pattern.patternSubGroup] = pattern.flatPatternPath;
320-
// }
321-
// }
322-
323293
};
324294

325295
//the patternlab site requires a lot of partials to be rendered.
@@ -357,9 +327,10 @@ module.exports = function(grunt) {
357327
});
358328
grunt.file.write('./public/index.html', patternlabSiteHtml);
359329

360-
//debug
361-
var outputFilename = './patternlab.json';
362-
grunt.file.write(outputFilename, JSON.stringify(patternlab, null, 3));
363-
330+
//debug file can be written by setting flag on package.json
331+
if(patternlab.package.debug){
332+
var outputFilename = './patternlab.json';
333+
grunt.file.write(outputFilename, JSON.stringify(patternlab, null, 3));
334+
}
364335
});
365336
};

package.json

Lines changed: 7 additions & 2 deletions
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.0",
4+
"version": "0.1.1",
55
"devDependencies": {
66
"grunt": "~0.4.0",
77
"grunt-contrib-watch": "~0.2.0",
@@ -20,12 +20,17 @@
2020
"Grunt",
2121
"Javascript"
2222
],
23+
"repository": {
24+
"type": "git",
25+
"url": "git://github.com/pattern-lab/patternlab-node.git"
26+
},
2327
"author": "Brian Muenzenmeyer",
2428
"license": "MIT",
2529
"scripts": {
2630
"test" : "grunt travis --verbose"
2731
},
2832
"engines": {
2933
"node": ">=0.8"
30-
}
34+
},
35+
"debug": false
3136
}

scripts/README

Lines changed: 0 additions & 6 deletions
This file was deleted.

scripts/generateSite.command

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/startAutoReloadServer.command

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/startPageFollowServer.command

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/startWatcher.command

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)