diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 3e44b6493..aee9a60ce 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,29 +1,61 @@ -# Contributing to Pattern Lab Node +Contributing to Pattern Lab Node +================================ + 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. 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. -## Developing Locally +Developing Locally +------------------ The best way to make changes to the Pattern Lab Node core and test them is through your existing edition. -* Fork this repository on Github. -* Create a new branch in your fork and push your changes in that fork. -* `npm install` -* `npm link` -* `cd /path/to/your/edition` -* `npm link patternlab-node` +- Fork this repository on Github. +- Create a new branch in your fork and push your changes in that fork. +- `npm install` +- `npm link` +- `cd /path/to/your/edition` +- `npm link patternlab-node` + +Guidelines +---------- + +- *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` +- Keep your pull requests concise and limited to **ONE** substantive change at a time. This makes reviewing and testing so much easier. +- Commits should reference the issue you are adressing. For any Pull Request that you send, use the template provided. +- Commits are best formatted using the [conventional commits pattern](https://conventionalcommits.org/). +- If you can, add some unit tests using the existing patterns in the `./test` directory +- 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. +- Mention the issue number in commits, so anyone can see to which issue your changes belong to. For instance: + - `#123 Fix resolving patterns in pattern_hunter` + - `Feature #42: improve improbability drive` + +Coding style +------------ -## Guidelines +Two files combine within the project to define and maintain our coding style. -* _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. If you have a major feature to stabilize over time, talk to @bmuenzenmeyer via an issue about making a dedicated `feature-branch` -* Please keep your pull requests concise and limited to **ONE** substantive change at a time. This makes reviewing and testing so much easier. -* Commits should reference the issue you are adressing. For any Pull Request that you send, use the template provided. -* If you can, add some unit tests using the existing patterns in the `./test` directory -* 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. +- The `.editorconfig` controls spaces / tabs within supported editors. Check out their [site](http://editorconfig.org/). +- The `.eslintrc` defines our javascript standards. Some editors will evaluate this real-time - otherwise it's run using `grunt|gulp build` -## Coding style -Two files combine within the project to define and maintain our coding style. +Tests +----- + +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. + +Branching Scheme +---------------- + +![branching scheme](branching-scheme.png) Currently Pattern Lab has the following branches: + +- **master** contains the latext stable, released version +- **dev**: for development. *Target pull requests against this branch.* +- **feature-branches** for larger changes. Allows merging all changes into both `dev` easily. +- **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) + +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. + +Gitter.im Chat +============== -* The `.editorconfig` controls spaces / tabs within supported editors. Check out their [site](http://editorconfig.org/). -* The `.eslintrc` defines our javascript standards. Some editors will evaluate this real-time - otherwise it's run using `grunt|gulp build` +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: diff --git a/.github/branching-scheme.png b/.github/branching-scheme.png new file mode 100644 index 000000000..9d7b7628a Binary files /dev/null and b/.github/branching-scheme.png differ diff --git a/.github/gitgraph/README.md b/.github/gitgraph/README.md new file mode 100644 index 000000000..02cc14ca4 --- /dev/null +++ b/.github/gitgraph/README.md @@ -0,0 +1,8 @@ +Generating a new graph +====================== + +This folder uses http://gitgraphjs.com/ for generating the git graph model. + +1. Change `patternlab-flow.js` to your needs according to the documentation on http://gitgraphjs.com/ +2. Open branching-scheme.html in browse, right click the graph and "Save as...". +3. Overwrite `/.github/branching-scheme.png` diff --git a/.github/gitgraph/branching-scheme.html b/.github/gitgraph/branching-scheme.html new file mode 100644 index 000000000..32d2ffb80 --- /dev/null +++ b/.github/gitgraph/branching-scheme.html @@ -0,0 +1,17 @@ + + +
+ + + + + + + + + diff --git a/.github/gitgraph/patternlab-flow.js b/.github/gitgraph/patternlab-flow.js new file mode 100644 index 000000000..79872b09a --- /dev/null +++ b/.github/gitgraph/patternlab-flow.js @@ -0,0 +1,212 @@ +var graphConfig = new GitGraph.Template({ + colors: [ "#9993FF", "#47E8D4", "#6BDB52", "#F85BB5", "#FFA657", "#FFCCAA", "#F85BB5" ], + branch: { + lineWidth: 3, + spacingX: 60, + mergeStyle: "straight", + showLabel: true, // display branch names on graph + labelFont: "normal 10pt Arial", + labelRotation: 0, + color: "black" + }, + commit: { + spacingY: -30, + dot: { + size: 8, + strokeColor: "#000000", + strokeWidth: 4 + }, + tag: { + font: "normal 10pt Arial", + color: "yellow" + }, + message: { + color: "black", + font: "normal 12pt Arial", + displayAuthor: false, + displayBranch: false, + displayHash: false, + } + }, + arrow: { + size: 8, + offset: 3, + + } +}); + +var config = { + template: graphConfig, + mode: "extended", + orientation: "horizontal" +}; + +var bugFixCommit = { + messageAuthorDisplay: false, + messageBranchDisplay: false, + messageHashDisplay: false, + message: "Bug fix commit(s)" +}; + +var stabilizationCommit = { + messageAuthorDisplay: false, + messageBranchDisplay: false, + messageHashDisplay: false, + message: "Release stabilization commit(s)" +}; + +// You can manually fix columns to control the display. +var i = 0; +var longRunningCol = i++; +var featureV3Col = i++; +var developV3Col = i++; +var featureCol = i++; +var developCol = i++; +var releaseCol = i++; +var masterCol = i++; + +var gitgraph = new GitGraph(config); + +var master = gitgraph.branch({ + name: "master", + column: masterCol +}); +master.commit("Initial commit"); + +var develop = gitgraph.branch({ + parentBranch: master, + name: "dev", + column: developCol +}); + +var developV3 = gitgraph.branch({ + parentBranch: master, + name: "dev-3.0", + column: developV3Col +}); + + +var longRunning = gitgraph.branch({ + parentBranch: master, + name: "long-running-improvement", + column: longRunningCol +}); + +develop.commit({ + messageDisplay: false +}); +developV3.commit({ + messageDisplay: false +}); + +longRunning.commit({ + messageDisplay: false +}); +longRunning.merge(developV3); + +var feature1 = gitgraph.branch({ + parentBranch: develop, + name: "feature/1-description", + column: featureCol +}); +feature1.commit("#1 A feature to go into v2.8.0").commit({ + messageDisplay: false +}); +develop.merge(feature1); +feature1.commit("Small Bugfix").commit({ + messageDisplay: false +}); +feature1.merge(develop); + + +var feature3X = gitgraph.branch({ + parentBranch: developV3, + name: "feature/42-feature-for-3-x-only", + column: featureV3Col +}); +feature3X.commit("#42 A feature to go into v3.X").commit({ + messageDisplay: false +}); +feature3X.merge(developV3); + + +var feature2 = gitgraph.branch({ + parentBranch: develop, + name: "feature/2-description", + column: featureCol +}); +feature2.commit("#2 Another feature to go into v2.8.0").commit({ + messageDisplay: false +}); +feature2.merge(develop); +feature2.merge(developV3); + +develop.merge(master,{ + dotStrokeWidth: 10, + message: "Release v2.8.1 tagged", + tag: "v2.8.1" +}); + + +develop.commit({ + messageDisplay: false +}); + + +longRunning.commit({ + messageDisplay: false +}); + +developV3.merge(longRunning); + +longRunning.commit({ + messageDisplay: false +}); + +var feature3 = gitgraph.branch({ + parentBranch: develop, + name: "bugfix/3-description", + column: featureCol +}); + +feature3.commit("A feature to go into v2.8.0").commit({ + messageDisplay: false +}); +feature3.merge(develop); + +longRunning.merge(developV3); + +developV3.commit({ + messageDisplay: false, + dotStrokeWidth: 10 +}); + + +develop.commit({ + messageDisplay: false +}); + +develop.commit({ + messageDisplay: false +}); + +develop.merge(master, { + dotStrokeWidth: 10, + message: "Release v2.9.0 tagged", + tag: "v2.9.0" +}); + +develop.commit({ + messageDisplay: false, + dotStrokeWidth: 10 +}); + +developV3.checkout(); + +/* +developV3.merge(master, { + dotStrokeWidth: 10, + message: "Release v3.0.0 tagged", + tag: "v3.0.0" +}); +*/ diff --git a/.gitignore b/.gitignore index d1ddc139e..4e141e644 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ public !test/patterns/public/.gitkeep !test/patterns/testDependencyGraph.json .nyc_output/ +.vscode/