Skip to content

Commit 31a5d63

Browse files
Merge pull request #779 from pattern-lab/dev
Pattern Lab Node v3.0.0-alpha.7
2 parents 4645d55 + b932f14 commit 31a5d63

File tree

85 files changed

+8493
-4958
lines changed

Some content is hidden

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

85 files changed

+8493
-4958
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:

.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: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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+
[![Join the chat at Gitter](https://badges.gitter.im/pattern-lab/node.svg)](https://gitter.im/pattern-lab/node)
45

56
# Pattern Lab Node Core
67

@@ -39,7 +40,7 @@ For users wanting a more pre-packaged experience several editions are available.
3940
* [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.
4041
* [Pattern Lab/Node: Vanilla Edition](https://github.com/pattern-lab/edition-node) contains info how to get started within a pure node environment.
4142
* [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!
43+
> Thanks to the team at Comcast for open-sourcing this stellar work!
4344
4445
## Ecosystem
4546

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

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

54-
``` javascript
55-
55+
```javascript
5656
const config = require('./patternlab-config.json');
5757
const patternlab = require('patternlab-node')(config);
5858

5959
// build, optionally watching or choosing incremental builds
6060
patternlab.build({
6161
cleanPublic: true,
62-
watch: true
62+
watch: true,
6363
});
6464

6565
// or build, watch, and then self-host
6666
patternlab.serve({
67-
cleanPublic: true
67+
cleanPublic: true,
6868
});
69-
7069
```
7170

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

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

78-
7977
### Events
8078

8179
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.
8280

83-
``` javascript
84-
81+
```javascript
8582
patternlab.serve(...);
8683

8784
patternlab.events.on('patternlab-asset-change', (data) => {
@@ -95,21 +92,20 @@ patternlab.events.on('patternlab-pattern-change', (data) => {
9592
patternlab.events.on('patternlab-global-change', (data) => {
9693
console.log(data); // {file: 'path/to/file.ext'}
9794
});
98-
9995
```
10096

10197
## Development Installation / Workflow
10298

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

105-
``` bash
101+
```bash
106102
mkdir /patternlab-node
107103
cd /patternlab-node
108104
git clone https://github.com/pattern-lab/patternlab-node.git
109105
npm install
110106
npm link
111107
cd location/of/editionOrSourceAndConfig
112-
npm link patternlab-node
108+
npm link @pattern-lab/patternlab-node
113109
```
114110

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

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

136-
137132
## Core Team
138133

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

0 commit comments

Comments
 (0)