Skip to content

Commit

Permalink
Merge pull request #45 from AthennaIO/develop
Browse files Browse the repository at this point in the history
chore(npm): update dependencies
  • Loading branch information
jlenon7 authored Jan 16, 2023
2 parents 069568f + 8ef54a4 commit 77bd0fa
Show file tree
Hide file tree
Showing 21 changed files with 623 additions and 142 deletions.
9 changes: 9 additions & 0 deletions app/Console/Commands/Install/DatabaseCommand.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { File, Path } from '@athenna/common'
import { Command, FilePropertiesHelper } from '@athenna/artisan'
import { NotFoundDatabaseException } from '#app/Exceptions/NotFoundDatabaseException'
Expand Down
9 changes: 9 additions & 0 deletions app/Console/Commands/Install/MailCommand.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { File, Path } from '@athenna/common'
import { Command, FilePropertiesHelper } from '@athenna/artisan'

Expand Down
9 changes: 9 additions & 0 deletions app/Console/Commands/NewCommand.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import chalk from 'chalk'

import { basename, isAbsolute, sep } from 'node:path'
Expand Down
9 changes: 9 additions & 0 deletions app/Console/Exceptions/Handler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { ConsoleExceptionHandler } from '@athenna/artisan'

/*
Expand Down
9 changes: 9 additions & 0 deletions app/Console/Kernel.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { CoreLoader } from '@athenna/core'
import { Folder, Path } from '@athenna/common'
import { ArtisanLoader, ConsoleKernel } from '@athenna/artisan'
Expand Down
9 changes: 9 additions & 0 deletions app/Exceptions/NotEmptyFolderException.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Exception } from '@athenna/common'

/*
Expand Down
9 changes: 9 additions & 0 deletions app/Exceptions/NotFoundDatabaseException.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Exception } from '@athenna/common'

/*
Expand Down
9 changes: 9 additions & 0 deletions app/Exceptions/NotFoundProjectTypeException.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Exception } from '@athenna/common'

/*
Expand Down
22 changes: 16 additions & 6 deletions artisan.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
#!/usr/bin/env node

/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Ignite } from '@athenna/core'
import { install } from 'source-map-support'

async function main() {
install()

process.env.BOOT_LOGS = 'false'
process.env.IS_ARTISAN = 'true'
process.env.CALL_PATH = process.cwd()

const application = await new Ignite().fire()
const application = await new Ignite().fire(import.meta.url, {
bootLogs: false,
})
const artisan = await application.bootArtisan()

await artisan.main('Artisan')

if (!Config.get('app.protectedCommands').includes(process.argv[2])) {
process.exit()
}
}

main().catch()
18 changes: 12 additions & 6 deletions bootstrap/main.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#!/usr/bin/env node

/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Ignite } from '@athenna/core'
import { install } from 'source-map-support'

async function main() {
install()

process.env.BOOT_LOGS = 'false'
process.env.IS_ARTISAN = 'false'
process.env.NODE_ENV = 'production'
process.env.CALL_PATH = process.cwd()

const application = await new Ignite().fire()
const application = await new Ignite().fire(import.meta.url, {
bootLogs: false,
})
const artisan = await application.bootArtisan()

await artisan.main('Athenna')
Expand Down
44 changes: 41 additions & 3 deletions config/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { File } from '@athenna/common'
import { ProviderHelper } from '@athenna/core'

Expand Down Expand Up @@ -129,8 +138,6 @@ export default {

gracefulShutdown: {
SIGINT: async () => {
await ProviderHelper.shutdownAll(false)

process.exit()
},
SIGTERM: async signal => {
Expand All @@ -139,6 +146,38 @@ export default {
process.kill(process.pid, signal)
},
},

/*
|--------------------------------------------------------------------------
| Trace Artisan commands
|--------------------------------------------------------------------------
|
| Trace artisan commands. If this value is true, Athenna will use the
| rTracer library to generate a unique uuid v1 for each command executed
| by Artisan.
|
*/

traceArtisan: false,

/*
|--------------------------------------------------------------------------
| Protected Artisan commands
|--------------------------------------------------------------------------
|
| Protected commands are usually commands that will let the Node.js process
| running for some reason.
|
| For example: "node artisan repl"
|
| This command will bootstrap a REPL session. The Node.js process needs to
| stay running, so we cannot force shutdown the application after this command
| is executed.
|
*/

protectedCommands: ['repl', 'test', 'serve'],

/*
|--------------------------------------------------------------------------
| Application providers
Expand All @@ -156,7 +195,6 @@ export default {
import('@athenna/core/providers/RepositoryProvider'),
import('@athenna/artisan/providers/ArtisanProvider'),
import('@athenna/artisan/providers/TemplateProvider'),
import('#providers/AppServiceProvider'),
],

/*
Expand Down
17 changes: 17 additions & 0 deletions config/logging.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/cli
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Path } from '@athenna/common'

export default {
Expand Down Expand Up @@ -40,19 +49,22 @@ export default {

formatter: 'simple',
},

console: {
driver: 'console',
level: 'trace',

formatter: 'cli',
},

exception: {
driver: 'console',
level: 'trace',
streamType: 'stderr',

formatter: 'none',
},

request: {
driver: 'console',
level: 'trace',
Expand All @@ -62,9 +74,11 @@ export default {
asJson: false,
},
},

discard: {
driver: 'null',
},

file: {
driver: 'file',
level: 'trace',
Expand All @@ -73,6 +87,7 @@ export default {
formatter: 'simple',
formatterConfig: {},
},

slack: {
driver: 'slack',
level: 'fatal',
Expand All @@ -81,6 +96,7 @@ export default {
formatter: 'message',
formatterConfig: {},
},

discord: {
driver: 'discord',
level: 'fatal',
Expand All @@ -90,6 +106,7 @@ export default {
formatter: 'message',
formatterConfig: {},
},

telegram: {
driver: 'telegram',
level: 'fatal',
Expand Down
Loading

0 comments on commit 77bd0fa

Please sign in to comment.