@@ -132,27 +132,40 @@ async function patchSkeleton() {
132132
133133 // Patch pnpm-workspace.yaml
134134 const pnpmWorkspacePath = join ( projectDir , 'skeleton' , 'pnpm-workspace.yaml' ) ;
135- const pnpmWorkspaceContent = fs
135+ let pnpmWorkspaceContent = fs
136136 . readFileSync ( pnpmWorkspacePath , 'utf8' )
137137 . replace ( `trustPolicy: no-downgrade` , '\n' )
138138 . replace (
139139 / ' @ v i t e s t \/ b r o w s e r - p l a y w r i g h t ' : [ \d . ] + / ,
140140 `'@vitest/browser-playwright': ${ vitestVersion } ` ,
141141 ) ;
142- const appendContent = `
143- minimumReleaseAgeExclude:
144- - '@voidzero-dev/*'
145- - '@vitest/*'
146- - oxlint
147- - oxfmt
148- - oxlint-tsgolint
149142
143+ // Add entries to existing minimumReleaseAgeExclude if it exists, otherwise append new section
144+ const newExcludes = [ "'@voidzero-dev/*'" , "'@vitest/*'" , 'oxlint' , 'oxfmt' , 'oxlint-tsgolint' ] ;
145+ if ( pnpmWorkspaceContent . includes ( 'minimumReleaseAgeExclude:' ) ) {
146+ // Find the minimumReleaseAgeExclude section and add new entries
147+ pnpmWorkspaceContent = pnpmWorkspaceContent . replace (
148+ / m i n i m u m R e l e a s e A g e E x c l u d e : \n ( (?: - .+ \n ) + ) / ,
149+ ( _ , existingEntries ) => {
150+ const newEntriesStr = newExcludes . map ( ( e ) => ` - ${ e } \n` ) . join ( '' ) ;
151+ return `minimumReleaseAgeExclude:\n${ existingEntries } ${ newEntriesStr } ` ;
152+ } ,
153+ ) ;
154+ } else {
155+ pnpmWorkspaceContent += `\nminimumReleaseAgeExclude:\n${ newExcludes . map ( ( e ) => ` - ${ e } ` ) . join ( '\n' ) } \n` ;
156+ }
157+
158+ // Add peerDependencyRules if not present
159+ if ( ! pnpmWorkspaceContent . includes ( 'peerDependencyRules:' ) ) {
160+ pnpmWorkspaceContent += `
150161peerDependencyRules:
151162 allowAny:
152163 - vite
153164 - vitest
154165` ;
155- fs . writeFileSync ( pnpmWorkspacePath , pnpmWorkspaceContent + appendContent ) ;
166+ }
167+
168+ fs . writeFileSync ( pnpmWorkspacePath , pnpmWorkspaceContent ) ;
156169
157170 // Update vite.config.ts files to import from vitest/browser-playwright instead of @vitest/browser-playwright
158171 // This is needed because pnpm overrides don't affect Node.js module resolution at config load time
0 commit comments