Skip to content

chore: add npm version script #1474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Here are some guides on how to do that:
- [Requesting Features](#requesting-features)
- [Submitting a PR](#submitting-a-pr)
- [Where to Start](#where-to-start)
- [Publishing new versions](#publishing-new-versions)

<!-- /TOC -->

Expand Down Expand Up @@ -76,3 +77,40 @@ It's our turn from there on! We will review the PR and discuss changes you might
## Where to Start

If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/nativescript-angular/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).


## Publishing new versions

Instructions how to publish a new version for Maintainers.

1. Execute `npm install` to install dependencies and prepare the package for publishing:
```bash
cd nativescript-angular/nativescript-angular
npm install
```

2. Add the following to your `.npmrc`:
```
tag-version-prefix=""
message="release: cut the %s release"
```

3. Create new branch for the release:
```bash
git checkout -b username/release-version
```

4. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version in the `package.json` file, tag the release and update the CHANGELOG.md:
```bash
npm version [patch|minor|major]
```

5. Push all the changes to your branch and create a pull request:
```bash
git push --set-upstream origin username/release-version --tags
```

6. Publish the package to `npm` after the pull request is merged:
```bash
npm publish
```
3 changes: 2 additions & 1 deletion nativescript-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"tsc": "tsc -p tsconfig.json",
"tsc-w": "tsc -p tsconfig.json -w",
"ngc": "ngc -p tsconfig.json",
"prepare": "npm run ngc"
"prepare": "npm run ngc",
"version": "rm package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md"
},
"bin": {
"update-app-ng-deps": "./bin/update-app-ng-deps"
Expand Down