Skip to content

Commit

Permalink
a clean commit
Browse files Browse the repository at this point in the history
as patternlab-node was a fork of patternlab-php, it did not let me
transfer ownership.  will migrate issues manually
  • Loading branch information
bmuenzenmeyer committed Oct 25, 2013
0 parents commit 57c2f15
Show file tree
Hide file tree
Showing 428 changed files with 24,946 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
node_modules/
.DS_Store
public/index.html
public/styleguide.html
public/styleguide/html/styleguide.html
public/css/*
public/fonts/*
public/js/*
public/images/*
public/patterns/*
public/styleguide/css/*
public/styleguide/js/*
config.ini
latest-change.txt
/public/styleguide/js/styleguide-ck.js
/public/listeners/synclisteners-ck.js
/public/styleguide/js/data-saver-ck.js
/public/styleguide/js/url-handler-ck.js
patternlab.json
.sass-cache/*
/sass-cache
13 changes: 13 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.

PL-node-v0.0.3
- FIX: Install documentation was incomplete, should not have assumed grunt
- FIX: Remove SASS/SCSS dependency which was causing clean installs from failing

PL-node-v0.0.2
- FIX: Sub Nav Items now strip hyphens and are styled like patternlab-php.
- FIX: Exclude patterns by using an underscore
- FIX: Grunt watching styleguide scss

PL-node-v0.0.1
- Minimum Viable Product! At this point, I feel you could use Pattern Lab Node to build a atomic design-drive website.
68 changes: 68 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
build: {
options: {
style: 'expanded',
precision: 8
},
files: {
'./source/css/style.css': './source/css/style.scss',
'./public/styleguide/css/static.css': './public/styleguide/css/static.scss',
'./public/styleguide/css/styleguide.css': './public/styleguide/css/styleguide.scss'
}
}
},
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: '*', dest: './public/images/' },
{ expand: true, cwd: './source/images/sample/', src: '*', dest: './public/images/sample/'},
{ expand: true, cwd: './source/fonts/', src: '*', dest: './public/fonts/'}
]
}
},
jshint: {
options: {
"curly": true,
"eqnull": true,
"eqeqeq": true,
"undef": true,
"forin": true,
//"unused": true,
"node": true
},
patternlab: ['Gruntfile.js', './builder/lib/patternlab.js']
},
watch: {
// scss: { //scss can be watched if you like
// files: ['source/css/**/*.scss', 'public/styleguide/css/*.scss'],
// tasks: ['default']
// },
mustache: {
files: ['source/_patterns/**/*.mustache'],
tasks: ['default']
},
data: {
files: ['source/_patterns/**/*.json'],
tasks: ['default']
}
}
});

grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-jshint');

//load the patternlab task
grunt.task.loadTasks('./builder/');

//if you choose to use scss, or any preprocessor, you can add it here
grunt.registerTask('default', ['patternlab', /*'sass',*/ 'copy']);
};
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
## About the Node Version of Pattern Lab

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.

## Under Active Development

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

### Getting Started

To run patternlab-node, just do the following from the command line at the root of patternlab-node:

1. `npm install`
2. `npm install -g grunt-cli`
3. `grunt`

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.

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.

#### Watching Progress

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!

#### Roadmap
* Full Patternlab site support. (This is the uber cool navigation found at [demo.pattern-lab.info](http://demo.pattern-lab.info)).
* More Documentation
* Tests

**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**


===

## Demo

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).

## Getting Started

The PHP version of Pattern Lab should be relatively easy for anyone to get up and running.

* [Requirements](https://github.com/pattern-lab/patternlab-php/wiki/Requirements)
* [Installing the PHP Version of Pattern Lab](https://github.com/pattern-lab/patternlab-php/wiki/Installing-the-PHP-Version-of-Pattern-Lab)
* [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)
* [Editing the Pattern Lab Website Source Files](https://github.com/pattern-lab/patternlab-php/wiki/Editing-the-Pattern-Lab-Website-Source-Files)
* [Using the Command-line Options](https://github.com/pattern-lab/patternlab-php/wiki/Using-the-Command-line-Options)

## Working with Patterns

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.

* [How Patterns Are Organized](https://github.com/pattern-lab/patternlab-php/wiki/How-Patterns-Are-Organized)
* [Adding New Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Adding-New-Patterns)
* [Reorganizing Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Reorganizing-Patterns)
* [Converting Old Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Converting-Old-Patterns)
* ["Hiding" Patterns in the Navigation](https://github.com/pattern-lab/patternlab-php/wiki/Hiding-Patterns-in-the-Navigation)
* [Including One Pattern Within Another via Partials](https://github.com/pattern-lab/patternlab-php/wiki/Including-One-Pattern-Within-Another)
* [Linking Directly to a Pattern](https://github.com/pattern-lab/patternlab-php/wiki/Linking-Directly-to-a-Pattern)
* [Managing Assets for a Pattern: JavaScript, images, CSS, etc.](https://github.com/pattern-lab/patternlab-php/wiki/Managing-Assets-for-a-Pattern)
* [Modifying the Standard Header & Footer for Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Modifying-the-Standard-Header-&-Footer-for-Patterns)

## Creating & Working With Dynamic Data for a Pattern

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.

* [Introduction to JSON & Mustache Variables](http://github.com/pattern-lab/patternlab-php/wiki/Introduction-to-JSON-&-Mustache-Variables)
* [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)
* [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)
* [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)

## Using Pattern Lab's Advanced Features

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:

* [Watching for Changes and Auto-Regenerating Patterns](https://github.com/pattern-lab/patternlab-php/wiki/Watching-for-Changes-and-Auto-Regenerating-Patterns)
* [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)
* [Multi-browser & Multi-device Testing with Page Follow](https://github.com/pattern-lab/patternlab-php/wiki/Multi-browser-&-Multi-device-Testing-with-Page-Follow)
10 changes: 10 additions & 0 deletions builder/lib/Mustache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
.rvmrc
node_modules
runner.js
jquery.mustache.js
qooxdoo.mustache.js
dojox
yui3
requirejs.mustache.js

3 changes: 3 additions & 0 deletions builder/lib/Mustache/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "test/spec"]
path = test/spec
url = https://github.com/mustache/spec
5 changes: 5 additions & 0 deletions builder/lib/Mustache/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"eqnull": true,
"evil": true
}

4 changes: 4 additions & 0 deletions builder/lib/Mustache/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- 0.6

43 changes: 43 additions & 0 deletions builder/lib/Mustache/CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
= HEAD

* Don't require the original template to be passed to the rendering function
when using compiled templates. This is still required when using higher-order
functions in order to be able to extract the portion of the template
that was contained by that section. Fixes #262.
* Performance improvements.

= 0.7.2 / 27 Dec 2012

* Fixed a rendering bug (#274) when using nested higher-order sections.
* Better error reporting on failed parse.
* Converted tests to use mocha instead of vows.

= 0.7.1 / 6 Dec 2012

* Handle empty templates gracefully. Fixes #265, #267, and #270.
* Cache partials by template, not by name. Fixes #257.
* Added Mustache.compileTokens to compile the output of Mustache.parse. Fixes
#258.

= 0.7.0 / 10 Sep 2012

* Rename Renderer => Writer.
* Allow partials to be loaded dynamically using a callback (thanks
@TiddoLangerak for the suggestion).
* Fixed a bug with higher-order sections that prevented them from being
passed the raw text of the section from the original template.
* More concise token format. Tokens also include start/end indices in the
original template.
* High-level API is consistent with the Writer API.
* Allow partials to be passed to the pre-compiled function (thanks
@fallenice).
* Don't use eval (thanks @cweider).

= 0.6.0 / 31 Aug 2012

* Use JavaScript's definition of falsy when determining whether to render an
inverted section or not. Issue #186.
* Use Mustache.escape to escape values inside {{}}. This function may be
reassigned to alter the default escaping behavior. Issue #244.
* Fixed a bug that clashed with QUnit (thanks @kannix).
* Added volo support (thanks @guybedford).
10 changes: 10 additions & 0 deletions builder/lib/Mustache/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The MIT License

Copyright (c) 2009 Chris Wanstrath (Ruby)
Copyright (c) 2010 Jan Lehnardt (JavaScript)

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
Loading

0 comments on commit 57c2f15

Please sign in to comment.