Skip to content

Commit f49d91e

Browse files
committed
refactor: replace lint/fmt with unified vp check
- Replace separate lint, fmt, fmt:check scripts with unified check/check:fix - Update CI to use single 'vp run check' step instead of separate fmt:check + lint - Update ready script to use check instead of fmt + lint - Upgrade vite-plus to 0.0.0-g61d318d2.20260227-0939 - Fix lint errors caught by new rules: - Wrap SidebarContext value in useMemo to prevent unnecessary rerenders - Use entry.name instead of array index for Cell keys in BundleSizeChart
1 parent fa920f5 commit f49d91e

7 files changed

Lines changed: 425 additions & 170 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ jobs:
2828

2929
- run: npx playwright install chromium
3030

31-
- run: vp run fmt:check
31+
- name: Check
32+
run: vp run check
3233

33-
- run: vp run lint --format github
34+
- name: Test
35+
run: vp run test
3436

35-
- run: vp run test
37+
- name: Build
38+
run: vp run @vibe/dashboard#build
3639

37-
- run: vp run @vibe/dashboard#build
38-
39-
- run: vp run ready
40+
- name: Ready
41+
run: vp run ready

apps/dashboard/src/components/rolldown/BundleSizeChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ export function BundleSizeChart() {
8888
}}
8989
style={{ fontSize: "11px", fill: "#94a3b8" }}
9090
/>
91-
{bundleSizeDiffData.map((entry: any, index: number) => (
91+
{bundleSizeDiffData.map((entry: any) => (
9292
<Cell
93-
key={`cell-${index}`}
93+
key={`cell-${entry.name}`}
9494
fill={entry.isBaseline ? "#94a3b8" : entry.value >= 0 ? "#dc2626" : "#16a34a"}
9595
/>
9696
))}

apps/dashboard/src/context/SidebarContext.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createContext, useContext, useState } from "react";
1+
import { createContext, useContext, useMemo, useState } from "react";
22

33
interface SidebarContextType {
44
collapsed: boolean;
@@ -9,12 +9,9 @@ const SidebarContext = createContext<SidebarContextType | undefined>(undefined);
99

1010
export function SidebarProvider({ children }: { children: React.ReactNode }) {
1111
const [collapsed, setCollapsed] = useState(false);
12+
const value = useMemo(() => ({ collapsed, setCollapsed }), [collapsed]);
1213

13-
return (
14-
<SidebarContext.Provider value={{ collapsed, setCollapsed }}>
15-
{children}
16-
</SidebarContext.Provider>
17-
);
14+
return <SidebarContext.Provider value={value}>{children}</SidebarContext.Provider>;
1815
}
1916

2017
export function useSidebar() {

data/rolldown-version-stats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,4 +889,4 @@
889889
"totalSize": 720281,
890890
"buildTime": 917
891891
}
892-
]
892+
]

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
"description": "A frontend dashboard for displaying different metrics",
66
"type": "module",
77
"scripts": {
8-
"ready": "vite run fmt && vite run lint && vite run test && vite run build",
8+
"ready": "vite run check && vite run test && vite run build",
99
"dev": "vite run @vibe/dashboard#dev",
1010
"build": "vite run @vibe/dashboard#build",
11-
"lint": "vite lint --deny-warnings --type-aware --type-check",
11+
"check": "vp check",
12+
"check:fix": "vp check --fix",
1213
"test": "vite test",
13-
"fmt": "vite fmt",
14-
"fmt:check": "vite fmt --check",
1514
"cache:clean": "vite cache clean",
1615
"generate": "node tools/override-rolldown.mjs --stats"
1716
},

0 commit comments

Comments
 (0)