forked from release-it/release-it
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Typescript type for config (closes release-it#1052)
- Loading branch information
1 parent
9e99e2b
commit b1b8948
Showing
5 changed files
with
235 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
import { Hooks } from './hooks'; | ||
|
||
export interface Config { | ||
hooks?: Hooks; | ||
|
||
plugins?: Record<string, Record<string, any>>; | ||
|
||
git?: { | ||
/** @default "git log --pretty=format:\"* %s (%h)\" ${from}...${to}" */ | ||
changelog?: string; | ||
|
||
/** @default true */ | ||
requireCleanWorkingDir?: boolean; | ||
|
||
/** @default false */ | ||
requireBranch?: boolean; | ||
|
||
/** @default true */ | ||
requireUpstream?: boolean; | ||
|
||
/** @default false */ | ||
requireCommits?: boolean; | ||
|
||
/** @default true */ | ||
requireCommitsFail?: boolean; | ||
|
||
/** @default "" */ | ||
commitsPath?: string; | ||
|
||
/** @default false */ | ||
addUntrackedFiles?: boolean; | ||
|
||
/** @default true */ | ||
commit?: boolean; | ||
|
||
/** @default "Release ${version}" */ | ||
commitMessage?: string; | ||
|
||
commitArgs?: Array<any>; | ||
|
||
/** @default true */ | ||
tag?: boolean; | ||
|
||
/** @default null */ | ||
tagExclude?: any; | ||
|
||
/** @default null */ | ||
tagName?: any; | ||
|
||
/** @default null */ | ||
tagMatch?: any; | ||
|
||
/** @default false */ | ||
getLatestTagFromAllRefs?: boolean; | ||
|
||
/** @default "Release ${version}" */ | ||
tagAnnotation?: string; | ||
|
||
tagArgs?: Array<any>; | ||
|
||
/** @default true */ | ||
push?: boolean; | ||
|
||
/** @default ["--follow-tags"] */ | ||
pushArgs?: Array<string>; | ||
|
||
/** @default "" */ | ||
pushRepo?: string; | ||
}; | ||
|
||
npm?: { | ||
/** @default true */ | ||
publish?: boolean; | ||
|
||
/** @default "." */ | ||
publishPath?: string; | ||
|
||
publishArgs?: Array<any>; | ||
|
||
/** @default null */ | ||
tag?: any; | ||
|
||
/** @default null */ | ||
otp?: any; | ||
|
||
/** @default false */ | ||
ignoreVersion?: boolean; | ||
|
||
/** @default false */ | ||
allowSameVersion?: boolean; | ||
|
||
versionArgs?: Array<any>; | ||
|
||
/** @default false */ | ||
skipChecks?: boolean; | ||
|
||
/** @default 10 */ | ||
timeout?: number; | ||
}; | ||
|
||
github?: { | ||
/** @default false */ | ||
release?: boolean; | ||
|
||
/** @default "Release ${version}" */ | ||
releaseName?: string; | ||
|
||
/** @default null */ | ||
releaseNotes?: any; | ||
|
||
/** @default false */ | ||
autoGenerate?: boolean; | ||
|
||
/** @default false */ | ||
preRelease?: boolean; | ||
|
||
/** @default false */ | ||
draft?: boolean; | ||
|
||
/** @default "GITHUB_TOKEN" */ | ||
tokenRef?: string; | ||
|
||
/** @default null */ | ||
assets?: any; | ||
|
||
/** @default null */ | ||
host?: any; | ||
|
||
/** @default 0 */ | ||
timeout?: number; | ||
|
||
/** @default null */ | ||
proxy?: any; | ||
|
||
/** @default false */ | ||
skipChecks?: boolean; | ||
|
||
/** @default false */ | ||
web?: boolean; | ||
|
||
comments?: { | ||
/** @default false */ | ||
submit?: boolean; | ||
|
||
/** @default ":rocket?: _This issue has been resolved in v${version}. See [${releaseName}](${releaseUrl}) for release notes._" */ | ||
issue?: string; | ||
|
||
/** @default ":rocket?: _This pull request is included in v${version}. See [${releaseName}](${releaseUrl}) for release notes._" */ | ||
pr?: string; | ||
}; | ||
}; | ||
|
||
gitlab?: { | ||
/** @default false */ | ||
release?: boolean; | ||
|
||
/** @default "Release ${version}" */ | ||
releaseName?: string; | ||
|
||
/** @default null */ | ||
releaseNotes?: any; | ||
|
||
milestones?: Array<any>; | ||
|
||
/** @default "GITLAB_TOKEN" */ | ||
tokenRef?: string; | ||
|
||
/** @default "Private-Token" */ | ||
tokenHeader?: string; | ||
|
||
/** @default null */ | ||
certificateAuthorityFile?: any; | ||
|
||
/** @default null */ | ||
assets?: any; | ||
|
||
/** @default null */ | ||
origin?: any; | ||
|
||
/** @default false */ | ||
skipChecks?: boolean; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
export type HookPrefix = 'before' | 'after'; | ||
export type InternalPlugin = 'version' | 'git' | 'npm' | 'github' | 'gitlab'; | ||
export type HookName = 'init' | 'bump' | 'release'; | ||
|
||
export type Hooks = { | ||
['before:init']?: string | string[]; | ||
['before:bump']?: string | string[]; | ||
['before:release']?: string | string[]; | ||
['after:init']?: string | string[]; | ||
['after:bump']?: string | string[]; | ||
['after:release']?: string | string[]; | ||
|
||
['before:version:init']?: string | string[]; | ||
['before:version:bump']?: string | string[]; | ||
['before:version:release']?: string | string[]; | ||
['after:version:init']?: string | string[]; | ||
['after:version:bump']?: string | string[]; | ||
['after:version:release']?: string | string[]; | ||
|
||
['before:git:init']?: string | string[]; | ||
['before:git:bump']?: string | string[]; | ||
['before:git:release']?: string | string[]; | ||
['after:git:init']?: string | string[]; | ||
['after:git:bump']?: string | string[]; | ||
['after:git:release']?: string | string[]; | ||
|
||
['before:npm:init']?: string | string[]; | ||
['before:npm:bump']?: string | string[]; | ||
['before:npm:release']?: string | string[]; | ||
['after:npm:init']?: string | string[]; | ||
['after:npm:bump']?: string | string[]; | ||
['after:npm:release']?: string | string[]; | ||
|
||
['before:github:init']?: string | string[]; | ||
['before:github:bump']?: string | string[]; | ||
['before:github:release']?: string | string[]; | ||
['after:github:init']?: string | string[]; | ||
['after:github:bump']?: string | string[]; | ||
['after:github:release']?: string | string[]; | ||
|
||
['before:gitlab:init']?: string | string[]; | ||
['before:gitlab:bump']?: string | string[]; | ||
['before:gitlab:release']?: string | string[]; | ||
['after:gitlab:init']?: string | string[]; | ||
['after:gitlab:bump']?: string | string[]; | ||
['after:gitlab:release']?: string | string[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare module 'release-it'; | ||
|
||
export type { Config } from './config.d'; |