Skip to content
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

Add commitizen to package templates #418

Merged
merged 13 commits into from
Apr 19, 2021
5 changes: 5 additions & 0 deletions .changeset/five-donuts-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

**template/\*-npm-package:** Add `yarn commit` script
7 changes: 7 additions & 0 deletions template/oss-npm-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions template/oss-npm-package/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"dependencies": {},
"description": "<%- description %>",
"devDependencies": {
"commitizen": "^4.2.3",
"skuba": "*"
},
"files": [
Expand All @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions template/private-npm-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions template/private-npm-package/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"dependencies": {},
"description": "<%- description %>",
"devDependencies": {
"commitizen": "^4.2.3",
"skuba": "*"
},
"files": [
Expand All @@ -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": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I believe we can/should do the same to the oss-npm-package template.
  2. Should we add a section to the relevant template READMEs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I was just not sure about the oss, just because you could go either way about it and implement changesets for example

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 It's definitely easier to get Changesets going in oss, but it should be fine to include this out of the box since the template defaults to using Semantic Release anyway.

"commitizen": {
"path": "cz-conventional-changelog"
}
},
"sideEffects": false,
"types": "./lib-types/index.d.ts",
"version": "0.0.0-semantically-released"
Expand Down