Skip to content

Commit 39829a8

Browse files
authored
refactor: use voidzero-dev/setup-vite-plus-action to install vite+ cli (#123)
* refactor: use voidzero-dev/setup-vite-plus-action to install vite+ cli * FIXUP * FIXUP
1 parent daafca8 commit 39829a8

15 files changed

Lines changed: 304 additions & 1868 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,33 @@ jobs:
2626
- name: Checkout code
2727
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2828

29-
- name: Setup Node.js and pnpm
30-
uses: ./.github/actions/setup-node-pnpm
29+
- name: Setup Node.js
30+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
31+
with:
32+
node-version: "lts/*"
33+
package-manager-cache: false
34+
check-latest: true
35+
36+
- name: Setup Vite+
37+
uses: voidzero-dev/setup-vite-plus-action@8e5c964eecdefb1a599d79ad0c4a00418e193e72 # v1
38+
with:
39+
cache: true
40+
registry: github
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
3142

3243
- name: Install Playwright browsers
33-
run: pnpm exec playwright install chromium
44+
run: npx playwright install chromium
3445

3546
- name: Check ready
3647
run: |
37-
pnpm ready
48+
vite run ready
3849
# run again to check cache hits
39-
pnpm ready
40-
env:
41-
VITE_LOG: 'trace'
50+
vite run ready
51+
# env:
52+
# VITE_LOG: 'trace'
4253

4354
- name: Check build artifacts
55+
if: ${{ matrix.os != 'windows-latest' }}
4456
run: |
4557
if [ -d "apps/dashboard/dist" ]; then
4658
echo "✅ Build artifacts created successfully"
@@ -49,41 +61,3 @@ jobs:
4961
echo "❌ Build artifacts not found"
5062
exit 1
5163
fi
52-
53-
global:
54-
timeout-minutes: 15
55-
permissions:
56-
contents: read
57-
packages: read
58-
59-
strategy:
60-
fail-fast: false
61-
matrix:
62-
os: [ubuntu-latest, macos-latest, windows-latest]
63-
64-
runs-on: ${{ matrix.os }}
65-
66-
steps:
67-
- name: Checkout code
68-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
69-
70-
- name: Setup Node.js and pnpm
71-
uses: ./.github/actions/setup-node-pnpm
72-
73-
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
74-
with:
75-
node-version: 'lts/*'
76-
registry-url: 'https://npm.pkg.github.com'
77-
scope: '@voidzero-dev'
78-
package-manager-cache: false
79-
80-
- run: npm install -g @voidzero-dev/global@latest
81-
env:
82-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83-
84-
- run: vite --version
85-
- run: vite fmt -c .oxfmtrc.jsonc --check
86-
87-
- run: vite lint -c .oxlintrc.json
88-
env:
89-
VITE_LOG: 'trace'

.oxfmtrc.jsonc

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

apps/dashboard/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@
2929
"@types/react-dom": "^19.1.7",
3030
"@types/react-router-dom": "^5.3.3",
3131
"@types/semver": "^7.7.1",
32-
"@vitest/browser": "^4.0.9",
33-
"@vitest/browser-playwright": "^4.0.9",
3432
"@vitest/ui": "^4.0.9",
3533
"playwright": "^1.55.0",
3634
"vite": "catalog:",
3735
"tailwindcss": "^4.1.13",
38-
"typescript": "catalog:"
36+
"typescript": "catalog:",
37+
"@voidzero-dev/vite-plus": "catalog:"
3938
}
4039
}

apps/dashboard/src/__tests__/pages.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render } from "@testing-library/react";
22
import { MemoryRouter } from "react-router-dom";
3-
import { describe, expect, it } from "vitest";
3+
import { describe, expect, it } from "@voidzero-dev/vite-plus/test";
44
import App from "../App";
55
import MinificationBenchmarksPage from "../pages/MinificationBenchmarksPage";
66
import NpmPackagesPage from "../pages/NpmPackagesPage";

apps/dashboard/src/components/layout/AppBar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export function AppBar({ title, subtitle }: AppBarProps) {
1212
<div className="h-full flex items-center justify-between">
1313
{/* Left side - Page title */}
1414
<div>
15-
{title && <h2 className="text-xl font-semibold bg-gradient-to-r from-slate-900 to-slate-700 dark:from-white dark:to-slate-300 bg-clip-text text-transparent">{title}</h2>}
15+
{title && (
16+
<h2 className="text-xl font-semibold bg-gradient-to-r from-slate-900 to-slate-700 dark:from-white dark:to-slate-300 bg-clip-text text-transparent">
17+
{title}
18+
</h2>
19+
)}
1620
{subtitle && <p className="text-sm text-slate-500 dark:text-slate-400">{subtitle}</p>}
1721
</div>
1822

apps/dashboard/src/components/layout/Sidebar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ export function Sidebar() {
8686
</div>
8787
{!collapsed && (
8888
<div>
89-
<h1 className="font-bold bg-gradient-to-r from-slate-900 to-slate-700 dark:from-white dark:to-slate-300 bg-clip-text text-transparent">Vibe</h1>
89+
<h1 className="font-bold bg-gradient-to-r from-slate-900 to-slate-700 dark:from-white dark:to-slate-300 bg-clip-text text-transparent">
90+
Vibe
91+
</h1>
9092
<p className="text-xs text-slate-500 dark:text-slate-400">Dashboard</p>
9193
</div>
9294
)}

apps/dashboard/src/context/SidebarContext.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ const SidebarContext = createContext<SidebarContextType | undefined>(undefined);
1010
export function SidebarProvider({ children }: { children: React.ReactNode }) {
1111
const [collapsed, setCollapsed] = useState(false);
1212

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

2016
export function useSidebar() {

apps/dashboard/src/pages/HomePage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ function HomePage() {
8282
const colors = getColorClasses(feature.color);
8383
return (
8484
<Link key={feature.link} to={feature.link}>
85-
<Card className={`h-full transition-all hover:shadow-2xl hover:scale-[1.02] ${colors.hover} cursor-pointer group relative overflow-hidden`}>
85+
<Card
86+
className={`h-full transition-all hover:shadow-2xl hover:scale-[1.02] ${colors.hover} cursor-pointer group relative overflow-hidden`}
87+
>
8688
<div className="absolute inset-0 bg-gradient-to-br from-transparent via-transparent to-slate-100/50 dark:to-slate-700/30 opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
8789
<div className="p-6 relative z-10">
8890
<div className="flex items-start gap-4">
89-
<div className={`p-3 rounded-xl ${colors.bg} shadow-sm group-hover:shadow-md transition-all group-hover:scale-110`}>
91+
<div
92+
className={`p-3 rounded-xl ${colors.bg} shadow-sm group-hover:shadow-md transition-all group-hover:scale-110`}
93+
>
9094
<div className={colors.icon}>{feature.icon}</div>
9195
</div>
9296
<div className="flex-1">

apps/dashboard/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import tailwindcss from "@tailwindcss/vite";
2-
import { playwright } from "@vitest/browser-playwright";
2+
import { playwright } from "@voidzero-dev/vite-plus/test/browser-playwright";
33
import { defineConfig } from "@voidzero-dev/vite-plus";
44

55
// https://vite.dev/config/

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
"packageManager": "pnpm@10.26.0",
77
"type": "module",
88
"scripts": {
9-
"ready": "vite fmt && vite lint --type-aware --threads 4 && vite test && vite run build",
10-
"dev": "pnpm --filter dashboard dev",
9+
"ready": "vite run fmt --check && vite run lint && vite run test && vite run build && vite run -r typecheck",
10+
"dev": "vite run @vibe/dashboard#dev",
1111
"build": "vite run @vibe/dashboard#build",
12-
"lint": "vite lint --type-aware --threads 4",
12+
"lint": "vite lint --type-aware --type-check --threads 4",
1313
"test": "vite test",
1414
"fmt": "vite fmt",
1515
"generate": "node tools/override-rolldown.mjs --stats"
1616
},
1717
"devDependencies": {
1818
"@typescript-eslint/scope-manager": "^8.47.0",
19-
"@voidzero-dev/vite-plus": "latest",
19+
"@voidzero-dev/vite-plus": "catalog:",
2020
"dprint": "^0.50.2",
2121
"playwright": "^1.56.1",
2222
"top-github-dependents-by-stars": "^1.0.4",
23-
"vitest": "^4.0.14"
23+
"vitest": "catalog:"
2424
}
2525
}

0 commit comments

Comments
 (0)