@@ -14,7 +14,13 @@ import {
14
14
type Commit
15
15
} from '@flex-development/commitlint-config'
16
16
import pathe from '@flex-development/pathe'
17
- import { CompareResult , isNIL } from '@flex-development/tutils'
17
+ import {
18
+ CompareResult ,
19
+ at ,
20
+ includes ,
21
+ isNIL ,
22
+ select
23
+ } from '@flex-development/tutils'
18
24
import addStream from 'add-stream'
19
25
import conventionalChangelog from 'conventional-changelog'
20
26
import type { Options } from 'conventional-changelog-core'
@@ -154,7 +160,6 @@ sade('changelog', true)
154
160
const changelog : Readable = conventionalChangelog < Commit > (
155
161
{
156
162
append : false ,
157
- debug : debug ? console . debug . bind ( console ) : undefined ,
158
163
outputUnreleased :
159
164
typeof outputUnreleased === 'boolean'
160
165
? outputUnreleased
@@ -175,6 +180,7 @@ sade('changelog', true)
175
180
{ section : ':bug: Fixes' , type : Type . FIX } ,
176
181
{ section : ':fire: Performance Improvements' , type : Type . PERF } ,
177
182
{ section : ':mechanical_arm: Refactors' , type : Type . REFACTOR } ,
183
+ { hidden : true , type : Type . RELEASE } ,
178
184
{ section : ':wastebasket: Reverts' , type : Type . REVERT } ,
179
185
{ hidden : true , type : Type . STYLE } ,
180
186
{ section : ':white_check_mark: Testing' , type : Type . TEST } ,
@@ -198,10 +204,10 @@ sade('changelog', true)
198
204
return void apply ( null , {
199
205
...commit ,
200
206
committerDate : dateformat ( commit . committerDate , 'yyyy-mm-dd' , true ) ,
201
- mentions : commit . mentions . filter ( m => m !== 'flexdevelopment' ) ,
207
+ mentions : select ( commit . mentions , m => m !== 'flexdevelopment' ) ,
202
208
// @ts -expect-error ts(2322)
203
209
raw : commit ,
204
- references : commit . references . filter ( ref => ref . action !== null ) ,
210
+ references : select ( commit . references , ref => ref . action !== null ) ,
205
211
version : commit . gitTags ? vgx . exec ( commit . gitTags ) ?. [ 1 ] : undefined
206
212
} )
207
213
} ,
@@ -296,21 +302,21 @@ sade('changelog', true)
296
302
*
297
303
* @const {CommitEnhanced?} first_commit
298
304
*/
299
- const first_commit : CommitEnhanced | undefined = commits . at ( 0 )
305
+ const first_commit : CommitEnhanced | undefined = at ( commits , 0 )
300
306
301
307
/**
302
308
* Last commit in release.
303
309
*
304
310
* @const {CommitEnhanced?} last_commit
305
311
*/
306
- const last_commit : CommitEnhanced | undefined = commits . at ( - 1 )
312
+ const last_commit : CommitEnhanced | undefined = at ( commits , - 1 )
307
313
308
314
// set current and previous tags
309
315
if ( key && ( ! currentTag || ! previousTag ) ) {
310
316
currentTag = key . version ?? undefined
311
317
312
318
// try setting previous tag based on current tag
313
- if ( gitSemverTags . includes ( currentTag ?? '' ) ) {
319
+ if ( includes ( gitSemverTags , currentTag ) ) {
314
320
const { version = '' } = key
315
321
previousTag = gitSemverTags [ gitSemverTags . indexOf ( version ) + 1 ]
316
322
if ( ! previousTag ) previousTag = last_commit ?. hash ?? undefined
@@ -324,7 +330,7 @@ sade('changelog', true)
324
330
: ! currentTag && version
325
331
? pkg . tagPrefix + version
326
332
: currentTag ?? version
327
- previousTag = previousTag ?? gitSemverTags [ 0 ]
333
+ previousTag = previousTag ?? at ( gitSemverTags , 0 )
328
334
}
329
335
330
336
// set release date
0 commit comments