Skip to content

feat: migrate toolchain to Vite+ - #2

Open
fengmk2 wants to merge 3 commits into
mainfrom
migrate-to-vite-plus
Open

feat: migrate toolchain to Vite+#2
fengmk2 wants to merge 3 commits into
mainfrom
migrate-to-vite-plus

Conversation

@fengmk2

@fengmk2 fengmk2 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Migrates the monorepo from split tooling (Vite 7, Vitest, Oxlint, Oxfmt) to Vite+ 0.2.7 via vp migrate.

  • Bump apps/web to Vite 8.2.0, resolved through the new pnpm catalog to the Rolldown-powered @voidzero-dev/vite-plus-core build, Vitest pinned at 4.1.10
  • Consolidate .oxlintrc.json into the new root vite.config.ts, now the single config for lint/fmt/test
  • Rewrite vitest imports to vite-plus/test in 56 files, switch package scripts to vp lint / vp fmt / vp test run
  • Reformat 319 files with the bundled Oxfmt 0.62, which now also formats Markdown (most of the diff is openspec/ and wiki/ docs)
  • Replace husky with vp-managed hooks (.vite-hooks via vp config); the gitleaks fail-closed pre-commit and pre-push scans are preserved, and pre-commit also runs vp staged (vp check --fix on staged files)

Type-aware linting stays off in the root config for now: it reports 88 pre-existing findings (58 no-floating-promises, plus unbound-method, no-base-to-string, one real type error in scripts/migrate-mongo-to-pg.ts) and its suggested tsconfig rootDir fix would break the apps/api build, which compiles workspace packages via tsconfig paths. Planned as a follow-up.

Verified: vp check clean (750 files formatted, 268 lint-clean), 232 tests pass, all builds pass, typecheck clean, openspec validate --all --strict 62/62.

fengmk2 added 3 commits August 5, 2026 14:03
Replace split vite/vitest/oxlint/oxfmt tooling with vite-plus 0.2.7
via vp migrate.

- Bump apps/web to Vite 8.2.0, resolved through the new pnpm catalog
  to the Rolldown-powered @voidzero-dev/vite-plus-core build
- Consolidate .oxlintrc.json into the new root vite.config.ts
- Rewrite vitest imports to vite-plus/test in 56 files, switch package
  scripts to vp lint / vp fmt / vp test run
- Reformat 319 files with the bundled Oxfmt 0.62, which now also
  formats Markdown
- Keep husky + gitleaks pre-commit hooks; vp hook setup skipped
- Leave type-aware linting off in the root config: it reports 88
  pre-existing findings and its suggested rootDir fix would break the
  apps/api build, which compiles workspace packages via tsconfig paths
Install hooks via vp config (.vite-hooks dispatcher). The gitleaks
fail-closed scans move unchanged into .vite-hooks/pre-commit and
.vite-hooks/pre-push, and pre-commit additionally runs vp staged
(vp check --fix on staged files).
@fengmk2
fengmk2 marked this pull request as ready for review August 5, 2026 08:35
@fengmk2
fengmk2 requested a review from thonatos August 5, 2026 08:36

@thonatos thonatos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review: 工具链迁移本身合理,注意两点

实质改动:husky→.vite-hooksvp config 接管)、oxlint/oxfmt→vp lint/fmt、vitest→vp test、lint 配置并入 vite.config.ts、vite/vitest catalog + peerDependencyRules、pre-commit 保留 gitleaks 暂存扫描。方向正确。

注意

  1. 首个提交 migrate toolchain to Vite+ 顺带全仓 vp fmt(383 文件 / 1.3 万行,admin.ts 的 1189 行变更均为换行重排,含 wiki 与 .agents/skills 的 md)。格式化基线已固化进下游 #3#7 每个堆叠 PR,噪声与冲突面大,建议在 PR 描述中明确。
  2. prepare: vp config 会在 Docker 构建的 pnpm install 中执行,而镜像内无 .git。镜像构建工作流仅在 push main 时运行、尚未被此 PR 验证,合并前请确认 vp config 在无 git 环境能优雅跳过,避免构建失败。

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