Package: @tooling/zod2md-jsdocs
Generator: sync-zod2md-setup
nx generate @tooling/zod2md-jsdocs:sync-zod2md-setupThe sync generator automatically targets all projects that already contain a
zod2md.config.ts file.
For each matching project, the generator performs the following checks and fixes:
- Searches for the first existing
tsconfig.*.jsonfile (e.g.tsconfig.json,tsconfig.lib.json) - If found:
- Verifies that the Zod2Md TypeScript plugin options are configured
- Automatically patches the
tsconfigfile if options are missing or incorrect
- Verifies the presence of a Zod2Md docs target
- Verifies that the
buildtarget has the correctdependsOnconfiguration - If missing:
- Adds the Zod2Md target
- Updates
build.dependsOnaccordingly
Root/
├── libs/
│ └── project-name/
│ ├── zod2md.config.ts 🔎 triggers the sync generator
│ ├── project.json 👈 checks targets + build.dependsOn
│ ├── tsconfig.lib.json 👈 configures zod2md-jsdocs TS plugin
│ └── src/
│ └── index.ts
└── ...- ✔ No
zod2md.config.ts→ project is ignored - ✔ Missing TS plugin config → patched automatically
- ✔ Missing Zod2Md target → added automatically
- ✔ Missing
build.dependsOnentries → updated automatically - ✔ Fully configured project → no changes, no errors
You can still scope execution to a single project:
nx g @tooling/zod2md-jsdocs:sync-zod2md-setup project-nameTo preview what the generator would change without applying modifications:
nx g @tooling/zod2md-jsdocs:sync-zod2md-setup --dry-runThis is especially useful when integrating the sync generator into CI or workspace maintenance workflows.
Global sync generators are registered in the nx.json file like this:
nx.json
{
"sync": {
"globalGenerators": ["./tools/zod2md-jsdocs:sync-zod2md-setup"]
}
}Local sync generators are registered in the project's package.json or project.json file under the syncGenerators property for specific targets:
package.json
{
"name": "my-project",
"nx": {
"targets": {
"build": {
"syncGenerators": ["./tools/zod2md-jsdocs:sync-zod2md-setup"]
}
}
}
}project.json
{
"name": "my-project",
"targets": {
"build": {
"syncGenerators": ["./tools/zod2md-jsdocs:sync-zod2md-setup"]
}
}
}With this configuration, the sync generator will run automatically before the specified target (e.g., build).
- This is a sync generator, not a build step
- It is safe to run repeatedly
- All changes are deterministic and idempotent
- Designed to work seamlessly with
nx syncand automated workflows