Skip to content

Commit 377dddc

Browse files
authored
Merge pull request #270 from Gigadrive/feature/typecheck-ci
feat: add typecheck CI step and fix Turborepo caching
2 parents b5ee20c + eede7f9 commit 377dddc

13 files changed

Lines changed: 48 additions & 18 deletions

File tree

.github/workflows/test.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,28 @@ jobs:
7777
- name: Prettier
7878
run: pnpm format
7979

80+
typecheck:
81+
name: Type Check
82+
runs-on: blacksmith-4vcpu-ubuntu-2204
83+
timeout-minutes: 10
84+
permissions:
85+
contents: read
86+
steps:
87+
- name: Checkout
88+
uses: actions/checkout@v4
89+
90+
- name: Setup
91+
uses: ./.github/actions/setup
92+
93+
- name: Type Check
94+
run: pnpm typecheck
95+
8096
summary:
8197
name: Summary (CI)
8298
runs-on: blacksmith-2vcpu-ubuntu-2204
8399
timeout-minutes: 5
84100
if: always()
85-
needs: [test, lint, format]
101+
needs: [test, lint, format, typecheck]
86102
permissions:
87103
contents: read
88104
steps:
@@ -91,8 +107,9 @@ jobs:
91107
TEST: ${{ needs.test.result }}
92108
LINT: ${{ needs.lint.result }}
93109
FORMAT: ${{ needs.format.result }}
110+
TYPECHECK: ${{ needs.typecheck.result }}
94111
run: |
95-
if [[ "$TEST" != "success" || "$LINT" != "success" || "$FORMAT" != "success" ]]; then
112+
if [[ "$TEST" != "success" || "$LINT" != "success" || "$FORMAT" != "success" || "$TYPECHECK" != "success" ]]; then
96113
echo "One or more jobs failed or were cancelled."
97114
exit 1
98115
fi

AGENTS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ pnpm build # Build all packages (via Turborepo)
2828
pnpm build:no-cache # Build without Turbo cache
2929
pnpm clean # Remove all dist directories
3030

31-
# Lint & Format
31+
# Lint, Format & Type Check
3232
pnpm lint # ESLint check
3333
pnpm lint:fix # ESLint autofix
3434
pnpm format # Prettier check
3535
pnpm format:fix # Prettier autofix
36+
pnpm typecheck # TypeScript type check (via Turborepo)
3637

3738
# Test (Vitest)
3839
pnpm test # Run all tests once
@@ -49,8 +50,8 @@ pnpm vitest run -t "should merge two objects correctly"
4950
pnpm vitest run packages/commons/
5051
```
5152

52-
**CI runs three parallel checks on every PR:** `pnpm test`, `pnpm lint`, `pnpm format`.
53-
All three must pass.
53+
**CI runs four parallel checks on every PR:** `pnpm test`, `pnpm lint`, `pnpm format`, `pnpm typecheck`.
54+
All four must pass.
5455

5556
## Test Conventions
5657

local/tsup/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"scripts": {
1919
"build": "tsup",
2020
"build:watch": "tsup --watch",
21-
"preinstall": "pnpm build"
21+
"preinstall": "pnpm build",
22+
"typecheck": "tsc --noEmit"
2223
}
2324
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"lint:fix": "eslint --cache --fix --ext .ts,.tsx,.js,.jsx .",
2323
"test": "vitest run",
2424
"test:coverage": "vitest run --coverage",
25-
"test:watch": "vitest"
25+
"test:watch": "vitest",
26+
"typecheck": "turbo run typecheck"
2627
},
2728
"devDependencies": {
2829
"@changesets/cli": "^2.29.7",

packages/build-utils/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
],
2525
"scripts": {
2626
"build": "tsup",
27-
"clean": "rm -rf dist"
27+
"clean": "rm -rf dist",
28+
"typecheck": "tsc --noEmit"
2829
},
2930
"dependencies": {
3031
"archiver": "^7.0.1",

packages/cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"scripts": {
2121
"build": "tsup",
2222
"clean": "rm -rf dist",
23-
"dev": "pnpm build && node dist/index.mjs"
23+
"dev": "pnpm build && node dist/index.mjs",
24+
"typecheck": "tsc --noEmit"
2425
},
2526
"dependencies": {
2627
"@effect/cli": "^0.73.2",

packages/cli/src/commands/build/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Command } from '@effect/cli';
22
import { FileSystem, Path } from '@effect/platform';
33
import { exec } from '@gigadrive/build-utils';
44
import { Console, Effect } from 'effect';
5-
import { BuildScriptNotFoundError, ExecError, PackageJsonNotFoundError } from '../../errors';
5+
import { BuildScriptNotFoundError, ExecError, PackageJsonNotFoundError, PackageJsonParseError } from '../../errors';
66
import { PackageManagerService } from '../../services/package-manager';
77

88
export const buildCommand = Command.make('build', {}, () =>

packages/commons/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
],
2525
"scripts": {
2626
"build": "tsup",
27-
"clean": "rm -rf dist"
27+
"clean": "rm -rf dist",
28+
"typecheck": "tsc --noEmit"
2829
},
2930
"devDependencies": {
3031
"@types/node": "^22.18.7"

packages/harmony/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"clean": "rm -rf dist",
5050
"storybook": "storybook dev -p 6006 --no-open",
5151
"storybook:build": "storybook build",
52-
"storybook:build-docs": "storybook build --docs"
52+
"storybook:build-docs": "storybook build --docs",
53+
"typecheck": "tsc --noEmit -p tsconfig.check.json"
5354
},
5455
"dependencies": {
5556
"@dnd-kit/core": "^6.3.1",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["src"]
4+
}

0 commit comments

Comments
 (0)