You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(nx-plugin): add base tsconfig options for improved configuration management
- Introduce `baseTsConfigName` and `baseTsConfigPath` options in the OpenAPI client generator and update executor schemas.
- Enhance README documentation to reflect new options and their usage.
- Implement `getBaseTsConfigPath` utility to resolve tsconfig paths based on provided options.
- Update tests to cover new tsconfig path handling logic.
Copy file name to clipboardExpand all lines: packages/nx-plugin/README.md
+4
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ Run in interactive mode `nx g @hey-api/nx-plugin:openapi-client`
32
32
The defaults tags will not be added to the project if you specify this option.
33
33
-`plugins`: Additional plugins to provide to the client api. [ string[]] (optional)
34
34
-`test`: The type of tests to setup. [ 'none' | 'vitest' ] (optional) (default: `none`)
35
+
-`baseTsConfigName`: The name of the base tsconfig file that contains the compiler paths used to resolve the imports. Use this if the base tsconfig file is in the workspace root. If provided with a baseTsConfigPath then the baseTsConfigName will be added to the path. Do not use this if the baseTsConfigPath is a file. [ string ] (optional)
36
+
-`baseTsConfigPath`: The path to the base tsconfig file that contains the compiler paths used to resolve the imports. Use this if the base tsconfig file is not in the workspace root. This can be a file or a directory. If it is a directory and the baseTsConfigName is provided then the baseTsConfigName will be added to the path. If it is a file and the baseTsConfigName is provided then there will be an error. [ string ] (optional)
35
37
36
38
##### Example
37
39
@@ -46,6 +48,8 @@ nx g @hey-api/nx-plugin:openapi-client --name=my-api --client=@hey-api/client-fe
46
48
This executor updates the OpenAPI spec file and generates a new client.
47
49
The options for the executor will be populated from the generator.
48
50
51
+
No need to add them yourself, to modify the options manually edit the `project.json` of the generated project.
52
+
49
53
Run `nx run @my-org/my-generated-package:updateApi`
Copy file name to clipboardExpand all lines: packages/nx-plugin/src/generators/openapi-client/openapiClient.schema.json
+8
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,14 @@
66
66
"type": "boolean",
67
67
"description": "** not working ** Whether to use the class style for the generated code, defaults to `false`",
68
68
"default": false
69
+
},
70
+
"baseTsConfigName": {
71
+
"type": "string",
72
+
"description": "The name of the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is in the workspace root, if provided with a baseTsConfigPath then the baseTsConfigName will be added to the path. DO not use this if the baseTsConfigPath is a file."
73
+
},
74
+
"baseTsConfigPath": {
75
+
"type": "string",
76
+
"description": "The path to the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is not in the workspace root. This can be a file or a directory. If it is a directory and the baseTsConfigName is provided then the baseTsConfigName will be added to the path. If it is a file and the baseTsConfigName is provided then there will be an error."
* Whether to use the class style for the generated code, defaults to `false`
129
130
*/
130
131
asClass?: boolean;
132
+
/**
133
+
* The name of the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is in the workspace root,
134
+
* if provided with a baseTsConfigPath then the baseTsConfigName will be added to the path.
135
+
* DO not use this if the baseTsConfigPath is a file.
136
+
*/
137
+
baseTsConfigName?: string;
138
+
/**
139
+
* The path to the base tsconfig file that contains the compiler paths used to resolve the imports, use this if the base tsconfig file is not in the workspace root.
140
+
* This can be a file or a directory. If it is a directory and the baseTsConfigName is provided then the baseTsConfigName will be added to the path.
141
+
* If it is a file and the baseTsConfigName is provided then there will be an error.
142
+
*/
143
+
baseTsConfigPath?: string;
131
144
/**
132
145
* The client to use for the OpenAPI client
133
146
*/
@@ -286,6 +299,8 @@ export default async function (
0 commit comments