duzun/verup 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

duzun/verup

最新稳定版本:v1.2.0

Composer 安装命令:

composer require duzun/verup

包简介

Increment and update version in all project files

README 文档

README

Increment and update version in all project files according to semver.

Note: This is a port to PHP of verup.js.

v1.2.0

Installation

composer require duzun/verup --dev

Usage

Basic Examples

# Increment revision (patch) version by 1 (1.2.3 -> 1.2.4)
composer exec verup 1

# Increment minor version by 1 (1.2.3 -> 1.3.0)
composer exec verup 1.0

# Increment major version by 1 (1.2.3 -> 2.0.0)
composer exec verup 1.0.0

Options

-n, --name <n>      Package name to bump (finds package in parent directories)
-p, --package <file> Package file to use (default: composer.json)
                     Supported: composer.json, package.json
-h, --help          Show help message

Examples with Options

If you have subprojects, and want to avoid confusion as of which project to patch, use -n <projectName> option:

# Update version in a specific package (search in parent folders)
composer exec verup -n my/pkg 1.0

This will look for package.json with name == 'my/pkg' in all parent folders, until it finds the right level, and patch the files at that level.

You can also use -p <file> option to specify a different package file:

# Use package.json instead of composer.json
composer exec verup -p package.json 1

In your composer.json (or package.json)

The minimum setup for your project is to add the list of file names that contain version string to composer.json at extra.verup.files. Here is a sample:

...
"extra": {
  "verup": {
    "files": [
      "manifest.json",
      "index.js",
      "README.MD" ...
    ]
  }
}
...

If the file is a .json, version is expected to be at key extra.verup.version or version.

You can define you own list of regular expressions in package.json at extra.verup.regs:

...
"extra": {
  "verup": {
    "regs": [
      "((?:\\$|(?:\\s*\\*?\\s*@)|(?:^\\s*(?:var|,)?\\s+))ver(?:sion)?[\\s\\:='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
      "^(\\s*\\$(?:_)?version[\\s='\"]+)([0-9]+(?:\\.[0-9]+){2,2})",
      "^(\\s?\\*.*v)([0-9]+(?:\\.[0-9]+){2,2})"
    ]
  }
}
...

Configuration Options

  • version: Current version of your package
  • files: List of files to update when version changes
  • regs: List of regular expressions to match version strings in files

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-04