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
10 changes: 5 additions & 5 deletions .cursor/BUGBOT.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import { buildPayload } from './utils';
- **Test edge cases** - Empty states, loading states, error states
- **Test validation** - Form validation errors and field-level errors
- **Fixtures per flow** - Organize test data in `src/flows/*/tests/fixtures.ts`
- **Coverage required** - Run `npm run test:coverage` to check coverage
- **Coverage required** - Run `pnpm test:coverage` to check coverage

**Test File Conventions:**

Expand Down Expand Up @@ -155,7 +155,7 @@ Package is consumed by external applications - monitor bundle impact:
- **Multiple entry points** - Verify exports in `package.json` work correctly
- **Build output check** - Review `dist/` size after builds

**Check:** Run `npm run build` and compare `dist/` size before/after.
**Check:** Run `pnpm build` and compare `dist/` size before/after.

### 3. Error Handling

Expand Down Expand Up @@ -219,7 +219,7 @@ Forms are central to this library - ensure consistency:

OpenAPI-driven development - never manually write client code:

- **Regenerate after schema changes** - Run `npm run openapi-ts` after API updates
- **Regenerate after schema changes** - Run `pnpm openapi-ts` after API updates
- **Use generated types** - Import types from `src/client/types.gen.ts`
- **Use generated SDK** - Import API methods from `src/client/sdk.gen.ts`
- **Query hooks pattern** - Wrap generated client in custom hooks (see `src/common/api.ts`)
Expand Down Expand Up @@ -386,7 +386,7 @@ flows/[FlowName]/
- **JSDoc for public APIs** - All exported functions, hooks, and components need JSDoc
- **README updates** - Update main README when adding new flows or features
- **Type documentation** - Complex types should have comments explaining usage
- **Changelog** - Follows conventional commits (auto-generated via `npm run release`)
- **Changelog** - Follows conventional commits (auto-generated via `pnpm release`)
- **Migration guides** - Breaking changes need migration documentation
- **Example app** - Update `example/` app when adding new features

Expand Down Expand Up @@ -517,7 +517,7 @@ This project uses automated releases via GitHub Actions:
**Manual release:**

```bash
npm run release
pnpm release
```

This will:
Expand Down
56 changes: 38 additions & 18 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ jobs:
with:
node-version: '24.15.0'

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

- name: Install dependencies
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Run format check
run: npm run check-format
run: pnpm check-format

- name: Run lint
run: npm run lint
run: pnpm lint

- name: Run type check
run: npm run type-check
run: pnpm type-check

build-and-exports:
name: Build and Check Exports
Expand All @@ -44,14 +47,17 @@ jobs:
with:
node-version: '24.15.0'

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

- name: Install dependencies
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Build
run: npm run build
run: pnpm build

- name: Check exports
run: npm run check-exports
run: pnpm check-exports

tests:
name: Unit Tests
Expand All @@ -66,11 +72,14 @@ jobs:
with:
node-version: '24.15.0'

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

- name: Install dependencies
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Run tests
run: npm run test
run: pnpm test

example-checks:
name: Example App Checks
Expand All @@ -85,23 +94,26 @@ jobs:
with:
node-version: '24.15.0'

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

- name: Install main package dependencies
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Build main package
run: npm run build
run: pnpm build

- name: Install example dependencies
working-directory: ./example
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Lint example app
working-directory: ./example
run: npm run lint
run: pnpm lint

- name: Type-check example app
working-directory: ./example
run: npm run type-check
run: pnpm type-check

deploy-remote-flows:
name: Deploy Remote Flows Preview
Expand Down Expand Up @@ -176,16 +188,24 @@ jobs:
with:
node-version: '24.15.0'

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

- name: Install main package dependencies
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

# example/ consumes the SDK via a `link:..` symlink to the repo root, so
# dist/ must be built for anything that resolves the SDK locally.
- name: Build main package
run: pnpm build

- name: Install example/ dependencies
working-directory: ./example
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Install Playwright
working-directory: ./example
run: npx playwright install chromium --with-deps
run: pnpm exec playwright install chromium --with-deps

- name: Download remote-flows URL
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
Expand All @@ -203,7 +223,7 @@ jobs:
VERCEL_BYPASS_TOKEN: ${{ secrets.VERCEL_BYPASS_TOKEN }}
DEBUG: pw:api
working-directory: ./example
run: npx playwright test --project=chromium
run: pnpm exec playwright test --project=chromium

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: ${{ !cancelled() }}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ jobs:
with:
node-version: '24.15.0'

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

- name: Install dependencies
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Run tests with coverage
run: npm run test:coverage
run: pnpm test:coverage

- name: Upload coverage artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
Expand All @@ -45,8 +48,11 @@ jobs:
with:
node-version: '24.15.0'

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

- name: Install dependencies
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Download coverage artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
Expand All @@ -57,7 +63,7 @@ jobs:
- name: Extract coverage percentage
id: coverage
run: |
COVERAGE_JSON=$(npm exec tsx scripts/extract-coverage.ts --coverage-dir coverage)
COVERAGE_JSON=$(pnpm exec tsx scripts/extract-coverage.ts --coverage-dir coverage)
COVERAGE=$(echo "$COVERAGE_JSON" | node -pe "JSON.parse(require('fs').readFileSync(0, 'utf-8')).lines.pct.toFixed(2)")
echo "coverage=$COVERAGE" >> $GITHUB_OUTPUT
echo "Coverage: $COVERAGE%"
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/e2e-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,24 @@ jobs:
with:
node-version: '24.15.0'

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

- name: Install main package dependencies
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

# example/ consumes the SDK via a `link:..` symlink to the repo root, so
# dist/ must be built for anything that resolves the SDK locally.
- name: Build main package
run: pnpm build

- name: Install example/ dependencies
working-directory: ./example
run: npm ci --include=optional --ignore-scripts
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Install Playwright browsers
working-directory: ./example
run: npx playwright install ${{ matrix.browser }} --with-deps
run: pnpm exec playwright install ${{ matrix.browser }} --with-deps

- name: Download remote-flows URL
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
Expand All @@ -87,7 +95,7 @@ jobs:
VERCEL_BYPASS_TOKEN: ${{ secrets.VERCEL_BYPASS_TOKEN }}
DEBUG: pw:api
working-directory: ./example
run: npx playwright test --project=${{ matrix.browser }}
run: pnpm exec playwright test --project=${{ matrix.browser }}

- name: Upload Playwright report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
Expand All @@ -114,7 +122,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
title: `Nightly E2E Workflow Failed - ${new Date().toISOString().split('T')[0]}`,
body: `## Nightly E2E Workflow Failure\n\n**Workflow Run:** ${runUrl}\n\n**Date:** ${new Date().toISOString()}\n\n**Note:** This could be a deployment failure, test failure, or an infrastructure issue (npm install, browser setup, etc.). Please review the workflow logs and Playwright reports in the artifacts.`,
body: `## Nightly E2E Workflow Failure\n\n**Workflow Run:** ${runUrl}\n\n**Date:** ${new Date().toISOString()}\n\n**Note:** This could be a deployment failure, test failure, or an infrastructure issue (pnpm install, browser setup, etc.). Please review the workflow logs and Playwright reports in the artifacts.`,
assignees: ['gabrielseco', 'jordividaller', 'cammellos']
});
console.log(`Created issue #${issue.data.number}`);
Loading
Loading