Skip to content

repo: record the hexo version in package.json - #17

Merged
cadywang merged 1 commit into
mainfrom
build/hexo-version-field
Oct 23, 2026
Merged

cadywang merged 1 commit into
mainfrom
build/hexo-version-field

Conversation

@cadywang

Copy link
Copy Markdown
Owner

变更内容

hexo 8.1.2 的升级改了 dependencies.hexo 的范围,但 package.json 里的 "hexo": { "version": ... }
字段仍是 7.3.0。Hexo 每次运行都会把这个字段重写成实际在跑的版本,于是跑一次 hexo generate
工作区就多出一处 package.json 修改——实测就是这个问题,跟本次改动完全无关的脏文件。

现在把字段改成 8.1.2,跑完构建工作区保持干净。

变更类型

  • 站点、主题或配置调整
  • 依赖或工作流调整

测试

提交后 npx hexo generate  : 58 files generated, rc=0
git status                : 0 个改动(修复前会多出 package.json)
npm run check:posts       : 6 篇文章,错误 0 个
commit 规范门禁            : 1/1

发布审查清单

  • 文章改动(如有):标题、日期、标签、分类已填写完整
  • 文章改动(如有):正文已通读,无错别字、未写完的段落或占位内容
  • 文章改动(如有):图片等本地资源已随文章提交,路径可访问
  • 不含密钥、口令、内网地址等敏感信息
  • 已在本地执行 npm run build 且构建通过
  • commit 遵循内核规范且带 Signed-off-by:(git commit -s)
  • PR 标题遵循内核规范 <subsystem>: <祈使句摘要>
  • 改动校验脚本 / 工作流时,对应的自测已更新并通过

审查人重点看什么

hexo.version 是否与 dependencies.hexo 一致(现在都是 8.1.2)。

关联 Issue

无独立 Issue。来自修复 hexo-generator-feed PR #15 时发现的脏工作区。

The hexo 8.1.2 bump updated the dependency range but left the
"hexo": { "version": ... } field at 7.3.0. Hexo rewrites that field with
the version it is actually running, so every "hexo generate" leaves the
working tree dirty -- the next person to run the site sees an unrelated
modification in git status.

Set it to 8.1.2 so the file matches the installed CLI.

Signed-off-by: cadywang <109458837+cadywang@users.noreply.github.com>
@cadywang
cadywang force-pushed the build/hexo-version-field branch from 9ca451d to ae8271f Compare October 23, 2026 04:41
@cadywang
cadywang merged commit 8c9ff01 into main Oct 23, 2026
4 checks passed
@cadywang
cadywang deleted the build/hexo-version-field branch October 23, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant