Skip to content

Commit 6ffb370

Browse files
chore(internal): bump IR to 67.2.0 for SseStreamChunk.resumable (#15812)
PR #15795 added an optional `resumable` field to `SseStreamChunk` in `ir-types-latest/definition/http.yml` but did not bump the IR version, so no new `@fern-fern/ir-sdk` package was published. Bump VERSION 67.1.0 -> 67.2.0 and append a corresponding CHANGELOG entry so the field becomes visible to downstream consumers. Also document the per-PR IR-version-bump requirement in packages/ir-sdk/CLAUDE.md (Adding New IR Features step 4 + revised Version Release Process) and the root CLAUDE.md (Feature Addition Workflow), so this is not missed in future feature PRs.
1 parent fa12ac0 commit 6ffb370

5 files changed

Lines changed: 65 additions & 22 deletions

File tree

CLAUDE.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,17 @@ Multi-stage process: API Schema → IR Updates → Generator Updates → Release
189189
**Stages**:
190190
1. **API Schema**: Update `/fern/apis/<definition>/` → Run generator command (check `generators.yml` in each API folder)
191191
2. **IR Updates**: Modify `/packages/ir-sdk/fern/apis/ir-types-latest/definition/``pnpm ir:generate`
192-
3. **Versioning**: Update `CHANGELOG.md`, `VERSION`, and `/packages/cli/cli/versions.yml`
193-
4. **Compile**: `pnpm compile` and fix breaking changes (common: `switch` statements need new cases)
194-
5. **Generator Updates**: One PR for CLI/IR updates (merge first), then separate PR(s) for generator changes
195-
6. **IR Migrations**: Update `/packages/cli/generation/ir-migrations/` for backward compatibility
196-
197-
**Key Points**: Multiple PRs required, automatic publishing via `versions.yml`, generators use published (not workspace) IR versions
192+
3. **IR Versioning (REQUIRED for any change to `ir-types-latest`)**:
193+
- Bump `packages/ir-sdk/fern/apis/ir-types-latest/VERSION` (minor for additive/optional fields, patch for non-schema, major only as a separate batched PR)
194+
- Add an entry to `packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md` (hand-edited; no `changes/unreleased/` for IR)
195+
- Do **not** edit `packages/cli/cli/versions.yml` `irVersion` for minor/patch — that field tracks the IR major and only changes during major bumps
196+
- See `packages/ir-sdk/CLAUDE.md` for the full checklist
197+
4. **CLI Versioning**: Add a CLI changelog entry under `packages/cli/cli/changes/unreleased/` (drives CLI semver only — see `packages/cli/CLAUDE.md`)
198+
5. **Compile**: `pnpm compile` and fix breaking changes (common: `switch` statements need new cases)
199+
6. **Generator Updates**: One PR for CLI/IR updates (merge first), then separate PR(s) for generator changes
200+
7. **IR Migrations**: Only required for major IR bumps — add under `/packages/cli/generation/ir-migrations/`
201+
202+
**Key Points**: Multiple PRs required, automatic publishing via `versions.yml`, generators use published (not workspace) IR versions. Forgetting to bump `ir-types-latest/VERSION` means no new `@fern-fern/ir-sdk` is published and the new field is invisible to downstream consumers.
198203

199204
### Other Core Workflows
200205

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# yaml-language-server: $schema=../../../../../fern-changes-yml.schema.json
2+
3+
- summary: |
4+
Bump IR to 67.2.0 to publish the optional `resumable` field added to
5+
`SseStreamChunk` in PR #15795. Without the IR version bump, no new
6+
`@fern-fern/ir-sdk` minor was published and the field stayed invisible
7+
to downstream consumers.
8+
type: chore

packages/ir-sdk/CLAUDE.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,27 +112,47 @@ pnpm generate
112112
- Update switch statements for new union cases
113113
- Test generator compatibility
114114

115-
### 4. Add Migrations (if breaking)
115+
### 4. Bump the IR version (REQUIRED)
116+
**Every PR that modifies `ir-types-latest/definition/` must bump the IR version, otherwise no new IR package is published and consumers can't pick up the change.**
117+
118+
The IR carries its own semver in `packages/ir-sdk/fern/apis/ir-types-latest/VERSION` (currently `MAJOR.MINOR.PATCH`, e.g. `67.2.0`). Pick the bump based on the change:
119+
120+
- **Minor bump** (`67.1.0``67.2.0`): additive, backward-compatible changes — new optional fields, new union variants on forward-compatible enums, additive type declarations. This is the common case.
121+
- **Patch bump** (`67.1.0``67.1.1`): non-schema fixes (doc-string edits, comment-only changes, internal refactors that don't alter the public type surface).
122+
- **Major bump** (`67.x.x``68.0.0`): breaking changes — required-field additions, field removals/renames, type changes, removed enum values. **Major bumps are batched and done as a separate "Update IR to N+1" PR**, not per-feature; they require freezing the previous latest into `ir-types-vN/`, adding a `vN+1-to-vN` migration under `packages/cli/generation/ir-migrations/`, and re-aliasing `IrVersions.ts`.
123+
124+
**Per-PR checklist for additive IR changes:**
125+
126+
1. Edit `packages/ir-sdk/fern/apis/ir-types-latest/definition/<file>.yml`.
127+
2. Run `pnpm ir:generate` from the repo root to regenerate `packages/ir-sdk/src/sdk/...` artifacts.
128+
3. **Bump `packages/ir-sdk/fern/apis/ir-types-latest/VERSION`** (minor for additive, patch for non-schema).
129+
4. **Add an entry to `packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md`** describing the new field/feature, dated today, under a new `## [vMAJ.MIN.PATCH] - YYYY-MM-DD` heading at the top.
130+
5. Run `pnpm --filter @fern-api/ir-sdk compile` to confirm the workspace types still build.
131+
6. Do **not** edit `packages/cli/cli/versions.yml`'s `irVersion` — that field tracks the IR *major* and is only updated during major-version bumps.
132+
7. Do **not** edit `generators.yml` coordinates (`irV66`, `fern_fern_ir_v66`) — those reference the published external IR major and are stable across minor bumps.
133+
134+
The IR changelog is **hand-edited**, not driven by a `changes/unreleased/` directory like the CLI.
135+
136+
### 5. Add Migrations (only on major bump)
116137
```bash
117-
# Add migration in CLI package
138+
# Required only when freezing latest into a new numbered version
118139
vim packages/cli/generation/ir-migrations/src/migrations/
119140
```
120141

121142
## Version Release Process
122143

123-
### 1. Prepare Release
124-
- Ensure `ir-types-latest` is stable
125-
- Update `CHANGELOG.md` with changes
126-
- Update `VERSION` file
127-
128-
### 2. Create New Version
129-
- Copy `ir-types-latest` to `ir-types-v{n+1}`
130-
- Update `packages/cli/cli/versions.yml`
131-
132-
### 3. Test Compatibility
133-
- Run full test suite (`pnpm test:ete`)
134-
- Test seed across all generators
135-
- Validate migration logic
144+
### Per-PR (minor / patch) — see "Adding New IR Features" above
145+
- Bump `packages/ir-sdk/fern/apis/ir-types-latest/VERSION`
146+
- Append entry to `packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md`
147+
- Release automation publishes a new `@fern-fern/ir-sdk` minor on merge to main
148+
149+
### Major-version bump (batched, separate PR)
150+
1. Freeze current `ir-types-latest` contents into `packages/ir-sdk/fern/apis/ir-types-v{N}/`
151+
2. Set `ir-types-latest/VERSION` to `{N+1}.0.0`
152+
3. Add `packages/cli/generation/ir-migrations/src/migrations/v{N+1}-to-v{N}/` with backward migration logic
153+
4. Re-alias `packages/cli/generation/ir-migrations/src/ir-versions/IrVersions.ts` so `V{N+1} = @fern-api/ir-sdk` and add a frozen `@fern-fern/ir-v{N}-sdk` import
154+
5. Update `packages/cli/cli/versions.yml` `irVersion: {N}``{N+1}` for the next CLI release
155+
6. Run full test suite (`pnpm test:ete`) and seed across all generators
136156

137157
## Best Practices
138158

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
67.1.0
1+
67.2.0

packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [v67.2.0] - 2026-05-08
9+
10+
- Feature: Add optional `resumable` field to `SseStreamChunk`. When `true`, signals
11+
to generators that the SSE endpoint supports auto-reconnection via standard SSE
12+
primitives (`Last-Event-ID` request header and `retry:` directive). Populated from
13+
the new `x-fern-streaming.resumable` OpenAPI extension (inheritable from the
14+
document root) and the `resumable` field on Fern Definition `response-stream`
15+
blocks. Defaults to `false`; non-resumable JSON streaming endpoints always emit
16+
`false` since they have no `Last-Event-ID` semantics.
17+
818
## [v67.1.0] - 2026-05-01
919

1020
- Feature: Add optional `defaultValue` field to `HttpHeader`, `QueryParameter`,

0 commit comments

Comments
 (0)