Gathering detailed insights and metrics for @142vip/changelog
Gathering detailed insights and metrics for @142vip/changelog
Gathering detailed insights and metrics for @142vip/changelog
Gathering detailed insights and metrics for @142vip/changelog
npm install @142vip/changelog
Typescript
Module System
Min. Node Version
Node Version
NPM Version
62.1
Supply Chain
79.6
Quality
90.2
Maintenance
100
Vulnerability
97.6
License
v0.0.1-alpha.30
Updated on May 06, 2025
v0.0.1-alpha.29
Updated on Apr 23, 2025
v0.0.1-alpha.28
Updated on Apr 15, 2025
v0.0.1-alpha.27
Updated on Mar 30, 2025
v0.0.1-alpha.26
Updated on Mar 28, 2025
v0.0.1-alpha.25
Updated on Mar 27, 2025
TypeScript (81.51%)
JavaScript (10.15%)
Vue (3.68%)
CSS (2.65%)
SCSS (1.27%)
Dockerfile (0.54%)
Shell (0.21%)
Total Downloads
2,221
Last Day
11
Last Week
87
Last Month
219
Last Year
2,221
MIT License
2 Stars
982 Commits
1 Forks
7 Branches
1 Contributors
Updated on May 07, 2025
Latest Version
0.0.1-alpha.19
Package Id
@142vip/changelog@0.0.1-alpha.19
Unpacked Size
76.50 kB
Size
19.77 kB
File Count
16
NPM Version
10.5.0
Node Version
20.12.2
Published on
May 06, 2025
Cumulative downloads
Total Downloads
Last Day
266.7%
11
Compared to previous day
Last Week
770%
87
Compared to previous week
Last Month
-43.6%
219
Compared to previous month
Last Year
0%
2,221
Compared to previous year
2
根据Git
提交记录,自动生成CHANGELOG
文档
从 GitHub
提交信息Conventional Commits中生成更改日志。 这个模块实现参考了 changelogen 和 changelogithub 两个模块的实现。
非常感谢两位作者的实现思路
1# 安装 2pnpm i @142vip/changelog -D
1# output参数可以配置,支持做本地文档更新 2npx changelog --output CHANGELOG.md
1# 只本地生成创建版本的URL 2npx changelog --dry-run
1# .github/workflows/release.yml 2name: Release 3 4permissions: 5 contents: write 6 7on: 8 push: 9 tags: 10 - 'v*' 11 12jobs: 13 release: 14 runs-on: ubuntu-latest 15 steps: 16 - uses: actions/checkout@v4 17 with: 18 fetch-depth: 0 19 20 # 安装node版本,大于16 21 - uses: actions/setup-node@v4 22 with: 23 node-version: 16.x 24 25 # Github发布版本,并更新Release信息 26 - name: Release New Version 27 run: | 28 npx changelog 29 env: 30 GITHUB_TOKEN: ${{secrets.TOKEN}}
向 GitHub 推送以“v”开头的标签时,github actions
会被触发。
在142vip所有的开源仓库中,都可以通过@142vip/changelog
模块来实现发布,例如:
1# 2# CD持续交付 3# 4 5name: CD 6on: 7 push: 8 branches: 9 - next 10 workflow_dispatch: 11jobs: 12 # 版本发布 13 github-release: 14 name: 创建Github发布 15 runs-on: ubuntu-latest 16 # 主库next且执行release更新时执行 17 if: github.repository == '142vip/core-x' && startsWith(github.event.head_commit.message, 'chore(release):') 18 19 steps: 20 - name: Checkout Code 21 uses: actions/checkout@v4 22 with: 23 persist-credentials: false 24 fetch-depth: 0 25 26 # 安装PNPM 27 - name: PNPM Install 28 uses: pnpm/action-setup@v4 29 with: 30 version: 9.6.0 31 32 # 安装Node环境 33 - name: Install Node.js 34 uses: actions/setup-node@v4 35 with: 36 node-version: 20.12.2 37 # 缓存 38 cache: pnpm 39 40 # 基于国内镜像源下载依赖,并执行初始化脚本:钩子函数、思维导图构建 41 - name: Install Dependencies 42 run: | 43 ./scripts/ci 44 45 # ci的hooks已经执行 46 # - name: Build All Packages 47 # run: | 48 # pnpm build:packages 49 50 # Github发布版本,并更新Release信息 51 - name: Release New Version 52 run: npx changelog 53 env: 54 GITHUB_TOKEN: ${{secrets.TOKEN}}
1# 常看命令 2npx changelog -h 3 4Usage: @142vip/changelog [options] 5 6基于Git提交信息,生成变更记录,输出Markdown格式的日志文件 7 8Options: 9 -v,--version VipCommander Version By @142vip 10 --trace 开启日志追踪模式 (default: false) 11 --dry-run 试运行 (default: false) 12 --token <token> GitHub的Token 13 --from <from> Git Commit信息的开始的标签 14 --to <to> Git Commit信息的结束标签 15 --name <name> 发布的名称 16 --github <github> Github仓库地址,例如:@142vip/core-x 17 --output <output> 输出文档的文件名,建议用绝对路径,例如:CHANGELOG.md 18 --scopeName <scopeName> Monorepo模式下的应用包名称 19 --prerelease 将当前发布的版本标记为预发布状态 (default: true) 20 -h, --help display help for command
可以将配置文件放在项目根目录中,名为 changelog.config.{json,ts,js,mjs,cjs}
或使用 changelog
字段在package.json
中。
1// 默认配置 2export default { 3 scopeMap: {}, 4 types: { 5 feat: { title: '✨ Features', semver: 'minor' }, 6 perf: { title: '🔥 Performance', semver: 'patch' }, 7 fix: { title: '🐛 Bug Fixes', semver: 'patch' }, 8 refactor: { title: '💅 Refactors', semver: 'patch' }, 9 docs: { title: '📖 Documentation', semver: 'patch' }, 10 build: { title: '📦 Build', semver: 'patch' }, 11 types: { title: '🌊 Types', semver: 'patch' }, 12 release: { title: '😏 Release Packages', semver: 'patch' }, 13 }, 14 titles: { 15 breakingChanges: '🚨 Breaking Changes', 16 }, 17 contributors: true, 18 capitalize: true, 19 group: true, 20 emoji: true, 21 baseUrl: 'github.com', 22 baseUrlApi: 'api.github.com', 23 prerelease: true, 24}
GithubAPI
对象Changelog
对象ChangelogAPI
GitCommitAPI
对象MarkdownAPI
对象1/** 2 * changelog相关API 3 */ 4export const ChangelogAPI = { 5 generateChangelogInfo, 6 upsertChangelogDoc, 7 changelogCoreHandler, 8} 9 10/** 11 * Git Commit相关API 12 */ 13export const GitCommitAPI = { 14 getGitCommitDiff, 15 parseGitCommits, 16 parseCommitsToMarkdownStr, 17} 18 19/** 20 * Github相关API 21 */ 22export const GithubAPI = { 23 getAuthorInfo, 24 isExistTag, 25 generateReleaseUrl, 26 printReleaseUrl, 27 getHeaders, 28 resolveAuthors, 29 createGithubRelease, 30} 31 32/** 33 * markdown文档相关API 34 */ 35export const MarkdownAPI = { 36 formatSection, 37 getNoSignificantChanges, 38 getNPMVersionDescription, 39 getGithubVersionDescription, 40}
Copyright (c) 2019-present, 142vip 储凡
No vulnerabilities found.
No security vulnerabilities found.