Skip to content

Commit

Permalink
build: conventional commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Apr 14, 2022
1 parent b86e714 commit 63129b4
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/node_modules
/package-lock.json
/yarn.lock
!.husky
!.travis.yml
!.gitignore
!.npmignore
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname $0)/_/husky.sh"

npx commitlint --edit $1
5 changes: 0 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Changelog: HTTP Status

## Trunk

* package: update travis with node.js 12 and 14

## Version 1.5.0

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,17 @@ app.listen(3000);
- James Barcellano: <https://github.com/ckeboss>

This package is developed by [Adaltas](http://www.adaltas.com).

## Developers

To automatically generate a new version:

```
yarn run release
```

There is currently no CI, copy/paste the code after release. Note, commits and tags are automatically pushed before publishing.

```
npm publish
```
10 changes: 10 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
extends: [
"@commitlint/config-conventional"
],
// rules: {
// 'scope-enum': [2, "always", [
// 'my_scope',
// ]],
// }
};
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@
"url": "http://github.com/adaltas/node-http-status/issues"
},
"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@types/mocha": "^8.0.4",
"@types/node": "^14.14.7",
"@types/should": "^13.0.0",
"coffeescript": "2.5.1",
"commitlint": "^16.2.3",
"husky": "^7.0.4",
"mocha": "8.2.1",
"should": "13.2.3",
"standard-version": "^9.3.2",
"ts-node": "^9.0.0",
"typescript": "^4.0.5"
},
Expand Down Expand Up @@ -69,14 +74,15 @@
"node": ">= 0.4.0"
},
"scripts": {
"preversion": "grep '## Trunk' CHANGELOG.md && npm test",
"version": "version=`grep '^ \"version\": ' package.json | sed 's/.*\"\\([0-9\\.]*\\)\".*/\\1/'` && sed -i \"s/## Trunk/## Version $version/\" CHANGELOG.md && git add CHANGELOG.md",
"postversion": "git push origin master && git push origin master --tags && npm publish",
"patch": "npm version patch -m 'Bump to version %s'",
"minor": "npm version minor -m 'Bump to version %s'",
"major": "npm version major -m 'Bump to version %s'",
"coffee": "coffee -b -o lib src",
"pretest": "coffee -b -o lib src && cp src/index.d.ts lib",
"__postversion": "git push origin master && git push origin master --tags && npm publish",
"build": "coffee -b -o lib src && cp src/index.d.ts lib",
"prepare": "husky install",
"prepublishOnly": "git push --follow-tags origin master",
"pretest": "npm run build",
"release": "standard-version",
"release:minor": "standard-version --release-as minor",
"release:patch": "standard-version --release-as patch",
"release:major": "standard-version --release-as major",
"test": "mocha \"test/**/*.{coffee,ts}\""
}
}

0 comments on commit 63129b4

Please sign in to comment.