sdk-upstream-sync solves fork drift. If you maintain a fork of any npm or GitHub SDK, upstream ships changes, your fork drifts, and you find out when something breaks in production. This tool diffs API contracts, auto-applies safe changes, and generates an investigation report for anything risky.
GitHub
nometria/sdk-upstream-sync
npm
@nometria-ai/sdk-upstream-sync
Install
Setup
Usage
How it works
| Step | What happens |
|---|---|
| 1. Fetch | Gets the latest upstream commit SHA — exits cleanly if already in sync |
| 2. Extract contracts | Reads exports, methods, and module structure from both sides via GitHub API |
| 3. Diff contracts | Detects removed exports/methods as breaking, new ones as safe additions |
| 4. Check thresholds | Auto-applies if: ≤ 20 files changed, ≤ 600 LOC, zero breaking changes |
| 5. Apply or report | Patches your fork, or generates sync/report.md for manual review |
Safety thresholds
| Condition | Action |
|---|---|
| ≤ 20 files, ≤ 600 LOC, no breaking changes | Auto-apply patch |
| > 20 files changed | Generate investigation report only |
| > 600 LOC changed | Generate investigation report only |
| Any breaking change detected | Generate investigation report only |
Automate with GitHub Actions
This tool was originally built to maintain Nometria’s fork of the Base44 JavaScript SDK and keep it in sync with upstream API changes automatically.