Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Changesets

This folder contains changeset files that describe changes to be released.

## What is a Changeset?

A changeset is a description of changes made in a pull request. It helps automate version bumps and changelog generation.

## How to create a Changeset

When you make changes that should be published to npm, run:

```bash
yarn changeset
```

This will:
1. Prompt you to select the type of change:
- `patch`: Bug fixes and minor changes (0.0.x)
- `minor`: New features (0.x.0)
- `major`: Breaking changes (x.0.0)
2. Ask for a description of the changes
3. Generate a markdown file in `.changeset/` that you commit with your PR

## Release Process

When PRs with changesets are merged to `master`:
1. The Changesets GitHub Action creates a "Version Packages" PR
2. This PR updates version numbers and changelogs
3. When merged, the packages are automatically published to npm

For more information, see the [Changesets documentation](https://github.com/changesets/changesets).
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why commit false

i had it true in abernier/react-mcu

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to "commit": true in 25efd68 to match the react-mcu reference. This will auto-commit changeset files when running yarn changeset.

"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ on:
push:
branches:
- 'master'
- 'beta'
- 'alpha'
- 'canary-*'
- 'rc'
pull_request: {}

permissions:
contents: write
pull-requests: write
id-token: write

# Cancel any previous run (see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency)
Expand Down Expand Up @@ -70,7 +67,12 @@ jobs:
- run: yarn install
- run: yarn build
- run: yarn build-storybook
# semantic-release skips not configured branches(see: release.config.js) or pull-requests
- run: yarn release

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 18 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You'll find a sample [`Example.tsx`](src/core/Example.tsx) component and its ass

## Commit Guidelines

Be sure your commit messages follow this specification: https://www.conventionalcommits.org/en/v1.0.0-beta.4/
Be sure your commit messages are clear and descriptive. While we use Changesets for versioning (so conventional commits are not strictly required), clear commit messages are still appreciated.

## Storybook

Expand All @@ -30,10 +30,22 @@ If you're adding a brand new feature, you need to make sure you add a storybook

## Publishing

We use `semantic-release-action` to deploy the package. Because of this only certain commits will trigger the action of creating a release:
We use [Changesets](https://github.com/changesets/changesets) to manage versions and publishing.

- `fix:` will create a `0.0.x` version
- `feat:` will create a `0.x.0` version
- `BREAKING CHANGE:` will create a `x.0.0` version
### Creating a changeset

We release on `master`, `beta` & `alpha`. `beta` & `alpha` are configured to be prerelease. Any other commits will not fire a release.
When you make changes that should be published, you need to create a changeset:

1. Run `yarn changeset` (or `npx changeset`)
2. Select the type of change:
- `patch` for bug fixes (0.0.x)
- `minor` for new features (0.x.0)
- `major` for breaking changes (x.0.0)
3. Provide a description of your changes
4. Commit the generated changeset file with your PR

### Release process

When your PR is merged to `master`, the Changesets GitHub Action will:
- Create a "Version Packages" PR that updates versions and changelogs
- When the Version Packages PR is merged, it will automatically publish to npm
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-three/drei",
"version": "0.0.0-semantic-release",
"version": "10.7.7",
"private": true,
"description": "useful add-ons for react-three-fiber",
"keywords": [
Expand Down Expand Up @@ -44,7 +44,8 @@
"chromatic": "chromatic --project-token $CHROMATIC_PROJECT_TOKEN",
"copy": "copyfiles package.json README.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.husky=undefined; this.prettier=undefined; this.jest=undefined; this['lint-staged']=undefined;\"",
"copy:native": "copyfiles -u 2 src/native/package.json dist/native",
"release": "semantic-release"
"release": "changeset publish",
"changeset": "changeset"
},
"dependencies": {
"@babel/runtime": "^7.26.0",
Expand Down Expand Up @@ -78,6 +79,7 @@
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"@babel/preset-typescript": "^7.26.0",
"@changesets/cli": "^2.29.8",
"@chromatic-com/storybook": "^4.1.3",
"@eslint/compat": "^1.2.3",
"@eslint/eslintrc": "^3.2.0",
Expand Down Expand Up @@ -118,7 +120,6 @@
"rollup-plugin-multi-input": "^1.5.0",
"rollup-plugin-terser": "^7.0.2",
"seedrandom": "^3.0.5",
"semantic-release": "^24.2.0",
"serve": "^14.2.4",
"storybook": "^10.1.11",
"three": "^0.159.0",
Expand Down
20 changes: 0 additions & 20 deletions release.config.js

This file was deleted.

Loading