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

This directory contains changeset files that track changes to packages in the Object UI monorepo.

## What are Changesets?

Changesets are a way to declare your intent to release packages. They help us:
- Track which packages have changed
- Determine appropriate version bumps (major, minor, patch)
- Generate comprehensive changelogs
- Automate the release process

## Quick Start

### Creating a Changeset

When you make changes to packages, run:

```bash
pnpm changeset
```

This will guide you through:
1. Selecting which packages changed
2. Choosing the type of version bump
3. Writing a description of the changes

### Example

```bash
$ pnpm changeset

🦋 Which packages would you like to include?
◉ @object-ui/react
◯ @object-ui/core
◯ @object-ui/components

🦋 What kind of change is this for @object-ui/react?
◯ major (breaking change)
◉ minor (new feature)
◯ patch (bug fix)

🦋 Please enter a summary for this change:
Add support for custom validators in form components
```

### When to Create a Changeset

✅ **DO** create a changeset for:
- New features
- Bug fixes
- Breaking changes
- Performance improvements
- API changes

❌ **DON'T** create a changeset for:
- Documentation updates
- Changes to examples or apps
- Internal refactoring with no API changes
- Test-only updates

## Automated Release Process

1. **Merge PR with changeset** → Triggers automation
2. **Bot creates "Version Packages" PR** → Updates versions and changelogs
3. **Merge Version PR** → Automatically publishes to npm

## Learn More

- [Full Changesets Documentation](https://github.com/changesets/changesets)
- [Object UI Contributing Guide](../CONTRIBUTING.md#versioning-and-releases)
- [Common Questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"@apps/*",
"@examples/*"
Comment on lines +11 to +12
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ignore patterns use '@apps/' and '@examples/', but these don't match typical monorepo package naming conventions where packages are usually scoped with the organization name. Verify these patterns match the actual package names in your monorepo. If packages are named differently (e.g., 'apps/' or 'examples/' without the @ prefix), update the patterns accordingly.

Copilot uses AI. Check for mistakes.
]
}
84 changes: 81 additions & 3 deletions .github/WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,85 @@ Creates GitHub releases and publishes packages.

**Note**: npm publishing is currently disabled. Uncomment the publish step when ready.

### 8. Stale Issues & PRs
### 8. Changeset Release (Automated)

**File**: `changeset-release.yml`
**Triggers**: Push to `main` branch

Automated version management and package publishing using Changesets.

**What It Does**:
1. Detects changesets in merged PRs
2. Creates/updates a "Version Packages" PR that:
- Bumps package versions based on changesets
- Updates CHANGELOG.md files
- Removes consumed changeset files
3. When the Version PR is merged:
- Publishes updated packages to npm
- Creates GitHub releases with tags

**How It Works**:

```mermaid
graph LR
A[PR with changeset merged] --> B[Workflow runs]
B --> C{Changesets exist?}
C -->|Yes| D[Create/Update Version PR]
C -->|No| E[Skip]
D --> F[Version PR merged]
F --> G[Publish to npm]
G --> H[Create GitHub Release]
```

**Developer Workflow**:
1. Create PR with code changes
2. Run `pnpm changeset` to create a changeset file
3. Commit changeset file with your PR
4. When PR is merged, automation takes over
5. Review and merge the automated "Version Packages" PR
6. Packages are published automatically

**Benefits**:
- No manual version number editing
- Automatic changelog generation
- Coordinated releases across packages
- Clear versioning based on semantic versioning
- Prevents accidental version conflicts

**Required Setup**:
- `NPM_TOKEN` secret must be configured in repository settings
- Changesets should be included in all PRs with package changes

**Note**: See [CONTRIBUTING.md](../CONTRIBUTING.md#versioning-and-releases) for details on creating changesets.

### 9. Changeset Check

**File**: `changeset-check.yml`
**Triggers**: Pull Requests (opened, synchronized, labeled)

Ensures PRs that modify packages include a changeset.

**What It Does**:
- Checks if PR modifies any files in `packages/`
- Verifies a changeset file exists (`.changeset/*.md`)
- Fails the check if changeset is missing
- Can be skipped with `skip-changeset` or `dependencies` label

**When to Skip**:
- Documentation-only changes
- Changes to examples or apps
- Test-only updates
- Automated dependency updates (Dependabot)

**How to Pass**:
1. Run `pnpm changeset` locally
2. Follow the prompts to create a changeset
3. Commit the generated `.changeset/*.md` file
4. OR add `skip-changeset` label if not needed

This workflow helps maintain consistent versioning and comprehensive changelogs.

### 10. Stale Issues & PRs

**File**: `stale.yml`
**Triggers**: Daily schedule, Manual workflow dispatch
Expand All @@ -134,7 +212,7 @@ Manages stale issues and pull requests.
- Exempt labels: `pinned`, `security`, `critical`, `bug`, `enhancement`
- Can be reopened if activity resumes

### 9. Dependabot Auto-merge
### 11. Dependabot Auto-merge

**File**: `dependabot-auto-merge.yml`
**Configuration**: `dependabot.yml`
Expand All @@ -153,7 +231,7 @@ Automatically manages dependency updates.
- Groups related dependencies
- Limits to 10 open PRs

### 10. Auto Changelog
### 12. Auto Changelog

**File**: `changelog.yml`
**Triggers**: Release published, Manual workflow dispatch
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Changeset Check

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

permissions:
contents: read

jobs:
check:
name: Check for Changeset
runs-on: ubuntu-latest
# Skip this check if PR has 'skip-changeset' label or only changes non-package files
if: |
!contains(github.event.pull_request.labels.*.name, 'skip-changeset') &&
!contains(github.event.pull_request.labels.*.name, 'dependencies')

steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check for changesets
run: |
# Check if there are any changesets
if [ ! "$(ls -A .changeset/*.md 2>/dev/null | grep -v 'README.md')" ]; then
# Check if any package files were changed
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q '^packages/'; then
echo "❌ This PR modifies packages but doesn't include a changeset"
echo ""
echo "To add a changeset, run: pnpm changeset"
echo ""
echo "If this PR doesn't need a changeset (docs only, etc.),"
echo "add the 'skip-changeset' label to the PR"
echo ""
echo "📚 Learn more: https://github.com/objectstack-ai/objectui/blob/main/CONTRIBUTING.md#versioning-and-releases"
exit 1
else
echo "✅ No package changes detected, skipping changeset check"
fi
else
echo "✅ Changeset found"
fi

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

on:
push:
branches:
- main

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

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

jobs:
release:
name: Changeset Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

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

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests
run: pnpm test

- name: Build packages
run: pnpm build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset:version
publish: pnpm changeset:publish
title: 'chore: release packages'
commit: 'chore: release packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading
Loading