@doki-land/nifty 0.0.12 → 0.1.1

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.
Files changed (44) hide show
  1. package/cli/nifty.mjs +2 -2
  2. package/locales/en-US/cli.json +1 -1
  3. package/package.json +6 -6
  4. package/src/cli/authArgs.ts +29 -29
  5. package/src/cli/bump-cmd.ts +15 -15
  6. package/src/cli/bump.ts +81 -81
  7. package/src/cli/change-logs-cmd.ts +26 -26
  8. package/src/cli/cli.ts +3 -3
  9. package/src/cli/commit-cmd.ts +77 -77
  10. package/src/cli/commit-lint-report.ts +44 -44
  11. package/src/cli/context.ts +9 -9
  12. package/src/cli/format-cmd.ts +6 -6
  13. package/src/cli/format.ts +15 -15
  14. package/src/cli/install-native-cmd.ts +4 -4
  15. package/src/cli/install-native.ts +24 -24
  16. package/src/cli/lint-cmd.ts +11 -11
  17. package/src/cli/lint.ts +49 -49
  18. package/src/cli/options.ts +16 -16
  19. package/src/cli/publish-cmd.ts +18 -16
  20. package/src/cli/publish.ts +38 -38
  21. package/src/cli/resolveNpm.ts +3 -3
  22. package/src/cli/retime-cmd.ts +18 -18
  23. package/src/cli/trust-cmd.ts +13 -10
  24. package/src/cli/trust.ts +30 -27
  25. package/src/cli/update-cmd.ts +5 -5
  26. package/src/cli/update.ts +12 -12
  27. package/src/cli/upload-cmd.ts +17 -17
  28. package/src/cli/upload.ts +132 -132
  29. package/src/cli/workspace.ts +49 -49
  30. package/src/config/authorMap.ts +4 -4
  31. package/src/config/defineConfig.ts +5 -5
  32. package/src/config/detectProject.ts +46 -46
  33. package/src/config/formatPresets.ts +26 -26
  34. package/src/config/index.ts +3 -0
  35. package/src/config/loadConfig.ts +35 -35
  36. package/src/config/trustPayload.ts +14 -0
  37. package/src/config/types.ts +60 -37
  38. package/src/git.ts +14 -14
  39. package/src/github.ts +54 -54
  40. package/src/gitmoji.ts +18 -18
  41. package/src/index.ts +3 -0
  42. package/src/native.ts +601 -591
  43. package/src/nifty.ts +30 -30
  44. package/src/types.ts +17 -17
package/src/native.ts CHANGED
@@ -9,730 +9,740 @@ import type {
9
9
  } from "./types.js";
10
10
 
11
11
  export type GitmojiExports = {
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;
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": (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
- ) => Array<{
44
- hash: string;
45
- email: string;
46
- author: string;
47
- subject: string;
48
- body: string;
49
- gitmoji?: string;
50
- section: string;
51
- }>;
52
- "detect-github-repo": (repoRoot: string) => string | undefined;
53
- "parse-github-remote": (url: string) => string | undefined;
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;
54
46
  };
55
47
 
48
+ type NativeCommitRecord = Omit<CommitRecord, "section"> & { section : string };
49
+
56
50
  export type PublishReport = {
57
- root: string;
58
- order: string[];
59
- published: string[];
60
- skipped: string[];
61
- skippedVersions: string[];
51
+ root : string;
52
+ order : string[];
53
+ published : string[];
54
+ skipped : string[];
55
+ skippedVersions : string[];
62
56
  };
63
57
 
64
58
  export type TrustReport = {
65
- root: string;
66
- configured: string[];
67
- skipped: string[];
68
- failed: string[];
59
+ root : string;
60
+ configured : string[];
61
+ skipped : string[];
62
+ failed : string[];
69
63
  };
70
64
 
71
65
  export type RewordPlannedChange = {
72
- oldOid: string;
73
- oldSubject: string;
74
- newSubject: string;
75
- parentsRelinked: boolean;
76
- messageChanged: boolean;
66
+ oldOid : string;
67
+ oldSubject : string;
68
+ newSubject : string;
69
+ parentsRelinked : boolean;
70
+ messageChanged : boolean;
77
71
  };
78
72
 
79
73
  export type RewordRewriteReport = {
80
- changes: RewordPlannedChange[];
81
- oldTip: string;
82
- newTip?: string;
83
- refName: string;
84
- dryRun: boolean;
74
+ changes : RewordPlannedChange[];
75
+ oldTip : string;
76
+ newTip ? : string;
77
+ refName : string;
78
+ dryRun : boolean;
85
79
  };
86
80
 
87
81
  export type HistoryExports = {
88
- "commit-export": (options: {
89
- cwd?: string;
90
- base: string;
91
- ref?: string;
92
- path: string;
93
- }) => { count: number; path: string };
94
- "commit-apply": (options: {
95
- cwd?: string;
96
- base: string;
97
- ref?: string;
98
- path: string;
99
- dryRun?: boolean;
100
- }) => 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;
101
95
  /** @deprecated use `commit-export` */
102
- "reword-export": (options: {
103
- cwd?: string;
104
- base: string;
105
- ref?: string;
106
- path: string;
107
- }) => { count: number; path: string };
96
+ "reword-export" : (options : {
97
+ cwd ? : string;
98
+ base : string;
99
+ ref ? : string;
100
+ path : string;
101
+ }) =>{ count : number; path : string };
108
102
  /** @deprecated use `commit-apply` */
109
- "reword-rewrite": (options: {
110
- cwd?: string;
111
- base: string;
112
- ref?: string;
113
- path: string;
114
- dryRun?: boolean;
115
- }) => RewordRewriteReport;
116
- "retime-range": (options: {
117
- cwd?: string;
118
- commit: string;
119
- startDate?: string;
120
- endDate?: string;
121
- branch?: string;
122
- tip?: string;
123
- }) => { branch: string; newTip: string; rewritten: number };
124
- "retime-root": (options: {
125
- cwd?: string;
126
- startDate?: string;
127
- endDate?: string;
128
- branch?: string;
129
- tip?: string;
130
- message?: string;
131
- }) => { branch: string; newTip: string; rewritten: number };
132
- "changelog-render": (options: {
133
- cwd?: string;
134
- version?: string;
135
- fromRef?: string;
136
- toRef?: string;
137
- write?: boolean;
138
- tags?: boolean;
139
- repo?: string;
140
- authorMap?: string;
141
- releasesDir?: string;
142
- }) => {
143
- notes: string;
144
- version: string;
145
- fromRef?: string;
146
- toRef: string;
147
- commitCount: number;
148
- writtenPath?: string;
149
- rangeLabel: string;
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;
150
144
  };
151
- "changelog-lookup": (options: {
152
- cwd?: string;
153
- email?: string;
154
- login?: string;
155
- map?: string;
156
- githubToken?: string;
157
- fetch?: boolean;
158
- }) => 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;
159
153
  };
160
154
 
161
155
  export type LintDiagnosticRecord = {
162
- rule: string;
163
- severity: "error" | "warning" | "info";
164
- message: string;
165
- subject?: string;
166
- hash?: string;
167
- path?: string;
168
- line?: number;
156
+ rule : string;
157
+ severity : "error" | "warning" | "info";
158
+ message : string;
159
+ subject ? : string;
160
+ hash ? : string;
161
+ path ? : string;
162
+ line ? : number;
169
163
  };
170
164
 
171
165
  export type LintRunOptions = {
172
- cwd?: string;
173
- fromRef?: string;
174
- toRef?: string;
175
- subjects?: string[];
176
- rules?: Array<{ id: string; enabled?: boolean; severity?: "error" | "warning" | "info" }>;
177
- scanCargo?: boolean;
178
- commitOnly?: boolean;
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;
179
173
  };
180
174
 
181
175
  export type LintReportRecord = {
182
- diagnostics: LintDiagnosticRecord[];
183
- errorCount: number;
184
- warningCount: number;
176
+ diagnostics : LintDiagnosticRecord[];
177
+ errorCount : number;
178
+ warningCount : number;
185
179
  };
186
180
 
187
181
  export type LintExports = {
188
- run: (options: LintRunOptions) => LintReportRecord;
189
- check: (options: LintRunOptions) => LintReportRecord;
182
+ run : (options : LintRunOptions) =>LintReportRecord;
183
+ check : (options : LintRunOptions) =>LintReportRecord;
190
184
  };
191
185
 
192
186
  export type UpdaterExports = {
193
- run: (options: { cwd?: string; interactive?: boolean }) => void;
187
+ run : (options : { cwd ? : string; interactive ? : boolean }) =>void;
194
188
  };
195
189
 
196
190
  export type FormatReportRecord = {
197
- formatted: number;
198
- unchanged: number;
199
- errors: string[];
191
+ formatted : number;
192
+ unchanged : number;
193
+ errors : string[];
200
194
  };
201
195
 
202
196
  export type FormatterStyleOptions = {
203
- indentStyle?: string;
204
- indentWidth?: number;
205
- lineWidth?: number;
206
- quoteStyle?: string;
197
+ indentStyle ? : string;
198
+ indentWidth ? : number;
199
+ lineWidth ? : number;
200
+ quoteStyle ? : string;
207
201
  };
208
202
 
209
203
  export type FormatterRunOptions = {
210
- cwd?: string;
211
- check?: boolean;
212
- includes?: string[];
213
- excludes?: string[];
214
- rust?: boolean;
215
- javascript?: boolean;
216
- style?: FormatterStyleOptions;
204
+ cwd ? : string;
205
+ check ? : boolean;
206
+ includes ? : string[];
207
+ excludes ? : string[];
208
+ rust ? : boolean;
209
+ javascript ? : boolean;
210
+ style ? : FormatterStyleOptions;
217
211
  };
218
212
 
219
213
  export type FormatterExports = {
220
- run: (options: FormatterRunOptions) => FormatReportRecord;
214
+ run : (options : FormatterRunOptions) =>FormatReportRecord;
221
215
  };
222
216
 
223
217
  export type PublisherExports = {
224
- "publish-workspace": (options: {
225
- cwd?: string;
226
- dryRun?: boolean;
227
- refresh?: boolean;
228
- placeholder?: boolean;
229
- only?: string;
230
- packages?: string[];
231
- tag?: string;
232
- access?: string;
233
- npm?: string;
234
- otp?: string;
235
- totpSecret?: string;
236
- token?: string;
237
- }) => PublishReport;
238
- "trust-workspace": (options: {
239
- cwd?: string;
240
- dryRun?: boolean;
241
- refresh?: boolean;
242
- only?: string;
243
- packages?: string[];
244
- npm?: string;
245
- otp?: string;
246
- totpSecret?: string;
247
- token?: string;
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: GitmojiExports;
253
- git: GitExports;
254
- history: HistoryExports;
255
- lint: LintExports;
256
- updater: UpdaterExports;
257
- formatter: FormatterExports;
258
- publisher: PublisherExports;
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: () => 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;
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: string;
339
- newTip?: string | null;
340
- refName: string;
341
- dryRun: boolean;
338
+ oldTip : string;
339
+ newTip ? : string | null;
340
+ refName : string;
341
+ dryRun : boolean;
342
342
  };
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;
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: string;
364
- newTip?: string | null;
365
- refName: string;
366
- dryRun: boolean;
363
+ oldTip : string;
364
+ newTip ? : string | null;
365
+ refName : string;
366
+ dryRun : boolean;
367
367
  };
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;
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: (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;
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: number;
431
- warningCount: number;
430
+ errorCount : number;
431
+ warningCount : number;
432
432
  };
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;
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: number;
453
- warningCount: number;
452
+ errorCount : number;
453
+ warningCount : number;
454
454
  };
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[];
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: 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",
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: GithubAuthor | null | undefined): GithubAuthor | undefined {
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: raw.id !== undefined && raw.id !== null ? BigInt(raw.id) : undefined,
485
- login: raw.login ?? undefined,
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: LintRunOptions) {
489
+ function mapLintOptions(options : LintRunOptions){
490
490
  return {
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 } : {}),
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: 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;
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: number;
512
- warningCount: number;
513
- }): LintReportRecord {
511
+ errorCount : number;
512
+ warningCount : number;
513
+ }) : LintReportRecord {
514
514
  return {
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,
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: NativeBinding): NiftyNative {
529
+ function wrapBinding(binding : NativeBinding) : NiftyNative {
530
530
  return {
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) =>
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": (author) => binding.gitmojiDisplayLogin(author),
543
- "profile-url": (author) => binding.gitmojiProfileUrl(author),
544
- "avatar-url": (author) => binding.gitmojiAvatarUrl(author),
545
- "author-mention": (email, authorName, authorMapJson) =>
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": (body, email, authorName, authorMapJson) =>
547
+ "commit-bullet" : (body, email, authorName, authorMapJson) =>
548
548
  binding.gitmojiCommitBullet(body, email, authorName, authorMapJson),
549
549
  },
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,
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": (repoRoot) => binding.gitFormatTagList(repoRoot),
559
- "resolve-range": (repoRoot, version, fromRef, toRef) => {
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: range.version,
563
- "from-ref": range.fromRef,
564
- "to-ref": range.toRef,
562
+ version : range.version,
563
+ "from-ref" : range.fromRef,
564
+ "to-ref" : range.toRef,
565
565
  };
566
566
  },
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,
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": (options) =>
571
+ history : {
572
+ "commit-export" : (options) =>
573
573
  binding.gitToolsCommitExport({
574
- ...(options.cwd !== undefined ? { cwd: options.cwd } : {}),
575
- base: options.base,
576
- ...(options.ref !== undefined ? { ref: options.ref } : {}),
577
- path: options.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": (options) => {
579
+ "commit-apply" : (options) =>{
580
580
  const report = binding.gitToolsCommitApply({
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 } : {}),
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: report.changes,
589
- oldTip: report.oldTip,
590
- newTip: report.newTip ?? undefined,
591
- refName: report.refName,
592
- dryRun: report.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": (options) =>
595
+ "reword-export" : (options) =>
596
596
  binding.gitToolsRewordExport({
597
- ...(options.cwd !== undefined ? { cwd: options.cwd } : {}),
598
- base: options.base,
599
- ...(options.ref !== undefined ? { ref: options.ref } : {}),
600
- path: options.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": (options) => {
602
+ "reword-rewrite" : (options) =>{
603
603
  const report = binding.gitToolsRewordRewrite({
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 } : {}),
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: report.changes,
612
- oldTip: report.oldTip,
613
- newTip: report.newTip ?? undefined,
614
- refName: report.refName,
615
- dryRun: report.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": (options) =>
618
+ "retime-range" : (options) =>
619
619
  binding.gitToolsRetimeRange({
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 } : {}),
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": (options) =>
627
+ "retime-root" : (options) =>
628
628
  binding.gitToolsRetimeRoot({
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 } : {}),
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": (options) => {
636
+ "changelog-render" : (options) =>{
637
637
  const report = binding.gitToolsChangelogRender({
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 } : {}),
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: 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,
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": (options) => {
658
+ "changelog-lookup" : (options) =>{
659
659
  const author = binding.gitToolsChangelogLookup({
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 } : {}),
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
- return mapAuthor(author) ?? {};
667
+ return mapAuthor(author) ?? { };
668
668
  },
669
669
  },
670
- lint: {
671
- run: (options) => mapLintReport(binding.lintRun(mapLintOptions(options))),
672
- check: (options) => mapLintReport(binding.lintCheck(mapLintOptions(options))),
670
+ lint : {
671
+ run : (options) =>mapLintReport(binding.lintRun(mapLintOptions(options))),
672
+ check : (options) =>mapLintReport(binding.lintCheck(mapLintOptions(options))),
673
673
  },
674
- updater: {
675
- run: (options) => {
674
+ updater : {
675
+ run : (options) =>{
676
676
  binding.updaterRun({
677
- ...(options.cwd !== undefined ? { cwd: options.cwd } : {}),
678
- ...(options.interactive !== undefined ? { interactive: options.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: (options) =>
682
+ formatter : {
683
+ run : (options) =>
684
684
  binding.formatterRun({
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 } : {}),
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": (options) =>
694
+ publisher : {
695
+ "publish-workspace" : (options) =>
696
696
  binding.publisherPublishWorkspace({
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 } : {}),
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
712
+ ? { trustEnvironment : options.trustEnvironment }
713
+ : { }),
709
714
  }),
710
- "trust-workspace": (options) =>
715
+ "trust-workspace" : (options) =>
711
716
  binding.publisherTrustWorkspace({
712
- ...(options.cwd !== undefined ? { cwd: options.cwd } : {}),
713
- ...(options.dryRun !== undefined ? { dryRun: options.dryRun } : {}),
714
- ...(options.refresh !== undefined ? { refresh: options.refresh } : {}),
715
- ...(options.only !== undefined ? { only: options.only } : {}),
716
- ...(options.packages !== undefined ? { packages: options.packages } : {}),
717
- ...(options.npm !== undefined ? { npm: options.npm } : {}),
718
- ...(options.otp !== undefined ? { otp: options.otp } : {}),
719
- ...(options.totpSecret !== undefined ? { totpSecret: options.totpSecret } : {}),
720
- ...(options.token !== undefined ? { token: options.token } : {}),
717
+ ...(options.cwd!== undefined ? { cwd : options.cwd } : { }),
718
+ ...(options.dryRun!== undefined ? { dryRun : options.dryRun } : { }),
719
+ ...(options.refresh!== undefined ? { refresh : options.refresh } : { }),
720
+ ...(options.only!== undefined ? { only : options.only } : { }),
721
+ ...(options.packages!== undefined ? { packages : options.packages } : { }),
722
+ ...(options.npm!== undefined ? { npm : options.npm } : { }),
723
+ ...(options.otp!== undefined ? { otp : options.otp } : { }),
724
+ ...(options.totpSecret!== undefined ? { totpSecret : options.totpSecret } : { }),
725
+ ...(options.token!== undefined ? { token : options.token } : { }),
726
+ ...(options.trustRepo!== undefined ? { trustRepo : options.trustRepo } : { }),
727
+ ...(options.trustFile!== undefined ? { trustFile : options.trustFile } : { }),
728
+ ...(options.trustEnvironment!== undefined
729
+ ? { trustEnvironment : options.trustEnvironment }
730
+ : { }),
721
731
  }),
722
732
  },
723
733
  };
724
734
  }
725
735
 
726
- let cached: NiftyNative | undefined;
736
+ let cached : NiftyNative | undefined;
727
737
 
728
738
  /** Load the platform-specific Node-API binary from `@doki-land/nifty-<platform>`. */
729
- export function loadNiftyNative(): NiftyNative {
730
- if (cached) {
739
+ export function loadNiftyNative() : NiftyNative {
740
+ if(cached){
731
741
  return cached;
732
742
  }
733
743
  const key = `${process.platform}-${process.arch}`;
734
744
  const pkg = PLATFORM_PACKAGES[key];
735
- if (!pkg) {
745
+ if(!pkg){
736
746
  throw new Error(`Unsupported platform for Nifty native bindings: ${key}`);
737
747
  }
738
748
  const require = createRequire(import.meta.url);
@@ -741,26 +751,26 @@ export function loadNiftyNative(): NiftyNative {
741
751
  return cached;
742
752
  }
743
753
 
744
- export function mapTagInfo(raw: { name: string; "short-hash": string }): TagInfo {
745
- return { name: raw.name, shortHash: raw["short-hash"] };
754
+ export function mapTagInfo(raw : { name : string; "short-hash" : string }) : TagInfo {
755
+ return { name : raw.name, shortHash : raw["short-hash"] };
746
756
  }
747
757
 
748
- export function mapRangeInfo(raw: { version: string; "from-ref"?: string; "to-ref": string }): RangeInfo {
758
+ export function mapRangeInfo(raw : { version : string; "from-ref" ? : string; "to-ref" : string }) : RangeInfo {
749
759
  return {
750
- version: raw.version,
751
- fromRef: raw["from-ref"],
752
- toRef: raw["to-ref"],
760
+ version : raw.version,
761
+ fromRef : raw["from-ref"],
762
+ toRef : raw["to-ref"],
753
763
  };
754
764
  }
755
765
 
756
- export function mapCommitRecord(raw: CommitRecord): CommitRecord {
766
+ export function mapCommitRecord(raw : NativeCommitRecord) : CommitRecord {
757
767
  return {
758
- hash: raw.hash,
759
- email: raw.email,
760
- author: raw.author,
761
- subject: raw.subject,
762
- body: raw.body,
763
- gitmoji: raw.gitmoji,
764
- section: raw.section as ReleaseSection,
768
+ hash : raw.hash,
769
+ email : raw.email,
770
+ author : raw.author,
771
+ subject : raw.subject,
772
+ body : raw.body,
773
+ gitmoji : raw.gitmoji,
774
+ section : raw.section as ReleaseSection,
765
775
  };
766
776
  }