Skip to content

Commit 2b6354a

Browse files
committed
Merge branch 'dev' into docs
2 parents cfc83d3 + 0fc9bd7 commit 2b6354a

File tree

105 files changed

+13866
-8578
lines changed

Some content is hidden

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

105 files changed

+13866
-8578
lines changed

.eslintrc

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,19 @@
99
"sourceType": "module"
1010
},
1111
"globals": {},
12+
"extends": ["prettier"],
13+
"plugins": ["prettier"],
1214
"rules": {
15+
"prettier/prettier": "error",
1316
"block-scoped-var": 0,
1417
"camelcase": 0,
15-
"comma-spacing": [1, {"before": false, "after": true}],
1618
"consistent-return": 2,
1719
"curly": [2, "all"],
1820
"dot-notation": [1, { "allowKeywords": true }],
1921
"eqeqeq": [2, "allow-null"],
2022
"global-strict": [0, "never"],
2123
"guard-for-in": 2,
22-
"indent": [1, 2, {"SwitchCase": 1, "VariableDeclarator": 1}],
23-
"lines-around-comment": [1, {
24-
"beforeBlockComment": true,
25-
"beforeLineComment": true,
26-
"allowBlockStart": true,
27-
"allowObjectStart": true,
28-
"allowArrayStart": true
29-
}],
3024
"key-spacing": 0,
31-
"keyword-spacing": 1,
3225
"new-cap": 0,
3326
"no-alert": 2,
3427
"no-bitwise": 2,
@@ -42,7 +35,6 @@
4235
"no-extend-native": 2,
4336
"no-extra-bind": 2,
4437
"no-extra-parens": 0,
45-
"no-extra-semi": 2,
4638
"no-func-assign": 2,
4739
"no-implied-eval": 2,
4840
"no-invalid-regexp": 2,
@@ -51,7 +43,6 @@
5143
"no-loop-func": 2,
5244
"no-mixed-requires": 0,
5345
"no-multi-str": 2,
54-
"no-multi-spaces": 1,
5546
"no-native-reassign": 2,
5647
"no-new": 2,
5748
"no-param-reassign": 1,
@@ -69,24 +60,19 @@
6960
"no-use-before-define": 1,
7061
"no-useless-call": 2,
7162
"no-useless-concat": 2,
63+
"no-var": 2,
7264
"no-with": 2,
7365
"quotes": [0, "single"],
7466
"radix": 2,
75-
"semi": [1, "always"],
7667
"strict": 0,
77-
"space-before-blocks": 1,
78-
"space-before-function-paren": [1, {
79-
"anonymous": "always",
80-
"named": "never"
81-
}],
82-
"space-in-parens": [1, "never"],
83-
"space-infix-ops": 1,
8468
"valid-typeof": 2,
8569
"vars-on-top": 0,
86-
"wrap-iife": [2, "inside"],
87-
"prefer-const": ["error", {
88-
"destructuring": "any",
89-
"ignoreReadBeforeAssign": false
90-
}]
70+
"prefer-const": [
71+
"error",
72+
{
73+
"destructuring": "any",
74+
"ignoreReadBeforeAssign": false
75+
}
76+
]
9177
}
9278
}

.github/CONTRIBUTING.md

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,53 @@
1-
Contributing to Pattern Lab Node
2-
================================
1+
# Contributing to Pattern Lab Node
32

43
If you'd like to contribute to Pattern Lab Node, please do so! There is always a lot of ground to cover and something for your wheelhouse.
54

65
No pull request is too small. Check out any [up for grabs issues](https://github.com/pattern-lab/patternlab-node/labels/up%20for%20grabs) as a good way to get your feet wet, or add some more unit tests.
76

8-
Developing Locally
9-
------------------
7+
## Developing Locally
108

119
The best way to make changes to the Pattern Lab Node core and test them is through your existing edition.
1210

13-
- Fork this repository on Github.
14-
- Create a new branch in your fork and push your changes in that fork.
15-
- `npm install`
16-
- `npm link`
17-
- `cd /path/to/your/edition`
18-
- `npm link patternlab-node`
11+
* Fork this repository on Github.
12+
* Create a new branch in your fork and push your changes in that fork.
13+
* `npm install`
14+
* `npm link`
15+
* `cd /path/to/your/edition`
16+
* `npm link patternlab-node`
1917

20-
Guidelines
21-
----------
18+
## Guidelines
2219

23-
- *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, attempt to redirect the target branch myself, thirdly, port over your contribution manually if time allows, and/or lastly, close your pull request. If you have a major feature to stabilize over time, talk to @bmuenzenmeyer via an issue about making a dedicated `feature-branch`
24-
- Keep your pull requests concise and limited to **ONE** substantive change at a time. This makes reviewing and testing so much easier.
25-
- Commits should reference the issue you are adressing. For any Pull Request that you send, use the template provided.
26-
- Commits are best formatted using the [conventional commits pattern](https://conventionalcommits.org/).
27-
- If you can, add some unit tests using the existing patterns in the `./test` directory
28-
- Large enhancements should begin with opening an issue. This will result in a more systematic way for us to review your contribution and determine if a [specifcation discussion](https://github.com/pattern-lab/the-spec/issues) needs to occur.
29-
- Mention the issue number in commits, so anyone can see to which issue your changes belong to. For instance:
30-
- `#123 Fix resolving patterns in pattern_hunter`
31-
- `Feature #42: improve improbability drive`
20+
* _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, attempt to redirect the target branch myself, thirdly, port over your contribution manually if time allows, and/or lastly, close your pull request. If you have a major feature to stabilize over time, talk to @bmuenzenmeyer via an issue about making a dedicated `feature-branch`
21+
* Keep your pull requests concise and limited to **ONE** substantive change at a time. This makes reviewing and testing so much easier.
22+
* Commits should reference the issue you are adressing. For any Pull Request that you send, use the template provided.
23+
* Commits are best formatted using the [conventional commits pattern](https://conventionalcommits.org/).
24+
* If you can, add some unit tests using the existing patterns in the `./test` directory
25+
* Large enhancements should begin with opening an issue. This will result in a more systematic way for us to review your contribution and determine if a [specifcation discussion](https://github.com/pattern-lab/the-spec/issues) needs to occur.
26+
* Mention the issue number in commits, so anyone can see to which issue your changes belong to. For instance:
27+
* `#123 Fix resolving patterns in pattern_hunter`
28+
* `Feature #42: improve improbability drive`
3229

33-
Coding style
34-
------------
30+
## Coding style
3531

36-
Two files combine within the project to define and maintain our coding style.
32+
Formatting is automated via [Prettier](https://prettier.io/), setup to run on precommit. We suggest [editor integration](https://prettier.io/docs/en/editors.html) for this and for eslint. Prettier is further configured within `.prettierrc`. Eslint validates syntax and usage that Prettier doesn't handle. Configuration for both is found within the `.eslintrc` file.
3733

38-
- The `.editorconfig` controls spaces / tabs within supported editors. Check out their [site](http://editorconfig.org/).
39-
- The `.eslintrc` defines our javascript standards. Some editors will evaluate this real-time - otherwise it's run using `grunt|gulp build`
34+
The `.editorconfig` controls spaces / tabs within supported editors. Check out their [site](http://editorconfig.org/).
4035

41-
Tests
42-
-----
36+
## Tests
4337

4438
Add unit and integration tests if you can. It's always nice if our code coverage improves bit by bit (literally!). We are using [Node Tap](http://www.node-tap.org/) as test framework and [Rewire](https://github.com/jhnns/rewire) for mocking things like file system access.
4539

46-
Branching Scheme
47-
----------------
40+
## Branching Scheme
4841

4942
![branching scheme](branching-scheme.png) Currently Pattern Lab has the following branches:
5043

51-
- **master** contains the latext stable, released version</dd>
52-
- **dev**: for development. *Target pull requests against this branch.*
53-
- **feature-branches** for larger changes. Allows merging all changes into both `dev` easily.
54-
- **long running branches** for changes that involve major changes to the code, architecture and take a lot of time (i.e. making Pattern Lab async)
44+
* **master** contains the latext stable, released version</dd>
45+
* **dev**: for development. _Target pull requests against this branch._
46+
* **feature-branches** for larger changes. Allows merging all changes into both `dev` easily.
47+
* **long running branches** for changes that involve major changes to the code, architecture and take a lot of time (i.e. making Pattern Lab async)
5548

5649
New features are typically cut off of `dev` branch. When `dev` is stable cut releases by merging `dev` to `master` and creating a release tag.
5750

58-
Gitter.im Chat
59-
==============
51+
# Gitter.im Chat
6052

6153
If you have any questions or you would like to help, feel free to ask on [our Gitter.im channel](https://gitter.im/pattern-lab/node) :smiley:

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<!-- before posting an issue, try chatting on https://gitter.im/pattern-lab/node -->
2-
<!-- before posting an issue, verify you are running at least Node 4 or 5 -->
32

4-
I am using Pattern Lab Node `vX.X.X` on `Windows | Mac | Linux`, with Node `vX.X.X`, using the `Gulp | Grunt ` Edition.
3+
<!-- before posting an issue, verify you are running at least Node 6 -->
54

6-
##### Expected Behavior
5+
I am using Pattern Lab Node `vX.X.X` on `Windows | Mac | Linux`, with Node `vX.X.X`, using the `Gulp | Grunt` Edition.
76

7+
##### Expected Behavior
88

99
##### Actual Behavior
1010

11-
1211
##### Steps to Reproduce

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.11.3
1+
8.9.4

.prettierrc

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

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
![Pattern Lab Logo](/patternlab.png "Pattern Lab Logo")
1+
![Pattern Lab Logo](/patternlab.png 'Pattern Lab Logo')
22

3-
[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.svg?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) ![current release](https://img.shields.io/github/release/pattern-lab/patternlab-node.svg) ![license](https://img.shields.io/github/license/pattern-lab/patternlab-node.svg) [![Coverage Status](https://coveralls.io/repos/github/pattern-lab/patternlab-node/badge.svg?branch=master)](https://coveralls.io/github/pattern-lab/patternlab-node?branch=master) [![Join the chat at Gitter](https://badges.gitter.im/pattern-lab/node.svg)](https://gitter.im/pattern-lab/node)
3+
[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.svg?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) ![current release](https://img.shields.io/npm/v/@pattern-lab/patternlab-node.svg) ![license](https://img.shields.io/github/license/pattern-lab/patternlab-node.svg) [![Coverage Status](https://coveralls.io/repos/github/pattern-lab/patternlab-node/badge.svg?branch=master)](https://coveralls.io/github/pattern-lab/patternlab-node?branch=master) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
4+
[![node (scoped)](https://img.shields.io/node/v/@pattern-lab/patternlab-node.svg)]()
5+
[![Join the chat at Gitter](https://badges.gitter.im/pattern-lab/node.svg)](https://gitter.im/pattern-lab/node)
46

57
# Pattern Lab Node Core
68

@@ -39,7 +41,7 @@ For users wanting a more pre-packaged experience several editions are available.
3941
* [Pattern Lab/Node: Grunt Edition](https://github.com/pattern-lab/edition-node-grunt) contains info how to get started within a Grunt task running environment.
4042
* [Pattern Lab/Node: Vanilla Edition](https://github.com/pattern-lab/edition-node) contains info how to get started within a pure node environment.
4143
* [Pattern Lab/Node: Webpack Edition](https://github.com/Comcast/patternlab-edition-node-webpack) contains info how to get started within a webpack environment.
42-
>Thanks to the team at Comcast for open-sourcing this stellar work!
44+
> Thanks to the team at Comcast for open-sourcing this stellar work!
4345
4446
## Ecosystem
4547

@@ -51,22 +53,20 @@ Core, and Editions, are part of the [Pattern Lab Ecosystem](http://patternlab.io
5153

5254
`patternlab-node` can be required within any Node environment, taking in a configuration file at instantiation.
5355

54-
``` javascript
55-
56+
```javascript
5657
const config = require('./patternlab-config.json');
5758
const patternlab = require('patternlab-node')(config);
5859

5960
// build, optionally watching or choosing incremental builds
6061
patternlab.build({
6162
cleanPublic: true,
62-
watch: true
63+
watch: true,
6364
});
6465

6566
// or build, watch, and then self-host
6667
patternlab.serve({
67-
cleanPublic: true
68+
cleanPublic: true,
6869
});
69-
7070
```
7171

7272
* Read more about [configuration](http://patternlab.io/docs/advanced-config-options.html#node) via `patternlab-config.json`.
@@ -75,13 +75,11 @@ patternlab.serve({
7575

7676
* A full-featured [command line interface](https://github.com/pattern-lab/patternlab-node-cli) is also available courtesy of [@raphaelokon](https://github.com/raphaelokon).
7777

78-
7978
### Events
8079

8180
Many [events](https://github.com/pattern-lab/patternlab-node/wiki/Creating-Plugins#events) are emitted during Pattern Lab operations, originally built to support plugins. Below is a sample, allowing users to be informed of asset or pattern changes.
8281

83-
``` javascript
84-
82+
```javascript
8583
patternlab.serve(...);
8684

8785
patternlab.events.on('patternlab-asset-change', (data) => {
@@ -95,21 +93,20 @@ patternlab.events.on('patternlab-pattern-change', (data) => {
9593
patternlab.events.on('patternlab-global-change', (data) => {
9694
console.log(data); // {file: 'path/to/file.ext'}
9795
});
98-
9996
```
10097

10198
## Development Installation / Workflow
10299

103100
If you are interested in [contributing to Pattern Lab](https://github.com/pattern-lab/patternlab-node/blob/master/.github/CONTRIBUTING.md), it's suggested to install an Edition of your choice and then run a local copy of this repository via [`npm link`](https://docs.npmjs.com/cli/link).
104101

105-
``` bash
102+
```bash
106103
mkdir /patternlab-node
107104
cd /patternlab-node
108105
git clone https://github.com/pattern-lab/patternlab-node.git
109106
npm install
110107
npm link
111108
cd location/of/editionOrSourceAndConfig
112-
npm link patternlab-node
109+
npm link @pattern-lab/patternlab-node
113110
```
114111

115112
The above is a bit verbose, but illustrates:
@@ -133,7 +130,6 @@ If you'd like to contribute to Pattern Lab Node, please do so! There is always a
133130

134131
Please read the guidelines: https://github.com/pattern-lab/patternlab-node/blob/master/.github/CONTRIBUTING.md
135132

136-
137133
## Core Team
138134

139135
* [@bmuenzenmeyer](https://github.com/bmuenzenmeyer) - Lead Maintainer

0 commit comments

Comments
 (0)