git-er-done 0.1.22 → 0.1.23

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,6 +1,6 @@
1
1
  {
2
2
  "name": "git-er-done",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
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",
@@ -77,6 +77,7 @@
77
77
  "README.md"
78
78
  ],
79
79
  "dependencies": {
80
+ "@davidwells/git-split-diffs": "^2.2.5",
80
81
  "debug": "^4.1.1",
81
82
  "json5": "^2.1.1",
82
83
  "jsonpointer": "^5.0.1",
@@ -95,7 +96,6 @@
95
96
  },
96
97
  "devDependencies": {
97
98
  "@davidwells/extract-deps": "^0.0.6",
98
- "@davidwells/git-split-diffs": "^2.2.1",
99
99
  "@types/node": "^22.10.1",
100
100
  "configorama": "^0.7.1",
101
101
  "minimatch": "^10.0.1",
@@ -68,6 +68,9 @@ function getLongestLineLength(diff) {
68
68
  * @param {number} [options.leftMargin=0] - Number of spaces to add to the left of each line
69
69
  * @param {number} [options.width=140] - Width of the diff output (ignored if shrinkToLongestLine is true)
70
70
  * @param {boolean} [options.hideHeader=false] - Remove the file path header from the diff
71
+ * @param {boolean} [options.hideFileHeader=false] - Hide file header (passed to formatDiff)
72
+ * @param {boolean} [options.hideHeaderTopLine=false] - Hide header top line (passed to formatDiff)
73
+ * @param {boolean} [options.disableDefaultBackground=false] - Disable default background colors (passed to formatDiff)
71
74
  * @param {boolean} [options.returnRaw=false] - Return both formatted and raw diff
72
75
  * @returns {Promise<string | FormattedDiffResult | null>} Formatted diff string, or {formatted, raw} if returnRaw, or null if no diff
73
76
  */
@@ -80,6 +83,9 @@ async function getFormattedDiff({
80
83
  leftMargin = 0,
81
84
  width = 140,
82
85
  hideHeader = false,
86
+ hideFileHeader = false,
87
+ hideHeaderTopLine = false,
88
+ disableDefaultBackground = false,
83
89
  returnRaw = false
84
90
  }) {
85
91
  try {
@@ -115,10 +121,6 @@ async function getFormattedDiff({
115
121
 
116
122
  // Format the diff with git-split-diffs
117
123
  let formatted = await formatDiff(diff, {
118
- // hyperlinkFileNames: false,
119
- // hyperlinkLineNumbers: false,
120
- // hideFileHeader: true,
121
- // omitHunkHeaders: true,
122
124
  trimLastEmptyLine: true,
123
125
  width: maxWidth,
124
126
  minLineWidth: 80,
@@ -126,6 +128,9 @@ async function getFormattedDiff({
126
128
  highlightLineChanges: true,
127
129
  themeName: 'dark',
128
130
  gitRootDir,
131
+ hideFileHeader,
132
+ hideHeaderTopLine,
133
+ disableDefaultBackground,
129
134
  })
130
135
 
131
136
  // Remove header if hideHeader is true
@@ -24,10 +24,13 @@ export type FormattedDiffResult = {
24
24
  * @param {number} [options.leftMargin=0] - Number of spaces to add to the left of each line
25
25
  * @param {number} [options.width=140] - Width of the diff output (ignored if shrinkToLongestLine is true)
26
26
  * @param {boolean} [options.hideHeader=false] - Remove the file path header from the diff
27
+ * @param {boolean} [options.hideFileHeader=false] - Hide file header (passed to formatDiff)
28
+ * @param {boolean} [options.hideHeaderTopLine=false] - Hide header top line (passed to formatDiff)
29
+ * @param {boolean} [options.disableDefaultBackground=false] - Disable default background colors (passed to formatDiff)
27
30
  * @param {boolean} [options.returnRaw=false] - Return both formatted and raw diff
28
31
  * @returns {Promise<string | FormattedDiffResult | null>} Formatted diff string, or {formatted, raw} if returnRaw, or null if no diff
29
32
  */
30
- export function getFormattedDiff({ filePath, gitRootDir, cwd, baseBranch, shrinkToLongestLine, leftMargin, width, hideHeader, returnRaw }: {
33
+ export function getFormattedDiff({ filePath, gitRootDir, cwd, baseBranch, shrinkToLongestLine, leftMargin, width, hideHeader, hideFileHeader, hideHeaderTopLine, disableDefaultBackground, returnRaw }: {
31
34
  filePath: string;
32
35
  gitRootDir?: string;
33
36
  cwd?: string;
@@ -36,5 +39,8 @@ export function getFormattedDiff({ filePath, gitRootDir, cwd, baseBranch, shrink
36
39
  leftMargin?: number;
37
40
  width?: number;
38
41
  hideHeader?: boolean;
42
+ hideFileHeader?: boolean;
43
+ hideHeaderTopLine?: boolean;
44
+ disableDefaultBackground?: boolean;
39
45
  returnRaw?: boolean;
40
46
  }): Promise<string | FormattedDiffResult | null>;