dsh-brain/docs/development.md

24 lines
981 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 开发与发布
> 本地构建、类型检查、打包发布与发布前闸门。
---
## 开发与发布
```powershell
pnpm install # 首次
pnpm run build # tsc -p tsconfig.build.json → lib/
pnpm run typecheck
node scripts/release-prep.mjs --dry-run # 先看会改什么
node scripts/release-prep.mjs # 原地整备:脱敏 + 元数据 + LICENSE(幂等)
node scripts/pack-guard.mjs # 白名单与脱敏闸门,不通过直接 exit 1
pnpm publish --access public --no-git-checks
```
`prepack` 会先重建 `lib/`,`prepublishOnly` 会先跑 `pack-guard`:包里一旦出现 `AGENTS.md`、`TODO.md`、`*.mjs` 探测脚本、`tsconfig*.json`、本机路径、个人域名或令牌原文,发布立刻中止。
> lifecycle 脚本要求 `node` 在 `PATH` 里。若报 `'node' is not recognized`,先把 DSH 运行时自带 node 的 `bin` 目录加进 `$env:Path` 再发布。