Skip to content

Commit 361a24b

Browse files
authored
better docs all around (#85)
1 parent 8fd6562 commit 361a24b

File tree

7 files changed

+176
-2
lines changed

7 files changed

+176
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "releases": [{ "name": "extract-react-types-loader", "type": "patch" }], "dependents": [] }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add readme

code-of-conduct.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at `[email protected]`. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

contributing.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Contributions to Extract React Types in the form of issues and PRs are welcomed.
2+
3+
## Code of Conduct
4+
5+
Extract React Types adheres to the [Contributor Covenant Code of Conduct](code-of-conduct.md).
6+
7+
## Version management
8+
9+
Keystone uses @noviny's [@changesets/cli](https://github.com/atlassian/changesets) in combination with `bolt` to track package versions and publish packages.
10+
This tool allows each PR to indicate which packages need a version bump along with a changelog snippet.
11+
This information is then collated when performing a release to update package versions and `CHANGELOG.md` files.
12+
13+
### What all contributors need to do
14+
15+
- Make your changes (as per usual)
16+
- Before you make a Pull Request, run the `bolt changeset` command and answer the questions that are asked. It will want to know:
17+
- which packages you want to publish
18+
- what version you are releasing them at
19+
- a message to summarise the changes (this message will be written to the changelog of bumped packages)
20+
- Before you accept the changeset, it will inform you of any other dependent packages within the repo that will also be bumped by this changeset. If this looks fine, agree, and a changeset will be generated in the `.changeset` directory.
21+
22+
Each changeset contains two files; `changes.json`, which contains structured data which indicates the packages which need to be updated, and `changes.md`, which contains a markdown snippet which will be included in the `CHANGELOG.md` files for the updated packages.
23+
24+
Here is what a `changeset.json` looks like:
25+
26+
```
27+
{
28+
"releases": [
29+
{ "name": "@keystone-alpha/adapter-mongoose", "type": "patch" },
30+
{ "name": "@keystone-alpha/keystone", "type": "minor" }
31+
],
32+
"dependents": []
33+
}
34+
```
35+
36+
You can have multiple changesets in a single PR. This will give you more granular changelogs, and is encouraged.
37+
38+
## Release Guidelines
39+
40+
## Publishing
41+
42+
### How to do a release
43+
44+
> This should only ever be done by a very short list of core contributors
45+
46+
Releasing is a two-step process. The first step updates the packages, and the second step publishes updated packages to npm.
47+
48+
#### Steps to version packages
49+
50+
The first step is `bolt apply-changesets`. This will find all changesets that have been created since the last release, and update the version in package.json as specified in those changesets, flattening out multiple bumps to a single package into a single version update.
51+
52+
The `bolt release` command will release new versions of packages to npm.
53+
54+
The commands to run are:
55+
56+
```sh
57+
git checkout master
58+
git pull
59+
git branch -D temp-release-branch
60+
git checkout -b temp-release-branch
61+
bolt apply-changesets
62+
git add .
63+
git commit -m "Run version-packages"
64+
git push --set-upstream origin temp-release-branch
65+
```
66+
67+
Once you have run this you will need to make a pull request to merge this back into master.
68+
69+
#### Release Process
70+
71+
Once the version changes are merged back in to master, to do a manual release:
72+
73+
```sh
74+
git checkout master
75+
git pull
76+
bolt
77+
bolt release
78+
git push --tags
79+
bolt
80+
```
81+
82+
The `bolt publish-changed` command finds packages where the version listed in the `package.json` is ahead of the version published on npm, and attempts to publish just those packages.
83+
84+
Because of this, we should keep the following in mind:
85+
86+
- Once the `apply-changesets` command has been run, the PR from the `temp-release-branch` should be merged before any other PRs are merged into master, to ensure that no changesets are skipped from being included in a release.
87+
- There is no reason you should ever manually edit the version in the `package.json`
88+
89+
### A quick note on changelogs
90+
91+
The release process will automatically generate and update a `CHANGELOG.md` file, however this does not need to be the only way this file is modified. The changelogs are deliberately static assets so past changelogs can be updated or expanded upon.
92+
93+
In addition, content added above the last released version will automatically be appended to the next release. If your changes do not fit comfortably within the summary of a changelog, we encourage you to add a more detailed account directly into the `CHANGELOG.md`.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"test": "jest",
77
"changeset": "changeset",
8-
"bump": "changeset bump",
8+
"apply-changesets": "changeset bump",
99
"release": "yarn build && changeset release --public",
1010
"postinstall": "preconstruct dev",
1111
"dev:pretty-proptypes": "bolt w pretty-proptypes run dev",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Extract React Types Loader
2+
3+
Please see [the documentation for pretty-proptypes](https://github.com/atlassian/extract-react-types/tree/master/packages/pretty-proptypes) for information on how to use this package.

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Packages:
1111

1212
## Contribute
1313

14-
Pull requests, issues and comments welcome
14+
Pull requests, issues and comments welcome - please read our [contributing guidelines](./contributing.md) and our [code of conduct](./code-of-conduct.md).

0 commit comments

Comments
 (0)