Skip to content

Commit c832ee7

Browse files
committed
v0.12.0 release - gulp support
removed sass from the default offerings updated README with a TON of goodness
1 parent 469a5a8 commit c832ee7

File tree

7 files changed

+77
-49
lines changed

7 files changed

+77
-49
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.12.0
4+
- ADD: Gulp support arrives with an optional configuration
5+
- ADD: Instructions how to install and run with Gulp
6+
- DEL: Deleted the sass modules from `package.json` files
7+
- CHG: Commented out all sass tasks in Grunt and Gulp files
8+
- CHG: Changed static web server provider to BrowserSync
9+
- CHG: Replaced the Style Guide toolbar Auto-Reload and Page Follow with a link to the BrowserSync UI
10+
311
PL-node-v0.11.0
412
- ADD: Ignore pattern directories that start with an underscore.
513
- ADD: Support for lists with the listItems variable

CONTRIBUTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ If you'd like to contribute to patternlab - node, please do so! There is always
44
No pull request is too small.
55

66
##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.
9-
3. If you can, add some unit tests using the existing patterns
7+
1. Please keep your pull requests concise and limited to **ONE** substantive change at a time.
8+
2. _ALWAYS_ submit pull requests 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.
9+
3. If you can, add some unit tests using the existing patterns
10+
11+
##Coding style
12+
Regarding code style like indentation and whitespace, follow the conventions you see used in the source already. Add enough source code comments to help the next person.

README.md

Lines changed: 61 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,59 @@
22

33
## About the Node Version of Pattern Lab
44

5-
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.
5+
The Node version of [Pattern Lab](http://patternlab.io/) is, at its core, a static site generator. It combines platform-agnostic assets, like the Mustache-based patterns, the JavaScript-based viewer, and the self-contained webserver, with a Node-based "builder" that transforms and dynamically builds the Pattern Lab site.
66

7-
### Getting Started
7+
This repository contains the vanilla builder logic, grunt and gulp configurations, and some sample template/css/data to illustrate the powe and flexibility of the tool.
88

9-
To run patternlab-node, run the following from the command line at the root of whichever directory you want to initialize your project in:
9+
### Download
1010

11-
1. `npm install`
12-
2. `npm install -g grunt-cli`
13-
3. `grunt`
11+
* Download the [latest release of patternlab-node](https://github.com/pattern-lab/patternlab-node/releases/latest) from Github
12+
* Via npm, run `npm install patternlab-node` (Note this will auto install the grunt version currently. see below)
1413

15-
This creates all patterns, the styleguide, and the pattern lab site.
14+
### Choose Your Adventure! Now Vanilla, Grunt & Gulp
15+
16+
This repository ships with two `package.json` files, a `Gruntfile.js`, and a `gulpfile.js`. The default is grunt currently. The core builder is not dependent on either.
17+
18+
**HELP WANTED** Please help me test both of the configurations by [reporting](https://github.com/pattern-lab/patternlab-node/blob/dev/CONTRIBUTING.md) any issues encountered.
19+
20+
### Getting Started - Grunt
21+
22+
To run patternlab-node using grunt, do the following in the directory you downloaded and extracted the zipped release:
23+
24+
1. Run `npm install` from the command line
25+
2. Optionally, delete `package.gulp.json`, `gulpfile.js`, and `builder/patternlab_gulp.js` files if you are certain you dont need it.
26+
* Not deleting `builder/patternlab_gulp.js` may cause a harmless error when running grunt. Delete it.
27+
3. Run `grunt` or `grunt serve` from the command line
28+
29+
This creates all patterns, the styleguide, and the pattern lab site. It's strongly recommended to run `grunt serve` to see have BrowserSync spin up and serve the files to you.
30+
31+
### Getting Started - Gulp
32+
33+
To run patternlab-node using gulp, you need to swap out the default grunt configuration. Do the following in the directory you downloaded and extracted the zipped release:
34+
35+
1. Rename `package.json` to `package.grunt.json` or delete it if you don't intend on going back
36+
2. Rename `package.gulp.json` to `package.json`
37+
3. Run `npm install` from the command line
38+
4. Run `gulp` or `gulp serve` from the command line
39+
40+
This creates all patterns, the styleguide, and the pattern lab site. It's strongly recommended to run `grunt serve` to see have BrowserSync spin up and serve the files to you.
41+
42+
### There and Back Again, or Switching Between Grunt and Gulp
43+
44+
It's not expected to toggle between the two build systems, but for those migrating between the two configs, here's some general guidelines:
45+
46+
* Make sure your `package.json` files are correct per the Getting Started sections.
47+
* Run `npm cache clear` before installation
48+
* Delete the contents of `./node_modules` if you want a cleaner installation.
49+
* Regarding speed, Gulp is faster. BrowserSync takes a bit longer than the old static server to spin up, but its capabilities far outweigh the startup cost.
50+
51+
### Upgrading
52+
53+
You can find some simple upgrade documenation in it's current home here (unreleased but confirmed to work): [https://github.com/pattern-lab/website/blob/dev/patternlabsite/docs/node/upgrading.md](https://github.com/pattern-lab/website/blob/dev/patternlabsite/docs/node/upgrading.md)
1654

1755
### Command Line Interface
1856

19-
The following are grunt task arguments you may execute:
57+
The following are grunt/gulp task arguments you may execute:
2058

2159
##### `patternlab`
2260
With no arguments, patternlab runs the full builder, compiling patterns, and constructing the front-end site.
@@ -30,10 +68,15 @@ Retrieve the version of patternlab-node you have installed
3068
##### `patternlab:help`
3169
Get more information about patternlab-node, pattern lab in general, and where to report issues.
3270

33-
### Config Options
71+
### Further Configuration
3472

3573
##### Watching Changes
36-
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.
74+
To have patternlab-node watch for changes to either a mustache template, data, or stylesheets, run `grunt|gulp watch` or `grunt|gulp serve`. The `Gruntfile|Gulpfile` governs what is watched. It should be easy to add scss or whatever preprocessor you fancy.
75+
76+
##### Preprocessor Support
77+
The patternlab-node release package ships with some `.scss` files utilized in the creation of the style guide and sample templates, but these are not required. The compilation tasks are commented out in the `Gruntfiles|Gulpfiles` but can be uncommented or changed to meet your needs. Sass modules are note included in `package.json` files - the prevailing thought being if you are familiar enough with preprocessors, you can use the instructions for [grunt-contrib-sass](https://github.com/gruntjs/grunt-contrib-sass) / [gulp-sass](https://github.com/dlmanning/gulp-sass) / _preprocessor of choice_ to install them.
78+
79+
**NOTE:** You may run into issues installing gulp-sass if you don't have the latest Visual Studio on Windows. See [here](https://github.com/sass/node-sass/issues/469) for more information and [this query](https://github.com/sass/node-sass/issues?utf8=%E2%9C%93&q=is%3Aissue+install) for a slew of installation problems related to gulp-sass.
3780

3881
##### Nav Bar Controls
3982
If you don't have a need for some of the nav-bar tools in the patternlab frontend, you can turn them off in `config.json`.
@@ -99,14 +142,21 @@ If you'd like to exclude an individual pattern you can do so by prepending the f
99142

100143
You can also exclude complete directories by prepending the directory name with an underscore, like: `/_experiment/...`
101144

102-
##### Verbose Mode
145+
##### Debug Mode
103146
`patternlab.json` is a file created for debugging purposes. Set `debug` to true in `.config.json` to see all the secrets.
104147

105148
##### Server & BrowserSync
106149
Running `grunt serve` will compile the patternlab front end and host it by default on <a href="http://localhost:3000">http://localhost:3000</a> via [BrowserSync](http://www.browsersync.io/docs/). After it starts, templates, `data.json`, and scss/css changes in your source code will be automatically injected into the page.
107150

108151
You'll notice that if you have this open across different browsers, we do our best to keep the front end in sync, but there is a known issue with synced navigation using the main menu.
109152

153+
### Roadmap
154+
155+
156+
A roadmap exists for Pattern Lab Node. Check it out [here](https://github.com/pattern-lab/patternlab-node/issues/134). The Node version of Pattern Lab is maintained 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).
157+
158+
Dave Olsen has also 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. Post v1 work will focus on other pattern engines and a plugin architecture.
159+
110160
### Advanced Pattern Library Features
111161

112162
##### Pattern Parameters
@@ -192,37 +242,6 @@ This would compile to:
192242

193243
As you can see, it's a much easier way of linking patterns to one another.
194244

195-
196-
===
197-
198-
The Node version of Pattern Lab is maintained 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).
199-
200-
### Upgrading
201-
202-
You can find some simple upgrade documenation in it's current home here (unreleased but confirmed to work): [https://github.com/pattern-lab/website/blob/dev/patternlabsite/docs/node/upgrading.md](https://github.com/pattern-lab/website/blob/dev/patternlabsite/docs/node/upgrading.md)
203-
204-
### ROADMAP
205-
206-
A roadmap exists for Pattern Lab Node. Check it out [here](https://github.com/pattern-lab/patternlab-node/issues/134)
207-
208-
Dave Olsen has also 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.
209-
210-
### Is Pattern Lab a Platform or a Build Tool?
211-
212-
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.
213-
214-
If you want to only build the patterns, alter your `Gruntfile.js` patternlab task to the following:
215-
216-
```
217-
grunt.registerTask('default', ['clean', 'concat', 'patternlab:only_patterns', /*'sass',*/ 'copy']);
218-
```
219-
220-
This will output compiled patterns to ./public/patterns/
221-
222-
### Where is the Gulp Version?
223-
224-
The core patternlab engine is free of any dependencies to grunt, allowing users to integrate with gulp if desired. Future efforts here will orient towards [this gulp implementation](https://github.com/oscar-g/patternlab-node/tree/dev-gulp) by [oscar-g](https://github.com/oscar-g).
225-
226245
===
227246

228247
## Working with Patterns

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"ignored-extensions" : ["scss", "DS_Store", "less"],
77
"ignored-directories" : ["scss"],
8-
"debug": true,
8+
"debug": false,
99
"ishControlsVisible": {
1010
"s": true,
1111
"m": true,

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Shoutout to oscar-g for starting this at https://github.com/oscar-g/patternlab-node/tree/dev-gulp
1+
// Special thanks to oscar-g (https://github.com/oscar-g) for starting this at https://github.com/oscar-g/patternlab-node/tree/dev-gulp
22

33
var pkg = require('./package.json'),
44
gulp = require('gulp'),

package.gulp.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"gulp-header": "^1.0.5",
1515
"gulp-load": "^0.1.1",
1616
"gulp-nodeunit": "0.0.5",
17-
"gulp-sass": "^0.7.3",
1817
"gulp-strip-banner": "0.0.2",
1918
"html-entities": "^1.1.1",
2019
"mustache": "^1.0.0"

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"grunt-contrib-concat": "^0.5.0",
1313
"grunt-contrib-copy": "^0.7.0",
1414
"grunt-contrib-nodeunit": "^0.4.1",
15-
"grunt-contrib-sass": "^0.8.1",
1615
"grunt-contrib-watch": "^0.6.1",
1716
"html-entities": "^1.1.1",
1817
"matchdep": "^0.3.0",

0 commit comments

Comments
 (0)