Skip to content

Commit 3ddfbdc

Browse files
update contributing doc (#69)
* update contributing doc * update template * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 584f428 commit 3ddfbdc

2 files changed

Lines changed: 25 additions & 65 deletions

File tree

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Checklist
44

5-
- [ ] If this PR changes a package, I’ve added an entry to the **CHANGELOG.md**
5+
- [ ] If this PR changes a package, I’ve added an entry to `.changesets` (see CONTRIBUTING.md)
66

77
### Description
88

CONTRIBUTING.md

Lines changed: 24 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
# Contributing
22

3+
Do all operations inside `nix develop`.
4+
35
## Branches
46

57
- `main` for stable, published code
6-
- `next` for new, unreleased features
7-
- `feature/<name>` for per-feature branches off `next`
8-
- `release/<name>` for releases, or `patch/name` for direct updates to main
8+
- `feature/<name>` for per-feature branches off `main`
99

1010
## Contributing to packages
1111

12-
Each package change must be accompanied with an `Unreleased` changelog line.
12+
This project uses [changesets](https://github.com/changesets/changesets) to document changes and manage releases to npm.
13+
14+
Each package change must be accompanied with a changeset entry.
15+
16+
To add a changeset to your PR:
17+
18+
```bash
19+
nix develop
20+
pnpm changeset
21+
## Follow the interactive prompts to select packages and write a description.
22+
## You can edit the generated markdown file in `.changeset/` later if needed.
23+
## Commit the newly created file.
24+
```
1325

14-
Types of changes
26+
Please use this format for writing changesets:
1527

1628
- `Added` for new features.
1729
- `Changed` for changes in existing functionality.
@@ -20,68 +32,16 @@ Types of changes
2032
- `Fixed` for any bug fixes.
2133
- `Security` in case of vulnerabilities.
2234

23-
## Releasing packages.
35+
## Releasing packages
2436

2537
### Steps
2638

27-
_Note:_ if releasing more than 1 package, all can be in the same PR, but if a package depends on another, make sure to update the version of the dependant package before releasing it, and clean install and build again.
28-
29-
1. Open a PR to merge `next` into `main`. Can do regular merge, do not squash the commits. Review and merge.
30-
31-
2. Set up release environment
32-
33-
```bash
34-
nix develop
35-
git checkout main
36-
git pull origin
37-
git checkout -b release/<name>
38-
rm -rf node_modules
39-
pnpm install
40-
turbo build
41-
```
42-
43-
3. `cd` into package root
44-
45-
4. Generate new version
39+
1. Run the github action `Version Packages`
4640

47-
```bash
48-
# Patch release (0.0.1 → 0.0.2)
49-
# backward-compatible bug fixes
50-
npm version patch
51-
52-
# Minor release (0.0.1 → 0.1.0)
53-
# backward-compatible new features
54-
npm version minor
55-
56-
# Major release (0.1.0 → 1.0.0)
57-
# backward-incompatible changes
58-
npm version major
59-
60-
# Or set an exact version
61-
npm version 0.2.0
62-
```
63-
64-
5. Update `CHANGELOG.md` with new version.
41+
- If there are changesets in the `.changesets` folder, the action will bump all versions and open a PR.
42+
- Review the PR (carefully!) to make sure all versions are accurate. It is safe to pull the branch and make edits to version numbers
43+
- Merge the PR
6544

66-
6. Publish to npm
45+
2. Run the github action `Release Packages`
6746

68-
**Note:** You must have write access to the npm scope `@valence-protocol`. Run the publish command and follow the prompts to authenticate yourself via CLI.
69-
70-
```bash
71-
cd <package root>
72-
npm publish --access public
73-
```
74-
75-
7. Open a PR from your `release/name` branch -> `main` with:
76-
77-
- migrated changelog
78-
- package `version` updated in package.json
79-
- `pnpm-lock.yaml` should change if packages depend on eachother
80-
81-
8. Reset `next` branch
82-
83-
```bash
84-
git checkout next
85-
git merge origin/main
86-
git push origin next
87-
```
47+
- This will build all packages with their dependencies, and push the bundles to npm with the version specified in their `package.json`

0 commit comments

Comments
 (0)