Skip to content

Commit 46e8f61

Browse files
committed
feat: 新官网提交
1 parent 3e17f33 commit 46e8f61

File tree

136 files changed

+17539
-0
lines changed

Some content is hidden

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

136 files changed

+17539
-0
lines changed

packages/website-next/.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/openInula/node_modules
6+
/openInula/dist
7+
/.pnp
8+
.pnp.*
9+
.yarn/*
10+
!.yarn/patches
11+
!.yarn/plugins
12+
!.yarn/releases
13+
!.yarn/versions
14+
15+
# testing
16+
/coverage
17+
18+
# next.js
19+
/.next/
20+
/out/
21+
22+
# production
23+
/build
24+
25+
# misc
26+
.DS_Store
27+
*.pem
28+
29+
# debug
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
.pnpm-debug.log*
34+
35+
# env files (can opt-in for committing if needed)
36+
.env*
37+
38+
# vercel
39+
.vercel
40+
41+
# typescript
42+
*.tsbuildinfo
43+
next-env.d.ts
44+
45+
#IDE
46+
.idea/
47+
48+
package-lock.json
49+
yarn.lock
50+
pnpm-lock.yaml
51+
52+
_pagefind/

packages/website-next/README.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# OpenInula 官网(Next.js 版)
2+
3+
## 项目简介
4+
5+
OpenInula 是一个现代化的 JavaScript UI 框架,致力于提供极致性能和开发体验。本仓库为 OpenInula 新一代官网,基于 Next.js 13+(App Router)与 Tailwind CSS 构建,提供文档、教程、示例与 Playground 等站点能力。
6+
7+
---
8+
9+
## 核心特性
10+
11+
- **编译优先**:在编译期完成大部分工作,缩短运行时开销
12+
- **细粒度响应式**:自动追踪依赖,减少不必要重渲染
13+
- **API 兼容性**:与 React 生态高度契合,平滑迁移
14+
- **模板增强**:内置 if/for 等模板指令
15+
- **站点体验**:深色模式、搜索、高亮、课程与示例、交互动效
16+
17+
---
18+
19+
## 环境要求
20+
21+
- Node.js ≥ 18
22+
- 包管理器:推荐 pnpm(也可使用 yarn/npm)
23+
- 由于本仓库包含 `openInula` 子项目(Vite 应用),其 Vite 插件要求 Node ≥ 18
24+
25+
---
26+
27+
## 安装与启动
28+
29+
1. 安装依赖(根项目):
30+
31+
```bash
32+
pnpm install
33+
```
34+
35+
2. 安装依赖(可选,openInula 子项目用于 Playground REPL 示例):
36+
37+
```bash
38+
cd openInula && pnpm install
39+
```
40+
41+
3. 本地开发:
42+
43+
```bash
44+
# 在根目录启动 Next.js 开发服务器
45+
pnpm dev
46+
47+
# 如需同时启动 openInula 子项目(可选)
48+
cd openInula && pnpm dev
49+
```
50+
4. 启用文档搜索
51+
```bash
52+
#首先构建项目
53+
pnpm build --no-lint
54+
55+
#然后运行 postbuild 生成搜索索引
56+
pnpm postbuild
57+
```
58+
---
59+
60+
## 构建与部署
61+
62+
- 根站点构建:
63+
首先将openInula文件夹移到其他地方,不要在项目根目录。同时,也需要进入openInula文件夹进行一次pnpm build构建
64+
65+
```bash
66+
pnpm build --no-lint
67+
pnpm postbuild
68+
```
69+
70+
- 站点启动(生产):
71+
72+
```bash
73+
pnpm start
74+
```
75+
76+
- 构建后搜索索引:构建完成会自动执行 `postbuild`,用 Pagefind 生成到 `public/_pagefind`
77+
78+
- 注意事项(重要):
79+
- 本仓库包含 `openInula/` 子目录(一个独立的 Vite 应用,仅供 REPL/Playground),默认情况下并不会影响 Next.js 的构建。但如果你的自定义流程将其纳入同一产物或分析,请避免把 `openInula` 误当作 Next.js 的子模块进行打包。
80+
81+
---
82+
83+
## 目录结构(节选)
84+
85+
```
86+
website-next/
87+
├─ src/
88+
│ ├─ app/ # Next.js App Router 页面与路由
89+
│ │ ├─ docs/ # 文档(MDX)与文档页
90+
│ │ ├─ playground/ # 教学与 Playground 页面
91+
│ │ ├─ api/ # API 文档/说明页
92+
│ │ └─ ...
93+
│ ├─ components/ # 站点通用组件(含 HomePage、UI 组件等)
94+
│ └─ lib/ # 工具、hooks、性能与 utils
95+
├─ public/ # 静态资源(含 Pagefind 索引输出 _pagefind)
96+
├─ openInula/ # 独立 Vite 应用(用于 REPL/Playground 示例)
97+
├─ package.json
98+
└─ README.md
99+
```
100+
101+
---
102+
103+
## 常用脚本
104+
105+
根目录 `package.json`
106+
107+
```json
108+
{
109+
"scripts": {
110+
"dev": "next dev",
111+
"build": "next build",
112+
"start": "next start",
113+
"lint": "next lint",
114+
"postbuild": "pagefind --site .next/server/app --output-path public/_pagefind"
115+
}
116+
}
117+
```
118+
119+
- **dev**: 启动 Next.js 开发服务器
120+
- **build**: 生产构建(会为 App Router 产出 `.next`
121+
- **start**: 启动生产服务
122+
- **lint**: 运行 ESLint 检查
123+
- **postbuild**: 构建后生成 Pagefind 搜索索引
124+
125+
`openInula/package.json`(子项目):
126+
127+
```json
128+
{
129+
"scripts": {
130+
"dev": "vite",
131+
"build": "vite build",
132+
"preview": "vite preview"
133+
}
134+
}
135+
```
136+
137+
---
138+
139+
## FAQ / 故障排查
140+
141+
- **Pagefind 索引未生成或搜索无结果**
142+
- 确认构建成功后已执行 `postbuild`。也可手动运行:
143+
```bash
144+
pnpm build && pnpm exec pagefind --site .next/server/app --output-path public/_pagefind
145+
```
146+
- **本地开发页面加载缓慢或样式异常**
147+
- 删除 `.next/``node_modules/` 重新安装依赖;检查 `tailwindcss` 版本与 PostCSS 配置是否匹配。
148+
- **Playground 示例不工作**
149+
- `openInula/` 子项目需单独 `pnpm install``pnpm dev`;确保依赖 `openinula``inula-router` 正常安装。
150+
151+
---
152+
153+
## 贡献
154+
155+
欢迎任何形式的贡献!
156+
157+
1. Fork 本仓库并克隆到本地
158+
2. 从 `main` 切出特性分支进行开发
159+
3. 发起 MR 并补充说明变更点与动机
160+
161+
详细流程与行为准则请参阅:
162+
163+
- `src/app/docs/conventional/ContributingGuide/page.mdx`
164+
- `src/app/docs/conventional/CodeOfConduct/page.mdx`
165+
166+
---
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/app/globals.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { dirname } from "path";
2+
import { fileURLToPath } from "url";
3+
import { FlatCompat } from "@eslint/eslintrc";
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
});
11+
12+
const eslintConfig = [
13+
...compat.extends("next/core-web-vitals", "next/typescript"),
14+
];
15+
16+
export default eslintConfig;

0 commit comments

Comments
 (0)