@doki-land/nifty 0.1.1 → 0.1.2
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/cli/nifty.mjs +2 -2
- package/package.json +6 -6
- package/src/cli/authArgs.ts +29 -29
- package/src/cli/bump-cmd.ts +15 -15
- package/src/cli/bump.ts +79 -79
- package/src/cli/change-logs-cmd.ts +26 -26
- package/src/cli/cli.ts +3 -3
- package/src/cli/commit-cmd.ts +76 -78
- package/src/cli/commit-lint-report.ts +46 -48
- package/src/cli/context.ts +9 -9
- package/src/cli/format-cmd.ts +6 -6
- package/src/cli/format.ts +15 -15
- package/src/cli/install-native-cmd.ts +4 -4
- package/src/cli/install-native.ts +24 -24
- package/src/cli/lint-cmd.ts +11 -11
- package/src/cli/lint.ts +48 -52
- package/src/cli/options.ts +14 -14
- package/src/cli/publish-cmd.ts +12 -18
- package/src/cli/publish.ts +38 -38
- package/src/cli/resolveNpm.ts +3 -3
- package/src/cli/retime-cmd.ts +18 -18
- package/src/cli/trust-cmd.ts +11 -11
- package/src/cli/trust.ts +26 -26
- package/src/cli/update-cmd.ts +5 -5
- package/src/cli/update.ts +12 -12
- package/src/cli/upload-cmd.ts +17 -17
- package/src/cli/upload.ts +131 -131
- package/src/cli/workspace.ts +46 -46
- package/src/config/authorMap.ts +4 -8
- package/src/config/defineConfig.ts +5 -5
- package/src/config/detectProject.ts +46 -46
- package/src/config/formatPresets.ts +24 -24
- package/src/config/loadConfig.ts +35 -35
- package/src/config/trustPayload.ts +6 -6
- package/src/config/types.ts +37 -37
- package/src/git.ts +14 -14
- package/src/github.ts +54 -54
- package/src/gitmoji.ts +18 -18
- package/src/native.ts +595 -599
- package/src/nifty.ts +29 -31
- package/src/types.ts +17 -17
package/src/native.ts
CHANGED
|
@@ -9,740 +9,736 @@ import type {
|
|
|
9
9
|
} from "./types.js";
|
|
10
10
|
|
|
11
11
|
export type GitmojiExports = {
|
|
12
|
-
"known-gitmojis"
|
|
13
|
-
"validate-subject"
|
|
14
|
-
"parse-subject"
|
|
15
|
-
"format-subject"
|
|
16
|
-
"strip-gitmoji"
|
|
17
|
-
"leading-gitmoji"
|
|
18
|
-
"section-for-gitmoji"
|
|
19
|
-
"parse-noreply-email"
|
|
20
|
-
"resolve-github-author"
|
|
21
|
-
"display-login"
|
|
22
|
-
"profile-url"
|
|
23
|
-
"avatar-url"
|
|
24
|
-
"author-mention"
|
|
25
|
-
"commit-bullet"
|
|
12
|
+
"known-gitmojis": () => string[];
|
|
13
|
+
"validate-subject": (subject: string) => boolean;
|
|
14
|
+
"parse-subject": (subject: string) => ParsedSubject;
|
|
15
|
+
"format-subject": (gitmoji: string, body: string) => string;
|
|
16
|
+
"strip-gitmoji": (subject: string) => string;
|
|
17
|
+
"leading-gitmoji": (subject: string) => string | undefined;
|
|
18
|
+
"section-for-gitmoji": (gitmoji: string | undefined) => ReleaseSection;
|
|
19
|
+
"parse-noreply-email": (email: string) => GithubAuthor | undefined;
|
|
20
|
+
"resolve-github-author": (email: string, authorMapJson: string) => GithubAuthor | undefined;
|
|
21
|
+
"display-login": (author: GithubAuthor) => string;
|
|
22
|
+
"profile-url": (author: GithubAuthor) => string;
|
|
23
|
+
"avatar-url": (author: GithubAuthor) => string;
|
|
24
|
+
"author-mention": (email: string, authorName: string, authorMapJson: string) => string;
|
|
25
|
+
"commit-bullet": (body: string, email: string, authorName: string, authorMapJson: string) => string;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export type GitExports = {
|
|
29
|
-
"discover-root"
|
|
30
|
-
"list-version-tags"
|
|
31
|
-
"list-tag-infos"
|
|
32
|
-
"format-tag-list"
|
|
33
|
-
"resolve-range"
|
|
34
|
-
repoRoot
|
|
35
|
-
version
|
|
36
|
-
fromRef
|
|
37
|
-
toRef
|
|
38
|
-
) =>{ version
|
|
39
|
-
"collect-commits"
|
|
40
|
-
repoRoot
|
|
41
|
-
fromRef
|
|
42
|
-
toRef
|
|
43
|
-
) =>NativeCommitRecord[];
|
|
44
|
-
"detect-github-repo"
|
|
45
|
-
"parse-github-remote"
|
|
29
|
+
"discover-root": (startPath: string) => string;
|
|
30
|
+
"list-version-tags": (repoRoot: string) => string[];
|
|
31
|
+
"list-tag-infos": (repoRoot: string) => Array < { name: string; "short-hash": string }>;
|
|
32
|
+
"format-tag-list": (repoRoot: string) => string;
|
|
33
|
+
"resolve-range": (
|
|
34
|
+
repoRoot: string,
|
|
35
|
+
version: string | undefined,
|
|
36
|
+
fromRef: string | undefined,
|
|
37
|
+
toRef: string | undefined,
|
|
38
|
+
) => { version: string; "from-ref"?: string; "to-ref": string };
|
|
39
|
+
"collect-commits": (
|
|
40
|
+
repoRoot: string,
|
|
41
|
+
fromRef: string | undefined,
|
|
42
|
+
toRef: string,
|
|
43
|
+
) => NativeCommitRecord[];
|
|
44
|
+
"detect-github-repo": (repoRoot: string) => string | undefined;
|
|
45
|
+
"parse-github-remote": (url: string) => string | undefined;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
type NativeCommitRecord = Omit<CommitRecord, "section"> & { section
|
|
48
|
+
type NativeCommitRecord = Omit < CommitRecord, "section"> & { section: string };
|
|
49
49
|
|
|
50
50
|
export type PublishReport = {
|
|
51
|
-
root
|
|
52
|
-
order
|
|
53
|
-
published
|
|
54
|
-
skipped
|
|
55
|
-
skippedVersions
|
|
51
|
+
root: string;
|
|
52
|
+
order: string[];
|
|
53
|
+
published: string[];
|
|
54
|
+
skipped: string[];
|
|
55
|
+
skippedVersions: string[];
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
export type TrustReport = {
|
|
59
|
-
root
|
|
60
|
-
configured
|
|
61
|
-
skipped
|
|
62
|
-
failed
|
|
59
|
+
root: string;
|
|
60
|
+
configured: string[];
|
|
61
|
+
skipped: string[];
|
|
62
|
+
failed: string[];
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export type RewordPlannedChange = {
|
|
66
|
-
oldOid
|
|
67
|
-
oldSubject
|
|
68
|
-
newSubject
|
|
69
|
-
parentsRelinked
|
|
70
|
-
messageChanged
|
|
66
|
+
oldOid: string;
|
|
67
|
+
oldSubject: string;
|
|
68
|
+
newSubject: string;
|
|
69
|
+
parentsRelinked: boolean;
|
|
70
|
+
messageChanged: boolean;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
export type RewordRewriteReport = {
|
|
74
|
-
changes
|
|
75
|
-
oldTip
|
|
76
|
-
newTip
|
|
77
|
-
refName
|
|
78
|
-
dryRun
|
|
74
|
+
changes: RewordPlannedChange[];
|
|
75
|
+
oldTip: string;
|
|
76
|
+
newTip?: string;
|
|
77
|
+
refName: string;
|
|
78
|
+
dryRun: boolean;
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
export type HistoryExports = {
|
|
82
|
-
"commit-export"
|
|
83
|
-
cwd
|
|
84
|
-
base
|
|
85
|
-
ref
|
|
86
|
-
path
|
|
87
|
-
}) =>{ count
|
|
88
|
-
"commit-apply"
|
|
89
|
-
cwd
|
|
90
|
-
base
|
|
91
|
-
ref
|
|
92
|
-
path
|
|
93
|
-
dryRun
|
|
94
|
-
}) =>RewordRewriteReport;
|
|
82
|
+
"commit-export": (options: {
|
|
83
|
+
cwd?: string;
|
|
84
|
+
base: string;
|
|
85
|
+
ref?: string;
|
|
86
|
+
path: string;
|
|
87
|
+
}) => { count: number; path: string };
|
|
88
|
+
"commit-apply": (options: {
|
|
89
|
+
cwd?: string;
|
|
90
|
+
base: string;
|
|
91
|
+
ref?: string;
|
|
92
|
+
path: string;
|
|
93
|
+
dryRun?: boolean;
|
|
94
|
+
}) => RewordRewriteReport;
|
|
95
95
|
/** @deprecated use `commit-export` */
|
|
96
|
-
"reword-export"
|
|
97
|
-
cwd
|
|
98
|
-
base
|
|
99
|
-
ref
|
|
100
|
-
path
|
|
101
|
-
}) =>{ count
|
|
96
|
+
"reword-export": (options: {
|
|
97
|
+
cwd?: string;
|
|
98
|
+
base: string;
|
|
99
|
+
ref?: string;
|
|
100
|
+
path: string;
|
|
101
|
+
}) => { count: number; path: string };
|
|
102
102
|
/** @deprecated use `commit-apply` */
|
|
103
|
-
"reword-rewrite"
|
|
104
|
-
cwd
|
|
105
|
-
base
|
|
106
|
-
ref
|
|
107
|
-
path
|
|
108
|
-
dryRun
|
|
109
|
-
}) =>RewordRewriteReport;
|
|
110
|
-
"retime-range"
|
|
111
|
-
cwd
|
|
112
|
-
commit
|
|
113
|
-
startDate
|
|
114
|
-
endDate
|
|
115
|
-
branch
|
|
116
|
-
tip
|
|
117
|
-
}) =>{ branch
|
|
118
|
-
"retime-root"
|
|
119
|
-
cwd
|
|
120
|
-
startDate
|
|
121
|
-
endDate
|
|
122
|
-
branch
|
|
123
|
-
tip
|
|
124
|
-
message
|
|
125
|
-
}) =>{ branch
|
|
126
|
-
"changelog-render"
|
|
127
|
-
cwd
|
|
128
|
-
version
|
|
129
|
-
fromRef
|
|
130
|
-
toRef
|
|
131
|
-
write
|
|
132
|
-
tags
|
|
133
|
-
repo
|
|
134
|
-
authorMap
|
|
135
|
-
releasesDir
|
|
136
|
-
}) =>{
|
|
137
|
-
notes
|
|
138
|
-
version
|
|
139
|
-
fromRef
|
|
140
|
-
toRef
|
|
141
|
-
commitCount
|
|
142
|
-
writtenPath
|
|
143
|
-
rangeLabel
|
|
103
|
+
"reword-rewrite": (options: {
|
|
104
|
+
cwd?: string;
|
|
105
|
+
base: string;
|
|
106
|
+
ref?: string;
|
|
107
|
+
path: string;
|
|
108
|
+
dryRun?: boolean;
|
|
109
|
+
}) => RewordRewriteReport;
|
|
110
|
+
"retime-range": (options: {
|
|
111
|
+
cwd?: string;
|
|
112
|
+
commit: string;
|
|
113
|
+
startDate?: string;
|
|
114
|
+
endDate?: string;
|
|
115
|
+
branch?: string;
|
|
116
|
+
tip?: string;
|
|
117
|
+
}) => { branch: string; newTip: string; rewritten: number };
|
|
118
|
+
"retime-root": (options: {
|
|
119
|
+
cwd?: string;
|
|
120
|
+
startDate?: string;
|
|
121
|
+
endDate?: string;
|
|
122
|
+
branch?: string;
|
|
123
|
+
tip?: string;
|
|
124
|
+
message?: string;
|
|
125
|
+
}) => { branch: string; newTip: string; rewritten: number };
|
|
126
|
+
"changelog-render": (options: {
|
|
127
|
+
cwd?: string;
|
|
128
|
+
version?: string;
|
|
129
|
+
fromRef?: string;
|
|
130
|
+
toRef?: string;
|
|
131
|
+
write?: boolean;
|
|
132
|
+
tags?: boolean;
|
|
133
|
+
repo?: string;
|
|
134
|
+
authorMap?: string;
|
|
135
|
+
releasesDir?: string;
|
|
136
|
+
}) => {
|
|
137
|
+
notes: string;
|
|
138
|
+
version: string;
|
|
139
|
+
fromRef?: string;
|
|
140
|
+
toRef: string;
|
|
141
|
+
commitCount: number;
|
|
142
|
+
writtenPath?: string;
|
|
143
|
+
rangeLabel: string;
|
|
144
144
|
};
|
|
145
|
-
"changelog-lookup"
|
|
146
|
-
cwd
|
|
147
|
-
email
|
|
148
|
-
login
|
|
149
|
-
map
|
|
150
|
-
githubToken
|
|
151
|
-
fetch
|
|
152
|
-
}) =>GithubAuthor;
|
|
145
|
+
"changelog-lookup": (options: {
|
|
146
|
+
cwd?: string;
|
|
147
|
+
email?: string;
|
|
148
|
+
login?: string;
|
|
149
|
+
map?: string;
|
|
150
|
+
githubToken?: string;
|
|
151
|
+
fetch?: boolean;
|
|
152
|
+
}) => GithubAuthor;
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
export type LintDiagnosticRecord = {
|
|
156
|
-
rule
|
|
157
|
-
severity
|
|
158
|
-
message
|
|
159
|
-
subject
|
|
160
|
-
hash
|
|
161
|
-
path
|
|
162
|
-
line
|
|
156
|
+
rule: string;
|
|
157
|
+
severity: "error" | "warning" | "info";
|
|
158
|
+
message: string;
|
|
159
|
+
subject?: string;
|
|
160
|
+
hash?: string;
|
|
161
|
+
path?: string;
|
|
162
|
+
line?: number;
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
export type LintRunOptions = {
|
|
166
|
-
cwd
|
|
167
|
-
fromRef
|
|
168
|
-
toRef
|
|
169
|
-
subjects
|
|
170
|
-
rules
|
|
171
|
-
scanCargo
|
|
172
|
-
commitOnly
|
|
166
|
+
cwd?: string;
|
|
167
|
+
fromRef?: string;
|
|
168
|
+
toRef?: string;
|
|
169
|
+
subjects?: string[];
|
|
170
|
+
rules?: Array < { id: string; enabled?: boolean; severity?: "error" | "warning" | "info" }>;
|
|
171
|
+
scanCargo?: boolean;
|
|
172
|
+
commitOnly?: boolean;
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
export type LintReportRecord = {
|
|
176
|
-
diagnostics
|
|
177
|
-
errorCount
|
|
178
|
-
warningCount
|
|
176
|
+
diagnostics: LintDiagnosticRecord[];
|
|
177
|
+
errorCount: number;
|
|
178
|
+
warningCount: number;
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
export type LintExports = {
|
|
182
|
-
run
|
|
183
|
-
check
|
|
182
|
+
run: (options: LintRunOptions) => LintReportRecord;
|
|
183
|
+
check: (options: LintRunOptions) => LintReportRecord;
|
|
184
184
|
};
|
|
185
185
|
|
|
186
186
|
export type UpdaterExports = {
|
|
187
|
-
run
|
|
187
|
+
run: (options: { cwd?: string; interactive?: boolean }) => void;
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
export type FormatReportRecord = {
|
|
191
|
-
formatted
|
|
192
|
-
unchanged
|
|
193
|
-
errors
|
|
191
|
+
formatted: number;
|
|
192
|
+
unchanged: number;
|
|
193
|
+
errors: string[];
|
|
194
194
|
};
|
|
195
195
|
|
|
196
196
|
export type FormatterStyleOptions = {
|
|
197
|
-
indentStyle
|
|
198
|
-
indentWidth
|
|
199
|
-
lineWidth
|
|
200
|
-
quoteStyle
|
|
197
|
+
indentStyle?: string;
|
|
198
|
+
indentWidth?: number;
|
|
199
|
+
lineWidth?: number;
|
|
200
|
+
quoteStyle?: string;
|
|
201
201
|
};
|
|
202
202
|
|
|
203
203
|
export type FormatterRunOptions = {
|
|
204
|
-
cwd
|
|
205
|
-
check
|
|
206
|
-
includes
|
|
207
|
-
excludes
|
|
208
|
-
rust
|
|
209
|
-
javascript
|
|
210
|
-
style
|
|
204
|
+
cwd?: string;
|
|
205
|
+
check?: boolean;
|
|
206
|
+
includes?: string[];
|
|
207
|
+
excludes?: string[];
|
|
208
|
+
rust?: boolean;
|
|
209
|
+
javascript?: boolean;
|
|
210
|
+
style?: FormatterStyleOptions;
|
|
211
211
|
};
|
|
212
212
|
|
|
213
213
|
export type FormatterExports = {
|
|
214
|
-
run
|
|
214
|
+
run: (options: FormatterRunOptions) => FormatReportRecord;
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
export type PublisherExports = {
|
|
218
|
-
"publish-workspace"
|
|
219
|
-
cwd
|
|
220
|
-
dryRun
|
|
221
|
-
refresh
|
|
222
|
-
placeholder
|
|
223
|
-
only
|
|
224
|
-
packages
|
|
225
|
-
tag
|
|
226
|
-
access
|
|
227
|
-
npm
|
|
228
|
-
otp
|
|
229
|
-
totpSecret
|
|
230
|
-
token
|
|
231
|
-
trustRepo
|
|
232
|
-
trustFile
|
|
233
|
-
trustEnvironment
|
|
234
|
-
}) =>PublishReport;
|
|
235
|
-
"trust-workspace"
|
|
236
|
-
cwd
|
|
237
|
-
dryRun
|
|
238
|
-
refresh
|
|
239
|
-
only
|
|
240
|
-
packages
|
|
241
|
-
npm
|
|
242
|
-
otp
|
|
243
|
-
totpSecret
|
|
244
|
-
token
|
|
245
|
-
trustRepo
|
|
246
|
-
trustFile
|
|
247
|
-
trustEnvironment
|
|
248
|
-
}) =>TrustReport;
|
|
218
|
+
"publish-workspace": (options: {
|
|
219
|
+
cwd?: string;
|
|
220
|
+
dryRun?: boolean;
|
|
221
|
+
refresh?: boolean;
|
|
222
|
+
placeholder?: boolean;
|
|
223
|
+
only?: string;
|
|
224
|
+
packages?: string[];
|
|
225
|
+
tag?: string;
|
|
226
|
+
access?: string;
|
|
227
|
+
npm?: string;
|
|
228
|
+
otp?: string;
|
|
229
|
+
totpSecret?: string;
|
|
230
|
+
token?: string;
|
|
231
|
+
trustRepo?: string;
|
|
232
|
+
trustFile?: string;
|
|
233
|
+
trustEnvironment?: string;
|
|
234
|
+
}) => PublishReport;
|
|
235
|
+
"trust-workspace": (options: {
|
|
236
|
+
cwd?: string;
|
|
237
|
+
dryRun?: boolean;
|
|
238
|
+
refresh?: boolean;
|
|
239
|
+
only?: string;
|
|
240
|
+
packages?: string[];
|
|
241
|
+
npm?: string;
|
|
242
|
+
otp?: string;
|
|
243
|
+
totpSecret?: string;
|
|
244
|
+
token?: string;
|
|
245
|
+
trustRepo?: string;
|
|
246
|
+
trustFile?: string;
|
|
247
|
+
trustEnvironment?: string;
|
|
248
|
+
}) => TrustReport;
|
|
249
249
|
};
|
|
250
250
|
|
|
251
251
|
export type NiftyNative = {
|
|
252
|
-
gitmoji
|
|
253
|
-
git
|
|
254
|
-
history
|
|
255
|
-
lint
|
|
256
|
-
updater
|
|
257
|
-
formatter
|
|
258
|
-
publisher
|
|
252
|
+
gitmoji: GitmojiExports;
|
|
253
|
+
git: GitExports;
|
|
254
|
+
history: HistoryExports;
|
|
255
|
+
lint: LintExports;
|
|
256
|
+
updater: UpdaterExports;
|
|
257
|
+
formatter: FormatterExports;
|
|
258
|
+
publisher: PublisherExports;
|
|
259
259
|
};
|
|
260
260
|
|
|
261
261
|
type NativeBinding = {
|
|
262
|
-
gitmojiKnownGitmojis
|
|
263
|
-
gitmojiValidateSubject
|
|
264
|
-
gitmojiParseSubject
|
|
265
|
-
gitmojiFormatSubject
|
|
266
|
-
gitmojiStripGitmoji
|
|
267
|
-
gitmojiLeadingGitmoji
|
|
268
|
-
gitmojiSectionForGitmoji
|
|
269
|
-
gitmojiParseNoreplyEmail
|
|
270
|
-
gitmojiResolveGithubAuthor
|
|
271
|
-
gitmojiDisplayLogin
|
|
272
|
-
gitmojiProfileUrl
|
|
273
|
-
gitmojiAvatarUrl
|
|
274
|
-
gitmojiAuthorMention
|
|
275
|
-
gitmojiCommitBullet
|
|
276
|
-
gitDiscoverRoot
|
|
277
|
-
gitListVersionTags
|
|
278
|
-
gitListTagInfos
|
|
279
|
-
gitFormatTagList
|
|
280
|
-
gitResolveRange
|
|
281
|
-
repoRoot
|
|
282
|
-
version
|
|
283
|
-
fromRef
|
|
284
|
-
toRef
|
|
285
|
-
) =>{ version
|
|
286
|
-
gitCollectCommits
|
|
287
|
-
repoRoot
|
|
288
|
-
fromRef
|
|
289
|
-
toRef
|
|
290
|
-
) =>CommitRecord[];
|
|
291
|
-
gitDetectGithubRepo
|
|
292
|
-
gitParseGithubRemote
|
|
293
|
-
publisherPublishWorkspace
|
|
294
|
-
cwd
|
|
295
|
-
dryRun
|
|
296
|
-
refresh
|
|
297
|
-
placeholder
|
|
298
|
-
tag
|
|
299
|
-
access
|
|
300
|
-
npm
|
|
301
|
-
otp
|
|
302
|
-
totpSecret
|
|
303
|
-
token
|
|
304
|
-
only
|
|
305
|
-
packages
|
|
306
|
-
}) =>PublishReport;
|
|
307
|
-
publisherTrustWorkspace
|
|
308
|
-
cwd
|
|
309
|
-
dryRun
|
|
310
|
-
refresh
|
|
311
|
-
only
|
|
312
|
-
packages
|
|
313
|
-
npm
|
|
314
|
-
otp
|
|
315
|
-
totpSecret
|
|
316
|
-
token
|
|
317
|
-
}) =>TrustReport;
|
|
318
|
-
gitToolsCommitExport
|
|
319
|
-
cwd
|
|
320
|
-
base
|
|
321
|
-
ref
|
|
322
|
-
path
|
|
323
|
-
}) =>{ count
|
|
324
|
-
gitToolsCommitApply
|
|
325
|
-
cwd
|
|
326
|
-
base
|
|
327
|
-
ref
|
|
328
|
-
path
|
|
329
|
-
dryRun
|
|
330
|
-
}) =>{
|
|
331
|
-
changes
|
|
332
|
-
oldOid
|
|
333
|
-
oldSubject
|
|
334
|
-
newSubject
|
|
335
|
-
parentsRelinked
|
|
336
|
-
messageChanged
|
|
262
|
+
gitmojiKnownGitmojis: () => string[];
|
|
263
|
+
gitmojiValidateSubject: (subject: string) => boolean;
|
|
264
|
+
gitmojiParseSubject: (subject: string) => ParsedSubject;
|
|
265
|
+
gitmojiFormatSubject: (gitmoji: string, body: string) => string;
|
|
266
|
+
gitmojiStripGitmoji: (subject: string) => string;
|
|
267
|
+
gitmojiLeadingGitmoji: (subject: string) => string | null;
|
|
268
|
+
gitmojiSectionForGitmoji: (gitmoji?: string | null) => string;
|
|
269
|
+
gitmojiParseNoreplyEmail: (email: string) => GithubAuthor | null;
|
|
270
|
+
gitmojiResolveGithubAuthor: (email: string, authorMapJson: string) => GithubAuthor | null;
|
|
271
|
+
gitmojiDisplayLogin: (author: GithubAuthor) => string;
|
|
272
|
+
gitmojiProfileUrl: (author: GithubAuthor) => string;
|
|
273
|
+
gitmojiAvatarUrl: (author: GithubAuthor) => string;
|
|
274
|
+
gitmojiAuthorMention: (email: string, authorName: string, authorMapJson: string) => string;
|
|
275
|
+
gitmojiCommitBullet: (body: string, email: string, authorName: string, authorMapJson: string) => string;
|
|
276
|
+
gitDiscoverRoot: (startPath: string) => string;
|
|
277
|
+
gitListVersionTags: (repoRoot: string) => string[];
|
|
278
|
+
gitListTagInfos: (repoRoot: string) => Array < { name: string; shortHash: string }>;
|
|
279
|
+
gitFormatTagList: (repoRoot: string) => string;
|
|
280
|
+
gitResolveRange: (
|
|
281
|
+
repoRoot: string,
|
|
282
|
+
version?: string | null,
|
|
283
|
+
fromRef?: string | null,
|
|
284
|
+
toRef?: string | null,
|
|
285
|
+
) => { version: string; fromRef?: string; toRef: string };
|
|
286
|
+
gitCollectCommits: (
|
|
287
|
+
repoRoot: string,
|
|
288
|
+
fromRef: string | null | undefined,
|
|
289
|
+
toRef: string,
|
|
290
|
+
) => CommitRecord[];
|
|
291
|
+
gitDetectGithubRepo: (repoRoot: string) => string | null;
|
|
292
|
+
gitParseGithubRemote: (url: string) => string | null;
|
|
293
|
+
publisherPublishWorkspace: (options: {
|
|
294
|
+
cwd?: string | null;
|
|
295
|
+
dryRun?: boolean | null;
|
|
296
|
+
refresh?: boolean | null;
|
|
297
|
+
placeholder?: boolean | null;
|
|
298
|
+
tag?: string | null;
|
|
299
|
+
access?: string | null;
|
|
300
|
+
npm?: string | null;
|
|
301
|
+
otp?: string | null;
|
|
302
|
+
totpSecret?: string | null;
|
|
303
|
+
token?: string | null;
|
|
304
|
+
only?: string | null;
|
|
305
|
+
packages?: string[] | null;
|
|
306
|
+
}) => PublishReport;
|
|
307
|
+
publisherTrustWorkspace: (options: {
|
|
308
|
+
cwd?: string | null;
|
|
309
|
+
dryRun?: boolean | null;
|
|
310
|
+
refresh?: boolean | null;
|
|
311
|
+
only?: string | null;
|
|
312
|
+
packages?: string[] | null;
|
|
313
|
+
npm?: string | null;
|
|
314
|
+
otp?: string | null;
|
|
315
|
+
totpSecret?: string | null;
|
|
316
|
+
token?: string | null;
|
|
317
|
+
}) => TrustReport;
|
|
318
|
+
gitToolsCommitExport: (options: {
|
|
319
|
+
cwd?: string | null;
|
|
320
|
+
base: string;
|
|
321
|
+
ref?: string | null;
|
|
322
|
+
path: string;
|
|
323
|
+
}) => { count: number; path: string };
|
|
324
|
+
gitToolsCommitApply: (options: {
|
|
325
|
+
cwd?: string | null;
|
|
326
|
+
base: string;
|
|
327
|
+
ref?: string | null;
|
|
328
|
+
path: string;
|
|
329
|
+
dryRun?: boolean | null;
|
|
330
|
+
}) => {
|
|
331
|
+
changes: Array < {
|
|
332
|
+
oldOid: string;
|
|
333
|
+
oldSubject: string;
|
|
334
|
+
newSubject: string;
|
|
335
|
+
parentsRelinked: boolean;
|
|
336
|
+
messageChanged: boolean;
|
|
337
337
|
}>;
|
|
338
|
-
oldTip
|
|
339
|
-
newTip
|
|
340
|
-
refName
|
|
341
|
-
dryRun
|
|
338
|
+
oldTip: string;
|
|
339
|
+
newTip?: string | null;
|
|
340
|
+
refName: string;
|
|
341
|
+
dryRun: boolean;
|
|
342
342
|
};
|
|
343
|
-
gitToolsRewordExport
|
|
344
|
-
cwd
|
|
345
|
-
base
|
|
346
|
-
ref
|
|
347
|
-
path
|
|
348
|
-
}) =>{ count
|
|
349
|
-
gitToolsRewordRewrite
|
|
350
|
-
cwd
|
|
351
|
-
base
|
|
352
|
-
ref
|
|
353
|
-
path
|
|
354
|
-
dryRun
|
|
355
|
-
}) =>{
|
|
356
|
-
changes
|
|
357
|
-
oldOid
|
|
358
|
-
oldSubject
|
|
359
|
-
newSubject
|
|
360
|
-
parentsRelinked
|
|
361
|
-
messageChanged
|
|
343
|
+
gitToolsRewordExport: (options: {
|
|
344
|
+
cwd?: string | null;
|
|
345
|
+
base: string;
|
|
346
|
+
ref?: string | null;
|
|
347
|
+
path: string;
|
|
348
|
+
}) => { count: number; path: string };
|
|
349
|
+
gitToolsRewordRewrite: (options: {
|
|
350
|
+
cwd?: string | null;
|
|
351
|
+
base: string;
|
|
352
|
+
ref?: string | null;
|
|
353
|
+
path: string;
|
|
354
|
+
dryRun?: boolean | null;
|
|
355
|
+
}) => {
|
|
356
|
+
changes: Array < {
|
|
357
|
+
oldOid: string;
|
|
358
|
+
oldSubject: string;
|
|
359
|
+
newSubject: string;
|
|
360
|
+
parentsRelinked: boolean;
|
|
361
|
+
messageChanged: boolean;
|
|
362
362
|
}>;
|
|
363
|
-
oldTip
|
|
364
|
-
newTip
|
|
365
|
-
refName
|
|
366
|
-
dryRun
|
|
363
|
+
oldTip: string;
|
|
364
|
+
newTip?: string | null;
|
|
365
|
+
refName: string;
|
|
366
|
+
dryRun: boolean;
|
|
367
367
|
};
|
|
368
|
-
gitToolsRetimeRange
|
|
369
|
-
cwd
|
|
370
|
-
commit
|
|
371
|
-
startDate
|
|
372
|
-
endDate
|
|
373
|
-
branch
|
|
374
|
-
tip
|
|
375
|
-
}) =>{ branch
|
|
376
|
-
gitToolsRetimeRoot
|
|
377
|
-
cwd
|
|
378
|
-
startDate
|
|
379
|
-
endDate
|
|
380
|
-
branch
|
|
381
|
-
tip
|
|
382
|
-
message
|
|
383
|
-
}) =>{ branch
|
|
384
|
-
gitToolsChangelogRender
|
|
385
|
-
cwd
|
|
386
|
-
version
|
|
387
|
-
fromRef
|
|
388
|
-
toRef
|
|
389
|
-
write
|
|
390
|
-
tags
|
|
391
|
-
repo
|
|
392
|
-
authorMap
|
|
393
|
-
releasesDir
|
|
394
|
-
}) =>{
|
|
395
|
-
notes
|
|
396
|
-
version
|
|
397
|
-
fromRef
|
|
398
|
-
toRef
|
|
399
|
-
commitCount
|
|
400
|
-
writtenPath
|
|
401
|
-
rangeLabel
|
|
368
|
+
gitToolsRetimeRange: (options: {
|
|
369
|
+
cwd?: string | null;
|
|
370
|
+
commit: string;
|
|
371
|
+
startDate?: string | null;
|
|
372
|
+
endDate?: string | null;
|
|
373
|
+
branch?: string | null;
|
|
374
|
+
tip?: string | null;
|
|
375
|
+
}) => { branch: string; newTip: string; rewritten: number };
|
|
376
|
+
gitToolsRetimeRoot: (options: {
|
|
377
|
+
cwd?: string | null;
|
|
378
|
+
startDate?: string | null;
|
|
379
|
+
endDate?: string | null;
|
|
380
|
+
branch?: string | null;
|
|
381
|
+
tip?: string | null;
|
|
382
|
+
message?: string | null;
|
|
383
|
+
}) => { branch: string; newTip: string; rewritten: number };
|
|
384
|
+
gitToolsChangelogRender: (options: {
|
|
385
|
+
cwd?: string | null;
|
|
386
|
+
version?: string | null;
|
|
387
|
+
fromRef?: string | null;
|
|
388
|
+
toRef?: string | null;
|
|
389
|
+
write?: boolean | null;
|
|
390
|
+
tags?: boolean | null;
|
|
391
|
+
repo?: string | null;
|
|
392
|
+
authorMap?: string | null;
|
|
393
|
+
releasesDir?: string | null;
|
|
394
|
+
}) => {
|
|
395
|
+
notes: string;
|
|
396
|
+
version: string;
|
|
397
|
+
fromRef?: string | null;
|
|
398
|
+
toRef: string;
|
|
399
|
+
commitCount: number;
|
|
400
|
+
writtenPath?: string | null;
|
|
401
|
+
rangeLabel: string;
|
|
402
402
|
};
|
|
403
|
-
gitToolsChangelogLookup
|
|
404
|
-
cwd
|
|
405
|
-
email
|
|
406
|
-
login
|
|
407
|
-
map
|
|
408
|
-
githubToken
|
|
409
|
-
fetch
|
|
410
|
-
}) =>GithubAuthor;
|
|
411
|
-
lintRun
|
|
412
|
-
cwd
|
|
413
|
-
fromRef
|
|
414
|
-
toRef
|
|
415
|
-
subjects
|
|
416
|
-
rules
|
|
417
|
-
scanCargo
|
|
418
|
-
commitOnly
|
|
419
|
-
check
|
|
420
|
-
}) =>{
|
|
421
|
-
diagnostics
|
|
422
|
-
rule
|
|
423
|
-
severity
|
|
424
|
-
message
|
|
425
|
-
subject
|
|
426
|
-
hash
|
|
427
|
-
path
|
|
428
|
-
line
|
|
403
|
+
gitToolsChangelogLookup: (options: {
|
|
404
|
+
cwd?: string | null;
|
|
405
|
+
email?: string | null;
|
|
406
|
+
login?: string | null;
|
|
407
|
+
map?: string | null;
|
|
408
|
+
githubToken?: string | null;
|
|
409
|
+
fetch?: boolean | null;
|
|
410
|
+
}) => GithubAuthor;
|
|
411
|
+
lintRun: (options: {
|
|
412
|
+
cwd?: string | null;
|
|
413
|
+
fromRef?: string | null;
|
|
414
|
+
toRef?: string | null;
|
|
415
|
+
subjects?: string[] | null;
|
|
416
|
+
rules?: Array < { id: string; enabled?: boolean | null; severity?: string | null }> | null;
|
|
417
|
+
scanCargo?: boolean | null;
|
|
418
|
+
commitOnly?: boolean | null;
|
|
419
|
+
check?: boolean | null;
|
|
420
|
+
}) => {
|
|
421
|
+
diagnostics: Array < {
|
|
422
|
+
rule: string;
|
|
423
|
+
severity: string;
|
|
424
|
+
message: string;
|
|
425
|
+
subject?: string | null;
|
|
426
|
+
hash?: string | null;
|
|
427
|
+
path?: string | null;
|
|
428
|
+
line?: number | null;
|
|
429
429
|
}>;
|
|
430
|
-
errorCount
|
|
431
|
-
warningCount
|
|
430
|
+
errorCount: number;
|
|
431
|
+
warningCount: number;
|
|
432
432
|
};
|
|
433
|
-
lintCheck
|
|
434
|
-
cwd
|
|
435
|
-
fromRef
|
|
436
|
-
toRef
|
|
437
|
-
subjects
|
|
438
|
-
rules
|
|
439
|
-
scanCargo
|
|
440
|
-
commitOnly
|
|
441
|
-
check
|
|
442
|
-
}) =>{
|
|
443
|
-
diagnostics
|
|
444
|
-
rule
|
|
445
|
-
severity
|
|
446
|
-
message
|
|
447
|
-
subject
|
|
448
|
-
hash
|
|
449
|
-
path
|
|
450
|
-
line
|
|
433
|
+
lintCheck: (options: {
|
|
434
|
+
cwd?: string | null;
|
|
435
|
+
fromRef?: string | null;
|
|
436
|
+
toRef?: string | null;
|
|
437
|
+
subjects?: string[] | null;
|
|
438
|
+
rules?: Array < { id: string; enabled?: boolean | null; severity?: string | null }> | null;
|
|
439
|
+
scanCargo?: boolean | null;
|
|
440
|
+
commitOnly?: boolean | null;
|
|
441
|
+
check?: boolean | null;
|
|
442
|
+
}) => {
|
|
443
|
+
diagnostics: Array < {
|
|
444
|
+
rule: string;
|
|
445
|
+
severity: string;
|
|
446
|
+
message: string;
|
|
447
|
+
subject?: string | null;
|
|
448
|
+
hash?: string | null;
|
|
449
|
+
path?: string | null;
|
|
450
|
+
line?: number | null;
|
|
451
451
|
}>;
|
|
452
|
-
errorCount
|
|
453
|
-
warningCount
|
|
452
|
+
errorCount: number;
|
|
453
|
+
warningCount: number;
|
|
454
454
|
};
|
|
455
|
-
updaterRun
|
|
456
|
-
formatterRun
|
|
457
|
-
cwd
|
|
458
|
-
check
|
|
459
|
-
includes
|
|
460
|
-
excludes
|
|
461
|
-
rust
|
|
462
|
-
javascript
|
|
463
|
-
style
|
|
464
|
-
}) =>{
|
|
465
|
-
formatted
|
|
466
|
-
unchanged
|
|
467
|
-
errors
|
|
455
|
+
updaterRun: (options: { cwd?: string | null; interactive?: boolean | null }) => void;
|
|
456
|
+
formatterRun: (options: {
|
|
457
|
+
cwd?: string | null;
|
|
458
|
+
check?: boolean | null;
|
|
459
|
+
includes?: string[] | null;
|
|
460
|
+
excludes?: string[] | null;
|
|
461
|
+
rust?: boolean | null;
|
|
462
|
+
javascript?: boolean | null;
|
|
463
|
+
style?: FormatterStyleOptions | null;
|
|
464
|
+
}) => {
|
|
465
|
+
formatted: number;
|
|
466
|
+
unchanged: number;
|
|
467
|
+
errors: string[];
|
|
468
468
|
};
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
-
const PLATFORM_PACKAGES
|
|
472
|
-
"win32-x64"
|
|
473
|
-
"linux-x64"
|
|
474
|
-
"linux-arm64"
|
|
475
|
-
"darwin-x64"
|
|
476
|
-
"darwin-arm64"
|
|
471
|
+
const PLATFORM_PACKAGES: Record < string, string > = {
|
|
472
|
+
"win32-x64": "@doki-land/nifty-win32-x64",
|
|
473
|
+
"linux-x64": "@doki-land/nifty-linux-x64",
|
|
474
|
+
"linux-arm64": "@doki-land/nifty-linux-arm64",
|
|
475
|
+
"darwin-x64": "@doki-land/nifty-darwin-x64",
|
|
476
|
+
"darwin-arm64": "@doki-land/nifty-darwin-arm64",
|
|
477
477
|
};
|
|
478
478
|
|
|
479
|
-
function mapAuthor(raw
|
|
480
|
-
if(!raw){
|
|
479
|
+
function mapAuthor(raw: GithubAuthor | null | undefined): GithubAuthor | undefined {
|
|
480
|
+
if (!raw) {
|
|
481
481
|
return undefined;
|
|
482
482
|
}
|
|
483
483
|
return {
|
|
484
|
-
id
|
|
485
|
-
login
|
|
484
|
+
id: raw.id !== undefined && raw.id !== null ? BigInt(raw.id) : undefined,
|
|
485
|
+
login: raw.login ?? undefined,
|
|
486
486
|
};
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
function mapLintOptions(options
|
|
489
|
+
function mapLintOptions(options: LintRunOptions) {
|
|
490
490
|
return {
|
|
491
|
-
...(options.cwd!== undefined ? { cwd
|
|
492
|
-
...(options.fromRef!== undefined ? { fromRef
|
|
493
|
-
...(options.toRef!== undefined ? { toRef
|
|
494
|
-
...(options.subjects!== undefined ? { subjects
|
|
495
|
-
...(options.rules!== undefined ? { rules
|
|
496
|
-
...(options.scanCargo!== undefined ? { scanCargo
|
|
497
|
-
...(options.commitOnly!== undefined ? { commitOnly
|
|
491
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
492
|
+
...(options.fromRef !== undefined ? { fromRef: options.fromRef } : { }),
|
|
493
|
+
...(options.toRef !== undefined ? { toRef: options.toRef } : { }),
|
|
494
|
+
...(options.subjects !== undefined ? { subjects: options.subjects } : { }),
|
|
495
|
+
...(options.rules !== undefined ? { rules: options.rules } : { }),
|
|
496
|
+
...(options.scanCargo !== undefined ? { scanCargo: options.scanCargo } : { }),
|
|
497
|
+
...(options.commitOnly !== undefined ? { commitOnly: options.commitOnly } : { }),
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
-
function mapLintReport(raw
|
|
502
|
-
diagnostics
|
|
503
|
-
rule
|
|
504
|
-
severity
|
|
505
|
-
message
|
|
506
|
-
subject
|
|
507
|
-
hash
|
|
508
|
-
path
|
|
509
|
-
line
|
|
501
|
+
function mapLintReport(raw: {
|
|
502
|
+
diagnostics: Array < {
|
|
503
|
+
rule: string;
|
|
504
|
+
severity: string;
|
|
505
|
+
message: string;
|
|
506
|
+
subject?: string | null;
|
|
507
|
+
hash?: string | null;
|
|
508
|
+
path?: string | null;
|
|
509
|
+
line?: number | null;
|
|
510
510
|
}>;
|
|
511
|
-
errorCount
|
|
512
|
-
warningCount
|
|
513
|
-
})
|
|
511
|
+
errorCount: number;
|
|
512
|
+
warningCount: number;
|
|
513
|
+
}): LintReportRecord {
|
|
514
514
|
return {
|
|
515
|
-
errorCount
|
|
516
|
-
warningCount
|
|
517
|
-
diagnostics
|
|
518
|
-
rule
|
|
519
|
-
severity
|
|
520
|
-
message
|
|
521
|
-
subject
|
|
522
|
-
hash
|
|
523
|
-
path
|
|
524
|
-
line
|
|
515
|
+
errorCount: raw.errorCount,
|
|
516
|
+
warningCount: raw.warningCount,
|
|
517
|
+
diagnostics: raw.diagnostics.map((item) => ({
|
|
518
|
+
rule: item.rule,
|
|
519
|
+
severity: item.severity as LintDiagnosticRecord["severity"],
|
|
520
|
+
message: item.message,
|
|
521
|
+
subject: item.subject ?? undefined,
|
|
522
|
+
hash: item.hash ?? undefined,
|
|
523
|
+
path: item.path ?? undefined,
|
|
524
|
+
line: item.line ?? undefined,
|
|
525
525
|
})),
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
function wrapBinding(binding
|
|
529
|
+
function wrapBinding(binding: NativeBinding): NiftyNative {
|
|
530
530
|
return {
|
|
531
|
-
gitmoji
|
|
532
|
-
"known-gitmojis"
|
|
533
|
-
"validate-subject"
|
|
534
|
-
"parse-subject"
|
|
535
|
-
"format-subject"
|
|
536
|
-
"strip-gitmoji"
|
|
537
|
-
"leading-gitmoji"
|
|
538
|
-
"section-for-gitmoji"
|
|
539
|
-
"parse-noreply-email"
|
|
540
|
-
"resolve-github-author"
|
|
531
|
+
gitmoji: {
|
|
532
|
+
"known-gitmojis": () => binding.gitmojiKnownGitmojis(),
|
|
533
|
+
"validate-subject": (subject) => binding.gitmojiValidateSubject(subject),
|
|
534
|
+
"parse-subject": (subject) => binding.gitmojiParseSubject(subject),
|
|
535
|
+
"format-subject": (gitmoji, body) => binding.gitmojiFormatSubject(gitmoji, body),
|
|
536
|
+
"strip-gitmoji": (subject) => binding.gitmojiStripGitmoji(subject),
|
|
537
|
+
"leading-gitmoji": (subject) => binding.gitmojiLeadingGitmoji(subject) ?? undefined,
|
|
538
|
+
"section-for-gitmoji": (gitmoji) => binding.gitmojiSectionForGitmoji(gitmoji)as ReleaseSection,
|
|
539
|
+
"parse-noreply-email": (email) => mapAuthor(binding.gitmojiParseNoreplyEmail(email)),
|
|
540
|
+
"resolve-github-author": (email, authorMapJson) =>
|
|
541
541
|
mapAuthor(binding.gitmojiResolveGithubAuthor(email, authorMapJson)),
|
|
542
|
-
"display-login"
|
|
543
|
-
"profile-url"
|
|
544
|
-
"avatar-url"
|
|
545
|
-
"author-mention"
|
|
542
|
+
"display-login": (author) => binding.gitmojiDisplayLogin(author),
|
|
543
|
+
"profile-url": (author) => binding.gitmojiProfileUrl(author),
|
|
544
|
+
"avatar-url": (author) => binding.gitmojiAvatarUrl(author),
|
|
545
|
+
"author-mention": (email, authorName, authorMapJson) =>
|
|
546
546
|
binding.gitmojiAuthorMention(email, authorName, authorMapJson),
|
|
547
|
-
"commit-bullet"
|
|
547
|
+
"commit-bullet": (body, email, authorName, authorMapJson) =>
|
|
548
548
|
binding.gitmojiCommitBullet(body, email, authorName, authorMapJson),
|
|
549
549
|
},
|
|
550
|
-
git
|
|
551
|
-
"discover-root"
|
|
552
|
-
"list-version-tags"
|
|
553
|
-
"list-tag-infos"
|
|
554
|
-
binding.gitListTagInfos(repoRoot).map((tag) =>({
|
|
555
|
-
name
|
|
556
|
-
"short-hash"
|
|
550
|
+
git: {
|
|
551
|
+
"discover-root": (startPath) => binding.gitDiscoverRoot(startPath),
|
|
552
|
+
"list-version-tags": (repoRoot) => binding.gitListVersionTags(repoRoot),
|
|
553
|
+
"list-tag-infos": (repoRoot) =>
|
|
554
|
+
binding.gitListTagInfos(repoRoot).map((tag) => ({
|
|
555
|
+
name: tag.name,
|
|
556
|
+
"short-hash": tag.shortHash,
|
|
557
557
|
})),
|
|
558
|
-
"format-tag-list"
|
|
559
|
-
"resolve-range"
|
|
558
|
+
"format-tag-list": (repoRoot) => binding.gitFormatTagList(repoRoot),
|
|
559
|
+
"resolve-range": (repoRoot, version, fromRef, toRef) => {
|
|
560
560
|
const range = binding.gitResolveRange(repoRoot, version, fromRef, toRef);
|
|
561
561
|
return {
|
|
562
|
-
version
|
|
563
|
-
"from-ref"
|
|
564
|
-
"to-ref"
|
|
562
|
+
version: range.version,
|
|
563
|
+
"from-ref": range.fromRef,
|
|
564
|
+
"to-ref": range.toRef,
|
|
565
565
|
};
|
|
566
566
|
},
|
|
567
|
-
"collect-commits"
|
|
568
|
-
"detect-github-repo"
|
|
569
|
-
"parse-github-remote"
|
|
567
|
+
"collect-commits": (repoRoot, fromRef, toRef) => binding.gitCollectCommits(repoRoot, fromRef, toRef),
|
|
568
|
+
"detect-github-repo": (repoRoot) => binding.gitDetectGithubRepo(repoRoot) ?? undefined,
|
|
569
|
+
"parse-github-remote": (url) => binding.gitParseGithubRemote(url) ?? undefined,
|
|
570
570
|
},
|
|
571
|
-
history
|
|
572
|
-
"commit-export"
|
|
571
|
+
history: {
|
|
572
|
+
"commit-export": (options) =>
|
|
573
573
|
binding.gitToolsCommitExport({
|
|
574
|
-
...(options.cwd!== undefined ? { cwd
|
|
575
|
-
base
|
|
576
|
-
...(options.ref!== undefined ? { ref
|
|
577
|
-
path
|
|
574
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
575
|
+
base: options.base,
|
|
576
|
+
...(options.ref !== undefined ? { ref: options.ref } : { }),
|
|
577
|
+
path: options.path,
|
|
578
578
|
}),
|
|
579
|
-
"commit-apply"
|
|
579
|
+
"commit-apply": (options) => {
|
|
580
580
|
const report = binding.gitToolsCommitApply({
|
|
581
|
-
...(options.cwd!== undefined ? { cwd
|
|
582
|
-
base
|
|
583
|
-
...(options.ref!== undefined ? { ref
|
|
584
|
-
path
|
|
585
|
-
...(options.dryRun!== undefined ? { dryRun
|
|
581
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
582
|
+
base: options.base,
|
|
583
|
+
...(options.ref !== undefined ? { ref: options.ref } : { }),
|
|
584
|
+
path: options.path,
|
|
585
|
+
...(options.dryRun !== undefined ? { dryRun: options.dryRun } : { }),
|
|
586
586
|
});
|
|
587
587
|
return {
|
|
588
|
-
changes
|
|
589
|
-
oldTip
|
|
590
|
-
newTip
|
|
591
|
-
refName
|
|
592
|
-
dryRun
|
|
588
|
+
changes: report.changes,
|
|
589
|
+
oldTip: report.oldTip,
|
|
590
|
+
newTip: report.newTip ?? undefined,
|
|
591
|
+
refName: report.refName,
|
|
592
|
+
dryRun: report.dryRun,
|
|
593
593
|
};
|
|
594
594
|
},
|
|
595
|
-
"reword-export"
|
|
595
|
+
"reword-export": (options) =>
|
|
596
596
|
binding.gitToolsRewordExport({
|
|
597
|
-
...(options.cwd!== undefined ? { cwd
|
|
598
|
-
base
|
|
599
|
-
...(options.ref!== undefined ? { ref
|
|
600
|
-
path
|
|
597
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
598
|
+
base: options.base,
|
|
599
|
+
...(options.ref !== undefined ? { ref: options.ref } : { }),
|
|
600
|
+
path: options.path,
|
|
601
601
|
}),
|
|
602
|
-
"reword-rewrite"
|
|
602
|
+
"reword-rewrite": (options) => {
|
|
603
603
|
const report = binding.gitToolsRewordRewrite({
|
|
604
|
-
...(options.cwd!== undefined ? { cwd
|
|
605
|
-
base
|
|
606
|
-
...(options.ref!== undefined ? { ref
|
|
607
|
-
path
|
|
608
|
-
...(options.dryRun!== undefined ? { dryRun
|
|
604
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
605
|
+
base: options.base,
|
|
606
|
+
...(options.ref !== undefined ? { ref: options.ref } : { }),
|
|
607
|
+
path: options.path,
|
|
608
|
+
...(options.dryRun !== undefined ? { dryRun: options.dryRun } : { }),
|
|
609
609
|
});
|
|
610
610
|
return {
|
|
611
|
-
changes
|
|
612
|
-
oldTip
|
|
613
|
-
newTip
|
|
614
|
-
refName
|
|
615
|
-
dryRun
|
|
611
|
+
changes: report.changes,
|
|
612
|
+
oldTip: report.oldTip,
|
|
613
|
+
newTip: report.newTip ?? undefined,
|
|
614
|
+
refName: report.refName,
|
|
615
|
+
dryRun: report.dryRun,
|
|
616
616
|
};
|
|
617
617
|
},
|
|
618
|
-
"retime-range"
|
|
618
|
+
"retime-range": (options) =>
|
|
619
619
|
binding.gitToolsRetimeRange({
|
|
620
|
-
...(options.cwd!== undefined ? { cwd
|
|
621
|
-
commit
|
|
622
|
-
...(options.startDate!== undefined ? { startDate
|
|
623
|
-
...(options.endDate!== undefined ? { endDate
|
|
624
|
-
...(options.branch!== undefined ? { branch
|
|
625
|
-
...(options.tip!== undefined ? { tip
|
|
620
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
621
|
+
commit: options.commit,
|
|
622
|
+
...(options.startDate !== undefined ? { startDate: options.startDate } : { }),
|
|
623
|
+
...(options.endDate !== undefined ? { endDate: options.endDate } : { }),
|
|
624
|
+
...(options.branch !== undefined ? { branch: options.branch } : { }),
|
|
625
|
+
...(options.tip !== undefined ? { tip: options.tip } : { }),
|
|
626
626
|
}),
|
|
627
|
-
"retime-root"
|
|
627
|
+
"retime-root": (options) =>
|
|
628
628
|
binding.gitToolsRetimeRoot({
|
|
629
|
-
...(options.cwd!== undefined ? { cwd
|
|
630
|
-
...(options.startDate!== undefined ? { startDate
|
|
631
|
-
...(options.endDate!== undefined ? { endDate
|
|
632
|
-
...(options.branch!== undefined ? { branch
|
|
633
|
-
...(options.tip!== undefined ? { tip
|
|
634
|
-
...(options.message!== undefined ? { message
|
|
629
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
630
|
+
...(options.startDate !== undefined ? { startDate: options.startDate } : { }),
|
|
631
|
+
...(options.endDate !== undefined ? { endDate: options.endDate } : { }),
|
|
632
|
+
...(options.branch !== undefined ? { branch: options.branch } : { }),
|
|
633
|
+
...(options.tip !== undefined ? { tip: options.tip } : { }),
|
|
634
|
+
...(options.message !== undefined ? { message: options.message } : { }),
|
|
635
635
|
}),
|
|
636
|
-
"changelog-render"
|
|
636
|
+
"changelog-render": (options) => {
|
|
637
637
|
const report = binding.gitToolsChangelogRender({
|
|
638
|
-
...(options.cwd!== undefined ? { cwd
|
|
639
|
-
...(options.version!== undefined ? { version
|
|
640
|
-
...(options.fromRef!== undefined ? { fromRef
|
|
641
|
-
...(options.toRef!== undefined ? { toRef
|
|
642
|
-
...(options.write!== undefined ? { write
|
|
643
|
-
...(options.tags!== undefined ? { tags
|
|
644
|
-
...(options.repo!== undefined ? { repo
|
|
645
|
-
...(options.authorMap!== undefined ? { authorMap
|
|
646
|
-
...(options.releasesDir!== undefined ? { releasesDir
|
|
638
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
639
|
+
...(options.version !== undefined ? { version: options.version } : { }),
|
|
640
|
+
...(options.fromRef !== undefined ? { fromRef: options.fromRef } : { }),
|
|
641
|
+
...(options.toRef !== undefined ? { toRef: options.toRef } : { }),
|
|
642
|
+
...(options.write !== undefined ? { write: options.write } : { }),
|
|
643
|
+
...(options.tags !== undefined ? { tags: options.tags } : { }),
|
|
644
|
+
...(options.repo !== undefined ? { repo: options.repo } : { }),
|
|
645
|
+
...(options.authorMap !== undefined ? { authorMap: options.authorMap } : { }),
|
|
646
|
+
...(options.releasesDir !== undefined ? { releasesDir: options.releasesDir } : { }),
|
|
647
647
|
});
|
|
648
648
|
return {
|
|
649
|
-
notes
|
|
650
|
-
version
|
|
651
|
-
fromRef
|
|
652
|
-
toRef
|
|
653
|
-
commitCount
|
|
654
|
-
writtenPath
|
|
655
|
-
rangeLabel
|
|
649
|
+
notes: report.notes,
|
|
650
|
+
version: report.version,
|
|
651
|
+
fromRef: report.fromRef ?? undefined,
|
|
652
|
+
toRef: report.toRef,
|
|
653
|
+
commitCount: report.commitCount,
|
|
654
|
+
writtenPath: report.writtenPath ?? undefined,
|
|
655
|
+
rangeLabel: report.rangeLabel,
|
|
656
656
|
};
|
|
657
657
|
},
|
|
658
|
-
"changelog-lookup"
|
|
658
|
+
"changelog-lookup": (options) => {
|
|
659
659
|
const author = binding.gitToolsChangelogLookup({
|
|
660
|
-
...(options.cwd!== undefined ? { cwd
|
|
661
|
-
...(options.email!== undefined ? { email
|
|
662
|
-
...(options.login!== undefined ? { login
|
|
663
|
-
...(options.map!== undefined ? { map
|
|
664
|
-
...(options.githubToken!== undefined ? { githubToken
|
|
665
|
-
...(options.fetch!== undefined ? { fetch
|
|
660
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
661
|
+
...(options.email !== undefined ? { email: options.email } : { }),
|
|
662
|
+
...(options.login !== undefined ? { login: options.login } : { }),
|
|
663
|
+
...(options.map !== undefined ? { map: options.map } : { }),
|
|
664
|
+
...(options.githubToken !== undefined ? { githubToken: options.githubToken } : { }),
|
|
665
|
+
...(options.fetch !== undefined ? { fetch: options.fetch } : { }),
|
|
666
666
|
});
|
|
667
667
|
return mapAuthor(author) ?? { };
|
|
668
668
|
},
|
|
669
669
|
},
|
|
670
|
-
lint
|
|
671
|
-
run
|
|
672
|
-
check
|
|
670
|
+
lint: {
|
|
671
|
+
run: (options) => mapLintReport(binding.lintRun(mapLintOptions(options))),
|
|
672
|
+
check: (options) => mapLintReport(binding.lintCheck(mapLintOptions(options))),
|
|
673
673
|
},
|
|
674
|
-
updater
|
|
675
|
-
run
|
|
674
|
+
updater: {
|
|
675
|
+
run: (options) => {
|
|
676
676
|
binding.updaterRun({
|
|
677
|
-
...(options.cwd!== undefined ? { cwd
|
|
678
|
-
...(options.interactive!== undefined ? { interactive
|
|
677
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
678
|
+
...(options.interactive !== undefined ? { interactive: options.interactive } : { }),
|
|
679
679
|
});
|
|
680
680
|
},
|
|
681
681
|
},
|
|
682
|
-
formatter
|
|
683
|
-
run
|
|
682
|
+
formatter: {
|
|
683
|
+
run: (options) =>
|
|
684
684
|
binding.formatterRun({
|
|
685
|
-
...(options.cwd!== undefined ? { cwd
|
|
686
|
-
...(options.check!== undefined ? { check
|
|
687
|
-
...(options.includes!== undefined ? { includes
|
|
688
|
-
...(options.excludes!== undefined ? { excludes
|
|
689
|
-
...(options.rust!== undefined ? { rust
|
|
690
|
-
...(options.javascript!== undefined ? { javascript
|
|
691
|
-
...(options.style!== undefined ? { style
|
|
685
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
686
|
+
...(options.check !== undefined ? { check: options.check } : { }),
|
|
687
|
+
...(options.includes !== undefined ? { includes: options.includes } : { }),
|
|
688
|
+
...(options.excludes !== undefined ? { excludes: options.excludes } : { }),
|
|
689
|
+
...(options.rust !== undefined ? { rust: options.rust } : { }),
|
|
690
|
+
...(options.javascript !== undefined ? { javascript: options.javascript } : { }),
|
|
691
|
+
...(options.style !== undefined ? { style: options.style } : { }),
|
|
692
692
|
}),
|
|
693
693
|
},
|
|
694
|
-
publisher
|
|
695
|
-
"publish-workspace"
|
|
694
|
+
publisher: {
|
|
695
|
+
"publish-workspace": (options) =>
|
|
696
696
|
binding.publisherPublishWorkspace({
|
|
697
|
-
...(options.cwd!== undefined ? { cwd
|
|
698
|
-
...(options.dryRun!== undefined ? { dryRun
|
|
699
|
-
...(options.refresh!== undefined ? { refresh
|
|
700
|
-
...(options.placeholder!== undefined ? { placeholder
|
|
701
|
-
...(options.only!== undefined ? { only
|
|
702
|
-
...(options.packages!== undefined ? { packages
|
|
703
|
-
...(options.tag!== undefined ? { tag
|
|
704
|
-
...(options.access!== undefined ? { access
|
|
705
|
-
...(options.npm!== undefined ? { npm
|
|
706
|
-
...(options.otp!== undefined ? { otp
|
|
707
|
-
...(options.totpSecret!== undefined ? { totpSecret
|
|
708
|
-
...(options.token!== undefined ? { token
|
|
709
|
-
...(options.trustRepo!== undefined ? { trustRepo
|
|
710
|
-
...(options.trustFile!== undefined ? { trustFile
|
|
711
|
-
...(options.trustEnvironment!== undefined
|
|
712
|
-
? { trustEnvironment : options.trustEnvironment }
|
|
713
|
-
: { }),
|
|
697
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
698
|
+
...(options.dryRun !== undefined ? { dryRun: options.dryRun } : { }),
|
|
699
|
+
...(options.refresh !== undefined ? { refresh: options.refresh } : { }),
|
|
700
|
+
...(options.placeholder !== undefined ? { placeholder: options.placeholder } : { }),
|
|
701
|
+
...(options.only !== undefined ? { only: options.only } : { }),
|
|
702
|
+
...(options.packages !== undefined ? { packages: options.packages } : { }),
|
|
703
|
+
...(options.tag !== undefined ? { tag: options.tag } : { }),
|
|
704
|
+
...(options.access !== undefined ? { access: options.access } : { }),
|
|
705
|
+
...(options.npm !== undefined ? { npm: options.npm } : { }),
|
|
706
|
+
...(options.otp !== undefined ? { otp: options.otp } : { }),
|
|
707
|
+
...(options.totpSecret !== undefined ? { totpSecret: options.totpSecret } : { }),
|
|
708
|
+
...(options.token !== undefined ? { token: options.token } : { }),
|
|
709
|
+
...(options.trustRepo !== undefined ? { trustRepo: options.trustRepo } : { }),
|
|
710
|
+
...(options.trustFile !== undefined ? { trustFile: options.trustFile } : { }),
|
|
711
|
+
...(options.trustEnvironment !== undefined ? { trustEnvironment: options.trustEnvironment } : { }),
|
|
714
712
|
}),
|
|
715
|
-
"trust-workspace"
|
|
713
|
+
"trust-workspace": (options) =>
|
|
716
714
|
binding.publisherTrustWorkspace({
|
|
717
|
-
...(options.cwd!== undefined ? { cwd
|
|
718
|
-
...(options.dryRun!== undefined ? { dryRun
|
|
719
|
-
...(options.refresh!== undefined ? { refresh
|
|
720
|
-
...(options.only!== undefined ? { only
|
|
721
|
-
...(options.packages!== undefined ? { packages
|
|
722
|
-
...(options.npm!== undefined ? { npm
|
|
723
|
-
...(options.otp!== undefined ? { otp
|
|
724
|
-
...(options.totpSecret!== undefined ? { totpSecret
|
|
725
|
-
...(options.token!== undefined ? { token
|
|
726
|
-
...(options.trustRepo!== undefined ? { trustRepo
|
|
727
|
-
...(options.trustFile!== undefined ? { trustFile
|
|
728
|
-
...(options.trustEnvironment!== undefined
|
|
729
|
-
? { trustEnvironment : options.trustEnvironment }
|
|
730
|
-
: { }),
|
|
715
|
+
...(options.cwd !== undefined ? { cwd: options.cwd } : { }),
|
|
716
|
+
...(options.dryRun !== undefined ? { dryRun: options.dryRun } : { }),
|
|
717
|
+
...(options.refresh !== undefined ? { refresh: options.refresh } : { }),
|
|
718
|
+
...(options.only !== undefined ? { only: options.only } : { }),
|
|
719
|
+
...(options.packages !== undefined ? { packages: options.packages } : { }),
|
|
720
|
+
...(options.npm !== undefined ? { npm: options.npm } : { }),
|
|
721
|
+
...(options.otp !== undefined ? { otp: options.otp } : { }),
|
|
722
|
+
...(options.totpSecret !== undefined ? { totpSecret: options.totpSecret } : { }),
|
|
723
|
+
...(options.token !== undefined ? { token: options.token } : { }),
|
|
724
|
+
...(options.trustRepo !== undefined ? { trustRepo: options.trustRepo } : { }),
|
|
725
|
+
...(options.trustFile !== undefined ? { trustFile: options.trustFile } : { }),
|
|
726
|
+
...(options.trustEnvironment !== undefined ? { trustEnvironment: options.trustEnvironment } : { }),
|
|
731
727
|
}),
|
|
732
728
|
},
|
|
733
729
|
};
|
|
734
730
|
}
|
|
735
731
|
|
|
736
|
-
let cached
|
|
732
|
+
let cached: NiftyNative | undefined;
|
|
737
733
|
|
|
738
734
|
/** Load the platform-specific Node-API binary from `@doki-land/nifty-<platform>`. */
|
|
739
|
-
export function loadNiftyNative()
|
|
740
|
-
if(cached){
|
|
735
|
+
export function loadNiftyNative(): NiftyNative {
|
|
736
|
+
if (cached) {
|
|
741
737
|
return cached;
|
|
742
738
|
}
|
|
743
739
|
const key = `${process.platform}-${process.arch}`;
|
|
744
740
|
const pkg = PLATFORM_PACKAGES[key];
|
|
745
|
-
if(!pkg){
|
|
741
|
+
if (!pkg) {
|
|
746
742
|
throw new Error(`Unsupported platform for Nifty native bindings: ${key}`);
|
|
747
743
|
}
|
|
748
744
|
const require = createRequire(import.meta.url);
|
|
@@ -751,26 +747,26 @@ export function loadNiftyNative() : NiftyNative {
|
|
|
751
747
|
return cached;
|
|
752
748
|
}
|
|
753
749
|
|
|
754
|
-
export function mapTagInfo(raw
|
|
755
|
-
return { name
|
|
750
|
+
export function mapTagInfo(raw: { name: string; "short-hash": string }): TagInfo {
|
|
751
|
+
return { name: raw.name, shortHash: raw["short-hash"] };
|
|
756
752
|
}
|
|
757
753
|
|
|
758
|
-
export function mapRangeInfo(raw
|
|
754
|
+
export function mapRangeInfo(raw: { version: string; "from-ref"?: string; "to-ref": string }): RangeInfo {
|
|
759
755
|
return {
|
|
760
|
-
version
|
|
761
|
-
fromRef
|
|
762
|
-
toRef
|
|
756
|
+
version: raw.version,
|
|
757
|
+
fromRef: raw["from-ref"],
|
|
758
|
+
toRef: raw["to-ref"],
|
|
763
759
|
};
|
|
764
760
|
}
|
|
765
761
|
|
|
766
|
-
export function mapCommitRecord(raw
|
|
762
|
+
export function mapCommitRecord(raw: NativeCommitRecord): CommitRecord {
|
|
767
763
|
return {
|
|
768
|
-
hash
|
|
769
|
-
email
|
|
770
|
-
author
|
|
771
|
-
subject
|
|
772
|
-
body
|
|
773
|
-
gitmoji
|
|
774
|
-
section
|
|
764
|
+
hash: raw.hash,
|
|
765
|
+
email: raw.email,
|
|
766
|
+
author: raw.author,
|
|
767
|
+
subject: raw.subject,
|
|
768
|
+
body: raw.body,
|
|
769
|
+
gitmoji: raw.gitmoji,
|
|
770
|
+
section: raw.section as ReleaseSection,
|
|
775
771
|
};
|
|
776
772
|
}
|