Comparing version 1.3.3-beta.1 to 1.3.3-beta.2
@@ -1,554 +0,2 @@ | ||
import * as _cz_git_inquirer from '@cz-git/inquirer'; | ||
declare const generateQuestions: (options: CommitizenGitOptions, cz: any) => false | ({ | ||
type: string; | ||
name: string; | ||
message: string | undefined; | ||
themeColorCode: string | undefined; | ||
source: (_: unknown, input: string) => _cz_git_inquirer.FilterArrayItemType[]; | ||
separator?: undefined; | ||
validate?: undefined; | ||
when?: undefined; | ||
default?: undefined; | ||
transformer?: undefined; | ||
filter?: undefined; | ||
choices?: undefined; | ||
} | { | ||
type: string; | ||
name: string; | ||
message: string | string[] | undefined; | ||
themeColorCode: string | undefined; | ||
separator: string | undefined; | ||
source: (answer: Answers, input: string) => _cz_git_inquirer.FilterArrayItemType[]; | ||
validate: (input: string | Array<string>) => string | true; | ||
when: (answer: Answers) => boolean; | ||
default?: undefined; | ||
transformer?: undefined; | ||
filter?: undefined; | ||
choices?: undefined; | ||
} | { | ||
type: string; | ||
name: string; | ||
message: string | undefined; | ||
default: string | undefined; | ||
validate: (input: string | Array<string>) => string | true; | ||
when: (answers: Answers) => boolean; | ||
transformer: (input: string) => string; | ||
themeColorCode?: undefined; | ||
source?: undefined; | ||
separator?: undefined; | ||
filter?: undefined; | ||
choices?: undefined; | ||
} | { | ||
type: string; | ||
name: string; | ||
message: string | undefined; | ||
validate: (subject: string, answers: Answers) => string | boolean; | ||
transformer: (subject: string, answers: Answers) => string; | ||
filter: (subject: string) => string; | ||
default: string | undefined; | ||
themeColorCode?: undefined; | ||
source?: undefined; | ||
separator?: undefined; | ||
when?: undefined; | ||
choices?: undefined; | ||
} | { | ||
type: string; | ||
name: string; | ||
message: string | undefined; | ||
default: string | undefined; | ||
transformer: (input: string) => string; | ||
themeColorCode?: undefined; | ||
source?: undefined; | ||
separator?: undefined; | ||
validate?: undefined; | ||
when?: undefined; | ||
filter?: undefined; | ||
choices?: undefined; | ||
} | { | ||
type: string; | ||
name: string; | ||
message: string | undefined; | ||
default: string | undefined; | ||
when: (answers: Answers) => boolean; | ||
transformer: (input: string) => string; | ||
themeColorCode?: undefined; | ||
source?: undefined; | ||
separator?: undefined; | ||
validate?: undefined; | ||
filter?: undefined; | ||
choices?: undefined; | ||
} | { | ||
type: string; | ||
name: string; | ||
message: string | undefined; | ||
themeColorCode: string | undefined; | ||
source: (_: Answers, input: string) => _cz_git_inquirer.FilterArrayItemType[]; | ||
when: () => boolean; | ||
separator?: undefined; | ||
validate?: undefined; | ||
default?: undefined; | ||
transformer?: undefined; | ||
filter?: undefined; | ||
choices?: undefined; | ||
} | { | ||
type: string; | ||
name: string; | ||
choices: { | ||
key: string; | ||
name: string; | ||
value: string; | ||
}[]; | ||
default: number; | ||
message(answers: Answers): string | undefined; | ||
themeColorCode?: undefined; | ||
source?: undefined; | ||
separator?: undefined; | ||
validate?: undefined; | ||
when?: undefined; | ||
transformer?: undefined; | ||
filter?: undefined; | ||
})[]; | ||
declare type GenerateQuestionsType = typeof generateQuestions; | ||
declare type QuestionsType = ReturnType<GenerateQuestionsType>; | ||
/** | ||
* @description: fork by "@commitlint/types" v16.2.1 | ||
*/ | ||
/** ========== rules ========== */ | ||
/** | ||
* Rules match the input either as successful or failed. | ||
* For example, when `header-full-stop` detects a full stop and is set as "always"; it's true. | ||
* If the `header-full-stop` discovers a full stop but is set to "never"; it's false. | ||
*/ | ||
declare type RuleOutcome = Readonly<[boolean, string?]>; | ||
/** | ||
* Rules receive a parsed commit, condition, and possible additional settings through value. | ||
* All rules should provide the most sensible rule condition and value. | ||
*/ | ||
declare type RuleType = "async" | "sync" | "either"; | ||
declare type BaseRule<Value = never, Type extends RuleType = "either"> = (parsed: Commit, when?: RuleConfigCondition, value?: Value) => Type extends "either" ? RuleOutcome | Promise<RuleOutcome> : Type extends "async" ? Promise<RuleOutcome> : Type extends "sync" ? RuleOutcome : never; | ||
declare type Rule<Value = never> = BaseRule<Value, "either">; | ||
declare type AsyncRule<Value = never> = BaseRule<Value, "async">; | ||
declare type SyncRule<Value = never> = BaseRule<Value, "sync">; | ||
/** | ||
* Rules always have a severity. | ||
* Severity indicates what to do if the rule is found to be broken | ||
* 0 - Disable this rule | ||
* 1 - Warn for violations | ||
* 2 - Error for violations | ||
*/ | ||
declare enum RuleConfigSeverity { | ||
Disabled = 0, | ||
Warning = 1, | ||
Error = 2 | ||
} | ||
/** | ||
* Rules always have a condition. | ||
* It can be either "always" (as tested), or "never" (as tested). | ||
* For example, `header-full-stop` can be enforced as "always" or "never". | ||
*/ | ||
declare type RuleConfigCondition = "always" | "never"; | ||
declare type RuleConfigTuple<T> = T extends void ? Readonly<[RuleConfigSeverity.Disabled]> | Readonly<[RuleConfigSeverity, RuleConfigCondition]> : Readonly<[RuleConfigSeverity.Disabled]> | Readonly<[RuleConfigSeverity, RuleConfigCondition, T]>; | ||
declare enum RuleConfigQuality { | ||
User = 0, | ||
Qualified = 1 | ||
} | ||
declare type QualifiedRuleConfig<T> = (() => RuleConfigTuple<T>) | (() => Promise<RuleConfigTuple<T>>) | RuleConfigTuple<T>; | ||
declare type RuleConfig<V = RuleConfigQuality.Qualified, T = void> = V extends RuleConfigQuality.Qualified ? RuleConfigTuple<T> : QualifiedRuleConfig<T>; | ||
declare type CaseRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, TargetCaseType | TargetCaseType[]>; | ||
declare type LengthRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, number>; | ||
declare type EnumRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, string[]>; | ||
declare type RulesConfig<V = RuleConfigQuality.User> = { | ||
"body-case": CaseRuleConfig<V>; | ||
"body-empty": RuleConfig<V>; | ||
"body-full-stop": RuleConfig<V, string>; | ||
"body-leading-blank": RuleConfig<V>; | ||
"body-max-length": LengthRuleConfig<V>; | ||
"body-max-line-length": LengthRuleConfig<V>; | ||
"body-min-length": LengthRuleConfig<V>; | ||
"footer-empty": RuleConfig<V>; | ||
"footer-leading-blank": RuleConfig<V>; | ||
"footer-max-length": LengthRuleConfig<V>; | ||
"footer-max-line-length": LengthRuleConfig<V>; | ||
"footer-min-length": LengthRuleConfig<V>; | ||
"header-case": CaseRuleConfig<V>; | ||
"header-full-stop": RuleConfig<V, string>; | ||
"header-max-length": LengthRuleConfig<V>; | ||
"header-min-length": LengthRuleConfig<V>; | ||
"references-empty": RuleConfig<V>; | ||
"scope-case": CaseRuleConfig<V>; | ||
"scope-empty": RuleConfig<V>; | ||
"scope-enum": EnumRuleConfig<V>; | ||
"scope-max-length": LengthRuleConfig<V>; | ||
"scope-min-length": LengthRuleConfig<V>; | ||
"signed-off-by": RuleConfig<V, string>; | ||
"subject-case": CaseRuleConfig<V>; | ||
"subject-empty": RuleConfig<V>; | ||
"subject-full-stop": RuleConfig<V, string>; | ||
"subject-max-length": LengthRuleConfig<V>; | ||
"subject-min-length": LengthRuleConfig<V>; | ||
"trailer-exists": RuleConfig<V, string>; | ||
"type-case": CaseRuleConfig<V>; | ||
"type-empty": RuleConfig<V>; | ||
"type-enum": EnumRuleConfig<V>; | ||
"type-max-length": LengthRuleConfig<V>; | ||
"type-min-length": LengthRuleConfig<V>; | ||
[key: string]: AnyRuleConfig<V>; | ||
}; | ||
declare type AnyRuleConfig<V> = RuleConfig<V, unknown> | RuleConfig<V, void>; | ||
/** ========== load ========== */ | ||
declare type PluginRecords = Record<string, Plugin>; | ||
interface Plugin { | ||
rules: { | ||
[ruleName: string]: Rule | AsyncRule | SyncRule; | ||
}; | ||
} | ||
interface LoadOptions { | ||
cwd?: string; | ||
file?: string; | ||
} | ||
interface CommitlintUserConfig { | ||
extends?: string | string[]; | ||
formatter?: string; | ||
rules?: Partial<RulesConfig>; | ||
parserPreset?: string | ParserPreset | Promise<ParserPreset>; | ||
ignores?: ((commit: string) => boolean)[]; | ||
defaultIgnores?: boolean; | ||
plugins?: (string | Plugin)[]; | ||
helpUrl?: string; | ||
[key: string]: unknown; | ||
} | ||
declare type QualifiedRules = Partial<RulesConfig<RuleConfigQuality.Qualified>>; | ||
interface QualifiedConfig { | ||
extends: string[]; | ||
formatter: string; | ||
rules: QualifiedRules; | ||
parserPreset?: ParserPreset; | ||
ignores?: ((commit: string) => boolean)[]; | ||
defaultIgnores?: boolean; | ||
plugins: PluginRecords; | ||
helpUrl: string; | ||
} | ||
interface ParserPreset { | ||
name?: string; | ||
path?: string; | ||
parserOpts?: unknown; | ||
} | ||
/** ========== parse ========== */ | ||
interface Commit { | ||
raw: string; | ||
header: string; | ||
type: string | null; | ||
scope: string | null; | ||
subject: string | null; | ||
body: string | null; | ||
footer: string | null; | ||
mentions: string[]; | ||
notes: CommitNote[]; | ||
references: CommitReference[]; | ||
revert: any; | ||
merge: any; | ||
} | ||
interface CommitNote { | ||
title: string; | ||
text: string; | ||
} | ||
interface CommitReference { | ||
raw: string; | ||
prefix: string; | ||
action: string | null; | ||
owner: string | null; | ||
repository: string | null; | ||
issue: string | null; | ||
} | ||
/** ========== ensure ========== */ | ||
declare type TargetCaseType = "camel-case" | "kebab-case" | "snake-case" | "pascal-case" | "start-case" | "upper-case" | "uppercase" | "sentence-case" | "sentencecase" | "lower-case" | "lowercase" | "lowerCase"; | ||
/** | ||
* @description: cz-git types | ||
* @author: @Zhengqbbb (zhengqbbb@gmail.com) | ||
* @license: MIT | ||
* @copyright: Copyright (c) 2022-present Qiubin Zheng | ||
*/ | ||
interface UserConfig extends CommitlintUserConfig { | ||
prompt?: CommitizenGitOptions; | ||
} | ||
declare type Config = Omit<Partial<typeof defaultConfig>, "scopes"> & { | ||
scopes: ScopesType; | ||
disableScopeLowerCase?: boolean; | ||
disableSubjectLowerCase?: boolean; | ||
maxHeaderLength?: number; | ||
maxSubjectLength?: number; | ||
minSubjectLength?: number; | ||
defaultScope?: string; | ||
defaultSubject?: string; | ||
defaultBody?: string; | ||
defaultFooterPrefix?: string; | ||
defaultIssues?: string; | ||
}; | ||
declare type Answers = { | ||
/** | ||
* @default: Select the type of change that you're committing: | ||
*/ | ||
type?: string; | ||
/** | ||
* @default: Denote the SCOPE of this change (optional): | ||
*/ | ||
scope?: string | string[]; | ||
/** | ||
* @default: Denote the SCOPE of this change: | ||
*/ | ||
customScope?: string; | ||
/** | ||
* @default: Write a SHORT, IMPERATIVE tense description of the change:\n | ||
*/ | ||
subject?: string; | ||
/** | ||
* @default:Provide a LONGER description of the change (optional). Use "|" to break new line:\n | ||
*/ | ||
body?: string; | ||
/** | ||
* @default: List any BREAKING CHANGES (optional). Use "|" to break new line:\n | ||
*/ | ||
breaking?: string; | ||
/** | ||
* @default: Select the ISSUES type of change (optional): | ||
*/ | ||
footerPrefixsSelect?: string; | ||
footerPrefix?: string; | ||
/** | ||
* @default: Input ISSUES prefix: | ||
*/ | ||
customFooterPrefixs?: string; | ||
/** | ||
* @default: List any ISSUES AFFECTED by this change. E.g.: #31, #34: | ||
*/ | ||
footer?: string; | ||
/** | ||
* @default: Are you sure you want to proceed with the commit above? | ||
*/ | ||
confirmCommit?: string; | ||
}; | ||
declare type ScopesType = string[] | Array<{ | ||
name: string; | ||
value?: string; | ||
}>; | ||
interface CommitizenType { | ||
registerPrompt: (type: string, plugin: unknown) => void; | ||
prompt: (qs: QuestionsType) => Promise<Answers>; | ||
} | ||
interface Option { | ||
/** | ||
* @description: show prompt name | ||
*/ | ||
name: string; | ||
/** | ||
* @description: output real value | ||
*/ | ||
value: string; | ||
} | ||
interface TypesOption extends Option { | ||
/** | ||
* @description: Submit emoji commit string | ||
* @see: https://gitmoji.dev/ | ||
* @example: ":bug:" => 🐛 | ||
*/ | ||
emoji?: string; | ||
} | ||
interface CommitizenGitOptions { | ||
/** | ||
* @description: Customize prompt questions | ||
*/ | ||
messages?: Answers; | ||
/** | ||
* @description: the prompt inquirer primary color | ||
* @rule `38;5;${color_code}` | ||
* @tip the color_code can get by https://github.com/sindresorhus/xterm-colors | ||
* @example "38;5;043" | ||
* @default: "" = cyan color | ||
*/ | ||
themeColorCode?: string; | ||
/** | ||
* @description: Customize prompt type | ||
*/ | ||
types?: TypesOption[]; | ||
/** | ||
* @description: Add extra types to default types | ||
* @use Use when you don't want to add bloated defaults and don't want to adjust the default order in configuration | ||
* @example `typesAppend: [ { value: "workflow", name: "workflow: Workflow changes"} ],` | ||
* @default: [] | ||
*/ | ||
typesAppend?: TypesOption[]; | ||
/** | ||
* @description: Use emoji ?| it will be use typesOption.emoji code | ||
* @default: false | ||
*/ | ||
useEmoji?: boolean; | ||
/** | ||
* @description: Provides a select of prompt to select module scopes | ||
* @note it auto import value from rule "scope-enum" with `@commitlint` | ||
* @use want to add scopes description or when you not use commitlint | ||
*/ | ||
scopes?: ScopesType; | ||
/** | ||
* @description: Provides an overriding select of prompt to select module scopes under specific typs | ||
* @note use this option should set `scopes` option to realize distinguish | ||
* @example: [test] => provide select e2eTest unitTest | ||
*/ | ||
scopeOverrides?: { | ||
[type: string]: ScopesType; | ||
}; | ||
/** | ||
* @description: Filter select of prompt to select module scopes by the scope.value | ||
* @default: ['.DS_Store'] | ||
*/ | ||
scopeFilters?: string[]; | ||
/** | ||
* @description: Whether to enable scope multiple mode | ||
* @default: false | ||
*/ | ||
enableMultipleScopes?: boolean; | ||
/** | ||
* @description: Multiple choice scope separator | ||
* @default: "," | ||
*/ | ||
scopeEnumSeparator?: string; | ||
/** | ||
* @description: Whether to show "custom" when selecting scopes | ||
* @note it auto check rule "scope-enum" set the option with `@commitlint` | ||
* @use when you not use commitlint | ||
* @default true | ||
*/ | ||
allowCustomScopes?: boolean; | ||
/** | ||
* @description: Whether to show "empty" when selecting scopes | ||
* @default true | ||
*/ | ||
allowEmptyScopes?: boolean; | ||
/** | ||
* @default: "bottom" | ||
*/ | ||
customScopesAlign?: "top" | "bottom" | "top-bottom" | "bottom-top"; | ||
/** | ||
* @default: "custom" | ||
*/ | ||
customScopesAlias?: string; | ||
/** | ||
* @default: "empty" | ||
*/ | ||
emptyScopesAlias?: string; | ||
/** | ||
* @description: Subject is need upper case first. | ||
* @default false | ||
*/ | ||
upperCaseSubject?: boolean; | ||
/** | ||
* @description: Allow breaking changes in the included types output box | ||
* @default: ['feat', 'fix'] | ||
*/ | ||
allowBreakingChanges?: string[]; | ||
/** | ||
* @description: set body and BREAKING CHANGE max length to breakline | ||
* @default: 100 | ||
* @note it auto check rule "body-max-line-length" set the option with `@commitlint`. | ||
* @use when you not use commitlint | ||
*/ | ||
breaklineNumber?: number; | ||
/** | ||
* @description: body and BREAKINGCHANGES new line char | ||
* @default: "|" | ||
*/ | ||
breaklineChar?: string; | ||
/** | ||
* @description: Provides a select issue prefix box in footer | ||
* @default: issuePrefixs: [{ value: "closed", name: "ISSUES has been processed" }] | ||
*/ | ||
issuePrefixs?: Option[]; | ||
/** | ||
* @default: "top" | ||
*/ | ||
customIssuePrefixsAlign?: "top" | "bottom" | "top-bottom" | "bottom-top"; | ||
/** | ||
* @default: "skip" | ||
*/ | ||
emptyIssuePrefixsAlias?: string; | ||
/** | ||
* @default: "custom" | ||
*/ | ||
customIssuePrefixsAlias?: string; | ||
/** | ||
* @description: Whether to show "custom" selecting issue prefixs | ||
* @default true | ||
*/ | ||
allowCustomIssuePrefixs?: boolean; | ||
/** | ||
* @description: Whether to show "skip(empty)" when selecting issue prefixs | ||
* @default true | ||
*/ | ||
allowEmptyIssuePrefixs?: boolean; | ||
/** | ||
* @description: Prompt final determination whether to display the color | ||
* @default: true | ||
*/ | ||
confirmColorize?: boolean; | ||
/** | ||
* @description: List of questions you want to skip | ||
* @default: [] | ||
* @example: ['body'] | ||
*/ | ||
skipQuestions?: Array<"scope" | "body" | "breaking" | "footerPrefix" | "footer">; | ||
/** | ||
* @description: Force set max header length | Equivalent setting maxSubjectLength. | ||
* @note it auto check rule "header-max-length" set the option with `@commitlint`. | ||
* @use when you not use commitlint | ||
*/ | ||
maxHeaderLength?: number; | ||
/** | ||
* @description: Force set max subject length. | ||
* @note it auto check rule "subject-max-length" set the option with `@commitlint`. | ||
* @use when you not use commitlint | ||
*/ | ||
maxSubjectLength?: number; | ||
/** | ||
* @description: Force set header width. | ||
* @note it auto check rule "subject-min-length" set the option with `@commitlint`. | ||
* @use when you not use commitlint | ||
*/ | ||
minSubjectLength?: number; | ||
/** | ||
* @description: pin type item the top of the types list (match item value) | ||
*/ | ||
defaultType?: string; | ||
/** | ||
* @description: Whether to use display default value in custom scope | ||
* @tip pin scope item the top of the scope list (match item value) | ||
* @example: When you want to use default, just keybord <Enter> it | ||
*/ | ||
defaultScope?: string; | ||
/** | ||
* @description: default value show subject prompt | ||
* @example: When you want to use default, just keybord <Enter> it | ||
*/ | ||
defaultSubject?: string; | ||
/** | ||
* @description: default value show body and BREAKINGCHANGES prompt | ||
* @example: When you want to use default, just keybord <Enter> it | ||
*/ | ||
defaultBody?: string; | ||
/** | ||
* @description: default value show issuePrefixs custom prompt | ||
* @example: When you want to use default, just keybord <Enter> it | ||
*/ | ||
defaultFooterPrefix?: string; | ||
/** | ||
* @description: default value show issue foot prompt | ||
* @example: When you want to use default, just keybord <Enter> it | ||
*/ | ||
defaultIssues?: string; | ||
} | ||
declare const defaultConfig: Readonly<CommitizenGitOptions>; | ||
/** | ||
* @description: customizable and git support commitizen adapter | ||
@@ -560,5 +8,4 @@ * @author: @Zhengqbbb (zhengqbbb@gmail.com) | ||
*/ | ||
declare const prompter: (cz: CommitizenType, commit: (message: string) => void) => void; | ||
export { Answers, AnyRuleConfig, AsyncRule, BaseRule, CaseRuleConfig, Commit, CommitNote, CommitReference, CommitizenGitOptions, CommitizenType, CommitlintUserConfig, Config, EnumRuleConfig, LengthRuleConfig, LoadOptions, Option, ParserPreset, Plugin, PluginRecords, QualifiedConfig, QualifiedRuleConfig, QualifiedRules, Rule, RuleConfig, RuleConfigCondition, RuleConfigQuality, RuleConfigSeverity, RuleConfigTuple, RuleOutcome, RuleType, RulesConfig, ScopesType, SyncRule, TargetCaseType, TypesOption, UserConfig, defaultConfig, prompter }; | ||
import type { CommitizenType } from "./shared"; | ||
export * from "./shared/types"; | ||
export declare const prompter: (cz: CommitizenType, commit: (message: string) => void) => void; |
{ | ||
"name": "cz-git", | ||
"version": "1.3.3-beta.1", | ||
"version": "1.3.3-beta.2", | ||
"description": "A better customizable and git support commitizen adapter", | ||
@@ -32,4 +32,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@cz-git/inquirer": "1.3.3-beta.1", | ||
"@cz-git/loader": "1.3.3-beta.1", | ||
"@cz-git/inquirer": "1.3.3-beta.2", | ||
"@cz-git/loader": "1.3.3-beta.2", | ||
"rimraf": "3.0.2" | ||
@@ -36,0 +36,0 @@ }, |
@@ -61,4 +61,4 @@ <p align="center"> | ||
$ npm install -D cz-git | ||
+ cz-git (1.8 MB) | ||
added 1 package in 0.47s | ||
+ cz-git (1.7 MB) | ||
added 1 package in 0.461s | ||
``` | ||
@@ -93,2 +93,3 @@ | ||
- [vue3-antd-admin](https://github.com/buqiyuan/vue3-antd-admin) | ||
- [Geeker-Admin](https://github.com/HalseySpicy/Geeker-Admin) | ||
- [vuepress-theme-hope](https://github.com/vuepress-theme-hope/vuepress-theme-hope) | ||
@@ -95,0 +96,0 @@ - [vuepress-theme-gungnir](https://github.com/Renovamen/vuepress-theme-gungnir) |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
12
102
40117
485
1
1