Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
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": []
}
11 changes: 11 additions & 0 deletions .changeset/type-safety-improvements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@adcp/client": patch
---

Improve type safety and use structured data from schemas

- Replace custom types with generated schema types (Format, Product, etc)
- Remove all 'as any' type casts for better type safety
- Remove 30+ lines of workaround code for non-standard responses
- Export key schema types for public API (Format, Product, PackageRequest, CreativeAsset, CreativePolicy)
- Client now expects servers to return proper structured responses per AdCP spec
72 changes: 0 additions & 72 deletions .github/workflows/release-please.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
branches:
- main

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

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm ci

- name: Build
run: npm run build:lib

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
title: 'chore: release package'
commit: 'chore: release package'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 0 additions & 3 deletions .release-please-manifest.json

This file was deleted.

138 changes: 64 additions & 74 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,42 +427,31 @@ Should show:

### 🚨 AUTOMATED RELEASE PROCESS 🚨

**IMPORTANT**: This project uses **Release Please** for fully automated releases. You should NEVER manually:
- Edit CHANGELOG.md
- Bump version in package.json
- Create GitHub releases
- Publish to npm

Everything is automated based on conventional commits.
**IMPORTANT**: This project uses **Changesets** for version management and releases.

### How It Works

1. **Commit using conventional commit format**:
1. **Create a changeset for your changes**:
```bash
# Feature (minor bump: 0.2.3 → 0.3.0)
git commit -m "feat: add new tool support"

# Bug fix (patch bump: 0.2.3 → 0.2.4)
git commit -m "fix: resolve authentication issue"

# Breaking change (major bump: 0.2.3 → 1.0.0)
git commit -m "feat!: change API signature"
# or
git commit -m "feat: new API

BREAKING CHANGE: old API removed"
npm run changeset
```
This will prompt you to:
- Select the version bump type (patch/minor/major)
- Write a summary of the changes
- Create a markdown file in `.changeset/`

2. **Push to main branch**:
2. **Commit the changeset with your code**:
```bash
git push origin main
git add .changeset/
git commit -m "feat: add new feature"
git push
```

3. **Release Please creates/updates a Release PR**:
- PR title: "chore(main): release X.Y.Z"
3. **GitHub Actions creates a Release PR**:
- PR title: "chore: release package"
- Automatically updates CHANGELOG.md
- Automatically bumps version in package.json
- Aggregates all commits since last release
- Combines all changesets since last release

4. **Review and merge the Release PR**:
- Check the generated CHANGELOG.md
Expand All @@ -471,91 +460,92 @@ Everything is automated based on conventional commits.

5. **Automatic publishing**:
- Merging Release PR creates a GitHub release
- GitHub release triggers npm publish automatically
- GitHub Actions publishes to npm automatically
- Package appears on npm registry

### Conventional Commit Types

| Type | Description | Version Bump | Example |
|------|-------------|--------------|---------|
| `feat:` | New feature (library code) | Minor (0.x.0) | `feat: add webhook support` |
| `fix:` | Bug fix (library code) | Patch (0.0.x) | `fix: resolve timeout issue` |
| `feat!:` or `BREAKING CHANGE:` | Breaking change | Major (x.0.0) | `feat!: redesign API` |
| `docs:` | Documentation only | None | `docs: update README` |
| `chore:` | Maintenance tasks | None | `chore: update deps` |
| `refactor:` | Code refactoring | None | `refactor: simplify logic` |
| `test:` | Adding/updating tests | None | `test: add unit tests` |
| `perf:` | Performance improvements | Patch (0.0.x) | `perf: optimize parser` |
| `ci:` | CI configuration | None | `ci: update workflow` |
| `build:` | Build system changes | None | `build: update tsconfig` |
### Version Bump Guidelines

### Commit Scopes for Library vs Testing
| Type | When to Use | Example |
|------|-------------|---------|
| `patch` | Bug fixes, minor improvements | 2.0.1 → 2.0.2 |
| `minor` | New features, non-breaking changes | 2.0.1 → 2.1.0 |
| `major` | Breaking changes | 2.0.1 → 3.0.0 |

**IMPORTANT**: To avoid releasing when only server/testing code changes, use appropriate scopes:
### Creating Changesets

**Library Changes (triggers release)**:
**For a single change:**
```bash
feat: add new tool # Library feature
fix: resolve auth bug # Library bug fix
perf: optimize client performance # Library performance
refactor: simplify protocol logic # Library refactoring
npm run changeset
# Select: patch/minor/major
# Write: "fix: resolve authentication issue"
```

**Testing/Server Changes (NO release)**:
**For multiple changes in one PR:**
```bash
chore(server): update UI styling # Server/UI changes
test(server): add integration test # Test framework changes
chore(testing): update test UI # Testing UI changes
docs(testing): update testing guide # Testing docs
ci: update deployment workflow # CI changes (no release)
npm run changeset # First change
npm run changeset # Second change
# Commit all changesets together
```

**Mixed Changes**: If you change both library AND server code in one PR, use the library type:
### Changeset Examples

**Bug Fix (patch):**
```bash
feat: add webhook support
# This commit includes both library changes and test UI updates
npm run changeset
# Select: patch
# Summary: "Fixed MCP structuredContent parsing for stringified JSON"
```

### Commit Linting
**New Feature (minor):**
```bash
npm run changeset
# Select: minor
# Summary: "Added webhook signature verification support"
```

All PRs are automatically checked for conventional commit format:
- PR title must follow conventional commits
- All commits in PR must follow conventional commits
- CI will fail if commits don't follow the format
**Breaking Change (major):**
```bash
npm run changeset
# Select: major
# Summary: "Removed deprecated Agent class, use ADCPClient instead"
```

### Verification Commands

```bash
# Check if Release PR exists
gh pr list --label "autorelease: pending"
# Check current version
npm version

# View release history
gh release list
# View changesets that haven't been released
ls .changeset/*.md

# Check npm package versions
npm view @adcp/client versions

# View release history
gh release list

# Monitor release workflow
gh run list --workflow=release-please.yml
gh run list --workflow=release.yml
```

### Emergency Manual Release (Use ONLY if automated process fails)

```bash
# 1. Manually update version
npm version patch|minor|major
# 1. Version packages
npm run version

# 2. Create GitHub release
gh release create v$(node -p "require('./package.json').version") --generate-notes
# 2. Publish to npm
npm run release

# 3. Publish to npm (GitHub Actions should do this automatically)
npm publish --access public
# 3. Create GitHub release
gh release create v$(node -p "require('./package.json').version") --generate-notes
```

**Remember**: Trust the automation. Just write good conventional commits and merge Release PRs.
**Remember**: Always create a changeset for library changes. The automation handles the rest.

---

*Last updated: 2025-10-01 (Migrated to Release Please for automated releases)*
*Last updated: 2025-10-17 (Migrated to Changesets for version management)*
*Project: AdCP Testing Framework*
*Environment: Fly.io Production*
Loading
Loading