type-git 0.5.0 → 0.7.0
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 +27 -7
- package/dist/adapters/bun/index.cjs +82 -13348
- package/dist/adapters/bun/index.d.cts +7 -1
- package/dist/adapters/bun/index.d.ts +7 -1
- package/dist/adapters/bun/index.js +49 -13275
- package/dist/adapters/deno/index.cjs +76 -13344
- package/dist/adapters/deno/index.d.cts +7 -1
- package/dist/adapters/deno/index.d.ts +7 -1
- package/dist/adapters/deno/index.js +44 -13272
- package/dist/adapters/node/index.cjs +5 -13617
- package/dist/adapters/node/index.d.cts +44 -6
- package/dist/adapters/node/index.d.ts +44 -6
- package/dist/adapters/node/index.js +8 -13580
- package/dist/chunk-5NI3KM5Z.js +4822 -0
- package/dist/chunk-IAJF67MB.js +392 -0
- package/dist/chunk-MFY7MGIJ.cjs +4822 -0
- package/dist/chunk-NBX6BNQF.cjs +5588 -0
- package/dist/chunk-X3F6MDXQ.cjs +392 -0
- package/dist/chunk-YIWTIIXH.js +5588 -0
- package/dist/client.d-Cs32YZX6.d.ts +566 -0
- package/dist/client.d-PRQCR2_T.d.cts +566 -0
- package/dist/{client-KHa1WMIH.d.cts → git.d-DrhCzWEn.d.cts} +4541 -6876
- package/dist/index.cjs +42 -13717
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +38 -13649
- package/dist/strict/index.cjs +2919 -0
- package/dist/strict/index.d.cts +134022 -0
- package/dist/strict/index.d.ts +1 -0
- package/dist/strict/index.js +2919 -0
- package/docs/adapters.md +168 -0
- package/docs/migrations/0.7.0.md +152 -0
- package/package.json +58 -21
- package/dist/adapters/bun/index.cjs.map +0 -1
- package/dist/adapters/bun/index.js.map +0 -1
- package/dist/adapters/deno/index.cjs.map +0 -1
- package/dist/adapters/deno/index.js.map +0 -1
- package/dist/adapters/node/index.cjs.map +0 -1
- package/dist/adapters/node/index.js.map +0 -1
- package/dist/client-KHa1WMIH.d.ts +0 -12041
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,12 +1,41 @@
|
|
|
1
|
-
import { E as ExecAdapter,
|
|
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-PRQCR2_T.cjs';
|
|
2
|
+
import { C as Capabilities, G as Git } from '../../git.d-DrhCzWEn.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Options for {@link NodeExecAdapter}.
|
|
6
|
+
*
|
|
7
|
+
* Only vetted `child_process.spawn` options are accepted. Options such as `shell` would let
|
|
8
|
+
* Git arguments be reinterpreted by a shell, and `stdio`/`cwd`/`env` are controlled per call
|
|
9
|
+
* through {@link SpawnOptions}, so they are deliberately not exposed here.
|
|
5
10
|
*/
|
|
6
|
-
|
|
11
|
+
type NodeExecAdapterOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* Hide the console window that Windows would otherwise create for each spawned process
|
|
14
|
+
* (Node's `windowsHide`). It has no effect on other platforms.
|
|
15
|
+
*
|
|
16
|
+
* @default false (Node's default)
|
|
17
|
+
*/
|
|
18
|
+
windowsHide?: boolean;
|
|
19
|
+
};
|
|
7
20
|
declare class NodeExecAdapter implements ExecAdapter {
|
|
21
|
+
private readonly windowsHide;
|
|
22
|
+
/**
|
|
23
|
+
* @param options - Vetted spawn options; see {@link NodeExecAdapterOptions}.
|
|
24
|
+
* @throws TypeError if `windowsHide` is present but not a boolean.
|
|
25
|
+
*/
|
|
26
|
+
constructor(options?: NodeExecAdapterOptions);
|
|
8
27
|
getCapabilities(): Capabilities;
|
|
9
28
|
spawn(options: SpawnOptions, handlers?: StreamHandler): Promise<SpawnResult>;
|
|
29
|
+
spawnBytes(options: SpawnOptions, handlers?: Pick<StreamHandler, 'onStderr'>): Promise<SpawnResult<Uint8Array>>;
|
|
30
|
+
/**
|
|
31
|
+
* Run a process to completion and collect its output as text, or as bytes when `binary` is
|
|
32
|
+
* true. Applies the configured `windowsHide` option.
|
|
33
|
+
*/
|
|
34
|
+
private spawnResult;
|
|
35
|
+
/**
|
|
36
|
+
* Start a process and return a handle that streams its stdout lines. Applies the configured
|
|
37
|
+
* `windowsHide` option.
|
|
38
|
+
*/
|
|
10
39
|
spawnStreaming(options: SpawnOptions): SpawnHandle;
|
|
11
40
|
}
|
|
12
41
|
|
|
@@ -15,7 +44,10 @@ declare class NodeExecAdapter implements ExecAdapter {
|
|
|
15
44
|
*/
|
|
16
45
|
|
|
17
46
|
declare class NodeFsAdapter implements FsAdapter {
|
|
47
|
+
/** Private directories created by createTempFile, keyed by the returned file path. */
|
|
48
|
+
private readonly tempFileDirs;
|
|
18
49
|
createTempFile(prefix?: string): Promise<string>;
|
|
50
|
+
createTempDirectory(prefix?: string): Promise<string>;
|
|
19
51
|
tail(options: TailOptions): Promise<void>;
|
|
20
52
|
deleteFile(filePath: string): Promise<void>;
|
|
21
53
|
deleteDirectory(dirPath: string): Promise<void>;
|
|
@@ -28,13 +60,19 @@ declare class NodeFsAdapter implements FsAdapter {
|
|
|
28
60
|
}): TailHandle;
|
|
29
61
|
}
|
|
30
62
|
|
|
63
|
+
/** Options for {@link createNodeAdapters}. */
|
|
64
|
+
type NodeAdaptersOptions = NodeExecAdapterOptions;
|
|
31
65
|
/**
|
|
32
66
|
* Create Node.js runtime adapters
|
|
33
67
|
*/
|
|
34
|
-
declare function createNodeAdapters(): RuntimeAdapters;
|
|
35
|
-
type TypeGitOptions = Omit<CreateGitOptions, 'adapters'
|
|
68
|
+
declare function createNodeAdapters(options?: NodeAdaptersOptions): RuntimeAdapters;
|
|
69
|
+
type TypeGitOptions = Omit<CreateGitOptions, 'adapters'> & NodeAdaptersOptions;
|
|
36
70
|
/** Git client preconfigured for Node. */
|
|
37
71
|
declare class TypeGit extends GitClient {
|
|
72
|
+
/**
|
|
73
|
+
* Create a client after checking the installed Git version. Node adapter options such as
|
|
74
|
+
* `windowsHide` are passed to the execution adapter.
|
|
75
|
+
*/
|
|
38
76
|
static create(options?: TypeGitOptions): Promise<TypeGit>;
|
|
39
77
|
/** @deprecated Use TypeGit.create() to check Git compatibility. */
|
|
40
78
|
constructor(constructorOptions?: TypeGitOptions);
|
|
@@ -42,4 +80,4 @@ declare class TypeGit extends GitClient {
|
|
|
42
80
|
constructor(git: Git);
|
|
43
81
|
}
|
|
44
82
|
|
|
45
|
-
export { NodeExecAdapter, NodeFsAdapter, TypeGit, type TypeGitOptions, createNodeAdapters };
|
|
83
|
+
export { type NodeAdaptersOptions, NodeExecAdapter, type NodeExecAdapterOptions, NodeFsAdapter, TypeGit, type TypeGitOptions, createNodeAdapters };
|
|
@@ -1,12 +1,41 @@
|
|
|
1
|
-
import { E as ExecAdapter,
|
|
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-Cs32YZX6.js';
|
|
2
|
+
import { C as Capabilities, G as Git } from '../../git.d-DrhCzWEn.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Options for {@link NodeExecAdapter}.
|
|
6
|
+
*
|
|
7
|
+
* Only vetted `child_process.spawn` options are accepted. Options such as `shell` would let
|
|
8
|
+
* Git arguments be reinterpreted by a shell, and `stdio`/`cwd`/`env` are controlled per call
|
|
9
|
+
* through {@link SpawnOptions}, so they are deliberately not exposed here.
|
|
5
10
|
*/
|
|
6
|
-
|
|
11
|
+
type NodeExecAdapterOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* Hide the console window that Windows would otherwise create for each spawned process
|
|
14
|
+
* (Node's `windowsHide`). It has no effect on other platforms.
|
|
15
|
+
*
|
|
16
|
+
* @default false (Node's default)
|
|
17
|
+
*/
|
|
18
|
+
windowsHide?: boolean;
|
|
19
|
+
};
|
|
7
20
|
declare class NodeExecAdapter implements ExecAdapter {
|
|
21
|
+
private readonly windowsHide;
|
|
22
|
+
/**
|
|
23
|
+
* @param options - Vetted spawn options; see {@link NodeExecAdapterOptions}.
|
|
24
|
+
* @throws TypeError if `windowsHide` is present but not a boolean.
|
|
25
|
+
*/
|
|
26
|
+
constructor(options?: NodeExecAdapterOptions);
|
|
8
27
|
getCapabilities(): Capabilities;
|
|
9
28
|
spawn(options: SpawnOptions, handlers?: StreamHandler): Promise<SpawnResult>;
|
|
29
|
+
spawnBytes(options: SpawnOptions, handlers?: Pick<StreamHandler, 'onStderr'>): Promise<SpawnResult<Uint8Array>>;
|
|
30
|
+
/**
|
|
31
|
+
* Run a process to completion and collect its output as text, or as bytes when `binary` is
|
|
32
|
+
* true. Applies the configured `windowsHide` option.
|
|
33
|
+
*/
|
|
34
|
+
private spawnResult;
|
|
35
|
+
/**
|
|
36
|
+
* Start a process and return a handle that streams its stdout lines. Applies the configured
|
|
37
|
+
* `windowsHide` option.
|
|
38
|
+
*/
|
|
10
39
|
spawnStreaming(options: SpawnOptions): SpawnHandle;
|
|
11
40
|
}
|
|
12
41
|
|
|
@@ -15,7 +44,10 @@ declare class NodeExecAdapter implements ExecAdapter {
|
|
|
15
44
|
*/
|
|
16
45
|
|
|
17
46
|
declare class NodeFsAdapter implements FsAdapter {
|
|
47
|
+
/** Private directories created by createTempFile, keyed by the returned file path. */
|
|
48
|
+
private readonly tempFileDirs;
|
|
18
49
|
createTempFile(prefix?: string): Promise<string>;
|
|
50
|
+
createTempDirectory(prefix?: string): Promise<string>;
|
|
19
51
|
tail(options: TailOptions): Promise<void>;
|
|
20
52
|
deleteFile(filePath: string): Promise<void>;
|
|
21
53
|
deleteDirectory(dirPath: string): Promise<void>;
|
|
@@ -28,13 +60,19 @@ declare class NodeFsAdapter implements FsAdapter {
|
|
|
28
60
|
}): TailHandle;
|
|
29
61
|
}
|
|
30
62
|
|
|
63
|
+
/** Options for {@link createNodeAdapters}. */
|
|
64
|
+
type NodeAdaptersOptions = NodeExecAdapterOptions;
|
|
31
65
|
/**
|
|
32
66
|
* Create Node.js runtime adapters
|
|
33
67
|
*/
|
|
34
|
-
declare function createNodeAdapters(): RuntimeAdapters;
|
|
35
|
-
type TypeGitOptions = Omit<CreateGitOptions, 'adapters'
|
|
68
|
+
declare function createNodeAdapters(options?: NodeAdaptersOptions): RuntimeAdapters;
|
|
69
|
+
type TypeGitOptions = Omit<CreateGitOptions, 'adapters'> & NodeAdaptersOptions;
|
|
36
70
|
/** Git client preconfigured for Node. */
|
|
37
71
|
declare class TypeGit extends GitClient {
|
|
72
|
+
/**
|
|
73
|
+
* Create a client after checking the installed Git version. Node adapter options such as
|
|
74
|
+
* `windowsHide` are passed to the execution adapter.
|
|
75
|
+
*/
|
|
38
76
|
static create(options?: TypeGitOptions): Promise<TypeGit>;
|
|
39
77
|
/** @deprecated Use TypeGit.create() to check Git compatibility. */
|
|
40
78
|
constructor(constructorOptions?: TypeGitOptions);
|
|
@@ -42,4 +80,4 @@ declare class TypeGit extends GitClient {
|
|
|
42
80
|
constructor(git: Git);
|
|
43
81
|
}
|
|
44
82
|
|
|
45
|
-
export { NodeExecAdapter, NodeFsAdapter, TypeGit, type TypeGitOptions, createNodeAdapters };
|
|
83
|
+
export { type NodeAdaptersOptions, NodeExecAdapter, type NodeExecAdapterOptions, NodeFsAdapter, TypeGit, type TypeGitOptions, createNodeAdapters };
|