@doki-land/nifty 0.1.0 → 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.
- 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 +81 -81
- package/src/cli/change-logs-cmd.ts +26 -26
- package/src/cli/cli.ts +3 -3
- package/src/cli/commit-cmd.ts +77 -77
- package/src/cli/commit-lint-report.ts +44 -44
- 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 +49 -49
- package/src/cli/options.ts +16 -16
- package/src/cli/publish-cmd.ts +16 -16
- 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 +132 -132
- package/src/cli/workspace.ts +49 -49
- package/src/config/authorMap.ts +4 -4
- package/src/config/defineConfig.ts +5 -5
- package/src/config/detectProject.ts +46 -46
- package/src/config/formatPresets.ts +26 -26
- package/src/config/loadConfig.ts +35 -35
- package/src/config/trustPayload.ts +7 -7
- package/src/config/types.ts +38 -38
- package/src/git.ts +14 -14
- package/src/github.ts +54 -54
- package/src/gitmoji.ts +18 -18
- package/src/native.ts +600 -600
- package/src/nifty.ts +30 -30
- package/src/types.ts +17 -17
package/src/native.ts
CHANGED
|
@@ -9,740 +9,740 @@ import type {
|
|
|
9
9
|
} from "./types.js";
|
|
10
10
|
|
|
11
11
|
export type GitmojiExports = {
|
|
12
|
-
"known-gitmojis": () =>
|
|
13
|
-
"validate-subject": (subject: string) =>
|
|
14
|
-
"parse-subject": (subject: string) =>
|
|
15
|
-
"format-subject": (gitmoji: string, body: string) =>
|
|
16
|
-
"strip-gitmoji": (subject: string) =>
|
|
17
|
-
"leading-gitmoji": (subject: string) =>
|
|
18
|
-
"section-for-gitmoji": (gitmoji: string | undefined) =>
|
|
19
|
-
"parse-noreply-email": (email: string) =>
|
|
20
|
-
"resolve-github-author": (email: string, authorMapJson: string) =>
|
|
21
|
-
"display-login": (author: GithubAuthor) =>
|
|
22
|
-
"profile-url": (author: GithubAuthor) =>
|
|
23
|
-
"avatar-url": (author: GithubAuthor) =>
|
|
24
|
-
"author-mention": (email: string, authorName: string, authorMapJson: string) =>
|
|
25
|
-
"commit-bullet": (body: string, email: string, authorName: string, authorMapJson: 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) =>
|
|
30
|
-
"list-version-tags": (repoRoot: string) =>
|
|
31
|
-
"list-tag-infos": (repoRoot: string) =>
|
|
32
|
-
"format-tag-list": (repoRoot: string) =>
|
|
33
|
-
"resolve-range": (
|
|
34
|
-
repoRoot: string,
|
|
35
|
-
version: string | undefined,
|
|
36
|
-
fromRef: string | undefined,
|
|
37
|
-
toRef: string | undefined,
|
|
38
|
-
) =>
|
|
39
|
-
"collect-commits": (
|
|
40
|
-
repoRoot: string,
|
|
41
|
-
fromRef: string | undefined,
|
|
42
|
-
toRef: string,
|
|
43
|
-
) =>
|
|
44
|
-
"detect-github-repo": (repoRoot: string) =>
|
|
45
|
-
"parse-github-remote": (url: string) =>
|
|
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: string };
|
|
48
|
+
type NativeCommitRecord = Omit<CommitRecord, "section"> & { section : string };
|
|
49
49
|
|
|
50
50
|
export type PublishReport = {
|
|
51
|
-
root: string;
|
|
52
|
-
order: string[];
|
|
53
|
-
published: string[];
|
|
54
|
-
skipped: string[];
|
|
55
|
-
skippedVersions: string[];
|
|
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: string;
|
|
60
|
-
configured: string[];
|
|
61
|
-
skipped: string[];
|
|
62
|
-
failed: string[];
|
|
59
|
+
root : string;
|
|
60
|
+
configured : string[];
|
|
61
|
+
skipped : string[];
|
|
62
|
+
failed : string[];
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export type RewordPlannedChange = {
|
|
66
|
-
oldOid: string;
|
|
67
|
-
oldSubject: string;
|
|
68
|
-
newSubject: string;
|
|
69
|
-
parentsRelinked: boolean;
|
|
70
|
-
messageChanged: boolean;
|
|
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: RewordPlannedChange[];
|
|
75
|
-
oldTip: string;
|
|
76
|
-
newTip
|
|
77
|
-
refName: string;
|
|
78
|
-
dryRun: boolean;
|
|
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": (options: {
|
|
83
|
-
cwd
|
|
84
|
-
base: string;
|
|
85
|
-
ref
|
|
86
|
-
path: string;
|
|
87
|
-
}) =>
|
|
88
|
-
"commit-apply": (options: {
|
|
89
|
-
cwd
|
|
90
|
-
base: string;
|
|
91
|
-
ref
|
|
92
|
-
path: string;
|
|
93
|
-
dryRun
|
|
94
|
-
}) =>
|
|
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": (options: {
|
|
97
|
-
cwd
|
|
98
|
-
base: string;
|
|
99
|
-
ref
|
|
100
|
-
path: string;
|
|
101
|
-
}) =>
|
|
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": (options: {
|
|
104
|
-
cwd
|
|
105
|
-
base: string;
|
|
106
|
-
ref
|
|
107
|
-
path: string;
|
|
108
|
-
dryRun
|
|
109
|
-
}) =>
|
|
110
|
-
"retime-range": (options: {
|
|
111
|
-
cwd
|
|
112
|
-
commit: string;
|
|
113
|
-
startDate
|
|
114
|
-
endDate
|
|
115
|
-
branch
|
|
116
|
-
tip
|
|
117
|
-
}) =>
|
|
118
|
-
"retime-root": (options: {
|
|
119
|
-
cwd
|
|
120
|
-
startDate
|
|
121
|
-
endDate
|
|
122
|
-
branch
|
|
123
|
-
tip
|
|
124
|
-
message
|
|
125
|
-
}) =>
|
|
126
|
-
"changelog-render": (options: {
|
|
127
|
-
cwd
|
|
128
|
-
version
|
|
129
|
-
fromRef
|
|
130
|
-
toRef
|
|
131
|
-
write
|
|
132
|
-
tags
|
|
133
|
-
repo
|
|
134
|
-
authorMap
|
|
135
|
-
releasesDir
|
|
136
|
-
}) =>
|
|
137
|
-
notes: string;
|
|
138
|
-
version: string;
|
|
139
|
-
fromRef
|
|
140
|
-
toRef: string;
|
|
141
|
-
commitCount: number;
|
|
142
|
-
writtenPath
|
|
143
|
-
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;
|
|
144
144
|
};
|
|
145
|
-
"changelog-lookup": (options: {
|
|
146
|
-
cwd
|
|
147
|
-
email
|
|
148
|
-
login
|
|
149
|
-
map
|
|
150
|
-
githubToken
|
|
151
|
-
fetch
|
|
152
|
-
}) =>
|
|
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: string;
|
|
157
|
-
severity: "error" | "warning" | "info";
|
|
158
|
-
message: string;
|
|
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: LintDiagnosticRecord[];
|
|
177
|
-
errorCount: number;
|
|
178
|
-
warningCount: number;
|
|
176
|
+
diagnostics : LintDiagnosticRecord[];
|
|
177
|
+
errorCount : number;
|
|
178
|
+
warningCount : number;
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
export type LintExports = {
|
|
182
|
-
run: (options: LintRunOptions) =>
|
|
183
|
-
check: (options: LintRunOptions) =>
|
|
182
|
+
run : (options : LintRunOptions) =>LintReportRecord;
|
|
183
|
+
check : (options : LintRunOptions) =>LintReportRecord;
|
|
184
184
|
};
|
|
185
185
|
|
|
186
186
|
export type UpdaterExports = {
|
|
187
|
-
run: (options: { cwd
|
|
187
|
+
run : (options : { cwd ? : string; interactive ? : boolean }) =>void;
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
export type FormatReportRecord = {
|
|
191
|
-
formatted: number;
|
|
192
|
-
unchanged: number;
|
|
193
|
-
errors: string[];
|
|
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: (options: FormatterRunOptions) =>
|
|
214
|
+
run : (options : FormatterRunOptions) =>FormatReportRecord;
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
export type PublisherExports = {
|
|
218
|
-
"publish-workspace": (options: {
|
|
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
|
-
}) =>
|
|
235
|
-
"trust-workspace": (options: {
|
|
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
|
-
}) =>
|
|
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: () =>
|
|
263
|
-
gitmojiValidateSubject: (subject: string) =>
|
|
264
|
-
gitmojiParseSubject: (subject: string) =>
|
|
265
|
-
gitmojiFormatSubject: (gitmoji: string, body: string) =>
|
|
266
|
-
gitmojiStripGitmoji: (subject: string) =>
|
|
267
|
-
gitmojiLeadingGitmoji: (subject: string) =>
|
|
268
|
-
gitmojiSectionForGitmoji: (gitmoji
|
|
269
|
-
gitmojiParseNoreplyEmail: (email: string) =>
|
|
270
|
-
gitmojiResolveGithubAuthor: (email: string, authorMapJson: string) =>
|
|
271
|
-
gitmojiDisplayLogin: (author: GithubAuthor) =>
|
|
272
|
-
gitmojiProfileUrl: (author: GithubAuthor) =>
|
|
273
|
-
gitmojiAvatarUrl: (author: GithubAuthor) =>
|
|
274
|
-
gitmojiAuthorMention: (email: string, authorName: string, authorMapJson: string) =>
|
|
275
|
-
gitmojiCommitBullet: (body: string, email: string, authorName: string, authorMapJson: string) =>
|
|
276
|
-
gitDiscoverRoot: (startPath: string) =>
|
|
277
|
-
gitListVersionTags: (repoRoot: string) =>
|
|
278
|
-
gitListTagInfos: (repoRoot: string) =>
|
|
279
|
-
gitFormatTagList: (repoRoot: string) =>
|
|
280
|
-
gitResolveRange: (
|
|
281
|
-
repoRoot: string,
|
|
282
|
-
version
|
|
283
|
-
fromRef
|
|
284
|
-
toRef
|
|
285
|
-
) =>
|
|
286
|
-
gitCollectCommits: (
|
|
287
|
-
repoRoot: string,
|
|
288
|
-
fromRef: string | null | undefined,
|
|
289
|
-
toRef: string,
|
|
290
|
-
) =>
|
|
291
|
-
gitDetectGithubRepo: (repoRoot: string) =>
|
|
292
|
-
gitParseGithubRemote: (url: string) =>
|
|
293
|
-
publisherPublishWorkspace: (options: {
|
|
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
|
-
}) =>
|
|
307
|
-
publisherTrustWorkspace: (options: {
|
|
308
|
-
cwd
|
|
309
|
-
dryRun
|
|
310
|
-
refresh
|
|
311
|
-
only
|
|
312
|
-
packages
|
|
313
|
-
npm
|
|
314
|
-
otp
|
|
315
|
-
totpSecret
|
|
316
|
-
token
|
|
317
|
-
}) =>
|
|
318
|
-
gitToolsCommitExport: (options: {
|
|
319
|
-
cwd
|
|
320
|
-
base: string;
|
|
321
|
-
ref
|
|
322
|
-
path: string;
|
|
323
|
-
}) =>
|
|
324
|
-
gitToolsCommitApply: (options: {
|
|
325
|
-
cwd
|
|
326
|
-
base: string;
|
|
327
|
-
ref
|
|
328
|
-
path: string;
|
|
329
|
-
dryRun
|
|
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
|
|
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
|
|
345
|
-
base: string;
|
|
346
|
-
ref
|
|
347
|
-
path: string;
|
|
348
|
-
}) =>
|
|
349
|
-
gitToolsRewordRewrite: (options: {
|
|
350
|
-
cwd
|
|
351
|
-
base: string;
|
|
352
|
-
ref
|
|
353
|
-
path: string;
|
|
354
|
-
dryRun
|
|
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
|
|
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
|
|
370
|
-
commit: string;
|
|
371
|
-
startDate
|
|
372
|
-
endDate
|
|
373
|
-
branch
|
|
374
|
-
tip
|
|
375
|
-
}) =>
|
|
376
|
-
gitToolsRetimeRoot: (options: {
|
|
377
|
-
cwd
|
|
378
|
-
startDate
|
|
379
|
-
endDate
|
|
380
|
-
branch
|
|
381
|
-
tip
|
|
382
|
-
message
|
|
383
|
-
}) =>
|
|
384
|
-
gitToolsChangelogRender: (options: {
|
|
385
|
-
cwd
|
|
386
|
-
version
|
|
387
|
-
fromRef
|
|
388
|
-
toRef
|
|
389
|
-
write
|
|
390
|
-
tags
|
|
391
|
-
repo
|
|
392
|
-
authorMap
|
|
393
|
-
releasesDir
|
|
394
|
-
}) =>
|
|
395
|
-
notes: string;
|
|
396
|
-
version: string;
|
|
397
|
-
fromRef
|
|
398
|
-
toRef: string;
|
|
399
|
-
commitCount: number;
|
|
400
|
-
writtenPath
|
|
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
|
|
405
|
-
email
|
|
406
|
-
login
|
|
407
|
-
map
|
|
408
|
-
githubToken
|
|
409
|
-
fetch
|
|
410
|
-
}) =>
|
|
411
|
-
lintRun: (options: {
|
|
412
|
-
cwd
|
|
413
|
-
fromRef
|
|
414
|
-
toRef
|
|
415
|
-
subjects
|
|
416
|
-
rules
|
|
417
|
-
scanCargo
|
|
418
|
-
commitOnly
|
|
419
|
-
check
|
|
420
|
-
}) =>
|
|
421
|
-
diagnostics: Array<{
|
|
422
|
-
rule: string;
|
|
423
|
-
severity: string;
|
|
424
|
-
message: string;
|
|
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: number;
|
|
431
|
-
warningCount: number;
|
|
430
|
+
errorCount : number;
|
|
431
|
+
warningCount : number;
|
|
432
432
|
};
|
|
433
|
-
lintCheck: (options: {
|
|
434
|
-
cwd
|
|
435
|
-
fromRef
|
|
436
|
-
toRef
|
|
437
|
-
subjects
|
|
438
|
-
rules
|
|
439
|
-
scanCargo
|
|
440
|
-
commitOnly
|
|
441
|
-
check
|
|
442
|
-
}) =>
|
|
443
|
-
diagnostics: Array<{
|
|
444
|
-
rule: string;
|
|
445
|
-
severity: string;
|
|
446
|
-
message: string;
|
|
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: number;
|
|
453
|
-
warningCount: number;
|
|
452
|
+
errorCount : number;
|
|
453
|
+
warningCount : number;
|
|
454
454
|
};
|
|
455
|
-
updaterRun: (options: { cwd
|
|
456
|
-
formatterRun: (options: {
|
|
457
|
-
cwd
|
|
458
|
-
check
|
|
459
|
-
includes
|
|
460
|
-
excludes
|
|
461
|
-
rust
|
|
462
|
-
javascript
|
|
463
|
-
style
|
|
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
|
|
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
|
|
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
|
|
492
|
-
...(options.fromRef
|
|
493
|
-
...(options.toRef
|
|
494
|
-
...(options.subjects
|
|
495
|
-
...(options.rules
|
|
496
|
-
...(options.scanCargo
|
|
497
|
-
...(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
|
|
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: 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": () =>
|
|
533
|
-
"validate-subject": (subject) =>
|
|
534
|
-
"parse-subject": (subject) =>
|
|
535
|
-
"format-subject": (gitmoji, body) =>
|
|
536
|
-
"strip-gitmoji": (subject) =>
|
|
537
|
-
"leading-gitmoji": (subject) =>
|
|
538
|
-
"section-for-gitmoji": (gitmoji) =>
|
|
539
|
-
"parse-noreply-email": (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) =>
|
|
543
|
-
"profile-url": (author) =>
|
|
544
|
-
"avatar-url": (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) =>
|
|
552
|
-
"list-version-tags": (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) =>
|
|
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) =>
|
|
568
|
-
"detect-github-repo": (repoRoot) =>
|
|
569
|
-
"parse-github-remote": (url) =>
|
|
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
|
|
575
|
-
base: options.base,
|
|
576
|
-
...(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
|
|
582
|
-
base: options.base,
|
|
583
|
-
...(options.ref
|
|
584
|
-
path: options.path,
|
|
585
|
-
...(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
|
|
598
|
-
base: options.base,
|
|
599
|
-
...(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
|
|
605
|
-
base: options.base,
|
|
606
|
-
...(options.ref
|
|
607
|
-
path: options.path,
|
|
608
|
-
...(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
|
|
621
|
-
commit: options.commit,
|
|
622
|
-
...(options.startDate
|
|
623
|
-
...(options.endDate
|
|
624
|
-
...(options.branch
|
|
625
|
-
...(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
|
|
630
|
-
...(options.startDate
|
|
631
|
-
...(options.endDate
|
|
632
|
-
...(options.branch
|
|
633
|
-
...(options.tip
|
|
634
|
-
...(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
|
|
639
|
-
...(options.version
|
|
640
|
-
...(options.fromRef
|
|
641
|
-
...(options.toRef
|
|
642
|
-
...(options.write
|
|
643
|
-
...(options.tags
|
|
644
|
-
...(options.repo
|
|
645
|
-
...(options.authorMap
|
|
646
|
-
...(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
|
|
661
|
-
...(options.email
|
|
662
|
-
...(options.login
|
|
663
|
-
...(options.map
|
|
664
|
-
...(options.githubToken
|
|
665
|
-
...(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) =>
|
|
672
|
-
check: (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
|
|
678
|
-
...(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
|
|
686
|
-
...(options.check
|
|
687
|
-
...(options.includes
|
|
688
|
-
...(options.excludes
|
|
689
|
-
...(options.rust
|
|
690
|
-
...(options.javascript
|
|
691
|
-
...(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
|
|
698
|
-
...(options.dryRun
|
|
699
|
-
...(options.refresh
|
|
700
|
-
...(options.placeholder
|
|
701
|
-
...(options.only
|
|
702
|
-
...(options.packages
|
|
703
|
-
...(options.tag
|
|
704
|
-
...(options.access
|
|
705
|
-
...(options.npm
|
|
706
|
-
...(options.otp
|
|
707
|
-
...(options.totpSecret
|
|
708
|
-
...(options.token
|
|
709
|
-
...(options.trustRepo
|
|
710
|
-
...(options.trustFile
|
|
711
|
-
...(options.trustEnvironment
|
|
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
|
|
712
|
+
? { trustEnvironment : options.trustEnvironment }
|
|
713
|
+
: { }),
|
|
714
714
|
}),
|
|
715
|
-
"trust-workspace": (options) =>
|
|
715
|
+
"trust-workspace" : (options) =>
|
|
716
716
|
binding.publisherTrustWorkspace({
|
|
717
|
-
...(options.cwd
|
|
718
|
-
...(options.dryRun
|
|
719
|
-
...(options.refresh
|
|
720
|
-
...(options.only
|
|
721
|
-
...(options.packages
|
|
722
|
-
...(options.npm
|
|
723
|
-
...(options.otp
|
|
724
|
-
...(options.totpSecret
|
|
725
|
-
...(options.token
|
|
726
|
-
...(options.trustRepo
|
|
727
|
-
...(options.trustFile
|
|
728
|
-
...(options.trustEnvironment
|
|
729
|
-
? { trustEnvironment: options.trustEnvironment }
|
|
730
|
-
: {}),
|
|
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
|
+
: { }),
|
|
731
731
|
}),
|
|
732
732
|
},
|
|
733
733
|
};
|
|
734
734
|
}
|
|
735
735
|
|
|
736
|
-
let cached: NiftyNative | undefined;
|
|
736
|
+
let cached : NiftyNative | undefined;
|
|
737
737
|
|
|
738
738
|
/** Load the platform-specific Node-API binary from `@doki-land/nifty-<platform>`. */
|
|
739
|
-
export function loadNiftyNative(): NiftyNative {
|
|
740
|
-
if
|
|
739
|
+
export function loadNiftyNative() : NiftyNative {
|
|
740
|
+
if(cached){
|
|
741
741
|
return cached;
|
|
742
742
|
}
|
|
743
743
|
const key = `${process.platform}-${process.arch}`;
|
|
744
744
|
const pkg = PLATFORM_PACKAGES[key];
|
|
745
|
-
if
|
|
745
|
+
if(!pkg){
|
|
746
746
|
throw new Error(`Unsupported platform for Nifty native bindings: ${key}`);
|
|
747
747
|
}
|
|
748
748
|
const require = createRequire(import.meta.url);
|
|
@@ -751,26 +751,26 @@ export function loadNiftyNative(): NiftyNative {
|
|
|
751
751
|
return cached;
|
|
752
752
|
}
|
|
753
753
|
|
|
754
|
-
export function mapTagInfo(raw: { name: string; "short-hash": string }): TagInfo {
|
|
755
|
-
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"] };
|
|
756
756
|
}
|
|
757
757
|
|
|
758
|
-
export function mapRangeInfo(raw: { version: string; "from-ref"
|
|
758
|
+
export function mapRangeInfo(raw : { version : string; "from-ref" ? : string; "to-ref" : string }) : RangeInfo {
|
|
759
759
|
return {
|
|
760
|
-
version: raw.version,
|
|
761
|
-
fromRef: raw["from-ref"],
|
|
762
|
-
toRef: raw["to-ref"],
|
|
760
|
+
version : raw.version,
|
|
761
|
+
fromRef : raw["from-ref"],
|
|
762
|
+
toRef : raw["to-ref"],
|
|
763
763
|
};
|
|
764
764
|
}
|
|
765
765
|
|
|
766
|
-
export function mapCommitRecord(raw: NativeCommitRecord): CommitRecord {
|
|
766
|
+
export function mapCommitRecord(raw : NativeCommitRecord) : CommitRecord {
|
|
767
767
|
return {
|
|
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,
|
|
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,
|
|
775
775
|
};
|
|
776
776
|
}
|