repo-do 1.0.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/README.md +331 -0
- package/bin/repo-do.js +2 -0
- package/dist/commands/add.d.ts +4 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +35 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/config.d.ts +6 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +41 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/find.d.ts +2 -0
- package/dist/commands/find.d.ts.map +1 -0
- package/dist/commands/find.js +23 -0
- package/dist/commands/find.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +51 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +4 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +27 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/remove.d.ts +2 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/remove.js +53 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/constants/index.d.ts +15 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +23 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/core/cache-manager.d.ts +14 -0
- package/dist/core/cache-manager.d.ts.map +1 -0
- package/dist/core/cache-manager.js +140 -0
- package/dist/core/cache-manager.js.map +1 -0
- package/dist/core/config-manager.d.ts +12 -0
- package/dist/core/config-manager.d.ts.map +1 -0
- package/dist/core/config-manager.js +76 -0
- package/dist/core/config-manager.js.map +1 -0
- package/dist/core/git-url-parser.d.ts +3 -0
- package/dist/core/git-url-parser.d.ts.map +1 -0
- package/dist/core/git-url-parser.js +55 -0
- package/dist/core/git-url-parser.js.map +1 -0
- package/dist/core/path-generator.d.ts +10 -0
- package/dist/core/path-generator.d.ts.map +1 -0
- package/dist/core/path-generator.js +29 -0
- package/dist/core/path-generator.js.map +1 -0
- package/dist/core/repository-manager.d.ts +10 -0
- package/dist/core/repository-manager.d.ts.map +1 -0
- package/dist/core/repository-manager.js +82 -0
- package/dist/core/repository-manager.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +13 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/clipboard.d.ts +5 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +22 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/git-executor.d.ts +12 -0
- package/dist/utils/git-executor.d.ts.map +1 -0
- package/dist/utils/git-executor.js +59 -0
- package/dist/utils/git-executor.js.map +1 -0
- package/dist/utils/logger.d.ts +9 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +27 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,UAAU,QAAsC,CAAC;AAC9D,eAAO,MAAM,WAAW,QAAuC,CAAC;AAChE,eAAO,MAAM,UAAU,QAA2C,CAAC;AACnE,eAAO,MAAM,gBAAgB,QAAgC,CAAC;AAE9D,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ERROR_CODES = exports.DEFAULT_BASE_DIR = exports.CACHE_FILE = exports.CONFIG_FILE = exports.CONFIG_DIR = exports.CONFIG_VERSION = void 0;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
exports.CONFIG_VERSION = '1.0.0';
|
|
10
|
+
exports.CONFIG_DIR = path_1.default.join(os_1.default.homedir(), '.repo-do');
|
|
11
|
+
exports.CONFIG_FILE = path_1.default.join(exports.CONFIG_DIR, 'config.json');
|
|
12
|
+
exports.CACHE_FILE = path_1.default.join(exports.CONFIG_DIR, 'repo_cache.json');
|
|
13
|
+
exports.DEFAULT_BASE_DIR = path_1.default.join(exports.CONFIG_DIR, 'repo');
|
|
14
|
+
exports.ERROR_CODES = {
|
|
15
|
+
INVALID_URL: 'INVALID_URL',
|
|
16
|
+
CLONE_FAILED: 'CLONE_FAILED',
|
|
17
|
+
CONFIG_ERROR: 'CONFIG_ERROR',
|
|
18
|
+
NOT_FOUND: 'NOT_FOUND',
|
|
19
|
+
PERMISSION_DENIED: 'PERMISSION_DENIED',
|
|
20
|
+
GIT_NOT_INSTALLED: 'GIT_NOT_INSTALLED',
|
|
21
|
+
CACHE_ERROR: 'CACHE_ERROR',
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAEX,QAAA,cAAc,GAAG,OAAO,CAAC;AACzB,QAAA,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;AACjD,QAAA,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAU,EAAE,aAAa,CAAC,CAAC;AACnD,QAAA,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAU,EAAE,iBAAiB,CAAC,CAAC;AACtD,QAAA,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAU,EAAE,MAAM,CAAC,CAAC;AAEjD,QAAA,WAAW,GAAG;IACzB,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,iBAAiB,EAAE,mBAAmB;IACtC,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;CAClB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IRepositoryCache, IRepositoryInfo } from '../types';
|
|
2
|
+
export declare class CacheManager {
|
|
3
|
+
ensureCacheDir(): Promise<void>;
|
|
4
|
+
loadCache(): Promise<IRepositoryCache>;
|
|
5
|
+
saveCache(cache: IRepositoryCache): Promise<void>;
|
|
6
|
+
addRepository(repo: IRepositoryInfo): Promise<void>;
|
|
7
|
+
removeRepository(repoPath: string): Promise<void>;
|
|
8
|
+
rebuildCache(baseDir: string): Promise<IRepositoryCache>;
|
|
9
|
+
getAllRepositories(): Promise<IRepositoryInfo[]>;
|
|
10
|
+
findRepositories(query: string): Promise<IRepositoryInfo[]>;
|
|
11
|
+
private getEmptyCache;
|
|
12
|
+
}
|
|
13
|
+
export declare const cacheManager: CacheManager;
|
|
14
|
+
//# sourceMappingURL=cache-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-manager.d.ts","sourceRoot":"","sources":["../../src/core/cache-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAa,MAAM,UAAU,CAAC;AAIxE,qBAAa,YAAY;IACjB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAW/B,SAAS,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAsBtC,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjD,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAcnD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA4DxD,kBAAkB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAKhD,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAajE,OAAO,CAAC,aAAa;CAMtB;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cacheManager = exports.CacheManager = void 0;
|
|
7
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
11
|
+
class CacheManager {
|
|
12
|
+
async ensureCacheDir() {
|
|
13
|
+
try {
|
|
14
|
+
await promises_1.default.mkdir(constants_1.CONFIG_DIR, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
throw new types_1.GitMError(`Failed to create cache directory: ${error.message}`, constants_1.ERROR_CODES.CACHE_ERROR);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async loadCache() {
|
|
21
|
+
try {
|
|
22
|
+
await this.ensureCacheDir();
|
|
23
|
+
const content = await promises_1.default.readFile(constants_1.CACHE_FILE, 'utf-8');
|
|
24
|
+
const cache = JSON.parse(content);
|
|
25
|
+
cache.repositories = cache.repositories.map((repo) => ({
|
|
26
|
+
...repo,
|
|
27
|
+
lastUpdated: new Date(repo.lastUpdated),
|
|
28
|
+
}));
|
|
29
|
+
cache.lastUpdated = new Date(cache.lastUpdated);
|
|
30
|
+
return cache;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if (error.code === 'ENOENT') {
|
|
34
|
+
return this.getEmptyCache();
|
|
35
|
+
}
|
|
36
|
+
throw new types_1.GitMError(`Failed to load cache: ${error.message}`, constants_1.ERROR_CODES.CACHE_ERROR);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async saveCache(cache) {
|
|
40
|
+
try {
|
|
41
|
+
await this.ensureCacheDir();
|
|
42
|
+
await promises_1.default.writeFile(constants_1.CACHE_FILE, JSON.stringify(cache, null, 2), 'utf-8');
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
throw new types_1.GitMError(`Failed to save cache: ${error.message}`, constants_1.ERROR_CODES.CACHE_ERROR);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async addRepository(repo) {
|
|
49
|
+
const cache = await this.loadCache();
|
|
50
|
+
const existingIndex = cache.repositories.findIndex(r => r.fullPath === repo.fullPath);
|
|
51
|
+
if (existingIndex >= 0) {
|
|
52
|
+
cache.repositories[existingIndex] = repo;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
cache.repositories.push(repo);
|
|
56
|
+
}
|
|
57
|
+
cache.lastUpdated = new Date();
|
|
58
|
+
await this.saveCache(cache);
|
|
59
|
+
}
|
|
60
|
+
async removeRepository(repoPath) {
|
|
61
|
+
const cache = await this.loadCache();
|
|
62
|
+
cache.repositories = cache.repositories.filter(r => r.fullPath !== repoPath);
|
|
63
|
+
cache.lastUpdated = new Date();
|
|
64
|
+
await this.saveCache(cache);
|
|
65
|
+
}
|
|
66
|
+
async rebuildCache(baseDir) {
|
|
67
|
+
const repositories = [];
|
|
68
|
+
try {
|
|
69
|
+
const domains = await promises_1.default.readdir(baseDir);
|
|
70
|
+
for (const domain of domains) {
|
|
71
|
+
const domainPath = path_1.default.join(baseDir, domain);
|
|
72
|
+
const stat = await promises_1.default.stat(domainPath);
|
|
73
|
+
if (!stat.isDirectory())
|
|
74
|
+
continue;
|
|
75
|
+
const groups = await promises_1.default.readdir(domainPath);
|
|
76
|
+
for (const group of groups) {
|
|
77
|
+
const groupPath = path_1.default.join(domainPath, group);
|
|
78
|
+
const groupStat = await promises_1.default.stat(groupPath);
|
|
79
|
+
if (!groupStat.isDirectory())
|
|
80
|
+
continue;
|
|
81
|
+
const repos = await promises_1.default.readdir(groupPath);
|
|
82
|
+
for (const repo of repos) {
|
|
83
|
+
const repoPath = path_1.default.join(groupPath, repo);
|
|
84
|
+
const repoStat = await promises_1.default.stat(repoPath);
|
|
85
|
+
if (!repoStat.isDirectory())
|
|
86
|
+
continue;
|
|
87
|
+
const gitPath = path_1.default.join(repoPath, '.git');
|
|
88
|
+
try {
|
|
89
|
+
await promises_1.default.access(gitPath);
|
|
90
|
+
repositories.push({
|
|
91
|
+
name: repo,
|
|
92
|
+
fullPath: repoPath,
|
|
93
|
+
gitUrl: '',
|
|
94
|
+
domain,
|
|
95
|
+
group,
|
|
96
|
+
lastUpdated: repoStat.mtime,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// Not a git repository, skip
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
if (error.code !== 'ENOENT') {
|
|
108
|
+
throw new types_1.GitMError(`Failed to rebuild cache: ${error.message}`, constants_1.ERROR_CODES.CACHE_ERROR);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const cache = {
|
|
112
|
+
repositories,
|
|
113
|
+
lastUpdated: new Date(),
|
|
114
|
+
};
|
|
115
|
+
await this.saveCache(cache);
|
|
116
|
+
return cache;
|
|
117
|
+
}
|
|
118
|
+
async getAllRepositories() {
|
|
119
|
+
const cache = await this.loadCache();
|
|
120
|
+
return cache.repositories;
|
|
121
|
+
}
|
|
122
|
+
async findRepositories(query) {
|
|
123
|
+
const cache = await this.loadCache();
|
|
124
|
+
const lowerQuery = query.toLowerCase();
|
|
125
|
+
return cache.repositories.filter(repo => {
|
|
126
|
+
return (repo.name.toLowerCase().includes(lowerQuery) ||
|
|
127
|
+
repo.group.toLowerCase().includes(lowerQuery) ||
|
|
128
|
+
repo.fullPath.toLowerCase().includes(lowerQuery));
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
getEmptyCache() {
|
|
132
|
+
return {
|
|
133
|
+
repositories: [],
|
|
134
|
+
lastUpdated: new Date(),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.CacheManager = CacheManager;
|
|
139
|
+
exports.cacheManager = new CacheManager();
|
|
140
|
+
//# sourceMappingURL=cache-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-manager.js","sourceRoot":"","sources":["../../src/core/cache-manager.ts"],"names":[],"mappings":";;;;;;AAAA,2DAA6B;AAC7B,gDAAwB;AACxB,oCAAwE;AACxE,4CAAmE;AAGnE,MAAa,YAAY;IACvB,KAAK,CAAC,cAAc;QAClB,IAAI,CAAC;YACH,MAAM,kBAAE,CAAC,KAAK,CAAC,sBAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,iBAAS,CACjB,qCAAsC,KAAe,CAAC,OAAO,EAAE,EAC/D,uBAAW,CAAC,WAAW,CACxB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,SAAS;QACb,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5B,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,sBAAU,EAAE,OAAO,CAAC,CAAC;YACvD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OA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M,KAAK,GAAqB;YAC9B,YAAY;YACZ,WAAW,EAAE,IAAI,IAAI,EAAE;SACxB,CAAC;QAEF,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC,YAAY,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,KAAa;QAClC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAEvC,OAAO,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACtC,OAAO,CACL,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAC5C,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAC7C,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CACjD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,aAAa;QACnB,OAAO;YACL,YAAY,EAAE,EAAE;YAChB,WAAW,EAAE,IAAI,IAAI,EAAE;SACxB,CAAC;IACJ,CAAC;CACF;AAvJD,oCAuJC;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IGitMConfig } from '../types';
|
|
2
|
+
export declare class ConfigManager {
|
|
3
|
+
ensureConfigDir(): Promise<void>;
|
|
4
|
+
loadConfig(): Promise<IGitMConfig>;
|
|
5
|
+
saveConfig(config: IGitMConfig): Promise<void>;
|
|
6
|
+
getBaseDirectory(): Promise<string>;
|
|
7
|
+
setBaseDirectory(directory: string): Promise<void>;
|
|
8
|
+
configExists(): Promise<boolean>;
|
|
9
|
+
private getDefaultConfig;
|
|
10
|
+
}
|
|
11
|
+
export declare const configManager: ConfigManager;
|
|
12
|
+
//# sourceMappingURL=config-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-manager.d.ts","sourceRoot":"","sources":["../../src/core/config-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAa,MAAM,UAAU,CAAC;AAGlD,qBAAa,aAAa;IAClB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAWhC,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC;IAgBlC,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9C,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;IAKnC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBlD,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;IAStC,OAAO,CAAC,gBAAgB;CAMzB;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configManager = exports.ConfigManager = void 0;
|
|
7
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
11
|
+
class ConfigManager {
|
|
12
|
+
async ensureConfigDir() {
|
|
13
|
+
try {
|
|
14
|
+
await promises_1.default.mkdir(constants_1.CONFIG_DIR, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
throw new types_1.GitMError(`Failed to create config directory: ${error.message}`, constants_1.ERROR_CODES.CONFIG_ERROR);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async loadConfig() {
|
|
21
|
+
try {
|
|
22
|
+
await this.ensureConfigDir();
|
|
23
|
+
const content = await promises_1.default.readFile(constants_1.CONFIG_FILE, 'utf-8');
|
|
24
|
+
return JSON.parse(content);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
if (error.code === 'ENOENT') {
|
|
28
|
+
return this.getDefaultConfig();
|
|
29
|
+
}
|
|
30
|
+
throw new types_1.GitMError(`Failed to load config: ${error.message}`, constants_1.ERROR_CODES.CONFIG_ERROR);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async saveConfig(config) {
|
|
34
|
+
try {
|
|
35
|
+
await this.ensureConfigDir();
|
|
36
|
+
await promises_1.default.writeFile(constants_1.CONFIG_FILE, JSON.stringify(config, null, 2), 'utf-8');
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
throw new types_1.GitMError(`Failed to save config: ${error.message}`, constants_1.ERROR_CODES.CONFIG_ERROR);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async getBaseDirectory() {
|
|
43
|
+
const config = await this.loadConfig();
|
|
44
|
+
return config.baseDirectory;
|
|
45
|
+
}
|
|
46
|
+
async setBaseDirectory(directory) {
|
|
47
|
+
const config = await this.loadConfig();
|
|
48
|
+
const absolutePath = path_1.default.resolve(directory);
|
|
49
|
+
try {
|
|
50
|
+
await promises_1.default.mkdir(absolutePath, { recursive: true });
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
throw new types_1.GitMError(`Failed to create base directory: ${error.message}`, constants_1.ERROR_CODES.PERMISSION_DENIED);
|
|
54
|
+
}
|
|
55
|
+
config.baseDirectory = absolutePath;
|
|
56
|
+
await this.saveConfig(config);
|
|
57
|
+
}
|
|
58
|
+
async configExists() {
|
|
59
|
+
try {
|
|
60
|
+
await promises_1.default.access(constants_1.CONFIG_FILE);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
getDefaultConfig() {
|
|
68
|
+
return {
|
|
69
|
+
baseDirectory: constants_1.DEFAULT_BASE_DIR,
|
|
70
|
+
version: constants_1.CONFIG_VERSION,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.ConfigManager = ConfigManager;
|
|
75
|
+
exports.configManager = new ConfigManager();
|
|
76
|
+
//# sourceMappingURL=config-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-manager.js","sourceRoot":"","sources":["../../src/core/config-manager.ts"],"names":[],"mappings":";;;;;;AAAA,2DAA6B;AAC7B,gDAAwB;AACxB,oCAAkD;AAClD,4CAAsG;AAEtG,MAAa,aAAa;IACxB,KAAK,CAAC,eAAe;QACnB,IAAI,CAAC;YACH,MAAM,kBAAE,CAAC,KAAK,CAAC,sBAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,iBAAS,CACjB,sCAAuC,KAAe,CAAC,OAAO,EAAE,EAChE,uBAAW,CAAC,YAAY,CACzB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,UAAU;QACd,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;YAC7B,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,uBAAW,EAAE,OAAO,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAgB,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACvD,OA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AChC,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC;YACH,MAAM,kBAAE,CAAC,MAAM,CAAC,uBAAW,CAAC,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAEO,gBAAgB;QACtB,OAAO;YACL,aAAa,EAAE,4BAAgB;YAC/B,OAAO,EAAE,0BAAc;SACxB,CAAC;IACJ,CAAC;CACF;AA7ED,sCA6EC;AAEY,QAAA,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-url-parser.d.ts","sourceRoot":"","sources":["../../src/core/git-url-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAa,MAAM,UAAU,CAAC;AAGpD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CA2DtD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseGitUrl = parseGitUrl;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
function parseGitUrl(url) {
|
|
7
|
+
if (!url || typeof url !== 'string') {
|
|
8
|
+
throw new types_1.GitMError('Invalid URL: URL cannot be empty', constants_1.ERROR_CODES.INVALID_URL);
|
|
9
|
+
}
|
|
10
|
+
const trimmedUrl = url.trim();
|
|
11
|
+
// HTTPS format: https://github.com/user/repo.git or https://github.com/user/repo
|
|
12
|
+
const httpsRegex = /^https?:\/\/([^\/]+)\/([^\/]+)\/([^\/\.]+)(\.git)?$/;
|
|
13
|
+
const httpsMatch = trimmedUrl.match(httpsRegex);
|
|
14
|
+
if (httpsMatch) {
|
|
15
|
+
const [, domain, group, repoName] = httpsMatch;
|
|
16
|
+
return {
|
|
17
|
+
protocol: 'https',
|
|
18
|
+
domain,
|
|
19
|
+
group,
|
|
20
|
+
repoName,
|
|
21
|
+
originalUrl: trimmedUrl,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// SSH format (scp-style): git@github.com:user/repo.git
|
|
25
|
+
const sshScpRegex = /^git@([^:]+):([^\/]+)\/([^\/\.]+)(\.git)?$/;
|
|
26
|
+
const sshScpMatch = trimmedUrl.match(sshScpRegex);
|
|
27
|
+
if (sshScpMatch) {
|
|
28
|
+
const [, domain, group, repoName] = sshScpMatch;
|
|
29
|
+
return {
|
|
30
|
+
protocol: 'ssh',
|
|
31
|
+
domain,
|
|
32
|
+
group,
|
|
33
|
+
repoName,
|
|
34
|
+
originalUrl: trimmedUrl,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// SSH format (URL-style): ssh://git@github.com/user/repo.git
|
|
38
|
+
const sshUrlRegex = /^ssh:\/\/git@([^\/]+)\/([^\/]+)\/([^\/\.]+)(\.git)?$/;
|
|
39
|
+
const sshUrlMatch = trimmedUrl.match(sshUrlRegex);
|
|
40
|
+
if (sshUrlMatch) {
|
|
41
|
+
const [, domain, group, repoName] = sshUrlMatch;
|
|
42
|
+
return {
|
|
43
|
+
protocol: 'ssh',
|
|
44
|
+
domain,
|
|
45
|
+
group,
|
|
46
|
+
repoName,
|
|
47
|
+
originalUrl: trimmedUrl,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
throw new types_1.GitMError(`Invalid git URL format: ${url}\nSupported formats:\n` +
|
|
51
|
+
' - https://github.com/user/repo.git\n' +
|
|
52
|
+
' - git@github.com:user/repo.git\n' +
|
|
53
|
+
' - ssh://git@github.com/user/repo.git', constants_1.ERROR_CODES.INVALID_URL);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=git-url-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-url-parser.js","sourceRoot":"","sources":["../../src/core/git-url-parser.ts"],"names":[],"mappings":";;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,EAAE,KAAK;YACf,MAAM;YACN,KAAK;YACL,QAAQ;YACR,WAAW,EAAE,UAAU;SACxB,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,iBAAS,CACjB,2BAA2B,GAAG,wBAAwB;QACtD,wCAAwC;QACxC,oCAAoC;QACpC,wCAAwC,EACxC,uBAAW,CAAC,WAAW,CACxB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IParsedGitUrl } from '../types';
|
|
2
|
+
export declare class PathGenerator {
|
|
3
|
+
generateRepoPath(baseDir: string, parsed: IParsedGitUrl): string;
|
|
4
|
+
getRelativePath(fullPath: string, baseDir: string): string;
|
|
5
|
+
extractRepoName(fullPath: string): string;
|
|
6
|
+
extractGroupName(fullPath: string): string;
|
|
7
|
+
extractDomainName(fullPath: string, baseDir: string): string;
|
|
8
|
+
}
|
|
9
|
+
export declare const pathGenerator: PathGenerator;
|
|
10
|
+
//# sourceMappingURL=path-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-generator.d.ts","sourceRoot":"","sources":["../../src/core/path-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,qBAAa,aAAa;IACxB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,MAAM;IAIhE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAI1D,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIzC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI1C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;CAK7D;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.pathGenerator = exports.PathGenerator = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
class PathGenerator {
|
|
9
|
+
generateRepoPath(baseDir, parsed) {
|
|
10
|
+
return path_1.default.join(baseDir, parsed.domain, parsed.group, parsed.repoName);
|
|
11
|
+
}
|
|
12
|
+
getRelativePath(fullPath, baseDir) {
|
|
13
|
+
return path_1.default.relative(baseDir, fullPath);
|
|
14
|
+
}
|
|
15
|
+
extractRepoName(fullPath) {
|
|
16
|
+
return path_1.default.basename(fullPath);
|
|
17
|
+
}
|
|
18
|
+
extractGroupName(fullPath) {
|
|
19
|
+
return path_1.default.basename(path_1.default.dirname(fullPath));
|
|
20
|
+
}
|
|
21
|
+
extractDomainName(fullPath, baseDir) {
|
|
22
|
+
const relativePath = this.getRelativePath(fullPath, baseDir);
|
|
23
|
+
const parts = relativePath.split(path_1.default.sep);
|
|
24
|
+
return parts[0] || '';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.PathGenerator = PathGenerator;
|
|
28
|
+
exports.pathGenerator = new PathGenerator();
|
|
29
|
+
//# sourceMappingURL=path-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-generator.js","sourceRoot":"","sources":["../../src/core/path-generator.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,MAAa,aAAa;IACxB,gBAAgB,CAAC,OAAe,EAAE,MAAqB;QACrD,OAAO,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1E,CAAC;IAED,eAAe,CAAC,QAAgB,EAAE,OAAe;QAC/C,OAAO,cAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,eAAe,CAAC,QAAgB;QAC9B,OAAO,cAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAED,gBAAgB,CAAC,QAAgB;QAC/B,OAAO,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,iBAAiB,CAAC,QAAgB,EAAE,OAAe;QACjD,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC7D,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,cAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;CACF;AAtBD,sCAsBC;AAEY,QAAA,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IRepositoryInfo, ICloneResult } from '../types';
|
|
2
|
+
export declare class RepositoryManager {
|
|
3
|
+
cloneRepository(url: string, cloneArgs?: string[]): Promise<ICloneResult>;
|
|
4
|
+
listRepositories(refresh?: boolean): Promise<IRepositoryInfo[]>;
|
|
5
|
+
findRepositories(query: string): Promise<IRepositoryInfo[]>;
|
|
6
|
+
removeRepository(identifier: string): Promise<void>;
|
|
7
|
+
repositoryExists(path: string): Promise<boolean>;
|
|
8
|
+
}
|
|
9
|
+
export declare const repositoryManager: RepositoryManager;
|
|
10
|
+
//# sourceMappingURL=repository-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-manager.d.ts","sourceRoot":"","sources":["../../src/core/repository-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAa,MAAM,UAAU,CAAC;AAQpE,qBAAa,iBAAiB;IACtB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IA0C7E,gBAAgB,CAAC,OAAO,GAAE,OAAe,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAStE,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI3D,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBnD,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQvD;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.repositoryManager = exports.RepositoryManager = void 0;
|
|
7
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
|
+
const types_1 = require("../types");
|
|
9
|
+
const config_manager_1 = require("./config-manager");
|
|
10
|
+
const cache_manager_1 = require("./cache-manager");
|
|
11
|
+
const git_executor_1 = require("../utils/git-executor");
|
|
12
|
+
const git_url_parser_1 = require("./git-url-parser");
|
|
13
|
+
const path_generator_1 = require("./path-generator");
|
|
14
|
+
const constants_1 = require("../constants");
|
|
15
|
+
class RepositoryManager {
|
|
16
|
+
async cloneRepository(url, cloneArgs = []) {
|
|
17
|
+
const parsed = (0, git_url_parser_1.parseGitUrl)(url);
|
|
18
|
+
const baseDir = await config_manager_1.configManager.getBaseDirectory();
|
|
19
|
+
const targetPath = path_generator_1.pathGenerator.generateRepoPath(baseDir, parsed);
|
|
20
|
+
const exists = await this.repositoryExists(targetPath);
|
|
21
|
+
if (exists) {
|
|
22
|
+
return {
|
|
23
|
+
success: false,
|
|
24
|
+
path: targetPath,
|
|
25
|
+
message: `Repository already exists at ${targetPath}`,
|
|
26
|
+
alreadyExists: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const result = await git_executor_1.gitExecutor.clone(url, targetPath, cloneArgs);
|
|
30
|
+
if (result.success) {
|
|
31
|
+
const repoInfo = {
|
|
32
|
+
name: parsed.repoName,
|
|
33
|
+
fullPath: targetPath,
|
|
34
|
+
gitUrl: url,
|
|
35
|
+
domain: parsed.domain,
|
|
36
|
+
group: parsed.group,
|
|
37
|
+
lastUpdated: new Date(),
|
|
38
|
+
};
|
|
39
|
+
await cache_manager_1.cacheManager.addRepository(repoInfo);
|
|
40
|
+
return {
|
|
41
|
+
success: true,
|
|
42
|
+
path: targetPath,
|
|
43
|
+
message: `Cloned successfully to ${targetPath}`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
throw new types_1.GitMError(`Failed to clone repository: ${result.stderr}`, constants_1.ERROR_CODES.CLONE_FAILED);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async listRepositories(refresh = false) {
|
|
51
|
+
if (refresh) {
|
|
52
|
+
const baseDir = await config_manager_1.configManager.getBaseDirectory();
|
|
53
|
+
await cache_manager_1.cacheManager.rebuildCache(baseDir);
|
|
54
|
+
}
|
|
55
|
+
return cache_manager_1.cacheManager.getAllRepositories();
|
|
56
|
+
}
|
|
57
|
+
async findRepositories(query) {
|
|
58
|
+
return cache_manager_1.cacheManager.findRepositories(query);
|
|
59
|
+
}
|
|
60
|
+
async removeRepository(identifier) {
|
|
61
|
+
const repos = await this.findRepositories(identifier);
|
|
62
|
+
if (repos.length === 0) {
|
|
63
|
+
throw new types_1.GitMError(`No repository found matching '${identifier}'`, constants_1.ERROR_CODES.NOT_FOUND);
|
|
64
|
+
}
|
|
65
|
+
if (repos.length > 1) {
|
|
66
|
+
throw new types_1.GitMError(`Multiple repositories found. Please be more specific.`, constants_1.ERROR_CODES.NOT_FOUND);
|
|
67
|
+
}
|
|
68
|
+
await cache_manager_1.cacheManager.removeRepository(repos[0].fullPath);
|
|
69
|
+
}
|
|
70
|
+
async repositoryExists(path) {
|
|
71
|
+
try {
|
|
72
|
+
await promises_1.default.access(path);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.RepositoryManager = RepositoryManager;
|
|
81
|
+
exports.repositoryManager = new RepositoryManager();
|
|
82
|
+
//# sourceMappingURL=repository-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-manager.js","sourceRoot":"","sources":["../../src/core/repository-manager.ts"],"names":[],"mappings":";;;;;;AAAA,2DAA6B;AAC7B,oCAAoE;AACpE,qDAAiD;AACjD,mDAA+C;AAC/C,wDAAoD;AACpD,qDAA+C;AAC/C,qDAAiD;AACjD,4CAA2C;AAE3C,MAAa,iBAAiB;IAC5B,KAAK,CAAC,eAAe,CAAC,GAAW,EAAE,YAAsB,EAAE;QACzD,MAAM,MAAM,GAAG,IAAA,4BAAW,EAAC,GAAG,CAAC,CAAC;QAChC,MAAM,OAAO,GAAG,MAAM,8BAAa,CAAC,gBAAgB,EAAE,CAAC;QACvD,MAAM,UAAU,GAAG,8BAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAEnE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACvD,IAAI,MAAM,EAAE,CAAC;YACX,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,gCAAgC,UAAU,EAAE;gBACrD,aAAa,EAAE,IAAI;aACpB,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,0BAAW,CAAC,KAAK,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,CAA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tB,CAAC;QACJ,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,iBAAS,CACjB,uDAAuD,EACvD,uBAAW,CAAC,SAAS,CACtB,CAAC;QACJ,CAAC;QAED,MAAM,4BAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,IAAY;QACjC,IAAI,CAAC;YACH,MAAM,kBAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AApFD,8CAoFC;AAEY,QAAA,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const init_1 = require("./commands/init");
|
|
6
|
+
const add_1 = require("./commands/add");
|
|
7
|
+
const list_1 = require("./commands/list");
|
|
8
|
+
const find_1 = require("./commands/find");
|
|
9
|
+
const remove_1 = require("./commands/remove");
|
|
10
|
+
const config_1 = require("./commands/config");
|
|
11
|
+
const program = new commander_1.Command();
|
|
12
|
+
program
|
|
13
|
+
.name('repo-do')
|
|
14
|
+
.description('Unified git repository management tool')
|
|
15
|
+
.version('1.0.0');
|
|
16
|
+
program
|
|
17
|
+
.command('init')
|
|
18
|
+
.description('Initialize configuration')
|
|
19
|
+
.action(init_1.initCommand);
|
|
20
|
+
program
|
|
21
|
+
.command('add <url>')
|
|
22
|
+
.description('Clone a git repository')
|
|
23
|
+
.allowUnknownOption()
|
|
24
|
+
.action((url, options, command) => {
|
|
25
|
+
const args = command.args.slice(1);
|
|
26
|
+
(0, add_1.addCommand)(url, { args });
|
|
27
|
+
});
|
|
28
|
+
program
|
|
29
|
+
.command('list')
|
|
30
|
+
.description('List all managed repositories')
|
|
31
|
+
.option('--refresh', 'Refresh repository cache')
|
|
32
|
+
.action((options) => {
|
|
33
|
+
(0, list_1.listCommand)({ refresh: options.refresh });
|
|
34
|
+
});
|
|
35
|
+
program
|
|
36
|
+
.command('find <prefix>')
|
|
37
|
+
.description('Find repositories by name prefix')
|
|
38
|
+
.action(find_1.findCommand);
|
|
39
|
+
program
|
|
40
|
+
.command('remove <identifier>')
|
|
41
|
+
.description('Remove repository from management (files not deleted)')
|
|
42
|
+
.action(remove_1.removeCommand);
|
|
43
|
+
program
|
|
44
|
+
.command('config')
|
|
45
|
+
.description('View or modify configuration')
|
|
46
|
+
.option('--get <key>', 'Get configuration value')
|
|
47
|
+
.option('--set <key>', 'Set configuration key')
|
|
48
|
+
.option('--value <value>', 'Configuration value to set')
|
|
49
|
+
.action((options) => {
|
|
50
|
+
(0, config_1.configCommand)({
|
|
51
|
+
get: options.get,
|
|
52
|
+
set: options.set,
|
|
53
|
+
value: options.value,
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
program.parse();
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,wCAA4C;AAC5C,0CAA8C;AAC9C,0CAA8C;AAC9C,8CAAkD;AAClD,8CAAkD;AAElD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,wCAAwC,CAAC;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AAE;IAClB,IAAA,sBAAa,EAAC;QACZ,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface IGitMConfig {
|
|
2
|
+
baseDirectory: string;
|
|
3
|
+
version: string;
|
|
4
|
+
}
|
|
5
|
+
export interface IParsedGitUrl {
|
|
6
|
+
protocol: 'https' | 'ssh';
|
|
7
|
+
domain: string;
|
|
8
|
+
group: string;
|
|
9
|
+
repoName: string;
|
|
10
|
+
originalUrl: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IRepositoryInfo {
|
|
13
|
+
name: string;
|
|
14
|
+
fullPath: string;
|
|
15
|
+
gitUrl: string;
|
|
16
|
+
domain: string;
|
|
17
|
+
group: string;
|
|
18
|
+
lastUpdated: Date;
|
|
19
|
+
}
|
|
20
|
+
export interface IRepositoryCache {
|
|
21
|
+
repositories: IRepositoryInfo[];
|
|
22
|
+
lastUpdated: Date;
|
|
23
|
+
}
|
|
24
|
+
export interface ICloneResult {
|
|
25
|
+
success: boolean;
|
|
26
|
+
path: string;
|
|
27
|
+
message: string;
|
|
28
|
+
alreadyExists?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ICommandOptions {
|
|
31
|
+
cloneArgs?: string[];
|
|
32
|
+
get?: string;
|
|
33
|
+
set?: boolean;
|
|
34
|
+
exact?: boolean;
|
|
35
|
+
refresh?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface IFindResult {
|
|
38
|
+
matches: IRepositoryInfo[];
|
|
39
|
+
query: string;
|
|
40
|
+
}
|
|
41
|
+
export declare class GitMError extends Error {
|
|
42
|
+
code: string;
|
|
43
|
+
constructor(message: string, code: string);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|