@simbo/git-changes 2.0.0 → 2.1.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/CHANGELOG.md
CHANGED
|
@@ -15,47 +15,34 @@ export type GitChangeStatusAdded = GitChangeStatus.Added;
|
|
|
15
15
|
* Untracked Git change status (only for unstaged changes).
|
|
16
16
|
*/
|
|
17
17
|
export type GitChangeStatusUntracked = GitChangeStatus.Untracked;
|
|
18
|
+
/**
|
|
19
|
+
* Combined type for staged changes field.
|
|
20
|
+
*/
|
|
18
21
|
export type GitChangeStagedStatus = GitChangeStatusCommon | GitChangeStatusAdded | GitChangeStatusWithOriginPath;
|
|
19
|
-
export type GitChangeUnstagedStatus = GitChangeStatusCommon | GitChangeStatusUntracked | GitChangeStatusWithOriginPath;
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* Combined type for unstaged changes field.
|
|
22
24
|
*/
|
|
23
|
-
export type
|
|
25
|
+
export type GitChangeUnstagedStatus = GitChangeStatusCommon | GitChangeStatusUntracked | GitChangeStatusWithOriginPath;
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
27
|
+
* Interface for a change in a Git repository.
|
|
26
28
|
*/
|
|
27
|
-
export interface
|
|
29
|
+
export interface GitChange {
|
|
28
30
|
/**
|
|
29
31
|
* The file path of the change.
|
|
30
32
|
*/
|
|
31
33
|
path: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* A change in a Git repository that is staged.
|
|
35
|
-
*/
|
|
36
|
-
export interface GitChangeStaged {
|
|
37
34
|
/**
|
|
38
|
-
* The status of the change
|
|
35
|
+
* The status of the change if it is staged.
|
|
39
36
|
* This can be one of the GitChangeStatus values or undefined if not staged.
|
|
40
37
|
*/
|
|
41
|
-
staged
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* A change in a Git repository that is unstaged.
|
|
45
|
-
*/
|
|
46
|
-
export interface GitChangeUnstaged {
|
|
38
|
+
staged?: GitChangeStagedStatus;
|
|
47
39
|
/**
|
|
48
|
-
* The status of the change
|
|
40
|
+
* The status of the change if it is unstaged.
|
|
49
41
|
* This can be one of the GitChangeStatus values or undefined if not unstaged.
|
|
50
42
|
*/
|
|
51
|
-
unstaged
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* A change in a Git repository that includes an origin path.
|
|
55
|
-
*/
|
|
56
|
-
export interface GitChangeWithOriginPath {
|
|
43
|
+
unstaged?: GitChangeUnstagedStatus;
|
|
57
44
|
/**
|
|
58
45
|
* The original file path before the change (for renamed or copied files).
|
|
59
46
|
*/
|
|
60
|
-
originPath
|
|
47
|
+
originPath?: string;
|
|
61
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GitChange } from './git-changes.types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Parses a Git change status string into staged and unstaged statuses.
|
|
4
4
|
*
|
|
@@ -13,7 +13,4 @@ import type { GitChangeStagedStatus, GitChangeUnstagedStatus } from './git-chang
|
|
|
13
13
|
* @param status - A two-character string representing the Git change status.
|
|
14
14
|
* @returns An object containing the staged and unstaged statuses.
|
|
15
15
|
*/
|
|
16
|
-
export declare function parseGitChangeStatus(status: string):
|
|
17
|
-
staged: GitChangeStagedStatus | undefined;
|
|
18
|
-
unstaged: GitChangeUnstagedStatus | undefined;
|
|
19
|
-
};
|
|
16
|
+
export declare function parseGitChangeStatus(status: string): Pick<GitChange, 'staged' | 'unstaged'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-git-change-status.js","sourceRoot":"","sources":["../src/parse-git-change-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAc;
|
|
1
|
+
{"version":3,"file":"parse-git-change-status.js","sourceRoot":"","sources":["../src/parse-git-change-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACpD,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAC3D,IAAI,IAAI,IAAI,KAAK,GAAG,IAAI,yBAAyB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CACH,CAAC;IAE9E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC"}
|
package/package.json
CHANGED