done-coding-git 0.6.0 → 0.6.2-alpha.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { c as m } from "./index-8bd8ff1f.js";
3
- import "./index-964abda4.js";
2
+ import { c as m } from "./index-291127b3.js";
3
+ import "./index-b2b183b0.js";
4
4
  import "@done-coding/cli-utils";
5
5
  import "node:child_process";
6
6
  import "node:fs";
package/es/helpers.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { g as s, G as n, a, h as m } from "./index-964abda4.js";
2
+ import { g as s, G as n, a, h as m } from "./index-b2b183b0.js";
3
3
  import { xPrompts as e } from "@done-coding/cli-utils";
4
4
  import "node:child_process";
5
5
  import "node:fs";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as a, i as t } from "./index-964abda4.js";
2
+ import { c as a, i as t } from "./index-b2b183b0.js";
3
3
  import { createMainCommand as r, createSubcommand as s } from "@done-coding/cli-utils";
4
4
  const {
5
5
  cliConfig: { moduleName: o }
@@ -61,7 +61,7 @@ const me = 3e4, w = Math.random(), L = {
61
61
  }
62
62
  }), A = {
63
63
  name: "@done-coding/cli-git",
64
- version: "0.6.0",
64
+ version: "0.6.2-alpha.0",
65
65
  description: "git跨平台操作命令行工具",
66
66
  cliConfig: {
67
67
  namespaceDir: ".done-coding",
@@ -247,7 +247,7 @@ const me = 3e4, w = Math.random(), L = {
247
247
  }
248
248
  }
249
249
  }
250
- }, Pe = () => ({
250
+ }, Se = () => ({
251
251
  ...I({
252
252
  configPathDefault: T
253
253
  }),
@@ -257,7 +257,7 @@ const me = 3e4, w = Math.random(), L = {
257
257
  choices: [d.DEFAULT, d.CLONE_CONFIG],
258
258
  default: d.DEFAULT
259
259
  }
260
- }), Se = (e) => {
260
+ }), Pe = (e) => {
261
261
  B(`npm pkg set scripts.postprepare="${e} init"`);
262
262
  }, j = async (e) => {
263
263
  const { type: t } = e;
@@ -268,7 +268,7 @@ const me = 3e4, w = Math.random(), L = {
268
268
  hookNames: _e,
269
269
  rootDir: s,
270
270
  getCode: (n) => `npx ${c} hooks ${n} "$@"`
271
- }), await Se(c), te(Ge, e, {
271
+ }), await Pe(c), te(Ge, e, {
272
272
  onFileGenerated: (n) => {
273
273
  i.info(`文件生成成功: ${n}`);
274
274
  }
@@ -289,7 +289,7 @@ const me = 3e4, w = Math.random(), L = {
289
289
  }, ke = {
290
290
  command: p.INIT,
291
291
  describe: "初始化配置文件",
292
- options: Pe(),
292
+ options: Se(),
293
293
  handler: j
294
294
  }, be = () => ({
295
295
  projectName: {
@@ -394,12 +394,12 @@ const me = 3e4, w = Math.random(), L = {
394
394
  {}
395
395
  );
396
396
  o.forEach((a, f) => {
397
- var P;
398
- const O = a.mergeInfo || ((P = l[a.hash]) == null ? void 0 : P.mergeInfo);
399
- O && Object.entries(s).forEach(([S]) => {
400
- const k = c[S];
397
+ var S;
398
+ const O = a.mergeInfo || ((S = l[a.hash]) == null ? void 0 : S.mergeInfo);
399
+ O && Object.entries(s).forEach(([P]) => {
400
+ const k = c[P];
401
401
  if (f > k) {
402
- i.skip(`${S} 只检测${k + 1}条, 超出不再检测`);
402
+ i.skip(`${P} 只检测${k + 1}条, 超出不再检测`);
403
403
  return;
404
404
  }
405
405
  const z = G({
@@ -585,7 +585,10 @@ const me = 3e4, w = Math.random(), L = {
585
585
  demandCommandCount: 1
586
586
  };
587
587
  export {
588
+ C,
588
589
  E as G,
590
+ d as I,
591
+ p as S,
589
592
  K as a,
590
593
  $e as b,
591
594
  Ze as c,
@@ -599,5 +602,6 @@ export {
599
602
  ve as k,
600
603
  q as l,
601
604
  Fe as m,
602
- Ye as n
605
+ Ye as n,
606
+ u as o
603
607
  };
package/es/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { m as l, l as d, f as t, h as c, c as p, b as C, n as f, k as h, j as k, e as I, d as H } from "./index-964abda4.js";
3
- import { a as g } from "./index-8bd8ff1f.js";
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-b2b183b0.js";
3
+ import { a as T } from "./index-291127b3.js";
4
4
  import "@done-coding/cli-utils";
5
5
  import "node:child_process";
6
6
  import "node:fs";
@@ -8,16 +8,21 @@ import "node:path";
8
8
  import "@done-coding/request-axios";
9
9
  import "axios";
10
10
  export {
11
- l as checkCommandCliInfo,
12
- d as checkHandler,
13
- t as cloneCommandCliInfo,
14
- c as cloneHandler,
15
- p as commandCliInfo,
16
- g as crateAsSubcommand,
17
- C as getTargetRepoUrl,
18
- f as handler,
19
- h as hooksCommandCliInfo,
20
- k as hooksHandler,
21
- I as initCommandCliInfo,
22
- H as initHandler
11
+ t as CheckReverseMergeWayEnum,
12
+ l as CheckTypeEnum,
13
+ d as GitPlatformEnum,
14
+ c as InitTypeEnum,
15
+ C as SubcommandEnum,
16
+ p as checkCommandCliInfo,
17
+ f as checkHandler,
18
+ h as cloneCommandCliInfo,
19
+ u as cloneHandler,
20
+ k as commandCliInfo,
21
+ T as crateAsSubcommand,
22
+ I as getTargetRepoUrl,
23
+ E as handler,
24
+ b as hooksCommandCliInfo,
25
+ H as hooksHandler,
26
+ g as initCommandCliInfo,
27
+ y as initHandler
23
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "done-coding-git",
3
- "version": "0.6.0",
3
+ "version": "0.6.2-alpha.0",
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.8",
44
+ "@done-coding/cli-inject": "^0.5.10-alpha.0",
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.0",
56
+ "@done-coding/cli-utils": "^0.7.1-alpha.0",
57
57
  "@done-coding/request-axios": "^1.1.1",
58
58
  "axios": "^1.8.4"
59
59
  },
60
- "gitHead": "b4fb4f2380a14f72597a1dbfd1bbce22287ef02f",
60
+ "gitHead": "3376f5fbbf8b87c791316e76df06028afd650e08",
61
61
  "scripts": {}
62
62
  }
package/types/cli.d.ts CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ export { }
@@ -1 +1,4 @@
1
- export * from './helpers-assets/done-coding';
1
+ /** 克隆done-coding系列项目 */
2
+ export declare const cloneDoneCodingSeries: (projectName?: string) => Promise<void>;
3
+
4
+ export { }
package/types/index.d.ts CHANGED
@@ -1,3 +1,142 @@
1
- export * from './handlers';
2
- export { crateAsSubcommand } from "./main";
3
- export { getTargetRepoUrl } from "./utils";
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 { }
@@ -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 };
@@ -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[]>>;
@@ -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[]>>;
@@ -1,3 +0,0 @@
1
- import { type GitConfig } from '../types';
2
- declare const config: GitConfig;
3
- export default config;
@@ -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">;
@@ -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;
@@ -1,2 +0,0 @@
1
- /** 克隆done-coding系列项目 */
2
- export declare const cloneDoneCodingSeries: (projectName?: string) => Promise<void>;
@@ -1,11 +0,0 @@
1
- declare const _default: {
2
- "name": "@done-coding/cli-git",
3
- "version": "0.6.0",
4
- "description": "git跨平台操作命令行工具",
5
- "cliConfig": {
6
- "namespaceDir": ".done-coding",
7
- "moduleName": "git"
8
- }
9
- };
10
-
11
- export default _default;
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<{}, {}>;
@@ -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
- }
@@ -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
- }
@@ -1,5 +0,0 @@
1
- import { HooksNameEnum, ReadConfigFileOptions } from "@done-coding/cli-utils";
2
- /** hooks选项 */
3
- export type HooksOptions = ReadConfigFileOptions & {
4
- name: HooksNameEnum;
5
- };
@@ -1,5 +0,0 @@
1
- export * from "./subcommand";
2
- export * from "./init";
3
- export * from "./clone";
4
- export * from "./hooks";
5
- export * from "./check";
@@ -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
- }
@@ -1,13 +0,0 @@
1
- /** 子命令枚举 */
2
- export declare enum SubcommandEnum {
3
- /** 初始化配置文件 */
4
- INIT = "init",
5
- /** 克隆 */
6
- CLONE = "clone",
7
- /** hooks调用 */
8
- HOOKS = "hooks",
9
- /**
10
- * 检测
11
- */
12
- CHECK = "check"
13
- }
@@ -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;
@@ -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;
@@ -1,3 +0,0 @@
1
- import { type GitParamsInfo } from '../types';
2
- /** 获取目标仓库地址 */
3
- export declare const getTargetRepoUrl: ({ platform: platformInit, username: usernameInit, }?: Partial<GitParamsInfo>) => Promise<any>;
@@ -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];
@@ -1,6 +0,0 @@
1
- export * from "./get-repo";
2
- export * from "./path";
3
- export * from "./config";
4
- export * from "./question";
5
- export * from "./hooks";
6
- export * from "./check";
@@ -1,4 +0,0 @@
1
- /** 模块配置相对路径 */
2
- export declare const MODULE_CONFIG_RELATIVE_PATH: string;
3
- /** 模块默认配置文件相对路径 */
4
- export declare const MODULE_DEFAULT_CONFIG_RELATIVE_PATH: string;
@@ -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>;