feat(core): support providing schema in sync generators
Summary
Align sync generator invocation with regular generators by providing schema-based options from nx.json and project configuration.
Current Behavior
Currently, sync generators are invoked with only a Tree parameter and do not receive any configuration options from the generator's schema, nx.json, or project configuration:
// Before
export type SyncGenerator = (tree: Tree) => SyncGeneratorResult;
This means sync generators cannot:
- Access generator-specific options defined in their schema
- Use options configured in nx.json via generators configuration
- Use project-level generator defaults
- Apply schema defaults and validations
Expected Behavior
Sync generators should receive combined options from their schema, just like regular generators do, but without command-line arguments (since they're not invoked directly by users).
// After
export type SyncGenerator<T = unknown> = (
tree: Tree,
schema: T
) => SyncGeneratorResult | Promise<SyncGeneratorResult>;
Related Discussion
Related to https://github.com/nrwl/nx/discussions/32663
Deploy request for nx-docs pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | 959f1ca62f1be25c29f73e6f9b654cb669baac6f |
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Updated (UTC) |
|---|---|---|---|
| nx-dev | Preview | Nov 13, 2025 4:04pm |
View your CI Pipeline Execution β for commit 89bb354adb41c326a6df791e48bef51eb10acd29
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=lint,test,test-kt,build,e... |
β Failed | 1h 40m 13s | View β |
nx run-many -t check-imports check-commit check... |
β Succeeded | 2m 6s | View β |
nx-cloud record -- nx-cloud conformance:check |
β Succeeded | 2s | View β |
nx-cloud record -- nx format:check |
β Succeeded | 5s | View β |
nx-cloud record -- nx sync:check |
β Succeeded | 4s | View β |
nx documentation |
β Succeeded | 2m 54s | View β |
βοΈ Nx Cloud last updated this comment at 2025-10-13 22:30:15 UTC
π interested
Hey @AgentEnder @FrozenPandaz, any chance we can move forward on this? It would be great to have it ready for 22.1 if possible.
In the Nx documentation I just discovering:
This is only used by the typescript-sync generator which is reading NxConf directly:
https://github.com/nrwl/nx/blob/081bec53cf23beab0bae332bd589d24a4745f638/packages/js/src/generators/typescript-sync/typescript-sync.ts#L201
Should we expect sync generators to read and apply options manually without any schemas?
Iβm confused why this appears in the docs as a general way to configure sync generatorsβ¦
Hi folks! Anything we can do to move this forward? I'm happy to contribute with anything π
π
Scott reacted via Gmail https://www.google.com/gmail/about/?utm_source=gmail-in-product&utm_medium=et&utm_campaign=emojireactionemail#app
On Tue, 9 Dec 2025, 7:48β―pm Scott mcgowan, @.***> wrote:
On Tue, 9 Dec 2025, 5:54β―pm Miguel, @.***> wrote:
mpsanchis left a comment (nrwl/nx#33060) https://github.com/nrwl/nx/pull/33060#issuecomment-3630855117
Hi folks! Anything we can do to move this forward? I'm happy to contribute with anything π
β Reply to this email directly, view it on GitHub https://github.com/nrwl/nx/pull/33060#issuecomment-3630855117, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3H3VBPESWYDB53ZP6IQFVT4AZ5ZTAVCNFSM6AAAAACJBUTVGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMZQHA2TKMJRG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>