From 20d1f1aa69393e790f2832b9dd3e52a340ef9f86 Mon Sep 17 00:00:00 2001 From: Dom <3301714+domjtalbot@users.noreply.github.com> Date: Wed, 21 Dec 2022 11:41:32 +0000 Subject: [PATCH] fix(nx-mesh): remove additional preset option --- .changeset/empty-ads-sneeze.md | 5 +++++ libs/nx-mesh/src/generators/preset/preset.spec.ts | 3 +-- libs/nx-mesh/src/generators/preset/preset.ts | 4 +--- libs/nx-mesh/src/generators/preset/schema.d.ts | 4 +--- libs/nx-mesh/src/generators/preset/schema.json | 7 +------ 5 files changed, 9 insertions(+), 14 deletions(-) create mode 100644 .changeset/empty-ads-sneeze.md diff --git a/.changeset/empty-ads-sneeze.md b/.changeset/empty-ads-sneeze.md new file mode 100644 index 00000000..fbe49e2b --- /dev/null +++ b/.changeset/empty-ads-sneeze.md @@ -0,0 +1,5 @@ +--- +'nx-mesh': patch +--- + +Remove additional preset option diff --git a/libs/nx-mesh/src/generators/preset/preset.spec.ts b/libs/nx-mesh/src/generators/preset/preset.spec.ts index 50a48b53..1b60ddd7 100644 --- a/libs/nx-mesh/src/generators/preset/preset.spec.ts +++ b/libs/nx-mesh/src/generators/preset/preset.spec.ts @@ -22,8 +22,7 @@ describe('generators/preset', () => { it('should create a workspace with the graphql-mesh sdk preset', async () => { await presetGenerator(tree, { - name: 'myorg', - sdkName: 'hello-world', + name: 'hello-world', compiler: 'tsc', }); diff --git a/libs/nx-mesh/src/generators/preset/preset.ts b/libs/nx-mesh/src/generators/preset/preset.ts index 7a11fd86..fdd3eba9 100644 --- a/libs/nx-mesh/src/generators/preset/preset.ts +++ b/libs/nx-mesh/src/generators/preset/preset.ts @@ -10,9 +10,7 @@ export async function presetGenerator( tree: Tree, options: PresetGeneratorSchema ) { - const { sdkName, ...config } = options; - - return await sdkGenerator(tree, { ...config, name: sdkName }); + return await sdkGenerator(tree, options); } export const presetSchematic = convertNxGenerator(presetGenerator); diff --git a/libs/nx-mesh/src/generators/preset/schema.d.ts b/libs/nx-mesh/src/generators/preset/schema.d.ts index a26085d0..3c5f7556 100644 --- a/libs/nx-mesh/src/generators/preset/schema.d.ts +++ b/libs/nx-mesh/src/generators/preset/schema.d.ts @@ -1,5 +1,3 @@ import type { SdkGeneratorSchema } from '../sdk/schema'; -export interface PresetGeneratorSchema extends SdkGeneratorSchema { - sdkName: string; -} +export type PresetGeneratorSchema = SdkGeneratorSchema; diff --git a/libs/nx-mesh/src/generators/preset/schema.json b/libs/nx-mesh/src/generators/preset/schema.json index 5506a829..40161cf1 100644 --- a/libs/nx-mesh/src/generators/preset/schema.json +++ b/libs/nx-mesh/src/generators/preset/schema.json @@ -14,11 +14,6 @@ }, "x-prompt": "What name would you like to use?" }, - "sdkName": { - "type": "string", - "description": "What would you like to name the SDK?", - "x-prompt": "What would you like to name the SDK?" - }, "directory": { "description": "The directory of the new sdk.", "type": "string", @@ -156,5 +151,5 @@ "default": false } }, - "required": ["name", "sdkName"] + "required": ["name"] }