@dts-cn/three
v0.185.0
Published
three.js 类型定义的中文注释版(翻译自 DefinitelyTyped 的 @types/three)
Maintainers
Readme
@dts-cn/three
three.js 类型定义的中文注释版,翻译自 DefinitelyTyped 的 @types/three。只改注释、不改类型结构,与英文版结构同构。
使用方式
npm alias 顶替官方类型包,VSCode 零配置生效:
pnpm add -D "@types/three@npm:@dts-cn/three"翻译规范与同步
- 规范与术语表:
GLOSSARY.md(翻译前必读) - 上游同步点:
UPSTREAM(记录本包翻译基线对应的上游 commit) - 上游变更链:
three-types/three-ts-types→ DefinitelyTypedtypes/three→ 本包
同步流程见 dts-cn/README.md。
发布流程
前置(仅首次):在 npmjs.com 创建名为 dts-cn 的免费组织,本地 npm login。
cd dts-cn/three
# devDependencies 的 three: link:. 是本地回归自链接,npm publish 拒绝 link: 协议,
# 且消费方不安装 devDependencies,发布前临时移除、发布后恢复
npm pkg delete devDependencies
npm publish --access public # scoped 包首发必须 --access public
git checkout package.json # 恢复 link:. 自链接
pnpm install --filter @dts-cn/three # 恢复 node_modules/three 符号链接版本规则:对齐 @types/three 的 major.minor(= three 库版本),patch 自增,如 0.185.0、0.185.1。
发布前检查:
# 全量回归
node_modules/.bin/tsc --noEmit -p dts-cn/three/tsconfig.json
# 打包预演(约 413KB,仅含 .d.ts/.d.cts,tests 由 .npmignore 排除)
cd dts-cn/three && npm pack --dry-run