git-er-done 0.1.12 → 0.1.14

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/package.json CHANGED
@@ -1,22 +1,58 @@
1
1
  {
2
2
  "name": "git-er-done",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Utility for dealing with modified, created, deleted files since a git commit",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
7
7
  "exports": {
8
- ".": "./src/index.js",
9
- "./get-commit": "./src/git/commits/getCommit.js",
10
- "./get-all-commits": "./src/git/commits/getAllCommits.js",
11
- "./get-first-commit": "./src/git/commits/getFirstCommit.js",
12
- "./get-last-commit": "./src/git/commits/getLastCommit.js",
13
- "./get-details": "./src/git/getDetails.js",
14
- "./get-root": "./src/git/getGitRoot.js",
15
- "./get-files": "./src/git/getGitFiles.js",
16
- "./get-file-at-commit": "./src/git/getFileAtCommit.js",
17
- "./get-diff-formatted": "./src/git/getDiffFormatted.js",
18
- "./get-file-dates": "./src/git/dates/getFileDates.js",
19
- "./get-remotes": "./src/git/remotes/getRemotes.js"
8
+ ".": {
9
+ "types": "./types/index.d.ts",
10
+ "default": "./src/index.js"
11
+ },
12
+ "./get-commit": {
13
+ "types": "./types/git/commits/getCommit.d.ts",
14
+ "default": "./src/git/commits/getCommit.js"
15
+ },
16
+ "./get-all-commits": {
17
+ "types": "./types/git/commits/getAllCommits.d.ts",
18
+ "default": "./src/git/commits/getAllCommits.js"
19
+ },
20
+ "./get-first-commit": {
21
+ "types": "./types/git/commits/getFirstCommit.d.ts",
22
+ "default": "./src/git/commits/getFirstCommit.js"
23
+ },
24
+ "./get-last-commit": {
25
+ "types": "./types/git/commits/getLastCommit.d.ts",
26
+ "default": "./src/git/commits/getLastCommit.js"
27
+ },
28
+ "./get-details": {
29
+ "types": "./types/git/getDetails.d.ts",
30
+ "default": "./src/git/getDetails.js"
31
+ },
32
+ "./get-root": {
33
+ "types": "./types/git/getGitRoot.d.ts",
34
+ "default": "./src/git/getGitRoot.js"
35
+ },
36
+ "./get-files": {
37
+ "types": "./types/git/getGitFiles.d.ts",
38
+ "default": "./src/git/getGitFiles.js"
39
+ },
40
+ "./get-file-at-commit": {
41
+ "types": "./types/git/getFileAtCommit.d.ts",
42
+ "default": "./src/git/getFileAtCommit.js"
43
+ },
44
+ "./get-diff-formatted": {
45
+ "types": "./types/git/getDiffFormatted.d.ts",
46
+ "default": "./src/git/getDiffFormatted.js"
47
+ },
48
+ "./get-file-dates": {
49
+ "types": "./types/git/dates/getFileDates.d.ts",
50
+ "default": "./src/git/dates/getFileDates.js"
51
+ },
52
+ "./get-remotes": {
53
+ "types": "./types/git/remotes/getRemotes.d.ts",
54
+ "default": "./src/git/remotes/getRemotes.js"
55
+ }
20
56
  },
21
57
  "scripts": {
22
58
  "test": "uvu . \\.test\\.js$",
@@ -55,12 +55,13 @@ function getLongestLineLength(diff) {
55
55
  * Get formatted diff for a specific file
56
56
  * @param {Object} options - Options for getting formatted diff
57
57
  * @param {string} options.filePath - Relative path from git root
58
- * @param {string} options.gitRootDir - Absolute path to git root directory
59
- * @param {string} options.baseBranch - Base branch to compare against
60
- * @param {boolean} options.shrinkToLongestLine - Auto-calculate width based on longest line
61
- * @param {number} options.leftMargin - Number of spaces to add to the left of each line
62
- * @param {number} options.width - Width of the diff output (ignored if shrinkToLongestLine is true)
63
- * @param {boolean} options.hideHeader - Remove the file path header from the diff
58
+ * @param {string} [options.gitRootDir] - Absolute path to git root directory (defaults to detected git root)
59
+ * @param {string} [options.baseBranch='master'] - Base branch to compare against
60
+ * @param {boolean} [options.shrinkToLongestLine=false] - Auto-calculate width based on longest line
61
+ * @param {number} [options.leftMargin=0] - Number of spaces to add to the left of each line
62
+ * @param {number} [options.width=140] - Width of the diff output (ignored if shrinkToLongestLine is true)
63
+ * @param {boolean} [options.hideHeader=false] - Remove the file path header from the diff
64
+ * @returns {Promise<string | null>} Formatted diff string or null if no diff
64
65
  */
65
66
  async function getFormattedDiff({
66
67
  filePath,
@@ -2,19 +2,20 @@
2
2
  * Get formatted diff for a specific file
3
3
  * @param {Object} options - Options for getting formatted diff
4
4
  * @param {string} options.filePath - Relative path from git root
5
- * @param {string} options.gitRootDir - Absolute path to git root directory
6
- * @param {string} options.baseBranch - Base branch to compare against
7
- * @param {boolean} options.shrinkToLongestLine - Auto-calculate width based on longest line
8
- * @param {number} options.leftMargin - Number of spaces to add to the left of each line
9
- * @param {number} options.width - Width of the diff output (ignored if shrinkToLongestLine is true)
10
- * @param {boolean} options.hideHeader - Remove the file path header from the diff
5
+ * @param {string} [options.gitRootDir] - Absolute path to git root directory (defaults to detected git root)
6
+ * @param {string} [options.baseBranch='master'] - Base branch to compare against
7
+ * @param {boolean} [options.shrinkToLongestLine=false] - Auto-calculate width based on longest line
8
+ * @param {number} [options.leftMargin=0] - Number of spaces to add to the left of each line
9
+ * @param {number} [options.width=140] - Width of the diff output (ignored if shrinkToLongestLine is true)
10
+ * @param {boolean} [options.hideHeader=false] - Remove the file path header from the diff
11
+ * @returns {Promise<string | null>} Formatted diff string or null if no diff
11
12
  */
12
13
  export function getFormattedDiff({ filePath, gitRootDir, baseBranch, shrinkToLongestLine, leftMargin, width, hideHeader }: {
13
14
  filePath: string;
14
- gitRootDir: string;
15
- baseBranch: string;
16
- shrinkToLongestLine: boolean;
17
- leftMargin: number;
18
- width: number;
19
- hideHeader: boolean;
20
- }): Promise<any>;
15
+ gitRootDir?: string;
16
+ baseBranch?: string;
17
+ shrinkToLongestLine?: boolean;
18
+ leftMargin?: number;
19
+ width?: number;
20
+ hideHeader?: boolean;
21
+ }): Promise<string | null>;