Skip to content

Commit 4ff3c97

Browse files
authored
feat: release v15 under the latest npm tag (#3418)
1 parent 126b657 commit 4ff3c97

10 files changed

Lines changed: 55 additions & 35 deletions

File tree

‎.releaserc.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"branches": [
33
{
4-
"name": "release-v14",
4+
"name": "master",
55
"channel": "latest"
66
},
77
{
8-
"name": "master",
9-
"prerelease": "rc",
10-
"channel": "rc"
8+
"name": "release-v14",
9+
"channel": "v14",
10+
"range": "14.x"
1111
}
1212
],
1313
"plugins": [

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Agents should prioritize API stability and high test coverage when changing code
1010

1111
Stream's React Chat SDK — React components, hooks and contexts for building chat UIs on the Stream Chat API. The published package (`stream-chat-react`) lives at the repo root; `examples/*` are private Yarn workspaces consuming it via `workspace:^`.
1212

13-
This is the **v15** line, developed on `master` and published as release candidates (npm `rc`). The stable v14 line lives on `release-v14` (npm `latest`). It is built on `stream-chat` v10 (the "LLC"), which owns message, thread and composer state; this package renders it.
13+
This is the **v15** line, developed on `master` and published under npm `latest`. The v14 maintenance line lives on `release-v14` (npm `release-v14`). It is built on `stream-chat` v10 (the "LLC"), which owns message, thread and composer state; this package renders it.
1414

1515
## Tech & toolchain
1616

@@ -443,7 +443,7 @@ Implement MediaRecorder API integration with MP3 encoding.
443443
Closes #123
444444
```
445445

446-
- v15 is a major release line: a change that breaks the v14 API is marked with `!` and a `BREAKING CHANGE:` footer, and gets an entry in `ai-docs/ai-migration-v14-v15.md`.
446+
- `master` publishes v15 under `latest`, so a commit marked with `!` or a `BREAKING CHANGE:` footer releases 16.0.0. Mark a commit as breaking only when the next major is planned (see `developers/BRANCHES.md`).
447447
- Never commit directly to `master` or `release-v14`; always create a feature branch (see `developers/BRANCHES.md`). v15 work targets `master`; v14 fixes target `release-v14`.
448448
- Never commit unless explicitly requested.
449449

‎developers/BRANCHES.md‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,25 @@
22

33
We have two base branches:
44

5-
- `master` — the v15 line. Releases from it are published as release candidates (`15.0.0-rc.N`) under the npm `rc` tag.
6-
- `release-v14` — the stable v14 line. Releases from it are published under the npm `latest` tag.
5+
- `master` — the v15 line. Releases from it are published under the npm `latest` tag.
6+
- `release-v14` — the v14 maintenance line. Releases from it are published under the npm `release-v14` tag (`npm install stream-chat-react@release-v14`).
7+
8+
Older lines (`release-v13`, `release-v12`, …) are maintenance branches as well, published under the npm `release-v13`, `release-v12`, … tags.
79

810
If you want to implement a solution, create a branch from the base branch it belongs to: `master` for v15 work, `release-v14` for a v14 fix. A base branch should receive updates only through squash-merging feature branches - each of these squashed commits should be up to date with its base branch and should be passing CI requirements.
911

1012
A fix that applies to both lines is merged into `release-v14` and ported to `master`.
1113

12-
`release-v14` must not receive breaking changes (`!` or a `BREAKING CHANGE:` footer). It is the release branch in `.releaserc.json`, which semantic-release cannot limit to `14.x`, so a breaking change there would publish v15 under `latest`.
14+
`release-v14` accepts only 14.x releases and must not receive breaking changes. It is a maintenance branch in `.releaserc.json` (`"range": "14.x"`), so semantic-release refuses a release that would leave 14.x: a `fix:` or `feat:` commit with a `BREAKING CHANGE:` footer makes the release fail with `EINVALIDNEXTVERSION` instead of publishing v15. Its commit analyzer uses the `angular` preset, which does not read `!` in a header, so a `fix!:` commit on `release-v14` releases nothing.
15+
16+
A breaking change on `master` releases the next major (16.0.0) under `latest`. Mark a commit on `master` as breaking only when the next major is planned.
1317

1418
The branch architecture in this repository is as follows:
1519

1620
```shell
17-
NPM (rc) <--- master <--- branch_solution_x
18-
<--- branch_solution_y
19-
...
20-
NPM (latest) <--- release-v14 <--- branch_fix_x
21-
...
21+
NPM (latest) <--- master <--- branch_solution_x
22+
<--- branch_solution_y
23+
...
24+
NPM (release-v14) <--- release-v14 <--- branch_fix_x
25+
...
2226
```

‎developers/RELEASE.md‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,39 @@ The `stream-chat-react` package follows semantic versioning and the release is t
99

1010
In order to get the above generated outputs, each contributor should follow [Angular's Commit Message Format rules](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format).
1111

12+
## Branches and npm dist-tags
13+
14+
The Release workflow runs `semantic-release` on the branch you pick, so that branch's own `.releaserc.json` decides where its releases go. `master` and `release-v14` keep the same `branches` list:
15+
16+
| Branch | Entry in `branches` | Versions | npm dist-tag |
17+
| ------------- | -------------------------------------------------------------- | -------- | ------------- |
18+
| `master` | `{ "name": "master", "channel": "latest" }` | 15.x | `latest` |
19+
| `release-v14` | `{ "name": "release-v14", "channel": "v14", "range": "14.x" }` | 14.x | `release-v14` |
20+
21+
`@semantic-release/npm` publishes a release under its channel as the dist-tag, and prefixes a channel that reads as a version range with `release-`: the `v14` channel publishes under `release-v14`. Older maintenance branches work the same way (`release-v13` publishes under `release-v13`).
22+
23+
A maintenance branch only publishes versions inside its `range`. If its commits call for a version outside it, for example 15.0.0 from a breaking change on `release-v14`, the release fails with `EINVALIDNEXTVERSION` and nothing is published.
24+
1225
## Major version release preparations
1326

14-
We need to:
27+
While the next major is in prerelease, `master` is a prerelease branch, for example `{ "name": "master", "prerelease": "rc", "channel": "rc" }`, and the previous line's branch (for example `release-v14`) is the release branch on `latest`. When the major goes GA:
1528

16-
1. Convert the current latest branch to a version branch by creating a PR with adjusted `.releaserc.json`. Example PR: https://github.com/GetStream/stream-chat-react/pull/2507
29+
1. Make the previous line a maintenance branch. On that branch, set the `branches` list in `.releaserc.json` to `master` on `latest` plus the branch with its own channel and range, as in the table above. Merge this first: once it is in, a release from that branch can no longer move `latest`. Example PR: https://github.com/GetStream/stream-chat-react/pull/3122
30+
2. On `master`, replace the prerelease entry with `{ "name": "master", "channel": "latest" }` and list the maintenance branch next to it, the same list as in step 1. Example PR: https://github.com/GetStream/stream-chat-react/pull/3121
31+
3. Run the Release workflow on `master`, with a dry run first. A release branch ignores the `-rc.N` tags, so `semantic-release` compares `master` with its last stable tag. The breaking commits since then make the release `X.0.0`, published under `latest`. No extra commit is needed.
32+
4. Run the Release workflow on the maintenance branch once, at any time after step 1. With no new fixes it only adds the branch's last version to the branch's dist-tag (for example `14.16.1` to `release-v14`), so `npm install stream-chat-react@release-v14` works before the first maintenance release. The workflow publishes through npm trusted publishing (OIDC). If this step fails with `E401` on `npm dist-tag`, the package's trusted publisher settings on npmjs.com do not allow `npm dist-tag`: allow it, or add the tag by hand with `npm dist-tag add stream-chat-react@14.16.1 release-v14`. A re-run does not retry the step.
1733

18-
2. Configure the `master` branch back from `prerelease` to `latest` and add a config for the next version branch also designated as `latest`. Example PR: https://github.com/GetStream/stream-chat-react/pull/2506.
34+
If step 3 runs before step 1, the next release from the previous line's branch publishes under `latest` and replaces the new major there.
1935

2036
## Required steps
2137

2238
At the moment these manual actions have to be taken to achieve a successful release:
2339

2440
1. make sure that all the new required features and bug fixes in peer dependency repositories `@stream-io/stream-chat-css` and `stream-chat-js` are released
2541
2. make sure that the peer dependencies `@stream-io/stream-chat-css` and `stream-chat-js` are installed at their latest version (see `package.json`, `yarn.lock`) (if applicable)
26-
3. squash-merge required pull requests to `master` branch with appropriate message name, for example: `fix(scope): new feature`, if this feature is breaking, make sure to include `BREAKING CHANGE: <reason>` in the message footer
42+
3. squash-merge required pull requests to their base branch (`master` or `release-v14`) with appropriate message name, for example: `fix(scope): new feature`. A breaking change (`!` or a `BREAKING CHANGE: <reason>` footer) releases a new major from `master`, so merge one only when the next major is planned (see `developers/BRANCHES.md`)
2743
4. navigate to ["Actions"](https://github.com/GetStream/stream-chat-react/actions) and in the left bar select the "Release" workflow
28-
5. click "Run workflow" and select the branch you want to release from then adjust the prompt options and click "Run workflow", note that allowed branches are branch names starting with `release`, `rc` and `master` (a dry run can use any branch), extend the workflow condition and `.releaserc.json` as needed. The `master` branch is the release-candidate branch.
44+
5. click "Run workflow" and select the branch you want to release from then adjust the prompt options and click "Run workflow", note that allowed branches are branch names starting with `release`, `rc` and `master` (a dry run can use any branch), extend the workflow condition and `.releaserc.json` as needed. Releases from `master` go to `latest`, releases from `release-v14` to `release-v14` (see [Branches and npm dist-tags](#branches-and-npm-dist-tags)).
2945

3046
## Available release prompt options
3147

‎examples/ai-chatbot/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"next": "^16.2.4",
1919
"react": "^19.2.6",
2020
"react-dom": "^19.2.6",
21-
"stream-chat": "10.0.0-rc.34",
21+
"stream-chat": "^10.0.0",
2222
"stream-chat-react": "workspace:^"
2323
},
2424
"devDependencies": {

‎examples/cookbook/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react": "^19.2.6",
2020
"react-dom": "^19.2.6",
2121
"react-leaflet": "^5.0.0",
22-
"stream-chat": "10.0.0-rc.34",
22+
"stream-chat": "^10.0.0",
2323
"stream-chat-react": "workspace:^"
2424
},
2525
"devDependencies": {

‎examples/tutorial/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"emoji-mart": "^5.6.0",
1717
"react": "^19.2.6",
1818
"react-dom": "^19.2.6",
19-
"stream-chat": "10.0.0-rc.34",
19+
"stream-chat": "^10.0.0",
2020
"stream-chat-react": "workspace:^"
2121
},
2222
"devDependencies": {

‎examples/vite/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"modern-normalize": "^3.0.1",
1919
"react": "^19.2.6",
2020
"react-dom": "^19.2.6",
21-
"stream-chat": "10.0.0-rc.34",
21+
"stream-chat": "^10.0.0",
2222
"stream-chat-react": "workspace:^"
2323
},
2424
"devDependencies": {

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"modern-normalize": "^3.0.1",
164164
"react": "^19.0.0 || ^18.0.0 || ^17.0.0",
165165
"react-dom": "^19.0.0 || ^18.0.0 || ^17.0.0",
166-
"stream-chat": "^10.0.0-rc.34"
166+
"stream-chat": "^10.0.0"
167167
},
168168
"peerDependenciesMeta": {
169169
"@a2ui/react": {
@@ -246,7 +246,7 @@
246246
"react-dom": "^19.2.6",
247247
"sass": "^1.100.0",
248248
"semantic-release": "^25.0.3",
249-
"stream-chat": "10.0.0-rc.34",
249+
"stream-chat": "^10.0.0",
250250
"typescript": "^6.0.3",
251251
"typescript-eslint": "^8.59.4",
252252
"vite": "^8.1.3",

‎yarn.lock‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,7 +3288,7 @@ __metadata:
32883288
react: "npm:^19.2.6"
32893289
react-dom: "npm:^19.2.6"
32903290
sass: "npm:^1.100.0"
3291-
stream-chat: "npm:10.0.0-rc.34"
3291+
stream-chat: "npm:^10.0.0"
32923292
stream-chat-react: "workspace:^"
32933293
typescript: "npm:^6.0.3"
32943294
languageName: unknown
@@ -3332,7 +3332,7 @@ __metadata:
33323332
react: "npm:^19.2.6"
33333333
react-dom: "npm:^19.2.6"
33343334
react-leaflet: "npm:^5.0.0"
3335-
stream-chat: "npm:10.0.0-rc.34"
3335+
stream-chat: "npm:^10.0.0"
33363336
stream-chat-react: "workspace:^"
33373337
typescript: "npm:^6.0.3"
33383338
vite: "npm:^8.1.3"
@@ -3350,7 +3350,7 @@ __metadata:
33503350
emoji-mart: "npm:^5.6.0"
33513351
react: "npm:^19.2.6"
33523352
react-dom: "npm:^19.2.6"
3353-
stream-chat: "npm:10.0.0-rc.34"
3353+
stream-chat: "npm:^10.0.0"
33543354
stream-chat-react: "workspace:^"
33553355
typescript: "npm:^6.0.3"
33563356
vite: "npm:^8.1.3"
@@ -3378,7 +3378,7 @@ __metadata:
33783378
react: "npm:^19.2.6"
33793379
react-dom: "npm:^19.2.6"
33803380
sass: "npm:^1.100.0"
3381-
stream-chat: "npm:10.0.0-rc.34"
3381+
stream-chat: "npm:^10.0.0"
33823382
stream-chat-react: "workspace:^"
33833383
typescript: "npm:^6.0.3"
33843384
vite: "npm:^8.1.3"
@@ -12058,7 +12058,7 @@ __metadata:
1205812058
remark-parse: "npm:^11.0.0"
1205912059
sass: "npm:^1.100.0"
1206012060
semantic-release: "npm:^25.0.3"
12061-
stream-chat: "npm:10.0.0-rc.34"
12061+
stream-chat: "npm:^10.0.0"
1206212062
typescript: "npm:^6.0.3"
1206312063
typescript-eslint: "npm:^8.59.4"
1206412064
unified: "npm:^11.0.5"
@@ -12081,7 +12081,7 @@ __metadata:
1208112081
modern-normalize: ^3.0.1
1208212082
react: ^19.0.0 || ^18.0.0 || ^17.0.0
1208312083
react-dom: ^19.0.0 || ^18.0.0 || ^17.0.0
12084-
stream-chat: ^10.0.0-rc.34
12084+
stream-chat: ^10.0.0
1208512085
dependenciesMeta:
1208612086
"@parcel/watcher":
1208712087
built: true
@@ -12111,9 +12111,9 @@ __metadata:
1211112111
languageName: unknown
1211212112
linkType: soft
1211312113

12114-
"stream-chat@npm:10.0.0-rc.34":
12115-
version: 10.0.0-rc.34
12116-
resolution: "stream-chat@npm:10.0.0-rc.34"
12114+
"stream-chat@npm:^10.0.0":
12115+
version: 10.0.0
12116+
resolution: "stream-chat@npm:10.0.0"
1211712117
dependencies:
1211812118
"@stream-io/logger": "npm:^2.1.0"
1211912119
"@stream-io/state-store": "npm:^1.2.0"
@@ -12124,7 +12124,7 @@ __metadata:
1212412124
built: true
1212512125
husky:
1212612126
built: true
12127-
checksum: 10c0/ab420864180b851b849e9abf69577d136cb341af302694cf7436dc81eee54cbbf51181cffff4a353f3417bd312a1d5c244f514c489f600e5fd3e01ef001957f9
12127+
checksum: 10c0/d44d6ddc3c417844f0d43b10ccf30dd483291fb7e7843173f00129759aa20020f05167e6037f6e8fbefc25f65c19a0c967058fa559bb4b23a4d8b255180a5b4c
1212812128
languageName: node
1212912129
linkType: hard
1213012130

0 commit comments

Comments
 (0)