Skip to content

Commit 5947e2d

Browse files
committed
refactor(nx-plugin): update schema prompts and descriptions for clarity in update-api and openapi-client
1 parent d4711ce commit 5947e2d

File tree

2 files changed

+33
-37
lines changed

2 files changed

+33
-37
lines changed

packages/nx-plugin/src/executors/update-api/schema.json

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,43 @@
88
"name": {
99
"type": "string",
1010
"description": "The name of the project",
11-
"x-prompt": "What is the name of the project? (e.g. my-api)",
1211
"$default": {
1312
"$source": "argv",
1413
"index": 0
15-
}
16-
},
17-
"spec": {
18-
"type": "string",
19-
"description": "The path to the OpenAPI spec file",
20-
"x-prompt": "What is the path to the OpenAPI spec file? (URI or local file path)"
14+
},
15+
"x-prompt": "What name would you like to use for the library? (e.g. my-api)"
2116
},
22-
"client": {
17+
"directory": {
2318
"type": "string",
24-
"description": "The type of client to generate",
25-
"x-prompt": "What is the type of client to generate? (@hey-api/client-fetch, @hey-api/client-axios)",
26-
"default": "@hey-api/client-fetch"
19+
"description": "Directory where the library will be created",
20+
"default": "libs"
2721
},
2822
"scope": {
2923
"type": "string",
3024
"description": "The scope of the project",
3125
"x-prompt": "What is the scope of the project? (e.g. @my-org)"
3226
},
33-
"directory": {
27+
"spec": {
3428
"type": "string",
35-
"description": "The directory of the project",
36-
"x-prompt": "What is the directory of the project? (e.g. libs)",
37-
"default": "libs"
29+
"description": "Path to the OpenAPI spec file (URL or local path)",
30+
"x-prompt": "What is the path to the OpenAPI spec file? (URI or local file path)"
31+
},
32+
"client": {
33+
"type": "string",
34+
"description": "The type of client to generate (@hey-api/client-fetch, @hey-api/client-axios, etc)",
35+
"default": "@hey-api/client-fetch"
3836
},
3937
"plugins": {
4038
"type": "array",
41-
"description": "The plugins to use",
42-
"x-prompt": "What plugins would you like to use? (e.g. @tanstack/react-query)",
39+
"description": "The plugins to be provided to @hey-api/openapi-ts",
4340
"default": [],
4441
"items": {
4542
"type": "string"
4643
}
4744
},
4845
"force": {
4946
"type": "boolean",
50-
"description": "If true, the Client code will be regenerated even if the spec has not changed",
47+
"description": "If true, the Client code will be regenerated even if the spec has not changed, also pass --skip-nx-cache to avoid caching issues",
5148
"default": false
5249
}
5350
},

packages/nx-plugin/src/generators/openapi-client/schema.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"properties": {
99
"name": {
1010
"type": "string",
11-
"description": "Library name",
11+
"description": "The name of the project",
1212
"$default": {
1313
"$source": "argv",
1414
"index": 0
1515
},
16-
"x-prompt": "What name would you like to use for the library?"
16+
"x-prompt": "What name would you like to use for the library? (e.g. my-api)"
1717
},
1818
"directory": {
1919
"type": "string",
@@ -22,45 +22,44 @@
2222
},
2323
"scope": {
2424
"type": "string",
25-
"description": "Scope of the library",
26-
"x-prompt": "What is the scope of the library?"
25+
"description": "The scope of the project",
26+
"x-prompt": "What is the scope of the project? (e.g. @my-org)"
2727
},
2828
"spec": {
2929
"type": "string",
3030
"description": "Path to the OpenAPI spec file (URL or local path)",
31-
"x-prompt": "What is the URL or local path to the OpenAPI spec file?"
32-
},
33-
"tags": {
34-
"type": "array",
35-
"description": "Add tags to the library (comma-separated)",
36-
"default": ["api", "openapi"],
37-
"items": {
38-
"type": "string"
39-
}
31+
"x-prompt": "What is the path to the OpenAPI spec file? (URI or local file path)"
4032
},
4133
"client": {
4234
"type": "string",
43-
"description": "Type of client to generate",
44-
"default": "@hey-api/client-fetch",
45-
"x-prompt": "Which client type would you like to use?"
35+
"description": "The type of client to generate (@hey-api/client-fetch, @hey-api/client-axios, etc)",
36+
"default": "@hey-api/client-fetch"
4637
},
4738
"plugins": {
4839
"type": "array",
49-
"description": "Plugins to use",
40+
"description": "The plugins to be provided to @hey-api/openapi-ts",
5041
"default": [],
5142
"items": {
5243
"type": "string"
5344
}
5445
},
46+
"tags": {
47+
"type": "array",
48+
"description": "Add tags to the library (comma-separated)",
49+
"default": ["api", "openapi"],
50+
"items": {
51+
"type": "string"
52+
}
53+
},
5554
"test": {
5655
"type": "string",
57-
"description": "Test to use",
56+
"description": "The test runner to use",
5857
"default": "none",
5958
"enum": ["none", "vitest"]
6059
},
6160
"private": {
6261
"type": "boolean",
63-
"description": "Whether to make the generated package private",
62+
"description": "Whether to make the generated package private, put false if you want to publish the package.",
6463
"default": true
6564
}
6665
},

0 commit comments

Comments
 (0)