diff --git a/package-lock.json b/package-lock.json index 05fbfbc..d75922f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/artisan", - "version": "4.17.0", + "version": "4.18.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/artisan", - "version": "4.17.0", + "version": "4.18.0", "license": "MIT", "dependencies": { "chalk-rainbow": "^1.0.0", diff --git a/package.json b/package.json index cf8e049..ca0f0a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/artisan", - "version": "4.17.0", + "version": "4.18.0", "description": "The Athenna CLI application. Built on top of commander and inspired in @adonisjs/ace.", "license": "MIT", "author": "João Lenon ", diff --git a/src/commands/ConfigureCommand.ts b/src/commands/ConfigureCommand.ts index e9ae0c0..f1a78be 100644 --- a/src/commands/ConfigureCommand.ts +++ b/src/commands/ConfigureCommand.ts @@ -16,7 +16,7 @@ export class ConfigureCommand extends BaseCommand { @Argument({ signature: 'libraries...', description: - 'One or more libraries to be configured. (Example: artisan configure @athenna/mail @athenna/database)' + 'One or more libraries to be configured. (Example: node artisan configure @athenna/mail @athenna/database)' }) public libraries: string[] @@ -35,17 +35,27 @@ export class ConfigureCommand extends BaseCommand { } private async configure(library: string) { + this.logger.simple(`({bold,green} [ CONFIGURING ${library} ])\n`) + const isFile = this.isFile(library) const isInstalled = await this.isInstalled(library) if (!isFile && !isInstalled) { - await this.logger.promiseSpinner(Exec.command(`npm install ${library}`), { - text: `Installing ${Color.chalk.magenta(library)} library`, - failText: `Failed to install ${Color.chalk.magenta(library)} library`, - successText: `Library ${Color.chalk.magenta( - library - )} successfully installed` - }) + this.logger.warn( + `Library ({dim,yellow} ${library}) is not installed, is recommended to run ({dim,yellow} npm install ${library}) because installing libraries from child process usually don't set the library in your ({dim,yellow} package.json) file.` + ) + await this.logger.promiseSpinner( + Exec.command(`npm install ${library}`, { cwd: Path.pwd() }), + { + text: `Installing ${Color.chalk.dim.magenta(library)} library`, + failText: `Failed to install ${Color.chalk.dim.magenta( + library + )} library`, + successText: `Library ${Color.chalk.dim.magenta( + library + )} successfully installed` + } + ) } const path = isFile