Skip to content

Commit

Permalink
chore(app): added ci (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinTh committed Aug 23, 2024
1 parent 6f84b5f commit 28af0e2
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 19 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 package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@enclosed/root",
"version": "1.0.0",
"description": "",
"description": "Send private and secure note",
"packageManager": "[email protected]",
"main": "index.js",
"scripts": {
"build:app": "pnpm -p --filter @enclosed/app-* run build && mkdir -p packages/app-server/dist-app && cp -r packages/app-*/dist/* packages/app-server/dist-app"
Expand Down
4 changes: 3 additions & 1 deletion packages/app-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@enclosed/app-client",
"type": "module",
"version": "0.0.0",
"packageManager": "[email protected]",
"description": "",
"license": "MIT",
"scripts": {
Expand All @@ -13,7 +14,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
}
}
7 changes: 6 additions & 1 deletion packages/app-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@enclosed/app-server",
"type": "module",
"version": "1.0.0",
"packageManager": "[email protected]",
"description": "",
"author": "",
"license": "ISC",
Expand All @@ -17,7 +18,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 28af0e2

Please sign in to comment.