@openapi-qraft/cli 2.0.0-next.9 → 2.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +203 -0
  2. package/README.md +3 -2
  3. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,208 @@
1
1
  # @openapi-qraft/cli
2
2
 
3
+ ## 2.0.1-beta.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [def57df]
8
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.1-beta.0
9
+ - @openapi-qraft/openapi-typescript-plugin@1.2.1-beta.0
10
+ - @openapi-qraft/plugin@2.0.1-beta.0
11
+
12
+ ## 2.0.0
13
+
14
+ ### Major Changes
15
+
16
+ - 8c77eb2: Generate comprehensive operation names with consideration of the `--service-name-base` option. Operation names now
17
+ include all path parts and parameters, and the structure can be customized based on the `--service-name-base` value.
18
+
19
+ **Breaking Changes:**
20
+
21
+ - Operation names now include all path parts and parameters by default.
22
+ - `/api/v{api-version}` is no longer automatically removed from the path when generating operation names.
23
+ - The `--service-name-base` option now influences the generated operation names with a new structure.
24
+
25
+ **Examples:**
26
+
27
+ - With `--service-name-base=endpoint[0]`:
28
+ `POST /v1/users/{id}` → `api.v1.postUsersId`
29
+ - With `--service-name-base=endpoint[1]`:
30
+ `GET /v1/users/{id}` → `api.users.getId`
31
+ - With `--service-name-base=endpoint[1]`:
32
+ `POST /v1/users/suspend` → `api.users.postSuspend`
33
+ - With `--service-name-base=endpoint[1]`:
34
+ `POST /v1/users/{id}/{key}` → `api.postIdKey`
35
+ - With `--service-name-base=tags`:
36
+ `POST /v1/users/{id}/{key}` → `api.<tag>.postV1UsersIdKey`
37
+
38
+ This change provides more flexibility in operation name generation and allows for better customization based on project
39
+ requirements.
40
+
41
+ - 54fd011: Changed the exports from the schema file to include only the essential types: `$defs`, `paths`, `components`, `operations`, `webhooks`. This adjustment improves the development experience by preventing the export of all schema types, which could result in an excessive number of exported types, complicating development and reducing clarity.
42
+
43
+ ### Minor Changes
44
+
45
+ - 2a53608: Updated TypeScript to version 5.5.4
46
+ - 76634bf: ### Changeset: `createPredefinedParametersRequestFn`
47
+
48
+ Introduced `createPredefinedParametersRequestFn`, generated by the `@openapi-qraft/cli` using
49
+ the `--operation-predefined-parameters` option.
50
+ This function allows for the automatic application of predefined
51
+ parameters to selected API operations by wrapping the base `requestFn`. It simplifies managing parameters, reducing
52
+ boilerplate code, and supports both static and dynamic values, enhancing flexibility in API request handling.
53
+
54
+ ### Patch Changes
55
+
56
+ - 7ab718b: Enhanced the `--explicit-import-extensions` option to support `.ts` in addition to `.js`, making it easier for projects using TypeScript to explicitly specify import extensions.
57
+ - Updated dependencies [4ef9ce0]
58
+ - Updated dependencies [56687f3]
59
+ - Updated dependencies [8bbe14b]
60
+ - Updated dependencies [16b380f]
61
+ - Updated dependencies [7ab718b]
62
+ - Updated dependencies [8c77eb2]
63
+ - Updated dependencies [9dc1918]
64
+ - Updated dependencies [2a53608]
65
+ - Updated dependencies [cd3fe16]
66
+ - Updated dependencies [0b3cda1]
67
+ - Updated dependencies [76634bf]
68
+ - Updated dependencies [78638a5]
69
+ - Updated dependencies [5b64278]
70
+ - Updated dependencies [c111be6]
71
+ - Updated dependencies [7e51026]
72
+ - Updated dependencies [cd8a856]
73
+ - Updated dependencies [266611a]
74
+ - Updated dependencies [3ed94dc]
75
+ - Updated dependencies [62ff8e0]
76
+ - Updated dependencies [54fd011]
77
+ - Updated dependencies [fc6b4e7]
78
+ - Updated dependencies [34ff132]
79
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0
80
+ - @openapi-qraft/plugin@2.0.0
81
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0
82
+
83
+ ## 2.0.0-next.19
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [62ff8e0]
88
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.19
89
+ - @openapi-qraft/plugin@2.0.0-next.19
90
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.19
91
+
92
+ ## 2.0.0-next.18
93
+
94
+ ### Patch Changes
95
+
96
+ - @openapi-qraft/plugin@2.0.0-next.18
97
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.18
98
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.18
99
+
100
+ ## 2.0.0-next.17
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [8bbe14b]
105
+ - Updated dependencies [16b380f]
106
+ - Updated dependencies [cd3fe16]
107
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.17
108
+ - @openapi-qraft/plugin@2.0.0-next.17
109
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.17
110
+
111
+ ## 2.0.0-next.16
112
+
113
+ ### Patch Changes
114
+
115
+ - @openapi-qraft/plugin@2.0.0-next.16
116
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.16
117
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.16
118
+
119
+ ## 2.0.0-next.15
120
+
121
+ ### Patch Changes
122
+
123
+ - Updated dependencies [4b1c13f]
124
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.15
125
+ - @openapi-qraft/plugin@2.0.0-next.15
126
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.15
127
+
128
+ ## 2.0.0-next.14
129
+
130
+ ### Major Changes
131
+
132
+ - 54fd011: Changed the exports from the schema file to include only the essential types: `$defs`, `paths`, `components`, `operations`, `webhooks`. This adjustment improves the development experience by preventing the export of all schema types, which could result in an excessive number of exported types, complicating development and reducing clarity.
133
+
134
+ ### Patch Changes
135
+
136
+ - 7ab718b: Enhanced the `--explicit-import-extensions` option to support `.ts` in addition to `.js`, making it easier for projects using TypeScript to explicitly specify import extensions.
137
+ - Updated dependencies [7ab718b]
138
+ - Updated dependencies [54fd011]
139
+ - Updated dependencies [34ff132]
140
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.14
141
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.14
142
+ - @openapi-qraft/plugin@2.0.0-next.14
143
+
144
+ ## 2.0.0-next.13
145
+
146
+ ### Patch Changes
147
+
148
+ - Updated dependencies [c111be6]
149
+ - @openapi-qraft/plugin@2.0.0-next.13
150
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.13
151
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.13
152
+
153
+ ## 2.0.0-next.12
154
+
155
+ ### Patch Changes
156
+
157
+ - @openapi-qraft/plugin@2.0.0-next.12
158
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.12
159
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.12
160
+
161
+ ## 2.0.0-next.11
162
+
163
+ ### Patch Changes
164
+
165
+ - Updated dependencies [3ed94dc]
166
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.11
167
+ - @openapi-qraft/plugin@2.0.0-next.11
168
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.11
169
+
170
+ ## 2.0.0-next.10
171
+
172
+ ### Major Changes
173
+
174
+ - 8c77eb2: Generate comprehensive operation names with consideration of the `--service-name-base` option. Operation names now
175
+ include all path parts and parameters, and the structure can be customized based on the `--service-name-base` value.
176
+
177
+ **Breaking Changes:**
178
+
179
+ - Operation names now include all path parts and parameters by default.
180
+ - `/api/v{api-version}` is no longer automatically removed from the path when generating operation names.
181
+ - The `--service-name-base` option now influences the generated operation names with a new structure.
182
+
183
+ **Examples:**
184
+
185
+ - With `--service-name-base=endpoint[0]`:
186
+ `POST /v1/users/{id}` → `api.v1.postUsersId`
187
+ - With `--service-name-base=endpoint[1]`:
188
+ `GET /v1/users/{id}` → `api.users.getId`
189
+ - With `--service-name-base=endpoint[1]`:
190
+ `POST /v1/users/suspend` → `api.users.postSuspend`
191
+ - With `--service-name-base=endpoint[1]`:
192
+ `POST /v1/users/{id}/{key}` → `api.postIdKey`
193
+ - With `--service-name-base=tags`:
194
+ `POST /v1/users/{id}/{key}` → `api.<tag>.postV1UsersIdKey`
195
+
196
+ This change provides more flexibility in operation name generation and allows for better customization based on project
197
+ requirements.
198
+
199
+ ### Patch Changes
200
+
201
+ - Updated dependencies [8c77eb2]
202
+ - @openapi-qraft/plugin@2.0.0-next.10
203
+ - @openapi-qraft/openapi-typescript-plugin@1.2.0-next.10
204
+ - @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.10
205
+
3
206
  ## 2.0.0-next.9
4
207
 
5
208
  ### Patch Changes
package/README.md CHANGED
@@ -38,7 +38,7 @@ Options:
38
38
  --service-name-base <endpoint[<index>] | tags> Use OpenAPI Operation `endpoint[<index>]` path part (e.g.: "/0/1/2") or `tags` as the base name of the service. (default: "endpoint[0]")
39
39
  --file-header <string> Header to be added to the generated file (eg: /* eslint-disable */)
40
40
  --openapi-types-import-path <path> Path to schema types file (.d.ts), eg: "../schema.d.ts"
41
- --explicit-import-extensions All import statements will include explicit `.js` extensions. Ideal for projects using ECMAScript modules.
41
+ --explicit-import-extensions [extension] All import statements will contain an explicit file extension. Ideal for projects using ECMAScript modules. (choices: ".js", ".ts", preset: ".js")
42
42
  --export-openapi-types [bool] Export the OpenAPI schema types from the generated `./index.ts` file (default: true)
43
43
  --operation-generics-import-path <path> Path to operation generics file (default: "@openapi-qraft/react")
44
44
  --openapi-types-file-name <path> OpenAPI Schema types file name, eg: "schema.d.ts" (default: "schema.ts")
@@ -145,7 +145,8 @@ npx openapi-qraft --plugin tanstack-query-react --plugin openapi-typescript http
145
145
  - `--service-name-base tags` will generate services based on the OpenAPI Operation tags instead of the endpoint.
146
146
  - If multiple tags are present for the operation, similar services will be created for each tag. Operation with `tags: [Foo, Bar]` will generate `services/FooService.ts` and `services/BarService.ts`.
147
147
  - If there are no tags for the operation, the services will be created under the `default` tag. Operation with empty `tags: []` will generate `services/DefaultService.ts`.
148
- - **`--explicit-import-extensions`:** Include explicit `.js` extensions in all import statements. Ideal for projects using ECMAScript modules when TypeScript's _--moduleResolution_ is `node16` or `nodenext` _(optional)_.
148
+ - **`--explicit-import-extensions [extension]`**: All import statements will contain an explicit file extension. Ideal for projects using ECMAScript modules
149
+ when TypeScript's _--moduleResolution_ is `node16` or `nodenext`. Choices: `.js`, `.ts`, preset: `.js`. _(optional)_
149
150
  - **`--file-header <string>`:** Add a custom header to each generated file, useful for disabling linting rules or adding file
150
151
  comments _(optional)_.
151
152
  - Example: `--file-header '/* eslint-disable */'`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openapi-qraft/cli",
3
- "version": "2.0.0-next.9",
3
+ "version": "2.0.1-beta.0",
4
4
  "description": "CLI for generating typed TanStack Query React Hooks and services from OpenAPI Document, improving type safety in React apps",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -15,19 +15,19 @@
15
15
  "openapi-qraft": "./bin.mjs"
16
16
  },
17
17
  "dependencies": {
18
- "@openapi-qraft/openapi-typescript-plugin": "1.2.0-next.9",
19
- "@openapi-qraft/plugin": "2.0.0-next.9",
20
- "@openapi-qraft/tanstack-query-react-plugin": "2.0.0-next.9",
18
+ "@openapi-qraft/openapi-typescript-plugin": "1.2.1-beta.0",
19
+ "@openapi-qraft/plugin": "2.0.1-beta.0",
20
+ "@openapi-qraft/tanstack-query-react-plugin": "2.0.1-beta.0",
21
21
  "commander": "^11.1.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@openapi-qraft/eslint-config": "1.0.0",
25
25
  "@types/node": "^20.16.5",
26
- "eslint": "^9.10.0",
26
+ "eslint": "^9.16.0",
27
27
  "globals": "^15.9.0",
28
28
  "rimraf": "^5.0.10",
29
29
  "typescript": "^5.6.2",
30
- "vitest": "^1.6.0"
30
+ "vitest": "^2.1.8"
31
31
  },
32
32
  "files": [
33
33
  "dist",