Skip to content

Commit

Permalink
chore(app): added ci
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinTh committed Aug 23, 2024
1 parent 6f84b5f commit f818f3e
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 18 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci-app-client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI - App Client

on:
pull_request:
push:
branches:
- main

jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/app-client

steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
corepack: true
cache: 'pnpm'

- name: Install dependencies
run: pnpm i
working-directory: ./

- name: Run linters
run: pnpm lint

- name: Type check
run: pnpm typecheck

- name: Run unit test
run: pnpm test

- name: Build the app
run: pnpm build
39 changes: 39 additions & 0 deletions .github/workflows/ci-app-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI - App Server

on:
pull_request:
push:
branches:
- main

jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/app-server

steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
corepack: true
cache: 'pnpm'

- name: Install dependencies
run: pnpm i
working-directory: ./

- name: Run linters
run: pnpm lint

- name: Type check
run: pnpm typecheck

- name: Run unit test
run: pnpm test

- name: Build the app
run: pnpm build
3 changes: 2 additions & 1 deletion packages/app-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"lint:fix": "eslint --fix .",
"test": "pnpm run test:unit",
"test:unit": "vitest run",
"test:unit:watch": "vitest watch"
"test:unit:watch": "vitest watch",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@kobalte/core": "^0.13.4",
Expand Down
3 changes: 2 additions & 1 deletion packages/app-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"noEmit": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true
"isolatedModules": true,
"skipLibCheck": true
}
}
6 changes: 5 additions & 1 deletion packages/app-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"preview": "wrangler pages dev",
"deploy": "$npm_execpath run build && wrangler pages deploy",
"lint": "eslint .",
"lint:fix": "eslint --fix ."
"lint:fix": "eslint --fix .",
"test": "pnpm run test:unit",
"test:unit": "vitest run",
"test:unit:watch": "vitest watch",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@hono/node-server": "^1.12.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ function buildValidator<Target extends keyof ValidationTargets>({ target, error
};
}

export const validateJsonBody = buildValidator({ target: 'json', error: { message: 'Invalid request body', code: 'server.invalid_request.body.json' } });
export const validateJsonBody = buildValidator({ target: 'json', error: { message: 'Invalid request body', code: 'server.invalid_request.body' } });
export const validateQuery = buildValidator({ target: 'query', error: { message: 'Invalid query parameters', code: 'server.invalid_request.query' } });
export const validateParams = buildValidator({ target: 'param', error: { message: 'Invalid URL parameters', code: 'server.invalid_request.params' } });
14 changes: 0 additions & 14 deletions packages/app-server/vite.config.ts

This file was deleted.

0 comments on commit f818f3e

Please sign in to comment.