2021-06-03 05:06:55 +08:00
|
|
|
# Building and testing
|
2021-02-16 19:18:48 +08:00
|
|
|
|
|
|
|
Install the dependencies.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ npm install
|
|
|
|
```
|
|
|
|
|
|
|
|
Build the typescript and package it for distribution.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ npm run build && npm run pack
|
|
|
|
```
|
|
|
|
|
|
|
|
Run the tests :heavy_check_mark:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ npm test
|
|
|
|
```
|
2021-02-28 19:15:08 +08:00
|
|
|
|
|
|
|
Run the tests and display only the first failing tests :heavy_check_mark:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ npm test:only-errors
|
|
|
|
```
|
|
|
|
|
|
|
|
Run the tests with the watch mode :heavy_check_mark:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ npm test:watch
|
|
|
|
```
|
|
|
|
|
|
|
|
Run the linter and fix (almost) every issue for you :heavy_check_mark:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ npm lint:all:fix
|
|
|
|
```
|
|
|
|
|
2021-06-03 05:06:55 +08:00
|
|
|
# Before creating a PR
|
|
|
|
|
|
|
|
## Build and quality checks
|
2021-02-28 19:15:08 +08:00
|
|
|
|
|
|
|
Build, lint, package and test everything.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ npm all
|
|
|
|
```
|
2021-06-03 05:06:55 +08:00
|
|
|
|
|
|
|
# Release
|
|
|
|
|
|
|
|
Based on [standard-version](https://github.com/conventional-changelog/standard-version).
|
|
|
|
|
|
|
|
## Define the new version
|
|
|
|
|
|
|
|
You can run `npm run release:dry-run` to create a dry-run, or you can directly run `npm run release` to create a new local release.
|
|
|
|
It will run `prerelease` beforehand to build and pack everything.
|
|
|
|
|
|
|
|
If the `prerelease` succeeded, a bump of version will happen based on the unreleased commits.
|
|
|
|
It will:
|
|
|
|
|
|
|
|
- Update the _package.json_ version field
|
|
|
|
- Update the _package-lock.json_ version field
|
|
|
|
- Update the _CHANGELOG.md_ to include the release notes of the new version
|
|
|
|
- Create a local tag
|
|
|
|
- Create a commit
|
|
|
|
|
|
|
|
If everything generated seems ok for you, you can push your tag by running `git push --follow-tags origin {your-branch-name}`.
|