type-git 0.0.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/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/adapters/bun/exec.d.ts +13 -0
- package/dist/adapters/bun/exec.d.ts.map +1 -0
- package/dist/adapters/bun/exec.js +242 -0
- package/dist/adapters/bun/exec.js.map +1 -0
- package/dist/adapters/bun/fs.d.ts +20 -0
- package/dist/adapters/bun/fs.d.ts.map +1 -0
- package/dist/adapters/bun/fs.js +148 -0
- package/dist/adapters/bun/fs.js.map +1 -0
- package/dist/adapters/bun/index.d.ts +11 -0
- package/dist/adapters/bun/index.d.ts.map +1 -0
- package/dist/adapters/bun/index.js +17 -0
- package/dist/adapters/bun/index.js.map +1 -0
- package/dist/adapters/deno/exec.d.ts +14 -0
- package/dist/adapters/deno/exec.d.ts.map +1 -0
- package/dist/adapters/deno/exec.js +266 -0
- package/dist/adapters/deno/exec.js.map +1 -0
- package/dist/adapters/deno/fs.d.ts +21 -0
- package/dist/adapters/deno/fs.d.ts.map +1 -0
- package/dist/adapters/deno/fs.js +191 -0
- package/dist/adapters/deno/fs.js.map +1 -0
- package/dist/adapters/deno/index.d.ts +11 -0
- package/dist/adapters/deno/index.d.ts.map +1 -0
- package/dist/adapters/deno/index.js +17 -0
- package/dist/adapters/deno/index.js.map +1 -0
- package/dist/adapters/node/exec.d.ts +11 -0
- package/dist/adapters/node/exec.d.ts.map +1 -0
- package/dist/adapters/node/exec.js +161 -0
- package/dist/adapters/node/exec.js.map +1 -0
- package/dist/adapters/node/fs.d.ts +18 -0
- package/dist/adapters/node/fs.d.ts.map +1 -0
- package/dist/adapters/node/fs.js +164 -0
- package/dist/adapters/node/fs.js.map +1 -0
- package/dist/adapters/node/index.d.ts +61 -0
- package/dist/adapters/node/index.d.ts.map +1 -0
- package/dist/adapters/node/index.js +76 -0
- package/dist/adapters/node/index.js.map +1 -0
- package/dist/core/adapters.d.ts +192 -0
- package/dist/core/adapters.d.ts.map +1 -0
- package/dist/core/adapters.js +10 -0
- package/dist/core/adapters.js.map +1 -0
- package/dist/core/git.d.ts +160 -0
- package/dist/core/git.d.ts.map +1 -0
- package/dist/core/git.js +5 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +8 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/repo.d.ts +1275 -0
- package/dist/core/repo.d.ts.map +1 -0
- package/dist/core/repo.js +5 -0
- package/dist/core/repo.js.map +1 -0
- package/dist/core/types.d.ts +376 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +100 -0
- package/dist/core/types.js.map +1 -0
- package/dist/impl/bare-repo-impl.d.ts +72 -0
- package/dist/impl/bare-repo-impl.d.ts.map +1 -0
- package/dist/impl/bare-repo-impl.js +328 -0
- package/dist/impl/bare-repo-impl.js.map +1 -0
- package/dist/impl/git-impl.d.ts +92 -0
- package/dist/impl/git-impl.d.ts.map +1 -0
- package/dist/impl/git-impl.js +350 -0
- package/dist/impl/git-impl.js.map +1 -0
- package/dist/impl/index.d.ts +7 -0
- package/dist/impl/index.d.ts.map +1 -0
- package/dist/impl/index.js +7 -0
- package/dist/impl/index.js.map +1 -0
- package/dist/impl/worktree-repo-impl.d.ts +180 -0
- package/dist/impl/worktree-repo-impl.d.ts.map +1 -0
- package/dist/impl/worktree-repo-impl.js +1931 -0
- package/dist/impl/worktree-repo-impl.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/index.d.ts +230 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +529 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/runner/cli-runner.d.ts +94 -0
- package/dist/runner/cli-runner.d.ts.map +1 -0
- package/dist/runner/cli-runner.js +315 -0
- package/dist/runner/cli-runner.js.map +1 -0
- package/dist/runner/index.d.ts +5 -0
- package/dist/runner/index.d.ts.map +1 -0
- package/dist/runner/index.js +5 -0
- package/dist/runner/index.js.map +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime adapter interfaces for cross-platform support (Node/Deno/Bun)
|
|
3
|
+
*
|
|
4
|
+
* This module defines:
|
|
5
|
+
* - ExecAdapter: Process execution abstraction (#15)
|
|
6
|
+
* - FsAdapter: Filesystem operations abstraction (#16)
|
|
7
|
+
* - Related types and options
|
|
8
|
+
*/
|
|
9
|
+
import type { Capabilities } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Options for spawning a process
|
|
12
|
+
*/
|
|
13
|
+
export type SpawnOptions = {
|
|
14
|
+
/** Command and arguments (first element is the command) */
|
|
15
|
+
argv: Array<string>;
|
|
16
|
+
/** Additional environment variables */
|
|
17
|
+
env?: Record<string, string>;
|
|
18
|
+
/** Working directory */
|
|
19
|
+
cwd?: string;
|
|
20
|
+
/** AbortSignal for cancellation */
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
/** Kill signal to use when aborting (default: SIGTERM) */
|
|
23
|
+
killSignal?: 'SIGTERM' | 'SIGKILL';
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Result from spawning a process
|
|
27
|
+
*/
|
|
28
|
+
export type SpawnResult = {
|
|
29
|
+
/** Standard output */
|
|
30
|
+
stdout: string;
|
|
31
|
+
/** Standard error */
|
|
32
|
+
stderr: string;
|
|
33
|
+
/** Exit code (-1 if unknown) */
|
|
34
|
+
exitCode: number;
|
|
35
|
+
/** Signal that terminated the process (if any) */
|
|
36
|
+
signal?: string;
|
|
37
|
+
/** Whether the process was aborted via AbortSignal */
|
|
38
|
+
aborted: boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Stream handler for incremental output
|
|
42
|
+
*
|
|
43
|
+
* Used for progress tracking and real-time output processing.
|
|
44
|
+
*/
|
|
45
|
+
export type StreamHandler = {
|
|
46
|
+
/** Called when stdout data is received */
|
|
47
|
+
onStdout?: (chunk: string) => void;
|
|
48
|
+
/** Called when stderr data is received */
|
|
49
|
+
onStderr?: (chunk: string) => void;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Handle to a spawned process
|
|
53
|
+
*
|
|
54
|
+
* Allows streaming output and waiting for completion.
|
|
55
|
+
*/
|
|
56
|
+
export interface SpawnHandle {
|
|
57
|
+
/** Async iterator for stdout lines */
|
|
58
|
+
readonly stdout: AsyncIterable<string>;
|
|
59
|
+
/** Async iterator for stderr lines */
|
|
60
|
+
readonly stderr: AsyncIterable<string>;
|
|
61
|
+
/** Wait for process completion */
|
|
62
|
+
wait(): Promise<SpawnResult>;
|
|
63
|
+
/** Kill the process */
|
|
64
|
+
kill(signal?: 'SIGTERM' | 'SIGKILL'): void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Adapter interface for process execution
|
|
68
|
+
*
|
|
69
|
+
* Abstracts process spawning across Node.js, Deno, and Bun.
|
|
70
|
+
*/
|
|
71
|
+
export interface ExecAdapter {
|
|
72
|
+
/**
|
|
73
|
+
* Get the capabilities of this runtime
|
|
74
|
+
*/
|
|
75
|
+
getCapabilities(): Capabilities;
|
|
76
|
+
/**
|
|
77
|
+
* Spawn a process and wait for completion
|
|
78
|
+
*
|
|
79
|
+
* @param options - Spawn options
|
|
80
|
+
* @param handlers - Optional stream handlers for real-time output
|
|
81
|
+
* @returns Promise resolving to spawn result
|
|
82
|
+
*/
|
|
83
|
+
spawn(options: SpawnOptions, handlers?: StreamHandler): Promise<SpawnResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Spawn a process with streaming support
|
|
86
|
+
*
|
|
87
|
+
* @param options - Spawn options
|
|
88
|
+
* @returns Handle to the spawned process
|
|
89
|
+
*/
|
|
90
|
+
spawnStreaming?(options: SpawnOptions): SpawnHandle;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Options for tailing a file
|
|
94
|
+
*/
|
|
95
|
+
export type TailOptions = {
|
|
96
|
+
/** Path to the file to tail */
|
|
97
|
+
filePath: string;
|
|
98
|
+
/** AbortSignal for cancellation */
|
|
99
|
+
signal?: AbortSignal;
|
|
100
|
+
/** Callback for each new line */
|
|
101
|
+
onLine: (line: string) => void;
|
|
102
|
+
/** Start offset in bytes (default: 0) */
|
|
103
|
+
startOffset?: number;
|
|
104
|
+
/** Polling interval in milliseconds (default: 100) */
|
|
105
|
+
pollInterval?: number;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Handle to a tail operation
|
|
109
|
+
*/
|
|
110
|
+
export interface TailHandle {
|
|
111
|
+
/** Async iterator for new lines */
|
|
112
|
+
readonly lines: AsyncIterable<string>;
|
|
113
|
+
/** Stop tailing */
|
|
114
|
+
stop(): void;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Adapter interface for filesystem operations
|
|
118
|
+
*
|
|
119
|
+
* Used primarily for LFS progress tracking via GIT_LFS_PROGRESS.
|
|
120
|
+
*/
|
|
121
|
+
export interface FsAdapter {
|
|
122
|
+
/**
|
|
123
|
+
* Create a temporary file and return its path
|
|
124
|
+
*
|
|
125
|
+
* @param prefix - Optional prefix for the temp file name
|
|
126
|
+
* @returns Path to the created temporary file
|
|
127
|
+
*/
|
|
128
|
+
createTempFile(prefix?: string): Promise<string>;
|
|
129
|
+
/**
|
|
130
|
+
* Start tailing a file (watching for new lines)
|
|
131
|
+
*
|
|
132
|
+
* @param options - Tail options
|
|
133
|
+
* @returns Promise that resolves when tailing stops
|
|
134
|
+
*/
|
|
135
|
+
tail(options: TailOptions): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* Start tailing a file with streaming support
|
|
138
|
+
*
|
|
139
|
+
* @param filePath - Path to the file to tail
|
|
140
|
+
* @param options - Optional tail options
|
|
141
|
+
* @returns Handle to the tail operation
|
|
142
|
+
*/
|
|
143
|
+
tailStreaming?(filePath: string, options?: {
|
|
144
|
+
signal?: AbortSignal;
|
|
145
|
+
pollInterval?: number;
|
|
146
|
+
}): TailHandle;
|
|
147
|
+
/**
|
|
148
|
+
* Delete a file
|
|
149
|
+
*
|
|
150
|
+
* @param filePath - Path to the file to delete
|
|
151
|
+
*/
|
|
152
|
+
deleteFile(filePath: string): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Delete a directory recursively
|
|
155
|
+
*
|
|
156
|
+
* @param dirPath - Path to the directory to delete
|
|
157
|
+
*/
|
|
158
|
+
deleteDirectory(dirPath: string): Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Check if a file exists
|
|
161
|
+
*
|
|
162
|
+
* @param filePath - Path to check
|
|
163
|
+
* @returns Whether the file exists
|
|
164
|
+
*/
|
|
165
|
+
exists(filePath: string): Promise<boolean>;
|
|
166
|
+
/**
|
|
167
|
+
* Read a file's contents
|
|
168
|
+
*
|
|
169
|
+
* @param filePath - Path to the file
|
|
170
|
+
* @returns File contents as string
|
|
171
|
+
*/
|
|
172
|
+
readFile?(filePath: string): Promise<string>;
|
|
173
|
+
/**
|
|
174
|
+
* Write contents to a file
|
|
175
|
+
*
|
|
176
|
+
* @param filePath - Path to the file
|
|
177
|
+
* @param contents - Contents to write
|
|
178
|
+
*/
|
|
179
|
+
writeFile?(filePath: string, contents: string): Promise<void>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Combined adapters for a runtime
|
|
183
|
+
*/
|
|
184
|
+
export interface RuntimeAdapters {
|
|
185
|
+
exec: ExecAdapter;
|
|
186
|
+
fs: FsAdapter;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Factory function type for creating runtime adapters
|
|
190
|
+
*/
|
|
191
|
+
export type AdapterFactory = () => RuntimeAdapters;
|
|
192
|
+
//# sourceMappingURL=adapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../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M,CAAA;KAAE,GACxD,UAAU,CAAC;IAEd;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE3C;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7C;;;;;OAKG;IACH,SAAS,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAMD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,EAAE,EAAE,SAAS,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime adapter interfaces for cross-platform support (Node/Deno/Bun)
|
|
3
|
+
*
|
|
4
|
+
* This module defines:
|
|
5
|
+
* - ExecAdapter: Process execution abstraction (#15)
|
|
6
|
+
* - FsAdapter: Filesystem operations abstraction (#16)
|
|
7
|
+
* - Related types and options
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/core/adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Git interface - repository-agnostic operations
|
|
3
|
+
*/
|
|
4
|
+
import type { BareRepo, ConfigEntry, ConfigGetOpts, ConfigKey, ConfigSchema, ConfigSetOpts, WorktreeRepo } from './repo.js';
|
|
5
|
+
import type { ExecOpts, GitOpenOptions, RawResult } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Options for git clone
|
|
8
|
+
*/
|
|
9
|
+
export type CloneOpts = {
|
|
10
|
+
bare?: boolean;
|
|
11
|
+
depth?: number;
|
|
12
|
+
branch?: string;
|
|
13
|
+
singleBranch?: boolean;
|
|
14
|
+
mirror?: boolean;
|
|
15
|
+
noCheckout?: boolean;
|
|
16
|
+
recurseSubmodules?: boolean;
|
|
17
|
+
/** Store .git directory at specified path instead of inside the repository */
|
|
18
|
+
separateGitDir?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to clean up the target directory if the operation is aborted.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
cleanupOnAbort?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Options for git init
|
|
27
|
+
*/
|
|
28
|
+
export type InitOpts = {
|
|
29
|
+
bare?: boolean;
|
|
30
|
+
initialBranch?: string;
|
|
31
|
+
/** Store .git directory at specified path instead of inside the repository */
|
|
32
|
+
separateGitDir?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to clean up the target directory if the operation is aborted.
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
cleanupOnAbort?: boolean;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Options for git ls-remote
|
|
41
|
+
*/
|
|
42
|
+
export type LsRemoteOpts = {
|
|
43
|
+
heads?: boolean;
|
|
44
|
+
tags?: boolean;
|
|
45
|
+
refs?: boolean;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Result from git ls-remote
|
|
49
|
+
*/
|
|
50
|
+
export type LsRemoteResult = {
|
|
51
|
+
refs: Array<{
|
|
52
|
+
hash: string;
|
|
53
|
+
name: string;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Options for global config list
|
|
58
|
+
*/
|
|
59
|
+
export type GlobalConfigListOpts = {
|
|
60
|
+
/** Show origin of each value */
|
|
61
|
+
showOrigin?: boolean;
|
|
62
|
+
/** Show scope of each value */
|
|
63
|
+
showScope?: boolean;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Global config operations interface
|
|
67
|
+
*
|
|
68
|
+
* Operates on ~/.gitconfig (user-level configuration).
|
|
69
|
+
* Uses the same typed ConfigSchema as repository-level config.
|
|
70
|
+
*/
|
|
71
|
+
export interface GlobalConfigOperations {
|
|
72
|
+
/**
|
|
73
|
+
* Get a typed global config value
|
|
74
|
+
* Returns undefined if not set
|
|
75
|
+
*/
|
|
76
|
+
get<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<ConfigSchema[K] | undefined>;
|
|
77
|
+
/**
|
|
78
|
+
* Get all values for a typed multi-valued global config key
|
|
79
|
+
*/
|
|
80
|
+
getAll<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<Array<ConfigSchema[K]>>;
|
|
81
|
+
/**
|
|
82
|
+
* Set a typed global config value
|
|
83
|
+
*/
|
|
84
|
+
set<K extends ConfigKey>(key: K, value: ConfigSchema[K], opts?: ExecOpts): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Add a value to a typed multi-valued global config key
|
|
87
|
+
*/
|
|
88
|
+
add<K extends ConfigKey>(key: K, value: ConfigSchema[K], opts?: ExecOpts): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Unset a typed global config value
|
|
91
|
+
*/
|
|
92
|
+
unset<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Get a raw global config value (for arbitrary keys)
|
|
95
|
+
* Returns undefined if not set
|
|
96
|
+
*/
|
|
97
|
+
getRaw(key: string, opts?: ConfigGetOpts & ExecOpts): Promise<string | Array<string> | undefined>;
|
|
98
|
+
/**
|
|
99
|
+
* Set a raw global config value (for arbitrary keys)
|
|
100
|
+
*/
|
|
101
|
+
setRaw(key: string, value: string, opts?: ConfigSetOpts & ExecOpts): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Unset a raw global config value (for arbitrary keys)
|
|
104
|
+
*/
|
|
105
|
+
unsetRaw(key: string, opts?: ExecOpts): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* List all global config values
|
|
108
|
+
*/
|
|
109
|
+
list(opts?: GlobalConfigListOpts & ExecOpts): Promise<Array<ConfigEntry>>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Main Git interface for repository-agnostic operations
|
|
113
|
+
*
|
|
114
|
+
* Design doc references:
|
|
115
|
+
* - §7.1: Repository-agnostic operations (clone, init, lsRemote, raw, version)
|
|
116
|
+
* - §6.3: open() with environment isolation options
|
|
117
|
+
*/
|
|
118
|
+
export interface Git {
|
|
119
|
+
/**
|
|
120
|
+
* Open an existing repository with optional environment isolation (§6.3)
|
|
121
|
+
*
|
|
122
|
+
* @param path - Path to the repository (workdir or git-dir)
|
|
123
|
+
* @param opts - Environment isolation and credential options
|
|
124
|
+
* @returns WorktreeRepo or BareRepo depending on repository type
|
|
125
|
+
*/
|
|
126
|
+
open(path: string, opts?: GitOpenOptions): Promise<WorktreeRepo | BareRepo>;
|
|
127
|
+
/**
|
|
128
|
+
* Clone a repository
|
|
129
|
+
*
|
|
130
|
+
* Returns the newly created repository, addressing the factory pattern
|
|
131
|
+
* design flaw in simple-git (§2.4).
|
|
132
|
+
*/
|
|
133
|
+
clone(url: string, path: string, opts?: CloneOpts & ExecOpts): Promise<WorktreeRepo | BareRepo>;
|
|
134
|
+
/**
|
|
135
|
+
* Initialize a new repository
|
|
136
|
+
*
|
|
137
|
+
* Returns the newly created repository.
|
|
138
|
+
*/
|
|
139
|
+
init(path: string, opts?: InitOpts & ExecOpts): Promise<WorktreeRepo | BareRepo>;
|
|
140
|
+
/**
|
|
141
|
+
* List references in a remote repository
|
|
142
|
+
*/
|
|
143
|
+
lsRemote(url: string, opts?: LsRemoteOpts & ExecOpts): Promise<LsRemoteResult>;
|
|
144
|
+
/**
|
|
145
|
+
* Get git version
|
|
146
|
+
*/
|
|
147
|
+
version(opts?: ExecOpts): Promise<string>;
|
|
148
|
+
/**
|
|
149
|
+
* Execute a raw git command (repository-agnostic)
|
|
150
|
+
*/
|
|
151
|
+
raw(argv: Array<string>, opts?: ExecOpts): Promise<RawResult>;
|
|
152
|
+
/**
|
|
153
|
+
* Global config operations (--global flag)
|
|
154
|
+
*
|
|
155
|
+
* Operates on ~/.gitconfig (user-level configuration).
|
|
156
|
+
* For repository-level config, use repo.config instead.
|
|
157
|
+
*/
|
|
158
|
+
config: GlobalConfigOperations;
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/core/git.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;GAE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,OAAO,CAAC,YAAY,GAAG,QAAQ,CAAC,CAAC;IAEhG;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,QAAQ,CAAC,CAAC;IAEjF;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE/E;;OAEG;IACH,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAE9D;;;;;OAKG;IACH,MAAM,EAAE,sBAAsB,CAAC;CAChC"}
|
package/dist/core/git.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/core/git.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|