@anolilab/semantic-release-pnpm
Version:
Semantic-release plugin to publish a npm package with pnpm.
124 lines (117 loc) • 3.23 kB
TypeScript
import stream from 'node:stream';
interface BranchObject {
channel?: string | false | undefined;
name: string;
prerelease?: boolean | string | undefined;
range?: string | undefined;
}
type BranchSpec$1 = BranchObject | string;
type PluginSpec<T = any> = string | [string, T];
interface Options {
[name: string]: any;
branches?: BranchSpec$1 | ReadonlyArray<BranchSpec$1> | undefined;
ci?: boolean | undefined;
dryRun?: boolean | undefined;
extends?: ReadonlyArray<string> | string | undefined;
plugins?: ReadonlyArray<PluginSpec> | undefined;
repositoryUrl?: string | undefined;
tagFormat?: string | undefined;
}
interface Commit {
author: {
email: string;
name: string;
short: string;
};
body: string;
commit: {
long: string;
short: string;
};
committer: {
email: string;
name: string;
short: string;
};
committerDate: string;
hash: string;
message: string;
subject: string;
tree: {
long: string;
short: string;
};
}
interface CommonContext {
branch: BranchSpec;
branches: BranchSpec[];
cwd: string;
env: "object";
logger: {
error: (...message: string[]) => void;
log: (...message: string[]) => void;
success: (...message: string[]) => void;
};
options: Options;
stderr: stream.Writable;
stdout: stream.Writable;
}
type VerifyConditionsContext = CommonContext;
type CommonContext2 = CommonContext & {
releases: Release[];
};
type AddChannelContext = CommonContext2 & {
commits: Commit[];
currentRelease: Release;
lastRelease: Release;
nextRelease: Release;
};
type CommonContext3 = CommonContext2 & {
commits: Commit[];
lastRelease: Release;
};
type CommonContext4 = CommonContext3 & {
commits: Commit[];
nextRelease: Release;
};
type PrepareContext = CommonContext4;
type PublishContext = CommonContext4;
interface BranchSpec {
name: string;
tags?: Tag[];
}
interface Tag {
channel?: string;
gitHead?: string;
gitTag?: string;
version?: string;
}
interface Release {
channel?: string | null;
gitHead?: string;
gitTag?: string;
name?: string;
type?: "build" | "major" | "minor" | "patch" | "premajor" | "preminor" | "prepatch" | "prerelease" | undefined;
version: string;
}
interface PluginConfig {
branches?: (string | {
name: string;
prerelease: boolean;
})[];
disableScripts?: boolean;
npmPublish?: boolean;
pkgRoot?: string;
publishBranch?: string;
tarballDir?: string;
}
interface ReleaseInfo {
channel: string;
name: string;
url?: string;
}
declare const verifyConditions: (pluginConfig: PluginConfig, context: VerifyConditionsContext) => Promise<void>;
declare const prepare: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
declare const publish: (pluginConfig: PluginConfig, context: PublishContext) => Promise<ReleaseInfo | false>;
declare const addChannel: (pluginConfig: PluginConfig, context: AddChannelContext) => Promise<ReleaseInfo | false>;
export { addChannel, prepare, publish, verifyConditions };