This repo is for reference when creating a new node module/application in the nodeshift org.
We have been trying to adhere to conventional commits, https://www.conventionalcommits.org/en/v1.0.0/, which helps when creating our changelogs and releases.
We also try to stay away from merge commits to keep the git history clean.
npm >= 7
npm install standard-version -D
npm set-script release "standard-version"
npm < 7
npm install standard-version -D
Add to package.json
"scripts": {
"release": "standard-version",
We can run this with --dry-run
option to see the results, for example:
$ npm run release -- --dry-run
> [email protected] release /home/lm/code/npcheck
> standard-version "--dry-run"
✔ bumping version in package.json from 0.1.13 to 0.1.14
✔ bumping version in package-lock.json from 0.1.13 to 0.1.14
✔ created CHANGELOG.md
✔ outputting changes to CHANGELOG.md
---
### 0.1.14 (2021-07-06)
### Features
* adding initial test structure ([#4](https://github.com/nodeshift/npcheck/issues/4)) ([e6281df](https://github.com/nodeshift/npcheck/commit/e6281df6e803ced9c6d57460821af7d8a431480e))
---
✔ committing package-lock.json and package.json and CHANGELOG.md
✔ tagging release v0.1.14
ℹ Run `git push --follow-tags origin standard-version && npm publish` to publish
Apache 2
We use eslint and extend semistandard.
npm >= 7
npm install husky -D
npm set-script prepare "husky install" && npm run prepare
npx husky add .husky/pre-commit "npm test"
npm < 7
npm install husky -D
Add to package.json
"scripts": {
"prepare": "husky install",
Run the commands
npm run prepare
npx husky add .husky/pre-commit "npm test"
Testing framework is dependant on the project. The Reference Architecture recommendations are for Mocha or Jest. The nodeshift team has been using Tape in the past.
We have been using the nyc module for code coverage as well as coveralls.io for hosting the results.
It is recommended to add a support:true property in the package.json and also include the package-support.json.
A node related .gitignore can be created with npx gitignore node
.
The nodeshift org is now using Github actions for its CI. Included in this repo is a copy of what is being used in the other repos.
The nodeshift org now uses Github actions to run and publish docs under the gh_pages branch on github for each release. Included in this repo is a copy of what is being used in the other repos.
The nodeshift org now uses the Release-please github action to automate the release PRs. Included in this repo is a copy of what is being used in the other repos.