Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
2a019ed
chore: update typedoc api
mmdapl Dec 5, 2025
c3acda1
chore(release): publish v0.0.1-alpha.37
mmdapl Dec 5, 2025
b7f4086
feat(@142vip/nest): 增加`TransformUriPath`转换器
mmdapl Dec 31, 2025
90195ae
feat(@142vip/nest-typeorm): 增加`DataType`枚举,修复`dataSourceName`参数异常
mmdapl Dec 31, 2025
f927a76
feat(@142vip/utils): 引入`address`依赖,增加`getAddress`方法,支持IP地址获取
mmdapl Dec 31, 2025
a27e9f8
feat(@142vip/nest-starter): 优化`Swagger`管理器,支持多配置
mmdapl Dec 31, 2025
1058962
feat(@142vip/nest-starter): 拓展启动器通用配置,`typeorm`配置支持`MySQL`、`PG`数据库
mmdapl Dec 31, 2025
387710d
refactor(@142vip/nest-starter): 重写启动器逻辑,优化终端日志打印
mmdapl Dec 31, 2025
6849cc1
release(@142vip/utils): publish `v0.0.1-alpha.46`
mmdapl Dec 31, 2025
cd5f8f5
release(@142vip/nest-typeorm): publish `v0.0.1-alpha.2`
mmdapl Dec 31, 2025
76efe4d
release(@142vip/nest): publish `v0.0.1-alpha.4`
mmdapl Dec 31, 2025
8908206
release(@142vip/nest-starter): publish `v0.0.1-alpha.4`
mmdapl Dec 31, 2025
c6da91e
fix(@142vip/nest-typeorm): 修复`dataSourceName`参数异常,增加`@Module`装饰器
mmdapl Jan 1, 2026
e6dcecb
release(@142vip/nest-typeorm): publish `v0.0.1-alpha.3`
mmdapl Jan 1, 2026
1162837
release(@142vip/nest-starter): publish `v0.0.1-alpha.5`
mmdapl Jan 1, 2026
01407a6
fix(@142vip/nest-typeorm): 修复`NestTypeOrmModule`类继承机制,优化导出逻辑
mmdapl Jan 4, 2026
aa4cd10
fix(@142vip/nest-starter): 修改`typeorm`配置,移除`debug`参数
mmdapl Jan 4, 2026
53e9ba2
release(@142vip/nest-typeorm): publish `v0.0.1-alpha.4`
mmdapl Jan 4, 2026
5c2bc61
release(@142vip/nest-starter): publish `v0.0.1-alpha.6`
mmdapl Jan 4, 2026
5ef1cf0
feat(@142vip/nest-typeorm): 补充模块导出
mmdapl Jan 4, 2026
e0903a9
feat(@142vip/nest-starter): 优化通用模块导出
mmdapl Jan 4, 2026
e54d75d
release(@142vip/nest-typeorm): publish `v0.0.1-alpha.5`
mmdapl Jan 4, 2026
412c483
release(@142vip/nest-starter): publish `v0.0.1-alpha.7`
mmdapl Jan 4, 2026
97907d5
feat(@142vip/nest-typeorm): 修改编译配置,支持`NodeNext`编译
mmdapl Jan 4, 2026
163002e
feat(@142vip/nest-starter): 修改编译配置,支持`NodeNext`编译
mmdapl Jan 4, 2026
53c5cdf
release(@142vip/nest-typeorm): publish `v0.0.1-alpha.6`
mmdapl Jan 4, 2026
42e5ba4
release(@142vip/nest-starter): publish `v0.0.1-alpha.8`
mmdapl Jan 4, 2026
9a83221
fix(@142vip/redis): 修复.d.ts类型文件识别异常
mmdapl Jan 5, 2026
5afa90a
feat: 基于`@nestjs`生态,优化`nest`包`ts`配置
mmdapl Jan 5, 2026
eb18b14
feat(@142vip/nest): 优化ts类型和打包配置
mmdapl Jan 5, 2026
c3b28e9
feat(@142vip/nest-logger): 优化ts类型和打包配置
mmdapl Jan 5, 2026
5ecafb7
feat(@142vip/nest-redis): 优化ts类型和打包配置
mmdapl Jan 5, 2026
63af570
feat(@142vip/nest-typeorm): 优化ts类型和打包配置
mmdapl Jan 5, 2026
bd099e5
feat(@142vip/nest-typeorm): 补充`typeorm`工具类
mmdapl Jan 5, 2026
cf4ef9b
feat(@142vip/nest-starter): 优化ts类型和打包配置
mmdapl Jan 5, 2026
bdd7e7f
feat(nest-demo): 补充typeorm实战实践,简化通用配置和依赖
mmdapl Jan 5, 2026
ca7c97a
release(@142vip/redis): publish `v0.0.1-alpha.5`
mmdapl Jan 5, 2026
f959aed
release(@142vip/nest): publish `v0.0.1-alpha.5`
mmdapl Jan 5, 2026
7152f86
release(@142vip/nest-logger): publish `v0.0.1-alpha.2`
mmdapl Jan 5, 2026
8349446
release(@142vip/nest-redis): publish `v0.0.1-alpha.4`
mmdapl Jan 5, 2026
7c80e7d
release(@142vip/nest-typeorm): publish `v0.0.1-alpha.7`
mmdapl Jan 5, 2026
279909a
release(@142vip/nest-starter): publish `v0.0.1-alpha.9`
mmdapl Jan 5, 2026
d951567
release(nest-demo): publish `v0.0.1-alpha.2`
mmdapl Jan 5, 2026
0ca7886
fix(@142vip/nest): 修复`npm`包缺失`index`入口文件
mmdapl Jan 6, 2026
f3ec530
fix(@142vip/nest-logger): 修复`npm`包缺失`index`入口文件
mmdapl Jan 6, 2026
f8bd8e6
fix(@142vip/nest-redis): 修复`npm`包缺失`index`入口文件
mmdapl Jan 6, 2026
99a2b07
fix(@142vip/nest-starter): 修复`npm`包缺失`index`入口文件
mmdapl Jan 6, 2026
21449c3
fix(@142vip/nest-typeorm): 修复`npm`包缺失`index`入口文件
mmdapl Jan 6, 2026
cf56d99
feat(@142vip/nest-typeorm): 修复模块导出逻辑,支持全局模块
mmdapl Jan 6, 2026
cbd9334
feat(@142vip/nest-starter): 基于`@nestjs/typeorm`模块集成数据库
mmdapl Jan 6, 2026
bf5217f
fix(nest-demo): 修复`GET`接口参数异常
mmdapl Jan 6, 2026
6503d72
release(@142vip/nest-logger): publish `v0.0.1-alpha.3`
mmdapl Jan 6, 2026
203e56a
release(@142vip/nest-redis): publish `v0.0.1-alpha.5`
mmdapl Jan 6, 2026
ac5cc6c
release(@142vip/nest-typeorm): publish `v0.0.1-alpha.8`
mmdapl Jan 6, 2026
42b821b
release(@142vip/nest-starter): publish `v0.0.1-alpha.10`
mmdapl Jan 6, 2026
c388040
release(@142vip/nest): publish `v0.0.1-alpha.6`
mmdapl Jan 6, 2026
4b42870
release(nest-demo): publish `v0.0.1-alpha.3`
mmdapl Jan 6, 2026
4eba205
feat(@142vip/nest-starter): 支持Starter启动器类继承后,函数重写
mmdapl Jan 11, 2026
816b293
release(@142vip/nest-starter): publish `v0.0.1-alpha.11`
mmdapl Jan 11, 2026
303bb7d
feat(@142vip/nest-starter): 启动配置支持`swagger.builderOptions`选项
mmdapl Jan 20, 2026
9d5ea28
feat(@142vip/nest-starter): 初始`swagger`时,基于`extraModels`增加`Vo`模型
mmdapl Jan 20, 2026
3484574
feat(@142vip/nest-starter): 优化启动逻辑,增加通用拦截器、过滤器设置
mmdapl Jan 20, 2026
cd85bee
feat(@142vip/nest): 增加`swagger`装饰器,用于接口`Response`声明
mmdapl Jan 20, 2026
79d749c
feat(@142vip/nest): 丰富`DTO`层校验,补充入参、出参定义模型
mmdapl Jan 20, 2026
6c891d0
feat(@142vip/nest): 增加全局过滤器,通用型异常捕获
mmdapl Jan 20, 2026
c0bfcf5
feat(@142vip/nest): 增加上下文、响应拦截器,统一接口返回
mmdapl Jan 20, 2026
4168570
feat(@142vip/nest): 规范常量声明,支持元数据`Key`导出
mmdapl Jan 20, 2026
bf2290f
feat: 依赖优化,减少冗余依赖定义
mmdapl Jan 20, 2026
c802e58
fix: 修复装饰器不生效问题,`nest`包编译配置增加`useDefineForClassFields`选项
mmdapl Jan 20, 2026
a0df396
feat(@142vip/nest-starter): 修改`NestTypeOrmModule`引入方式
mmdapl Jan 20, 2026
4e0d2b2
feat(@142vip/nest): 引入`rxjs`模块,支持全局过滤器
mmdapl Jan 20, 2026
7bfb2c5
feat(@142vip/nest): 增加`ApiResponseSkip`装饰器,跳过`Swagger`和拦截器处理
mmdapl Jan 20, 2026
7779b50
feat(nest-demo): 简化示例代码,降低基础模块学习成本
mmdapl Jan 20, 2026
30d0d2c
feat: 调整侧边栏导航设置
mmdapl Jan 21, 2026
5f2cf9a
feat(@142vip/nest): 增加模块使用文档,补充实践示例
mmdapl Jan 21, 2026
5254be6
release(@142vip/nest): publish `v0.0.1-alpha.7`
mmdapl Jan 21, 2026
c13b17d
release(@142vip/nest-starter): publish `v0.0.1-alpha.12`
mmdapl Jan 21, 2026
1fc3749
release(nest-demo): publish `v0.0.1-alpha.4`
mmdapl Jan 21, 2026
747954b
chore(release): publish v0.0.1-alpha.38
mmdapl Jan 21, 2026
0c6cd3e
feat(@142vip/nest):增加`base-entity`相关`DTO`、`VO`基础类
mmdapl Jan 26, 2026
b149bae
feat(@142vip/nest): `Response`函数增加`HttpCode`装饰器逻辑
mmdapl Jan 26, 2026
b06394b
feat(@142vip/nest-starter): 引入`BaseEntityVo`等数据模型
mmdapl Jan 26, 2026
e0c5e6c
feat(nest-demo): 优化接口在`Swagger`上的显示
mmdapl Jan 26, 2026
4b89948
release(@142vip/nest): publish `v0.0.1-alpha.8`
mmdapl Jan 26, 2026
662f44e
release(@142vip/nest-starter): publish `v0.0.1-alpha.13`
mmdapl Jan 26, 2026
4a77d7d
fix(@142vip/nest): 修复分页`PaginationDto`校验逻辑异常
mmdapl Jan 28, 2026
fdac7c5
release(@142vip/nest): publish `v0.0.1-alpha.9`
mmdapl Jan 28, 2026
c38582a
fix(@142vip/nest): 分页功能返回结构修改,主体数据用records字段
mmdapl Feb 5, 2026
44692f6
feat(nest-demo): 优化rest接口,支持最新分页格式
mmdapl Feb 5, 2026
a491234
release(@142vip/nest): publish `v0.0.1-alpha.10`
mmdapl Feb 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 11 additions & 11 deletions .vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import type { SidebarConfig, VipPackageJSON, VipProject } from '@142vip/vitepres
import { defineVipSidebarConfig } from '@142vip/vitepress'

enum ProjectId {
BUSINESS = '商业代码',
BUSINESS = '商业模块',
TOOLS = '通用工具',
EGG = 'Egg.js框架',
NEST = 'Nest.js框架',
BLOG = '博客工具',
INFRA = '工程化',
DEMO = '演示Demo',
DEMO = '最佳实践',
}

/**
Expand All @@ -21,6 +21,15 @@ export const sidebarConfig = defineVipSidebarConfig([
{ text: '@142vip/data-source', link: '/packages/data-source/index.md' },
],
},
{
text: `🎮 ${ProjectId.DEMO}`,
items: [
{ text: 'egg-demo', link: '/apps/egg-demo/index.md' },
{ text: 'nest-demo', link: '/apps/nest-demo/index.md' },
{ text: 'vitepress-demo', link: '/apps/vitepress-demo/index.md' },
{ text: 'vuepress-demo', link: '/apps/vuepress-demo/index.md' },
],
},
{
text: `🏆 ${ProjectId.INFRA}`,
items: [
Expand Down Expand Up @@ -75,15 +84,6 @@ export const sidebarConfig = defineVipSidebarConfig([
{ text: '@142vip/vuepress', link: '/packages/vuepress/index.md' },
],
},
{
text: `🎮 ${ProjectId.DEMO}`,
items: [
{ text: 'egg-demo', link: '/apps/egg-demo/index.md' },
{ text: 'nest-demo', link: '/apps/nest-demo/index.md' },
{ text: 'vitepress-demo', link: '/apps/vitepress-demo/index.md' },
{ text: 'vuepress-demo', link: '/apps/vuepress-demo/index.md' },
],
},
])

/**
Expand Down
176 changes: 176 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions apps/nest-demo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## v0.0.1-alpha.4 (2026-01-21)

### ✨ Features

- 简化示例代码,降低基础模块学习成本 &nbsp;-&nbsp; by **chufan** [<samp>(7779b)</samp>](https://github.com/142vip/core-x/commit/7779b50c)

**Release New Version v0.0.1-alpha.4 [👉 View New Package On NPM](https://www.npmjs.com/package/nest-demo)**

## v0.0.1-alpha.3 (2026-01-06)

### 🐛 Bug Fixes

- 修复`GET`接口参数异常 &nbsp;-&nbsp; by **chufan** [<samp>(bf521)</samp>](https://github.com/142vip/core-x/commit/bf5217f1)

**Release New Version v0.0.1-alpha.3 [👉 View New Package On NPM](https://www.npmjs.com/package/nest-demo)**

## v0.0.1-alpha.2 (2026-01-05)

### ✨ Features

- 补充typeorm实战实践,简化通用配置和依赖 &nbsp;-&nbsp; by **chufan** [<samp>(bdd7e)</samp>](https://github.com/142vip/core-x/commit/bdd7e7f4)

**Release New Version v0.0.1-alpha.2 [👉 View New Package On NPM](https://www.npmjs.com/package/nest-demo)**

## v0.0.1-alpha.1 (2025-11-04)

### ✨ Features
Expand Down
31 changes: 28 additions & 3 deletions apps/nest-demo/config/test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,34 @@ module.exports = {
starter: {
port: 3000,
enableSwagger: true,
swagger: {},
// logger: {},
globalPrefix: '/api/example',
swagger: {
// docPath: '/doc',
// envs: {
// local: 'http://127.0.0.1',
// },
// builderOptions: {
// globalResponses: [
// {
// status: 500,
// description: '服务异常',
// },
// {
// status: 400,
// description: '参数错误',
// },
// ],
// },
},
redis: {
url: 'redis://127.0.0.1:6379',
},
typeorm: {
url: 'postgres://root:123456@127.0.0.1:5432/oauth-service',
synchronize: false,
logging: 'true',
},
enableLogger: true,
// enableSwagger: true,
},
test: 1,
}
15 changes: 15 additions & 0 deletions apps/nest-demo/nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"plugins": [
{
"name": "@nestjs/swagger",
"options": {
"classValidatorShim": true,
"introspectComments": true,
"skipAutoHttpCode": false,
"dtoFileNameSuffix": [
".dto.ts",
".vo.ts",
".entity.ts"
]
}
}
],
"deleteOutDir": true
}
}
6 changes: 1 addition & 5 deletions apps/nest-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nest-demo",
"version": "0.0.1-alpha.1",
"version": "0.0.1-alpha.4",
"private": true,
"description": "@142vip/nest相关包和插件的使用Demo",
"authorInfo": {
Expand All @@ -16,11 +16,7 @@
"build": "nest build",
"start": "nest start"
},
"peerDependencies": {
"@142vip/nest": "workspace:*"
},
"dependencies": {
"@142vip/nest-redis": "workspace:*",
"@142vip/nest-starter": "workspace:*"
}
}
10 changes: 4 additions & 6 deletions apps/nest-demo/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { NestRedisModule } from '@142vip/nest-redis'
import { Module } from '@nestjs/common'
import { ConfigExampleModule } from './config-example/config-example.module'
import { RedisExampleModule } from './redis-example/redis-example.module'
import { RestExampleModule } from './rest-example/rest-example.module'
import { TypeormExampleModule } from './typeorm-example/typeorm-example.module'

@Module({
imports: [
// 全局模块
NestRedisModule.register({ url: 'redis://172.16.202.252:6379' }),

// 最佳实践
TypeormExampleModule,
RedisExampleModule,

ConfigExampleModule,
RestExampleModule,
],
})
export class AppModule {}
13 changes: 11 additions & 2 deletions apps/nest-demo/src/config-example/config-example.controller.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import { StarterConfig } from '@142vip/nest-starter'
import { ApiResponseSkip } from '@142vip/nest'
import { Controller, Get } from '@nestjs/common'
import { ApiTags } from '@nestjs/swagger'
import { ConfigExampleService } from './config-example.service'

/**
* 配置
*/
@Controller('config-example')
@ApiTags('config')
export class ConfigExampleController {
constructor(
private readonly configExampleService: ConfigExampleService,
) {}

/**
* 获取配置
*/
@Get('/')
public 'Get /'(): StarterConfig {
@ApiResponseSkip()
public 'Get /'() {
return this.configExampleService.getStarterConfig()
}
}
2 changes: 2 additions & 0 deletions apps/nest-demo/src/config-example/config-example.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { StarterConfig } from '@142vip/nest-starter'
import { Injectable } from '@nestjs/common'

@Injectable()
export class ConfigExampleService {
constructor(
private readonly starterConfig: StarterConfig,
Expand Down
7 changes: 4 additions & 3 deletions apps/nest-demo/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { NestAppConfig } from '@142vip/nest-starter'
import { IsNumber } from 'class-validator'

/**
* 配置
*/
export class Config extends NestAppConfig {
@IsNumber()
test!: number

}
15 changes: 15 additions & 0 deletions apps/nest-demo/src/redis-example/redis-example.controller.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
import { ApiResponseNull, ApiResponseSkip } from '@142vip/nest'
import { Controller, Delete, Get, Post } from '@nestjs/common'
import { ApiTags } from '@nestjs/swagger'
import { RedisExampleService } from './redis-example.service'

@Controller('redis-example')
@ApiTags('redis')
export class RedisExampleController {
constructor(
private readonly redisExampleService: RedisExampleService,
) {}

/**
* 创建
*/
@Post('/')
@ApiResponseNull()
public async 'Post /'(): Promise<void> {
await this.redisExampleService.setKey()
}

/**
* 获取 所有缓存Key
*/
@Get('/')
@ApiResponseSkip()
public async 'Get /'(): Promise<string | null> {
return await this.redisExampleService.getKey()
}

/**
* 删除
*/
@Delete('/')
@ApiResponseNull()
public async 'Delete /'(): Promise<void> {
await this.redisExampleService.delKey()
}
Expand Down
2 changes: 1 addition & 1 deletion apps/nest-demo/src/redis-example/redis-example.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const storeExample = { key: 'test', value: 'redis-example' }
export class RedisExampleService {
constructor(
private readonly redisService: RedisService,
) { }
) {}

async setKey(): Promise<void> {
await this.redisService.setEx(storeExample.key, storeExample.value, 5)
Expand Down
76 changes: 76 additions & 0 deletions apps/nest-demo/src/rest-example/rest-example.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { ApiResponseNull, ApiResponseObject, ApiResponsePagination, PaginationResponse } from '@142vip/nest'
import { Body, Controller, Delete, Get, Patch, Post, Query } from '@nestjs/common'
import { ApiTags } from '@nestjs/swagger'
import {
CreateRestExampleDTO,
GetRestExampleDTO,
GetRestExampleListDTO,
} from './rest-example.dto'
import { RestExampleService } from './rest-example.service'
import { GetRestExampleListVo, GetRestExampleVo } from './rest-example.vo'

@Controller('rest-example')
@ApiTags('rest')
export class RestExampleController {
constructor(
private readonly restExampleService: RestExampleService,
) {}

/**
* 创建
*/
@Post('/')
@ApiResponseNull()
public 'Post /'(
@Body() _params: CreateRestExampleDTO,
): void {

}

/**
* 获取 - 单页
*/
@Get('/')
@ApiResponseObject(GetRestExampleVo)
public async 'Get /'(
@Query() _params: GetRestExampleDTO,
): Promise<GetRestExampleVo> {
const example = this.restExampleService.getExample()
return new GetRestExampleVo(example)
}

/**
* 获取 - 列表
*/
@Get('/list')
@ApiResponsePagination(GetRestExampleListVo)
public async 'Get /list'(
@Query() params: GetRestExampleListDTO,
): Promise<PaginationResponse<GetRestExampleListVo>> {
const examples = this.restExampleService.getExampleList()
return {
total: 1,
records: examples,
pageNum: params.pageNum,
pageSize: params.pageSize,
}
}

/**
* 更新
*/
@Patch('/')
@ApiResponseNull()
public 'Patch /'(): void {

}

/**
* 删除
*/
@Delete()
@ApiResponseNull()
public 'Delete /'(): void {

}
}
Loading