create-hest-app 0.1.0 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-hest-app",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Create HestJS-powered applications with one command",
6
6
  "keywords": [
@@ -1,4 +1,4 @@
1
- # HestJS Demo Application 🚀
1
+ # HestJS Application 🚀
2
2
 
3
3
  一个基于 **HestJS** 框架的现代化 TypeScript 演示应用,展示了类似 NestJS 的开发体验,但具有更轻量和更高性能的特点。内置支持通过注解自动生成 **OpenAPI 3.0** 规范的 Swagger 文档。
4
4
 
@@ -66,7 +66,7 @@ export class UsersController {
66
66
  items: {
67
67
  type: 'object',
68
68
  properties: {
69
- id: { type: 'string', example: 'user-123' },
69
+ id: { type: 'string', example: '' },
70
70
  name: { type: 'string', example: 'John Doe' },
71
71
  email: { type: 'string', format: 'email', example: 'john@example.com' },
72
72
  },
@@ -87,7 +87,7 @@ async getUsers() {
87
87
  @ApiParam('id', {
88
88
  description: 'User unique identifier',
89
89
  schema: { type: 'string' },
90
- example: 'user-123',
90
+ example: '1',
91
91
  })
92
92
  @ApiResponse('200', {
93
93
  description: 'User found',
@@ -175,14 +175,14 @@ async createUser(@Body() userData: CreateUserDto) {
175
175
 
176
176
  ### 🎨 可用装饰器
177
177
 
178
- | 装饰器 | 用途 | 示例 |
179
- |--------|------|------|
180
- | `@ApiTags(...)` | 为控制器或方法添加标签 | `@ApiTags('Users', 'Admin')` |
181
- | `@ApiOperation(...)` | 描述 API 操作 | `@ApiOperation({ summary: '获取用户' })` |
182
- | `@ApiResponse(status, spec)` | 定义响应格式 | `@ApiResponse('200', { description: '成功' })` |
183
- | `@ApiParam(name, spec)` | 描述路径参数 | `@ApiParam('id', { type: 'string' })` |
184
- | `@ApiQuery(name, spec)` | 描述查询参数 | `@ApiQuery('page', { type: 'number' })` |
185
- | `@ApiBody(schema, options)` | 描述请求体 | `@ApiBody({ schema: userSchema })` |
178
+ | 装饰器 | 用途 | 示例 |
179
+ | ------------------------------ | ---------------------- | ------------------------------------------------ |
180
+ | `@ApiTags(...)` | 为控制器或方法添加标签 | `@ApiTags('Users', 'Admin')` |
181
+ | `@ApiOperation(...)` | 描述 API 操作 | `@ApiOperation({ summary: '获取用户' })` |
182
+ | `@ApiResponse(status, spec)` | 定义响应格式 | `@ApiResponse('200', { description: '成功' })` |
183
+ | `@ApiParam(name, spec)` | 描述路径参数 | `@ApiParam('id', { type: 'string' })` |
184
+ | `@ApiQuery(name, spec)` | 描述查询参数 | `@ApiQuery('page', { type: 'number' })` |
185
+ | `@ApiBody(schema, options)` | 描述请求体 | `@ApiBody({ schema: userSchema })` |
186
186
 
187
187
  ### ⚙️ 配置选项
188
188
 
@@ -17,8 +17,6 @@ export default [
17
17
  '*.d.ts',
18
18
  '.bun/**',
19
19
  'bun.lockb',
20
- // shadcn 目录
21
- 'src/components/ui/**',
22
20
  // scripts 目录
23
21
  'scripts/**',
24
22
  ],
@@ -30,7 +30,7 @@
30
30
  "author": "aqz236",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@hestjs/core": "^0.1.8",
33
+ "@hestjs/core": "^0.1.9",
34
34
  "@hestjs/logger": "^0.1.5",
35
35
  "@hestjs/validation": "^0.1.5",
36
36
  "hono": "^4.8.9",
@@ -1,4 +1,4 @@
1
- # HestJS Demo Application 🚀
1
+ # HestJS Application 🚀
2
2
 
3
3
  一个基于 **HestJS** 框架的现代化 TypeScript 演示应用,展示了类似 NestJS 的开发体验,但具有更轻量和更高性能的特点。内置支持通过注解自动生成 **OpenAPI 3.0** 规范的 Swagger 文档。
4
4
 
@@ -66,7 +66,7 @@ export class UsersController {
66
66
  items: {
67
67
  type: 'object',
68
68
  properties: {
69
- id: { type: 'string', example: 'user-123' },
69
+ id: { type: 'string', example: '' },
70
70
  name: { type: 'string', example: 'John Doe' },
71
71
  email: { type: 'string', format: 'email', example: 'john@example.com' },
72
72
  },
@@ -87,7 +87,7 @@ async getUsers() {
87
87
  @ApiParam('id', {
88
88
  description: 'User unique identifier',
89
89
  schema: { type: 'string' },
90
- example: 'user-123',
90
+ example: '1',
91
91
  })
92
92
  @ApiResponse('200', {
93
93
  description: 'User found',
@@ -175,14 +175,14 @@ async createUser(@Body() userData: CreateUserDto) {
175
175
 
176
176
  ### 🎨 可用装饰器
177
177
 
178
- | 装饰器 | 用途 | 示例 |
179
- |--------|------|------|
180
- | `@ApiTags(...)` | 为控制器或方法添加标签 | `@ApiTags('Users', 'Admin')` |
181
- | `@ApiOperation(...)` | 描述 API 操作 | `@ApiOperation({ summary: '获取用户' })` |
182
- | `@ApiResponse(status, spec)` | 定义响应格式 | `@ApiResponse('200', { description: '成功' })` |
183
- | `@ApiParam(name, spec)` | 描述路径参数 | `@ApiParam('id', { type: 'string' })` |
184
- | `@ApiQuery(name, spec)` | 描述查询参数 | `@ApiQuery('page', { type: 'number' })` |
185
- | `@ApiBody(schema, options)` | 描述请求体 | `@ApiBody({ schema: userSchema })` |
178
+ | 装饰器 | 用途 | 示例 |
179
+ | ------------------------------ | ---------------------- | ------------------------------------------------ |
180
+ | `@ApiTags(...)` | 为控制器或方法添加标签 | `@ApiTags('Users', 'Admin')` |
181
+ | `@ApiOperation(...)` | 描述 API 操作 | `@ApiOperation({ summary: '获取用户' })` |
182
+ | `@ApiResponse(status, spec)` | 定义响应格式 | `@ApiResponse('200', { description: '成功' })` |
183
+ | `@ApiParam(name, spec)` | 描述路径参数 | `@ApiParam('id', { type: 'string' })` |
184
+ | `@ApiQuery(name, spec)` | 描述查询参数 | `@ApiQuery('page', { type: 'number' })` |
185
+ | `@ApiBody(schema, options)` | 描述请求体 | `@ApiBody({ schema: userSchema })` |
186
186
 
187
187
  ### ⚙️ 配置选项
188
188
 
@@ -17,8 +17,6 @@ export default [
17
17
  '*.d.ts',
18
18
  '.bun/**',
19
19
  'bun.lockb',
20
- // shadcn 目录
21
- 'src/components/ui/**',
22
20
  // scripts 目录
23
21
  'scripts/**',
24
22
  ],
@@ -30,9 +30,9 @@
30
30
  "author": "aqz236",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@hestjs/core": "^0.1.8",
33
+ "@hestjs/core": "^0.1.9",
34
34
  "@hestjs/logger": "^0.1.5",
35
- "@hestjs/scalar": "^0.1.2",
35
+ "@hestjs/scalar": "^0.1.4",
36
36
  "@hestjs/validation": "^0.1.5",
37
37
  "hono": "^4.8.9",
38
38
  "reflect-metadata": "^0.2.2"
@@ -23,9 +23,8 @@ async function bootstrap() {
23
23
  // 全局异常过滤器
24
24
  app.useGlobalFilters(new HttpExceptionFilter());
25
25
 
26
- // 设置OpenAPI规范端点 - 基于注解生成
27
- app.useScalarWithControllers(
28
- [AppController], // 传入需要生成文档的控制器
26
+ // 设置OpenAPI规范端点
27
+ app.useSwagger(
29
28
  {
30
29
  info: {
31
30
  title: 'HestJS Demo API',
@@ -17,8 +17,6 @@ export default [
17
17
  '*.d.ts',
18
18
  '.bun/**',
19
19
  'bun.lockb',
20
- // shadcn 目录
21
- 'src/components/ui/**',
22
20
  // scripts 目录
23
21
  'scripts/**',
24
22
  ],
@@ -30,9 +30,9 @@
30
30
  "author": "aqz236",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@hestjs/core": "^0.1.8",
33
+ "@hestjs/core": "^0.1.9",
34
34
  "@hestjs/validation": "^0.1.5",
35
- "@hestjs/cqrs": "^0.1.2",
35
+ "@hestjs/cqrs": "^0.1.3",
36
36
  "hono": "^4.8.9",
37
37
  "reflect-metadata": "^0.2.2"
38
38
  },