Skip to content

Commit d655bba

Browse files
committed
Repair all failed typecheck issues, add lint and typecheck to ci/cd
1 parent ca58f90 commit d655bba

File tree

9 files changed

+93
-52
lines changed

9 files changed

+93
-52
lines changed

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
# TODO: Enable lint job after applying lint fixes and setting appropriate warning limits
10+
# Will be handled in follow-up PR to avoid blocking CI setup / bloating this PR
11+
# lint:
12+
# name: Lint
13+
# runs-on: ubuntu-latest
14+
15+
# steps:
16+
# - uses: actions/checkout@v4
17+
18+
# - uses: oven-sh/setup-bun@v1
19+
# with:
20+
# bun-version: latest
21+
22+
# - name: Cache dependencies
23+
# uses: actions/cache@v4
24+
# with:
25+
# path: |
26+
# ~/.bun/install/cache
27+
# key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
28+
29+
# - name: Install dependencies
30+
# run: bun install --frozen
31+
32+
# - name: Run linter
33+
# run: bun lint
34+
35+
typecheck:
36+
name: Typecheck
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: oven-sh/setup-bun@v1
43+
with:
44+
bun-version: latest
45+
46+
- name: Cache dependencies
47+
uses: actions/cache@v4
48+
with:
49+
path: |
50+
~/.bun/install/cache
51+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
52+
53+
- name: Install dependencies
54+
run: bun install --frozen
55+
56+
- name: Run type checking
57+
run: bun typecheck
58+
59+
test:
60+
name: Unit Test
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- uses: oven-sh/setup-bun@v1
67+
with:
68+
bun-version: latest
69+
70+
- name: Cache dependencies
71+
uses: actions/cache@v4
72+
with:
73+
path: |
74+
~/.bun/install/cache
75+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
76+
77+
- name: Install dependencies
78+
run: bun install --frozen
79+
80+
- name: Run tests
81+
run: bun test --timeout 30000 --coverage

.github/workflows/unit-test.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

apps/web/preload/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
}
99
},
1010
"include": [
11-
"src",
12-
"test"
11+
"script",
12+
"server"
1313
],
1414
"exclude": [
1515
"node_modules"

apps/web/server/tsup.config.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/db/src/seed/db.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const user0 = {
5151
createdAt: new Date(),
5252
updatedAt: new Date(),
5353
stripeCustomerId: null,
54+
githubInstallationId: null,
5455
} satisfies User;
5556

5657
const project0 = createDefaultProject({
@@ -156,6 +157,7 @@ const context0 = {
156157
path: 'src/index.ts',
157158
displayName: 'index.ts',
158159
content: 'console.log("Hello, world!");',
160+
branchId: branch0.id,
159161
} satisfies MessageContext;
160162

161163
const context1 = {
@@ -165,6 +167,7 @@ const context1 = {
165167
content: 'console.log("Hello, world!");',
166168
start: 0,
167169
end: 10,
170+
branchId: branch0.id,
168171
} satisfies MessageContext;
169172

170173
const contexts = [context0, context1];

packages/github/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "@onlook/typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist",
55
"rootDir": "src"

packages/parser/test/ids.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ describe('addOidsToAst', () => {
129129
const ast = getAstFromContent(inputContent);
130130
if (!ast) throw new Error('Failed to parse input code');
131131

132-
const globalOids = new Set();
133-
const branchOidMap = new Map();
132+
const globalOids = new Set<string>();
133+
const branchOidMap = new Map<string, string>();
134134

135135
const { ast: astWithIds, modified } = addOidsToAst(
136136
ast,

packages/ui/src/components/calendar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
2+
import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';
23
import { DayPicker } from 'react-day-picker';
34

4-
import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';
55
import { cn } from '../utils';
66
import { buttonVariants } from './button';
77

@@ -32,7 +32,7 @@ function Calendar({
3232
head_cell: 'text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]',
3333
row: 'flex w-full mt-2',
3434
cell: cn(
35-
'relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md',
35+
'[&:has([aria-selected])]:bg-accent relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected].day-range-end)]:rounded-r-md',
3636
props.mode === 'range'
3737
? '[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md'
3838
: '[&:has([aria-selected])]:rounded-md',
@@ -56,10 +56,10 @@ function Calendar({
5656
...classNames,
5757
}}
5858
components={{
59-
IconLeft: ({ className, ...props }) => (
59+
IconLeft: ({ className, children: _children, ...props }) => (
6060
<ChevronLeftIcon className={cn('size-4', className)} {...props} />
6161
),
62-
IconRight: ({ className, ...props }) => (
62+
IconRight: ({ className, children: _children, ...props }) => (
6363
<ChevronRightIcon className={cn('size-4', className)} {...props} />
6464
),
6565
}}

tooling/eslint/base.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export const restrictEnvAccess = tseslint.config(
3737
);
3838

3939
export default tseslint.config(
40-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
4140
includeIgnoreFile(path.join(import.meta.dirname, '../../.gitignore')),
4241
{
4342
ignores: [
@@ -52,15 +51,12 @@ export default tseslint.config(
5251
{
5352
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
5453
plugins: {
55-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
5654
import: importPlugin,
57-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
5855
prettier: prettierPlugin,
5956
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
6057
onlyWarn,
6158
},
6259
extends: [
63-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
6460
eslint.configs.recommended,
6561
...tseslint.configs.recommended,
6662
...tseslint.configs.recommendedTypeChecked,

0 commit comments

Comments
 (0)