From ee49b127cb269d3eaa84156f7e3e637fccfe597d Mon Sep 17 00:00:00 2001 From: Dom Talbot <3301714+domjtalbot@users.noreply.github.com> Date: Tue, 6 Dec 2022 17:31:28 +0000 Subject: [PATCH] fix(nx-mesh): `application` and `sdk` generators showing outdated example options (#96) --- .changeset/tame-cooks-greet.md | 5 +++++ .../src/generators/application/schema.json | 19 ++++++++++++++++--- libs/nx-mesh/src/generators/sdk/schema.json | 19 ++++++++++++++++--- 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 .changeset/tame-cooks-greet.md diff --git a/.changeset/tame-cooks-greet.md b/.changeset/tame-cooks-greet.md new file mode 100644 index 00000000..a7b65752 --- /dev/null +++ b/.changeset/tame-cooks-greet.md @@ -0,0 +1,5 @@ +--- +'nx-mesh': patch +--- + +Fix `application` & `sdk` generators showing outdated examples diff --git a/libs/nx-mesh/src/generators/application/schema.json b/libs/nx-mesh/src/generators/application/schema.json index 73ddcecf..0ff21efb 100644 --- a/libs/nx-mesh/src/generators/application/schema.json +++ b/libs/nx-mesh/src/generators/application/schema.json @@ -52,10 +52,23 @@ } }, "example": { - "description": "Which example project would you like to use?", + "description": "Which example project would you like to start with?", "type": "string", - "enum": ["javascriptWiki", "stackexchange", "trippin", "country-info"], - "default": "javascriptWiki" + "default": "star-wars-api", + "x-prompt": { + "message": "Which example project would you like to start with?", + "type": "list", + "items": [ + { "value": "country-info", "label": "Country Info (SOAP)" }, + { "value": "fake-api", "label": "Fake API (JSON Schema)" }, + { "value": "javascript-wiki", "label": "JavaScript Wiki (OpenAPI)" }, + { "value": "movies", "label": "Movies (Neo4j)" }, + { "value": "rfam", "label": "RFam (MySQL)" }, + { "value": "stackexchange", "label": "StackExchange (OpenAPI)" }, + { "value": "star-wars-api", "label": "Star Wars API (GraphQL)" }, + { "value": "trippin", "label": "Trip Pin (odata)" } + ] + } }, "linter": { "description": "The tool to use for running lint checks.", diff --git a/libs/nx-mesh/src/generators/sdk/schema.json b/libs/nx-mesh/src/generators/sdk/schema.json index 8b8bad9b..1bd11319 100644 --- a/libs/nx-mesh/src/generators/sdk/schema.json +++ b/libs/nx-mesh/src/generators/sdk/schema.json @@ -45,10 +45,23 @@ } }, "example": { - "description": "Which example project would you like to use?", + "description": "Which example project would you like to start with?", "type": "string", - "enum": ["javascriptWiki", "stackexchange", "trippin", "country-info"], - "default": "javascriptWiki" + "default": "star-wars-api", + "x-prompt": { + "message": "Which example project would you like to start with?", + "type": "list", + "items": [ + { "value": "country-info", "label": "Country Info (SOAP)" }, + { "value": "fake-api", "label": "Fake API (JSON Schema)" }, + { "value": "javascript-wiki", "label": "JavaScript Wiki (OpenAPI)" }, + { "value": "movies", "label": "Movies (Neo4j)" }, + { "value": "rfam", "label": "RFam (MySQL)" }, + { "value": "stackexchange", "label": "StackExchange (OpenAPI)" }, + { "value": "star-wars-api", "label": "Star Wars API (GraphQL)" }, + { "value": "trippin", "label": "Trip Pin (odata)" } + ] + } }, "simpleModuleName": { "description": "Keep the module name simple (when using `--directory`).",