Skip to content

Commit

Permalink
refactor: Update @secjs/logger
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Oct 31, 2021
1 parent b4b29f7 commit 4e8daaf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 60 deletions.
21 changes: 11 additions & 10 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ const command = new Command()

const packageJson = require('./package.json')

command.version(packageJson.version)
console.log(chalk.green(figlet.textSync('Templating CLI')))

console.log('\n')

console.log(chalk.green(`🆚 Version: ${packageJson.version}`))
console.log(chalk.green(`👤 Maintainer: ${packageJson.author}`))

console.log('\n')
command.version(packageJson.version, '-v, --version')

command
.command('generate [path]')
Expand All @@ -43,10 +35,19 @@ command

await templating.generate()

logger.log(`✅ All files generated inside -> ${dirname(path)}`)
logger.success(`✅ All files generated inside -> ${dirname(path)}`)
} catch (error) {
logger.error(`❌ Something went wrong: ${error.toString()}`)
}
})

command.parse(process.argv)

console.log(chalk.green(figlet.textSync('Templating CLI')))

console.log('\n')

console.log(chalk.green(`🆚 Version: ${packageJson.version}`))
console.log(chalk.green(`👤 Maintainer: ${packageJson.author}`))

console.log('\n')
58 changes: 13 additions & 45 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jlenon7/templating",
"version": "1.0.7",
"version": "1.0.8",
"description": "",
"license": "MIT",
"author": "João Lenon",
Expand Down Expand Up @@ -144,8 +144,7 @@
"index.d.ts"
],
"dependencies": {
"@secjs/env": "1.1.8",
"@secjs/logger": "1.1.4",
"@secjs/logger": "1.1.7",
"@secjs/contracts": "1.1.6",
"@secjs/exceptions": "1.0.3",
"@secjs/utils": "1.3.8",
Expand Down
4 changes: 2 additions & 2 deletions src/Templating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Templating {
for await (const file of getFiles(this.templatesPath)) {
const fileBase = parse(file).base

this.logger.log(`🔍 Template found: ${fileBase}`)
this.logger.success(`🔍 Template found: ${fileBase}`)

this.templates.set(fileBase, (await readFile(file)).toString())
}
Expand Down Expand Up @@ -78,7 +78,7 @@ export class Templating {
const promises = []

this.templates.forEach((template, templateKey) => {
this.logger.log(`🧬 Generating file from ${templateKey} template`)
this.logger.success(`🧬 Generating file from ${templateKey} template`)

promises.push(
writeFile(`${dirname(this.templatesPath)}/${templateKey}`, template),
Expand Down

0 comments on commit 4e8daaf

Please sign in to comment.