File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { readFileSync, writeFileSync } from 'node:fs'
2
2
import { release } from '@vitejs/release-scripts'
3
3
import colors from 'picocolors'
4
4
5
+ const nextH2RE = / ^ # # / gm
6
+
5
7
release ( {
6
8
repo : 'vite-plugin-react' ,
7
9
packages : [ 'plugin-react' , 'plugin-react-swc' , 'plugin-react-oxc' ] ,
@@ -18,11 +20,9 @@ release({
18
20
throw new Error ( "Can't find '## Unreleased' section in CHANGELOG.md" )
19
21
}
20
22
const index = changelog . indexOf ( '## Unreleased' ) + 13
21
- console . log (
22
- colors . dim (
23
- changelog . slice ( index , changelog . indexOf ( '## ' , index ) ) . trim ( ) ,
24
- ) ,
25
- )
23
+ nextH2RE . lastIndex = index
24
+ const nextH2Pos = nextH2RE . exec ( changelog ) ?. index
25
+ console . log ( colors . dim ( changelog . slice ( index , nextH2Pos ) . trim ( ) ) )
26
26
} ,
27
27
generateChangelog : async ( pkgName , version ) => {
28
28
if ( pkgName === 'plugin-react-swc' ) {
You can’t perform that action at this time.
0 commit comments