@@ -142,7 +142,7 @@ fn run_script<T: AsRef<Path>, A: AsRef<OsStr>, P: AsRef<Path> + std::fmt::Displa
142142 if exit_code == Some ( 0 ) || ( exit_code. is_some ( ) && !check_exit_code) {
143143 Ok ( ( ) )
144144 } else {
145- Err ( io:: Error :: other ( "npm exit code indicates failure." ) )
145+ Err ( io:: Error :: other ( "pnpm exit code indicates failure." ) )
146146 }
147147}
148148
@@ -289,7 +289,7 @@ fn patch_file(patch: &str, before_patch: &str, file_path: &str) -> io::Result<()
289289 Ok ( ( ) )
290290}
291291/// After updating files in the client's Node files, perform some fix-ups.
292- fn patch_client_npm ( ) -> io:: Result < ( ) > {
292+ fn patch_client_libs ( ) -> io:: Result < ( ) > {
293293 // Apply a the fixes described in [issue
294294 // 27](https://github.com/bjones1/CodeChat_Editor/issues/27).
295295 patch_file (
@@ -333,9 +333,9 @@ fn patch_client_npm() -> io::Result<()> {
333333}
334334
335335fn run_install ( dev : bool ) -> io:: Result < ( ) > {
336- run_script ( "npm " , & [ "install" ] , "../client" , true ) ?;
337- patch_client_npm ( ) ?;
338- run_script ( "npm " , & [ "install" ] , "../extensions/VSCode" , true ) ?;
336+ run_script ( "pnpm " , & [ "install" ] , "../client" , true ) ?;
337+ patch_client_libs ( ) ?;
338+ run_script ( "pnpm " , & [ "install" ] , "../extensions/VSCode" , true ) ?;
339339 run_cmd ! (
340340 cargo fetch --manifest-path=../builder/Cargo . toml;
341341 cargo fetch;
@@ -354,16 +354,16 @@ fn run_install(dev: bool) -> io::Result<()> {
354354}
355355
356356fn run_update ( ) -> io:: Result < ( ) > {
357- run_script ( "npm " , & [ "update" ] , "../client" , true ) ?;
358- patch_client_npm ( ) ?;
359- run_script ( "npm " , & [ "update" ] , "../extensions/VSCode" , true ) ?;
357+ run_script ( "pnpm " , & [ "update" ] , "../client" , true ) ?;
358+ patch_client_libs ( ) ?;
359+ run_script ( "pnpm " , & [ "update" ] , "../extensions/VSCode" , true ) ?;
360360 run_cmd ! (
361361 cargo update --manifest-path=../builder/Cargo . toml;
362362 cargo update;
363363 ) ?;
364364 // Simply display outdated dependencies, but don't consider them an error.
365- run_script ( "npm " , & [ "outdated" ] , "../client" , false ) ?;
366- run_script ( "npm " , & [ "outdated" ] , "../extensions/VSCode" , false ) ?;
365+ run_script ( "pnpm " , & [ "outdated" ] , "../client" , false ) ?;
366+ run_script ( "pnpm " , & [ "outdated" ] , "../extensions/VSCode" , false ) ?;
367367 run_cmd ! (
368368 cargo outdated --manifest-path=../builder/Cargo . toml;
369369 cargo outdated;
@@ -403,7 +403,7 @@ fn run_build() -> io::Result<()> {
403403 // Clean out all bundled files before the rebuild.
404404 remove_dir_all_if_exists ( "../client/static/bundled" ) ?;
405405 run_client_build ( false , false ) ?;
406- run_script ( "npm " , & [ "run" , "compile" ] , "../extensions/VSCode" , true ) ?;
406+ run_script ( "pnpm " , & [ "run" , "compile" ] , "../extensions/VSCode" , true ) ?;
407407 Ok ( ( ) )
408408}
409409
@@ -501,7 +501,7 @@ fn run_change_version(new_version: &String) -> io::Result<()> {
501501 ) ?;
502502 let json_search_regex = r#"(\r?\n "version": ")[\d.]+(",\r?\n)"# ;
503503 search_and_replace_file (
504- "../client/package.json " ,
504+ "../client/package.json5 " ,
505505 json_search_regex,
506506 & replacement_string,
507507 ) ?;
@@ -520,7 +520,7 @@ fn run_prerelease() -> io::Result<()> {
520520 run_cmd ! (
521521 cargo test export_bindings;
522522 ) ?;
523- run_script ( "npm " , & [ "run" , "dist" ] , "../client" , true ) ?;
523+ run_script ( "pnpm " , & [ "run" , "dist" ] , "../client" , true ) ?;
524524 Ok ( ( ) )
525525}
526526
0 commit comments