Skip to content
This repository was archived by the owner on Jul 3, 2026. It is now read-only.

Commit 63c50c7

Browse files
UE-DNDuednd
authored andcommitted
1.4.0
【修复】 - TS 静态错误 - 过时的构建命令 - 潜在的代码问题 【优化】 - 完善接口注释 - 搜索高亮性能 - 虚拟列表性能 - 移除部分死代码 - 文档/注释语法错误 - 文本类型文件预览性能 - 文本类型文件预览响应式设计 - README 中弃用的 HTML 特性 - Markdown 相对链接跳转稳定性
1 parent 1bfe764 commit 63c50c7

141 files changed

Lines changed: 1958 additions & 3899 deletions

File tree

Some content is hidden

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

.env.backup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SITE_TITLE=Repo-Viewer
22
SITE_DESCRIPTION=基于MD3设计语言的GitHub仓库浏览应用
33
SITE_KEYWORDS= GitHub, 仓库, 浏览器, 代码, 查看器
4-
GITHUB_REPO_OWNER=UE-DND
4+
GITHUB_REPO_OWNER=CQUT-OpenProject
55
GITHUB_REPO_NAME=Repo-Viewer
66
GITHUB_REPO_BRANCH=master
77

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SITE_DESCRIPTION = 基于MD3设计语言的GitHub仓库浏览应用
1111
SITE_KEYWORDS = GitHub, 仓库, 浏览器, 代码, 查看器
1212

1313
# GitHub仓库信息 - 配置要浏览的GitHub仓库
14-
GITHUB_REPO_OWNER = UE-DND
14+
GITHUB_REPO_OWNER = CQUT-OpenProject
1515
GITHUB_REPO_NAME = Repo-Viewer
1616
GITHUB_REPO_BRANCH = master
1717

CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- **克隆仓库**
1818

1919
```bash
20-
git clone https://github.com/UE-DND/Repo-Viewer.git
20+
git clone https://github.com/CQUT-OpenProject/Repo-Viewer.git
2121
cd Repo-Viewer
2222
```
2323

@@ -91,7 +91,7 @@ npm run lint
9191

9292
### 代码格式化
9393

94-
我们使用 `EditorConfig` 进行一致的格式化,请确保你的编辑器安装了相应插件以自动应用格式规则。
94+
我们使用 `EditorConfig` 进行统一格式化,请确保你的编辑器安装了相应插件以自动应用格式规则。
9595

9696
## 提交 issue
9797

@@ -104,7 +104,7 @@ npm run lint
104104

105105
### [enhancement]
106106

107-
- 清晰的增强描述,杜绝抽象概念
107+
- 清晰地描述增强点,杜绝抽象概念
108108
- 建议的实现逻辑
109109

110110
### [feature]
@@ -115,8 +115,6 @@ npm run lint
115115

116116
> 推荐保持与历史 issue 一致的标题格式
117117

118-
---
119-
120118
### 许可证
121119

122120
通过贡献,您同意您的贡献将按照与项目相同的许可证 [AGPL-3.0](LICENSE) 进行许可。

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
<h1 align="center">
2-
<em>Repo-Viewer</em>
3-
</h1>
4-
5-
<p align="center">
6-
<strong>基于 Material Design 3设计风格的 GitHub仓库浏览应用</strong>
7-
&nbsp;&nbsp;
8-
<a href="https://deepwiki.com/UE-DND/Repo-Viewer">
9-
<img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki">
10-
</a>
11-
</p>
1+
<div style="text-align: center;">
2+
<h1><em>Repo-Viewer</em></h1>
3+
</div>
4+
5+
<div style="text-align: center;">
6+
<p>
7+
<strong>基于 Material Design 3设计风格的 GitHub仓库浏览应用</strong>
8+
&nbsp;&nbsp;
9+
<a href="https://deepwiki.com/CQUT-OpenProject/Repo-Viewer">
10+
<img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki">
11+
</a>
12+
</p>
13+
</div>
1214

1315
![Preview Dark](docs/image/dark.png)
1416

@@ -20,9 +22,17 @@
2022
<tr>
2123
</table>
2224

25+
## 为 Repo Viewer 贡献代码
26+
27+
此项目已进入稳定阶段,本人将不再花过多精力维护。若发现已知的问题,欢迎任何形式的贡献!无论是修复错误、改进功能,还是提升代码质量,我们都非常欢迎您的参与。
28+
29+
> 此组织的所有成员均有管理员权限,若不想提交 Pull Request,直接推送代码是被允许的。
30+
>
31+
> 但在提交贡献前,推荐阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 以了解建议的代码规范和提交流程。
32+
2333
## 主要功能
2434

25-
- 📁 **仓库浏览**:直观的文件结构导航,同时提供首页文件和文件夹排除选项.
35+
- 📁 **仓库浏览**:直观的文件结构导航,同时提供首页文件与文件夹排除选项.
2636
- 🔎 **文件搜索**:支持基于自建索引和 Github API 的快速文件搜索,可按分支、路径前缀和扩展名过滤.
2737
- 📄 **文件预览**:多种文件格式预览,目前支持 `Markdown``PDF``图片`.
2838
- ⬇️ **文件下载**:可下载单个文件或整个文件夹.
@@ -76,8 +86,8 @@ Repo-Viewer 使用 docfind 生成静态索引并随站点发布。构建时运
7686

7787
## 贡献者
7888

79-
[![Contributors](https://contrib.rocks/image?repo=UE-DND/Repo-Viewer)](https://github.com/UE-DND/Repo-Viewer/graphs/contributors)
89+
[![Contributors](https://contrib.rocks/image?repo=CQUT-OpenProject/Repo-Viewer)](https://github.com/CQUT-OpenProject/Repo-Viewer/graphs/contributors)
8090

8191
## Stars
8292

83-
![Star History](https://api.star-history.com/svg?repos=UE-DND/Repo-Viewer&type=Date)
93+
![Star History](https://api.star-history.com/svg?repos=CQUT-OpenProject/Repo-Viewer&type=Date)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "repo-viewer",
33
"private": true,
4-
"version": "1.3.9",
4+
"version": "1.4.0",
55
"type": "module",
66
"engines": {
77
"node": "24.x"
@@ -10,7 +10,7 @@
1010
"dev": "vite",
1111
"build": "tsc -p scripts/tsconfig.json && node scripts/dist/generateInitialContent.js && node scripts/dist/generateDocfindIndex.js && tsc && vite build",
1212
"generate:index": "tsc -p scripts/tsconfig.json && node scripts/dist/generateDocfindIndex.js",
13-
"install-deps": "npm install --legacy-peer-deps",
13+
"install-deps": "npm install",
1414
"lint": "eslint . --ext ts,tsx",
1515
"preview": "vite preview"
1616
},

scripts/generateDocfindIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ const resolveBranchRef = async (repoPath: string, branch: string): Promise<strin
402402
await runCommandText("git", ["rev-parse", "--verify", candidate], repoPath);
403403
return candidate;
404404
} catch {
405-
continue;
405+
406406
}
407407
}
408408
return null;

scripts/generateInitialContent.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const fetchJson = async <T>(url: string): Promise<T> => {
7878
if (!response.ok) {
7979
throw new Error(`Request failed: ${response.status} ${response.statusText}`);
8080
}
81-
return response.json() as Promise<T>;
81+
return (await response.json()) as T;
8282
};
8383

8484
const fetchText = async (url: string): Promise<string> => {
@@ -139,7 +139,9 @@ const run = async (): Promise<void> => {
139139
const contents = await fetchJson<unknown>(contentsUrl);
140140

141141
if (!Array.isArray(contents)) {
142-
throw new Error("Unexpected contents response");
142+
console.warn("[hydration] Unexpected contents response, writing null payload.");
143+
await writeOutput(null);
144+
return;
143145
}
144146

145147
const contentItems = contents.filter(isRecord);
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
import type { InitialContentHydrationPayload } from "@/types";
2-
3-
export const initialContentPayload: InitialContentHydrationPayload | null = null;
1+
export {};

src/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const App = React.memo(() => {
8888
`GitHub Token状态: ${hasTokenFlag ? "已配置" : "未配置"}, Token数量: ${tokenCount.toString()}`,
8989
);
9090

91+
// 此日志仅供本地开发环境使用,部署至平台后无法检测环境变量
9192
if (!hasTokenFlag) {
9293
logger.warn(
9394
"未检测到GitHub Token,API搜索功能可能受限。请考虑配置Token以获取更好的搜索体验。",
@@ -181,7 +182,7 @@ const App = React.memo(() => {
181182
{SITE_TITLE}
182183
</Typography>
183184

184-
{/* 面包屑在顶部栏的容器 */}
185+
{/* 面包屑导航(顶部栏)的容器 */}
185186
<Collapse
186187
in={showBreadcrumbInToolbar}
187188
orientation="horizontal"
@@ -226,7 +227,7 @@ const App = React.memo(() => {
226227
);
227228
});
228229

229-
// 添加显示名称以便调试
230+
// DevTools 显示名称
230231
App.displayName = "App";
231232

232233
export default App;

0 commit comments

Comments
 (0)