-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Use .changes directories to drive releases
#10864
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
Open
markdalgleish
wants to merge
3
commits into
main
Choose a base branch
from
markdalgleish/changes-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,253
−198
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,32 +38,109 @@ All packages are published with TypeScript types along with both ESM and CJS mod | |
|
|
||
| Packages live in the [`packages` directory](https://github.com/remix-run/remix/tree/v3/packages). At a minimum, each package includes: | ||
|
|
||
| - `.changes/`: Directory containing change files for the next release | ||
| - `CHANGELOG.md`: A log of what's changed | ||
| - `package.json`: Package metadata and dependencies | ||
| - `README.md`: Information about the package | ||
| - `src/`: The package's source code | ||
|
|
||
| When you make changes to a package, please make sure you add a few relevant tests and run the whole test suite to make sure everything still works. Then, add a human-friendly description of your change in the changelog and [make a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). We will take a look at it as soon as we can. | ||
| When you make changes to a package, please make sure you add a few relevant tests and run the whole test suite to make sure everything still works. Then, [add a change file](#adding-a-change-file) describing your changes and [make a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). We will take a look at it as soon as we can. | ||
|
|
||
| ### Adding a Change File | ||
|
|
||
| When making changes to a package, create a markdown file in the package's `.changes/` directory following this naming convention: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| #### Examples | ||
|
|
||
| - `major.breaking-api-change.md` - Breaking change requiring major version bump | ||
| - `minor.add-new-feature.md` - New feature requiring minor version bump | ||
| - `patch.fix-bug.md` - Bug fix requiring patch version bump | ||
|
|
||
| #### Content Format | ||
|
|
||
| Write your change as a bullet point (without the leading `-` or `*`). This content will be added to the CHANGELOG during release. | ||
|
|
||
| **Simple change:** | ||
|
|
||
| ```markdown | ||
| Add support for X feature | ||
| ``` | ||
|
|
||
| **Multi-line change:** | ||
|
|
||
| ```markdown | ||
| Add support for X feature | ||
|
|
||
| This is a longer explanation that will be indented | ||
| under the main bullet point in the CHANGELOG. | ||
| ``` | ||
|
|
||
| #### Validation | ||
|
|
||
| Change files are automatically validated in CI. You can also validate them locally: | ||
|
|
||
| ```sh | ||
| pnpm changes:validate | ||
| ``` | ||
|
|
||
| ## Releases | ||
|
|
||
| Cutting releases is a 2-step process: | ||
| Cutting releases is a multi-step process: | ||
|
|
||
| 1. **Preview** - See what will be released | ||
| 2. **Version** - Update versions and create commit/tags locally | ||
| 3. **Push** - Push to GitHub (triggers CI to publish to npm) | ||
|
|
||
| ### Preview a Release | ||
|
|
||
| To see which packages have changes and preview the release: | ||
|
|
||
| ```sh | ||
| pnpm changes:preview | ||
| ``` | ||
|
|
||
| This shows: | ||
|
|
||
| - Update versions in package.json and the changelog and create a git tag (tagging) | ||
| - Publish new packages to npm and create a GitHub Release (publishing) | ||
| - Which packages will be released with version bumps | ||
| - CHANGELOG additions | ||
| - Git tags that will be created | ||
| - Commit message | ||
|
|
||
| This repo includes a script for each step. | ||
| ### Version a Release | ||
|
|
||
| To update versions and create a tag, use `pnpm run tag-release <packageName> <releaseType>`. For example, to create a `minor` release of the `headers` package, run: | ||
| When ready to release, update versions and create the commit and tags locally: | ||
|
|
||
| ```sh | ||
| pnpm run tag-release headers minor | ||
| pnpm changes:version | ||
| ``` | ||
|
|
||
| To publish the release you just tagged, use `pnpm run publish-release <tag>`. For example, if the tag that was created in the previous step was `[email protected]`, you'd run `pnpm run publish-release [email protected]`. | ||
| This will: | ||
|
|
||
| - Validate all change files | ||
| - Update `package.json` versions | ||
| - Update `CHANGELOG.md` files | ||
| - Delete processed change files | ||
| - Create a git commit | ||
| - Create git tags | ||
|
|
||
| The publish step runs in GitHub Actions if you just push the tag to GitHub: | ||
| If you want to review the file changes before committing: | ||
|
|
||
| ```sh | ||
| git push origin main --tags | ||
| pnpm changes:version --no-commit | ||
| ``` | ||
|
|
||
| This updates the files but skips git operations. After reviewing, the script will show you the exact git commands to run to create the commit and tags. | ||
|
|
||
| ### Push the Release | ||
|
|
||
| Push the release commit and tags to GitHub: | ||
|
|
||
| ```sh | ||
| git push && git push --tags | ||
| ``` | ||
|
|
||
| GitHub Actions will automatically publish the tagged packages to npm and create GitHub Releases. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Changes Directory | ||
|
|
||
| This directory contains change files that will be processed during releases. | ||
|
|
||
| ## Adding a Change | ||
|
|
||
| See the [Contributing Guide](../../../CONTRIBUTING.md#adding-a-change-file) for documentation on how to add change files. | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| Create a file with the pattern: | ||
|
|
||
| ``` | ||
| [major|minor|patch].short-description.md | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `major.breaking-api-change.md` | ||
| - `minor.add-new-feature.md` | ||
| - `patch.fix-bug.md` | ||
|
|
||
| The content will be added to the CHANGELOG during release. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget how git deals with symbolic links, but might be less repetitive to have this README at the root of the repo somewhere and then just link to it in each
<package>/.changes/README.mdinstead of duplicating the contents, esp. if the contents are intended to stay in sync.Though if you are trying to simulate our changes flow as something that could be 3rd party, then sym links make less sense. But still if contents are always the same, might be nicer to generate the README and gitignore it