@csmith/release-it-calver-plugin

中文文档
2026.9.0发布于 2026/09/22MITES Module构建来源已验证近 30 天下载 1.6万

Calender Versioning (calver) plugin for Release It!

原始使用文档
文档目录10 节
  1. Calendar Versioning (calver) plugin for Release It!
  2. Configuration
  3. Cycle options
  4. Prefix
  5. Separator
  6. Upgrading from pre-calver 24.x versions
  7. What happens automatically
  8. What changes
  9. Config mapping
  10. Example upgrade

release-it-calver-plugin

Calendar Versioning (calver) plugin for Release It!

codecov

This plugin enables Calendar Versioning (calver) with Release It! This is especially useful for application projects in a continuous delivery environment.

npm install --save-dev @csmith/release-it-calver-plugin

In release-it config:

"plugins": {
  "@csmith/release-it-calver-plugin": {
    "cycle": "month"
  }
}

Configuration

OptionDescriptionDefaultValues
cycleThe calendar cycle to usemonthyear, month, week, day, auto
prefixString to prepend to the version""Any string
separatorSeparator between date segments".""." or "-"

Cycle options

year

Versions contain only the year and a minor number.

2026.0
2026.1
2027.0

month (default)

Versions contain the year, month, and a minor number.

2026.3.0
2026.3.1
2026.4.0

week

Versions contain the year, week number, and a minor number.

2026.13.0
2026.13.1
2026.14.0

day

Versions contain the year, month, day, and a minor number.

Note: 4-segment versions (e.g. 2026.3.24.0) are not valid semver and will be rejected by npm version. If you publish to npm, either use a different cycle or set "npm": { "skipChecks": true } in your release-it config.

2026.3.24.0
2026.3.24.1
2026.3.25.0

Prefix

Useful for monorepos where multiple modules need distinct version tags.

"@csmith/release-it-calver-plugin": {
    "cycle": "month",
    "prefix": "ui-"
}

Produces versions like ui-2026.3.0, ui-2026.3.1, etc.

Separator

By default, all date segments are separated by . for npm semver compatibility. Set to "-" to use dash-separated output (calver-native format). Only use this if you don't need npm compatibility.

"@csmith/release-it-calver-plugin": {
    "cycle": "month",
    "separator": "-"
}

Produces versions like 2026-3.0, 2026-3.1, etc.

Dash-separated versions are not valid semver, so you will also need to configure release-it to skip npm version checks:

"npm": {
    "skipChecks": true
}

Upgrading from pre-calver 24.x versions

This plugin now uses calver 24.x, which is a complete rewrite of the calver library. The plugin handles the transition automatically, but there are some things to be aware of.

What happens automatically

  • Old config still works. The format, increment, and fallbackIncrement options are deprecated but still supported. The plugin maps them to the new cycle setting and logs a deprecation warning. You can upgrade your config at your own pace.
  • Old tags are migrated. Existing tags in the old format (e.g. 24.11.0 or 2024.11.0) are automatically converted when computing the next version. No manual retagging is needed.
  • Initial versions work. If your repository has no prior calver tags (or only a 0.0.0 tag), the plugin now correctly generates an initial version instead of returning 0.0.0.

What changes

  • 4-digit years. Versions now always use 4-digit years. If your previous tags used 2-digit years (e.g. 24.11.0), the next version will use 4-digit years (e.g. 2026.3.0).
  • Simplified config. The format and increment options are replaced by a single cycle option. See the table below for the mapping.

Config mapping

Old configNew config
"format": "yy.mm.minor", "increment": "calendar""cycle": "month"
"format": "yyyy.mm.minor", "increment": "calendar""cycle": "month"
"format": "yyyy.minor", "increment": "calendar""cycle": "year"
"format": "yyyy.ww.minor", "increment": "calendar""cycle": "week"
"format": "yyyy.mm.dd.minor", "increment": "calendar""cycle": "day"
"format": "yyyy.0m.minor""cycle": "month"
"format": "yyyy.0m.0d.minor""cycle": "day"

Example upgrade

Before:

"@csmith/release-it-calver-plugin": {
    "format": "yyyy.mm.minor",
    "increment": "calendar",
    "fallbackIncrement": "minor"
}

After:

"@csmith/release-it-calver-plugin": {
    "cycle": "month"
}

More information on calendar versioning can be found here: calver

版本与发布记录

@csmith/release-it-calver-plugin 共发布 53 个版本,首次发布于 2020/08/06;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2026.9.0latest2026/09/221 个月前
2026.7.02026/07/283 个月前
2026.6.22026/06/304 个月前
2026.6.12026/06/194 个月前
2026.6.02026/06/045 个月前
2026.4.02026/04/256 个月前

关于 @csmith/release-it-calver-plugin 的常见问题

@csmith/release-it-calver-plugin 是什么?

Calender Versioning (calver) plugin for Release It!

如何安装 @csmith/release-it-calver-plugin?

在项目目录运行 npm install @csmith/release-it-calver-plugin,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:release-it(^21.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@csmith/release-it-calver-plugin 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/csmith__release-it-calver-plugin 是否存在。

@csmith/release-it-calver-plugin 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@csmith/release-it-calver-plugin 可以商用吗?

@csmith/release-it-calver-plugin 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@csmith/release-it-calver-plugin 的下载量有多少?

根据 npm 官方下载统计,@csmith/release-it-calver-plugin 在 2026/10/11 – 2026/11/09 这 30 天内被下载 16,174 次,日均约 539 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@csmith/release-it-calver-plugin 还在维护吗?

最新版本 2026.9.0 发布于 2026/09/22(1 个月前);至今共发布 53 个版本,其中过去 12 个月发布了 18 个;首次发布于 2020/08/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。