type-git 0.8.1 → 0.8.3
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/README.md +3 -0
- package/dist/adapters/bun/index.cjs +8 -8
- package/dist/adapters/bun/index.d.cts +2 -2
- package/dist/adapters/bun/index.d.ts +2 -2
- package/dist/adapters/bun/index.js +2 -2
- package/dist/adapters/deno/index.cjs +8 -8
- package/dist/adapters/deno/index.d.cts +2 -2
- package/dist/adapters/deno/index.d.ts +2 -2
- package/dist/adapters/deno/index.js +2 -2
- package/dist/adapters/node/index.cjs +4 -4
- package/dist/adapters/node/index.d.cts +2 -2
- package/dist/adapters/node/index.d.ts +2 -2
- package/dist/adapters/node/index.js +3 -3
- package/dist/{chunk-ADC26634.js → chunk-HCQGGKTC.js} +212 -135
- package/dist/{chunk-JDCCYWIX.cjs → chunk-I77B22ZE.cjs} +7 -7
- package/dist/{chunk-S3EFBFVP.js → chunk-MS6E5USB.js} +1 -1
- package/dist/{chunk-6HDMSFY7.cjs → chunk-QHIS7LHW.cjs} +69 -12
- package/dist/{chunk-UHZWPYTF.cjs → chunk-SNC324NL.cjs} +1059 -982
- package/dist/{chunk-UAKOSACD.js → chunk-V4ZRQG3O.js} +69 -12
- package/dist/{client.d-Cg5wWJnY.d.cts → client.d-ClMefrEh.d.ts} +2 -2
- package/dist/{client.d-DCiFA_CK.d.ts → client.d-Jwli7Qfw.d.cts} +2 -2
- package/dist/{git.d-DqAvRXEf.d.cts → git.d-BTNkPofF.d.cts} +83 -10
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/strict/index.cjs +99 -99
- package/dist/strict/index.d.cts +1 -1
- package/dist/strict/index.js +1 -1
- package/docs/adapters.md +40 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -175,6 +175,9 @@ const result = await repo.raw(['rev-parse', 'HEAD']);
|
|
|
175
175
|
|
|
176
176
|
// Send data on stdin instead of putting it in argv
|
|
177
177
|
const { stdout: blobId } = await repo.raw(['hash-object', '-w', '--stdin'], { stdin: 'hello' });
|
|
178
|
+
|
|
179
|
+
// raw() returns a non-zero exit in exitCode; throwOnNonZero throws the typed GitError instead
|
|
180
|
+
const { stdout: head } = await repo.raw(['rev-parse', 'HEAD'], { throwOnNonZero: true });
|
|
178
181
|
```
|
|
179
182
|
|
|
180
183
|
### Audit Mode
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../../chunk-
|
|
8
|
+
var _chunkSNC324NLcjs = require('../../chunk-SNC324NL.cjs');
|
|
9
|
+
require('../../chunk-QHIS7LHW.cjs');
|
|
10
10
|
|
|
11
11
|
// src/adapters/bun/exec.ts
|
|
12
12
|
function resolveChildEnv(env, inheritEnv) {
|
|
@@ -117,7 +117,7 @@ var BunExecAdapter = class {
|
|
|
117
117
|
let stderr = "";
|
|
118
118
|
if (binary) {
|
|
119
119
|
[stdout, stderr] = await Promise.all([
|
|
120
|
-
proc.stdout ?
|
|
120
|
+
proc.stdout ? _chunkSNC324NLcjs.readBytes.call(void 0, proc.stdout) : Promise.resolve(new Uint8Array(0)),
|
|
121
121
|
proc.stderr ? readStream(proc.stderr, _optionalChain([handlers, 'optionalAccess', _4 => _4.onStderr])) : Promise.resolve("")
|
|
122
122
|
]);
|
|
123
123
|
} else if (_optionalChain([handlers, 'optionalAccess', _5 => _5.onStdout]) || _optionalChain([handlers, 'optionalAccess', _6 => _6.onStderr])) {
|
|
@@ -294,7 +294,7 @@ var BunFsAdapter = (_class = class {constructor() { _class.prototype.__init.call
|
|
|
294
294
|
},
|
|
295
295
|
sleep: (ms) => Bun.sleep(ms)
|
|
296
296
|
};
|
|
297
|
-
await
|
|
297
|
+
await _chunkSNC324NLcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
|
|
298
298
|
}
|
|
299
299
|
async deleteFile(filePath) {
|
|
300
300
|
const tempDir = this.tempFileDirs.get(filePath);
|
|
@@ -349,7 +349,7 @@ var BunFsAdapter = (_class = class {constructor() { _class.prototype.__init.call
|
|
|
349
349
|
},
|
|
350
350
|
sleep: (ms) => Bun.sleep(ms)
|
|
351
351
|
};
|
|
352
|
-
return
|
|
352
|
+
return _chunkSNC324NLcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
|
|
353
353
|
}
|
|
354
354
|
}, _class);
|
|
355
355
|
|
|
@@ -360,13 +360,13 @@ function createBunAdapters() {
|
|
|
360
360
|
fs: new BunFsAdapter()
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
var TypeGit = class _TypeGit extends
|
|
363
|
+
var TypeGit = class _TypeGit extends _chunkSNC324NLcjs.GitClient {
|
|
364
364
|
static async create(options) {
|
|
365
|
-
return new _TypeGit(await
|
|
365
|
+
return new _TypeGit(await _chunkSNC324NLcjs.createGit.call(void 0, { ...options, adapters: createBunAdapters() }));
|
|
366
366
|
}
|
|
367
367
|
constructor(optionsOrGit) {
|
|
368
368
|
super(
|
|
369
|
-
optionsOrGit && "open" in optionsOrGit ? optionsOrGit :
|
|
369
|
+
optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkSNC324NLcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createBunAdapters() })
|
|
370
370
|
);
|
|
371
371
|
}
|
|
372
372
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-
|
|
2
|
-
import { C as Capabilities, G as Git } from '../../git.d-
|
|
1
|
+
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Jwli7Qfw.cjs';
|
|
2
|
+
import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Bun ExecAdapter implementation
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-
|
|
2
|
-
import { C as Capabilities, G as Git } from '../../git.d-
|
|
1
|
+
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-ClMefrEh.js';
|
|
2
|
+
import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Bun ExecAdapter implementation
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
createTailPolling,
|
|
6
6
|
readBytes,
|
|
7
7
|
runTailPolling
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-HCQGGKTC.js";
|
|
9
|
+
import "../../chunk-V4ZRQG3O.js";
|
|
10
10
|
|
|
11
11
|
// src/adapters/bun/exec.ts
|
|
12
12
|
function resolveChildEnv(env, inheritEnv) {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../../chunk-
|
|
8
|
+
var _chunkSNC324NLcjs = require('../../chunk-SNC324NL.cjs');
|
|
9
|
+
require('../../chunk-QHIS7LHW.cjs');
|
|
10
10
|
|
|
11
11
|
// src/adapters/deno/exec.ts
|
|
12
12
|
function resolveChildEnvOptions(env, inheritEnv) {
|
|
@@ -141,7 +141,7 @@ var DenoExecAdapter = class {
|
|
|
141
141
|
let stderr = "";
|
|
142
142
|
if (binary) {
|
|
143
143
|
[stdout, stderr] = await Promise.all([
|
|
144
|
-
child.stdout ?
|
|
144
|
+
child.stdout ? _chunkSNC324NLcjs.readBytes.call(void 0, child.stdout) : Promise.resolve(new Uint8Array(0)),
|
|
145
145
|
child.stderr ? readStream(child.stderr, _optionalChain([handlers, 'optionalAccess', _4 => _4.onStderr])) : Promise.resolve("")
|
|
146
146
|
]);
|
|
147
147
|
} else if (_optionalChain([handlers, 'optionalAccess', _5 => _5.onStdout]) || _optionalChain([handlers, 'optionalAccess', _6 => _6.onStderr])) {
|
|
@@ -357,7 +357,7 @@ var DenoFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
|
|
|
357
357
|
},
|
|
358
358
|
sleep: (ms) => delay(ms)
|
|
359
359
|
};
|
|
360
|
-
await
|
|
360
|
+
await _chunkSNC324NLcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
|
|
361
361
|
}
|
|
362
362
|
async deleteFile(filePath) {
|
|
363
363
|
const tempDir = this.tempFileDirs.get(filePath);
|
|
@@ -443,7 +443,7 @@ var DenoFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
|
|
|
443
443
|
},
|
|
444
444
|
sleep: (ms) => delay(ms)
|
|
445
445
|
};
|
|
446
|
-
return
|
|
446
|
+
return _chunkSNC324NLcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
|
|
447
447
|
}
|
|
448
448
|
}, _class);
|
|
449
449
|
|
|
@@ -454,13 +454,13 @@ function createDenoAdapters() {
|
|
|
454
454
|
fs: new DenoFsAdapter()
|
|
455
455
|
};
|
|
456
456
|
}
|
|
457
|
-
var TypeGit = class _TypeGit extends
|
|
457
|
+
var TypeGit = class _TypeGit extends _chunkSNC324NLcjs.GitClient {
|
|
458
458
|
static async create(options) {
|
|
459
|
-
return new _TypeGit(await
|
|
459
|
+
return new _TypeGit(await _chunkSNC324NLcjs.createGit.call(void 0, { ...options, adapters: createDenoAdapters() }));
|
|
460
460
|
}
|
|
461
461
|
constructor(optionsOrGit) {
|
|
462
462
|
super(
|
|
463
|
-
optionsOrGit && "open" in optionsOrGit ? optionsOrGit :
|
|
463
|
+
optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkSNC324NLcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createDenoAdapters() })
|
|
464
464
|
);
|
|
465
465
|
}
|
|
466
466
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-
|
|
2
|
-
import { C as Capabilities, G as Git } from '../../git.d-
|
|
1
|
+
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Jwli7Qfw.cjs';
|
|
2
|
+
import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Deno ExecAdapter implementation
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-
|
|
2
|
-
import { C as Capabilities, G as Git } from '../../git.d-
|
|
1
|
+
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-ClMefrEh.js';
|
|
2
|
+
import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Deno ExecAdapter implementation
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
createTailPolling,
|
|
6
6
|
readBytes,
|
|
7
7
|
runTailPolling
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-HCQGGKTC.js";
|
|
9
|
+
import "../../chunk-V4ZRQG3O.js";
|
|
10
10
|
|
|
11
11
|
// src/adapters/deno/exec.ts
|
|
12
12
|
function resolveChildEnvOptions(env, inheritEnv) {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
6
|
+
var _chunkI77B22ZEcjs = require('../../chunk-I77B22ZE.cjs');
|
|
7
|
+
require('../../chunk-SNC324NL.cjs');
|
|
8
|
+
require('../../chunk-QHIS7LHW.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.NodeExecAdapter =
|
|
14
|
+
exports.NodeExecAdapter = _chunkI77B22ZEcjs.NodeExecAdapter; exports.NodeFsAdapter = _chunkI77B22ZEcjs.NodeFsAdapter; exports.TypeGit = _chunkI77B22ZEcjs.TypeGit; exports.createNodeAdapters = _chunkI77B22ZEcjs.createNodeAdapters;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-
|
|
2
|
-
import { C as Capabilities, G as Git } from '../../git.d-
|
|
1
|
+
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Jwli7Qfw.cjs';
|
|
2
|
+
import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Options for {@link NodeExecAdapter}.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-
|
|
2
|
-
import { C as Capabilities, G as Git } from '../../git.d-
|
|
1
|
+
import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-ClMefrEh.js';
|
|
2
|
+
import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Options for {@link NodeExecAdapter}.
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
NodeFsAdapter,
|
|
4
4
|
TypeGit,
|
|
5
5
|
createNodeAdapters
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-MS6E5USB.js";
|
|
7
|
+
import "../../chunk-HCQGGKTC.js";
|
|
8
|
+
import "../../chunk-V4ZRQG3O.js";
|
|
9
9
|
export {
|
|
10
10
|
NodeExecAdapter,
|
|
11
11
|
NodeFsAdapter,
|