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
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ reviews:
instructions: 'Review test coverage and test quality. Ensure proper mocking and test isolation. Check for edge cases and error scenarios. Verify proper async test handling.'
- path: '**/*.cy.tsx'
instructions: 'Review Cypress component tests for proper component interaction testing. Ensure proper test selectors and assertions. Check for proper test data setup and cleanup.'
- path: 'tsup.config.ts'
- path: 'tsdown.config.ts'
instructions: 'Review build configuration for proper bundling and output formats. Ensure proper entry points and external dependencies handling.'
Comment thread
m2na7 marked this conversation as resolved.
- path: 'package.json'
instructions: 'Review dependencies for security vulnerabilities and version compatibility. Ensure proper peer dependencies for React library. Check scripts and build configuration.'
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
types: [opened, synchronize, reopened]

jobs:
quality:
name: Check quality
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
strategy:
matrix:
command: ['type-check', 'format:check', 'build:lib', 'build']
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

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

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

- name: Run command
run: pnpm run ${{ matrix.command }}
continue-on-error: ${{ matrix.command == 'build:lib' }}

check-bundle-size:
name: Bundle size check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
contents: read
pull-requests: write
needs: quality
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

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

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

- name: Check library bundle size
uses: preactjs/compressed-size-action@v2
with:
build-script: 'build:lib'
pattern: './dist/index.{js,mjs}'
exclude: '{**/*.map,**/node_modules/**}'
repo-token: '${{ secrets.GITHUB_TOKEN }}'
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
- uses: pnpm/action-setup@v4
name: Setup pnpm

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

Expand All @@ -40,14 +40,6 @@ jobs:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Update Package Version
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
npm version ${{ github.event.inputs.version }} -m "Release v%s"
git push origin HEAD:main
git push --tags

- name: Run Unit Tests
run: pnpm run test:unit:run

Expand All @@ -60,6 +52,14 @@ jobs:
- name: Build Library
run: pnpm run build:lib

- name: Update Package Version
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
npm version ${{ github.event.inputs.version }} -m "Release v%s"
git push origin HEAD:main
git push --tags

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build/
# Config files
tsconfig.json
tsconfig.node.json
tsup.config.ts
tsdown.config.ts
.gitignore
.swcrc

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"coverage:open": "open coverage/lcov-report/index.html",
"coverage:reset": "rm -rf coverage .nyc_output",
"eject": "react-scripts eject",
"build:lib": "tsup",
"dev:lib": "tsup --watch",
"build:lib": "tsdown",
"dev:lib": "tsdown --watch",
"playground": "cd playground && pnpm run dev",
"playground:build": "cd playground && pnpm run build",
"playground:preview": "cd playground && pnpm run preview",
Expand Down Expand Up @@ -98,7 +98,7 @@
"nyc": "^17.1.0",
"prettier": "^3.6.2",
"react-scripts": "5.0.1",
"tsup": "^8.0.0",
"tsdown": "^0.12.9",
"typescript": "^5.8.2",
"vite": "^6.0.3",
"vite-plugin-istanbul": "^6.0.2",
Expand All @@ -109,7 +109,7 @@
"react-dom": "^18 || ^19"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"packageManager": "pnpm@10.12.0"
}
Loading