Skip to content

Commit 82db652

Browse files
author
Sébastien Van Eyck
committed
feat(release|INS-511): Create release build process for NPM library
1 parent ad32077 commit 82db652

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

CHANGELOG.md

Whitespace-only changes.

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,36 @@ You can develop and test locally your modified package by running `npm link`. Th
9999
Commit messages must follow conventions, please use these guidelines: https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md
100100

101101
Any new feature must be unit tested. The following `npm` tasks are available:
102+
102103
- `npm test` Will run all tests and print tests results along code coverage.
103104
- `npm run test-ci` Will watch for any files changes and run all tests
104105

105106
Code coverage report is generated in `/coverage/lcov-report` folder
107+
108+
## Release process
109+
------------------
110+
Release is made with `standard-version` of `conventional-changelog`:
111+
112+
```
113+
npm run release
114+
```
115+
116+
The following jobs will be ran:
117+
118+
- Bumping version in package.json file
119+
- Outputting changes to CHANGELOG.md (based on commit messages)
120+
- Committing package.json and CHANGELOG.md
121+
- Adding a new tag for targeted release
122+
123+
124+
Once your local master branch is ready, just run the following command:
125+
```
126+
npm run publish
127+
```
128+
129+
The following jobs will be ran:
130+
131+
- Pushing commit and tag to the remote master branch
132+
- Publish the package to npm registry
133+
134+
> Publishing on npm registry requires a registered user. Please read [Publishing npm packages](https://docs.npmjs.com/getting-started/publishing-npm-packages) for more details.

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "frontify-sync",
3-
"private": true,
43
"version": "0.1.0",
54
"scripts": {
65
"test": "istanbul cover _mocha",
7-
"test-ci": "mocha --watch"
6+
"test-ci": "mocha --watch",
7+
"release": "standard-version",
8+
"publish": "git push --follow-tags origin master && npm publish"
89
},
910
"main": "./src/main.js",
1011
"bin": "./index.js",
@@ -20,7 +21,8 @@
2021
"chai-as-promised": "6.0.0",
2122
"istanbul": "0.4.5",
2223
"mocha": "3.1.2",
23-
"sinon": "1.17.6"
24+
"sinon": "1.17.6",
25+
"standard-version": "3.0.0"
2426
},
2527
"engines": {
2628
"node": ">=0.10.0"

0 commit comments

Comments
 (0)