done-coding-git 0.6.1-alpha.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/cli.mjs +2 -2
- package/es/helpers.mjs +1 -1
- package/es/{index-57341be9.js → index-0ee2e0d9.js} +1 -1
- package/es/{index-be60e089.js → index-5b3d8814.js} +1 -1
- package/es/index.mjs +2 -2
- package/package.json +4 -4
- package/types/cli.d.ts +1 -2
- package/types/helpers.d.ts +4 -1
- package/types/index.d.ts +142 -4
- package/types/api/_request.d.ts +0 -5
- package/types/api/gitee.d.ts +0 -21
- package/types/api/github.d.ts +0 -21
- package/types/config/index.d.ts +0 -3
- package/types/handlers/check.d.ts +0 -51
- package/types/handlers/clone.d.ts +0 -8
- package/types/handlers/hooks.d.ts +0 -7
- package/types/handlers/index.d.ts +0 -9
- package/types/handlers/init.d.ts +0 -19
- package/types/helpers-assets/done-coding.d.ts +0 -2
- package/types/injectInfo.json.d.ts +0 -11
- package/types/main.d.ts +0 -9
- package/types/types/check.d.ts +0 -40
- package/types/types/clone.d.ts +0 -23
- package/types/types/hooks.d.ts +0 -5
- package/types/types/index.d.ts +0 -5
- package/types/types/init.d.ts +0 -10
- package/types/types/subcommand.d.ts +0 -13
- package/types/utils/check.d.ts +0 -20
- package/types/utils/config.d.ts +0 -14
- package/types/utils/get-repo.d.ts +0 -3
- package/types/utils/hooks.d.ts +0 -7
- package/types/utils/index.d.ts +0 -6
- package/types/utils/path.d.ts +0 -4
- package/types/utils/question.d.ts +0 -8
package/es/cli.mjs
CHANGED
package/es/helpers.mjs
CHANGED
package/es/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { o as t, C as l, G as d, I as c, S as C, m as p, l as f, f as h, h as u, c as k, b as I, n as E, k as b, j as H, e as g, d as y } from "./index-
|
|
3
|
-
import { a as T } from "./index-
|
|
2
|
+
import { o as t, C as l, G as d, I as c, S as C, m as p, l as f, f as h, h as u, c as k, b as I, n as E, k as b, j as H, e as g, d as y } from "./index-5b3d8814.js";
|
|
3
|
+
import { a as T } from "./index-0ee2e0d9.js";
|
|
4
4
|
import "@done-coding/cli-utils";
|
|
5
5
|
import "node:child_process";
|
|
6
6
|
import "node:fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "done-coding-git",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "git跨平台操作命令行工具",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@done-coding/cli-inject": "^0.5.
|
|
44
|
+
"@done-coding/cli-inject": "^0.5.10",
|
|
45
45
|
"@types/node": "^18.0.0",
|
|
46
46
|
"@types/yargs": "^17.0.28",
|
|
47
47
|
"rimraf": "^6.0.1",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"node": ">=18.0.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@done-coding/cli-utils": "^0.7.
|
|
56
|
+
"@done-coding/cli-utils": "^0.7.1",
|
|
57
57
|
"@done-coding/request-axios": "^1.1.1",
|
|
58
58
|
"axios": "^1.8.4"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "299ab3991d6842c83d65816dfba6efd175aa885a",
|
|
61
61
|
"scripts": {}
|
|
62
62
|
}
|
package/types/cli.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {};
|
|
1
|
+
export { }
|
package/types/helpers.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { ArgumentsCamelCase } from '@done-coding/cli-utils';
|
|
2
|
+
import type { ArgumentsCamelCase as ArgumentsCamelCase_2 } from 'yargs';
|
|
3
|
+
import { CliHandlerArgv } from '@done-coding/cli-utils';
|
|
4
|
+
import { CliInfo } from '@done-coding/cli-utils';
|
|
5
|
+
import { CommandModule } from 'yargs';
|
|
6
|
+
import { HooksNameEnum } from '@done-coding/cli-utils';
|
|
7
|
+
import type { InitConfigFileOptions } from '@done-coding/cli-utils';
|
|
8
|
+
import { ReadConfigFileOptions } from '@done-coding/cli-utils';
|
|
9
|
+
import type { SubCliInfo } from '@done-coding/cli-utils';
|
|
10
|
+
|
|
11
|
+
export declare const checkCommandCliInfo: SubCliInfo;
|
|
12
|
+
|
|
13
|
+
/** 检测 */
|
|
14
|
+
export declare const checkHandler: (argv: ArgumentsCamelCase<CheckOptions>) => Promise<void>;
|
|
15
|
+
|
|
16
|
+
/** 检测反向 */
|
|
17
|
+
export declare type CheckOptions = ReadConfigFileOptions & {
|
|
18
|
+
type: CheckTypeEnum;
|
|
19
|
+
args: string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** 检测反向方式枚举 */
|
|
23
|
+
export declare enum CheckReverseMergeWayEnum {
|
|
24
|
+
/** GIT_REFLOG_ACTION */
|
|
25
|
+
REFLOG_ACTION = "reflog-action",
|
|
26
|
+
/** 提交信息 */
|
|
27
|
+
COMMIT_MSG = "commit-msg",
|
|
28
|
+
/** 提交记录 */
|
|
29
|
+
COMMIT_RECORD = "commit-record",
|
|
30
|
+
/** 变基线 */
|
|
31
|
+
PRE_REBASE = "pre-rebase"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 检测类型 */
|
|
35
|
+
export declare enum CheckTypeEnum {
|
|
36
|
+
/** 反向提交 */
|
|
37
|
+
REVERSE_MERGE = "reverseMerge"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare const cloneCommandCliInfo: SubCliInfo;
|
|
41
|
+
|
|
42
|
+
/** 克隆目标仓库 */
|
|
43
|
+
export declare const cloneHandler: (options: CliHandlerArgv<CloneOptions>) => Promise<void>;
|
|
44
|
+
|
|
45
|
+
/** 可控选项 */
|
|
46
|
+
export declare type CloneOptions = GitParamsInfo;
|
|
47
|
+
|
|
48
|
+
export declare const commandCliInfo: Omit<CliInfo, "usage">;
|
|
49
|
+
|
|
50
|
+
/** 作为子命令创建 */
|
|
51
|
+
export declare const crateAsSubcommand: () => CommandModule<{}, {}>;
|
|
52
|
+
|
|
53
|
+
/** 获取目标仓库地址 */
|
|
54
|
+
export declare const getTargetRepoUrl: ({ platform: platformInit, username: usernameInit, }?: Partial<GitParamsInfo>) => Promise<any>;
|
|
55
|
+
|
|
56
|
+
/** 螃蟹git配置 */
|
|
57
|
+
export declare interface GitConfig {
|
|
58
|
+
[SubcommandEnum.CHECK]: {
|
|
59
|
+
[CheckTypeEnum.REVERSE_MERGE]: Record<string, GitConfigCheckReverseMergeBranchConfig>;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 禁止合并某个分支的检测选项
|
|
65
|
+
*/
|
|
66
|
+
export declare interface GitConfigCheckReverseMergeBranchConfig {
|
|
67
|
+
/** 包括变基操作 */
|
|
68
|
+
includeRebase: boolean;
|
|
69
|
+
/** 某个hash之后的提交 */
|
|
70
|
+
afterHash?: string;
|
|
71
|
+
/** 最多(检查日志数量) */
|
|
72
|
+
logCount: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Git 配置信息 */
|
|
76
|
+
export declare interface GitConfigInfo {
|
|
77
|
+
/** token */
|
|
78
|
+
accessToken: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** git参数信息 */
|
|
82
|
+
export declare interface GitParamsInfo {
|
|
83
|
+
/** 平台 */
|
|
84
|
+
platform: GitPlatformEnum;
|
|
85
|
+
/** 用户名 */
|
|
86
|
+
username: string;
|
|
87
|
+
/** 项目名称 */
|
|
88
|
+
projectName?: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Git 平台枚举 */
|
|
92
|
+
export declare enum GitPlatformEnum {
|
|
93
|
+
/** GitHub */
|
|
94
|
+
GITHUB = "github",
|
|
95
|
+
/** Gitee */
|
|
96
|
+
GITEE = "gitee"
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any>) => Promise<void>;
|
|
100
|
+
|
|
101
|
+
export declare const hooksCommandCliInfo: SubCliInfo;
|
|
102
|
+
|
|
103
|
+
export declare const hooksHandler: (argv: ArgumentsCamelCase_2<HooksOptions>) => Promise<void>;
|
|
104
|
+
|
|
105
|
+
/** hooks选项 */
|
|
106
|
+
export declare type HooksOptions = ReadConfigFileOptions & {
|
|
107
|
+
name: HooksNameEnum;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export declare const initCommandCliInfo: SubCliInfo;
|
|
111
|
+
|
|
112
|
+
export declare const initHandler: (argv: ArgumentsCamelCase<InitOptions> & {
|
|
113
|
+
/** 是否是子命令 */
|
|
114
|
+
isSubCommand?: boolean;
|
|
115
|
+
}) => Promise<void>;
|
|
116
|
+
|
|
117
|
+
/** 初始化选项 */
|
|
118
|
+
export declare interface InitOptions extends InitConfigFileOptions {
|
|
119
|
+
type?: InitTypeEnum;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** 初始化类型 */
|
|
123
|
+
export declare enum InitTypeEnum {
|
|
124
|
+
DEFAULT = "default",
|
|
125
|
+
CLONE_CONFIG = "cloneConfig"
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** 子命令枚举 */
|
|
129
|
+
export declare enum SubcommandEnum {
|
|
130
|
+
/** 初始化配置文件 */
|
|
131
|
+
INIT = "init",
|
|
132
|
+
/** 克隆 */
|
|
133
|
+
CLONE = "clone",
|
|
134
|
+
/** hooks调用 */
|
|
135
|
+
HOOKS = "hooks",
|
|
136
|
+
/**
|
|
137
|
+
* 检测
|
|
138
|
+
*/
|
|
139
|
+
CHECK = "check"
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export { }
|
package/types/api/_request.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** gitee 请求 */
|
|
2
|
-
declare const giteeRequest: <D>(apiConfig: import("@done-coding/request-axios").ApiConfig<import("axios").AxiosRequestConfig<any>>, debug?: boolean | undefined) => Promise<import("@done-coding/request-axios").RequestResult<D>>;
|
|
3
|
-
/** github 请求 */
|
|
4
|
-
declare const githubRequest: <D>(apiConfig: import("@done-coding/request-axios").ApiConfig<import("axios").AxiosRequestConfig<any>>, debug?: boolean | undefined) => Promise<import("@done-coding/request-axios").RequestResult<D>>;
|
|
5
|
-
export { giteeRequest, githubRequest };
|
package/types/api/gitee.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** 获取 gitee 仓库信息 */
|
|
2
|
-
export interface GiteeRepoInfo {
|
|
3
|
-
/** 仓库名 */
|
|
4
|
-
name: string;
|
|
5
|
-
/** ssh */
|
|
6
|
-
ssh_url: string;
|
|
7
|
-
/** https */
|
|
8
|
-
html_url: string;
|
|
9
|
-
/** 描述 */
|
|
10
|
-
description?: string | null;
|
|
11
|
-
}
|
|
12
|
-
/** 获取 gitee 用户公开的仓库列表 */
|
|
13
|
-
export declare const getGiteeUserPublicRepos: ({ username, }: {
|
|
14
|
-
username: string;
|
|
15
|
-
accessToken?: string | undefined;
|
|
16
|
-
}) => Promise<import("@done-coding/request-axios").RequestResult<GiteeRepoInfo[]>>;
|
|
17
|
-
/** 获取 gitee 用户的所有仓库列表 */
|
|
18
|
-
export declare const getGiteeUserAllRepos: ({ accessToken, }: {
|
|
19
|
-
username: string;
|
|
20
|
-
accessToken?: string | undefined;
|
|
21
|
-
}) => Promise<import("@done-coding/request-axios").RequestResult<GiteeRepoInfo[]>>;
|
package/types/api/github.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** 获取 github 仓库信息 */
|
|
2
|
-
export interface GithubRepoInfo {
|
|
3
|
-
/** 仓库名 */
|
|
4
|
-
name: string;
|
|
5
|
-
/** ssh */
|
|
6
|
-
ssh_url: string;
|
|
7
|
-
/** https */
|
|
8
|
-
clone_url: string;
|
|
9
|
-
/** 描述 */
|
|
10
|
-
description?: string | null;
|
|
11
|
-
}
|
|
12
|
-
/** 获取 github 用户公开仓库列表 */
|
|
13
|
-
export declare const getGithubUserPublicRepos: ({ username, }: {
|
|
14
|
-
username: string;
|
|
15
|
-
accessToken?: string | undefined;
|
|
16
|
-
}) => Promise<import("@done-coding/request-axios").RequestResult<GithubRepoInfo[]>>;
|
|
17
|
-
/** 获取 github 用户所有仓库列表 */
|
|
18
|
-
export declare const getGithubUserAllRepos: ({ accessToken, }: {
|
|
19
|
-
username: string;
|
|
20
|
-
accessToken?: string | undefined;
|
|
21
|
-
}) => Promise<import("@done-coding/request-axios").RequestResult<GithubRepoInfo[]>>;
|
package/types/config/index.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { CheckOptions, GitConfig } from '../types';
|
|
2
|
-
import { CheckReverseMergeWayEnum } from '../types';
|
|
3
|
-
import type { ArgumentsCamelCase, GitRebaseInfo, SubCliInfo, SupportGetCommitByHookName, YargsOptions } from "@done-coding/cli-utils";
|
|
4
|
-
import type { PositionalOptions } from "yargs";
|
|
5
|
-
export declare const getOptions: () => Record<string, YargsOptions>;
|
|
6
|
-
export declare const getPositionals: () => Record<string, PositionalOptions>;
|
|
7
|
-
/** 检测反向合并-通过git reflog action */
|
|
8
|
-
export declare const checkReverseMergeByReflogAction: ({ config, currentBranch, }: {
|
|
9
|
-
config: GitConfig;
|
|
10
|
-
currentBranch?: string | undefined;
|
|
11
|
-
}) => undefined;
|
|
12
|
-
/** 检测反向合并-通过提交信息 */
|
|
13
|
-
export declare const checkReverseMergeByCommitMsg: ({ config, currentBranch, commitMsg, rootDir, }: {
|
|
14
|
-
config: GitConfig;
|
|
15
|
-
currentBranch?: string | undefined;
|
|
16
|
-
commitMsg?: string | undefined;
|
|
17
|
-
rootDir: string;
|
|
18
|
-
}) => void;
|
|
19
|
-
/** 检测反向合并-通过提交记录 */
|
|
20
|
-
export declare const checkReverseMergeByCommitRecord: ({ config, currentBranch, }: {
|
|
21
|
-
config: GitConfig;
|
|
22
|
-
currentBranch?: string | undefined;
|
|
23
|
-
}) => void;
|
|
24
|
-
/** 检测反向变基 */
|
|
25
|
-
export declare const checkReverseRebase: ({ config, rebaseInfo, }: {
|
|
26
|
-
config: GitConfig;
|
|
27
|
-
rebaseInfo: GitRebaseInfo;
|
|
28
|
-
}) => undefined;
|
|
29
|
-
export type CheckReverseMergeHandlerParams = {
|
|
30
|
-
config: GitConfig;
|
|
31
|
-
rootDir: string;
|
|
32
|
-
way: CheckReverseMergeWayEnum.COMMIT_MSG;
|
|
33
|
-
hookName: SupportGetCommitByHookName;
|
|
34
|
-
} | {
|
|
35
|
-
config: GitConfig;
|
|
36
|
-
rootDir: string;
|
|
37
|
-
way: CheckReverseMergeWayEnum.REFLOG_ACTION;
|
|
38
|
-
} | {
|
|
39
|
-
config: GitConfig;
|
|
40
|
-
rootDir: string;
|
|
41
|
-
way: CheckReverseMergeWayEnum.COMMIT_RECORD;
|
|
42
|
-
} | {
|
|
43
|
-
config: GitConfig;
|
|
44
|
-
way: CheckReverseMergeWayEnum.PRE_REBASE;
|
|
45
|
-
args: string[];
|
|
46
|
-
};
|
|
47
|
-
/** 检测反向合并 */
|
|
48
|
-
export declare const checkReverseMergeHandler: (params: CheckReverseMergeHandlerParams) => Promise<void>;
|
|
49
|
-
/** 检测 */
|
|
50
|
-
export declare const handler: (argv: ArgumentsCamelCase<CheckOptions>) => Promise<void>;
|
|
51
|
-
export declare const commandCliInfo: SubCliInfo;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CliHandlerArgv, CliInfo, SubCliInfo } from "@done-coding/cli-utils";
|
|
2
|
-
import type { CloneOptions } from '../types';
|
|
3
|
-
export declare const getOptions: () => CliInfo["options"];
|
|
4
|
-
/** 位置参数 */
|
|
5
|
-
export declare const getPositionals: () => CliInfo["positionals"];
|
|
6
|
-
/** 克隆目标仓库 */
|
|
7
|
-
export declare const handler: (options: CliHandlerArgv<CloneOptions>) => Promise<void>;
|
|
8
|
-
export declare const commandCliInfo: SubCliInfo;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ArgumentsCamelCase, PositionalOptions } from "yargs";
|
|
2
|
-
import { type HooksOptions } from '../types';
|
|
3
|
-
import type { SubCliInfo, YargsOptions } from "@done-coding/cli-utils";
|
|
4
|
-
export declare const getOptions: () => Record<string, YargsOptions>;
|
|
5
|
-
export declare const getPositionals: () => Record<string, PositionalOptions>;
|
|
6
|
-
export declare const handler: (argv: ArgumentsCamelCase<HooksOptions>) => Promise<void>;
|
|
7
|
-
export declare const commandCliInfo: SubCliInfo;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { handler as initHandler, commandCliInfo as initCommandCliInfo } from "./init";
|
|
2
|
-
import { handler as cloneHandler, commandCliInfo as cloneCommandCliInfo } from "./clone";
|
|
3
|
-
import { handler as hooksHandler, commandCliInfo as hooksCommandCliInfo } from "./hooks";
|
|
4
|
-
import { handler as checkHandler, commandCliInfo as checkCommandCliInfo } from "./check";
|
|
5
|
-
import { SubcommandEnum } from '../types';
|
|
6
|
-
import { type CliHandlerArgv, type CliInfo } from "@done-coding/cli-utils";
|
|
7
|
-
export { initHandler, initCommandCliInfo, cloneHandler, cloneCommandCliInfo, hooksHandler, hooksCommandCliInfo, checkHandler, checkCommandCliInfo, };
|
|
8
|
-
export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any>) => Promise<void>;
|
|
9
|
-
export declare const commandCliInfo: Omit<CliInfo, "usage">;
|
package/types/handlers/init.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="yargs" />
|
|
2
|
-
import type { ArgumentsCamelCase, SubCliInfo } from "@done-coding/cli-utils";
|
|
3
|
-
import { InitTypeEnum, type InitOptions } from '../types';
|
|
4
|
-
/** 获取初始化选项 */
|
|
5
|
-
export declare const getOptions: () => {
|
|
6
|
-
type: {
|
|
7
|
-
alias: string;
|
|
8
|
-
describe: string;
|
|
9
|
-
choices: InitTypeEnum[];
|
|
10
|
-
default: InitTypeEnum;
|
|
11
|
-
};
|
|
12
|
-
rootDir: import("yargs").Options;
|
|
13
|
-
configPath: import("yargs").Options;
|
|
14
|
-
};
|
|
15
|
-
export declare const handler: (argv: ArgumentsCamelCase<InitOptions> & {
|
|
16
|
-
/** 是否是子命令 */
|
|
17
|
-
isSubCommand?: boolean;
|
|
18
|
-
}) => Promise<void>;
|
|
19
|
-
export declare const commandCliInfo: SubCliInfo;
|
package/types/main.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="yargs" />
|
|
2
|
-
/** 作为主命令创建 */
|
|
3
|
-
export declare const createCommand: () => Promise<void | {
|
|
4
|
-
[x: string]: unknown;
|
|
5
|
-
_: (string | number)[];
|
|
6
|
-
$0: string;
|
|
7
|
-
}>;
|
|
8
|
-
/** 作为子命令创建 */
|
|
9
|
-
export declare const crateAsSubcommand: () => import("yargs").CommandModule<{}, {}>;
|
package/types/types/check.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ReadConfigFileOptions } from "@done-coding/cli-utils";
|
|
2
|
-
import { SubcommandEnum } from "./subcommand";
|
|
3
|
-
/** 检测类型 */
|
|
4
|
-
export declare enum CheckTypeEnum {
|
|
5
|
-
/** 反向提交 */
|
|
6
|
-
REVERSE_MERGE = "reverseMerge"
|
|
7
|
-
}
|
|
8
|
-
/** 检测反向方式枚举 */
|
|
9
|
-
export declare enum CheckReverseMergeWayEnum {
|
|
10
|
-
/** GIT_REFLOG_ACTION */
|
|
11
|
-
REFLOG_ACTION = "reflog-action",
|
|
12
|
-
/** 提交信息 */
|
|
13
|
-
COMMIT_MSG = "commit-msg",
|
|
14
|
-
/** 提交记录 */
|
|
15
|
-
COMMIT_RECORD = "commit-record",
|
|
16
|
-
/** 变基线 */
|
|
17
|
-
PRE_REBASE = "pre-rebase"
|
|
18
|
-
}
|
|
19
|
-
/** 检测反向 */
|
|
20
|
-
export type CheckOptions = ReadConfigFileOptions & {
|
|
21
|
-
type: CheckTypeEnum;
|
|
22
|
-
args: string[];
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* 禁止合并某个分支的检测选项
|
|
26
|
-
*/
|
|
27
|
-
export interface GitConfigCheckReverseMergeBranchConfig {
|
|
28
|
-
/** 包括变基操作 */
|
|
29
|
-
includeRebase: boolean;
|
|
30
|
-
/** 某个hash之后的提交 */
|
|
31
|
-
afterHash?: string;
|
|
32
|
-
/** 最多(检查日志数量) */
|
|
33
|
-
logCount: number;
|
|
34
|
-
}
|
|
35
|
-
/** 螃蟹git配置 */
|
|
36
|
-
export interface GitConfig {
|
|
37
|
-
[SubcommandEnum.CHECK]: {
|
|
38
|
-
[CheckTypeEnum.REVERSE_MERGE]: Record<string, GitConfigCheckReverseMergeBranchConfig>;
|
|
39
|
-
};
|
|
40
|
-
}
|
package/types/types/clone.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** Git 平台枚举 */
|
|
2
|
-
export declare enum GitPlatformEnum {
|
|
3
|
-
/** GitHub */
|
|
4
|
-
GITHUB = "github",
|
|
5
|
-
/** Gitee */
|
|
6
|
-
GITEE = "gitee"
|
|
7
|
-
}
|
|
8
|
-
/** git参数信息 */
|
|
9
|
-
export interface GitParamsInfo {
|
|
10
|
-
/** 平台 */
|
|
11
|
-
platform: GitPlatformEnum;
|
|
12
|
-
/** 用户名 */
|
|
13
|
-
username: string;
|
|
14
|
-
/** 项目名称 */
|
|
15
|
-
projectName?: string;
|
|
16
|
-
}
|
|
17
|
-
/** 可控选项 */
|
|
18
|
-
export type CloneOptions = GitParamsInfo;
|
|
19
|
-
/** Git 配置信息 */
|
|
20
|
-
export interface GitConfigInfo {
|
|
21
|
-
/** token */
|
|
22
|
-
accessToken: string;
|
|
23
|
-
}
|
package/types/types/hooks.d.ts
DELETED
package/types/types/index.d.ts
DELETED
package/types/types/init.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { InitConfigFileOptions } from "@done-coding/cli-utils";
|
|
2
|
-
/** 初始化类型 */
|
|
3
|
-
export declare enum InitTypeEnum {
|
|
4
|
-
DEFAULT = "default",
|
|
5
|
-
CLONE_CONFIG = "cloneConfig"
|
|
6
|
-
}
|
|
7
|
-
/** 初始化选项 */
|
|
8
|
-
export interface InitOptions extends InitConfigFileOptions {
|
|
9
|
-
type?: InitTypeEnum;
|
|
10
|
-
}
|
package/types/utils/check.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { GitConfig } from '../types';
|
|
2
|
-
import type { GitLogItemInfo, GitReflogItemInfo } from "@done-coding/cli-utils";
|
|
3
|
-
import { type GitMergeBranchInfo } from "@done-coding/cli-utils";
|
|
4
|
-
/** 获取检测反向合并配置map */
|
|
5
|
-
export declare const getCheckReverseMergeConfigMap: (config: GitConfig) => Record<string, import('../types').GitConfigCheckReverseMergeBranchConfig>;
|
|
6
|
-
/** 获取检测反向合并配置map类型 */
|
|
7
|
-
export type CheckReverseMergeConfigMap = ReturnType<typeof getCheckReverseMergeConfigMap>;
|
|
8
|
-
/** 获取检测反向合并配置的最大日志数量 */
|
|
9
|
-
export declare const getCheckReverseMergeMaxLogCount: (configMap: CheckReverseMergeConfigMap) => number;
|
|
10
|
-
/** 获取检测反向合并配置的最大索引map */
|
|
11
|
-
export declare const getCheckReverseMergeMaxIndexMap: (configMap: CheckReverseMergeConfigMap, logList: (GitLogItemInfo | GitReflogItemInfo)[]) => Record<string, number>;
|
|
12
|
-
/**
|
|
13
|
-
* 检测是否是反向合并
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
export declare const checkIsReverseMerge: ({ mergeInfo, configMap, currentBranch, }: {
|
|
17
|
-
mergeInfo?: GitMergeBranchInfo | undefined;
|
|
18
|
-
configMap: CheckReverseMergeConfigMap;
|
|
19
|
-
currentBranch?: string | undefined;
|
|
20
|
-
}) => boolean | undefined;
|
package/types/utils/config.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { GitConfigInfo, GitParamsInfo } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* 获取配置信息
|
|
4
|
-
*/
|
|
5
|
-
export declare const getGitConfigInfo: (params: GitParamsInfo) => GitConfigInfo | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* 设置配置信息
|
|
8
|
-
*/
|
|
9
|
-
export declare const setGitConfigInfo: ({ rootDir, username, platform, accessToken, }: {
|
|
10
|
-
/** 根目录 */
|
|
11
|
-
rootDir: string;
|
|
12
|
-
/** 访问令牌 */
|
|
13
|
-
accessToken: string;
|
|
14
|
-
} & GitParamsInfo) => void;
|
package/types/utils/hooks.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { HooksNameEnum } from "@done-coding/cli-utils";
|
|
2
|
-
/** 支持的git hooks名称 */
|
|
3
|
-
export declare const SUPPORT_HOOKS_NAME: HooksNameEnum[];
|
|
4
|
-
/** 支持的检查反向合并的git hooks名称 */
|
|
5
|
-
export declare const SUPPORT_CHECK_REVERSE_MERGE_HOOKS_NAME: readonly [HooksNameEnum.PRE_MERGE_COMMIT, HooksNameEnum.PREPARE_COMMIT_MSG, HooksNameEnum.POST_MERGE, HooksNameEnum.PRE_PUSH, HooksNameEnum.PRE_REBASE];
|
|
6
|
-
/** 支持的检查反向合并的git hooks名称类型 */
|
|
7
|
-
export type SupportCheckReverseMergeHooksNameType = (typeof SUPPORT_CHECK_REVERSE_MERGE_HOOKS_NAME)[number];
|
package/types/utils/index.d.ts
DELETED
package/types/utils/path.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { PromptObject } from "@done-coding/cli-utils";
|
|
2
|
-
import { GitPlatformEnum } from '../types';
|
|
3
|
-
/** git平台选择表单 */
|
|
4
|
-
export declare const getPlatformForm: (initialValue?: GitPlatformEnum) => PromptObject<string>;
|
|
5
|
-
/** git用户名表单 */
|
|
6
|
-
export declare const getGitUsernameForm: (initial?: PromptObject["initial"]) => PromptObject<string>;
|
|
7
|
-
/** git access token表单 */
|
|
8
|
-
export declare const gitAccessTokenForm: PromptObject<string>;
|