Skip to content

Commit b6d24f2

Browse files
resolved typecheck errors
1 parent 7d1c4d9 commit b6d24f2

9 files changed

Lines changed: 93 additions & 23 deletions

File tree

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: ["**"]
6+
push:
7+
branches: ["main", "develop"]
8+
9+
permissions: read-all
10+
11+
concurrency:
12+
group: ci-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
frontend:
17+
name: Frontend (Node ${{ matrix.node-version }})
18+
runs-on: ubuntu-latest
19+
env:
20+
CI: true
21+
strategy:
22+
matrix:
23+
node-version: [18.x, 20.x]
24+
defaults:
25+
run:
26+
working-directory: frontend
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
- name: Setup Node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
cache: npm
35+
cache-dependency-path: frontend/package-lock.json
36+
- name: Install deps
37+
run: npm ci
38+
- name: Typecheck
39+
run: npm run typecheck
40+
- name: Run tests
41+
run: npm run test:run -- --reporter=verbose
42+
- name: Coverage
43+
run: npm run test:coverage
44+
- name: Upload coverage artifact
45+
if: always()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: frontend-coverage-${{ matrix.node-version }}
49+
path: frontend/coverage
50+
51+
backend:
52+
name: Backend (Node ${{ matrix.node-version }})
53+
runs-on: ubuntu-latest
54+
env:
55+
CI: true
56+
strategy:
57+
matrix:
58+
node-version: [18.x, 20.x]
59+
defaults:
60+
run:
61+
working-directory: backend
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
- name: Setup Node
66+
uses: actions/setup-node@v4
67+
with:
68+
node-version: ${{ matrix.node-version }}
69+
cache: npm
70+
cache-dependency-path: backend/package-lock.json
71+
- name: Install deps
72+
run: npm ci
73+
- name: Run tests
74+
run: npm test
75+
- name: Coverage
76+
run: npm run test:coverage
77+
- name: Upload coverage artifact
78+
if: always()
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: backend-coverage-${{ matrix.node-version }}
82+
path: backend/coverage

frontend/src/App.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
import React from 'react'
21
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
32
import { ThemeProvider } from 'next-themes'
43
import Home from './pages/Home'
54
import NotFound from './pages/NotFound'
65

76
function App() {
8-
const router = createBrowserRouter(
9-
[
10-
{ path: '/', element: <Home /> },
11-
{ path: '*', element: <NotFound /> },
12-
],
13-
{
14-
future: {
15-
v7_startTransition: true,
16-
v7_relativeSplatPath: true,
17-
},
18-
}
19-
)
7+
const router = createBrowserRouter([
8+
{ path: '/', element: <Home /> },
9+
{ path: '*', element: <NotFound /> },
10+
])
2011
return (
2112
<ThemeProvider attribute="class" defaultTheme="light" enableSystem>
2213
<RouterProvider router={router} />

frontend/src/components/Footer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React from 'react';
21
import { Github, Rocket } from 'lucide-react';
32

4-
const Footer: React.FC = () => {
3+
const Footer = () => {
54
return (
65
<footer className="bg-slate-50 dark:bg-gray-800/50 border-t border-slate-200 dark:border-white/10 mt-auto">
76
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">

frontend/src/components/GoogleMap.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef, useState } from "react";
1+
import { useEffect, useRef, useState } from "react";
22
import { cn } from "@/lib/utils";
33

44
export type GeoPoint = {
@@ -111,7 +111,7 @@ export function GoogleMap({ from, to, animateKey, className }: GoogleMapProps) {
111111
directionsRendererRef.current.setDirections(result);
112112

113113
// Add custom markers
114-
const startMarker = new window.google.maps.Marker({
114+
new window.google.maps.Marker({
115115
position: { lat: from.lat, lng: from.lon },
116116
map: mapInstanceRef.current,
117117
title: from.name || 'Start',
@@ -125,7 +125,7 @@ export function GoogleMap({ from, to, animateKey, className }: GoogleMapProps) {
125125
}
126126
});
127127

128-
const endMarker = new window.google.maps.Marker({
128+
new window.google.maps.Marker({
129129
position: { lat: to.lat, lng: to.lon },
130130
map: mapInstanceRef.current,
131131
title: to.name || 'End',

frontend/src/components/LeafletMap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect } from 'react'
1+
import { useEffect } from 'react'
22
import L from 'leaflet'
33
import 'leaflet/dist/leaflet.css'
44

frontend/src/components/LocationSearch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function LocationSearch({
6363
}: LocationSearchProps) {
6464
const [searchResults, setSearchResults] = useState<Location[]>([]);
6565
const [isOpen, setIsOpen] = useState(false);
66-
const [isSearching, setIsSearching] = useState(false);
66+
const [isSearching] = useState(false);
6767
const inputRef = useRef<HTMLInputElement>(null);
6868
const dropdownRef = useRef<HTMLDivElement>(null);
6969

frontend/src/components/ui/theme-toggle.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as React from "react"
21
import { Moon, Sun } from "lucide-react"
32
import { useTheme } from "next-themes"
43
import { Button } from "@/components/ui/button"

frontend/src/pages/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from "react";
1+
import { useState } from "react";
22
import { LocationSearch } from "@/components/LocationSearch";
33
import LeafletMap from "@/components/LeafletMap";
44
import { Button } from "@/components/ui/button";

frontend/src/pages/NotFound.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { Button } from '@/components/ui/button';
32
import { useNavigate } from 'react-router-dom';
43

0 commit comments

Comments
 (0)