Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
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/config@3.1.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["uniswapx-integration"]
}
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ sdks/universal-router-sdk/ @Uniswap/swap-be
sdks/v2-sdk/ @Uniswap/swap-be
sdks/v3-sdk/ @Uniswap/swap-be
sdks/v4-sdk/ @Uniswap/swap-be

# Automated version bumps (Changesets Version Packages PR)
# Last match wins — allows any of these teams to approve version-only changes
**/package.json @Uniswap/swap-be @Uniswap/protocols
**/CHANGELOG.md @Uniswap/swap-be @Uniswap/protocols
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
environment:
name: production
runs-on:
group: npm-deploy
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: bullfrogsec/bullfrog@dcde5841b19b7ef693224207a7fdec67fce604db # v0.8.3
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
submodules: "true"
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
with:
cache: yarn
node-version: 22

- name: Install dependencies
run: yarn --immutable

- name: Build SDK's
run: yarn g:build

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@70b8f42bea198d6c9323eb37781844e8498e3766 # v1
with:
version: yarn version-packages
publish: yarn g:release
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
56 changes: 0 additions & 56 deletions .github/workflows/semantic-release.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enableGlobalCache: false

enableTelemetry: false

enableTransparentWorkspaces: false
enableTransparentWorkspaces: true

logFilters:
- code: YN0002
Expand Down
68 changes: 59 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,66 @@ yarn g:test
yarn sdk @uniswap/{sdk-name} {command}
```

## Publishing SDK's
## Making Changes & Publishing

Publishing of each SDK is done on merge to main using semantic-release and semantic-release-monorepo. PR titles / commits follow angular conventional commits with custom settings that map as follows:
This repo uses [Changesets](https://github.com/changesets/changesets) for versioning and publishing, with the `workspace:` protocol for internal dependencies.

```markdown
- `fix(SDK name):` will trigger a patch version
- `<type>(public):` will trigger a patch version
- `feat(SDK name):` will trigger a minor version
- `feat(breaking):` will trigger a major version for a breaking change
- `chore(<scope>):` will not trigger a release
### 1. Make your code changes on a branch

Internal dependencies (e.g., `v4-sdk` depending on `sdk-core`) use the `workspace:` protocol, so they resolve to the local workspace during development. This means you can change multiple packages in a single PR — no need for sequential publish-wait-bump cycles.

### 2. Add a changeset

After making your changes, run:

```
yarn changeset
```

Versions will only be generated based on the changelog of the relevant SDK's folder/files.
This interactive CLI will ask you:
- **Which packages should be bumped?** Select the packages you directly changed (e.g., `@uniswap/sdk-core`).
- **What type of bump?** `patch`, `minor`, or `major`.
- **Summary** A short description of the change (this becomes the changelog entry).

This creates a markdown file in `.changeset/` that looks like:

```md
---
"@uniswap/sdk-core": minor
---

Add support for Soneium chain
```

You **only need to list the packages you directly changed**. Changesets automatically bumps dependents (e.g., bumping `sdk-core` will also bump `v2-sdk`, `v3-sdk`, `v4-sdk`, `router-sdk`, `universal-router-sdk`, etc.).

### 3. Open your PR

Commit the changeset file alongside your code changes. Reviewers can see exactly what version bumps are planned.

### 4. What happens on merge to `main`

The CI workflow (`changesets/action`) runs automatically and does one of two things:

- **If there are pending changeset files:** It opens (or updates) a **"Version Packages" PR** that bumps versions in every affected `package.json`, updates changelogs, and removes the consumed changeset files.
- **If the "Version Packages" PR is merged:** It publishes all packages with new versions to npm.

### Example: Adding a new chain

Previously this required 4 sequential PRs with publish-wait-bump cycles. Now it's a single PR:

```
1. Edit sdk-core (add chain) + universal-router-sdk (use chain)
2. Run `yarn changeset` and select both packages
3. Open PR, merge
4. Merge the auto-generated "Version Packages" PR
5. All affected packages publish to npm
```

### Quick reference

| Command | What it does |
|---|---|
| `yarn changeset` | Create a changeset file (run before opening your PR) |
| `yarn version-packages` | Apply pending changesets to bump versions (CI does this) |
| `yarn g:release` | Publish all bumped packages to npm (CI does this) |
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
"version": "0.0.0",
"dependencies": {
"@babel/runtime": "7.18.9",
"@changesets/cli": "2.30.0",
"@manypkg/cli": "^0.19.2",
"@semantic-release/exec": "6.0.3",
"@typescript-eslint/eslint-plugin": "^8.38.0",
"danger": "11.2.6",
"eslint": "^8.57.0",
"eslint-plugin-prettier": "^3.4.1",
"husky": "^8.0.3",
"semantic-release": "^25.0.1",
"semantic-release-monorepo": "8.0.2",
"syncpack": "^8.5.14",
"turbo": "1.10.16"
},
Expand All @@ -25,9 +23,11 @@
"g:check:deps:mismatch": "manypkg check",
"g:build": "turbo run build",
"g:lint": "turbo run lint",
"g:release": "turbo run release --concurrency=1 --continue",
"g:release": "changeset publish",
"g:test": "turbo run test",
"g:typecheck": "turbo run typecheck",
"changeset": "changeset",
"version-packages": "changeset version",
"sdk": "yarn workspace",
"postinstall": "husky"
},
Expand Down
5 changes: 0 additions & 5 deletions publishing/release-rules.cjs

This file was deleted.

32 changes: 2 additions & 30 deletions sdks/flashtestations-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@uniswap/flashtestations-sdk",
"version": "1.1.0",
"author": "Melvillian",
"description": "⚒️ An SDK for working with Flashteststations",
"repository": "https://github.com/Uniswap/sdks.git",
Expand Down Expand Up @@ -28,7 +29,7 @@
"build:types": "tsc -p tsconfig.types.json",
"lint": "eslint src --ext .ts",
"test": "jest",
"release": "semantic-release"
"release": "changeset publish"
},
"exports": {
".": {
Expand All @@ -41,35 +42,6 @@
"access": "public",
"provenance": true
},
"release": {
"extends": "semantic-release-monorepo",
"branches": [
{
"name": "main",
"prerelease": false
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": "../../publishing/release-rules.cjs"
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/exec",
{
"successCmd": "git restore yarn.lock && yarn",
"failCmd": "git restore yarn.lock && yarn",
"execCwd": "../.."
}
]
]
},
"sideEffects": false,
"prettier": {
"printWidth": 80,
Expand Down
32 changes: 2 additions & 30 deletions sdks/permit2-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@uniswap/permit2-sdk",
"version": "1.4.0",
"description": "An sdk for interacting with permit2.",
"repository": "https://github.com/Uniswap/sdks.git",
"keywords": [
Expand Down Expand Up @@ -29,7 +30,7 @@
"clean": "rm -rf ./dist",
"interop": "yarn node writeInterop.js",
"lint": "prettier --check src/",
"release": "semantic-release",
"release": "changeset publish",
"test": "jest"
},
"dependencies": {
Expand All @@ -50,34 +51,5 @@
"publishConfig": {
"access": "public",
"provenance": true
},
"release": {
"extends": "semantic-release-monorepo",
"branches": [
{
"name": "main",
"prerelease": false
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": "../../publishing/release-rules.cjs"
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/exec",
{
"successCmd": "git restore yarn.lock && yarn",
"failCmd": "git restore yarn.lock && yarn",
"execCwd": "../.."
}
]
]
}
}
11 changes: 11 additions & 0 deletions sdks/router-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @uniswap/router-sdk

## 2.7.2

### Patch Changes

- Updated dependencies
- @uniswap/sdk-core@7.13.0
- @uniswap/v2-sdk@4.19.2
- @uniswap/v3-sdk@3.29.2
- @uniswap/v4-sdk@1.29.2
Loading
Loading