Skip to content

Commit 01ca65e

Browse files
docs: fix cosmiConfig usage
1 parent 383f110 commit 01ca65e

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.changeset/gold-students-boil.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openapi-ts-request': patch
3+
---
4+
5+
docs: fix cosmiConfig usage

README-en_US.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pnpm i openapi-ts-request -D
2929

3030
### CosmiConfig
3131

32-
create ```openapi-ts.config.ts``` file in the project root directory
33-
> the config file also supports ***.openapi-ts.ts***, ***openapi-ts.config.cjs*** format, reference [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#cosmiconfig)
32+
create ```openapi-ts-request.config.ts``` file in the project root directory
33+
> the config file also supports ***.openapi-ts-request.ts***, ***openapi-ts-request.config.cjs*** format, reference [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#cosmiconfig)
3434
3535
```ts
3636
export default {
@@ -63,7 +63,7 @@ npm run openapi
6363

6464
### JS
6565

66-
create a new ```openapi-ts.config.js``` file in any directory ```xxx/xxx```
66+
create a new ```openapi-ts-request.config.js``` file in any directory ```xxx/xxx```
6767

6868
```ts
6969
const { generateService } = require('openapi-ts-request')
@@ -74,7 +74,7 @@ generateService({
7474
})
7575
```
7676

77-
add the command in ```script``` of ```package.json```: ```"openapi": "node xxx/xxx/openapi-ts.config.js"```
77+
add the command in ```script``` of ```package.json```: ```"openapi": "node xxx/xxx/openapi-ts-request.config.js"```
7878

7979
generate result:
8080

@@ -84,7 +84,7 @@ npm run openapi
8484

8585
### TS
8686

87-
create a new ```openapi-ts.config.ts``` file in any directory ```xxx/xxx```
87+
create a new ```openapi-ts-request.config.ts``` file in any directory ```xxx/xxx```
8888

8989
```ts
9090
const { generateService } = require('openapi-ts-request')
@@ -95,7 +95,7 @@ generateService({
9595
})
9696
```
9797

98-
add the command in ```script``` of ```package.json```: ```"openapi": "ts-node xxx/xxx/openapi-ts.config.ts",```
98+
add the command in ```script``` of ```package.json```: ```"openapi": "ts-node xxx/xxx/openapi-ts-request.config.ts",```
9999

100100
generate result:
101101

@@ -106,6 +106,7 @@ npm run openapi
106106
### NPX
107107

108108
```bash
109+
# npm
109110
npx --package=openapi-ts-request -- openapi -i ./openapi.json -o ./apis
110111
npx --package=openapi-ts-request -- openapi -i https://petstore3.swagger.io/api/v3/openapi.json -o ./apis
111112

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pnpm i openapi-ts-request -D
2929

3030
### CosmiConfig
3131

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+
在项目根目录新建 ```openapi-ts-request.config.ts```
33+
> 配置文件还支持 ***.openapi-ts-request.ts***, ***openapi-ts-request.config.cjs*** 等格式,参考 [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#cosmiconfig)
3434
3535
```ts
3636
export default {
@@ -63,7 +63,7 @@ npm run openapi
6363

6464
### JS
6565

66-
任意目录 ```xxx/xxx``` 新建 ```openapi-ts.config.js```
66+
任意目录 ```xxx/xxx``` 新建 ```openapi-ts-request.config.js```
6767

6868
```ts
6969
const { generateService } = require('openapi-ts-request')
@@ -74,7 +74,7 @@ generateService({
7474
})
7575
```
7676

77-
```package.json``````script``` 中添加命令: ```"openapi": "node xxx/xxx/openapi-ts.config.js"```
77+
```package.json``````script``` 中添加命令: ```"openapi": "node xxx/xxx/openapi-ts-request.config.js"```
7878

7979
生成结果:
8080

@@ -84,7 +84,7 @@ npm run openapi
8484

8585
### TS
8686

87-
任意目录 ```xxx/xxx``` 新建 ```openapi-ts.config.ts```
87+
任意目录 ```xxx/xxx``` 新建 ```openapi-ts-request.config.ts```
8888

8989
```ts
9090
const { generateService } = require('openapi-ts-request')
@@ -95,7 +95,7 @@ generateService({
9595
})
9696
```
9797

98-
```package.json``````script``` 中添加命令: ```"openapi": "ts-node xxx/xxx/openapi-ts.config.ts",```
98+
```package.json``````script``` 中添加命令: ```"openapi": "ts-node xxx/xxx/openapi-ts-request.config.ts",```
9999

100100
生成结果:
101101

0 commit comments

Comments
 (0)