chore: 移除 LeetCode 笔记并加入站点验证与 Agent 工作流规则
- 从 collections、导航移除 LeetCode,删除 docs/notes/programming/leetcode 下页面 - devDependencies 显式加入 @vuepress/helper@rc.123,配合 overrides 降低 Vite 预构建白屏风险 - 新增 npm run docs:verify 与 scripts/verify-site.mjs(构建后检查首页 hero) - .cursor/rules/agent-workflow-verify-and-git.mdc:每次修改须验证;用户未明确说不要提交时默认 commit Made-with: Cursor
This commit is contained in:
27
scripts/verify-site.mjs
Normal file
27
scripts/verify-site.mjs
Normal file
@@ -0,0 +1,27 @@
|
||||
import { readFileSync, existsSync } from 'node:fs'
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { dirname, join } from 'node:path'
|
||||
|
||||
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const indexHtml = join(root, 'docs', '.vuepress', 'dist', 'index.html')
|
||||
|
||||
const build = spawnSync('npm', ['run', 'docs:build'], {
|
||||
cwd: root,
|
||||
shell: true,
|
||||
stdio: 'inherit',
|
||||
})
|
||||
if (build.status !== 0) process.exit(build.status ?? 1)
|
||||
|
||||
if (!existsSync(indexHtml)) {
|
||||
console.error('verify-site: dist/index.html missing after build')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const html = readFileSync(indexHtml, 'utf8')
|
||||
if (!html.includes('hero-name') || !html.includes('仲夏夜之梦')) {
|
||||
console.error('verify-site: home hero markers missing in dist/index.html (possible theme/render failure)')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log('verify-site: OK (home hero present in production build)')
|
||||
Reference in New Issue
Block a user