@fern-api/replay
v0.7.0
Published
Automatically preserves SDK customizations across Fern regenerations
Keywords
Readme
@fern-api/replay
Automatically preserves SDK customizations across Fern regenerations.
What it does
Fern Replay detects user edits to generated SDK code, stores them as patches, and re-applies them after each regeneration using 3-way merge. This means your customizations survive fern generate without manual intervention.
Pipeline
- Detect — Find commits since last generation
- Store — Save patches to
replay.lock - Generate — Run generator (overwrites all)
- Replay — Apply patches via 3-way merge
- Commit — Commit the merged result (or surface conflicts)
Install
npm install @fern-api/replayDevelopment
npm install
npm run build
npm testLocal Development with Fern CLI
To use a local version of @fern-api/replay with the Fern CLI monorepo:
# From the fern-replay directory
cd /path/to/fern-replay
pnpm link --global
# From the fern monorepo root
cd /path/to/fern
pnpm link --global @fern-api/replayVerify the link is working:
ls -la node_modules/@fern-api/replay
# Should show a symlink pointing to your local fern-replay directoryAny changes you make in fern-replay will be picked up immediately without reinstalling.
To unlink and restore the published npm version:
pnpm unlink @fern-api/replay
pnpm installLicense
MIT
