@@ -4,8 +4,8 @@ This is documentation for maintainers of this project.
4
4
5
5
## Code of Conduct
6
6
7
- Please review, understand, and be an example of it. Violations of the code of
8
- conduct are taken seriously, even (especially) for maintainers.
7
+ Please [ review] [ 1 ] , understand, and be an example of it. Violations of the code
8
+ of conduct are taken seriously, even (especially) for maintainers.
9
9
10
10
## Issues
11
11
@@ -16,7 +16,7 @@ minimal reproduction of what they're trying to accomplish or the bug they think
16
16
they've found.
17
17
18
18
Once it's determined that a code change is necessary, point people to
19
- [ makeapullrequest.com] [ 1 ] and invite them to make a pull request. If they're the
19
+ [ makeapullrequest.com] [ 2 ] and invite them to make a pull request. If they're the
20
20
one who needs the feature, they're the one who can build it. If they need some
21
21
hand holding and you have time to lend a hand, please do so. It's an investment
22
22
into another human being, and an investment into a potential maintainer.
@@ -32,79 +32,90 @@ As a maintainer, you're fine to make your branches on the main repo or on your
32
32
own fork. Either way is fine.
33
33
34
34
When we receive a pull request, a GitHub Actions build is kicked off
35
- automatically (see [ ` .github/workflows ` ] [ 2 ] ). We avoid merging anything that
35
+ automatically (see [ ` .github/workflows ` ] [ 3 ] ). We avoid merging anything that
36
36
fails the Actions workflow.
37
37
38
38
Please review PRs and focus on the code rather than the individual. You never
39
39
know when this is someone's first ever PR and we want their experience to be as
40
40
positive as possible, so be uplifting and constructive.
41
41
42
- When you merge the pull request, 99% of the time you should use the [ Squash and
43
- merge] [ 3 ] feature. This keeps our git history clean, but more importantly, this
44
- allows us to make any necessary changes to the commit message so we release what
45
- we want to release. See the next section on Releases for more about that.
42
+ When you merge the pull request, 99% of the time you should use the [ rebase and
43
+ merge] [ 4 ] feature. This keeps our git history clean. If commit messages need to
44
+ be adjusted, maintainers should force push new commits with adjusted messages to
45
+ the PR branch before merging it in.
46
+
47
+ The [ squash and merge] [ 5 ] feature can also be used, but keep in mind that
48
+ squashing commits will likely damage the [ generated] [ 6 ] [ CHANGELOG.md] [ 7 ] ,
49
+ hinder [ bisection] [ 8 ] , and result in [ non-atomic commits] [ 9 ] , so use it
50
+ sparingly.
46
51
47
52
## Release
48
53
49
54
Our releases are automatic. They happen whenever code lands into ` master ` . A
50
- GitHub Actions build gets kicked off and if it's successful, a tool called
51
- [ ` semantic-release ` ] [ 4 ] is used to automatically publish a new release to npm as
52
- well as a changelog to GitHub . It is only able to determine the version and
53
- whether a release is necessary by the git commit messages. With this in mind,
54
- ** please brush up on [ the commit message convention] [ commit ] which drives our
55
- releases.**
56
-
57
- > One important note about this: Please make sure that commit messages do NOT
55
+ GitHub Actions build gets kicked off and, if it's successful, a tool called
56
+ [ ` semantic-release ` ] [ 10 ] is used to automatically publish a new release to npm
57
+ and GitHub along with an updated changelog . It is only able to determine the
58
+ version and whether a release is necessary by the git commit messages. With this
59
+ in mind, ** please brush up on [ the commit message convention] [ commit ] which
60
+ drives our releases.**
61
+
62
+ > One important note about this: please make sure that commit messages do NOT
58
63
> contain the words "BREAKING CHANGE" in them unless we want to push a major
59
64
> version. I've been burned by this more than once where someone will include
60
- > "BREAKING CHANGE: None" and it will end up releasing a new major version. Not
61
- > a huge deal honestly, but kind of annoying...
65
+ > "BREAKING CHANGE: None" and it will end up releasing a new major version. Do
66
+ > not do this!
62
67
63
68
### Manual Releases
64
69
65
- This project has an automated release set up. So things are only released when
66
- there are useful changes in the code that justify a release. But sometimes
67
- things get messed up one way or another and we need to trigger the release
68
- ourselves. When this happens, simply bump the number below and commit that with
69
- the following commit message based on your needs:
70
+ This project has an automated release set up. That means things are only
71
+ released when there are useful changes in the code that justify a release. See
72
+ [ the release rules] [ 11 ] for a list of commit types that trigger releases.
70
73
71
- #### Major
74
+ However, sometimes things get messed up (e.g. CI workflow / GitHub Actions
75
+ breaks) and we need to trigger a release ourselves. When this happens,
76
+ semantic-release can be triggered locally by following these steps:
72
77
73
- ``` text
74
- fix(release): manually release a major version
78
+ > If one of these steps fails, you should address the failure before running the
79
+ > next step.
75
80
76
- There was an issue with a major release, so this manual-releases.md
77
- change is to release a new major version.
81
+ ``` bash
82
+ # These command must be run from the project root
78
83
79
- Reference: #<the number of a relevant pull request, issue, or commit>
84
+ # 1. Setup the local environment. Add your auth tokens to this file
85
+ # ! DO NOT COMMIT THIS FILE !
86
+ cp .env.default .env
80
87
81
- BREAKING CHANGE: <mention any relevant breaking changes (this is what triggers the major version change so don't skip this!)>
82
- ```
88
+ # 2. Reset the working directory to a clean state (deletes all ignored files)
89
+ npm run clean
83
90
84
- #### Minor
91
+ # 3. Lint all files
92
+ npm run lint:all
85
93
86
- ``` text
87
- feat(release): manually release a minor version
94
+ # 4. Build distributables
95
+ npm run build:dist
88
96
89
- There was an issue with a minor release, so this manual-releases.md
90
- change is to release a new minor version.
97
+ # 5. Build auxiliary documentation
98
+ npm run build:docs
91
99
92
- Reference: #<the number of a relevant pull request, issue, or commit>
93
- ```
100
+ # 6. Build any external executables (used in GitHub Actions workflows)
101
+ npm run build:externals
94
102
95
- #### Patch
103
+ # 7. Format all files
104
+ npm run format
96
105
97
- ``` text
98
- fix(release): manually release a patch version
106
+ # 8. Run all possible tests and generate coverage information
107
+ npm run test:all
99
108
100
- There was an issue with a patch release, so this manual-releases.md
101
- change is to release a new patch version.
109
+ # 9. Upload coverage information to codecov (only if you have the proper token)
110
+ CODECOV_TOKEN= $( npx --yes dotenv-cli -p CODECOV_TOKEN ) codecov
102
111
103
- Reference: #<the number of a relevant pull request, issue, or commit>
112
+ # 10. Trigger semantic-release locally and generate a new release. This requires
113
+ # having tokens for NPM and GitHub with the appropriate permissions. This
114
+ # command should be run in a clean environment using a user account without a
115
+ # home directory (so no ~/.npmrc or ~/.gnupg directories)
116
+ NPM_TOKEN=$( npx --yes dotenv-cli -p NPM_TOKEN) GH_TOKEN=$( npx --yes dotenv-cli -p GITHUB_TOKEN) HUSKY=0 UPDATE_CHANGELOG=true GIT_AUTHOR_NAME=$( git config --global --get user.name) GIT_COMMITTER_NAME=$( git config --global --get user.name) GIT_AUTHOR_EMAIL=$( git config --global --get user.email) GIT_COMMITTER_EMAIL=$( git config --global --get user.email) npx --no-install semantic-release --no-ci --extends " $( pwd) /release.config.js"
104
117
```
105
118
106
- The number of times we've had to do a manual release is: 1
107
-
108
119
<!-- lint ignore -->
109
120
110
121
## Thanks!
@@ -113,7 +124,18 @@ Thank you so much for helping to maintain this project!
113
124
114
125
[ commit] :
115
126
https://github.com/conventional-changelog-archived-repos/conventional-changelog-angular/blob/ed32559941719a130bb0327f886d6a32a8cbc2ba/convention.md
116
- [ 1 ] : http://makeapullrequest.com
117
- [ 2 ] : ./.github/workflows
118
- [ 3 ] : https://help.github.com/articles/merging-a-pull-request
119
- [ 4 ] : https://github.com/semantic-release/semantic-release
127
+ [ 1 ] : ./.github/CODE_OF_CONDUCT.md
128
+ [ 2 ] : http://makeapullrequest.com
129
+ [ 3 ] : ./.github/workflows
130
+ [ 4] :
131
+ https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#rebase-and-merge-your-commits
132
+ [ 5] :
133
+ https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits
134
+ [ 6 ] : https://github.com/conventional-changelog/conventional-changelog
135
+ [ 7 ] : https://www.conventionalcommits.org/en/v1.0.0
136
+ [ 8] :
137
+ https://www.metaltoad.com/blog/beginners-guide-git-bisect-process-elimination
138
+ [ 9 ] : https://dev.to/paulinevos/atomic-commits-will-help-you-git-legit-35i7
139
+ [ 10 ] : https://github.com/semantic-release/semantic-release
140
+ [ 11] :
141
+ https://github.com/babel-utils/babel-plugin-tester/blob/c13a2e0ff4ea9289d7a79a5da8949c125c636130/release.config.js#L27
0 commit comments