You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+80-13Lines changed: 80 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,28 +59,95 @@ Complete your CLA here: <https://code.facebook.com/cla>
59
59
5. Ensure all tests pass
60
60
61
61
```sh
62
-
npmtest
62
+
yarntest
63
63
```
64
64
65
-
## Release on NPM
65
+
## Commit Message Conventions
66
66
67
-
*Only core contributors may release to NPM.*
67
+
Our commit messages are linted by `commitlint` following the angular changelog convention. You may end up losing a commit message or two if you don't follow this rule. We can add a prompt if people ask for it. This was designed for compatiblity with various git clients.
68
68
69
-
To release a new version on NPM, first ensure you're on the `master` branch and
70
-
have recently run `git pull` and that all tests pass with `npm test`.
71
-
Use `npm version patch|minor|major` in order to increment the version in
72
-
package.json and tag and commit a release. Then `git push --follow-tags`
73
-
this change so Travis CI can deploy to NPM. *Do not run `npm publish` directly.*
74
-
Once published, add [release notes](https://github.com/graphql/graphql-js/tags).
75
-
Use [semver](http://semver.org/) to determine which version part to increment.
76
69
77
-
Example for a patch release:
70
+
## Cutting New Releases
71
+
72
+
We chose a manual process which is pretty simple and flexible because of our conventional commit messages.
73
+
74
+
If you have NPM privileges, you have the ability to cut new releases of the packages herein.
75
+
76
+
### Requirements
77
+
78
+
You'll need:
79
+
-`GH_TOKEN` : a github user token as an environment variable
80
+
-`git` command line installed, obviously!
81
+
- to run `yarn adduser` first to ensure you're authenticated for publishing
82
+
- your npm 2FA should be enabled, and you should have your second factor device handy for publish
83
+
- your remote should be named `origin` for github, and should be the ssh url
84
+
- (coming soon) GPG key uploaded to account for signing
85
+
86
+
Note: Ideally we can avoid publishing from any branch but `master`, but we can always `--allow-branch mybranch` in case of an emergency for pre-releases. _Whenever you can, always publish from `master`_.
It will automatically create and prompt you for each of the pre-release versions that reflect the conventional pattern from the commit log - so some packages may end up pre-alpha, others may be pre-minor, etc.
103
+
104
+
For example, if you made a change to `graphql-language-service-utils` there would be a new version for every single package. But if you made a change to `graphiql` in the commits since the last publish, there should only be a new pre-release version for `graphiql` when you run this command.
105
+
106
+
You can also `--amend` a previous release before publishing.
107
+
108
+
Once this is complete, run `publish:prerelease` to complete this process, so that we can ensure we use pre-release tags. And then you'll of course authenticate again with your 2FA device.
109
+
110
+
111
+
### Graduating Prereleases
112
+
113
+
Now, after creating and publishing some pre-release versions, if you want to graduate them you can do so with a command that works in very much the same way as above.
78
114
79
115
```sh
80
-
npm version patch
81
-
git push --follow-tags
116
+
yarn version:graduate *
82
117
```
83
118
119
+
Would graduate all pre-alphas to patch releases, pre-minors to minor releases, etc.
120
+
121
+
You can also give a comma seperated list of packages, or just a single one, as with `prereleases`
122
+
123
+
```sh
124
+
yarn version:graduate codemirror-graphql
125
+
```
126
+
127
+
then you can run
128
+
129
+
```sh
130
+
yarn run publish:graduate
131
+
```
132
+
133
+
And authenticate with 2FA
134
+
135
+
136
+
### Full Releases
137
+
138
+
```sh
139
+
yarn version:release
140
+
```
141
+
142
+
Will automatically detect and generate changelog/etc with appropriate versions and entries for all subpackage, no need to supply package names or an asterisk
143
+
144
+
Then you can run
145
+
```sh
146
+
lerna publish
147
+
```
148
+
149
+
And authenticate with 2FA
150
+
84
151
## License
85
152
86
153
By contributing to GraphiQL, you agree that your contributions will be
0 commit comments