From fc6222ca3dbd4f7ba4ac2ce3d07eaa27c48856c8 Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Sun, 25 Feb 2024 20:33:35 +0000 Subject: [PATCH] chore(npm): update dependencies --- package-lock.json | 12 ++++++------ package.json | 4 ++-- src/helpers/command/Generator.ts | 6 +----- tests/unit/helpers/command/GeneratorTest.ts | 6 +++--- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4aba9c..b32ca26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/artisan", - "version": "4.35.0", + "version": "4.36.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/artisan", - "version": "4.35.0", + "version": "4.36.0", "license": "MIT", "dependencies": { "chalk-rainbow": "^1.0.0", @@ -26,7 +26,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", @@ -227,9 +227,9 @@ } }, "node_modules/@athenna/view": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@athenna/view/-/view-4.14.0.tgz", - "integrity": "sha512-f90NZxZIeb1HhcYvXRrxpPDEM/2+glhmApTsCTvir/ykQ8/F2nEQ8LzYKuGgqqph9EACRn0N5jceXZ31zES8+A==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@athenna/view/-/view-4.17.0.tgz", + "integrity": "sha512-4nYGn/mKOzL2tFpcqLji6IUOdNqdBNCX2SO22Hqd6othMEP3QM53azmy1aD+kzvXUsOMCJ5ZOQLFmmqWxEbKIQ==", "dev": true, "dependencies": { "edge.js": "^6.0.1" diff --git a/package.json b/package.json index ee3fc1d..f1256fd 100644 --- a/package.json +++ b/package.json @@ -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 ", @@ -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", diff --git a/src/helpers/command/Generator.ts b/src/helpers/command/Generator.ts index 885ed87..9592789 100644 --- a/src/helpers/command/Generator.ts +++ b/src/helpers/command/Generator.ts @@ -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) } diff --git a/tests/unit/helpers/command/GeneratorTest.ts b/tests/unit/helpers/command/GeneratorTest.ts index 549247a..2d2b656 100644 --- a/tests/unit/helpers/command/GeneratorTest.ts +++ b/tests/unit/helpers/command/GeneratorTest.ts @@ -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() } @@ -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')) @@ -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'))