-
Notifications
You must be signed in to change notification settings - Fork 95
Add script to generate JSON data for rendering the homepage. #1052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other comments (8)
- static/json/baidu_tongji_data.json (12-14) There's an inconsistency in the date ranges. The `fetch_time` is 2025-11-07, `date_range` shows 20251027-20251102 (Oct 27 - Nov 2), but `timeSpan` shows 2025/11/06 - 2025/11/07. These date ranges should be aligned to ensure data consistency.
-
.github/scripts/baidu-tongji.js (290-292)
In the `main()` function, errors are caught but not logged before calling `process.exit(1)`. This makes it difficult to diagnose issues when they occur. Consider logging the error message before exiting:
} catch (error) { console.error('执行过程中出错:', error.message); process.exit(1); } -
.github/scripts/latest-updates.js (110-113)
The error handling in the catch block silently ignores errors without logging them. Consider adding error logging to help with debugging:
} catch (e) { // 忽略单条失败,继续 console.warn(`Failed to process commit ${item.sha}: ${e.message}`); continue; - .github/workflows/deploy.yaml (178-178) The `yarn install` command has been moved to a separate step but wasn't removed from the Build step. This could lead to duplicate installation operations. Consider removing the redundant command.
- static/json/baidu_tongji_data.json (24-24) There are several empty arrays in the data structure (in `sum`, `pageSum`, and at the end of `items`) that don't appear to serve any purpose. Consider removing these empty arrays to make the JSON more concise and easier to maintain.
- static/json/commit_update_data.json (8-8) I noticed that all commit entries have empty URL fields (`"url": ""`). This will prevent users from being able to click through to view the actual commits when this data is rendered on the homepage. Consider populating these URLs with links to the actual GitHub commits using the SHA values.
- .github/workflows/deploy.yaml (180-180) The PR is downgrading from `actions/upload-pages-artifact@v4` to `v3`. Unless there's a specific compatibility issue with v4, it's generally recommended to use the latest version of GitHub Actions to benefit from bug fixes and improvements.
- static/json/baidu_tongji_data.json (262-262) The file is missing a newline at the end. It's a common best practice to end text files with a newline character.
💡 To request another review, post a new comment with "/windsurf-review".
RadxaYuntian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
提交历史看看能不能整理一下吧
整理了一下提交记录 |
RadxaYuntian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以后merge commit不要留在提交历史里面
OK |
添加脚本生成 JSON 数据,用于渲染首页