diff --git a/docs/generated/packages/nest/generators/guard.json b/docs/generated/packages/nest/generators/guard.json index 20921b3958443..689e354e2c156 100644 --- a/docs/generated/packages/nest/generators/guard.json +++ b/docs/generated/packages/nest/generators/guard.json @@ -39,7 +39,7 @@ } }, "additionalProperties": false, - "required": ["name"], + "required": ["path"], "presets": [] }, "description": "Run the `guard` NestJS generator with Nx project support.", diff --git a/docs/generated/packages/nest/generators/interceptor.json b/docs/generated/packages/nest/generators/interceptor.json index 8f25cf08a5b84..f456859882db1 100644 --- a/docs/generated/packages/nest/generators/interceptor.json +++ b/docs/generated/packages/nest/generators/interceptor.json @@ -39,7 +39,7 @@ } }, "additionalProperties": false, - "required": ["name"], + "required": ["path"], "presets": [] }, "description": "Run the `interceptor` NestJS generator with Nx project support.", diff --git a/packages/nest/src/generators/guard/schema.json b/packages/nest/src/generators/guard/schema.json index 32217e7496149..4a1ef99e4356d 100644 --- a/packages/nest/src/generators/guard/schema.json +++ b/packages/nest/src/generators/guard/schema.json @@ -39,5 +39,5 @@ } }, "additionalProperties": false, - "required": ["name"] + "required": ["path"] } diff --git a/packages/nest/src/generators/interceptor/schema.json b/packages/nest/src/generators/interceptor/schema.json index 91fa7edc33eea..20a16606a3d81 100644 --- a/packages/nest/src/generators/interceptor/schema.json +++ b/packages/nest/src/generators/interceptor/schema.json @@ -39,5 +39,5 @@ } }, "additionalProperties": false, - "required": ["name"] + "required": ["path"] } diff --git a/packages/nest/src/generators/utils/normalize-options.ts b/packages/nest/src/generators/utils/normalize-options.ts index 50bba69f812c8..a17980124001d 100644 --- a/packages/nest/src/generators/utils/normalize-options.ts +++ b/packages/nest/src/generators/utils/normalize-options.ts @@ -10,16 +10,18 @@ export async function normalizeOptions( tree: Tree, options: NestGeneratorOptions ): Promise { - const { directory, fileName } = + const { directory, artifactName } = await determineArtifactNameAndDirectoryOptions(tree, { name: options.name, path: options.path, }); + options.path = undefined; // Now that we have `directory` we don't need `path` + return { ...options, flat: true, - name: fileName, + name: artifactName, skipFormat: options.skipFormat, sourceRoot: directory, };