npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@varlet/release

v0.2.10

Published

release all packages and generate changelogs

Downloads

503

Readme

介绍

Varlet Release 是一个用于发布所有包、生成变更日志和检测 commit message 的工具,依赖于 pnpm

安装

pnpm add @varlet/release -D

使用

使用命令

# 发布所有包并生成变更日志
npx vr release

# 指定远程仓库名称
npx vr release -r https://github.com/varletjs/varlet-release
# or
npx vr release --remote https://github.com/varletjs/varlet-release

# 仅生成变更日志
npx vr changelog

# 指定变更日志文件名
npx vr changelog -f changelog.md
# or
npx vr changelog --file changelog.md

# 检测 commit message
npx vr lint-commit -p .git/COMMIT_EDITMSG

# 发布到 npm,可以在 ci 中执行
npx vr publish

配置

release

| 参数 | 说明 | | ------------------------- | ----------------------------------------------------------------------- | | -r --remote <remote> | 指定远程仓库名称 | | -s --skip-npm-publish | 跳过 npm 发布 | | -c --check-remote-version | 检测 npm 包的远程版本是否与要在本地发布的包版本相同,如果是,则停止执行 | | -sc --skip-changelog | 跳过生成变更日志 | | -sgt --skip-git-tag | 跳过 git tag | | -nt --npm-tag <npmTag> | npm tag |

changelog

| 参数 | 说明 | | ----------------------------------- | ------------------ | | -f --file <filename> | 指定变更日志文件名 | | -rc --releaseCount <releaseCount> | 发布数量 |

lint-commit

| 参数 | 说明 | | ------------------------------- | --------------------------------------------------------------------------- | | -p --commitMessagePath <path> | 提交 git message 的临时文件路径。git 钩子 commit-msg 会传递这个参数。 | | -r --commitMessageRe <reg> | 验证 commit message 是否通过的正则 | | -e --errorMessage <message> | 验证失败展示的错误信息 | | -w --warningMessage <message> | 验证失败展示的提示信息 |

publish

| 参数 | 说明 | | ------------------------- | --------------------------------------------------------------------- | | -c --check-remote-version | 检测npm包的远程版本是否与要在本地发布的包版本相同,如果是,则跳过发布 | | -nt --npm-tag <npmTag> | npm tag |

自定义处理

示例

import { release, changelog } from '@varlet/release'

// Do what you want to do...
release()

你可以传入一个 task,在包版本更改后,在发布之前会调用 task

import { release, changelog } from '@varlet/release'

async function task() {
  await doSomething1()
  await doSomething2()
}

release({ task })

类型

interface PublishCommandOptions {
  preRelease?: boolean
  checkRemoteVersion?: boolean
  npmTag?: string
}
function publish({ preRelease, checkRemoteVersion, npmTag }: PublishCommandOptions): Promise<void>
function updateVersion(version: string): void
interface ReleaseCommandOptions {
  remote?: string
  skipNpmPublish?: boolean
  skipChangelog?: boolean
  skipGitTag?: boolean
  npmTag?: string
  task?(): Promise<void>
}
function release(options: ReleaseCommandOptions): Promise<void>

interface ChangelogCommandOptions {
  file?: string
  releaseCount?: number
}
function changelog({ releaseCount, file }?: ChangelogCommandOptions): Promise<void>

const COMMIT_MESSAGE_RE: RegExp
function isVersionCommitMessage(message: string): string | false | null
function getCommitMessage(commitMessagePath: string): string
interface CommitLintCommandOptions {
  commitMessagePath: string
  commitMessageRe?: string | RegExp
  errorMessage?: string
  warningMessage?: string
}
function commitLint(options: CommitLintCommandOptions): void

License

MIT