@142vip/release-version
Version:
通用型版本迭代Cli工具,支持版本迭代更新,Git提交信息、打标记并推送到远程
63 lines (59 loc) • 2.21 kB
text/typescript
import { VipReleaseType } from '@142vip/utils';
import { ReleaseOperationOptions } from './enums/index.cjs';
import { V as VersionBumpResults, a as VersionBumpOptions, b as VersionProgressEventEnum, c as VersionHooksEnum } from './shared/release-version.BQ5ftkMF.cjs';
export { d as VersionBumpProgress } from './shared/release-version.BQ5ftkMF.cjs';
export { CONFIG_DEFAULT_NAME, bumpConfigDefaults, bumpDefaultConfig, defineBumpXConfig, getBumpDefaultConfig } from './utils/index.cjs';
interface OperationState {
release: VipReleaseType | undefined;
currentVersionSource: string;
currentVersion: string;
newVersion: string;
commitMessage: string;
tagName: string;
}
interface UpdateOperationState extends Partial<OperationState> {
event?: VersionProgressEventEnum;
script?: VersionHooksEnum;
}
/**
* All the inputs, outputs, and state of a single `versionBump()` call.
*/
declare class ReleaseOperation {
/**
* The options for this operation.
*/
options: ReleaseOperationOptions;
/**
* The current state of the operation.
*/
readonly state: Readonly<OperationState>;
/**
* Private constructor. Use the `Operation.start()` static method instead.
*/
private constructor();
/**
* The results of the operation.
*/
get results(): VersionBumpResults;
/**
* 开始一个全新的`versionBump()`操作
*/
static start(input: VersionBumpOptions): Promise<ReleaseOperation>;
/**
* 更新操作状态和结果,并将更新后的进度报告给上层
*/
update({ event, script, ...newState }: UpdateOperationState): this;
}
/**
* 版本发布
*/
declare function versionBump(options: VersionBumpOptions): Promise<VersionBumpResults | undefined>;
/**
* 试运行
*/
declare function versionBumpDryRun(options: VersionBumpOptions): Promise<ReleaseOperation>;
/**
* 升级版本号,获取操作的基本信息
*/
declare function versionBumpInfo(arg: VersionBumpOptions): Promise<ReleaseOperation>;
export { ReleaseOperationOptions, VersionBumpOptions, VersionBumpResults, VersionHooksEnum, VersionProgressEventEnum, versionBump, versionBumpDryRun, versionBumpInfo };