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.
- package/.github/workflows/release.yml +8 -0
- package/CHANGELOG.md +36 -0
- package/bun.lock +89 -306
- package/dist/App.js +895 -520
- package/dist/FollowMode.js +85 -0
- package/dist/KeyBindings.js +178 -0
- package/dist/MouseHandlers.js +156 -0
- package/dist/core/ExplorerStateManager.js +632 -0
- package/dist/core/FilePathWatcher.js +133 -0
- package/dist/core/GitStateManager.js +221 -86
- package/dist/git/diff.js +4 -0
- package/dist/git/ignoreUtils.js +30 -0
- package/dist/git/status.js +2 -34
- package/dist/index.js +68 -53
- package/dist/ipc/CommandClient.js +165 -0
- package/dist/ipc/CommandServer.js +152 -0
- package/dist/state/CommitFlowState.js +86 -0
- package/dist/state/UIState.js +195 -0
- package/dist/types/tabs.js +4 -0
- package/dist/ui/Layout.js +252 -0
- package/dist/ui/PaneRenderers.js +56 -0
- package/dist/ui/modals/BaseBranchPicker.js +110 -0
- package/dist/ui/modals/DiscardConfirm.js +77 -0
- package/dist/ui/modals/FileFinder.js +232 -0
- package/dist/ui/modals/HotkeysModal.js +209 -0
- package/dist/ui/modals/ThemePicker.js +107 -0
- package/dist/ui/widgets/CommitPanel.js +58 -0
- package/dist/ui/widgets/CompareListView.js +238 -0
- package/dist/ui/widgets/DiffView.js +281 -0
- package/dist/ui/widgets/ExplorerContent.js +89 -0
- package/dist/ui/widgets/ExplorerView.js +204 -0
- package/dist/ui/widgets/FileList.js +185 -0
- package/dist/ui/widgets/Footer.js +50 -0
- package/dist/ui/widgets/Header.js +68 -0
- package/dist/ui/widgets/HistoryView.js +69 -0
- package/dist/utils/displayRows.js +185 -6
- package/dist/utils/explorerDisplayRows.js +1 -1
- package/dist/utils/fileCategories.js +37 -0
- package/dist/utils/fileTree.js +148 -0
- package/dist/utils/languageDetection.js +56 -0
- package/dist/utils/pathUtils.js +27 -0
- package/dist/utils/wordDiff.js +50 -0
- package/eslint.metrics.js +16 -0
- package/metrics/.gitkeep +0 -0
- package/metrics/v0.2.1.json +268 -0
- package/package.json +14 -12
- package/dist/components/BaseBranchPicker.js +0 -60
- package/dist/components/BottomPane.js +0 -101
- package/dist/components/CommitPanel.js +0 -58
- package/dist/components/CompareListView.js +0 -110
- package/dist/components/ExplorerContentView.js +0 -80
- package/dist/components/ExplorerView.js +0 -37
- package/dist/components/FileList.js +0 -131
- package/dist/components/Footer.js +0 -6
- package/dist/components/Header.js +0 -107
- package/dist/components/HistoryView.js +0 -21
- package/dist/components/HotkeysModal.js +0 -108
- package/dist/components/Modal.js +0 -19
- package/dist/components/ScrollableList.js +0 -125
- package/dist/components/ThemePicker.js +0 -42
- package/dist/components/TopPane.js +0 -14
- package/dist/components/UnifiedDiffView.js +0 -115
- package/dist/hooks/useCommitFlow.js +0 -66
- package/dist/hooks/useCompareState.js +0 -123
- package/dist/hooks/useExplorerState.js +0 -248
- package/dist/hooks/useGit.js +0 -156
- package/dist/hooks/useHistoryState.js +0 -62
- package/dist/hooks/useKeymap.js +0 -167
- package/dist/hooks/useLayout.js +0 -154
- package/dist/hooks/useMouse.js +0 -87
- package/dist/hooks/useTerminalSize.js +0 -20
- package/dist/hooks/useWatcher.js +0 -137
- package/dist/utils/mouseCoordinates.js +0 -165
- package/dist/utils/rowCalculations.js +0 -209
package/dist/git/status.js
CHANGED
|
@@ -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(
|
|
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)) {
|