File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,20 @@ if (!packages.length) {
3131
3232packages . forEach ( unlink ? unlinkPackage : linkPackage )
3333
34+ // After unlinking, restore npm packages with a single pnpm install.
35+ if ( unlink && packages . length > 0 ) {
36+ const srcPath = path . resolve ( __dirname , ".." , "src" )
37+ console . log ( "\nRestoring npm packages..." )
38+
39+ try {
40+ execSync ( "pnpm install" , { cwd : srcPath , stdio : "inherit" } )
41+ console . log ( "Successfully restored npm packages" )
42+ } catch ( error ) {
43+ console . error ( `Failed to restore packages: ${ error . message } ` )
44+ console . log ( "You may need to run 'pnpm install' manually in the src directory" )
45+ }
46+ }
47+
3448if ( ! unlink && watch ) {
3549 const watchers = packages . filter ( ( pkg ) => pkg . watchCommand ) . map ( startWatch )
3650
You can’t perform that action at this time.
0 commit comments