Repository navigation
[migrate] upgrade to Bootstrap 6 ecosystem & Serwist PWA plugin #46
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
31f5f23
[migrate] Upgrade to Bootstrap 6 and Sentry 11
TechQuery 8f59cd8
[chore] Include remaining workspace changes
TechQuery b7cb3d3
refactor: remove unused styles and add project coding guidelines
TechQuery c5d9f92
chore: update next.js version and patch, modify manifest description,…
TechQuery d132109
[fix] Idea React CSS importing
TechQuery 401c6fb
migrate: Upgrade Node.js to 26 and adjust package.json install script…
TechQuery ac18727
chore: Upgrade actions/checkout to v7 and replace custom Vercel deplo…
TechQuery 4d868c1
chore: 增加多个依赖包到 transpilePackages 列表中
TechQuery ec0900b
Refactor code structure for improved readability and maintainability
TechQuery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # 项目编程规范 | ||
|
|
||
| ## 理解需求 | ||
|
|
||
| - 实现前先阅读 Issue 及其示例。遵循指定的 API、数据模型和导出类型;先核实已安装依赖的实际接口,必要时升级依赖,不要擅自替换成无关 API。 | ||
| - 在整个仓库中搜索相关用法,并一致地落实适用改动。保留现有行为、功能和源码链接;删除空文件、未使用代码、调试输出,以及没有实际效果的配置改动。 | ||
|
|
||
| ## 数据与错误处理 | ||
|
|
||
| - 将可复用的数据发现、排序和分页逻辑放入共享工具函数。保持工具通用,不要把特定内容目录或页面硬编码进去。 | ||
| - 构建时页面应使用框架提供的静态生成 API。缺少必需内容、生成路径无效及其他构建错误都应明确暴露;仅在应用可以恢复时捕获错误,避免静默回退或空的 `catch` 块。 | ||
| - 使用类型安全检查和可选链明确处理可选数据。只有在缺失数据属于预期情况时,才显示有意义的占位内容。 | ||
|
|
||
| ## React、TypeScript 与内容 | ||
|
|
||
| - 使用依赖实际导出的类型和 API。为组件声明明确的属性类型,对象属性应使用解构;不要重复导出依赖本身的类型。 | ||
| - 保持组件职责清晰且可复用:将重复 UI 提取为符合领域职责的组件,由父组件决定布局;渲染 MobX 可观察状态的组件应使用 `@observer` 装饰器。 | ||
| - 列表项应使用稳定且唯一的业务标识作为 `key`;对于可能变化或重排的集合,不要使用数组索引。 | ||
| - 使用语义化且易访问的 HTML:集合使用列表,名称与对应值使用描述列表,日期使用带 `dateTime` 属性的 `<time>`。 | ||
| - 所有面向用户的文本都必须接入 i18n,并为全部受支持语言添加对应翻译:`en-US`、`zh-CN` 和 `zh-TW`。 | ||
|
|
||
| ## 样式与依赖 | ||
|
|
||
| - 优先复用现有 Idea-React 组件、Bootstrap 工具类、响应式断点、共享样式和项目资源,避免重复实现或编写不必要的自定义 CSS。页面专用样式应保持局部,全局样式只用于真正全局的规则。 | ||
| - 修改全局样式或主题变量时,检查所有受影响的用法,避免重复规则,并确保框架组件变体及链接文字对比度正常。优先复用已有 Markdown 样式,不要重新实现。 | ||
| - 添加或替换共享工具前,优先选择成熟的项目依赖,并核实其维护成熟度、导出 API 和运行时行为。避免重复依赖或重复引入已由全局提供的资源。 | ||
| - 项目命令应兼容 NPM,开发时优先使用 PNPM。不要提交 `package-lock.json`、`yarn.lock`;项目锁文件为 `pnpm-lock.yaml`。 | ||
|
|
||
| ## 可靠性与隐私 | ||
|
|
||
| - 合并前清理临时 `console` 调试输出。不要用看似成功的回退逻辑掩盖失败。 | ||
| - 如果遥测或会话回放会采集 URL,必须在所有采集入口(包括回放数据)中一并脱敏敏感查询参数。 | ||
|
|
||
| ## 验证 | ||
|
|
||
| - 改动后运行相关检查:使用 `npm test` 执行 lint 和 TypeScript 校验;涉及应用行为、静态生成或生产打包时,运行 `pnpm build`。 | ||
| - 修改 UI 或全局样式后,检查实际渲染结果,包括共享组件变体和响应式布局。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do not copy local credentials into the runtime image.
If a developer builds with a secret-bearing
.env.local, the supplied.dockerignoreallows that file into the build stage. This wildcard then copies the file into the final image. Anyone who receives the image can read the credentials.Next 16.4.6 selects only
.envand.env.productionwhen copying loaded environment files into standalone output. This line broadens that selection to local files. Remove the wildcard copy and supply private runtime values through the deployment environment. Keep only explicitly non-secret defaults in the image. (raw.githubusercontent.com)