Skip to content

Commit

Permalink
chore(npm): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Jan 15, 2024
1 parent 2eaa34d commit 733846a
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 212 deletions.
20 changes: 10 additions & 10 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/core",
"version": "4.23.0",
"version": "4.24.0",
"description": "The plug and play Node.js framework.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down Expand Up @@ -76,10 +76,10 @@
"semver": "^7.5.4"
},
"devDependencies": {
"@athenna/artisan": "^4.28.0",
"@athenna/artisan": "^4.29.0",
"@athenna/common": "^4.27.0",
"@athenna/config": "^4.12.0",
"@athenna/http": "^4.17.0",
"@athenna/http": "^4.18.0",
"@athenna/ioc": "^4.13.0",
"@athenna/logger": "^4.14.0",
"@athenna/test": "^4.18.0",
Expand Down
31 changes: 6 additions & 25 deletions src/commands/MakeExceptionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import { Path } from '@athenna/common'
import { sep, resolve, isAbsolute } from 'node:path'
import { BaseCommand, Argument } from '@athenna/artisan'

export class MakeExceptionCommand extends BaseCommand {
Expand All @@ -28,8 +27,13 @@ export class MakeExceptionCommand extends BaseCommand {
public async handle(): Promise<void> {
this.logger.simple('({bold,green} [ MAKING EXCEPTION ])\n')

const destination = Config.get(
'rc.commands.make:exception.destination',
Path.exceptions()
)
const file = await this.generator
.path(this.getFilePath())
.fileName(this.name)
.destination(destination)
.template('exception')
.setNameProperties(true)
.make()
Expand All @@ -38,27 +42,4 @@ export class MakeExceptionCommand extends BaseCommand {
`Exception ({yellow} "${file.name}") successfully created.`
)
}

/**
* Get the file path where it will be generated.
*/
private getFilePath(): string {
return this.getDestinationPath().concat(`${sep}${this.name}.${Path.ext()}`)
}

/**
* Get the destination path for the file that will be generated.
*/
private getDestinationPath(): string {
let destination = Config.get(
'rc.commands.make:exception.destination',
Path.exceptions()
)

if (!isAbsolute(destination)) {
destination = resolve(Path.pwd(), destination)
}

return destination
}
}
31 changes: 6 additions & 25 deletions src/commands/MakeFacadeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import { Path } from '@athenna/common'
import { sep, resolve, isAbsolute } from 'node:path'
import { BaseCommand, Argument } from '@athenna/artisan'

export class MakeFacadeCommand extends BaseCommand {
Expand All @@ -28,8 +27,13 @@ export class MakeFacadeCommand extends BaseCommand {
public async handle(): Promise<void> {
this.logger.simple('({bold,green} [ MAKING FACADE ])\n')

const destination = Config.get(
'rc.commands.make:facade.destination',
Path.facades()
)
const file = await this.generator
.path(this.getFilePath())
.fileName(this.name)
.destination(destination)
.template('facade')
.setNameProperties(true)
.make()
Expand All @@ -38,27 +42,4 @@ export class MakeFacadeCommand extends BaseCommand {
`Facade ({yellow} "${file.name}") successfully created.`
)
}

/**
* Get the file path where it will be generated.
*/
private getFilePath(): string {
return this.getDestinationPath().concat(`${sep}${this.name}.${Path.ext()}`)
}

/**
* Get the destination path for the file that will be generated.
*/
private getDestinationPath(): string {
let destination = Config.get(
'rc.commands.make:facade.destination',
Path.facades()
)

if (!isAbsolute(destination)) {
destination = resolve(Path.pwd(), destination)
}

return destination
}
}
45 changes: 7 additions & 38 deletions src/commands/MakeProviderCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import { Path } from '@athenna/common'
import { sep, resolve, isAbsolute } from 'node:path'
import { BaseCommand, Argument } from '@athenna/artisan'

export class MakeProviderCommand extends BaseCommand {
Expand All @@ -28,8 +27,13 @@ export class MakeProviderCommand extends BaseCommand {
public async handle(): Promise<void> {
this.logger.simple('({bold,green} [ MAKING PROVIDER ])\n')

const destination = Config.get(
'rc.commands.make:provider.destination',
Path.providers()
)
const file = await this.generator
.path(this.getFilePath())
.fileName(this.name)
.destination(destination)
.template('provider')
.setNameProperties(true)
.make()
Expand All @@ -38,47 +42,12 @@ export class MakeProviderCommand extends BaseCommand {
`Provider ({yellow} "${file.name}") successfully created.`
)

const importPath = this.getImportPath(file.name)
const importPath = this.generator.getImportPath()

await this.rc.pushTo('providers', importPath).save()

this.logger.success(
`Athenna RC updated: ({dim,yellow} [ providers += "${importPath}" ])`
)
}

/**
* Get the file path where it will be generated.
*/
private getFilePath(): string {
return this.getDestinationPath().concat(`${sep}${this.name}.${Path.ext()}`)
}

/**
* Get the destination path for the file that will be generated.
*/
private getDestinationPath(): string {
let destination = Config.get(
'rc.commands.make:provider.destination',
Path.providers()
)

if (!isAbsolute(destination)) {
destination = resolve(Path.pwd(), destination)
}

return destination
}

/**
* Get the import path that should be registered in RC file.
*/
private getImportPath(fileName: string): string {
const destination = this.getDestinationPath()

return `${destination
.replace(Path.pwd(), '')
.replace(/\\/g, '/')
.replace('/', '#')}/${fileName}`
}
}
45 changes: 7 additions & 38 deletions src/commands/MakeServiceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import { Path } from '@athenna/common'
import { sep, resolve, isAbsolute } from 'node:path'
import { BaseCommand, Argument } from '@athenna/artisan'

export class MakeServiceCommand extends BaseCommand {
Expand All @@ -28,8 +27,13 @@ export class MakeServiceCommand extends BaseCommand {
public async handle(): Promise<void> {
this.logger.simple('({bold,green} [ MAKING SERVICE ])\n')

const destination = Config.get(
'rc.commands.make:service.destination',
Path.services()
)
const file = await this.generator
.path(this.getFilePath())
.fileName(this.name)
.destination(destination)
.template('service')
.setNameProperties(true)
.make()
Expand All @@ -38,47 +42,12 @@ export class MakeServiceCommand extends BaseCommand {
`Service ({yellow} "${file.name}") successfully created.`
)

const importPath = this.getImportPath(file.name)
const importPath = this.generator.getImportPath()

await this.rc.pushTo('services', importPath).save()

this.logger.success(
`Athenna RC updated: ({dim,yellow} [ services += "${importPath}" ])`
)
}

/**
* Get the file path where it will be generated.
*/
private getFilePath(): string {
return this.getDestinationPath().concat(`${sep}${this.name}.${Path.ext()}`)
}

/**
* Get the destination path for the file that will be generated.
*/
private getDestinationPath(): string {
let destination = Config.get(
'rc.commands.make:service.destination',
Path.services()
)

if (!isAbsolute(destination)) {
destination = resolve(Path.pwd(), destination)
}

return destination
}

/**
* Get the import path that should be registered in RC file.
*/
private getImportPath(fileName: string): string {
const destination = this.getDestinationPath()

return `${destination
.replace(Path.pwd(), '')
.replace(/\\/g, '/')
.replace('/', '#')}/${fileName}`
}
}
31 changes: 6 additions & 25 deletions src/commands/MakeTestCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import { Path } from '@athenna/common'
import { sep, resolve, isAbsolute } from 'node:path'
import { BaseCommand, Argument, Option } from '@athenna/artisan'

export class MakeTestCommand extends BaseCommand {
Expand Down Expand Up @@ -66,35 +65,17 @@ export class MakeTestCommand extends BaseCommand {
template = 'test-fn'
}

const destination = Config.get(
'rc.commands.make:test.destination',
this.isUnit ? Path.tests('unit') : Path.tests('e2e')
)
const file = await this.generator
.path(this.getFilePath())
.fileName(this.name)
.destination(destination)
.template(template)
.setNameProperties(true)
.make()

this.logger.success(`Test ({yellow} "${file.name}") successfully created.`)
}

/**
* Get the file path where it will be generated.
*/
private getFilePath(): string {
return this.getDestinationPath().concat(`${sep}${this.name}.${Path.ext()}`)
}

/**
* Get the destination path for the file that will be generated.
*/
private getDestinationPath(): string {
let destination = Config.get(
'rc.commands.make:test.destination',
this.isUnit ? Path.tests('unit') : Path.tests('e2e')
)

if (!isAbsolute(destination)) {
destination = resolve(Path.pwd(), destination)
}

return destination
}
}
8 changes: 1 addition & 7 deletions src/commands/ReplCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
*/

import { Module } from '@athenna/common'
import { BaseCommand, Option } from '@athenna/artisan'
import { BaseCommand } from '@athenna/artisan'

export class ReplCommand extends BaseCommand {
@Option({ isFromGlobal: true, signature: '--env <env>' })
public env: string

public static signature(): string {
return 'repl'
}
Expand All @@ -23,9 +20,6 @@ export class ReplCommand extends BaseCommand {
}

public async handle(): Promise<void> {
process.env.APP_ENV = this.env
process.env.NODE_ENV = this.env

const entrypoint = Config.get(
'rc.commands.repl.entrypoint',
Path.bootstrap(`repl.${Path.ext()}`)
Expand Down
Loading

0 comments on commit 733846a

Please sign in to comment.