Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/changelog/src/core/changelog.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function upsertChangelogDoc(
}

// 添加版本头部
const newMd = `## ${releaseVersionName} (${vipDayjs.formatDateToYMD()})\n\n${markdown}`
const newMd = `## ${releaseVersionName} (${vipDayjs.formatCurrentDateToYMD()})\n\n${markdown}`

const lastEntry = changelogMD.match(/^##\s+(?:\S.*)?$/m)

Expand Down
2 changes: 1 addition & 1 deletion packages/nest-logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"dependencies": {
"nestjs-pino": "4.4.1",
"pino": "9.4.0",
"pino": "10.1.0",
"pino-http": "11.0.0",
"pino-pretty": "11.3.0"
},
Expand Down
10 changes: 10 additions & 0 deletions packages/utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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.44 (2025-11-18)

### ✨ Features

- 基于原生`ConfigType`优化`VipDayjs`类函数的类型 &nbsp;-&nbsp; by **chufan** [<samp>(c450f)</samp>](https://github.com/142vip/core-x/commit/c450f004)
- 拓展`VipDayjs`类,增加`formatCurrentDateToStr`等方法 &nbsp;-&nbsp; by **chufan** [<samp>(1eea0)</samp>](https://github.com/142vip/core-x/commit/1eea051d)
- 拓展`VipNanoId`类,增加`getRandomUpperCharId`等方法 &nbsp;-&nbsp; by **chufan** [<samp>(53ecf)</samp>](https://github.com/142vip/core-x/commit/53ecf0f8)

**Release New Version v0.0.1-alpha.44 [👉 View New Package On NPM](https://www.npmjs.com/package/@142vip/utils)**

## v0.0.1-alpha.43 (2025-11-06)

### 💅 Refactors
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@142vip/utils",
"type": "module",
"version": "0.0.1-alpha.43",
"version": "0.0.1-alpha.44",
"private": false,
"description": "通用型基础工具集合,对常用模块的二次集成",
"author": "mmdapl <mmdapl@163.com>",
Expand Down
29 changes: 27 additions & 2 deletions packages/utils/src/pkgs/dayjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ export class VipDayjs {
* 时间格式:年-月-日 时:分:秒
*/
private readonly FORMAT_TEMPLATE_STR = 'YYYY-MM-DD HH:mm:ss'

/**
* 时间戳格式:年月日时分秒毫秒
*/
private readonly FORMAT_TEMPLATE_STR_TIMESTAMP = 'YYYYMMDDHHmmSSS'

/**
* 日期格式:年-月-日
*/
private readonly FORMAT_TEMPLATE_STR_DATE = 'YYYY-MM-DD'
/**
* 获取当前时间戳。单位:毫秒
*/
Expand Down Expand Up @@ -47,8 +57,23 @@ export class VipDayjs {
* 年月日格式化当前时间
* - 格式: 2024-08-09
*/
public formatDateToYMD(): string {
return this.formatDateToStr(new Date(), 'YYYY-MM-DD')
public formatCurrentDateToYMD(): string {
return this.formatDateToStr(new Date(), this.FORMAT_TEMPLATE_STR_DATE)
}

/**
* 时间戳格式化当前时间
* - 格式: 20240809152030123
*/
public formatCurrentDateToTimestamp(): string {
return this.formatDateToStr(new Date(), this.FORMAT_TEMPLATE_STR_TIMESTAMP)
}

/**
* 时间格式化当前时间,默认: 年-月-日 时:分:秒
*/
public formatCurrentDateToStr(): string {
return this.formatDateToStr(new Date(), this.FORMAT_TEMPLATE_STR)
}
}

Expand Down
18 changes: 18 additions & 0 deletions packages/utils/src/pkgs/nanoid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { customAlphabet, nanoid } from 'nanoid'
export enum Alphabet {
DEFAULT = '0123456789abcdefghijklmnopqrstuvwxyz',
ONLY_NUMBER = '0123456789',
ONLY_LOWER_CHAR = 'abcdefghijklmnopqrstuvwxyz',
ONLY_UPPER_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
ONLY_CHAR = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
COMPLEX = '-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
}
Expand Down Expand Up @@ -47,6 +49,22 @@ export class VipNanoId {
return this.getNanoId(Alphabet.ONLY_CHAR)(size)
}

/**
* 获取纯小写字母的随机字符串
* @param size
*/
public getRandomLowerCharId(size?: number): string {
return this.getNanoId(Alphabet.ONLY_LOWER_CHAR)(size)
}

/**
* 获取纯大写字母的随机字符串
* @param size
*/
public getRandomUpperCharId(size?: number): string {
return this.getNanoId(Alphabet.ONLY_UPPER_CHAR)(size)
}

/**
* 获取复杂的随机字符串,包含数字、小写字母、大写字母和特殊字符
* @param size
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"typedoc-plugin-markdown": "4.9.0",
"typedoc-plugin-remark": "2.0.1",
"typedoc-vitepress-theme": "1.1.2",
"unplugin-element-plus": "0.9.1",
"unplugin-element-plus": "0.11.1",
"vue-sfc-transformer": "0.1.14"
}
}
Loading
Loading