Skip to content

Commit d37653a

Browse files
committed
feat: 完成 HaloLight Preact 版本完整实现
- 基于 Preact + Vite + TypeScript 构建 - Preact Signals 状态管理 - 完整认证流程 (登录/注册/忘记/重置密码) - 仪表盘布局 - 主题切换 (light/dark/system + 11 skins) - 自定义组件库 - CI/CD (lint/type-check/build)
0 parents  commit d37653a

80 files changed

Lines changed: 13151 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.development

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
VITE_API_URL=/api
2+
VITE_MOCK=true
3+
VITE_DEMO_EMAIL=admin@halolight.h7ml.cn
4+
VITE_DEMO_PASSWORD=123456
5+
VITE_SHOW_DEMO_HINT=true
6+
VITE_APP_TITLE=Admin Pro - Dev
7+
VITE_BRAND_NAME=Halolight

.env.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# =============================================================================
2+
# Halolight Preact 环境变量配置
3+
# =============================================================================
4+
5+
# API 基础 URL
6+
VITE_API_URL=/api
7+
8+
# 是否启用 Mock 数据
9+
VITE_MOCK=true
10+
11+
# 演示账号
12+
VITE_DEMO_EMAIL=admin@example.com
13+
VITE_DEMO_PASSWORD=123456
14+
VITE_SHOW_DEMO_HINT=true
15+
16+
# 应用配置
17+
VITE_APP_TITLE=Admin Pro
18+
VITE_BRAND_NAME=Halolight

.env.production

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
VITE_API_URL=/api
2+
VITE_MOCK=false
3+
VITE_DEMO_EMAIL=admin@halolight.h7ml.cn
4+
VITE_DEMO_PASSWORD=123456
5+
VITE_SHOW_DEMO_HINT=false
6+
VITE_APP_TITLE=Admin Pro
7+
VITE_BRAND_NAME=Halolight

.github/workflows/ci.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
env:
10+
NODE_VERSION: '22'
11+
PNPM_VERSION: '10.23.0'
12+
13+
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: ${{ env.PNPM_VERSION }}
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ env.NODE_VERSION }}
30+
cache: 'pnpm'
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Run ESLint
36+
run: pnpm lint
37+
38+
type-check:
39+
name: Type Check
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Setup pnpm
46+
uses: pnpm/action-setup@v4
47+
with:
48+
version: ${{ env.PNPM_VERSION }}
49+
50+
- name: Setup Node.js
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: ${{ env.NODE_VERSION }}
54+
cache: 'pnpm'
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: Run TypeScript check
60+
run: pnpm type-check
61+
62+
test:
63+
name: Test
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Setup pnpm
70+
uses: pnpm/action-setup@v4
71+
with:
72+
version: ${{ env.PNPM_VERSION }}
73+
74+
- name: Setup Node.js
75+
uses: actions/setup-node@v4
76+
with:
77+
node-version: ${{ env.NODE_VERSION }}
78+
cache: 'pnpm'
79+
80+
- name: Install dependencies
81+
run: pnpm install --frozen-lockfile
82+
83+
- name: Run tests
84+
run: pnpm test:ci
85+
86+
- name: Upload coverage reports
87+
uses: codecov/codecov-action@v4
88+
with:
89+
token: ${{ secrets.CODECOV_TOKEN }}
90+
files: ./coverage/lcov.info
91+
fail_ci_if_error: false
92+
93+
build:
94+
name: Build
95+
runs-on: ubuntu-latest
96+
needs: [lint, type-check, test]
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
101+
- name: Setup pnpm
102+
uses: pnpm/action-setup@v4
103+
with:
104+
version: ${{ env.PNPM_VERSION }}
105+
106+
- name: Setup Node.js
107+
uses: actions/setup-node@v4
108+
with:
109+
node-version: ${{ env.NODE_VERSION }}
110+
cache: 'pnpm'
111+
112+
- name: Install dependencies
113+
run: pnpm install --frozen-lockfile
114+
115+
- name: Build
116+
run: pnpm build
117+
118+
- name: Upload build artifacts
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: dist
122+
path: dist/
123+
retention-days: 7

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

0 commit comments

Comments
 (0)