Skip to content

🚚 chore: migrate project toolchain to Vite+#79

Merged
SigureMo merged 5 commits into
PFCCLab:mainfrom
ShigureNyako:chore/migrate-to-vp
Apr 12, 2026
Merged

🚚 chore: migrate project toolchain to Vite+#79
SigureMo merged 5 commits into
PFCCLab:mainfrom
ShigureNyako:chore/migrate-to-vp

Conversation

@ShigureNyako
Copy link
Copy Markdown
Contributor

背景

按要求将仓库做一次最小但完整的 vp / Vite+ 迁移,保留现有 GitHub Action 的 dist/index.js 产物约定。

主要改动

  • 新增 vite.config.ts,集中管理:
    • fmt
    • lint
    • test
    • pack
  • 将测试导入从 vitest 迁移到 vite-plus/test
  • 将打包流程从 rolldown 脚本迁移到 vp pack
  • 将格式化/检查/测试脚本迁移到 vp fmt / vp check / vp test
  • 删除旧的 Prettier / Rolldown 配置文件
  • 更新 CI,改为使用 voidzero-dev/setup-vp@v1
  • 更新 README 中的开发命令说明
  • 顺手清理了 vp check 下暴露出的少量 lint / type / logging 问题,保证迁移后检查通过
  • 重新生成 dist/index.js

验证

已在本地验证:

pnpm install --frozen-lockfile
pnpm exec vp check
pnpm exec vp test
pnpm exec vp pack

其中:

  • vp check 通过
  • vp test 通过(31 tests)
  • vp pack 生成单文件 dist/index.js

风险说明

  • dist/index.js 的打包器从 Rolldown CLI 切换为 Vite+ 内置的 vp pack(底层为 tsdown),产物体积有小幅变化,但已保持为可供 action.yml 直接使用的单文件输出
  • README / Renovate 配置经过 Oxfmt 重排,属于迁移到 Vite+ 后的格式化差异

@SigureMo 麻烦有空帮忙看一下喵。

Comment thread README.md Outdated
Comment thread src/rules/approve.ts Outdated
Comment thread .github/workflows/check-dist.yml Outdated
Comment thread .github/workflows/update-dist.yml Outdated
@ShigureNyako
Copy link
Copy Markdown
Contributor Author

已按 review 改完并推了新提交 9868180,这次主要调整了 4 点:

  • README 的选项表格恢复 <!-- prettier-ignore -->
  • review / comment 日志改成直接打印必要字段,不再额外 JSON.stringify
  • setup-vp 改回读取 .node-version,并补了 run-install: false
  • update-dist 不再在 PR 上触发,PR 里手动更新 dist

本地重新验证过:

pnpm exec vp check
pnpm exec vp test
pnpm exec vp pack

都通过了,辛苦再看下喵 @SigureMo

Comment thread .github/workflows/update-dist.yml Outdated
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
ref: ${{ github.head_ref || github.ref_name }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改这里的原因是?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???为什么不改???

Comment on lines -4 to -6
pull_request:
branches:
- main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么删?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?加回来了吗?

Comment thread src/rules/approve.ts Outdated
Comment thread src/rules/comment.ts Outdated
Comment thread src/rules/comment.ts Outdated
@ShigureNyako
Copy link
Copy Markdown
Contributor Author

补了一个很小的 follow-up 提交 182e65b

  • approve.ts / comment.ts 的 warning payload 改成直接 JSON.stringify(...)
  • 已同步重新生成 dist/index.js

本地重新跑过:

pnpm exec vp check
pnpm exec vp test
pnpm exec vp pack

都通过了。

Copy link
Copy Markdown
Contributor

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

怎么不听话呢?

Comment on lines -4 to -6
pull_request:
branches:
- main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?加回来了吗?

Comment thread .github/workflows/update-dist.yml Outdated
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
ref: ${{ github.head_ref || github.ref_name }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???为什么不改???

@ShigureNyako
Copy link
Copy Markdown
Contributor Author

收到,刚才那两处我理解偏了,已经按你的意思直接改回并推了 0199625

@SigureMo SigureMo added this pull request to the merge queue Apr 12, 2026
Merged via the queue into PFCCLab:main with commit 279d07e Apr 12, 2026
10 of 11 checks passed
@ShigureNyako ShigureNyako deleted the chore/migrate-to-vp branch April 12, 2026 21:11
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.

2 participants