From 386f6e99c5764afaf5614b9cbf0ededaf47ae54c Mon Sep 17 00:00:00 2001 From: sor4chi Date: Sun, 3 Dec 2023 12:38:05 +0900 Subject: [PATCH 1/4] chore: enable skip lib check --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 67fc18f..70640e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "moduleResolution": "node", "esModuleInterop": true, "strict": true, + "skipLibCheck": true, "lib": ["esnext"] } } From e65103d13a81e68482e16b77673065f688432fb6 Mon Sep 17 00:00:00 2001 From: sor4chi Date: Sun, 3 Dec 2023 12:38:30 +0900 Subject: [PATCH 2/4] chore: configure typecheck command --- package.json | 1 + packages/hono-do/package.json | 3 ++- turbo.json | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 428a321..72a662b 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "format:check": "turbo format:check", "build": "turbo build", "test": "turbo test", + "test:type": "turbo test:type", "release": "pnpm build && changeset publish" }, "devDependencies": { diff --git a/packages/hono-do/package.json b/packages/hono-do/package.json index f6d7757..3b447c3 100644 --- a/packages/hono-do/package.json +++ b/packages/hono-do/package.json @@ -11,7 +11,8 @@ "format": "prettier --write \"src/**/*.{ts,tsx}\"", "format:check": "prettier --check \"src/**/*.{ts,tsx}\"", "build": "tsc -p tsconfig.build.json", - "test": "vitest" + "test": "vitest", + "test:type": "vitest typecheck" }, "keywords": [ "hono", diff --git a/turbo.json b/turbo.json index 421a5b3..306e294 100644 --- a/turbo.json +++ b/turbo.json @@ -16,6 +16,9 @@ "format:check": {}, "test": { "dependsOn": ["^build"] + }, + "test:type": { + "dependsOn": ["^build"] } } } From 24e2ac1aac347e3a55d2c74722c268f65001ec25 Mon Sep 17 00:00:00 2001 From: sor4chi Date: Sun, 3 Dec 2023 12:39:30 +0900 Subject: [PATCH 3/4] ci: add type test check workflow --- .github/workflows/check.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3d40a5f..7a001f5 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -130,6 +130,48 @@ jobs: - name: Test run: pnpm test + test-type: + name: Test Type + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Launch Turbo Remote Cache Server + uses: dtinth/setup-github-actions-caching-for-turbo@v1.1.0 + with: + cache-prefix: turbogha_ + + - name: Setup Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - uses: pnpm/action-setup@v2 + name: Install pnpm + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + + - name: Test + run: pnpm test:type + build: name: Build runs-on: ubuntu-latest From 33d04ef5401796c5fe0bc235848919eb0880c0c2 Mon Sep 17 00:00:00 2001 From: sor4chi Date: Sun, 3 Dec 2023 12:41:32 +0900 Subject: [PATCH 4/4] chore: configure *.test.ts as type test target --- packages/hono-do/vitest.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/hono-do/vitest.config.ts b/packages/hono-do/vitest.config.ts index d35ef31..8075253 100644 --- a/packages/hono-do/vitest.config.ts +++ b/packages/hono-do/vitest.config.ts @@ -4,5 +4,8 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { globals: true, + typecheck: { + include: ["tests/**/*.test.ts"], + }, }, });