-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
112 lines (110 loc) · 2.83 KB
/
types.ts
File metadata and controls
112 lines (110 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
* @fileoverview Public type surface for `git/*` modules — the
* `FilterPackagesByChangesOptions` and `GitDiffOptions` configuration
* records. Pure types, no runtime side effects.
*/
/**
* Options for filtering packages by git changes.
*
* Used to determine which packages in a monorepo have changed files.
*
* @example
* ```typescript
* // Filter packages with changes
* const changed = filterPackagesByChanges(packages)
*
* // Force include all packages
* const all = filterPackagesByChanges(packages, { force: true })
*
* // Use custom package key
* const changed = filterPackagesByChanges(
* packages,
* { packageKey: 'directory' }
* )
* ```
*/
export interface FilterPackagesByChangesOptions {
/**
* Force include all packages regardless of changes.
*
* @default false
*/
force?: boolean | undefined
/**
* Key to access package path in package objects.
*
* @default 'path'
*/
packageKey?: string | undefined
/**
* Additional options for filtering.
*/
[key: string]: unknown
}
/**
* Options for git diff operations.
*
* Controls how git diff results are processed and returned.
*
* @example
* ```typescript
* // Get absolute file paths
* const files = await getChangedFiles({ absolute: true })
* // => ['/path/to/repo/src/file.ts']
*
* // Get relative paths with caching disabled
* const files = await getChangedFiles({ cache: false })
* // => ['src/file.ts']
*
* // Get files from specific directory
* const files = await getChangedFiles({ cwd: '/path/to/repo/src' })
* ```
*/
export interface GitDiffOptions {
/**
* Return absolute file paths instead of relative paths.
*
* @default false
*/
absolute?: boolean | undefined
/**
* Return results as a `Set` instead of an array.
*
* @default false
*/
asSet?: boolean | undefined
/**
* Cache git diff results to avoid repeated git subprocess calls.
*
* Caching is keyed by the git command and options used, so different
* option combinations maintain separate cache entries.
*
* @default true
*/
cache?: boolean | undefined
/**
* Working directory for git operations.
*
* Git operations will be run from this directory, and returned paths
* will be relative to the git repository root. Symlinks are resolved
* using `fs.realpathSync()`.
*
* @default process.cwd()
*/
cwd?: string | undefined
/**
* Parse git porcelain format output (status codes like `M`, `A`, `??`).
*
* When `true`, strips the two-character status code and space from the
* beginning of each line. Automatically enabled for `getChangedFiles()`.
*
* @default false
*/
porcelain?: boolean | undefined
/**
* Additional options passed to glob matcher.
*
* Supports options like `dot`, `ignore`, `nocase` for filtering results.
*/
[key: string]: unknown
}