diff --git a/.changeset/five-donuts-flash.md b/.changeset/five-donuts-flash.md new file mode 100644 index 000000000..95f2de4b1 --- /dev/null +++ b/.changeset/five-donuts-flash.md @@ -0,0 +1,5 @@ +--- +'skuba': patch +--- + +**template/\*-npm-package:** Add `yarn commit` script diff --git a/template/oss-npm-package/README.md b/template/oss-npm-package/README.md index ffe164aea..25ec4951e 100644 --- a/template/oss-npm-package/README.md +++ b/template/oss-npm-package/README.md @@ -28,6 +28,7 @@ Next steps: - [Lint](#lint) - [Package](#package) - [Release](#release) + - [Commit messages](#commit-messages) - [Releasing latest](#releasing-latest) - [Releasing other dist-tags](#releasing-other-dist-tags) @@ -101,6 +102,12 @@ It depends on this repo being hosted on [seek-oss] with appropriate access. To set up this repo for publishing, follow the instructions in our [OSS npm package guidance]. +### Commit messages + +This package is published with **[semantic-release]**, which requires a particular commit format to manage semantic versioning. +You can run the interactive `yarn commit` command in place of `git commit` to generate a compliant commit title and message. +If you use the `Squash and merge` option on pull requests, take extra care to format the squashed commit in the GitHub UI before merging. + ### Releasing latest Commits to the `master` branch will be released with the `latest` tag, diff --git a/template/oss-npm-package/_package.json b/template/oss-npm-package/_package.json index cb63f17f5..f9f454c0a 100644 --- a/template/oss-npm-package/_package.json +++ b/template/oss-npm-package/_package.json @@ -2,6 +2,7 @@ "dependencies": {}, "description": "<%- description %>", "devDependencies": { + "commitizen": "^4.2.3", "skuba": "*" }, "files": [ @@ -20,12 +21,18 @@ }, "scripts": { "build": "skuba build-package", + "commit": "cz", "format": "skuba format", "lint": "skuba lint", "release": "yarn build && skuba release", "test": "skuba test --coverage", "test:watch": "skuba test --watch" }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } + }, "sideEffects": false, "types": "./lib-types/index.d.ts", "version": "0.0.0-semantically-released" diff --git a/template/private-npm-package/README.md b/template/private-npm-package/README.md index ae1a823f3..1a63bc1cf 100644 --- a/template/private-npm-package/README.md +++ b/template/private-npm-package/README.md @@ -28,6 +28,7 @@ Next steps: - [Lint](#lint) - [Package](#package) - [Release](#release) + - [Commit messages](#commit-messages) - [Releasing latest](#releasing-latest) - [Releasing other dist-tags](#releasing-other-dist-tags) @@ -87,6 +88,12 @@ This package is published to the npm registry under the private `@seek` npm org It depends on this repo being hosted on [SEEK-Jobs] with appropriate access. +### Commit messages + +This package is published with **[semantic-release]**, which requires a particular commit format to manage semantic versioning. +You can run the interactive `yarn commit` command in place of `git commit` to generate a compliant commit title and message. +If you use the `Squash and merge` option on pull requests, take extra care to format the squashed commit in the GitHub UI before merging. + ### Releasing latest Commits to the `master` branch will be released with the `latest` tag, diff --git a/template/private-npm-package/_package.json b/template/private-npm-package/_package.json index 8971409fc..2786e4d6c 100644 --- a/template/private-npm-package/_package.json +++ b/template/private-npm-package/_package.json @@ -2,6 +2,7 @@ "dependencies": {}, "description": "<%- description %>", "devDependencies": { + "commitizen": "^4.2.3", "skuba": "*" }, "files": [ @@ -20,12 +21,18 @@ }, "scripts": { "build": "skuba build-package", + "commit": "cz", "format": "skuba format", "lint": "skuba lint", "release": "yarn build && skuba release", "test": "skuba test --coverage", "test:watch": "skuba test --watch" }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } + }, "sideEffects": false, "types": "./lib-types/index.d.ts", "version": "0.0.0-semantically-released"