swagger2api-v3 1.0.0 → 1.0.1

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Swagger2API
1
+ # Swagger2API-v3
2
2
 
3
3
  一个强大的 npm 工具包,用于从 Swagger JSON 文档生成前端接口代码。支持 TypeScript,按标签分组,详细注释生成等功能。
4
4
 
@@ -15,13 +15,13 @@
15
15
 
16
16
  ```bash
17
17
  # 使用 pnpm(推荐)
18
- pnpm add swagger2api
18
+ pnpm add swagger2api-v3
19
19
 
20
20
  # 使用 npm
21
- npm install swagger2api
21
+ npm install swagger2api-v3
22
22
 
23
23
  # 使用 yarn
24
- yarn add swagger2api
24
+ yarn add swagger2api-v3
25
25
  ```
26
26
 
27
27
  ## 快速开始
@@ -30,7 +30,7 @@ yarn add swagger2api
30
30
 
31
31
  ```bash
32
32
  # 创建基础配置文件
33
- npx swagger2api init
33
+ npx swagger2api-v3 init
34
34
  ```
35
35
 
36
36
  ### 2. 配置 `.swagger.config.ts`
@@ -69,7 +69,7 @@ module.exports = config;
69
69
 
70
70
  ```bash
71
71
  # 使用配置文件生成
72
- npx swagger2api generate
72
+ npx swagger2api-v3 generate
73
73
 
74
74
  # 或者通过 npm script
75
75
  npm run swagger:generate
@@ -82,29 +82,29 @@ npm run swagger:generate
82
82
  ```json
83
83
  {
84
84
  "scripts": {
85
- "swagger:generate": "npx swagger2api generate",
86
- "swagger:run": "npx swagger2api run",
87
- "swagger:init": "npx swagger2api init",
88
- "swagger:validate": "npx swagger2api validate"
85
+ "swagger:generate": "npx swagger2api-v3 generate",
86
+ "swagger:run": "npx swagger2api-v3 run",
87
+ "swagger:init": "npx swagger2api-v3 init",
88
+ "swagger:validate": "npx swagger2api-v3 validate"
89
89
  }
90
90
  }
91
91
  ```
92
92
 
93
93
  ## CLI 命令
94
94
 
95
- ### `swagger2api run`
95
+ ### `swagger2api-v3 run`
96
96
 
97
97
  运行 `.swagger.config.ts` 配置文件生成接口代码:
98
98
 
99
99
  ```bash
100
100
  # 使用默认配置文件
101
- swagger2api run
101
+ swagger2api-v3 run
102
102
 
103
103
  # 指定配置文件
104
- swagger2api run -c ./custom.swagger.config.ts
104
+ swagger2api-v3 run -c ./custom.swagger.config.ts
105
105
  ```
106
106
 
107
- ### `swagger2api generate`
107
+ ### `swagger2api-v3 generate`
108
108
 
109
109
  使用配置文件生成接口代码:
110
110
 
@@ -116,31 +116,31 @@ swagger2api generate
116
116
  npm run swagger:generate
117
117
  ```
118
118
 
119
- ### `swagger2api init`
119
+ ### `swagger2api-v3 init`
120
120
 
121
121
  初始化配置文件:
122
122
 
123
123
  ```bash
124
124
  # 创建基础配置
125
- swagger2api init
125
+ swagger2api-v3 init
126
126
 
127
127
  # 创建示例配置
128
- swagger2api init --example
128
+ swagger2api-v3 init --example
129
129
 
130
130
  # 指定输出路径
131
- swagger2api init -o ./config/swagger.config.ts
131
+ swagger2api-v3 init -o ./config/swagger.config.ts
132
132
  ```
133
133
 
134
- ### `swagger2api validate`
134
+ ### `swagger2api-v3 validate`
135
135
 
136
136
  验证 Swagger 文档:
137
137
 
138
138
  ```bash
139
139
  # 验证文件
140
- swagger2api validate -i ./swagger.json
140
+ swagger2api-v3 validate -i ./swagger.json
141
141
 
142
142
  # 使用配置文件验证
143
- swagger2api validate -c ./.swagger.config.ts
143
+ swagger2api-v3 validate -c ./.swagger.config.ts
144
144
  ```
145
145
 
146
146
  ## 配置选项
@@ -418,7 +418,7 @@ test/
418
418
  ```bash
419
419
  # 克隆项目
420
420
  git clone <repository-url>
421
- cd swagger2api
421
+ cd swagger2api-v3
422
422
 
423
423
  # 安装依赖
424
424
  npm install
package/dist/cli/index.js CHANGED
@@ -42,7 +42,7 @@ const program = new commander_1.Command();
42
42
  // 版本信息
43
43
  const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf-8'));
44
44
  program
45
- .name('swagger2api')
45
+ .name('swagger2api-v3')
46
46
  .description('从 Swagger/OpenAPI 文档生成 TypeScript API 接口')
47
47
  .version(packageJson.version);
48
48
  // generate 命令
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swagger2api-v3",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "从 Swagger/OpenAPI 文档生成 TypeScript API 接口的命令行工具",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -42,13 +42,13 @@
42
42
  ],
43
43
  "author": "xiaoyang",
44
44
  "license": "MIT",
45
- "homepage": "https://github.com/xiaoyang33/swagger2api#readme",
45
+ "homepage": "https://github.com/xiaoyang33/swagger2api-v3#readme",
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "https://github.com/xiaoyang33/swagger2api.git"
48
+ "url": "https://github.com/xiaoyang33/swagger2api-v3.git"
49
49
  },
50
50
  "bugs": {
51
- "url": "https://github.com/xiaoyang33/swagger2api/issues"
51
+ "url": "https://github.com/xiaoyang33/swagger2api-v3/issues"
52
52
  },
53
53
  "packageManager": "pnpm@10.11.0",
54
54
  "type": "commonjs",