Skip to content

Commit eef6fe8

Browse files
unhappychoiceclaude
andcommitted
fix(server): use the named simpleGit export for simple-git v4
simple-git v4 removed its default export, so the default import is no longer callable and tsc fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f5bddce commit eef6fe8

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/server/routes/diff.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Router } from 'express';
2-
import simpleGit, { SimpleGit } from 'simple-git';
2+
import { simpleGit, SimpleGit } from 'simple-git';
33
import { ServerContext } from '../context';
44

55
const extractFilePath = (params: Record<string, unknown>): string => {

‎src/server/routes/filetree.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Router } from 'express';
22
import fs, { Dirent } from 'fs';
33
import path from 'path';
4-
import simpleGit, { SimpleGit, StatusResult, FileStatusResult } from 'simple-git';
4+
import { simpleGit, SimpleGit, StatusResult, FileStatusResult } from 'simple-git';
55
import { EXCLUDED_DIRECTORIES } from '../../constants';
66
import { ServerContext } from '../context';
77
import { logger } from '../../utils/logger';

‎test/__mocks__/simple-git.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ const simpleGit = jest.fn(() => ({
1111
checkIsRepo: jest.fn(() => Promise.resolve(true)),
1212
}));
1313

14-
export default simpleGit;
14+
export { simpleGit };

‎test/unit/server/routes/diff.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import express from 'express';
22
import request from 'supertest';
3-
import simpleGit from 'simple-git';
3+
import { simpleGit } from 'simple-git';
44
import { diffRouter, diffPrevRouter } from '../../../../src/server/routes/diff';
55

66
jest.mock('simple-git');

0 commit comments

Comments
 (0)