diff --git a/.github/workflows/ci-app-client.yaml b/.github/workflows/ci-app-client.yaml new file mode 100644 index 00000000..da989b81 --- /dev/null +++ b/.github/workflows/ci-app-client.yaml @@ -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 diff --git a/.github/workflows/ci-app-server.yaml b/.github/workflows/ci-app-server.yaml new file mode 100644 index 00000000..20e211a7 --- /dev/null +++ b/.github/workflows/ci-app-server.yaml @@ -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 diff --git a/packages/app-client/package.json b/packages/app-client/package.json index 5baea76c..f4386fac 100644 --- a/packages/app-client/package.json +++ b/packages/app-client/package.json @@ -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", diff --git a/packages/app-client/tsconfig.json b/packages/app-client/tsconfig.json index 9d9269ff..bcbb5f06 100644 --- a/packages/app-client/tsconfig.json +++ b/packages/app-client/tsconfig.json @@ -14,6 +14,7 @@ "noEmit": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, - "isolatedModules": true + "isolatedModules": true, + "skipLibCheck": true } } diff --git a/packages/app-server/package.json b/packages/app-server/package.json index 11d48a6b..884f871b 100644 --- a/packages/app-server/package.json +++ b/packages/app-server/package.json @@ -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", diff --git a/packages/app-server/src/modules/shared/validation/validation.ts b/packages/app-server/src/modules/shared/validation/validation.ts index 891e6db8..3a19367a 100644 --- a/packages/app-server/src/modules/shared/validation/validation.ts +++ b/packages/app-server/src/modules/shared/validation/validation.ts @@ -40,6 +40,6 @@ function buildValidator({ 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' } }); diff --git a/packages/app-server/vite.config.ts b/packages/app-server/vite.config.ts deleted file mode 100644 index 00d2052b..00000000 --- a/packages/app-server/vite.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import build from '@hono/vite-cloudflare-pages'; -import devServer from '@hono/vite-dev-server'; -import adapter from '@hono/vite-dev-server/cloudflare'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - plugins: [ - build(), - devServer({ - adapter, - entry: 'src/index.cloudflare.ts', - }), - ], -});