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
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "chromaui/addon-visual-tests"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch"
}
5 changes: 5 additions & 0 deletions .changeset/swift-trains-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chromatic-com/storybook': patch
---

Add provenance to npm releases
13 changes: 11 additions & 2 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Enable corepack (for pnpm)
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version-file: .nvmrc

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

- name: Publish to Chromatic
uses: chromaui/action@v1
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish preview

on:
pull_request:
push:
branches:
- main

env:
CI: true
COREPACK_INTEGRITY_KEYS: 0

jobs:
release-preview:
name: Publish preview releases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Enable corepack (for pnpm)
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
cache: pnpm
node-version-file: '.nvmrc'

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

- name: Build
run: pnpm build

- name: Publish preview releases
run: pnpm pkg-pr-new publish --pnpm
53 changes: 34 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,51 @@
name: Release

on: [push]
on:
push:
branches:
- main

env:
CI: true
COREPACK_INTEGRITY_KEYS: 0

permissions:
id-token: write # Required for OIDC
contents: write # Required for auto shipit
pull-requests: write # Required for auto shipit
contents: write
pull-requests: write
id-token: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
if: github.repository == 'chromaui/addon-visual-tests'
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
id: app-token
with:
app-id: ${{ vars.STORYBOOK_BOT_APP_ID }}
private-key: ${{ secrets.STORYBOOK_BOT_APP_PRIVATE_KEY }}

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0
fetch-tags: true
clean: true

- name: Use Node.js
uses: actions/setup-node@v4
- name: Enable corepack (for pnpm)
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
cache: 'yarn'
node-version-file: .nvmrc
cache: pnpm
node-version-file: '.nvmrc'

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

- name: Create Release
run: yarn run release
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
with:
publish: pnpm release
commitMode: github-api
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
21 changes: 15 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Enable corepack (for pnpm)
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version-file: .nvmrc

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

- name: Lint
run: yarn lint
run: pnpm lint

- name: Check formatting
run: yarn format --no-write --check
run: pnpm exec prettier . --check

- name: Typecheck
run: yarn typecheck
run: pnpm typecheck

- name: Test
run: yarn test
run: pnpm test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
Expand Down
10 changes: 1 addition & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@ dist/
node_modules/
.DS_Store
.env
yarn-error.log
pnpm-debug.log*
storybook-static/
build-storybook.log
chromatic.log
chromatic-build-*.xml
chromatic-diagnostics.json
coverage/

**/.pnp.*
**/.yarn/*
!**/.yarn/patches
!**/.yarn/plugins
!**/.yarn/releases
!**/.yarn/sdks
!**/.yarn/versions
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.yarn
dist
public
src/gql
Expand Down
942 changes: 0 additions & 942 deletions .yarn/releases/yarn-4.12.0.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

46 changes: 46 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Agent Instructions for addon-visual-tests

## Release Process

This repo uses [Changesets](https://github.com/changesets/changesets) for versioning and publishing.

```bash
pnpm changeset # Create a changeset for your changes
pnpm release # Build and publish (CI handles this automatically)
```

**Before committing, always run the format script to avoid CI failures:**

```bash
pnpm format
```

### Creating Changesets (MANDATORY for user-facing changes)

When making changes that affect users (bug fixes, new features, breaking changes, dependency updates), you **MUST** create a changeset file.

**Steps:**

1. Create a new `.md` file in the `.changeset/` directory
2. Use naming convention: `<random-word>-<random-word>-<random-word>.md` (for example, `swift-trains-smile.md`)
3. Format:

```markdown
---
'@chromatic-com/storybook': patch
---

Short description of what changed.
```

**Version bump types:**

- `patch` — Bug fixes, internal improvements, dependency updates (non-breaking)
- `minor` — New features (backward compatible)
- `major` — Breaking changes

**Writing the description — keep it short:**

- **Default: one sentence.** Most changes need nothing more than a brief statement of what changed.
- Only write more when you are introducing a **breaking change** or a **new public API** that users need to understand or act on — in those cases add migration steps or usage examples.
- Do **not** explain why the change was made, internal implementation details, or repeat what is obvious from the diff.
Loading
Loading