Skip to content

Commit

Permalink
Merge pull request #192 from AthennaIO/develop
Browse files Browse the repository at this point in the history
feat(npm): reload rc file after npm commands
  • Loading branch information
jlenon7 authored Mar 4, 2024
2 parents 66af54a + e331078 commit 0107878
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/artisan",
"version": "4.38.0",
"version": "4.39.0",
"description": "The Athenna CLI application. Built on top of commander and inspired in @adonisjs/ace.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down Expand Up @@ -77,7 +77,7 @@
},
"devDependencies": {
"@athenna/common": "^4.35.0",
"@athenna/config": "^4.18.0",
"@athenna/config": "^4.19.0",
"@athenna/ioc": "^4.18.0",
"@athenna/logger": "^4.18.0",
"@athenna/test": "^4.22.0",
Expand Down
21 changes: 19 additions & 2 deletions src/helpers/command/Npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
type LinkPackageOptions,
type InstallPackageOptions
} from '@athenna/common'
import { Rc } from '@athenna/config'

export class Npm {
/**
Expand All @@ -34,13 +35,29 @@ export class Npm {
libraries: string | string[],
options?: LinkPackageOptions
) {
return Exec.link(libraries, options)
await Exec.link(libraries, options).then(() => Rc.reload())
}

/**
* Run `npm install` command inside a child process.
*
* @example
* ```ts
* await this.npm.install('@athenna/common')
* ```
*
* By default the registry used will be `npm`, but you
* can change it by adding your registry in options:
*
* @example
* ```ts
* await this.npm.install('@athenna/common', { registry: 'yarn' })
* ```
*/
public async install(
libraries: string | string[],
options?: InstallPackageOptions
) {
return Exec.install(libraries, options)
await Exec.install(libraries, options).then(() => Rc.reload())
}
}

0 comments on commit 0107878

Please sign in to comment.