diffstalker 0.1.7 → 0.2.1

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.
Files changed (74) hide show
  1. package/.github/workflows/release.yml +8 -0
  2. package/CHANGELOG.md +36 -0
  3. package/bun.lock +89 -306
  4. package/dist/App.js +895 -520
  5. package/dist/FollowMode.js +85 -0
  6. package/dist/KeyBindings.js +178 -0
  7. package/dist/MouseHandlers.js +156 -0
  8. package/dist/core/ExplorerStateManager.js +632 -0
  9. package/dist/core/FilePathWatcher.js +133 -0
  10. package/dist/core/GitStateManager.js +221 -86
  11. package/dist/git/diff.js +4 -0
  12. package/dist/git/ignoreUtils.js +30 -0
  13. package/dist/git/status.js +2 -34
  14. package/dist/index.js +68 -53
  15. package/dist/ipc/CommandClient.js +165 -0
  16. package/dist/ipc/CommandServer.js +152 -0
  17. package/dist/state/CommitFlowState.js +86 -0
  18. package/dist/state/UIState.js +195 -0
  19. package/dist/types/tabs.js +4 -0
  20. package/dist/ui/Layout.js +252 -0
  21. package/dist/ui/PaneRenderers.js +56 -0
  22. package/dist/ui/modals/BaseBranchPicker.js +110 -0
  23. package/dist/ui/modals/DiscardConfirm.js +77 -0
  24. package/dist/ui/modals/FileFinder.js +232 -0
  25. package/dist/ui/modals/HotkeysModal.js +209 -0
  26. package/dist/ui/modals/ThemePicker.js +107 -0
  27. package/dist/ui/widgets/CommitPanel.js +58 -0
  28. package/dist/ui/widgets/CompareListView.js +238 -0
  29. package/dist/ui/widgets/DiffView.js +281 -0
  30. package/dist/ui/widgets/ExplorerContent.js +89 -0
  31. package/dist/ui/widgets/ExplorerView.js +204 -0
  32. package/dist/ui/widgets/FileList.js +185 -0
  33. package/dist/ui/widgets/Footer.js +50 -0
  34. package/dist/ui/widgets/Header.js +68 -0
  35. package/dist/ui/widgets/HistoryView.js +69 -0
  36. package/dist/utils/displayRows.js +185 -6
  37. package/dist/utils/explorerDisplayRows.js +1 -1
  38. package/dist/utils/fileCategories.js +37 -0
  39. package/dist/utils/fileTree.js +148 -0
  40. package/dist/utils/languageDetection.js +56 -0
  41. package/dist/utils/pathUtils.js +27 -0
  42. package/dist/utils/wordDiff.js +50 -0
  43. package/eslint.metrics.js +16 -0
  44. package/metrics/.gitkeep +0 -0
  45. package/metrics/v0.2.1.json +268 -0
  46. package/package.json +14 -12
  47. package/dist/components/BaseBranchPicker.js +0 -60
  48. package/dist/components/BottomPane.js +0 -101
  49. package/dist/components/CommitPanel.js +0 -58
  50. package/dist/components/CompareListView.js +0 -110
  51. package/dist/components/ExplorerContentView.js +0 -80
  52. package/dist/components/ExplorerView.js +0 -37
  53. package/dist/components/FileList.js +0 -131
  54. package/dist/components/Footer.js +0 -6
  55. package/dist/components/Header.js +0 -107
  56. package/dist/components/HistoryView.js +0 -21
  57. package/dist/components/HotkeysModal.js +0 -108
  58. package/dist/components/Modal.js +0 -19
  59. package/dist/components/ScrollableList.js +0 -125
  60. package/dist/components/ThemePicker.js +0 -42
  61. package/dist/components/TopPane.js +0 -14
  62. package/dist/components/UnifiedDiffView.js +0 -115
  63. package/dist/hooks/useCommitFlow.js +0 -66
  64. package/dist/hooks/useCompareState.js +0 -123
  65. package/dist/hooks/useExplorerState.js +0 -248
  66. package/dist/hooks/useGit.js +0 -156
  67. package/dist/hooks/useHistoryState.js +0 -62
  68. package/dist/hooks/useKeymap.js +0 -167
  69. package/dist/hooks/useLayout.js +0 -154
  70. package/dist/hooks/useMouse.js +0 -87
  71. package/dist/hooks/useTerminalSize.js +0 -20
  72. package/dist/hooks/useWatcher.js +0 -137
  73. package/dist/utils/mouseCoordinates.js +0 -165
  74. package/dist/utils/rowCalculations.js +0 -209
@@ -1,6 +1,7 @@
1
1
  import { simpleGit } from 'simple-git';
2
2
  import * as fs from 'node:fs';
3
3
  import * as path from 'node:path';
4
+ import { getIgnoredFiles } from './ignoreUtils.js';
4
5
  // Parse git diff --numstat output into a map of path -> stats
5
6
  export function parseNumstat(output) {
6
7
  const stats = new Map();
@@ -29,39 +30,6 @@ async function countFileLines(repoPath, filePath) {
29
30
  return 0;
30
31
  }
31
32
  }
32
- // Check which files from a list are ignored by git
33
- async function getIgnoredFiles(git, files) {
34
- if (files.length === 0)
35
- return new Set();
36
- try {
37
- // git check-ignore returns the list of ignored files (one per line)
38
- // Pass files as arguments (limit batch size to avoid command line length issues)
39
- const ignoredFiles = new Set();
40
- const batchSize = 100;
41
- for (let i = 0; i < files.length; i += batchSize) {
42
- const batch = files.slice(i, i + batchSize);
43
- try {
44
- const result = await git.raw(['check-ignore', ...batch]);
45
- const ignored = result
46
- .trim()
47
- .split('\n')
48
- .filter((f) => f.length > 0);
49
- for (const f of ignored) {
50
- ignoredFiles.add(f);
51
- }
52
- }
53
- catch {
54
- // check-ignore exits with code 1 if no files are ignored, which throws
55
- // Just continue to next batch
56
- }
57
- }
58
- return ignoredFiles;
59
- }
60
- catch {
61
- // If check-ignore fails entirely, return empty set
62
- return new Set();
63
- }
64
- }
65
33
  export function parseStatusCode(code) {
66
34
  switch (code) {
67
35
  case 'M':
@@ -145,7 +113,7 @@ export async function getStatus(repoPath) {
145
113
  // Collect untracked files to check if they're ignored
146
114
  const untrackedPaths = status.files.filter((f) => f.working_dir === '?').map((f) => f.path);
147
115
  // Get the set of ignored files
148
- const ignoredFiles = await getIgnoredFiles(git, untrackedPaths);
116
+ const ignoredFiles = await getIgnoredFiles(repoPath, untrackedPaths);
149
117
  for (const file of status.files) {
150
118
  // Skip ignored files (marked with '!' in either column, or detected by check-ignore)
151
119
  if (file.index === '!' || file.working_dir === '!' || ignoredFiles.has(file.path)) {