ff-nest
v0.1.1
Published
Project-local CLI for watching protocol files and generating NestJS stubs.
Readme
ff-nest
Project-local CLI for watching protocol files and generating NestJS stubs.
Usage
ff-nest watch --project backend
# or one-shot
ff-nest watch --project backend --once
# split generated admin routes into per-directory modules
ff-nest watch --project backend --once --admin-module-per-dirPrevent overwrites
- 默认策略:如果目标文件已存在(controller/service/dto),ff-nest 不会覆盖。
- 仅在文件不存在时创建模板文件。
ff-nest no-update仍可用于禁止模块文件(module/app module)被更新(如果你在这些文件里也做了大量手写改动)。
Config
When you run ff-nest watch / ff-nest migrate, if ff.config.json is missing, ff-nest will create it in the current working directory.
ff.config.json supports comments (JSONC style: // and /* */) so it can contain Chinese explanations.
Example ff.config.json:
{
// 配置版本(内部使用;一般不需要改)
"$schemaVersion": 1,
// 后端项目目录(相对当前执行命令的目录,或写绝对路径)
"projectDir": "backend",
"watch": {
// 协议文件目录(相对 backendDir)
"protocolsDir": "src/shared/protocols",
// Sequelize Model 文件目录(相对 backendDir)
"modelsDir": "src/db/models",
// 是否生成 model-augmentations.d.ts
"generateModelAugmentations": true,
// 是否在新建空模型文件时写入模板
"initNewModelFile": true,
// 是否按目录拆分 admin 模块
"adminModulePerDir": true
},
"migrate": {
// 协议文件目录(相对 backendDir)
"protocolsDir": "src/shared/protocols"
}
}