@@ -10,7 +10,7 @@ fn socket_patch_command(pm: PackageManager) -> &'static str {
1010 match pm {
1111 PackageManager :: Npm => "npx @socketsecurity/socket-patch apply --silent --ecosystems npm" ,
1212 PackageManager :: Pnpm => {
13- "pnpx @socketsecurity/socket-patch apply --silent --ecosystems npm"
13+ "pnpm dlx @socketsecurity/socket-patch apply --silent --ecosystems npm"
1414 }
1515 }
1616}
@@ -294,10 +294,10 @@ mod tests {
294294 }
295295
296296 #[ test]
297- fn test_configured_str_pnpx_pattern ( ) {
298- let content = r#"{"scripts":{"postinstall":"pnpx @socketsecurity/socket-patch apply --silent --ecosystems npm"}}"# ;
297+ fn test_configured_str_pnpm_dlx_pattern ( ) {
298+ let content = r#"{"scripts":{"postinstall":"pnpm dlx @socketsecurity/socket-patch apply --silent --ecosystems npm"}}"# ;
299299 let status = is_setup_configured_str ( content) ;
300- // "pnpx @socketsecurity/socket-patch apply" contains "socket-patch apply"
300+ // "pnpm dlx @socketsecurity/socket-patch apply" contains "socket-patch apply"
301301 assert ! ( status. postinstall_configured) ;
302302 }
303303
@@ -315,7 +315,7 @@ mod tests {
315315 fn test_generate_empty_pnpm ( ) {
316316 assert_eq ! (
317317 generate_updated_script( "" , PackageManager :: Pnpm ) ,
318- "pnpx @socketsecurity/socket-patch apply --silent --ecosystems npm"
318+ "pnpm dlx @socketsecurity/socket-patch apply --silent --ecosystems npm"
319319 ) ;
320320 }
321321
@@ -331,7 +331,7 @@ mod tests {
331331 fn test_generate_prepend_pnpm ( ) {
332332 assert_eq ! (
333333 generate_updated_script( "echo done" , PackageManager :: Pnpm ) ,
334- "pnpx @socketsecurity/socket-patch apply --silent --ecosystems npm && echo done"
334+ "pnpm dlx @socketsecurity/socket-patch apply --silent --ecosystems npm && echo done"
335335 ) ;
336336 }
337337
@@ -374,8 +374,8 @@ mod tests {
374374 let ( modified, new_postinstall, new_dependencies) =
375375 update_package_json_object ( & mut pkg, PackageManager :: Pnpm ) ;
376376 assert ! ( modified) ;
377- assert ! ( new_postinstall. contains( "pnpx @socketsecurity/socket-patch apply" ) ) ;
378- assert ! ( new_dependencies. contains( "pnpx @socketsecurity/socket-patch apply" ) ) ;
377+ assert ! ( new_postinstall. contains( "pnpm dlx @socketsecurity/socket-patch apply" ) ) ;
378+ assert ! ( new_dependencies. contains( "pnpm dlx @socketsecurity/socket-patch apply" ) ) ;
379379 }
380380
381381 #[ test]
@@ -446,16 +446,16 @@ mod tests {
446446 let ( modified, new_content, _, new_pi, _, new_dep) =
447447 update_package_json_content ( content, PackageManager :: Pnpm ) . unwrap ( ) ;
448448 assert ! ( modified) ;
449- assert ! ( new_pi. contains( "pnpx @socketsecurity/socket-patch apply" ) ) ;
450- assert ! ( new_dep. contains( "pnpx @socketsecurity/socket-patch apply" ) ) ;
449+ assert ! ( new_pi. contains( "pnpm dlx @socketsecurity/socket-patch apply" ) ) ;
450+ assert ! ( new_dep. contains( "pnpm dlx @socketsecurity/socket-patch apply" ) ) ;
451451 let parsed: serde_json:: Value = serde_json:: from_str ( & new_content) . unwrap ( ) ;
452452 assert ! ( parsed[ "scripts" ] [ "postinstall" ]
453453 . as_str( )
454454 . unwrap( )
455- . contains( "pnpx " ) ) ;
455+ . contains( "pnpm dlx " ) ) ;
456456 assert ! ( parsed[ "scripts" ] [ "dependencies" ]
457457 . as_str( )
458458 . unwrap( )
459- . contains( "pnpx " ) ) ;
459+ . contains( "pnpm dlx " ) ) ;
460460 }
461461}
0 commit comments