-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-types.ts
More file actions
92 lines (89 loc) · 2.09 KB
/
github-types.ts
File metadata and controls
92 lines (89 loc) · 2.09 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
/**
* @file Public types for GitHub release download utilities.
*/
/**
* Pattern for matching release assets. Can be either:
*
* - A string with glob pattern syntax
* - A prefix/suffix pair for explicit matching (backward compatible)
* - A RegExp for complex patterns
*
* String patterns support full glob syntax via picomatch. Examples:
*
* - Simple wildcard: yoga-sync-*.mjs matches yoga-sync-abc123.mjs
* - Complex: models-*.tar.gz matches models-2024-01-15.tar.gz
* - Prefix wildcard: *-models.tar.gz matches foo-models.tar.gz
* - Suffix wildcard: yoga-* matches yoga-layout
* - Brace expansion: {yoga,models}-*.{mjs,js} matches yoga-abc.mjs or
* models-xyz.js
*
* For backward compatibility, prefix/suffix objects are still supported but
* glob patterns are recommended.
*/
export type AssetPattern = string | { prefix: string; suffix: string } | RegExp
/**
* Configuration for downloading a GitHub release.
*/
export interface DownloadGitHubReleaseConfig {
/**
* Asset name on GitHub.
*/
assetName: string
/**
* Binary filename (e.g., 'node', 'binject').
*/
binaryName: string
/**
* Working directory (defaults to process.cwd()).
*/
cwd?: string
/**
* Download destination directory. @default 'build/downloaded'
*/
downloadDir?: string
/**
* GitHub repository owner/organization.
*/
owner: string
/**
* Platform-arch identifier (e.g., 'linux-x64-musl').
*/
platformArch: string
/**
* Suppress log messages. @default false.
*/
quiet?: boolean
/**
* Remove macOS quarantine attribute after download. @default true.
*/
removeMacOSQuarantine?: boolean
/**
* GitHub repository name.
*/
repo: string
/**
* Specific release tag to download.
*/
tag?: string
/**
* Tool name for directory structure.
*/
toolName: string
/**
* Tool prefix for finding latest release.
*/
toolPrefix?: string
}
/**
* Configuration for repository access.
*/
export interface RepoConfig {
/**
* GitHub repository owner/organization.
*/
owner: string
/**
* GitHub repository name.
*/
repo: string
}