gitgrip 0.2.3 → 0.3.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 +75 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -10
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pr/create.d.ts.map +1 -1
- package/dist/commands/pr/create.js +29 -8
- package/dist/commands/pr/create.js.map +1 -1
- package/dist/commands/pr/merge.d.ts.map +1 -1
- package/dist/commands/pr/merge.js +40 -33
- package/dist/commands/pr/merge.js.map +1 -1
- package/dist/commands/pr/status.d.ts.map +1 -1
- package/dist/commands/pr/status.js +15 -11
- package/dist/commands/pr/status.js.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/lib/github.d.ts +28 -4
- package/dist/lib/github.d.ts.map +1 -1
- package/dist/lib/github.js +65 -126
- package/dist/lib/github.js.map +1 -1
- package/dist/lib/linker.d.ts +19 -4
- package/dist/lib/linker.d.ts.map +1 -1
- package/dist/lib/linker.js +107 -16
- package/dist/lib/linker.js.map +1 -1
- package/dist/lib/manifest.d.ts +14 -16
- package/dist/lib/manifest.d.ts.map +1 -1
- package/dist/lib/manifest.js +49 -57
- package/dist/lib/manifest.js.map +1 -1
- package/dist/lib/platform/azure-devops.d.ts +83 -0
- package/dist/lib/platform/azure-devops.d.ts.map +1 -0
- package/dist/lib/platform/azure-devops.js +378 -0
- package/dist/lib/platform/azure-devops.js.map +1 -0
- package/dist/lib/platform/github.d.ts +82 -0
- package/dist/lib/platform/github.d.ts.map +1 -0
- package/dist/lib/platform/github.js +285 -0
- package/dist/lib/platform/github.js.map +1 -0
- package/dist/lib/platform/gitlab.d.ts +82 -0
- package/dist/lib/platform/gitlab.d.ts.map +1 -0
- package/dist/lib/platform/gitlab.js +331 -0
- package/dist/lib/platform/gitlab.js.map +1 -0
- package/dist/lib/platform/index.d.ts +60 -0
- package/dist/lib/platform/index.d.ts.map +1 -0
- package/dist/lib/platform/index.js +132 -0
- package/dist/lib/platform/index.js.map +1 -0
- package/dist/lib/platform/types.d.ts +162 -0
- package/dist/lib/platform/types.d.ts.map +1 -0
- package/dist/lib/platform/types.js +5 -0
- package/dist/lib/platform/types.js.map +1 -0
- package/dist/types.d.ts +39 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/commands/migrate.d.ts +0 -17
- package/dist/commands/migrate.d.ts.map +0 -1
- package/dist/commands/migrate.js +0 -180
- package/dist/commands/migrate.js.map +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform types for multi-platform hosting support (GitHub, GitLab, Azure DevOps)
|
|
3
|
+
*/
|
|
4
|
+
export type PlatformType = 'github' | 'gitlab' | 'azure-devops';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for a hosting platform, including self-hosted instances
|
|
7
|
+
*/
|
|
8
|
+
export interface PlatformConfig {
|
|
9
|
+
type: PlatformType;
|
|
10
|
+
/** Base URL for self-hosted instances (e.g., https://gitlab.company.com) */
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parsed repository information from a git URL
|
|
15
|
+
*/
|
|
16
|
+
export interface ParsedRepoInfo {
|
|
17
|
+
owner: string;
|
|
18
|
+
repo: string;
|
|
19
|
+
/** For Azure DevOps: the project name */
|
|
20
|
+
project?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Pull request state across all platforms
|
|
24
|
+
*/
|
|
25
|
+
export type PRState = 'open' | 'closed' | 'merged';
|
|
26
|
+
/**
|
|
27
|
+
* Normalized pull request information across platforms
|
|
28
|
+
*/
|
|
29
|
+
export interface PullRequest {
|
|
30
|
+
number: number;
|
|
31
|
+
url: string;
|
|
32
|
+
title: string;
|
|
33
|
+
body: string;
|
|
34
|
+
state: PRState;
|
|
35
|
+
merged: boolean;
|
|
36
|
+
mergeable: boolean | null;
|
|
37
|
+
head: {
|
|
38
|
+
ref: string;
|
|
39
|
+
sha: string;
|
|
40
|
+
};
|
|
41
|
+
base: {
|
|
42
|
+
ref: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Options for creating a pull request
|
|
47
|
+
*/
|
|
48
|
+
export interface PRCreateOptions {
|
|
49
|
+
title: string;
|
|
50
|
+
body?: string;
|
|
51
|
+
base?: string;
|
|
52
|
+
draft?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Options for merging a pull request
|
|
56
|
+
*/
|
|
57
|
+
export interface PRMergeOptions {
|
|
58
|
+
method?: 'merge' | 'squash' | 'rebase';
|
|
59
|
+
deleteBranch?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Result of creating a pull request
|
|
63
|
+
*/
|
|
64
|
+
export interface PRCreateResult {
|
|
65
|
+
number: number;
|
|
66
|
+
url: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Review information
|
|
70
|
+
*/
|
|
71
|
+
export interface PRReview {
|
|
72
|
+
state: string;
|
|
73
|
+
user: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Status check result
|
|
77
|
+
*/
|
|
78
|
+
export interface StatusCheckResult {
|
|
79
|
+
state: 'success' | 'failure' | 'pending';
|
|
80
|
+
statuses: {
|
|
81
|
+
context: string;
|
|
82
|
+
state: string;
|
|
83
|
+
}[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Interface for hosting platform adapters
|
|
87
|
+
* Each platform (GitHub, GitLab, Azure DevOps) implements this interface
|
|
88
|
+
*/
|
|
89
|
+
export interface HostingPlatform {
|
|
90
|
+
/** Platform type identifier */
|
|
91
|
+
readonly type: PlatformType;
|
|
92
|
+
/**
|
|
93
|
+
* Get authentication token for API calls
|
|
94
|
+
* @throws Error if token is not available
|
|
95
|
+
*/
|
|
96
|
+
getToken(): Promise<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Create a pull request
|
|
99
|
+
*/
|
|
100
|
+
createPullRequest(owner: string, repo: string, head: string, base: string, title: string, body?: string, draft?: boolean): Promise<PRCreateResult>;
|
|
101
|
+
/**
|
|
102
|
+
* Get pull request details
|
|
103
|
+
*/
|
|
104
|
+
getPullRequest(owner: string, repo: string, pullNumber: number): Promise<PullRequest>;
|
|
105
|
+
/**
|
|
106
|
+
* Update pull request body
|
|
107
|
+
*/
|
|
108
|
+
updatePullRequestBody(owner: string, repo: string, pullNumber: number, body: string): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Merge a pull request
|
|
111
|
+
* @returns true if merge succeeded, false otherwise
|
|
112
|
+
*/
|
|
113
|
+
mergePullRequest(owner: string, repo: string, pullNumber: number, options?: PRMergeOptions): Promise<boolean>;
|
|
114
|
+
/**
|
|
115
|
+
* Find an open PR by branch name
|
|
116
|
+
*/
|
|
117
|
+
findPRByBranch(owner: string, repo: string, branch: string): Promise<PRCreateResult | null>;
|
|
118
|
+
/**
|
|
119
|
+
* Check if PR is approved (has approval, no changes requested)
|
|
120
|
+
*/
|
|
121
|
+
isPullRequestApproved(owner: string, repo: string, pullNumber: number): Promise<boolean>;
|
|
122
|
+
/**
|
|
123
|
+
* Get reviews for a PR
|
|
124
|
+
*/
|
|
125
|
+
getPullRequestReviews(owner: string, repo: string, pullNumber: number): Promise<PRReview[]>;
|
|
126
|
+
/**
|
|
127
|
+
* Get CI/CD status checks for a commit
|
|
128
|
+
*/
|
|
129
|
+
getStatusChecks(owner: string, repo: string, ref: string): Promise<StatusCheckResult>;
|
|
130
|
+
/**
|
|
131
|
+
* Parse a git URL to extract owner/repo information
|
|
132
|
+
* @returns null if URL doesn't match this platform
|
|
133
|
+
*/
|
|
134
|
+
parseRepoUrl(url: string): ParsedRepoInfo | null;
|
|
135
|
+
/**
|
|
136
|
+
* Check if a URL belongs to this platform
|
|
137
|
+
*/
|
|
138
|
+
matchesUrl(url: string): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Generate HTML comment for linked PR tracking
|
|
141
|
+
*/
|
|
142
|
+
generateLinkedPRComment(links: {
|
|
143
|
+
repoName: string;
|
|
144
|
+
number: number;
|
|
145
|
+
}[]): string;
|
|
146
|
+
/**
|
|
147
|
+
* Parse linked PR references from PR body
|
|
148
|
+
*/
|
|
149
|
+
parseLinkedPRComment(body: string): {
|
|
150
|
+
repoName: string;
|
|
151
|
+
number: number;
|
|
152
|
+
}[];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Options for Azure DevOps that require project context
|
|
156
|
+
*/
|
|
157
|
+
export interface AzureDevOpsContext {
|
|
158
|
+
organization: string;
|
|
159
|
+
project: string;
|
|
160
|
+
repository: string;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/platform/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,cAAc,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf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,MAAM,GAAG,OAAO,CAAC;IAGjC;;OAEG;IACH,uBAAuB,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,MAAM,CAAC;IAE/E;;OAEG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC5E;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/platform/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hosting platform type for repositories
|
|
3
|
+
*/
|
|
4
|
+
export type PlatformType = 'github' | 'gitlab' | 'azure-devops';
|
|
5
|
+
/**
|
|
6
|
+
* Platform configuration for self-hosted instances
|
|
7
|
+
*/
|
|
8
|
+
export interface PlatformConfig {
|
|
9
|
+
type: PlatformType;
|
|
10
|
+
/** Base URL for self-hosted instances (e.g., https://gitlab.company.com) */
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
}
|
|
1
13
|
/**
|
|
2
14
|
* Configuration for copying a file from repo to workspace
|
|
3
15
|
*/
|
|
@@ -30,6 +42,8 @@ export interface RepoConfig {
|
|
|
30
42
|
copyfile?: CopyFileConfig[];
|
|
31
43
|
/** Symlinks to create from repo to workspace */
|
|
32
44
|
linkfile?: LinkFileConfig[];
|
|
45
|
+
/** Optional platform override (auto-detected from URL if not specified) */
|
|
46
|
+
platform?: PlatformConfig;
|
|
33
47
|
}
|
|
34
48
|
/**
|
|
35
49
|
* Configuration for the manifest repository itself
|
|
@@ -43,6 +57,8 @@ export interface ManifestRepoConfig {
|
|
|
43
57
|
copyfile?: CopyFileConfig[];
|
|
44
58
|
/** Symlinks to create from manifest repo to workspace */
|
|
45
59
|
linkfile?: LinkFileConfig[];
|
|
60
|
+
/** Optional platform override (auto-detected from URL if not specified) */
|
|
61
|
+
platform?: PlatformConfig;
|
|
46
62
|
}
|
|
47
63
|
/**
|
|
48
64
|
* Global settings for the manifest
|
|
@@ -126,10 +142,14 @@ export interface RepoInfo extends RepoConfig {
|
|
|
126
142
|
name: string;
|
|
127
143
|
/** Absolute path on disk */
|
|
128
144
|
absolutePath: string;
|
|
129
|
-
/** Owner from
|
|
145
|
+
/** Owner/namespace from git URL (for Azure DevOps: org/project) */
|
|
130
146
|
owner: string;
|
|
131
|
-
/** Repo name from
|
|
147
|
+
/** Repo name from git URL */
|
|
132
148
|
repo: string;
|
|
149
|
+
/** Detected or configured platform type */
|
|
150
|
+
platformType: PlatformType;
|
|
151
|
+
/** Project name (Azure DevOps only) */
|
|
152
|
+
project?: string;
|
|
133
153
|
}
|
|
134
154
|
/**
|
|
135
155
|
* Status of a single repository
|
|
@@ -160,9 +180,9 @@ export interface RepoStatus {
|
|
|
160
180
|
export interface LinkedPR {
|
|
161
181
|
/** Repository name (from manifest) */
|
|
162
182
|
repoName: string;
|
|
163
|
-
/** Owner
|
|
183
|
+
/** Owner/namespace from git URL */
|
|
164
184
|
owner: string;
|
|
165
|
-
/** Repo name
|
|
185
|
+
/** Repo name from git URL */
|
|
166
186
|
repo: string;
|
|
167
187
|
/** PR number */
|
|
168
188
|
number: number;
|
|
@@ -176,6 +196,8 @@ export interface LinkedPR {
|
|
|
176
196
|
checksPass: boolean;
|
|
177
197
|
/** Whether PR is mergeable */
|
|
178
198
|
mergeable: boolean;
|
|
199
|
+
/** Hosting platform type */
|
|
200
|
+
platformType?: PlatformType;
|
|
179
201
|
}
|
|
180
202
|
/**
|
|
181
203
|
* A manifest PR that tracks linked child PRs
|
|
@@ -245,12 +267,24 @@ export interface PRMergeOptions {
|
|
|
245
267
|
force?: boolean;
|
|
246
268
|
}
|
|
247
269
|
/**
|
|
248
|
-
*
|
|
270
|
+
* Repository info extracted from URL (platform-agnostic)
|
|
271
|
+
* @deprecated Use ParsedRepoInfo from platform/types.ts instead
|
|
249
272
|
*/
|
|
250
273
|
export interface GitHubRepoInfo {
|
|
251
274
|
owner: string;
|
|
252
275
|
repo: string;
|
|
253
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Repository info extracted from git URL (platform-agnostic)
|
|
279
|
+
*/
|
|
280
|
+
export interface ParsedRepoInfo {
|
|
281
|
+
owner: string;
|
|
282
|
+
repo: string;
|
|
283
|
+
/** Project name (Azure DevOps only) */
|
|
284
|
+
project?: string;
|
|
285
|
+
/** Detected platform type */
|
|
286
|
+
platform?: PlatformType;
|
|
287
|
+
}
|
|
254
288
|
/**
|
|
255
289
|
* Status of a file link (copyfile or linkfile)
|
|
256
290
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,g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;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitgrip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "git a grip - Multi-repo workflow tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"multi-repo",
|
|
24
24
|
"monorepo",
|
|
25
25
|
"github",
|
|
26
|
+
"gitlab",
|
|
27
|
+
"azure-devops",
|
|
26
28
|
"pr",
|
|
27
29
|
"cli",
|
|
28
30
|
"workflow"
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface MigrateOptions {
|
|
2
|
-
force?: boolean;
|
|
3
|
-
remote?: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Migrate from old codi-repos.yaml format to new .gitgrip/manifests/ structure
|
|
7
|
-
*
|
|
8
|
-
* This command:
|
|
9
|
-
* 1. Finds codi-repos.yaml in current or parent directory
|
|
10
|
-
* 2. Creates .gitgrip/manifests/ as a new git repo
|
|
11
|
-
* 3. Moves codi-repos.yaml to .gitgrip/manifests/manifest.yaml
|
|
12
|
-
* 4. Commits the manifest
|
|
13
|
-
* 5. Optionally pushes to a remote
|
|
14
|
-
*/
|
|
15
|
-
export declare function migrate(options?: MigrateOptions): Promise<void>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAaA,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyKzE"}
|
package/dist/commands/migrate.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { mkdir, readFile, writeFile, rm } from 'fs/promises';
|
|
2
|
-
import { resolve, dirname } from 'path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import ora from 'ora';
|
|
5
|
-
import inquirer from 'inquirer';
|
|
6
|
-
import { simpleGit } from 'simple-git';
|
|
7
|
-
import { findLegacyManifestPath, getNewGitgripDir, getManifestsDir, } from '../lib/manifest.js';
|
|
8
|
-
import { pathExists } from '../lib/git.js';
|
|
9
|
-
/**
|
|
10
|
-
* Migrate from old codi-repos.yaml format to new .gitgrip/manifests/ structure
|
|
11
|
-
*
|
|
12
|
-
* This command:
|
|
13
|
-
* 1. Finds codi-repos.yaml in current or parent directory
|
|
14
|
-
* 2. Creates .gitgrip/manifests/ as a new git repo
|
|
15
|
-
* 3. Moves codi-repos.yaml to .gitgrip/manifests/manifest.yaml
|
|
16
|
-
* 4. Commits the manifest
|
|
17
|
-
* 5. Optionally pushes to a remote
|
|
18
|
-
*/
|
|
19
|
-
export async function migrate(options = {}) {
|
|
20
|
-
// Find legacy manifest
|
|
21
|
-
const legacyPath = await findLegacyManifestPath();
|
|
22
|
-
if (!legacyPath) {
|
|
23
|
-
console.log(chalk.yellow('No legacy codi-repos.yaml found.'));
|
|
24
|
-
console.log(chalk.dim('This workspace may already be using the new format, or not initialized.'));
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const workspaceRoot = dirname(legacyPath);
|
|
28
|
-
const gitgripDir = getNewGitgripDir(workspaceRoot);
|
|
29
|
-
const manifestsDir = getManifestsDir(workspaceRoot);
|
|
30
|
-
console.log(chalk.blue('Migration Plan:'));
|
|
31
|
-
console.log(chalk.dim(` From: ${legacyPath}`));
|
|
32
|
-
console.log(chalk.dim(` To: ${manifestsDir}/manifest.yaml`));
|
|
33
|
-
console.log('');
|
|
34
|
-
// Check if .gitgrip already exists
|
|
35
|
-
if (await pathExists(gitgripDir)) {
|
|
36
|
-
if (!options.force) {
|
|
37
|
-
const { proceed } = await inquirer.prompt([
|
|
38
|
-
{
|
|
39
|
-
type: 'confirm',
|
|
40
|
-
name: 'proceed',
|
|
41
|
-
message: '.gitgrip/ already exists. Overwrite?',
|
|
42
|
-
default: false,
|
|
43
|
-
},
|
|
44
|
-
]);
|
|
45
|
-
if (!proceed) {
|
|
46
|
-
console.log('Migration cancelled.');
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// Remove existing .gitgrip
|
|
51
|
-
await rm(gitgripDir, { recursive: true, force: true });
|
|
52
|
-
}
|
|
53
|
-
// Ask for confirmation
|
|
54
|
-
if (!options.force) {
|
|
55
|
-
const { confirm } = await inquirer.prompt([
|
|
56
|
-
{
|
|
57
|
-
type: 'confirm',
|
|
58
|
-
name: 'confirm',
|
|
59
|
-
message: 'Proceed with migration?',
|
|
60
|
-
default: true,
|
|
61
|
-
},
|
|
62
|
-
]);
|
|
63
|
-
if (!confirm) {
|
|
64
|
-
console.log('Migration cancelled.');
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
// Create .gitgrip/manifests/ directory
|
|
69
|
-
const mkdirSpinner = ora('Creating .gitgrip/manifests/...').start();
|
|
70
|
-
try {
|
|
71
|
-
await mkdir(manifestsDir, { recursive: true });
|
|
72
|
-
mkdirSpinner.succeed('Created .gitgrip/manifests/');
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
mkdirSpinner.fail('Failed to create directories');
|
|
76
|
-
throw error;
|
|
77
|
-
}
|
|
78
|
-
// Read legacy manifest content
|
|
79
|
-
const legacyContent = await readFile(legacyPath, 'utf-8');
|
|
80
|
-
// Write to new location
|
|
81
|
-
const writeSpinner = ora('Moving manifest...').start();
|
|
82
|
-
try {
|
|
83
|
-
await writeFile(resolve(manifestsDir, 'manifest.yaml'), legacyContent, 'utf-8');
|
|
84
|
-
writeSpinner.succeed('Created manifest.yaml');
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
writeSpinner.fail('Failed to write manifest.yaml');
|
|
88
|
-
throw error;
|
|
89
|
-
}
|
|
90
|
-
// Initialize git repo in manifests directory
|
|
91
|
-
const gitSpinner = ora('Initializing git repository...').start();
|
|
92
|
-
try {
|
|
93
|
-
const git = simpleGit(manifestsDir);
|
|
94
|
-
await git.init();
|
|
95
|
-
await git.add('manifest.yaml');
|
|
96
|
-
await git.commit('chore: migrate manifest from codi-repos.yaml');
|
|
97
|
-
gitSpinner.succeed('Initialized git repository with initial commit');
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
gitSpinner.fail('Failed to initialize git repository');
|
|
101
|
-
throw error;
|
|
102
|
-
}
|
|
103
|
-
// Optionally add remote and push
|
|
104
|
-
let remoteUrl = options.remote;
|
|
105
|
-
if (!remoteUrl) {
|
|
106
|
-
const { addRemote } = await inquirer.prompt([
|
|
107
|
-
{
|
|
108
|
-
type: 'confirm',
|
|
109
|
-
name: 'addRemote',
|
|
110
|
-
message: 'Would you like to push the manifest to a remote repository?',
|
|
111
|
-
default: false,
|
|
112
|
-
},
|
|
113
|
-
]);
|
|
114
|
-
if (addRemote) {
|
|
115
|
-
const { url } = await inquirer.prompt([
|
|
116
|
-
{
|
|
117
|
-
type: 'input',
|
|
118
|
-
name: 'url',
|
|
119
|
-
message: 'Enter the remote URL (e.g., git@github.com:user/manifests.git):',
|
|
120
|
-
},
|
|
121
|
-
]);
|
|
122
|
-
remoteUrl = url;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (remoteUrl) {
|
|
126
|
-
const pushSpinner = ora('Pushing to remote...').start();
|
|
127
|
-
try {
|
|
128
|
-
const git = simpleGit(manifestsDir);
|
|
129
|
-
await git.addRemote('origin', remoteUrl);
|
|
130
|
-
await git.push(['-u', 'origin', 'main']);
|
|
131
|
-
pushSpinner.succeed(`Pushed to ${remoteUrl}`);
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
pushSpinner.fail('Failed to push to remote');
|
|
135
|
-
console.error(chalk.dim(`Error: ${error instanceof Error ? error.message : error}`));
|
|
136
|
-
console.log(chalk.dim('You can add the remote manually later.'));
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
// Remove old manifest file
|
|
140
|
-
const removeSpinner = ora('Removing old codi-repos.yaml...').start();
|
|
141
|
-
try {
|
|
142
|
-
await rm(legacyPath);
|
|
143
|
-
removeSpinner.succeed('Removed old codi-repos.yaml');
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
removeSpinner.warn('Could not remove old codi-repos.yaml (you may want to remove it manually)');
|
|
147
|
-
}
|
|
148
|
-
// Remove old .gitgrip entries from .gitignore if present
|
|
149
|
-
const gitignorePath = resolve(workspaceRoot, '.gitignore');
|
|
150
|
-
if (await pathExists(gitignorePath)) {
|
|
151
|
-
try {
|
|
152
|
-
const gitignoreContent = await readFile(gitignorePath, 'utf-8');
|
|
153
|
-
// The workspace is no longer a git repo, but clean up anyway
|
|
154
|
-
console.log(chalk.dim('Note: .gitignore file remains; you may want to remove it if the workspace is no longer a git repo.'));
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
// Ignore
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
console.log('');
|
|
161
|
-
console.log(chalk.green('Migration complete!'));
|
|
162
|
-
console.log('');
|
|
163
|
-
console.log(chalk.dim('Your workspace is now using the AOSP-style structure:'));
|
|
164
|
-
console.log(chalk.cyan(` ${workspaceRoot}/`));
|
|
165
|
-
console.log(chalk.cyan(' ├── .gitgrip/'));
|
|
166
|
-
console.log(chalk.cyan(' │ └── manifests/'));
|
|
167
|
-
console.log(chalk.cyan(' │ ├── .git/'));
|
|
168
|
-
console.log(chalk.cyan(' │ └── manifest.yaml'));
|
|
169
|
-
console.log(chalk.cyan(' └── <your repos>/'));
|
|
170
|
-
console.log('');
|
|
171
|
-
console.log(chalk.dim('Run `gr status` to verify everything is working.'));
|
|
172
|
-
if (!remoteUrl) {
|
|
173
|
-
console.log('');
|
|
174
|
-
console.log(chalk.yellow('Tip: Consider pushing your manifest to a remote for team sharing:'));
|
|
175
|
-
console.log(chalk.dim(` cd ${manifestsDir}`));
|
|
176
|
-
console.log(chalk.dim(' git remote add origin <your-manifest-repo-url>'));
|
|
177
|
-
console.log(chalk.dim(' git push -u origin main'));
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
//# sourceMappingURL=migrate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAU,EAAE,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,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