@@ -13,7 +13,6 @@ import inquirer from "inquirer";
1313import * as yaml from "js-yaml" ;
1414import { cwd } from "process" ;
1515import chalk from "chalk" ;
16- import ora from "ora" ;
1716
1817 const pluginsFilePath = path . resolve ( __dirname , '../../../pluginsList.json' ) ;
1918 if ( ! fs . existsSync ( pluginsFilePath ) ) {
@@ -176,14 +175,7 @@ export default EventSource;
176175}
177176
178177const addAction = async ( pluginsList : string [ ] ) => {
179- const spinner = ora ( {
180- text : "Installing plugins... " ,
181- spinner : {
182- frames : [ "🌍 " , "🌎 " , "🌏 " , "🌐 " , "🌑 " , "🌒 " , "🌓 " , "🌔 " ] ,
183- interval : 180 ,
184- } ,
185- } ) ;
186-
178+ console . log ( 'Searching for plugin...' ) ;
187179 async function installPlugin ( pluginsList : string [ ] ) {
188180 try {
189181 console . log ( "Starting plugin installation..." ) ;
@@ -193,19 +185,9 @@ const addAction = async (pluginsList: string[]) => {
193185
194186 const packageManager = hasPnpm ? "pnpm" : "npm" ;
195187 console . log ( `Using package manager: ${ packageManager } ` ) ;
196-
197- spinner . text = `Installing plugins with ${ packageManager } ...` ;
198- spinner . start ( ) ;
199-
188+ console . log ( `Installing plugins with ${ packageManager } ...` ) ;
200189 const startTime = Date . now ( ) ;
201- let dots = 0 ;
202190
203- const intervalId = setInterval ( ( ) => {
204- dots = ( dots + 1 ) % 4 ;
205- const elapsed = Math . floor ( ( Date . now ( ) - startTime ) / 1000 ) ;
206- spinner . text = `Installing plugins with ${ packageManager } ${ '.' . repeat ( dots ) } (${ elapsed } s elapsed)` ;
207- } , 1000 ) ;
208-
209191 return new Promise < void > ( ( resolve , reject ) => {
210192 const { exec } = require ( 'child_process' ) ;
211193
@@ -237,26 +219,24 @@ const addAction = async (pluginsList: string[]) => {
237219 } ) ;
238220
239221 childProcess . on ( 'exit' , ( code : number ) => {
240- clearInterval ( intervalId ) ;
241-
242222 if ( code !== 0 ) {
243- spinner . stop ( ) ;
223+
244224 console . error ( `Installation failed with exit code: ${ code } ` ) ;
245225 console . error ( "Error output:" , stderrData || "No error output" ) ;
246226 reject ( new Error ( `Process exited with code ${ code } ` ) ) ;
247227 return ;
248228 }
249229
250230 const totalTime = ( ( Date . now ( ) - startTime ) / 1000 ) . toFixed ( 1 ) ;
251- spinner . stop ( ) ;
252- console . log ( `\nPlugins installed successfully in ${ totalTime } s!` ) ;
231+
232+ console . log ( `\n✓ All plugins installed successfully in ${ totalTime } s!` ) ;
253233 console . log ( `Installed plugins: ${ pluginsList . join ( ', ' ) } ` ) ;
254234 console . log ( chalk . cyan . bold ( "Happy coding with Godspeed! 🚀🎉\n" ) ) ;
255235 resolve ( ) ;
256236 } ) ;
257237 } ) ;
258238 } catch ( error : any ) {
259- spinner . stop ( ) ;
239+
260240 console . error ( "Error during installation:" , error . message ) ;
261241 throw error ;
262242 }
@@ -525,26 +505,16 @@ const add = program
525505 } ) ;
526506
527507const removeAction = async ( pluginsList : string [ ] ) => {
528- const spinner = ora ( {
529- text : "Uninstalling plugins... " ,
530- spinner : {
531- frames : [ "🌍 " , "🌎 " , "🌏 " , "🌐 " , "🌑 " , "🌒 " , "🌓 " , "🌔 " ] ,
532- interval : 180 ,
533- } ,
534- } ) ;
535508 async function uninstallPlugin ( pluginsList : string [ ] ) {
536509 try {
537- spinner . start ( ) ;
538-
510+ console . log ( "Uninstalling plugins..." ) ;
511+
539512 const child = spawnSync (
540- "npm " ,
513+ "pnpm " ,
541514 [
542- "uninstall " ,
515+ "remove " ,
543516 ...pluginsList ,
544- "--quiet" ,
545- "--no-warnings" ,
546- "--silent" ,
547- "--progress=false" ,
517+ "--reporter=silent"
548518 ] ,
549519 {
550520 stdio : "inherit" ,
@@ -557,11 +527,11 @@ const removeAction = async (pluginsList: string[]) => {
557527 } ) ;
558528 } ) ;
559529
560- spinner . stop ( ) ;
530+
561531 console . log ( "\nPlugins uninstalled successfully!" ) ;
562532 console . log ( chalk . cyan . bold ( "Happy coding with Godspeed! 🚀🎉\n" ) ) ;
563533 } catch ( error : any ) {
564- spinner . stop ( ) ;
534+
565535 console . error ( "Error during installation:" , error . message ) ;
566536 }
567537 }
@@ -742,26 +712,16 @@ const update = program
742712 return ;
743713 }
744714
745- const spinner = ora ( {
746- text : "Updating plugins... " ,
747- spinner : {
748- frames : [ "🌍 " , "🌎 " , "🌏 " , "🌐 " , "🌑 " , "🌒 " , "🌓 " , "🌔 " ] ,
749- interval : 180 ,
750- } ,
751- } ) ;
752715 async function updatePlugin ( pluginsList : string [ ] ) {
753716 try {
754- spinner . start ( ) ;
755-
717+ console . log ( "Updating plugins..." ) ;
718+
756719 const child = spawnSync (
757- "npm " ,
720+ "pnpm " ,
758721 [
759722 "update" ,
760723 ...pluginsList ,
761- "--quiet" ,
762- "--no-warnings" ,
763- "--silent" ,
764- "--progress=false" ,
724+ "--reporter=silent"
765725 ] ,
766726 {
767727 stdio : "inherit" ,
@@ -774,11 +734,11 @@ const update = program
774734 } ) ;
775735 } ) ;
776736
777- spinner . stop ( ) ;
737+
778738 console . log ( "\nPlugins updated successfully!" ) ;
779739 console . log ( chalk . cyan . bold ( "Happy coding with Godspeed! 🚀🎉\n" ) ) ;
780740 } catch ( error : any ) {
781- spinner . stop ( ) ;
741+
782742 console . error ( "Error during updation:" , error . message ) ;
783743 }
784744 }
0 commit comments