Skip to content

Commit 57c2f15

Browse files
committed
a clean commit
as patternlab-node was a fork of patternlab-php, it did not let me transfer ownership. will migrate issues manually
0 parents  commit 57c2f15

File tree

428 files changed

+24946
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

428 files changed

+24946
-0
lines changed

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules/
2+
.DS_Store
3+
public/index.html
4+
public/styleguide.html
5+
public/styleguide/html/styleguide.html
6+
public/css/*
7+
public/fonts/*
8+
public/js/*
9+
public/images/*
10+
public/patterns/*
11+
public/styleguide/css/*
12+
public/styleguide/js/*
13+
config.ini
14+
latest-change.txt
15+
/public/styleguide/js/styleguide-ck.js
16+
/public/listeners/synclisteners-ck.js
17+
/public/styleguide/js/data-saver-ck.js
18+
/public/styleguide/js/url-handler-ck.js
19+
patternlab.json
20+
.sass-cache/*
21+
/sass-cache

CHANGELOG

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
2+
3+
PL-node-v0.0.3
4+
- FIX: Install documentation was incomplete, should not have assumed grunt
5+
- FIX: Remove SASS/SCSS dependency which was causing clean installs from failing
6+
7+
PL-node-v0.0.2
8+
- FIX: Sub Nav Items now strip hyphens and are styled like patternlab-php.
9+
- FIX: Exclude patterns by using an underscore
10+
- FIX: Grunt watching styleguide scss
11+
12+
PL-node-v0.0.1
13+
- Minimum Viable Product! At this point, I feel you could use Pattern Lab Node to build a atomic design-drive website.

Gruntfile.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
module.exports = function(grunt) {
2+
3+
// Project configuration.
4+
grunt.initConfig({
5+
pkg: grunt.file.readJSON('package.json'),
6+
sass: {
7+
build: {
8+
options: {
9+
style: 'expanded',
10+
precision: 8
11+
},
12+
files: {
13+
'./source/css/style.css': './source/css/style.scss',
14+
'./public/styleguide/css/static.css': './public/styleguide/css/static.scss',
15+
'./public/styleguide/css/styleguide.css': './public/styleguide/css/styleguide.scss'
16+
}
17+
}
18+
},
19+
copy: {
20+
main: {
21+
files: [
22+
{ expand: true, cwd: './source/js/', src: '*', dest: './public/js/'},
23+
{ expand: true, cwd: './source/css/', src: 'style.css', dest: './public/css/' },
24+
{ expand: true, cwd: './source/images/', src: '*', dest: './public/images/' },
25+
{ expand: true, cwd: './source/images/sample/', src: '*', dest: './public/images/sample/'},
26+
{ expand: true, cwd: './source/fonts/', src: '*', dest: './public/fonts/'}
27+
]
28+
}
29+
},
30+
jshint: {
31+
options: {
32+
"curly": true,
33+
"eqnull": true,
34+
"eqeqeq": true,
35+
"undef": true,
36+
"forin": true,
37+
//"unused": true,
38+
"node": true
39+
},
40+
patternlab: ['Gruntfile.js', './builder/lib/patternlab.js']
41+
},
42+
watch: {
43+
// scss: { //scss can be watched if you like
44+
// files: ['source/css/**/*.scss', 'public/styleguide/css/*.scss'],
45+
// tasks: ['default']
46+
// },
47+
mustache: {
48+
files: ['source/_patterns/**/*.mustache'],
49+
tasks: ['default']
50+
},
51+
data: {
52+
files: ['source/_patterns/**/*.json'],
53+
tasks: ['default']
54+
}
55+
}
56+
});
57+
58+
grunt.loadNpmTasks('grunt-contrib-copy');
59+
grunt.loadNpmTasks('grunt-contrib-watch');
60+
grunt.loadNpmTasks('grunt-contrib-sass');
61+
grunt.loadNpmTasks('grunt-contrib-jshint');
62+
63+
//load the patternlab task
64+
grunt.task.loadTasks('./builder/');
65+
66+
//if you choose to use scss, or any preprocessor, you can add it here
67+
grunt.registerTask('default', ['patternlab', /*'sass',*/ 'copy']);
68+
};

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
## About the Node Version of Pattern Lab
2+
3+
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.
4+
5+
## Under Active Development
6+
7+
The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer) and (hopefully) [@Wiscow](https://twitter.com/Wiscow). Contributions welcome. We both have kids under 2 years of age, so patience and coffee is requested :D
8+
9+
### Getting Started
10+
11+
To run patternlab-node, just do the following from the command line at the root of patternlab-node:
12+
13+
1. `npm install`
14+
2. `npm install -g grunt-cli`
15+
3. `grunt`
16+
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.
18+
19+
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.
20+
21+
#### Watching Progress
22+
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!
24+
25+
#### Roadmap
26+
* Full Patternlab site support. (This is the uber cool navigation found at [demo.pattern-lab.info](http://demo.pattern-lab.info)).
27+
* More Documentation
28+
* Tests
29+
30+
**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**
31+
32+
33+
===
34+
35+
## Demo
36+
37+
You can play with a demo of the front-end of the PHP version of Pattern Lab at [demo.pattern-lab.info](http://demo.pattern-lab.info).
38+
39+
## Getting Started
40+
41+
The PHP version of Pattern Lab should be relatively easy for anyone to get up and running.
42+
43+
* [Requirements](https://github.com/pattern-lab/patternlab-php/wiki/Requirements)
44+
* [Installing the PHP Version of Pattern Lab](https://github.com/pattern-lab/patternlab-php/wiki/Installing-the-PHP-Version-of-Pattern-Lab)
45+
* [Generating the Pattern Lab Website for the First Time](https://github.com/pattern-lab/patternlab-php/wiki/Generating-the-Pattern-Lab-Website-for-the-First-Time)
46+
* [Editing the Pattern Lab Website Source Files](https://github.com/pattern-lab/patternlab-php/wiki/Editing-the-Pattern-Lab-Website-Source-Files)
47+
* [Using the Command-line Options](https://github.com/pattern-lab/patternlab-php/wiki/Using-the-Command-line-Options)
48+
49+
## Working with Patterns
50+
51+
Patterns are the core element of Pattern Lab. Understanding how they work is the key to getting the most out of the system. Patterns use [Mustache](http://mustache.github.io/) so please read [Mustache's docs](http://mustache.github.io/mustache.5.html) as well.
52+
53+
* [How Patterns Are Organized](https://github.com/pattern-lab/patternlab-php/wiki/How-Patterns-Are-Organized)
54+
* [Adding New Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Adding-New-Patterns)
55+
* [Reorganizing Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Reorganizing-Patterns)
56+
* [Converting Old Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Converting-Old-Patterns)
57+
* ["Hiding" Patterns in the Navigation](https://github.com/pattern-lab/patternlab-php/wiki/Hiding-Patterns-in-the-Navigation)
58+
* [Including One Pattern Within Another via Partials](https://github.com/pattern-lab/patternlab-php/wiki/Including-One-Pattern-Within-Another)
59+
* [Linking Directly to a Pattern](https://github.com/pattern-lab/patternlab-php/wiki/Linking-Directly-to-a-Pattern)
60+
* [Managing Assets for a Pattern: JavaScript, images, CSS, etc.](https://github.com/pattern-lab/patternlab-php/wiki/Managing-Assets-for-a-Pattern)
61+
* [Modifying the Standard Header & Footer for Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Modifying-the-Standard-Header-&-Footer-for-Patterns)
62+
63+
## Creating & Working With Dynamic Data for a Pattern
64+
65+
The PHP version of Pattern Lab utilizes Mustache as the template language for patterns. In addition to allowing for the [inclusion of one pattern within another](https://github.com/pattern-lab/patternlab-php/wiki/Including-One-Pattern-Within-Another) it also gives pattern developers the ability to include variables. This means that attributes like image sources can be centralized in one file for easy modification across one or more patterns. The PHP version of Pattern Lab uses a JSON file, `source/_data/data.json`, to centralize many of these attributes.
66+
67+
* [Introduction to JSON & Mustache Variables](http://github.com/pattern-lab/patternlab-php/wiki/Introduction-to-JSON-&-Mustache-Variables)
68+
* [Overriding the Central `data.json` Values with Pattern-specific Values](https://github.com/pattern-lab/patternlab-php/wiki/Overriding-the-Central-%60data.json%60-Values-with-Pattern-specific-Values)
69+
* [Linking to Patterns with Pattern Lab's Default `link` Variable](https://github.com/pattern-lab/patternlab-php/wiki/Linking-to-Patterns-with-Pattern-Lab's-Default-%60link%60-Variable)
70+
* [Creating Lists with Pattern Lab's Default `listItems` Variable](https://github.com/pattern-lab/patternlab-php/wiki/Creating-Lists-with-Pattern-Lab's-Default-%60listItems%60-Variable)
71+
72+
## Using Pattern Lab's Advanced Features
73+
74+
By default, the Pattern Lab assets can be manually generated and the Pattern Lab site manually refreshed but who wants to waste time doing that? Here are some ways that the PHP version of Pattern Lab can make your development workflow a little smoother:
75+
76+
* [Watching for Changes and Auto-Regenerating Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Watching-for-Changes-and-Auto-Regenerating-Patterns)
77+
* [Auto-Reloading the Browser Window When Changes Are Made](https://github.com/pattern-lab/patternlab-php/wiki/Auto-Reloading-the-Browser-Window-When-Changes-Are-Made)
78+
* [Multi-browser & Multi-device Testing with Page Follow](https://github.com/pattern-lab/patternlab-php/wiki/Multi-browser-&-Multi-device-Testing-with-Page-Follow)

builder/lib/Mustache/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
.rvmrc
3+
node_modules
4+
runner.js
5+
jquery.mustache.js
6+
qooxdoo.mustache.js
7+
dojox
8+
yui3
9+
requirejs.mustache.js
10+

builder/lib/Mustache/.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "test/spec"]
2+
path = test/spec
3+
url = https://github.com/mustache/spec

builder/lib/Mustache/.jshintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"eqnull": true,
3+
"evil": true
4+
}
5+

builder/lib/Mustache/.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- 0.6
4+

builder/lib/Mustache/CHANGES

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
= HEAD
2+
3+
* Don't require the original template to be passed to the rendering function
4+
when using compiled templates. This is still required when using higher-order
5+
functions in order to be able to extract the portion of the template
6+
that was contained by that section. Fixes #262.
7+
* Performance improvements.
8+
9+
= 0.7.2 / 27 Dec 2012
10+
11+
* Fixed a rendering bug (#274) when using nested higher-order sections.
12+
* Better error reporting on failed parse.
13+
* Converted tests to use mocha instead of vows.
14+
15+
= 0.7.1 / 6 Dec 2012
16+
17+
* Handle empty templates gracefully. Fixes #265, #267, and #270.
18+
* Cache partials by template, not by name. Fixes #257.
19+
* Added Mustache.compileTokens to compile the output of Mustache.parse. Fixes
20+
#258.
21+
22+
= 0.7.0 / 10 Sep 2012
23+
24+
* Rename Renderer => Writer.
25+
* Allow partials to be loaded dynamically using a callback (thanks
26+
@TiddoLangerak for the suggestion).
27+
* Fixed a bug with higher-order sections that prevented them from being
28+
passed the raw text of the section from the original template.
29+
* More concise token format. Tokens also include start/end indices in the
30+
original template.
31+
* High-level API is consistent with the Writer API.
32+
* Allow partials to be passed to the pre-compiled function (thanks
33+
@fallenice).
34+
* Don't use eval (thanks @cweider).
35+
36+
= 0.6.0 / 31 Aug 2012
37+
38+
* Use JavaScript's definition of falsy when determining whether to render an
39+
inverted section or not. Issue #186.
40+
* Use Mustache.escape to escape values inside {{}}. This function may be
41+
reassigned to alter the default escaping behavior. Issue #244.
42+
* Fixed a bug that clashed with QUnit (thanks @kannix).
43+
* Added volo support (thanks @guybedford).

builder/lib/Mustache/LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The MIT License
2+
3+
Copyright (c) 2009 Chris Wanstrath (Ruby)
4+
Copyright (c) 2010 Jan Lehnardt (JavaScript)
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)