Skip to content

Commit

Permalink
Merge pull request #187 from AthennaIO/develop
Browse files Browse the repository at this point in the history
chore(npm): update dependencies
  • Loading branch information
jlenon7 authored Feb 25, 2024
2 parents e4f3674 + fc6222c commit 5395fb2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
12 changes: 6 additions & 6 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
@@ -1,6 +1,6 @@
{
"name": "@athenna/artisan",
"version": "4.35.0",
"version": "4.36.0",
"description": "The Athenna CLI application. Built on top of commander and inspired in @adonisjs/ace.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down Expand Up @@ -82,7 +82,7 @@
"@athenna/logger": "^4.17.0",
"@athenna/test": "^4.22.0",
"@athenna/tsconfig": "^4.12.0",
"@athenna/view": "^4.14.0",
"@athenna/view": "^4.17.0",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"commitizen": "^4.2.6",
Expand Down
6 changes: 1 addition & 5 deletions src/helpers/command/Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,7 @@ export class Generator {
templatePath = resolve(templatePath)
}

const fileTemplate = new File(templatePath)

View.createTemplate(this._template, await fileTemplate.getContentAsString())

const content = await View.render(this._template, this._properties)
const content = await View.renderRawByPath(templatePath, this._properties)

return file.setContent(content)
}
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/helpers/command/GeneratorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default class GeneratorTest {

@BeforeEach()
public async beforeEach() {
new ViewProvider().register()
await Config.load(Path.fixtures('config/rc.ts'))
new ViewProvider().register()
this.generator = new Generator()
}

Expand Down Expand Up @@ -75,7 +75,7 @@ export default class GeneratorTest {
public async shouldBeAbleToGenerateFilesFromTemplatesThatAreAlreadyRegisteredInView({ assert }: Context) {
const path = Path.fixtures('tmp/GeneratorTestCommand.ts')

View.createTemplate('command', await new File('../../../../templates/command.edge').getContentAsString())
View.createTemplateByPath('command', 'templates/command.edge')

assert.isTrue(View.hasTemplate('command'))

Expand All @@ -94,7 +94,7 @@ export default class GeneratorTest {
public async shouldBeAbleToGenerateFilesFromTemplatesSettingFileNameDestinationAndExt({ assert }: Context) {
const path = Path.fixtures('tmp/GeneratorTestCommand.ts')

View.createTemplate('command', await new File('../../../../templates/command.edge').getContentAsString())
View.createTemplateByPath('command', 'templates/command.edge')

assert.isTrue(View.hasTemplate('command'))

Expand Down

0 comments on commit 5395fb2

Please sign in to comment.