Skip to content

Commit

Permalink
feat: update logger and utils
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Apr 7, 2022
1 parent fc309bf commit 380c9e5
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 218 deletions.
239 changes: 26 additions & 213 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
Expand Up @@ -173,8 +173,8 @@
}
},
"dependencies": {
"@athenna/logger": "1.1.1",
"@secjs/utils": "1.8.0",
"@athenna/logger": "1.1.2",
"@secjs/utils": "1.8.2",
"chalk": "4.1.1",
"chalk-rainbow": "1.0.0",
"cli-table": "0.3.11",
Expand Down
3 changes: 3 additions & 0 deletions src/Cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Command } from 'commander'
import { New } from './Commands/New'
import { Make } from './Commands/Make'
import { version } from '../package.json'
import { Config, Path } from '@secjs/utils'

export class Cli {
private clientFolder: string
Expand All @@ -37,6 +38,8 @@ export class Cli {
}

async main() {
await new Config().safeLoad(Path.config())

const newCommand = new New(this.clientFolder)
const makeCommand = new Make(this.clientFolder)

Expand Down
3 changes: 2 additions & 1 deletion src/Utils/runCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

import ora from 'ora'
import { promisify } from 'util'
import { exec as ChildProcessExec } from 'child_process'
import { NodeExecException } from '../Exceptions/NodeExecException'

const exec = promisify(require('child_process').exec)
const exec = promisify(ChildProcessExec)

export async function runCommand(command: string, log?: string) {
const spinner = ora(log)
Expand Down
6 changes: 5 additions & 1 deletion tests/Unit/Commands/MakeTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
*/

import { existsSync } from 'fs'
import { Folder, Path } from '@secjs/utils'
import { Config, Folder, Path } from '@secjs/utils'
import { Make } from '../../../src/Commands/Make'

describe('\n MakeTest', () => {
beforeAll(async () => {
await new Config().safeLoad(Path.config('logging'))
})

it('should be able to create a controller file', async () => {
await new Make(Path.storage()).controller('TestControllers', { extension: 'ts' })

Expand Down
6 changes: 5 additions & 1 deletion tests/Unit/Commands/NewTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
*/

import { existsSync } from 'fs'
import { Folder, Path } from '@secjs/utils'
import { Config, Folder, Path } from '@secjs/utils'
import { New } from '../../../src/Commands/New'

describe('\n NewTest', () => {
beforeAll(async () => {
await new Config().safeLoad(Path.config('logging'))
})

it('should be able to create a new http project', async () => {
await new New(Path.pwd()).project('test', { type: 'http' })

Expand Down

0 comments on commit 380c9e5

Please sign in to comment.