File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,22 @@ function getWorkspacePackageJsonFiles(workspaceFile: string): string[] {
77 const workspaceYaml = fs . readFileSync ( workspaceFile , 'utf8' ) ;
88 const workspace = yaml . parse ( workspaceYaml ) as { packages ?: string [ ] } ;
99 if ( ! workspace . packages ) throw new Error ( 'No "packages" key found in pnpm-workspace.yaml' ) ;
10- const rootDir = path . dirname ( workspaceFile ) ;
10+
1111 const files = new Set < string > ( ) ;
12+
13+ // include all package.json files in the workspace
14+ const rootDir = path . dirname ( workspaceFile ) ;
1215 for ( const pattern of workspace . packages ) {
1316 const matches = glob . sync ( path . join ( pattern , 'package.json' ) , {
1417 cwd : rootDir ,
1518 absolute : true ,
1619 } ) ;
1720 matches . filter ( ( f ) => ! f . includes ( 'node_modules' ) ) . forEach ( ( f ) => files . add ( f ) ) ;
1821 }
22+
23+ // include root package.json
24+ files . add ( path . resolve ( __dirname , '../package.json' ) ) ;
25+
1926 return Array . from ( files ) ;
2027}
2128
You can’t perform that action at this time.
0 commit comments