Skip to content

Commit 6f2ab22

Browse files
authored
Migrate to PNPM and update deps (#52)
1 parent 05b4b41 commit 6f2ab22

File tree

15 files changed

+1854
-15789
lines changed

15 files changed

+1854
-15789
lines changed

.cursor/rules/guidelines.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ alwaysApply: true
66

77
### TypeScript Standards
88
- **Strict Mode**: Enable `"strict": true` configuration
9-
- **Syntax Version**: Prioritize ES2017+ syntax features
9+
- **Syntax Version**: Prioritize ES2022+ syntax features
1010
- **Component Definition**: Use arrow functions or `export default function`
1111
- **Type Import**: Use `import type { }` syntax
1212

.github/workflows/deploy.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,24 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v6
3535
with:
3636
fetch-depth: 0
37-
- name: Install dependencies
38-
run: npm install -g pnpm && pnpm install
37+
38+
- name: Install pnpm
39+
uses: pnpm/action-setup@v4
40+
41+
- name: Use Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 24
45+
cache: "pnpm"
46+
3947
- name: Install dependencies and build
4048
run: |
4149
pnpm install --no-frozen-lockfile
4250
pnpm run build
51+
4352
- name: Install Aliyun OSS CLI
4453
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
4554
shell: bash

AGENTS.md

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ This document provides development guidelines and rules for AI Agents to ensure
55
## 📋 Project Overview
66

77
- **Project Name**: RustFS.com - Official Website
8-
- **Framework**: Next.js 15.3.4 (App Router, Static Export)
9-
- **Language**: TypeScript (ES2017+, Strict Mode)
10-
- **Package Manager**: pnpm (recommended) or npm
8+
- **Framework**: Next.js 16.1.6 (App Router, Static Export)
9+
- **Language**: TypeScript (ES2022+, Strict Mode)
10+
- **Package Manager**: pnpm
1111
- **Styling**: Tailwind CSS 4 + shadcn/ui
1212
- **CI/CD**: GitHub Actions → Aliyun OSS
1313

@@ -28,8 +28,6 @@ This document provides development guidelines and rules for AI Agents to ensure
2828

2929
```bash
3030
pnpm run lint
31-
# or
32-
npm run lint
3331
```
3432

3533
3. **✅ Local Build Test**
@@ -40,25 +38,14 @@ This document provides development guidelines and rules for AI Agents to ensure
4038

4139
# Execute build
4240
pnpm run build
43-
# or
44-
npm run build
4541

4642
# Ensure build succeeds without errors
4743
```
4844

4945
4. **✅ Dependency Lock File Synchronization**
50-
51-
- If using `npm install` to update dependencies, must synchronize `pnpm-lock.yaml`:
52-
53-
```bash
54-
pnpm install
55-
```
56-
5746
- If using `pnpm install` to update dependencies, ensure `pnpm-lock.yaml` is updated
58-
- **Important**: CI uses pnpm. If dependencies are updated locally with npm but `pnpm-lock.yaml` is not updated, CI will fail
5947

6048
5. **✅ Build Artifact Verification**
61-
6249
- Ensure `out/` directory is generated
6350
- Ensure `out/sitemap.xml` is generated (automatically by postbuild script)
6451
- Check build artifacts are complete
@@ -71,20 +58,18 @@ According to `.github/workflows/deploy.yml`, the CI process includes:
7158

7259
1. **Checkout**: Check out code
7360

74-
2. **Install dependencies**:
61+
2. **Install pnpm**:
7562

76-
```bash
77-
npm install -g pnpm && pnpm install
78-
```
63+
3. **Use Node.js**:
7964

80-
3. **Install dependencies and build**:
65+
4. **Install dependencies and build**:
8166

8267
```bash
8368
pnpm install --no-frozen-lockfile
8469
pnpm run build
8570
```
8671

87-
4. **Deploy**: Deploy to Aliyun OSS
72+
5. **Deploy**: Deploy to Aliyun OSS
8873

8974
### Local CI Simulation
9075

@@ -95,7 +80,6 @@ Before committing, it's recommended to simulate the complete CI process locally:
9580
rm -rf node_modules .next out
9681

9782
# 2. Install dependencies (using pnpm, consistent with CI)
98-
npm install -g pnpm
9983
pnpm install
10084

10185
# 3. Build project
@@ -147,7 +131,7 @@ Examples:
147131

148132
```bash
149133
feat: add contact form with hCaptcha
150-
fix: update pnpm-lock.yaml after npm dependency changes
134+
fix: correct button alignment on mobile
151135
docs: update README with new features
152136
```
153137

@@ -159,7 +143,6 @@ docs: update README with new features
159143

160144
**Causes**:
161145

162-
- Dependencies updated locally with npm but `pnpm-lock.yaml` not updated
163146
- `pnpm-lock.yaml` out of sync with `package.json`
164147

165148
**Solution**:

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ RustFS is a high-performance distributed object storage system developed in Rust
88

99
## 🛠️ Tech Stack
1010

11-
- **Framework**: Next.js 15.3.4 (App Router)
12-
- **Language**: TypeScript (ES2017+, Strict Mode)
11+
- **Framework**: Next.js 16.1.6 (App Router)
12+
- **Language**: TypeScript (ES2022+, Strict Mode)
1313
- **Styling**: Tailwind CSS 4 + shadcn/ui
1414
- **Icons**: Lucide React
1515
- **Theme**: next-themes (Dark Mode Support)
@@ -47,26 +47,20 @@ rustfs.com/
4747
### Requirements
4848

4949
- Node.js 18+
50-
- pnpm (recommended) or npm
50+
- pnpm
5151

5252
### Install Dependencies
5353

5454
```bash
55-
# Using pnpm (recommended)
55+
# Using
5656
pnpm install
57-
58-
# Or using npm
59-
npm install
6057
```
6158

6259
### Development Server
6360

6461
```bash
6562
# Start development server
6663
pnpm dev
67-
68-
# Or using npm
69-
npm run dev
7064
```
7165

7266
Open [http://localhost:3000](http://localhost:3000) to view the result.

components/business/fixed-language-banner.tsx

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,18 @@
22

33
import { SITE_CONFIG } from '@/app.config'
44
import { X } from 'lucide-react'
5-
import { useEffect, useState } from 'react'
5+
import { useState } from 'react'
66

77
const STORAGE_KEY = 'rustfs-language-banner-dismissed'
88

99
export default function FixedLanguageBanner() {
10-
const [showBanner, setShowBanner] = useState(false)
11-
12-
useEffect(() => {
13-
// Check if banner was dismissed
14-
const dismissed = localStorage.getItem(STORAGE_KEY)
15-
if (dismissed) {
16-
return
17-
}
18-
19-
// Detect browser language
20-
const browserLang = navigator.language.toLowerCase()
21-
const isChinese = browserLang.startsWith('zh')
22-
23-
if (isChinese) {
24-
setShowBanner(true)
25-
}
26-
}, [])
10+
const [showBanner, setShowBanner] = useState(() => {
11+
if (typeof window === 'undefined') return false
12+
13+
const isDismissed = localStorage.getItem(STORAGE_KEY) === 'true'
14+
const isChinese = navigator.language.toLowerCase().startsWith('zh')
15+
return isChinese && !isDismissed
16+
})
2717

2818
const handleDismiss = () => {
2919
setShowBanner(false)

components/business/home-hero.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use client'
2+
23
import { WordRotate } from "@/components/magicui/word-rotate";
34
import { Globe } from "@/components/ui/globe";
45
import type { GitHubMetrics } from "@/lib/github";
56
import { useTheme } from "next-themes";
6-
import { useEffect, useMemo, useState } from "react";
7+
import { useMemo } from "react";
78
import ContactUsButton from "./buttons/contact-us";
89
import DownloadLink from "./buttons/download-link";
910
import StatsStrip from "./stats-strip";
@@ -17,14 +18,9 @@ interface HomeHeroProps {
1718
}
1819

1920
export default function HomeHero({ dockerPulls, metrics }: HomeHeroProps) {
20-
const { resolvedTheme } = useTheme();
21-
const [mounted, setMounted] = useState(false);
22-
23-
useEffect(() => {
24-
setMounted(true);
25-
}, []);
21+
const { theme } = useTheme();
2622

27-
const isDark = mounted && resolvedTheme === "dark";
23+
const isDark = theme === "dark";
2824

2925
const globeConfig = useMemo(
3026
() => ({

eslint.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import next from "eslint-config-next";
2+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
3+
import nextTypescript from "eslint-config-next/typescript";
4+
import nextVitals from "eslint-config-next/core-web-vitals";
5+
import { defineConfig, globalIgnores } from "eslint/config";
6+
7+
const eslintConfig = defineConfig([
8+
...next,
9+
...nextCoreWebVitals,
10+
...nextTypescript,
11+
...nextVitals,
12+
globalIgnores([
13+
"node_modules/**",
14+
".next/**",
15+
"out/**",
16+
"build/**",
17+
"next-env.d.ts",
18+
"components/ui/**", // shadcn/ui components
19+
]),
20+
]);
21+
22+
export default eslintConfig;

eslint.config.mjs

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

0 commit comments

Comments
 (0)