Skip to content

Commit

Permalink
Merge pull request #69 from AthennaIO/develop
Browse files Browse the repository at this point in the history
chore(npm): update dependencies
  • Loading branch information
jlenon7 authored Jul 7, 2022
2 parents 3f6c12a + 55413a7 commit 31a4c20
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 112 deletions.
136 changes: 68 additions & 68 deletions package-lock.json

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

15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/core",
"version": "1.6.6",
"version": "1.6.7",
"description": "The plug and play Node.js framework.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down Expand Up @@ -37,12 +37,12 @@
"#tests/*": "./tests/*.js"
},
"dependencies": {
"@athenna/artisan": "1.2.7",
"@athenna/config": "1.1.1",
"@athenna/http": "1.4.5",
"@athenna/ioc": "1.2.0",
"@athenna/logger": "1.2.5",
"@secjs/utils": "1.9.4"
"@athenna/artisan": "1.3.0",
"@athenna/config": "1.1.3",
"@athenna/http": "1.4.7",
"@athenna/ioc": "1.2.3",
"@athenna/logger": "1.2.8",
"@secjs/utils": "1.9.7"
},
"devDependencies": {
"@japa/assert": "1.3.4",
Expand Down Expand Up @@ -129,6 +129,7 @@
"node": true
},
"globals": {
"ioc": true,
"Env": true,
"Config": true
},
Expand Down
21 changes: 5 additions & 16 deletions src/Providers/ServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* file that was distributed with this source code.
*/

import { Exec, Folder, Path } from '@secjs/utils'
import { Module, Path } from '@secjs/utils'
import { ServiceProvider as IocServiceProvider } from '@athenna/ioc'

export class ServiceProvider extends IocServiceProvider {
Expand All @@ -18,23 +18,12 @@ export class ServiceProvider extends IocServiceProvider {
*/
async boot() {
const path = Path.services()
const subAlias = 'App/Services'

if (!(await Folder.exists(path))) {
return
}
const services = await Module.getAllFromWithAlias(path, subAlias)

const services = (await new Folder(path).load()).getFilesByPattern(
'*/**/*.js',
)

const promises = services.map(({ href }) => {
return Exec.getModule(import(href)).then(Service => {
const alias = `App/Services/${Service.name}`

this.container.singleton(alias, Service)
})
services.forEach(({ alias, module }) => {
this.container.singleton(alias, module, true)
})

await Promise.all(promises)
}
}
Loading

0 comments on commit 31a4c20

Please sign in to comment.