Skip to content

Commit

Permalink
fix: fix npx run error
Browse files Browse the repository at this point in the history
  • Loading branch information
rookie-luochao committed Jul 15, 2024
1 parent 7c11115 commit 34b24a6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-candles-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openapi-ts-request': patch
---

fix: fix npx run error
14 changes: 7 additions & 7 deletions README-en_US.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ pnpm i openapi-ts-request -D

### CosmiConfig

create ```openapi-ts-request.config.ts``` file in the project root directory
> 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)
create ```openapi-ts.config.ts``` file in the project root directory
> 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)
```ts
export default {
Expand All @@ -51,7 +51,7 @@ export default [
]
```

add the command in ```script``` of ```package.json```: ```"openapi": "openapi-ts-request",```
add the command in ```script``` of ```package.json```: ```"openapi": "openapi-ts",```

generate result:

Expand All @@ -61,7 +61,7 @@ npm run openapi

### JS

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

```ts
const { generateService } = require('openapi-ts-request')
Expand All @@ -72,7 +72,7 @@ generateService({
})
```

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

generate result:

Expand All @@ -82,7 +82,7 @@ npm run openapi

### TS

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

```ts
const { generateService } = require('openapi-ts-request')
Expand All @@ -93,7 +93,7 @@ generateService({
})
```

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

generate result:

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ pnpm i openapi-ts-request -D

### CosmiConfig

在项目根目录新建 ```openapi-ts-request.config.ts```
> 配置文件还支持 ***.openapi-ts-request.ts***, ***openapi-ts-request.config.cjs*** 等格式,参考 [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#cosmiconfig)
在项目根目录新建 ```openapi-ts.config.ts```
> 配置文件还支持 ***.openapi-ts.ts***, ***openapi-ts.config.cjs*** 等格式,参考 [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#cosmiconfig)
```ts
export default {
Expand All @@ -51,7 +51,7 @@ export default [
]
```

```package.json``````script``` 中添加命令: ```"openapi": "openapi-ts-request",```
```package.json``````script``` 中添加命令: ```"openapi": "openapi-ts",```

生成结果:

Expand All @@ -61,7 +61,7 @@ npm run openapi

### JS

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

```ts
const { generateService } = require('openapi-ts-request')
Expand All @@ -72,7 +72,7 @@ generateService({
})
```

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

生成结果:

Expand All @@ -82,7 +82,7 @@ npm run openapi

### TS

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

```ts
const { generateService } = require('openapi-ts-request')
Expand All @@ -93,7 +93,7 @@ generateService({
})
```

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

生成结果:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"types": "dist/index.d.ts",
"bin": {
"openapi": "dist/bin/openapi.js",
"openapi-ts-request": "dist/bin/cli.js"
"openapi-ts": "dist/bin/cli.js"
},
"files": [
"dist",
Expand Down

0 comments on commit 34b24a6

Please sign in to comment.