• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agentic-dev-library / thumbcode / 21933729139

12 Feb 2026 04:36AM UTC coverage: 28.401% (+0.7%) from 27.702%
21933729139

Pull #116

github

web-flow
Merge b9d1b07d1 into c6c31bd07
Pull Request #116: refactor: decompose 9 monolith files into focused modules

406 of 2268 branches covered (17.9%)

Branch coverage included in aggregate %.

365 of 845 new or added lines in 22 files covered. (43.2%)

1 existing line in 1 file now uncovered.

1120 of 3105 relevant lines covered (36.07%)

7.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/packages/core/src/git/git-fs.ts
1
/**
2
 * Git File System Adapter
3
 *
4
 * Bridges expo-file-system with isomorphic-git for React Native compatibility.
5
 * Shared across all Git service modules.
6
 */
7

8
import * as FileSystem from 'expo-file-system';
9
import type { HttpClient } from 'isomorphic-git';
10
import { gitHttpClient } from './GitHttpClient';
11

12
// HTTP client adapter - bridges our implementation to isomorphic-git's HttpClient type
13
// Our implementation uses AsyncIterableIterator which works with isomorphic-git at runtime
14
// Using type assertion as the body types differ but are compatible at runtime
15
export const http = gitHttpClient as unknown as HttpClient;
1✔
16

17
/**
18
 * File system adapter for isomorphic-git
19
 * Uses expo-file-system for React Native compatibility
20
 */
21
export const fs = {
1✔
22
  promises: {
23
    readFile: async (filepath: string, options?: { encoding?: string }) => {
24
      const content = await FileSystem.readAsStringAsync(filepath, {
2,246✔
25
        encoding:
26
          options?.encoding === 'utf8'
2,246✔
27
            ? FileSystem.EncodingType.UTF8
28
            : FileSystem.EncodingType.Base64,
29
      });
30
      if (options?.encoding === 'utf8') {
1,217✔
31
        return content;
211✔
32
      }
33
      // Return as Buffer-like for binary files
34
      return Buffer.from(content, 'base64');
1,006✔
35
    },
36

37
    writeFile: async (
38
      filepath: string,
39
      data: string | Uint8Array,
40
      _options?: { mode?: number }
41
    ) => {
42
      const isString = typeof data === 'string';
408✔
43
      await FileSystem.writeAsStringAsync(
408✔
44
        filepath,
45
        isString ? data : Buffer.from(data).toString('base64'),
408✔
46
        {
47
          encoding: isString ? FileSystem.EncodingType.UTF8 : FileSystem.EncodingType.Base64,
408✔
48
        }
49
      );
50
    },
51

52
    unlink: async (filepath: string) => {
NEW
53
      await FileSystem.deleteAsync(filepath, { idempotent: true });
×
54
    },
55

56
    readdir: async (dirpath: string) => {
NEW
57
      const result = await FileSystem.readDirectoryAsync(dirpath);
×
NEW
58
      return result;
×
59
    },
60

61
    mkdir: async (dirpath: string, options?: { recursive?: boolean }) => {
62
      await FileSystem.makeDirectoryAsync(dirpath, {
7✔
63
        intermediates: options?.recursive ?? true,
13✔
64
      });
65
    },
66

67
    rmdir: async (dirpath: string) => {
NEW
68
      await FileSystem.deleteAsync(dirpath, { idempotent: true });
×
69
    },
70

71
    stat: async (filepath: string) => {
72
      const info = await FileSystem.getInfoAsync(filepath);
1,416✔
73
      if (!info.exists) {
1,416✔
74
        const error = new Error(`ENOENT: no such file or directory, stat '${filepath}'`);
407✔
75
        (error as any).code = 'ENOENT';
407✔
76
        throw error;
407✔
77
      }
78
      return {
1,009✔
NEW
79
        isFile: () => !info.isDirectory,
×
80
        isDirectory: () => info.isDirectory,
608✔
81
        isSymbolicLink: () => false,
200✔
82
        size: 'size' in info ? info.size : 0,
1,009!
83
        mode: 0o644,
84
        mtimeMs: 'modificationTime' in info ? info.modificationTime * 1000 : 0,
1,009!
85
        ctimeMs: 'modificationTime' in info ? info.modificationTime * 1000 : 0,
1,009!
86
        uid: 0,
87
        gid: 0,
88
        dev: 0,
89
        ino: 0,
90
      };
91
    },
92

93
    lstat: async (filepath: string) => {
94
      // For React Native, lstat behaves same as stat
95
      return fs.promises.stat(filepath);
602✔
96
    },
97

98
    readlink: async (_filepath: string): Promise<string> => {
99
      // Symlinks not fully supported in React Native
NEW
100
      throw new Error('Symlinks not supported');
×
101
    },
102

103
    symlink: async (_target: string, _filepath: string): Promise<void> => {
104
      // Symlinks not fully supported in React Native
NEW
105
      throw new Error('Symlinks not supported');
×
106
    },
107

108
    chmod: async (_filepath: string, _mode: number): Promise<void> => {
109
      // chmod not applicable in React Native
NEW
110
      return;
×
111
    },
112
  },
113
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc