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'
22import { release } from '@vitejs/release-scripts'
33import colors from 'picocolors'
44
5+ const nextH2RE = / ^ # # / gm
6+
57release ( {
68 repo : 'vite-plugin-react' ,
79 packages : [ 'plugin-react' , 'plugin-react-swc' , 'plugin-react-oxc' ] ,
@@ -18,11 +20,9 @@ release({
1820 throw new Error ( "Can't find '## Unreleased' section in CHANGELOG.md" )
1921 }
2022 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 ( ) ) )
2626 } ,
2727 generateChangelog : async ( pkgName , version ) => {
2828 if ( pkgName === 'plugin-react-swc' ) {
You can’t perform that action at this time.
0 commit comments