openapi-ts-request 0.4.1 → 0.4.3

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 (2) hide show
  1. package/README.md +15 -9
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -20,15 +20,17 @@
20
20
  ## 使用
21
21
 
22
22
  ```bash
23
+ # npm
23
24
  npm i openapi-ts-request --save-dev
24
25
 
26
+ # pnpm
25
27
  pnpm i openapi-ts-request -D
26
28
  ```
27
29
 
28
30
  ### CosmiConfig
29
31
 
30
- 在项目根目录新建 ```openapi-ts-request.config.ts```
31
- > 配置文件还支持 ***.openapi-ts-request.ts***, ***openapi-ts-request.config.cjs*** 等格式,参考 [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#cosmiconfig)
32
+ 在项目根目录新建 ```openapi-ts.config.ts```
33
+ > 配置文件还支持 ***.openapi-ts.ts***, ***openapi-ts.config.cjs*** 等格式,参考 [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#cosmiconfig)
32
34
 
33
35
  ```ts
34
36
  export default {
@@ -51,7 +53,7 @@ export default [
51
53
  ]
52
54
  ```
53
55
 
54
- 在 ```package.json``` 的 ```script``` 中添加命令: ```"openapi": "openapi-ts-request",```
56
+ 在 ```package.json``` 的 ```script``` 中添加命令: ```"openapi": "openapi-ts",```
55
57
 
56
58
  生成结果:
57
59
 
@@ -61,7 +63,7 @@ npm run openapi
61
63
 
62
64
  ### JS
63
65
 
64
- 任意目录 ```xxx/xxx``` 新建 ```openapi-ts-request.config.js```
66
+ 任意目录 ```xxx/xxx``` 新建 ```openapi-ts.config.js```
65
67
 
66
68
  ```ts
67
69
  const { generateService } = require('openapi-ts-request')
@@ -72,7 +74,7 @@ generateService({
72
74
  })
73
75
  ```
74
76
 
75
- 在 ```package.json``` 的 ```script``` 中添加命令: ```"openapi": "node xxx/xxx/openapi-ts-request.config.js"```
77
+ 在 ```package.json``` 的 ```script``` 中添加命令: ```"openapi": "node xxx/xxx/openapi-ts.config.js"```
76
78
 
77
79
  生成结果:
78
80
 
@@ -82,7 +84,7 @@ npm run openapi
82
84
 
83
85
  ### TS
84
86
 
85
- 任意目录 ```xxx/xxx``` 新建 ```openapi-ts-request.config.ts```
87
+ 任意目录 ```xxx/xxx``` 新建 ```openapi-ts.config.ts```
86
88
 
87
89
  ```ts
88
90
  const { generateService } = require('openapi-ts-request')
@@ -93,7 +95,7 @@ generateService({
93
95
  })
94
96
  ```
95
97
 
96
- 在 ```package.json``` 的 ```script``` 中添加命令: ```"openapi": "ts-node xxx/xxx/openapi-ts-request.config.ts",```
98
+ 在 ```package.json``` 的 ```script``` 中添加命令: ```"openapi": "ts-node xxx/xxx/openapi-ts.config.ts",```
97
99
 
98
100
  生成结果:
99
101
 
@@ -103,8 +105,12 @@ npm run openapi
103
105
 
104
106
  ### NPX
105
107
 
106
- ```
107
- npx openapi-ts-request openapi -i ./openapi.json -o ./apis
108
+ ```bash
109
+ # npm
110
+ npx --package=openapi-ts-request -- openapi -i ./openapi.json -o ./apis
111
+
112
+ # pnpm
113
+ pnpm --package=openapi-ts-request dlx openapi -i ./openapi.json -o ./apis
108
114
  ```
109
115
 
110
116
  ### CLI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-ts-request",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Swagger2/OpenAPI3 to TypeScript, request client, request mock service, enum, type field label, JSON Schemas",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "types": "dist/index.d.ts",
13
13
  "bin": {
14
14
  "openapi": "dist/bin/openapi.js",
15
- "openapi-ts-request": "dist/bin/cli.js"
15
+ "openapi-ts": "dist/bin/cli.js"
16
16
  },
17
17
  "files": [
18
18
  "dist",