diff --git a/.github/workflows/pr-quality-checks.yml b/.github/workflows/pr-quality-checks.yml new file mode 100644 index 00000000..3be5a8c4 --- /dev/null +++ b/.github/workflows/pr-quality-checks.yml @@ -0,0 +1,66 @@ +name: PR Quality Checks + +on: + pull_request: + paths: + - 'apps/**' + - 'packages/**' + - '.github/workflows/**' + - '*.json' + - '*.js' + - '*.ts' + - '*.tsx' + - 'yarn.lock' + - 'turbo.json' + - 'biome.json' + - '!**/*.md' + - '!**/*.txt' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + quality-checks: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '22.9.0' + + - name: Setup Yarn Corepack + run: corepack enable + + - name: Install dependencies + run: yarn install + + - name: Cache Turbo + uses: actions/cache@v4 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}- + ${{ runner.os }}-turbo-${{ github.ref_name }}- + ${{ runner.os }}-turbo- + + - name: Run Turbo lint + run: yarn turbo run lint + + - name: Run Turbo typecheck + run: yarn turbo run type-check --filter=@lambdacurry/forms + + - name: Summary + run: | + echo "## PR Quality Checks Summary" >> $GITHUB_STEP_SUMMARY + echo "✅ Linting passed (Biome)" >> $GITHUB_STEP_SUMMARY + echo "✅ TypeScript compilation passed" >> $GITHUB_STEP_SUMMARY + echo "✅ All checks completed with Turbo caching" >> $GITHUB_STEP_SUMMARY diff --git a/.vscode/settings.json b/.vscode/settings.json index 9052de7d..98647df4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,11 +24,8 @@ "source.fixAll.biome": "explicit", "source.organizeImports.biome": "explicit" }, - "tailwindCSS.classAttributes": [ - "class", - "className", - "ngClass", - "class:list", - "wrapperClassName" - ] -} \ No newline at end of file + "tailwindCSS.classAttributes": ["class", "className", "ngClass", "class:list", "wrapperClassName"], + "[jsonc]": { + "editor.defaultFormatter": "biomejs.biome" + } +} diff --git a/apps/docs/package.json b/apps/docs/package.json index aa7cc625..5c78bc60 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -31,6 +31,9 @@ "@storybook/testing-library": "^0.2.2", "@tailwindcss/postcss": "^4.1.8", "@tailwindcss/vite": "^4.0.0", + "@testing-library/jest-dom": "^6.8.0", + "@testing-library/react": "^16.3.0", + "@types/jest": "^30.0.0", "@types/react": "^19.0.0", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", diff --git a/apps/docs/src/examples/middleware-example.tsx b/apps/docs/src/examples/middleware-example.tsx index 7faf2ed0..c1cf3a9c 100644 --- a/apps/docs/src/examples/middleware-example.tsx +++ b/apps/docs/src/examples/middleware-example.tsx @@ -33,11 +33,7 @@ export const action = async ({ context }: ActionFunctionArgs) => { // Component export default function MiddlewareExample() { - const { - handleSubmit, - formState: { errors }, - register, - } = useRemixForm({ + const methods = useRemixForm({ mode: 'onSubmit', resolver, }); @@ -46,12 +42,12 @@ export default function MiddlewareExample() {

Remix Hook Form v7 Middleware Example

- -
+ +
- + - +