@simbo/git-changes 1.0.1 → 1.0.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/CHANGELOG.md +6 -0
- package/dist/get-git-changes.d.ts +1 -1
- package/dist/git-changes.types.d.ts +27 -0
- package/dist/git-changes.types.js +2 -0
- package/dist/git-changes.types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/parse-git-change-status.d.ts +1 -1
- package/dist/parse-git-status-output.d.ts +1 -1
- package/package.json +4 -4
- package/dist/git-change.interface.d.ts +0 -25
- package/dist/git-change.interface.js +0 -2
- package/dist/git-change.interface.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GitChangeStatus } from './git-change-status.enum.js';
|
|
2
|
+
export type GitChangeStagedStatus = GitChangeStatus.Added | GitChangeStatus.Modified | GitChangeStatus.Deleted | GitChangeStatus.Renamed | GitChangeStatus.Copied;
|
|
3
|
+
export type GitChangeUnstagedStatus = GitChangeStatus.Untracked | GitChangeStatus.Modified | GitChangeStatus.Deleted | GitChangeStatus.Renamed | GitChangeStatus.Copied;
|
|
4
|
+
/**
|
|
5
|
+
* Represents a change in a Git repository.
|
|
6
|
+
*/
|
|
7
|
+
export interface GitChange<Staged extends GitChangeStagedStatus | undefined = GitChangeStagedStatus | undefined, Unstaged extends GitChangeUnstagedStatus | undefined = GitChangeUnstagedStatus | undefined> {
|
|
8
|
+
/**
|
|
9
|
+
* The file path of the change.
|
|
10
|
+
*/
|
|
11
|
+
path: string;
|
|
12
|
+
/**
|
|
13
|
+
* The origin file path if the change is a rename or copy.
|
|
14
|
+
* This is only set for changes that involve renaming or copying files.
|
|
15
|
+
*/
|
|
16
|
+
originPath?: Staged extends GitChangeStatus.Renamed | GitChangeStatus.Copied ? string : Unstaged extends GitChangeStatus.Renamed | GitChangeStatus.Copied ? string : undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The status of the change when it is staged.
|
|
19
|
+
* This can be one of the GitChangeStatus values or undefined if not staged.
|
|
20
|
+
*/
|
|
21
|
+
staged?: Staged;
|
|
22
|
+
/**
|
|
23
|
+
* The status of the change when it is unstaged.
|
|
24
|
+
* This can be one of the GitChangeStatus values or undefined if not unstaged.
|
|
25
|
+
*/
|
|
26
|
+
unstaged?: Unstaged;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-changes.types.js","sourceRoot":"","sources":["../src/git-changes.types.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './get-git-changes.js';
|
|
2
2
|
export * from './git-change-status.enum.js';
|
|
3
|
-
export type * from './git-
|
|
3
|
+
export type * from './git-changes.types.js';
|
|
4
4
|
export * from './git-status-constants.js';
|
|
5
5
|
export * from './parse-git-change-status.js';
|
|
6
6
|
export * from './parse-git-status-output.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simbo/git-changes",
|
|
3
3
|
"description": "A library to read, parse and provide Git changes information from `git status` for a local repository.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"git",
|
|
7
7
|
"changes",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"prettier": "^3.7.4",
|
|
48
48
|
"typescript": "^5.9.3",
|
|
49
49
|
"vitest": "^3.2.4",
|
|
50
|
-
"@simbo/eslint-config": "2.0.
|
|
51
|
-
"@simbo/
|
|
52
|
-
"@simbo/
|
|
50
|
+
"@simbo/eslint-config": "2.0.4",
|
|
51
|
+
"@simbo/tsconfig": "1.0.4",
|
|
52
|
+
"@simbo/prettier-config": "2.0.0"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { GitChangeStatus } from './git-change-status.enum.js';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a change in a Git repository.
|
|
4
|
-
*/
|
|
5
|
-
export interface GitChange {
|
|
6
|
-
/**
|
|
7
|
-
* The file path of the change.
|
|
8
|
-
*/
|
|
9
|
-
path: string;
|
|
10
|
-
/**
|
|
11
|
-
* The origin file path if the change is a rename or copy.
|
|
12
|
-
* This is only set for changes that involve renaming or copying files.
|
|
13
|
-
*/
|
|
14
|
-
originPath?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The status of the change when it is staged.
|
|
17
|
-
* This can be one of the GitChangeStatus values or undefined if not staged.
|
|
18
|
-
*/
|
|
19
|
-
staged?: GitChangeStatus.Added | GitChangeStatus.Modified | GitChangeStatus.Deleted | GitChangeStatus.Renamed | GitChangeStatus.Copied;
|
|
20
|
-
/**
|
|
21
|
-
* The status of the change when it is unstaged.
|
|
22
|
-
* This can be one of the GitChangeStatus values or undefined if not unstaged.
|
|
23
|
-
*/
|
|
24
|
-
unstaged?: GitChangeStatus.Untracked | GitChangeStatus.Modified | GitChangeStatus.Deleted | GitChangeStatus.Renamed | GitChangeStatus.Copied;
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-change.interface.js","sourceRoot":"","sources":["../src/git-change.interface.ts"],"names":[],"mappings":""}
|