@trapar-waves/react-tailwind 1.1.23 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -19
- package/assets/readme/headers/contributing.svg +27 -0
- package/assets/readme/headers/features.svg +27 -0
- package/assets/readme/headers/getting-started.svg +27 -0
- package/assets/readme/headers/license.svg +27 -0
- package/assets/readme/headers/project-structure.svg +27 -0
- package/assets/readme/headers/tech-stack.svg +27 -0
- package/assets/readme/hero.svg +100 -0
- package/eslint.config.js +7 -9
- package/lint-staged.config.js +1 -1
- package/package.json +24 -20
- package/pnpm-workspace.yaml +6 -0
- package/readme/README-CN.md +49 -57
- package/readme/README-JP.md +49 -57
- package/readme/README-RU.md +36 -44
- package/rsbuild.config.ts +42 -0
- package/src/app.css +65 -0
- package/src/app.tsx +167 -0
- package/src/index.tsx +5 -5
- package/src/App.css +0 -2
- package/src/App.tsx +0 -13
- /package/src/{env.d.ts → environment.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|

|
|
8
8
|

|
|
9
9
|
|
|
10
|
+

|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
[中文](./readme/README-CN.md) | [日本語](./readme/README-JP.md) | [Русский язык](./readme/README-RU.md)
|
|
13
15
|
|
|
14
16
|
> A modern UI development template integrating React and Tailwind CSS, with Rsbuild, TypeScript, ESLint (Antfu config), and Iconify support.
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+

|
|
17
19
|
|
|
18
20
|
- **Modern UI Framework:** Built using React (v19) for a component-driven, declarative interface.
|
|
19
21
|
- **Utility-First Styling:** Employs Tailwind CSS v4 (`tailwindcss`) along with `@tailwindcss/postcss`, enabling flexible and rapid styling while maintaining consistency.
|
|
@@ -23,7 +25,23 @@
|
|
|
23
25
|
- **Focus on Code Quality:** Includes ESLint with `@antfu/eslint-config` for linting and enforcing best practices in the codebase.
|
|
24
26
|
- **Git Hooks:** Integrated `husky` and `lint-staged` for pre-commit checks.
|
|
25
27
|
|
|
26
|
-
##
|
|
28
|
+
## GitHub Pages
|
|
29
|
+
|
|
30
|
+
Pushing a version tag matching `v*` runs [`.github/workflows/pages.yml`](./.github/workflows/pages.yml), which builds with `BASE_PATH=/<repository-name>/`, copies `dist/index.html` to `dist/404.html` for SPA routing, and deploys to GitHub Pages. In the repository **Settings → Pages**, set **Source** to **GitHub Actions** once.
|
|
31
|
+
|
|
32
|
+
Local subpath check (Unix-like shell):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
BASE_PATH=/react-tailwind/ pnpm run build && pnpm preview
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
PowerShell:
|
|
39
|
+
|
|
40
|
+
```powershell
|
|
41
|
+
$env:BASE_PATH="/react-tailwind/"; pnpm run build; pnpm preview
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+

|
|
27
45
|
|
|
28
46
|
- **Framework/Library:** React (v19)
|
|
29
47
|
- **Styling:** Tailwind CSS (`tailwindcss`)
|
|
@@ -35,22 +53,13 @@
|
|
|
35
53
|
|
|
36
54
|
See the [package.json](./package.json) for a full list of dependencies.
|
|
37
55
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Follow these instructions to get the project running locally.
|
|
56
|
+

|
|
41
57
|
|
|
42
58
|
### Prerequisites
|
|
43
59
|
|
|
44
|
-
Ensure you have the following installed:
|
|
45
|
-
|
|
46
60
|
- Node.js (>= 18.x recommended)
|
|
47
61
|
- Package manager (npm, yarn, or pnpm)
|
|
48
62
|
|
|
49
|
-
```bash
|
|
50
|
-
node -v
|
|
51
|
-
npm -v
|
|
52
|
-
```
|
|
53
|
-
|
|
54
63
|
### Installation
|
|
55
64
|
|
|
56
65
|
1. Create a new project using the template:
|
|
@@ -63,10 +72,6 @@ npm -v
|
|
|
63
72
|
|
|
64
73
|
```bash
|
|
65
74
|
pnpm install
|
|
66
|
-
# or
|
|
67
|
-
npm install
|
|
68
|
-
# or
|
|
69
|
-
yarn install
|
|
70
75
|
```
|
|
71
76
|
|
|
72
77
|
3. Start the development server:
|
|
@@ -75,7 +80,7 @@ npm -v
|
|
|
75
80
|
pnpm dev
|
|
76
81
|
```
|
|
77
82
|
|
|
78
|
-
|
|
83
|
+

|
|
79
84
|
|
|
80
85
|
```
|
|
81
86
|
├── public/ # Static assets
|
|
@@ -89,7 +94,7 @@ npm -v
|
|
|
89
94
|
└── package.json # Project dependencies and scripts
|
|
90
95
|
```
|
|
91
96
|
|
|
92
|
-
|
|
97
|
+

|
|
93
98
|
|
|
94
99
|
Contributions are welcome and greatly appreciated! Please follow these steps to contribute:
|
|
95
100
|
|
|
@@ -99,6 +104,10 @@ Contributions are welcome and greatly appreciated! Please follow these steps to
|
|
|
99
104
|
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
100
105
|
5. Open a Pull Request
|
|
101
106
|
|
|
107
|
+

|
|
108
|
+
|
|
109
|
+
MIT License © 2025 Trapar Waves
|
|
110
|
+
|
|
102
111
|
## 👤 Author
|
|
103
112
|
|
|
104
113
|
- **Rikka:** [admin@rikka.cc](mailto:admin@rikka.cc)
|
|
@@ -107,5 +116,4 @@ Contributions are welcome and greatly appreciated! Please follow these steps to
|
|
|
107
116
|
## 🔗 Links
|
|
108
117
|
|
|
109
118
|
- **Repository:** [https://github.com/Trapar-waves/react-tailwind](https://github.com/Trapar-waves/react-tailwind)
|
|
110
|
-
- **Homepage:** [https://github.com/Trapar-waves/react-tailwind](https://github.com/Trapar-waves/react-tailwind)
|
|
111
119
|
- **Issues:** [https://github.com/Trapar-waves/react-tailwind/issues](https://github.com/Trapar-waves/react-tailwind/issues)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 80" width="100%">
|
|
2
|
+
<title>Contributing section header</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="bg-contrib" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#06B6D4;stop-opacity:0.15"/>
|
|
6
|
+
<stop offset="100%" style="stop-color:#06B6D4;stop-opacity:0.08"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
|
|
10
|
+
<!-- Background (opaque) -->
|
|
11
|
+
<rect width="1200" height="80" fill="#FFFFFF"/>
|
|
12
|
+
<rect width="1200" height="80" fill="url(#bg-contrib)"/>
|
|
13
|
+
|
|
14
|
+
<!-- Border -->
|
|
15
|
+
<rect x="0.5" y="0.5" width="1199" height="79" rx="8" ry="8" fill="none" stroke="#E2E8F0" stroke-width="1"/>
|
|
16
|
+
|
|
17
|
+
<!-- Bottom accent -->
|
|
18
|
+
<rect x="0" y="76" width="1200" height="4" rx="2" fill="#06B6D4"/>
|
|
19
|
+
|
|
20
|
+
<!-- Emoji -->
|
|
21
|
+
<text x="40" y="52" font-family="system-ui, sans-serif" font-size="36">🤝</text>
|
|
22
|
+
|
|
23
|
+
<!-- Title -->
|
|
24
|
+
<text x="90" y="54" font-family="system-ui, sans-serif" font-size="28" font-weight="bold" fill="#0F172A">
|
|
25
|
+
Contributing
|
|
26
|
+
</text>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 80" width="100%">
|
|
2
|
+
<title>Features section header</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="bg-features" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#06B6D4;stop-opacity:0.15"/>
|
|
6
|
+
<stop offset="100%" style="stop-color:#06B6D4;stop-opacity:0.08"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
|
|
10
|
+
<!-- Background (opaque) -->
|
|
11
|
+
<rect width="1200" height="80" fill="#FFFFFF"/>
|
|
12
|
+
<rect width="1200" height="80" fill="url(#bg-features)"/>
|
|
13
|
+
|
|
14
|
+
<!-- Border -->
|
|
15
|
+
<rect x="0.5" y="0.5" width="1199" height="79" rx="8" ry="8" fill="none" stroke="#E2E8F0" stroke-width="1"/>
|
|
16
|
+
|
|
17
|
+
<!-- Bottom accent -->
|
|
18
|
+
<rect x="0" y="76" width="1200" height="4" rx="2" fill="#06B6D4"/>
|
|
19
|
+
|
|
20
|
+
<!-- Emoji -->
|
|
21
|
+
<text x="40" y="52" font-family="system-ui, sans-serif" font-size="36">✨</text>
|
|
22
|
+
|
|
23
|
+
<!-- Title -->
|
|
24
|
+
<text x="90" y="54" font-family="system-ui, sans-serif" font-size="28" font-weight="bold" fill="#0F172A">
|
|
25
|
+
Features
|
|
26
|
+
</text>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 80" width="100%">
|
|
2
|
+
<title>Getting Started section header</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="bg-start" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#06B6D4;stop-opacity:0.15"/>
|
|
6
|
+
<stop offset="100%" style="stop-color:#06B6D4;stop-opacity:0.08"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
|
|
10
|
+
<!-- Background (opaque) -->
|
|
11
|
+
<rect width="1200" height="80" fill="#FFFFFF"/>
|
|
12
|
+
<rect width="1200" height="80" fill="url(#bg-start)"/>
|
|
13
|
+
|
|
14
|
+
<!-- Border -->
|
|
15
|
+
<rect x="0.5" y="0.5" width="1199" height="79" rx="8" ry="8" fill="none" stroke="#E2E8F0" stroke-width="1"/>
|
|
16
|
+
|
|
17
|
+
<!-- Bottom accent -->
|
|
18
|
+
<rect x="0" y="76" width="1200" height="4" rx="2" fill="#06B6D4"/>
|
|
19
|
+
|
|
20
|
+
<!-- Emoji -->
|
|
21
|
+
<text x="40" y="52" font-family="system-ui, sans-serif" font-size="36">🚀</text>
|
|
22
|
+
|
|
23
|
+
<!-- Title -->
|
|
24
|
+
<text x="90" y="54" font-family="system-ui, sans-serif" font-size="28" font-weight="bold" fill="#0F172A">
|
|
25
|
+
Getting Started
|
|
26
|
+
</text>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 80" width="100%">
|
|
2
|
+
<title>License section header</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="bg-license" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#06B6D4;stop-opacity:0.15"/>
|
|
6
|
+
<stop offset="100%" style="stop-color:#06B6D4;stop-opacity:0.08"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
|
|
10
|
+
<!-- Background (opaque) -->
|
|
11
|
+
<rect width="1200" height="80" fill="#FFFFFF"/>
|
|
12
|
+
<rect width="1200" height="80" fill="url(#bg-license)"/>
|
|
13
|
+
|
|
14
|
+
<!-- Border -->
|
|
15
|
+
<rect x="0.5" y="0.5" width="1199" height="79" rx="8" ry="8" fill="none" stroke="#E2E8F0" stroke-width="1"/>
|
|
16
|
+
|
|
17
|
+
<!-- Bottom accent -->
|
|
18
|
+
<rect x="0" y="76" width="1200" height="4" rx="2" fill="#06B6D4"/>
|
|
19
|
+
|
|
20
|
+
<!-- Emoji -->
|
|
21
|
+
<text x="40" y="52" font-family="system-ui, sans-serif" font-size="36">📄</text>
|
|
22
|
+
|
|
23
|
+
<!-- Title -->
|
|
24
|
+
<text x="90" y="54" font-family="system-ui, sans-serif" font-size="28" font-weight="bold" fill="#0F172A">
|
|
25
|
+
License
|
|
26
|
+
</text>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 80" width="100%">
|
|
2
|
+
<title>Project Structure section header</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="bg-struct" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#06B6D4;stop-opacity:0.15"/>
|
|
6
|
+
<stop offset="100%" style="stop-color:#06B6D4;stop-opacity:0.08"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
|
|
10
|
+
<!-- Background (opaque) -->
|
|
11
|
+
<rect width="1200" height="80" fill="#FFFFFF"/>
|
|
12
|
+
<rect width="1200" height="80" fill="url(#bg-struct)"/>
|
|
13
|
+
|
|
14
|
+
<!-- Border -->
|
|
15
|
+
<rect x="0.5" y="0.5" width="1199" height="79" rx="8" ry="8" fill="none" stroke="#E2E8F0" stroke-width="1"/>
|
|
16
|
+
|
|
17
|
+
<!-- Bottom accent -->
|
|
18
|
+
<rect x="0" y="76" width="1200" height="4" rx="2" fill="#06B6D4"/>
|
|
19
|
+
|
|
20
|
+
<!-- Emoji -->
|
|
21
|
+
<text x="40" y="52" font-family="system-ui, sans-serif" font-size="36">📁</text>
|
|
22
|
+
|
|
23
|
+
<!-- Title -->
|
|
24
|
+
<text x="90" y="54" font-family="system-ui, sans-serif" font-size="28" font-weight="bold" fill="#0F172A">
|
|
25
|
+
Project Structure
|
|
26
|
+
</text>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 80" width="100%">
|
|
2
|
+
<title>Tech Stack section header</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="bg-tech" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#06B6D4;stop-opacity:0.15"/>
|
|
6
|
+
<stop offset="100%" style="stop-color:#06B6D4;stop-opacity:0.08"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
|
|
10
|
+
<!-- Background (opaque) -->
|
|
11
|
+
<rect width="1200" height="80" fill="#FFFFFF"/>
|
|
12
|
+
<rect width="1200" height="80" fill="url(#bg-tech)"/>
|
|
13
|
+
|
|
14
|
+
<!-- Border -->
|
|
15
|
+
<rect x="0.5" y="0.5" width="1199" height="79" rx="8" ry="8" fill="none" stroke="#E2E8F0" stroke-width="1"/>
|
|
16
|
+
|
|
17
|
+
<!-- Bottom accent -->
|
|
18
|
+
<rect x="0" y="76" width="1200" height="4" rx="2" fill="#06B6D4"/>
|
|
19
|
+
|
|
20
|
+
<!-- Emoji -->
|
|
21
|
+
<text x="40" y="52" font-family="system-ui, sans-serif" font-size="36">💻</text>
|
|
22
|
+
|
|
23
|
+
<!-- Title -->
|
|
24
|
+
<text x="90" y="54" font-family="system-ui, sans-serif" font-size="28" font-weight="bold" fill="#0F172A">
|
|
25
|
+
Tech Stack
|
|
26
|
+
</text>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 450" width="100%">
|
|
2
|
+
<title>React Tailwind - Modern React + Tailwind CSS starter template</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#F8FAFC"/>
|
|
6
|
+
<stop offset="100%" style="stop-color:#F1F5F9"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse">
|
|
9
|
+
<circle cx="1" cy="1" r="0.5" fill="#E2E8F0" opacity="0.5"/>
|
|
10
|
+
</pattern>
|
|
11
|
+
</defs>
|
|
12
|
+
|
|
13
|
+
<!-- Background -->
|
|
14
|
+
<rect width="1200" height="450" fill="url(#bg)"/>
|
|
15
|
+
<rect width="1200" height="450" fill="url(#grid)"/>
|
|
16
|
+
|
|
17
|
+
<!-- Left side: Project identity (40%) -->
|
|
18
|
+
<g transform="translate(60, 60)">
|
|
19
|
+
<!-- Organization name -->
|
|
20
|
+
<text x="0" y="30" font-family="ui-monospace, monospace" font-size="18" fill="#64748B">
|
|
21
|
+
trapar-waves
|
|
22
|
+
</text>
|
|
23
|
+
|
|
24
|
+
<!-- Repository name -->
|
|
25
|
+
<text x="0" y="90" font-family="system-ui, sans-serif" font-size="64" font-weight="bold" fill="#06B6D4">
|
|
26
|
+
react-tailwind
|
|
27
|
+
</text>
|
|
28
|
+
|
|
29
|
+
<!-- Description -->
|
|
30
|
+
<text x="0" y="140" font-family="system-ui, sans-serif" font-size="24" fill="#475569">
|
|
31
|
+
Modern React + Tailwind CSS
|
|
32
|
+
</text>
|
|
33
|
+
<text x="0" y="175" font-family="system-ui, sans-serif" font-size="24" fill="#475569">
|
|
34
|
+
starter template
|
|
35
|
+
</text>
|
|
36
|
+
</g>
|
|
37
|
+
|
|
38
|
+
<!-- Right side: Feature cards (60%) -->
|
|
39
|
+
<g transform="translate(520, 60)">
|
|
40
|
+
<!-- Card 1: Fast Dev -->
|
|
41
|
+
<g transform="translate(0, 0)">
|
|
42
|
+
<rect width="280" height="140" rx="12" fill="white" stroke="#E2E8F0" stroke-width="1"/>
|
|
43
|
+
<text x="24" y="45" font-family="system-ui, sans-serif" font-size="36">⚡</text>
|
|
44
|
+
<text x="70" y="45" font-family="system-ui, sans-serif" font-size="22" font-weight="bold" fill="#1E293B">
|
|
45
|
+
Fast Dev
|
|
46
|
+
</text>
|
|
47
|
+
<text x="24" y="85" font-family="system-ui, sans-serif" font-size="16" fill="#64748B">
|
|
48
|
+
Rsbuild hot reload
|
|
49
|
+
</text>
|
|
50
|
+
<text x="24" y="110" font-family="system-ui, sans-serif" font-size="16" fill="#64748B">
|
|
51
|
+
for instant feedback
|
|
52
|
+
</text>
|
|
53
|
+
</g>
|
|
54
|
+
|
|
55
|
+
<!-- Card 2: Tailwind CSS -->
|
|
56
|
+
<g transform="translate(310, 0)">
|
|
57
|
+
<rect width="280" height="140" rx="12" fill="white" stroke="#E2E8F0" stroke-width="1"/>
|
|
58
|
+
<text x="24" y="45" font-family="system-ui, sans-serif" font-size="36">🎨</text>
|
|
59
|
+
<text x="70" y="45" font-family="system-ui, sans-serif" font-size="22" font-weight="bold" fill="#1E293B">
|
|
60
|
+
Tailwind CSS
|
|
61
|
+
</text>
|
|
62
|
+
<text x="24" y="85" font-family="system-ui, sans-serif" font-size="16" fill="#64748B">
|
|
63
|
+
Utility-first styling
|
|
64
|
+
</text>
|
|
65
|
+
<text x="24" y="110" font-family="system-ui, sans-serif" font-size="16" fill="#64748B">
|
|
66
|
+
for rapid development
|
|
67
|
+
</text>
|
|
68
|
+
</g>
|
|
69
|
+
|
|
70
|
+
<!-- Card 3: Type Safe -->
|
|
71
|
+
<g transform="translate(0, 160)">
|
|
72
|
+
<rect width="280" height="140" rx="12" fill="white" stroke="#E2E8F0" stroke-width="1"/>
|
|
73
|
+
<text x="24" y="45" font-family="system-ui, sans-serif" font-size="36">🔧</text>
|
|
74
|
+
<text x="70" y="45" font-family="system-ui, sans-serif" font-size="22" font-weight="bold" fill="#1E293B">
|
|
75
|
+
Type Safe
|
|
76
|
+
</text>
|
|
77
|
+
<text x="24" y="85" font-family="system-ui, sans-serif" font-size="16" fill="#64748B">
|
|
78
|
+
TypeScript support
|
|
79
|
+
</text>
|
|
80
|
+
<text x="24" y="110" font-family="system-ui, sans-serif" font-size="16" fill="#64748B">
|
|
81
|
+
for reliable code
|
|
82
|
+
</text>
|
|
83
|
+
</g>
|
|
84
|
+
|
|
85
|
+
<!-- Card 4: Modern -->
|
|
86
|
+
<g transform="translate(310, 160)">
|
|
87
|
+
<rect width="280" height="140" rx="12" fill="white" stroke="#E2E8F0" stroke-width="1"/>
|
|
88
|
+
<text x="24" y="45" font-family="system-ui, sans-serif" font-size="36">📦</text>
|
|
89
|
+
<text x="70" y="45" font-family="system-ui, sans-serif" font-size="22" font-weight="bold" fill="#1E293B">
|
|
90
|
+
Modern
|
|
91
|
+
</text>
|
|
92
|
+
<text x="24" y="85" font-family="system-ui, sans-serif" font-size="16" fill="#64748B">
|
|
93
|
+
React 19 + latest
|
|
94
|
+
</text>
|
|
95
|
+
<text x="24" y="110" font-family="system-ui, sans-serif" font-size="16" fill="#64748B">
|
|
96
|
+
toolchain
|
|
97
|
+
</text>
|
|
98
|
+
</g>
|
|
99
|
+
</g>
|
|
100
|
+
</svg>
|
package/eslint.config.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { rentonReact } from "@renton/eslint-config-react";
|
|
2
2
|
|
|
3
|
-
export default
|
|
3
|
+
export default rentonReact({
|
|
4
4
|
stylistic: {
|
|
5
5
|
quotes: "double",
|
|
6
6
|
semi: true,
|
|
7
7
|
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
formatters: {
|
|
14
|
-
markdown: "prettier",
|
|
8
|
+
}, {
|
|
9
|
+
files: ["pnpm-workspace.yaml"],
|
|
10
|
+
name: "trapar/pnpm-workspace-yaml-trust-policy",
|
|
11
|
+
rules: {
|
|
12
|
+
"pnpm/yaml-enforce-settings": "off",
|
|
15
13
|
},
|
|
16
14
|
});
|
package/lint-staged.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trapar-waves/react-tailwind",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
5
|
-
"packageManager": "pnpm@
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"packageManager": "pnpm@11.24.0",
|
|
6
6
|
"description": "A modern UI development template integrating React and Tailwind CSS, with Rsbuild, TypeScript, ESLint (Antfu config), and Iconify support.",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "admin@rikka.cc",
|
|
@@ -32,31 +32,35 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"dev": "rsbuild dev --open",
|
|
34
34
|
"build": "rsbuild build",
|
|
35
|
+
"build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build",
|
|
35
36
|
"preview": "rsbuild preview",
|
|
36
37
|
"lint": "eslint . --cache --max-warnings=0 --no-warn-ignored",
|
|
37
38
|
"postinstall": "husky"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
|
-
"react": "^19.2.
|
|
41
|
-
"react-dom": "^19.2.
|
|
41
|
+
"react": "^19.2.8",
|
|
42
|
+
"react-dom": "^19.2.8"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@iconify/
|
|
47
|
-
"@
|
|
48
|
-
"@rsbuild/core": "^
|
|
49
|
-
"@rsbuild/plugin-react": "^1.
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@types/react
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"eslint
|
|
56
|
-
"eslint-plugin-
|
|
45
|
+
"@eslint-react/eslint-plugin": "^5.18.6",
|
|
46
|
+
"@iconify/json": "^2.2.522",
|
|
47
|
+
"@iconify/tailwind4": "^1.2.3",
|
|
48
|
+
"@renton/eslint-config-react": "^1.0.0",
|
|
49
|
+
"@rsbuild/core": "^2.2.1",
|
|
50
|
+
"@rsbuild/plugin-react": "^2.1.0",
|
|
51
|
+
"@rsdoctor/rspack-plugin": "^1.6.3",
|
|
52
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
53
|
+
"@types/react": "^19.2.18",
|
|
54
|
+
"@types/react-dom": "^19.2.5",
|
|
55
|
+
"cross-env": "^10.1.0",
|
|
56
|
+
"eslint": "^10.9.1",
|
|
57
|
+
"eslint-plugin-format": "^2.0.1",
|
|
58
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
59
|
+
"eslint-plugin-react-refresh": "^0.5.5",
|
|
57
60
|
"husky": "^9.1.7",
|
|
58
|
-
"lint-staged": "^
|
|
59
|
-
"tailwindcss": "^4.
|
|
60
|
-
"typescript": "^
|
|
61
|
+
"lint-staged": "^17.4.1",
|
|
62
|
+
"tailwindcss": "^4.3.3",
|
|
63
|
+
"typescript": "^6.0.3",
|
|
64
|
+
"unplugin-turbo-console": "^2.3.3"
|
|
61
65
|
}
|
|
62
66
|
}
|
package/pnpm-workspace.yaml
CHANGED
package/readme/README-CN.md
CHANGED
|
@@ -7,105 +7,97 @@
|
|
|
7
7
|

|
|
8
8
|

|
|
9
9
|
|
|
10
|
+

|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
[English](../README.md) | [日本語](./README-JP.md) | [Русский язык](./README-RU.md)
|
|
13
15
|
|
|
14
|
-
>
|
|
15
|
-
|
|
16
|
-
## ✨ 特性
|
|
16
|
+
> 一个现代化的 UI 开发模板,集成了 React 和 Tailwind CSS,配合 Rsbuild、TypeScript、ESLint(Antfu 配置)和 Iconify 支持。
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
- **实用优先的样式:** 采用Tailwind CSS v4 (`tailwindcss`)和`@tailwindcss/postcss`,实现灵活快速的样式设计,同时保持一致性。
|
|
20
|
-
- **快速开发工作流:** 使用Rsbuild(`@rsbuild/core`和`@rsbuild/plugin-react`)实现优化构建和高效开发服务器性能。
|
|
21
|
-
- **图标支持:** 包含`@iconify/json`和`@iconify/tailwind4`,提供可扩展和可定制的图标。
|
|
22
|
-
- **类型安全:** 使用TypeScript (v5.9.x)增强代码可靠性,并在开发过程中提供强大的类型检查。
|
|
23
|
-
- **注重代码质量:** 包含ESLint和`@antfu/eslint-config`,用于代码 linting 和执行最佳实践。
|
|
24
|
-
- **Git Hooks:** 集成`husky`和`lint-staged`用于提交前检查。
|
|
18
|
+

|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
- **现代 UI 框架:** 使用 React (v19) 构建,支持组件驱动的声明式接口。
|
|
21
|
+
- **实用优先的样式:** 采用 Tailwind CSS v4(`tailwindcss`)和 `@tailwindcss/postcss`,实现灵活快速的样式开发,同时保持一致性。
|
|
22
|
+
- **快速开发工作流:** 使用 Rsbuild(`@rsbuild/core` 和 `@rsbuild/plugin-react`)进行优化构建和高效开发服务器性能。
|
|
23
|
+
- **图标支持:** 包含 `@iconify/json` 和 `@iconify/tailwind4`,提供可扩展和可定制的图标。
|
|
24
|
+
- **类型安全:** 利用 TypeScript (v5.9.x) 提高代码可靠性,并在开发过程中提供强大的类型检查。
|
|
25
|
+
- **代码质量:** 包含 ESLint 和 `@antfu/eslint-config` 进行代码检查和最佳实践 enforcement。
|
|
26
|
+
- **Git Hooks:** 集成 `husky` 和 `lint-staged` 进行提交前检查。
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
- **样式:** Tailwind CSS (`tailwindcss`)
|
|
30
|
-
- **构建工具:** Rsbuild (`@rsbuild/core`)
|
|
31
|
-
- **语言:** TypeScript (v5.9.x)
|
|
32
|
-
- **CSS处理:** PostCSS with `@tailwindcss/postcss`
|
|
33
|
-
- **代码检查:** ESLint与`@antfu/eslint-config`
|
|
34
|
-
- **图标库:** Iconify (`@iconify/json`, `@iconify/tailwind4`)
|
|
28
|
+

|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
- **框架/库:** React (v19)
|
|
31
|
+
- **样式:** Tailwind CSS (`tailwindcss`)
|
|
32
|
+
- **构建工具:** Rsbuild (`@rsbuild/core`)
|
|
33
|
+
- **语言:** TypeScript (v5.9.x)
|
|
34
|
+
- **CSS 处理:** PostCSS 和 `@tailwindcss/postcss`
|
|
35
|
+
- **代码检查:** ESLint 和 `@antfu/eslint-config`
|
|
36
|
+
- **图标:** Iconify (`@iconify/json`, `@iconify/tailwind4`)
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
查看 [package.json](../package.json) 获取完整的依赖列表。
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+

|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
## 前置条件
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
- Node.js(推荐 >= 18.x)
|
|
45
|
+
- 包管理器(npm、yarn 或 pnpm)
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
- 包管理器 (npm, yarn 或 pnpm)
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
node -v
|
|
51
|
-
npm -v
|
|
52
|
-
```
|
|
47
|
+
### 安装
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
1. 使用模板创建新项目:
|
|
49
|
+
1. 使用模板创建新项目:
|
|
57
50
|
|
|
58
51
|
```bash
|
|
59
52
|
pnpm create trapar-waves
|
|
60
53
|
```
|
|
61
54
|
|
|
62
|
-
2.
|
|
55
|
+
2. 导航到项目目录并安装依赖:
|
|
63
56
|
|
|
64
57
|
```bash
|
|
65
58
|
pnpm install
|
|
66
|
-
# or
|
|
67
|
-
npm install
|
|
68
|
-
# or
|
|
69
|
-
yarn install
|
|
70
59
|
```
|
|
71
60
|
|
|
72
|
-
3.
|
|
61
|
+
3. 启动开发服务器:
|
|
73
62
|
|
|
74
63
|
```bash
|
|
75
64
|
pnpm dev
|
|
76
65
|
```
|
|
77
66
|
|
|
78
|
-
|
|
67
|
+

|
|
79
68
|
|
|
80
69
|
```
|
|
81
70
|
├── public/ # 静态资源
|
|
82
71
|
├── src/ # 源代码
|
|
83
|
-
│ ├── App.css # 全局样式和Tailwind导入
|
|
72
|
+
│ ├── App.css # 全局样式和 Tailwind 导入
|
|
84
73
|
│ ├── App.tsx # 主应用组件
|
|
85
74
|
│ └── index.tsx # 入口点
|
|
86
|
-
├── rsbuild.config.ts # Rsbuild配置
|
|
87
|
-
├── tsconfig.json # TypeScript配置
|
|
88
|
-
├── eslint.config.js # ESLint配置
|
|
75
|
+
├── rsbuild.config.ts # Rsbuild 配置
|
|
76
|
+
├── tsconfig.json # TypeScript 配置
|
|
77
|
+
├── eslint.config.js # ESLint 配置
|
|
89
78
|
└── package.json # 项目依赖和脚本
|
|
90
79
|
```
|
|
91
80
|
|
|
92
|
-
|
|
81
|
+

|
|
93
82
|
|
|
94
|
-
|
|
83
|
+
欢迎贡献,非常感谢!请按照以下步骤贡献:
|
|
95
84
|
|
|
96
|
-
1. Fork
|
|
97
|
-
2.
|
|
98
|
-
3.
|
|
85
|
+
1. Fork 仓库
|
|
86
|
+
2. 创建特性分支(`git checkout -b feature/amazing-feature`)
|
|
87
|
+
3. 提交更改(`git commit -m 'Add some amazing feature'`)
|
|
99
88
|
4. 推送到分支(`git push origin feature/amazing-feature`)
|
|
100
|
-
5.
|
|
89
|
+
5. 创建 Pull Request
|
|
90
|
+
|
|
91
|
+

|
|
92
|
+
|
|
93
|
+
MIT License © 2025 Trapar Waves
|
|
101
94
|
|
|
102
|
-
## 👤
|
|
95
|
+
## 👤 作者
|
|
103
96
|
|
|
104
|
-
- **Rikka
|
|
105
|
-
- **GitHub
|
|
97
|
+
- **Rikka:** [admin@rikka.cc](mailto:admin@rikka.cc)
|
|
98
|
+
- **GitHub 主页:** [Muromi-Rikka](https://github.com/Muromi-Rikka)
|
|
106
99
|
|
|
107
|
-
## 🔗
|
|
100
|
+
## 🔗 链接
|
|
108
101
|
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
- **问题:** [https://github.com/Trapar-waves/react-tailwind/issues](https://github.com/Trapar-waves/react-tailwind/issues)
|
|
102
|
+
- **仓库:** [https://github.com/Trapar-waves/react-tailwind](https://github.com/Trapar-waves/react-tailwind)
|
|
103
|
+
- **Issues:** [https://github.com/Trapar-waves/react-tailwind/issues](https://github.com/Trapar-waves/react-tailwind/issues)
|
package/readme/README-JP.md
CHANGED
|
@@ -7,105 +7,97 @@
|
|
|
7
7
|

|
|
8
8
|

|
|
9
9
|
|
|
10
|
+

|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
[English](../README.md) | [中文](./README-CN.md) | [Русский язык](./README-RU.md)
|
|
13
15
|
|
|
14
|
-
> ReactとTailwind CSSを統合したモダンなUI開発テンプレート。Rsbuild、TypeScript、ESLint
|
|
15
|
-
|
|
16
|
-
## ✨ 特徴
|
|
16
|
+
> React と Tailwind CSS を統合したモダンな UI 開発テンプレート。Rsbuild、TypeScript、ESLint(Antfu 設定)、Iconify サポート付き。
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
- **ユーティリティファーストのスタイリング:** Tailwind CSS v4 (`tailwindcss`)と`@tailwindcss/postcss`を採用し、一貫性を維持しながら柔軟で迅速なスタイリングを可能にします。
|
|
20
|
-
- **高速開発ワークフロー:** Rsbuild(`@rsbuild/core`と`@rsbuild/plugin-react`)を使用して最適化されたビルドと効率的な開発サーバーパフォーマンスを実現します。
|
|
21
|
-
- **アイコンサポート:** `@iconify/json`と`@iconify/tailwind4`を含み、スケーラブルでカスタマイズ可能なアイコンを提供します。
|
|
22
|
-
- **型安全性:** TypeScript (v5.9.x)を使用してコードの信頼性を向上させ、開発中に堅牢な型チェックを提供します。
|
|
23
|
-
- **コード品質への焦点:** ESLintと`@antfu/eslint-config`を含み、コードベースのリンティングとベストプラクティスの適用を実現します。
|
|
24
|
-
- **Git フック:** `husky`と`lint-staged`を統合し、コミット前のチェックを実施します。
|
|
18
|
+

|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
- **モダン UI フレームワーク:** React (v19) を使用したコンポーネント駆動の宣言的インターフェース。
|
|
21
|
+
- **ユーティリティファーストのスタイリング:** Tailwind CSS v4(`tailwindcss`)と `@tailwindcss/postcss` を採用し、柔軟で迅速なスタイリングを実現しながら一貫性を維持。
|
|
22
|
+
- **高速開発ワークフロー:** Rsbuild(`@rsbuild/core` と `@rsbuild/plugin-react`)を使用し、最適化されたビルドと効率的な開発サーバー性能を実現。
|
|
23
|
+
- **アイコンサポート:** `@iconify/json` と `@iconify/tailwind4` を含み、スケーラブルでカスタマイズ可能なアイコンを提供。
|
|
24
|
+
- **型安全性:** TypeScript (v5.9.x) を活用し、コードの信頼性を向上させ、開発中に堅牢な型チェックを提供。
|
|
25
|
+
- **コード品質:** ESLint と `@antfu/eslint-config` を含み、リントとベストプラクティスの適用を強制。
|
|
26
|
+
- **Git Hooks:** `husky` と `lint-staged` を統合し、コミット前チェックを実行。
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
- **スタイリング:** Tailwind CSS (`tailwindcss`)
|
|
30
|
-
- **ビルドツール:** Rsbuild (`@rsbuild/core`)
|
|
31
|
-
- **言語:** TypeScript (v5.9.x)
|
|
32
|
-
- **CSS処理:** PostCSS with `@tailwindcss/postcss`
|
|
33
|
-
- **リンティング:** `@antfu/eslint-config`を備えたESLint
|
|
34
|
-
- **アイコン:** Iconify (`@iconify/json`, `@iconify/tailwind4`)
|
|
28
|
+

|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
- **フレームワーク/ライブラリ:** React (v19)
|
|
31
|
+
- **スタイリング:** Tailwind CSS (`tailwindcss`)
|
|
32
|
+
- **ビルドツール:** Rsbuild (`@rsbuild/core`)
|
|
33
|
+
- **言語:** TypeScript (v5.9.x)
|
|
34
|
+
- **CSS 処理:** PostCSS と `@tailwindcss/postcss`
|
|
35
|
+
- **リント:** ESLint と `@antfu/eslint-config`
|
|
36
|
+
- **アイコン:** Iconify (`@iconify/json`, `@iconify/tailwind4`)
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
依存関係の完全なリストは [package.json](../package.json) を参照してください。
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+

|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
## 前提条件
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- Node.js (推奨バージョン >= 18.x)
|
|
47
|
-
- パッケージマネージャー (npm, yarn または pnpm)
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
node -v
|
|
51
|
-
npm -v
|
|
52
|
-
```
|
|
44
|
+
- Node.js(>= 18.x 推奨)
|
|
45
|
+
- パッケージマネージャー(npm、yarn、または pnpm)
|
|
53
46
|
|
|
54
47
|
### インストール
|
|
55
48
|
|
|
56
|
-
1.
|
|
49
|
+
1. テンプレートを使用して新しいプロジェクトを作成:
|
|
57
50
|
|
|
58
51
|
```bash
|
|
59
52
|
pnpm create trapar-waves
|
|
60
53
|
```
|
|
61
54
|
|
|
62
|
-
2.
|
|
55
|
+
2. プロジェクトディレクトリに移動し、依存関係をインストール:
|
|
63
56
|
|
|
64
57
|
```bash
|
|
65
58
|
pnpm install
|
|
66
|
-
# or
|
|
67
|
-
npm install
|
|
68
|
-
# or
|
|
69
|
-
yarn install
|
|
70
59
|
```
|
|
71
60
|
|
|
72
|
-
3.
|
|
61
|
+
3. 開発サーバーを起動:
|
|
73
62
|
|
|
74
63
|
```bash
|
|
75
64
|
pnpm dev
|
|
76
65
|
```
|
|
77
66
|
|
|
78
|
-
|
|
67
|
+

|
|
79
68
|
|
|
80
69
|
```
|
|
81
70
|
├── public/ # 静的アセット
|
|
82
71
|
├── src/ # ソースコード
|
|
83
|
-
│ ├── App.css # グローバルスタイルとTailwind
|
|
72
|
+
│ ├── App.css # グローバルスタイルと Tailwind インポート
|
|
84
73
|
│ ├── App.tsx # メインアプリケーションコンポーネント
|
|
85
74
|
│ └── index.tsx # エントリーポイント
|
|
86
|
-
├── rsbuild.config.ts # Rsbuild設定
|
|
87
|
-
├── tsconfig.json # TypeScript設定
|
|
88
|
-
├── eslint.config.js # ESLint設定
|
|
75
|
+
├── rsbuild.config.ts # Rsbuild 設定
|
|
76
|
+
├── tsconfig.json # TypeScript 設定
|
|
77
|
+
├── eslint.config.js # ESLint 設定
|
|
89
78
|
└── package.json # プロジェクトの依存関係とスクリプト
|
|
90
79
|
```
|
|
91
80
|
|
|
92
|
-
|
|
81
|
+

|
|
82
|
+
|
|
83
|
+
コントリビュートを歓迎します!以下の手順に従ってコントリビュートしてください:
|
|
84
|
+
|
|
85
|
+
1. リポジトリをフォーク
|
|
86
|
+
2. 機能ブランチを作成(`git checkout -b feature/amazing-feature`)
|
|
87
|
+
3. 変更をコミット(`git commit -m 'Add some amazing feature'`)
|
|
88
|
+
4. ブランチにプッシュ(`git push origin feature/amazing-feature`)
|
|
89
|
+
5. Pull Request を作成
|
|
93
90
|
|
|
94
|
-
|
|
91
|
+

|
|
95
92
|
|
|
96
|
-
|
|
97
|
-
2. 機能ブランチを作成する(`git checkout -b feature/amazing-feature`)
|
|
98
|
-
3. 変更をコミットする(`git commit -m 'Add some amazing feature'`)
|
|
99
|
-
4. ブランチにプッシュする(`git push origin feature/amazing-feature`)
|
|
100
|
-
5. Pull Requestを開く
|
|
93
|
+
MIT License © 2025 Trapar Waves
|
|
101
94
|
|
|
102
|
-
## 👤
|
|
95
|
+
## 👤 作者
|
|
103
96
|
|
|
104
|
-
- **Rikka
|
|
105
|
-
- **GitHub
|
|
97
|
+
- **Rikka:** [admin@rikka.cc](mailto:admin@rikka.cc)
|
|
98
|
+
- **GitHub プロフィール:** [Muromi-Rikka](https://github.com/Muromi-Rikka)
|
|
106
99
|
|
|
107
|
-
## 🔗
|
|
100
|
+
## 🔗 リンク
|
|
108
101
|
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
- **イシュー:** [https://github.com/Trapar-waves/react-tailwind/issues](https://github.com/Trapar-waves/react-tailwind/issues)
|
|
102
|
+
- **リポジトリ:** [https://github.com/Trapar-waves/react-tailwind](https://github.com/Trapar-waves/react-tailwind)
|
|
103
|
+
- **Issues:** [https://github.com/Trapar-waves/react-tailwind/issues](https://github.com/Trapar-waves/react-tailwind/issues)
|
package/readme/README-RU.md
CHANGED
|
@@ -7,49 +7,42 @@
|
|
|
7
7
|

|
|
8
8
|

|
|
9
9
|
|
|
10
|
+

|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
[English](../README.md) | [中文](./README-CN.md) | [日本語](./README-JP.md)
|
|
13
15
|
|
|
14
|
-
> Современный шаблон разработки
|
|
16
|
+
> Современный шаблон разработки UI, интегрирующий React и Tailwind CSS, с поддержкой Rsbuild, TypeScript, ESLint (конфигурация Antfu) и Iconify.
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+

|
|
17
19
|
|
|
18
|
-
- **Современный UI
|
|
19
|
-
-
|
|
20
|
-
- **Быстрый рабочий процесс разработки:** Использует Rsbuild (`@rsbuild/core` и `@rsbuild/plugin-react`) для оптимизированных сборок и эффективной
|
|
21
|
-
- **Поддержка иконок:** Включает `@iconify/json` и `@iconify/tailwind4` для
|
|
22
|
-
-
|
|
23
|
-
- **Фокус на качестве кода:** Включает ESLint с `@antfu/eslint-config` для линтинга и
|
|
24
|
-
- **Git Hooks:**
|
|
20
|
+
- **Современный UI фреймворк:** Построен на React (v19) для компонентно-ориентированного декларативного интерфейса.
|
|
21
|
+
- **Утилитарный подход к стилям:** Использует Tailwind CSS v4 (`tailwindcss`) вместе с `@tailwindcss/postcss`, обеспечивая гибкую и быструю разработку стилей с сохранением一致性.
|
|
22
|
+
- **Быстрый рабочий процесс разработки:** Использует Rsbuild (`@rsbuild/core` и `@rsbuild/plugin-react`) для оптимизированных сборок и эффективной работы сервера разработки.
|
|
23
|
+
- **Поддержка иконок:** Включает `@iconify/json` и `@iconify/tailwind4` для масштабируемых и настраиваемых иконок.
|
|
24
|
+
- **Типобезопасность:** Использует TypeScript (v5.9.x) для повышения надежности кода и обеспечения строгой проверки типов во время разработки.
|
|
25
|
+
- **Фокус на качестве кода:** Включает ESLint с `@antfu/eslint-config` для линтинга и применения лучших практик.
|
|
26
|
+
- **Git Hooks:** Интегрированы `husky` и `lint-staged` для проверок перед коммитом.
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+

|
|
27
29
|
|
|
28
|
-
-
|
|
30
|
+
- **Фреймворк/библиотека:** React (v19)
|
|
29
31
|
- **Стилизация:** Tailwind CSS (`tailwindcss`)
|
|
30
32
|
- **Инструмент сборки:** Rsbuild (`@rsbuild/core`)
|
|
31
33
|
- **Язык:** TypeScript (v5.9.x)
|
|
32
|
-
- **Обработка CSS:** PostCSS
|
|
33
|
-
- **Линтинг:** ESLint
|
|
34
|
+
- **Обработка CSS:** PostCSS и `@tailwindcss/postcss`
|
|
35
|
+
- **Линтинг:** ESLint и `@antfu/eslint-config`
|
|
34
36
|
- **Иконки:** Iconify (`@iconify/json`, `@iconify/tailwind4`)
|
|
35
37
|
|
|
36
|
-
Полный список зависимостей
|
|
37
|
-
|
|
38
|
-
## 🚀 Начало работы
|
|
38
|
+
Полный список зависимостей смотрите в [package.json](../package.json).
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+

|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
## Предварительные требования
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- Node.js (рекомендуется версия >= 18.x)
|
|
47
|
-
- Пакетный менеджер (npm, yarn или pnpm)
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
node -v
|
|
51
|
-
npm -v
|
|
52
|
-
```
|
|
44
|
+
- Node.js (рекомендуется >= 18.x)
|
|
45
|
+
- Менеджер пакетов (npm, yarn или pnpm)
|
|
53
46
|
|
|
54
47
|
### Установка
|
|
55
48
|
|
|
@@ -59,14 +52,10 @@ npm -v
|
|
|
59
52
|
pnpm create trapar-waves
|
|
60
53
|
```
|
|
61
54
|
|
|
62
|
-
2. Перейдите в
|
|
55
|
+
2. Перейдите в директорию проекта и установите зависимости:
|
|
63
56
|
|
|
64
57
|
```bash
|
|
65
58
|
pnpm install
|
|
66
|
-
# or
|
|
67
|
-
npm install
|
|
68
|
-
# or
|
|
69
|
-
yarn install
|
|
70
59
|
```
|
|
71
60
|
|
|
72
61
|
3. Запустите сервер разработки:
|
|
@@ -75,12 +64,12 @@ npm -v
|
|
|
75
64
|
pnpm dev
|
|
76
65
|
```
|
|
77
66
|
|
|
78
|
-
|
|
67
|
+

|
|
79
68
|
|
|
80
69
|
```
|
|
81
70
|
├── public/ # Статические ресурсы
|
|
82
71
|
├── src/ # Исходный код
|
|
83
|
-
│ ├── App.css # Глобальные стили и
|
|
72
|
+
│ ├── App.css # Глобальные стили и импорты Tailwind
|
|
84
73
|
│ ├── App.tsx # Основной компонент приложения
|
|
85
74
|
│ └── index.tsx # Точка входа
|
|
86
75
|
├── rsbuild.config.ts # Конфигурация Rsbuild
|
|
@@ -89,23 +78,26 @@ npm -v
|
|
|
89
78
|
└── package.json # Зависимости и скрипты проекта
|
|
90
79
|
```
|
|
91
80
|
|
|
92
|
-
|
|
81
|
+

|
|
93
82
|
|
|
94
|
-
|
|
83
|
+
Участие приветствуется и высоко ценится! Пожалуйста, следуйте этим шагам для вклада:
|
|
95
84
|
|
|
96
|
-
1.
|
|
97
|
-
2. Создайте ветку
|
|
98
|
-
3. Зафиксируйте
|
|
85
|
+
1. Fork репозиторий
|
|
86
|
+
2. Создайте ветку для новой функции (`git checkout -b feature/amazing-feature`)
|
|
87
|
+
3. Зафиксируйте изменения (`git commit -m 'Add some amazing feature'`)
|
|
99
88
|
4. Отправьте изменения в ветку (`git push origin feature/amazing-feature`)
|
|
100
89
|
5. Откройте Pull Request
|
|
101
90
|
|
|
102
|
-
|
|
91
|
+

|
|
92
|
+
|
|
93
|
+
MIT License © 2025 Trapar Waves
|
|
94
|
+
|
|
95
|
+
## 👤 Автор
|
|
103
96
|
|
|
104
97
|
- **Rikka:** [admin@rikka.cc](mailto:admin@rikka.cc)
|
|
105
|
-
-
|
|
98
|
+
- **Профиль GitHub:** [Muromi-Rikka](https://github.com/Muromi-Rikka)
|
|
106
99
|
|
|
107
|
-
## 🔗
|
|
100
|
+
## 🔗 Ссылки
|
|
108
101
|
|
|
109
102
|
- **Репозиторий:** [https://github.com/Trapar-waves/react-tailwind](https://github.com/Trapar-waves/react-tailwind)
|
|
110
|
-
-
|
|
111
|
-
- **Проблемы:** [https://github.com/Trapar-waves/react-tailwind/issues](https://github.com/Trapar-waves/react-tailwind/issues)
|
|
103
|
+
- **Issues:** [https://github.com/Trapar-waves/react-tailwind/issues](https://github.com/Trapar-waves/react-tailwind/issues)
|
package/rsbuild.config.ts
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
import { defineConfig } from "@rsbuild/core";
|
|
2
2
|
import { pluginReact } from "@rsbuild/plugin-react";
|
|
3
|
+
import { RsdoctorRspackPlugin } from "@rsdoctor/rspack-plugin";
|
|
3
4
|
import tailwind from "@tailwindcss/postcss";
|
|
5
|
+
import process from "node:process";
|
|
6
|
+
import TurboConsole from "unplugin-turbo-console/rspack";
|
|
7
|
+
|
|
8
|
+
function normalizeBasePath(): string {
|
|
9
|
+
const raw = process.env.BASE_PATH?.trim();
|
|
10
|
+
if (!raw || raw === "/") {
|
|
11
|
+
return "/";
|
|
12
|
+
}
|
|
13
|
+
const prefixed = raw.startsWith("/") ? raw : `/${raw}`;
|
|
14
|
+
return prefixed.endsWith("/") ? prefixed : `${prefixed}/`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const basePath = normalizeBasePath();
|
|
18
|
+
const isUseSubpath = basePath !== "/";
|
|
19
|
+
|
|
20
|
+
const isEnableRsdoctor = Boolean(process.env.RSDOCTOR);
|
|
21
|
+
const isEnableTurboConsole = process.env.NODE_ENV === "development";
|
|
4
22
|
|
|
5
23
|
export default defineConfig({
|
|
24
|
+
...(isUseSubpath && {
|
|
25
|
+
output: { assetPrefix: basePath },
|
|
26
|
+
server: { base: basePath },
|
|
27
|
+
}),
|
|
28
|
+
performance: {
|
|
29
|
+
...(isEnableRsdoctor && { buildCache: false }),
|
|
30
|
+
},
|
|
6
31
|
plugins: [pluginReact()],
|
|
7
32
|
tools: {
|
|
8
33
|
postcss: {
|
|
@@ -10,5 +35,22 @@ export default defineConfig({
|
|
|
10
35
|
plugins: [tailwind],
|
|
11
36
|
},
|
|
12
37
|
},
|
|
38
|
+
rspack: {
|
|
39
|
+
plugins: [
|
|
40
|
+
...(isEnableTurboConsole ? [TurboConsole()] : []),
|
|
41
|
+
...(isEnableRsdoctor
|
|
42
|
+
? [
|
|
43
|
+
new RsdoctorRspackPlugin({
|
|
44
|
+
output: {
|
|
45
|
+
mode: "brief",
|
|
46
|
+
options: {
|
|
47
|
+
type: ["json"],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
]
|
|
52
|
+
: []),
|
|
53
|
+
],
|
|
54
|
+
},
|
|
13
55
|
},
|
|
14
56
|
});
|
package/src/app.css
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Outfit:wght@400;500;600&display=swap");
|
|
2
|
+
|
|
3
|
+
@import "tailwindcss";
|
|
4
|
+
@plugin "@iconify/tailwind4";
|
|
5
|
+
|
|
6
|
+
@theme {
|
|
7
|
+
--font-display: "Instrument Serif", ui-serif, Georgia, serif;
|
|
8
|
+
--font-sans: "Outfit", system-ui, sans-serif;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (prefers-reduced-motion: reduce) {
|
|
12
|
+
*,
|
|
13
|
+
*::before,
|
|
14
|
+
*::after {
|
|
15
|
+
animation-duration: 0.01ms !important;
|
|
16
|
+
animation-iteration-count: 1 !important;
|
|
17
|
+
transition-duration: 0.01ms !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.skip-link {
|
|
22
|
+
position: absolute;
|
|
23
|
+
left: 0.75rem;
|
|
24
|
+
top: 0.75rem;
|
|
25
|
+
z-index: 50;
|
|
26
|
+
padding: 0.5rem 1rem;
|
|
27
|
+
border-radius: 0.375rem;
|
|
28
|
+
background: #0f172a;
|
|
29
|
+
color: #f8fafc;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
font-size: 0.875rem;
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
transform: translateY(-200%);
|
|
34
|
+
transition: transform 200ms ease-out;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.skip-link:focus {
|
|
38
|
+
transform: translateY(0);
|
|
39
|
+
outline: 3px solid #f97316;
|
|
40
|
+
outline-offset: 2px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.hero-grid {
|
|
44
|
+
background-image:
|
|
45
|
+
linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
|
|
46
|
+
linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
|
|
47
|
+
background-size: 48px 48px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.trapar-tech-icon {
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
width: 2.75rem;
|
|
55
|
+
height: 2.75rem;
|
|
56
|
+
border-radius: 0.75rem;
|
|
57
|
+
background: rgba(255, 255, 255, 0.95);
|
|
58
|
+
border: 1px solid rgba(234, 88, 12, 0.2);
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.trapar-tech-icon span[class^="icon-"] {
|
|
63
|
+
font-size: 1.5rem;
|
|
64
|
+
line-height: 1;
|
|
65
|
+
}
|
package/src/app.tsx
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import "./app.css";
|
|
2
|
+
|
|
3
|
+
const HOMEPAGE = "https://github.com/Trapar-waves/react-tailwind";
|
|
4
|
+
const LOGOS_SET_URL = "https://icon-sets.iconify.design/logos/";
|
|
5
|
+
|
|
6
|
+
interface TechItem {
|
|
7
|
+
hint: string;
|
|
8
|
+
iconClass: string;
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const techStack: TechItem[] = [
|
|
14
|
+
{ hint: "组件驱动、声明式 UI", iconClass: "icon-[logos--react]", id: "react", label: "React 19" },
|
|
15
|
+
{ hint: "静态类型与编辑器体验", iconClass: "icon-[logos--typescript-icon]", id: "ts", label: "TypeScript" },
|
|
16
|
+
{ hint: "tailwindcss · @tailwindcss/postcss", iconClass: "icon-[logos--tailwindcss-icon]", id: "tailwind", label: "Tailwind CSS 4" },
|
|
17
|
+
{ hint: "@rsbuild/core · @rsbuild/plugin-react", iconClass: "icon-[material-icon-theme--rstack]", id: "rsbuild", label: "Rsbuild" },
|
|
18
|
+
{ hint: "@renton/eslint-config-react", iconClass: "icon-[logos--eslint]", id: "eslint", label: "ESLint" },
|
|
19
|
+
{ hint: "@iconify/json · @iconify/tailwind4(含 logos)", iconClass: "icon-[logos--markdown]", id: "iconify", label: "Iconify" },
|
|
20
|
+
{ hint: "包管理与 CI 缓存", iconClass: "icon-[logos--pnpm]", id: "pnpm", label: "pnpm" },
|
|
21
|
+
{ hint: "本地开发与构建", iconClass: "icon-[logos--nodejs-icon]", id: "node", label: "Node.js" },
|
|
22
|
+
{ hint: "Release 与 Pages 工作流", iconClass: "icon-[logos--github-icon]", id: "github", label: "GitHub Actions" },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const readmeFeatures: string[] = [
|
|
26
|
+
"基于 React 19 的组件化界面。",
|
|
27
|
+
"Tailwind CSS v4 与 @tailwindcss/postcss,工具类优先、易迭代。",
|
|
28
|
+
"Rsbuild 提供极速开发与优化构建。",
|
|
29
|
+
"@iconify/json 与 @iconify/tailwind4,支持 logos 等多集合矢量图标。",
|
|
30
|
+
"TypeScript 贯穿模板代码。",
|
|
31
|
+
"@renton/eslint-config-react 统一代码风格与规则。",
|
|
32
|
+
"Husky 与 lint-staged 在提交前执行检查。",
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const readmeTechNote = "本模板未内置路由或全局状态;可按业务接入 TanStack Router、Zustand 等,与 README「扩展」章节一致。";
|
|
36
|
+
|
|
37
|
+
export default function App() {
|
|
38
|
+
return (
|
|
39
|
+
<div className="min-h-dvh bg-[#faf8f5] text-slate-900 font-sans antialiased">
|
|
40
|
+
<a className="skip-link" href="#main">
|
|
41
|
+
跳到主要内容
|
|
42
|
+
</a>
|
|
43
|
+
<div className="hero-grid relative overflow-hidden border-b border-slate-200/80">
|
|
44
|
+
<div
|
|
45
|
+
aria-hidden
|
|
46
|
+
className="pointer-events-none absolute -right-24 top-0 h-72 w-72 rounded-full bg-orange-500/15 blur-3xl motion-safe:animate-[pulse_14s_ease-in-out_infinite]"
|
|
47
|
+
/>
|
|
48
|
+
<header className="relative mx-auto max-w-5xl px-6 pb-16 pt-14 sm:px-10 sm:pb-20 sm:pt-20">
|
|
49
|
+
<p className="font-mono text-xs font-medium uppercase tracking-[0.2em] text-orange-700">
|
|
50
|
+
Trapar-waves / react-tailwind
|
|
51
|
+
</p>
|
|
52
|
+
<h1 className="mt-4 max-w-3xl font-display text-4xl font-normal leading-tight text-slate-950 sm:text-5xl">
|
|
53
|
+
Rsbuild、React 19 与 Tailwind CSS 4 的轻量起点
|
|
54
|
+
</h1>
|
|
55
|
+
<p className="mt-6 max-w-2xl text-lg leading-relaxed text-slate-600">
|
|
56
|
+
本页结合 README 特性与
|
|
57
|
+
{" "}
|
|
58
|
+
<a
|
|
59
|
+
className="font-semibold text-orange-800 underline decoration-orange-300 underline-offset-2 hover:text-orange-950"
|
|
60
|
+
href={LOGOS_SET_URL}
|
|
61
|
+
rel="noreferrer"
|
|
62
|
+
target="_blank"
|
|
63
|
+
>
|
|
64
|
+
Iconify logos
|
|
65
|
+
</a>
|
|
66
|
+
{" "}
|
|
67
|
+
集合展示技术栈;保留 @theme 字体、跳过链接与减少动效等可访问实践。
|
|
68
|
+
</p>
|
|
69
|
+
<div className="mt-10 flex flex-wrap items-center gap-4">
|
|
70
|
+
<a
|
|
71
|
+
className="inline-flex min-h-11 min-w-11 items-center justify-center rounded-full bg-slate-900 px-8 py-3 text-sm font-semibold text-white shadow-lg shadow-slate-900/15 transition hover:bg-slate-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-orange-500"
|
|
72
|
+
href={HOMEPAGE}
|
|
73
|
+
>
|
|
74
|
+
查看模板仓库
|
|
75
|
+
</a>
|
|
76
|
+
<span aria-hidden className="icon-[logos--react] text-3xl text-sky-700" />
|
|
77
|
+
<span aria-hidden className="icon-[logos--tailwindcss-icon] text-3xl text-cyan-700" />
|
|
78
|
+
<span aria-hidden className="icon-[material-icon-theme--rstack] text-3xl text-amber-800" />
|
|
79
|
+
</div>
|
|
80
|
+
</header>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<main className="mx-auto max-w-5xl px-6 py-14 sm:px-10" id="main">
|
|
84
|
+
<h2 className="font-display text-2xl text-slate-900">技术栈一览</h2>
|
|
85
|
+
<p className="mt-2 max-w-3xl text-sm leading-relaxed text-slate-600">
|
|
86
|
+
Rsbuild 与 Rspack 生态相关示意使用
|
|
87
|
+
{" "}
|
|
88
|
+
<code className="rounded bg-slate-200/80 px-1.5 py-0.5 text-slate-800">material-icon-theme--rstack</code>
|
|
89
|
+
;图标集说明见上文链接。
|
|
90
|
+
</p>
|
|
91
|
+
<ul className="mt-8 grid list-none gap-4 p-0 sm:grid-cols-2 lg:grid-cols-3">
|
|
92
|
+
{techStack.map(item => (
|
|
93
|
+
<li
|
|
94
|
+
className="flex gap-4 rounded-2xl border border-slate-200/90 bg-white p-5 shadow-sm"
|
|
95
|
+
key={item.id}
|
|
96
|
+
>
|
|
97
|
+
<div aria-hidden className="trapar-tech-icon">
|
|
98
|
+
<span className={item.iconClass} />
|
|
99
|
+
</div>
|
|
100
|
+
<div>
|
|
101
|
+
<h3 className="text-base font-semibold text-slate-900">{item.label}</h3>
|
|
102
|
+
<p className="mt-1 text-sm leading-snug text-slate-600">{item.hint}</p>
|
|
103
|
+
</div>
|
|
104
|
+
</li>
|
|
105
|
+
))}
|
|
106
|
+
</ul>
|
|
107
|
+
|
|
108
|
+
<h2 className="font-display mt-14 text-2xl text-slate-900">README 特性摘要</h2>
|
|
109
|
+
<ul className="mt-4 max-w-3xl list-disc space-y-2 pl-5 text-slate-700">
|
|
110
|
+
{readmeFeatures.map(line => (
|
|
111
|
+
<li key={line}>{line}</li>
|
|
112
|
+
))}
|
|
113
|
+
</ul>
|
|
114
|
+
<p className="mt-4 max-w-3xl text-sm italic text-slate-600">{readmeTechNote}</p>
|
|
115
|
+
|
|
116
|
+
<section aria-labelledby="a11y-heading" className="mt-12 rounded-2xl border border-slate-200/90 bg-white p-6 shadow-sm">
|
|
117
|
+
<h2 className="font-display text-xl text-slate-900" id="a11y-heading">
|
|
118
|
+
图标与可访问性
|
|
119
|
+
</h2>
|
|
120
|
+
<p className="mt-3 max-w-3xl text-sm leading-relaxed text-slate-600">
|
|
121
|
+
装饰性技术标识使用 Iconify
|
|
122
|
+
<code className="mx-1 rounded bg-slate-100 px-1">logos</code>
|
|
123
|
+
集合的矢量类名(与源码中实际 slug 一致),并配合
|
|
124
|
+
<span className="font-medium text-slate-800"> aria-hidden</span>
|
|
125
|
+
;主操作区保持约 44px 触控高度与可见焦点环;系统开启「减少动态效果」时装饰动画会缩短。
|
|
126
|
+
</p>
|
|
127
|
+
<div className="mt-4 flex flex-wrap gap-3">
|
|
128
|
+
<span aria-hidden className="icon-[logos--eslint] text-3xl text-purple-800" />
|
|
129
|
+
<span aria-hidden className="icon-[logos--typescript-icon] text-3xl text-blue-800" />
|
|
130
|
+
<span aria-hidden className="icon-[logos--github-icon] text-3xl text-slate-800" />
|
|
131
|
+
</div>
|
|
132
|
+
</section>
|
|
133
|
+
|
|
134
|
+
<h2 className="font-display mt-14 text-2xl text-slate-900">界面骨架示例</h2>
|
|
135
|
+
<ul className="mt-8 grid gap-6 sm:grid-cols-2">
|
|
136
|
+
<li className="rounded-2xl border border-slate-200/90 bg-white p-6 shadow-sm transition hover:border-orange-200 hover:shadow-md">
|
|
137
|
+
<h3 className="text-lg font-semibold text-slate-900">Tailwind 4 + PostCSS</h3>
|
|
138
|
+
<p className="mt-2 text-slate-600">
|
|
139
|
+
使用 @theme 扩展字体族,配合 @utility 与任意值快速迭代布局与间距体系。
|
|
140
|
+
</p>
|
|
141
|
+
</li>
|
|
142
|
+
<li className="rounded-2xl border border-slate-200/90 bg-white p-6 shadow-sm transition hover:border-orange-200 hover:shadow-md">
|
|
143
|
+
<h3 className="text-lg font-semibold text-slate-900">Iconify 图标</h3>
|
|
144
|
+
<p className="mt-2 text-slate-600">
|
|
145
|
+
通过 @iconify/tailwind4 以原子类方式引用多集合矢量图标,避免 emoji 替代图标。
|
|
146
|
+
</p>
|
|
147
|
+
</li>
|
|
148
|
+
<li className="rounded-2xl border border-slate-200/90 bg-white p-6 shadow-sm transition hover:border-orange-200 hover:shadow-md">
|
|
149
|
+
<h3 className="text-lg font-semibold text-slate-900">可访问与动效</h3>
|
|
150
|
+
<p className="mt-2 text-slate-600">
|
|
151
|
+
首跳链接、可见焦点环,以及在 prefers-reduced-motion 下弱化装饰性动画。
|
|
152
|
+
</p>
|
|
153
|
+
</li>
|
|
154
|
+
<li className="rounded-2xl border border-slate-200/90 bg-white p-6 shadow-sm transition hover:border-orange-200 hover:shadow-md">
|
|
155
|
+
<h3 className="text-lg font-semibold text-slate-900">GitHub Pages</h3>
|
|
156
|
+
<p className="mt-2 text-slate-600">
|
|
157
|
+
通过 BASE_PATH 子路径构建,在推送版本标签时由 Actions 发布静态站点。
|
|
158
|
+
</p>
|
|
159
|
+
</li>
|
|
160
|
+
</ul>
|
|
161
|
+
</main>
|
|
162
|
+
<footer className="border-t border-slate-200/80 bg-white/80 py-8 text-center text-sm text-slate-500">
|
|
163
|
+
MIT · Trapar-waves · 图标致谢 Iconify logos(CC0)
|
|
164
|
+
</footer>
|
|
165
|
+
</div>
|
|
166
|
+
);
|
|
167
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import ReactDOM from "react-dom/client";
|
|
3
|
-
import App from "./
|
|
3
|
+
import App from "./app";
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
const root = ReactDOM.createRoot(
|
|
5
|
+
const rootElement = document.querySelector("#root");
|
|
6
|
+
if (rootElement) {
|
|
7
|
+
const root = ReactDOM.createRoot(rootElement);
|
|
8
8
|
root.render(
|
|
9
9
|
<React.StrictMode>
|
|
10
10
|
<App />
|
package/src/App.css
DELETED
package/src/App.tsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import "./App.css";
|
|
2
|
-
|
|
3
|
-
function App() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="bg-red-200">
|
|
6
|
-
<h1 className="text-green-800">Rsbuild with React</h1>
|
|
7
|
-
<p>Start building amazing things with Rsbuild.</p>
|
|
8
|
-
<span className="icon-[cryptocurrency--btc]"></span>
|
|
9
|
-
</div>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default App;
|
|
File without changes
|