Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit 6485118

Browse files
Merge pull request #3 from pattern-lab/3.0
Pattern Lab Node Edition 1.0.0-alpha.1
2 parents 4460334 + 1c7c67a commit 6485118

File tree

17 files changed

+175
-59
lines changed

17 files changed

+175
-59
lines changed

README.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,61 @@
1+
![Pattern Lab Logo](/patternlab.png "Pattern Lab Logo")
2+
3+
![current release](https://img.shields.io/github/release/pattern-lab/edition-node.svg) ![license](https://img.shields.io/github/license/pattern-lab/edition-node.svg)[![Join the chat at Gitter](https://badges.gitter.im/pattern-lab/node.svg)](https://gitter.im/pattern-lab/node)
4+
15
# Pattern Lab Node
26

37
The pure wrapper around [Pattern Lab Node Core](https://github.com/pattern-lab/patternlab-node), the default pattern engine, and supporting frontend assets.
48

9+
[Online Demo of Pattern Lab Output](http://demo.patternlab.io/)
10+
511
## Packaged Components
612

7-
The Gulp Edition comes with the following components:
13+
This Edition comes with the following components:
814

9-
* `patternlab-node`: [GitHub](https://github.com/pattern-lab/patternlab-node), [npm](https://www.npmjs.com/package/patternlab-node)
10-
* `patternengine-node-mustache`: [GitHub](https://github.com/pattern-lab/patternengine-node-mustache), [npm](https://www.npmjs.com/package/patternengine-node-mustache)
11-
* `pattern-lab/styleguidekit-assets-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-assets-default)
12-
* `pattern-lab/styleguidekit-mustache-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-mustache-default)
15+
* `pattern-lab/patternlab-node`: [GitHub](https://github.com/pattern-lab/patternlab-node) | [npm](https://www.npmjs.com/package/@pattern-lab/patternlab-node)
16+
* `pattern-lab/patternengine-node-mustache`: [GitHub](https://github.com/pattern-lab/patternengine-node-mustache) | [npm](https://www.npmjs.com/package/@pattern-lab/patternengine-node-mustache)
17+
* `pattern-lab/styleguidekit-assets-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-assets-default) | [npm](https://www.npmjs.com/package/@pattern-lab/styleguidekit-assets-default)
18+
* `pattern-lab/styleguidekit-mustache-default`: [GitHub](https://github.com/pattern-lab/styleguidekit-mustache-default) | [npm](https://www.npmjs.com/package/@pattern-lab/styleguidekit-mustache-default)
1319

1420
## Prerequisites
1521

16-
The Pattern Lab Node uses [Node](https://nodejs.org) for core processing, [npm](https://www.npmjs.com/) to manage project dependencies, and [gulp.js](http://gulpjs.com/) to run tasks and interface with the core library. Node version 4 or higher suffices. You can follow the directions for [installing Node](https://nodejs.org/en/download/) on the Node website if you haven't done so already. Installation of Node will include npm.
22+
The Pattern Lab Node uses [Node](https://nodejs.org) for core processing and [npm](https://www.npmjs.com/) to manage project dependencies. You can follow the directions for [installing Node](https://nodejs.org/en/download/) on the Node website if you haven't done so already. Installation of Node will include npm.
1723

1824
## Installing
1925

20-
Forthcoming
26+
Pattern Lab Node can be used different ways. Editions lilke this one are **example** pairings of Pattern Lab code and do not always have an upgrade path or simple means to run as a dependency within a larger project. Users wishing to be most current and have the greatest flexibility are encouraged to consume `patternlab-node` directly. Users wanting to learn more about Pattern Lab and have a tailored default experience are encouraged to start with an Edition. Both methods still expect to interact with other elements of the [Pattern Lab Ecosystem](https://github.com/pattern-lab/patternlab-node#ecosystem).
27+
28+
As an edition, the simplist installation sequence is to clone this repository.
29+
30+
``` bash
31+
mkdir newApp && cs newApp
32+
git clone https://github.com/pattern-lab/edition-node.git
33+
npm install
34+
```
2135

2236
## Getting Started
2337

24-
Forthcoming
38+
This edition comes pre-packaged with a couple simple scripts. Extend them as needed.
39+
40+
**build** patterns, copy assets, and construct ui
41+
42+
``` bash
43+
npm run build
44+
```
45+
46+
build patterns, copy assets, and construct ui, watch source files, and **serve** locally
47+
48+
``` bash
49+
npm run serve
50+
```
51+
52+
logs Pattern Lab Node usage and **help** content
53+
54+
``` bash
55+
npm run help
56+
```
57+
58+
To interact further with Pattern Lab Node, such as to install plugins or starterkits, it's suggested to incorporate the [Pattern Lab Node Command Line Interface](https://github.com/pattern-lab/patternlab-node-cli) or learn more about the [core API](https://github.com/pattern-lab/patternlab-node#usage).
2559

2660
## Updating Pattern Lab
2761

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "edition-node",
33
"description": "A pure wrapper around patternlab-node core, the default pattern engine, and supporting frontend assets.",
4-
"version": "0.0.1",
4+
"version": "1.0.0-alpha.1",
55
"dependencies": {
6-
"patternlab-node": "^2.0.0",
7-
"patternengine-node-mustache": "^1.0.0",
8-
"styleguidekit-assets-default": "^3.0.0",
9-
"styleguidekit-mustache-default": "^3.0.0"
6+
"@pattern-lab/patternengine-node-mustache": "^2.0.0-alpha.1",
7+
"@pattern-lab/patternlab-node": "^3.0.0-alpha.5",
8+
"@pattern-lab/styleguidekit-assets-default": "^4.0.0-alpha.2",
9+
"@pattern-lab/styleguidekit-mustache-default": "^4.0.0-alpha.1"
1010
},
1111
"keywords": [
1212
"Pattern Lab",
@@ -21,10 +21,12 @@
2121
"bugs": "https://github.com/pattern-lab/edition-node/issues",
2222
"author": "Brian Muenzenmeyer",
2323
"scripts": {
24-
"postinstall": "node scripts/postinstall.js"
24+
"build": "node ./scripts/build.js",
25+
"help": "node ./scripts/help.js",
26+
"serve": "node ./scripts/serve.js"
2527
},
2628
"license": "MIT",
2729
"engines": {
28-
"node": ">=4.0"
30+
"node": ">=6.0"
2931
}
3032
}

patternlab-config.json

Lines changed: 51 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,51 @@
11
{
2+
"cacheBust": true,
3+
"cleanPublic" : true,
4+
"defaultPattern": "all",
5+
"defaultShowPatternInfo": false,
6+
"ishControlsHide": {
7+
"s": false,
8+
"m": false,
9+
"l": false,
10+
"full": false,
11+
"random": false,
12+
"disco": false,
13+
"hay": true,
14+
"mqs": false,
15+
"find": false,
16+
"views-all": false,
17+
"views-annotations": false,
18+
"views-code": false,
19+
"views-new": false,
20+
"tools-all": false,
21+
"tools-docs": false
22+
},
23+
"ishViewportRange": {
24+
"s": [240, 500],
25+
"m": [500, 800],
26+
"l": [800, 2600]
27+
},
28+
"logLevel": "info",
29+
"outputFileSuffixes": {
30+
"rendered": ".rendered",
31+
"rawTemplate": "",
32+
"markupOnly": ".markup-only"
33+
},
234
"paths" : {
335
"source" : {
436
"root": "./source/",
537
"patterns" : "./source/_patterns/",
638
"data" : "./source/_data/",
739
"meta": "./source/_meta/",
840
"annotations" : "./source/_annotations/",
9-
"styleguide" : "./node_modules/styleguidekit-assets-default/dist/",
10-
"patternlabFiles" : "./node_modules/styleguidekit-mustache-default/views/",
41+
"styleguide" : "./node_modules/@pattern-lab/styleguidekit-assets-default/dist/",
42+
"patternlabFiles" : {
43+
"general-header": "./node_modules/@pattern-lab/styleguidekit-mustache-default/views/partials/general-header.mustache",
44+
"general-footer": "./node_modules/@pattern-lab/styleguidekit-mustache-default/views/partials/general-footer.mustache",
45+
"patternSection": "./node_modules/@pattern-lab/styleguidekit-mustache-default/views/partials/patternSection.mustache",
46+
"patternSectionSubtype": "./node_modules/@pattern-lab/styleguidekit-mustache-default/views/partials/patternSectionSubtype.mustache",
47+
"viewall": "./node_modules/@pattern-lab/styleguidekit-mustache-default/views/viewall.mustache"
48+
},
1149
"js" : "./source/js",
1250
"images" : "./source/images",
1351
"fonts" : "./source/fonts",
@@ -25,45 +63,19 @@
2563
"css" : "./public/css"
2664
}
2765
},
28-
"styleGuideExcludes": [
29-
],
30-
"defaultPattern": "all",
31-
"defaultShowPatternInfo": false,
32-
"cleanPublic" : true,
3366
"patternExtension": "mustache",
34-
"ignored-extensions" : ["scss", "DS_Store", "less"],
35-
"ignored-directories" : ["scss"],
36-
"debug": false,
37-
"ishControlsHide": {
38-
"s": false,
39-
"m": false,
40-
"l": false,
41-
"full": false,
42-
"random": false,
43-
"disco": false,
44-
"hay": true,
45-
"mqs": false,
46-
"find": false,
47-
"views-all": false,
48-
"views-annotations": false,
49-
"views-code": false,
50-
"views-new": false,
51-
"tools-all": false,
52-
"tools-docs": false
53-
},
54-
"ishMinimum": "240",
55-
"ishMaximum": "2600",
5667
"patternStateCascade": ["inprogress", "inreview", "complete"],
57-
"patternStates": {
58-
},
59-
"patternExportPatternPartials": [],
6068
"patternExportDirectory": "./pattern_exports/",
61-
"cacheBust": true,
62-
"starterkitSubDir": "dist",
63-
"outputFileSuffixes": {
64-
"rendered": ".rendered",
65-
"rawTemplate": "",
66-
"markupOnly": ".markup-only"
69+
"patternExportPatternPartials": [],
70+
"serverOptions": {
71+
"wait": 1000
6772
},
68-
"cleanOutputHtml": true
73+
"starterkitSubDir": "dist",
74+
"styleGuideExcludes": [
75+
],
76+
"theme": {
77+
"color": "dark",
78+
"density": "compact",
79+
"layout": "horizontal"
80+
}
6981
}

patternlab.png

11.4 KB
Loading

scripts/build.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
This is another simple example, which we wrapped with an `npm` script inside package.json
3+
*/
4+
const config = require('./../patternlab-config.json');
5+
const patternlab = require('@pattern-lab/patternlab-node')(config);
6+
7+
patternlab.build(() => {
8+
// use the callback
9+
}, {
10+
cleanPublic: true
11+
}).then(() => {
12+
// or do something else when this promise resolves
13+
});

scripts/help.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
This is another simple example, which we wrapped with an `npm` script inside package.json
3+
*/
4+
const config = require('./../patternlab-config.json');
5+
const patternlab = require('@pattern-lab/patternlab-node')(config);
6+
7+
patternlab.help();

scripts/postinstall.js

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

scripts/serve.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
This is another simple example, which we wrapped with an `npm` script inside package.json
3+
*/
4+
const config = require('./../patternlab-config.json');
5+
const patternlab = require('@pattern-lab/patternlab-node')(config);
6+
7+
patternlab.serve(() => {
8+
// use the callback
9+
}, {
10+
cleanPublic: true,
11+
}).then(() => {
12+
// or do something else when this promise resolves
13+
});

source/_annotations/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This is the default location to place annotations.
2+
3+
Pattern Lab uses annotations defined here to markup the UI. Read more about [annotations](http://patternlab.io/docs/pattern-adding-annotations.html).
4+
5+
If you wish to rename this directory, make sure you update the `paths.source.annotations` property within `patternlab-config.json`.

source/_data/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This is the default location to place global data files.
2+
3+
Pattern Lab uses data defined here as the global fallback if a template does not provide its own data. Read more about [data](http://patternlab.io/docs/data-overview.html).
4+
5+
If you wish to rename this directory, make sure you update the `paths.source.data` property within `patternlab-config.json`.

0 commit comments

Comments
 (0)