From 3be47423b61b4ec179b96d9a8a66971f4e51964d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Mon, 26 Aug 2024 13:20:39 +0100 Subject: [PATCH 1/2] chore(npm): update dependencies --- package-lock.json | 70 +++++++++---------- package.json | 22 +++--- src/validators/TestValidator.ts | 15 ++++ .../unit/commands/MakeValidatorCommandTest.ts | 4 +- 4 files changed, 64 insertions(+), 47 deletions(-) create mode 100644 src/validators/TestValidator.ts diff --git a/package-lock.json b/package-lock.json index 7b69496..b81ecd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,25 +1,25 @@ { "name": "@athenna/validator", - "version": "4.8.0", + "version": "5.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/validator", - "version": "4.8.0", + "version": "5.0.0", "license": "MIT", "dependencies": { "@vinejs/vine": "^2.1.0" }, "devDependencies": { - "@athenna/artisan": "^4.45.0", - "@athenna/common": "^4.46.0", - "@athenna/config": "^4.27.0", - "@athenna/ioc": "^4.27.0", - "@athenna/logger": "^4.29.0", - "@athenna/test": "^4.30.0", - "@athenna/tsconfig": "^4.19.0", - "@athenna/view": "^4.33.0", + "@athenna/artisan": "^5.0.0", + "@athenna/common": "^5.0.0", + "@athenna/config": "^5.0.0", + "@athenna/ioc": "^5.0.0", + "@athenna/logger": "^5.0.0", + "@athenna/test": "^5.0.0", + "@athenna/tsconfig": "^5.0.0", + "@athenna/view": "^5.0.0", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", "commitizen": "^4.3.0", @@ -70,9 +70,9 @@ "license": "MIT" }, "node_modules/@athenna/artisan": { - "version": "4.45.0", - "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-4.45.0.tgz", - "integrity": "sha512-jHAE7NVL+Lf7xMuutBlntQQAuwrh0M0M4bx3eZZB3ftnAFGEQtJ4aZFPPc5uLQ9MY7q1GxKe7hR1XsYhHn6SXw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-5.0.0.tgz", + "integrity": "sha512-qR1viT6sr51cVuuXn9vPCxUDNFRJYiaFUhFEDxfvPQMGh+fLk/8bxJZdfOgr3gokmYSCo0X5p78VZ4nyay0HvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -82,7 +82,7 @@ "columnify": "^1.6.0", "commander": "^9.5.0", "figlet": "^1.7.0", - "inquirer": "^9.2.22", + "inquirer": "^9.3.6", "log-update": "^5.0.1", "ora": "^6.3.1" }, @@ -91,9 +91,9 @@ } }, "node_modules/@athenna/common": { - "version": "4.46.0", - "resolved": "https://registry.npmjs.org/@athenna/common/-/common-4.46.0.tgz", - "integrity": "sha512-Cnx+Rx8OW5MRKaNcBwBvpSlF2uguycDvzUerYlKl6piHf7FOOiQ0it443uozVvaBNWBYuhAv4fYw1xM2HpyFEA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@athenna/common/-/common-5.0.0.tgz", + "integrity": "sha512-gUbwCJraEw06CNdNYV6Nb0jIq/OYpXbbTNdYZ1yj62y7+s/A4q3Y05P7BzTxhNhIraP6117O7Vi2UoYY45ilwQ==", "dev": true, "license": "MIT", "dependencies": { @@ -129,9 +129,9 @@ } }, "node_modules/@athenna/config": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@athenna/config/-/config-4.27.0.tgz", - "integrity": "sha512-Y9UkjvOrETW3Nr6bfPtKEoU2pka4BOCZ+0VkKgRyNkLauMJ5iqD8DDiDLNA9+6BzIZuU683Ozx2cmwgUGH5hAg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@athenna/config/-/config-5.0.0.tgz", + "integrity": "sha512-PZE8u7uzH+JKXQhNzALV0mtfPEzpXLWkR/77wPjqV5j1l3Giu1opw4Q+mB9NIVtsiy16FRt58z+BDyXH9ajw1g==", "dev": true, "license": "MIT", "dependencies": { @@ -144,9 +144,9 @@ } }, "node_modules/@athenna/ioc": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-4.27.0.tgz", - "integrity": "sha512-8rVYoUaBpDeaaHVJJmC+IZ/2nzWqHPSlfvt7/X7FLrxB00n0TlLkI/8rlJtuH6O8v5wRBphn8D0kgi/jkkx9qw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-5.0.0.tgz", + "integrity": "sha512-Czxc+1vyIpkx9fcTQQeKYCkNDjc5+ljKYC7UkNgFQJszQCfZjuUU+I+Y6goyWFvZZ0IdAGi67/bc9wlCP+c1Wg==", "dev": true, "license": "MIT", "dependencies": { @@ -157,9 +157,9 @@ } }, "node_modules/@athenna/logger": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-4.29.0.tgz", - "integrity": "sha512-k8VdDs8XDKH9v6AA59j4bEnWnw7ir5+pBFHEZlAqLorzaR23go1XC3CJmY9h1oZt6UNugxYlwzalX6cEGfis+g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-5.0.0.tgz", + "integrity": "sha512-blLKcIejErX0INAQa66QvhydVdF93GtqQkhz0JnuKjRhP5MAKgTqFst8vIrvGGmCiZ33MXUSn9yaPX+H3cEHxA==", "dev": true, "license": "MIT", "dependencies": { @@ -172,9 +172,9 @@ } }, "node_modules/@athenna/test": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@athenna/test/-/test-4.30.0.tgz", - "integrity": "sha512-PyvvDXUf3ZsHpBxhwqA5OBUv8JCTOFtAIxmBJZwYPJEMnf4RndlhkjdKfJ/1anE9yoazqm5iJ4G4IvAp4dZF3g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@athenna/test/-/test-5.0.0.tgz", + "integrity": "sha512-+mrFFc/EapTrz7T3Inobo/2NKGsF1IIquZTBElQubvchoTk7kJvZcPqYOLqqNn7Ha8zpQAthUo/GouUSmDEaZw==", "dev": true, "license": "MIT", "dependencies": { @@ -189,9 +189,9 @@ } }, "node_modules/@athenna/tsconfig": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/@athenna/tsconfig/-/tsconfig-4.19.0.tgz", - "integrity": "sha512-BpbbnXyMXDHS2DMCUDHWOjFYvzHOe3CJQM+OmQ7MFTS8UXIBaavDd0160aoLCrJLk5IPuCytO1VastQ+h2xRUg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@athenna/tsconfig/-/tsconfig-5.0.0.tgz", + "integrity": "sha512-GolYan7ILYA5/GDVriEAbz6E100epGh68Gy1ZbPven4VrfrBsf3Zqfl3qsjcqJvks5shEFko8N/xL4sGO2qMjA==", "dev": true, "license": "MIT", "dependencies": { @@ -205,9 +205,9 @@ } }, "node_modules/@athenna/view": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@athenna/view/-/view-4.33.0.tgz", - "integrity": "sha512-inlk39UQT0scyfRboM7thw07LLxG5n/I2I1wupBQZ7UVDBsWiO14riEM9GfNA4L0KCcL96rO9Ru0fjXqLHUIAA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@athenna/view/-/view-5.0.0.tgz", + "integrity": "sha512-B5e7+RKa5vN1K0ufMDn/o1Qz28m9Uw/dMTfkpp0Qm4P5chqCtbxm3+njKGdHcVTmR97qOv+5JlK1kYvbA5hNGQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 1a23bf7..faf98cf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@athenna/validator", - "version": "4.8.0", - "description": "Template for new projects.", + "version": "5.0.0", + "description": "The Athenna validation solution. Built on top of VineJS.", "license": "MIT", "author": "João Lenon ", "bugs": "https://github.com/AthennaIO/Validator/issues", @@ -9,6 +9,8 @@ "homepage": "https://github.com/AthennaIO/Validator#readme", "keywords": [ "esm", + "vinejs", + "validator", "athenna" ], "engines": { @@ -55,14 +57,14 @@ "@vinejs/vine": "^2.1.0" }, "devDependencies": { - "@athenna/artisan": "^4.45.0", - "@athenna/common": "^4.46.0", - "@athenna/config": "^4.27.0", - "@athenna/ioc": "^4.27.0", - "@athenna/logger": "^4.29.0", - "@athenna/test": "^4.30.0", - "@athenna/tsconfig": "^4.19.0", - "@athenna/view": "^4.33.0", + "@athenna/artisan": "^5.0.0", + "@athenna/common": "^5.0.0", + "@athenna/config": "^5.0.0", + "@athenna/ioc": "^5.0.0", + "@athenna/logger": "^5.0.0", + "@athenna/test": "^5.0.0", + "@athenna/tsconfig": "^5.0.0", + "@athenna/view": "^5.0.0", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", "commitizen": "^4.3.0", diff --git a/src/validators/TestValidator.ts b/src/validators/TestValidator.ts new file mode 100644 index 0000000..be27e42 --- /dev/null +++ b/src/validators/TestValidator.ts @@ -0,0 +1,15 @@ +import type { Context } from '@athenna/http' +import { Validator, BaseValidator } from '@athenna/validator' + +@Validator() +export class TestValidator extends BaseValidator { + public schema = this.validator.object({ + name: this.validator.string() + }) + + public async handle({ request }: Context) { + const data = request.body + + await this.validate(data) + } +} \ No newline at end of file diff --git a/tests/unit/commands/MakeValidatorCommandTest.ts b/tests/unit/commands/MakeValidatorCommandTest.ts index 21f8f7e..1462786 100644 --- a/tests/unit/commands/MakeValidatorCommandTest.ts +++ b/tests/unit/commands/MakeValidatorCommandTest.ts @@ -19,12 +19,12 @@ export default class MakeValidatorCommandTest extends BaseCommandTest { output.assertSucceeded() output.assertLogged('[ MAKING VALIDATOR ]') output.assertLogged('[ success ] Validator "TestValidator" successfully created.') - output.assertLogged('[ success ] Athenna RC updated: [ validators += "#app/validators/TestValidator" ]') + output.assertLogged('[ success ] Athenna RC updated: [ validators += "#src/validators/TestValidator" ]') const { athenna } = await new File(Path.pwd('package.json')).getContentAsJson() assert.isTrue(await File.exists(Path.validators('TestValidator.ts'))) - assert.containsSubset(athenna.validators, ['#app/validators/TestValidator']) + assert.containsSubset(athenna.validators, ['#src/validators/TestValidator']) } @Test() From 7214bac2ab72b4c9d008b62f2cb01d27205b84a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Mon, 26 Aug 2024 13:20:51 +0100 Subject: [PATCH 2/2] chore(npm): update dependencies --- src/validators/TestValidator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validators/TestValidator.ts b/src/validators/TestValidator.ts index be27e42..f0f1558 100644 --- a/src/validators/TestValidator.ts +++ b/src/validators/TestValidator.ts @@ -12,4 +12,4 @@ export class TestValidator extends BaseValidator { await this.validate(data) } -} \ No newline at end of file +}