forked from tangly1024/NotionNext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tangly1024#2943 from dongzhenye/feat/version-manag…
…ement refactor: improve version number management
- Loading branch information
Showing
6 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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,34 @@ | ||
## 已知问题 | ||
|
||
1. (示例)版本号管理不规范 | ||
- 版本号直接写在环境变量中,容易出错 | ||
- 多处维护版本号,可能不一致 | ||
|
||
## 解决方案 | ||
|
||
1. (示例)将版本号管理从 `.env.local` 迁移到 `package.json` | ||
- 统一从 `package.json` 读取版本号 | ||
- 使用 IIFE 优雅处理版本号获取逻辑 | ||
- 保持向后兼容,支持环境变量覆盖 | ||
|
||
## 改动收益 | ||
|
||
1. (示例)更规范的版本管理 | ||
- 统一从 `package.json` 读取 | ||
- 保持与 npm 生态一致 | ||
- 减少人为错误 | ||
|
||
## 具体改动 | ||
|
||
1. (示例)`blog.config.js` | ||
- 移除原有的静态版本号配置 | ||
- 在文件末尾添加动态版本号获取逻辑 | ||
- 保持向后兼容,优先使用环境变量 | ||
- 添加错误处理和默认值 | ||
|
||
## 测试确认 | ||
|
||
- [x] 本地开发环境测试通过 | ||
- [x] 生产环境构建测试通过 | ||
- [x] 版本号正确显示 | ||
- [x] 环境变量配置正常工作 |
This file contains 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 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 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 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