diff --git a/package-lock.json b/package-lock.json index 8754978..1317ed8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,31 +1,30 @@ { "name": "@athenna/core", - "version": "3.6.0", + "version": "3.8.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@athenna/core", - "version": "3.6.0", + "version": "3.8.0", "license": "MIT", "dependencies": { "pretty-repl": "^3.1.1", "semver": "^7.3.8" }, "devDependencies": { - "@athenna/artisan": "^3.8.0", - "@athenna/common": "^3.5.1", - "@athenna/config": "^3.5.0", - "@athenna/http": "^3.9.0", - "@athenna/ioc": "^3.3.0", - "@athenna/logger": "^3.3.0", - "@athenna/test": "^3.5.1", - "@athenna/view": "^3.2.0", + "@athenna/artisan": "^3.9.0", + "@athenna/common": "^3.6.0", + "@athenna/config": "^3.6.0", + "@athenna/http": "^3.10.0", + "@athenna/ioc": "^3.4.0", + "@athenna/logger": "^3.4.0", + "@athenna/test": "^3.6.0", + "@athenna/view": "^3.3.0", "@swc/core": "^1.3.27", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", "c8": "^7.12.0", - "cls-rtracer": "^2.6.2", "commitizen": "^4.2.6", "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", @@ -72,9 +71,9 @@ "dev": true }, "node_modules/@athenna/artisan": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-3.8.0.tgz", - "integrity": "sha512-c/4FZ1vOfSBEJ/RCfPRZM7rmpSx/VycsCP/8zywK0H3FTISQQX9tId0b9fgXLVXB4g3q6u2NGDKZH6WQ/NO94g==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-3.9.0.tgz", + "integrity": "sha512-vlxIwXvOacOzOQNs337pUbPLGpUQ9Rb58yQtW0x+Ot7rxB2clX4J7GUD1YMFLCAv6N7qnyh2wxNoCumUdQCosQ==", "dev": true, "dependencies": { "chalk-rainbow": "^1.0.0", @@ -83,15 +82,15 @@ "columnify": "^1.6.0", "commander": "^9.5.0", "figlet": "^1.5.2", - "inquirer": "^9.1.4", + "inquirer": "^9.1.5", "log-update": "^5.0.1", - "ora": "^6.1.2" + "ora": "^6.2.0" } }, "node_modules/@athenna/artisan/node_modules/ansi-escapes": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.0.0.tgz", - "integrity": "sha512-IG23inYII3dWlU2EyiAiGj6Bwal5GzsgPMwjYGvc1HPE2dgbj4ZB5ToWBKSquKw74nB3TIuOwaI6/jSULzfgrw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.1.0.tgz", + "integrity": "sha512-bQyg9bzRntwR/8b89DOEhGwctcwCrbWW/TuqTQnpqpy5Fz3aovcOTj5i8NJV6AHc8OGNdMaqdxAWww8pz2kiKg==", "dev": true, "dependencies": { "type-fest": "^3.0.0" @@ -127,41 +126,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@athenna/artisan/node_modules/bl": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", - "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", - "dev": true, - "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/@athenna/artisan/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/@athenna/artisan/node_modules/cli-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", @@ -215,29 +179,29 @@ } }, "node_modules/@athenna/artisan/node_modules/inquirer": { - "version": "9.1.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.1.4.tgz", - "integrity": "sha512-9hiJxE5gkK/cM2d1mTEnuurGTAoHebbkX0BYl3h7iEg7FYfuNIom+nDfBCSWtvSnoSrWCeBxqqBZu26xdlJlXA==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.1.5.tgz", + "integrity": "sha512-3ygAIh8gcZavV9bj6MTdYddG2zPSYswP808fKS46NOwlF0zZljVpnLCHODDqItWJDbDpLb3aouAxGaJbkxoppA==", "dev": true, "dependencies": { "ansi-escapes": "^6.0.0", - "chalk": "^5.1.2", + "chalk": "^5.2.0", "cli-cursor": "^4.0.0", "cli-width": "^4.0.0", "external-editor": "^3.0.3", "figures": "^5.0.0", "lodash": "^4.17.21", - "mute-stream": "0.0.8", + "mute-stream": "1.0.0", "ora": "^6.1.2", "run-async": "^2.4.0", - "rxjs": "^7.5.7", + "rxjs": "^7.8.0", "string-width": "^5.1.2", "strip-ansi": "^7.0.1", "through": "^2.3.6", - "wrap-ansi": "^8.0.1" + "wrap-ansi": "^8.1.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.18.0" } }, "node_modules/@athenna/artisan/node_modules/is-interactive": { @@ -326,19 +290,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@athenna/artisan/node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@athenna/artisan/node_modules/ora": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", - "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.0.tgz", + "integrity": "sha512-1/D8uRFY0ay2kgBpmAwmSA404w4OoPVhHMqRqtjvrcK/dnzcEZxMJ+V4DUbyICu8IIVRclHcOf5wlD1tMY4GUQ==", "dev": true, "dependencies": { - "bl": "^5.0.0", "chalk": "^5.0.0", "cli-cursor": "^4.0.0", "cli-spinners": "^2.6.1", "is-interactive": "^2.0.0", "is-unicode-supported": "^1.1.0", "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", "strip-ansi": "^7.0.1", "wcwidth": "^1.0.1" }, @@ -398,9 +371,9 @@ } }, "node_modules/@athenna/artisan/node_modules/type-fest": { - "version": "3.5.7", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.5.7.tgz", - "integrity": "sha512-6J4bYzb4sdkcLBty4XW7F18VPI66M4boXNE+CY40532oq2OJe6AVMB5NmjOp6skt/jw5mRjz/hLRpuglz0U+FA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.8.0.tgz", + "integrity": "sha512-FVNSzGQz9Th+/9R6Lvv7WIAkstylfHN2/JYxkyhhmKFYh9At2DST8t6L6Lref9eYO8PXFTfG9Sg1Agg0K3vq3Q==", "dev": true, "engines": { "node": ">=14.16" @@ -427,9 +400,9 @@ } }, "node_modules/@athenna/common": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@athenna/common/-/common-3.5.1.tgz", - "integrity": "sha512-4WoH5Wx/LfMeqzlBWE3UNeH2A1tnZglW+UnA/B21nrgu09exyQLOMZuVzp7+WWiz9UQFFXYK3+lZENQvesSM1A==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@athenna/common/-/common-3.6.0.tgz", + "integrity": "sha512-5/KAJ2wE1PVyp/lqV+Pf+gXnzrGyncl4jdL/2fcoq8xOx1etVwh9FtekxhSqHce/OjuHuCzd+4IO7/h31WhvhQ==", "dev": true, "dependencies": { "@fastify/formbody": "^7.4.0", @@ -439,7 +412,7 @@ "change-case": "^4.1.2", "collect.js": "^4.34.3", "debug": "^4.3.4", - "fastify": "^4.14.1", + "fastify": "^4.15.0", "got": "^12.6.0", "http-status-codes": "^2.2.0", "is-wsl": "^2.2.0", @@ -458,9 +431,9 @@ } }, "node_modules/@athenna/config": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@athenna/config/-/config-3.5.0.tgz", - "integrity": "sha512-6VjJ0NBMJ2XTLXfH/oVY+WHWfPBaeK6o57pXjHzfmyok3OJmmMPrvsYvzfhmXvHJy7dx200AAoYtKQUxRh+img==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@athenna/config/-/config-3.6.0.tgz", + "integrity": "sha512-MzTc3hrt0pbCdfYHjUAp2Izk1m9kmJdAIvVlRl1Y/nTic9wfRfo2WvfGrlvKOhApFZhV+Oy9GhosP4LVfGrJRA==", "dev": true, "dependencies": { "dotenv": "^16.0.3", @@ -469,39 +442,39 @@ } }, "node_modules/@athenna/http": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@athenna/http/-/http-3.9.0.tgz", - "integrity": "sha512-K4bpObvS1zlz/NrXKArsgK9teyQSfvzs+WEAIMlTYKib5M1lwrFtvUZR8LDW0NByks+TNMy7shnTcxw6/J5nSw==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/@athenna/http/-/http-3.10.0.tgz", + "integrity": "sha512-tPleZyOzJDQ22/uKHtZbSFGaaJp8zqgF9pIyg4WkQfS5GK6l7TCAsagIyJGqHbkVOtnoEcmjZME7Wm1346HzHQ==", "dev": true, "dependencies": { "fastify": "^4.15.0" } }, "node_modules/@athenna/ioc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-3.3.0.tgz", - "integrity": "sha512-e9TS/jk4FRvcnHJ9j905Hf/pntcvVaC1j1BQ3jwE466dMqABnqJQhU4rXPLj80IpJYAlLUGy3P8C+VvZ+H6OHw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-3.4.0.tgz", + "integrity": "sha512-/uPH0VH1Pcw3tIsL8Ep6NhmcTzJFTiWZFQPA/CK9+FOy7UKAacv1QQODDmDsZvOkKgX7sJJ1tqWq705GhIohEQ==", "dev": true, "dependencies": { "awilix": "^7.0.3" } }, "node_modules/@athenna/logger": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-3.3.0.tgz", - "integrity": "sha512-J5/o3PjsSLxPwbNTWh32STi67sNLICSzumgkseWhmiAVaXPgdmK4KgSda5ixH8U/gETD1OArbksnwB/jseUmVg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-3.4.0.tgz", + "integrity": "sha512-jdUBePht+5Isj6R0OrLyHeAPlSXQ1HH4d1rI+gE/VqFbv7mIzMD8zRaS4ex/Ofxu55NfPU++D1xcKWc45glatA==", "dev": true, "dependencies": { + "cls-rtracer": "^2.6.2", "telegraf": "^4.12.2" } }, "node_modules/@athenna/test": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@athenna/test/-/test-3.5.1.tgz", - "integrity": "sha512-ktagv1IxVHlpgQZq4esanNt1NupdwGh46NRh3eoqKkkcHTb1WuHDBH7ofq/tTRKq13bQozH7VtCRXhIxepb0zA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@athenna/test/-/test-3.6.0.tgz", + "integrity": "sha512-1LeasmDMfQaKGN5Pc066WDTlFmYFUU90vyYZWsuMeO379sbosNntAUuTJ0+w/MN3q+4AfzaKQICr+5Th+rZv3A==", "dev": true, "dependencies": { - "@athenna/common": "^3.4.4", "@japa/assert": "^1.3.6", "@japa/run-failed-tests": "^1.1.0", "@japa/runner": "^2.2.2", @@ -511,12 +484,12 @@ } }, "node_modules/@athenna/view": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@athenna/view/-/view-3.2.0.tgz", - "integrity": "sha512-hgSYc6Mvb9UVjWMdPmIA2CudDzQGgxiU0YZUekXU7efDN5QwCmX9lWYtEiucLJTDjCHTcsOKS/VLjmlSq/V5gw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@athenna/view/-/view-3.3.0.tgz", + "integrity": "sha512-61vzgH7szfbWrghCBTfS+sqr0qSD8kN2+SMOpSOpSVp4g7Jby5RK3nKNQa2WpUgaoseqnwbPQRTpE/devJ5KZA==", "dev": true, "dependencies": { - "edge.js": "^5.5.0" + "edge.js": "^5.5.1" } }, "node_modules/@babel/code-frame": { @@ -1939,9 +1912,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3713,43 +3686,43 @@ "dev": true }, "node_modules/edge-error": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/edge-error/-/edge-error-2.0.8.tgz", - "integrity": "sha512-ORKH7rn/LEfgo0qrgoMMwFPfestNFvTO+dRLDmS+zgulhd9BVXfv/p+V6K3OyEeu2L0ysYp/71uHB31GIDe68A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/edge-error/-/edge-error-3.0.0.tgz", + "integrity": "sha512-TJE2A6KFqBMIe3EPyl/5V8veGYcMfpEtSNKfZkrSkQAyz3kh27etQ2erU6o0lkAFqDjjUl11YVzBIO2ij5/Zhw==", "dev": true }, "node_modules/edge-lexer": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-4.0.10.tgz", - "integrity": "sha512-6hvRE0TkYyqogEGTU6GpNW3vf6PDA0U+zLEXIV4ZhsCRy2YX+FuprzitYpe69ZHC+BZdiFpdCn2Zqf1HOebqEg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-5.0.2.tgz", + "integrity": "sha512-MSpv6JRPD96eZl0uPo8gIvE9cPAXb1eNRfZKlQpFYJ2O8cNdZDpN8RvT2zpu4XqC63HWs/c938qc3dWN+GJhFw==", "dev": true, "dependencies": { - "edge-error": "^2.0.8" + "edge-error": "^3.0.0" } }, "node_modules/edge-parser": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-8.2.1.tgz", - "integrity": "sha512-6x2BdSqwU4Oo4IF+ppu3wchpzhZ8Oq05hBPGLYnTOSoSVrQThSV9PK9t+Oz47XQOQSb5V9fugUOYLuUy8iXZGg==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-8.2.2.tgz", + "integrity": "sha512-48iOLaOD4PAxIU0jnLRNXUL8G6ktO79bA4adOGXzNHg2M+mHfudFI7QPdF6IO8gW0NC1N0TPvwLWK3FVkE9bLQ==", "dev": true, "dependencies": { - "acorn": "^8.8.0", - "astring": "^1.8.3", - "edge-error": "^2.0.8", - "edge-lexer": "^4.0.10", + "acorn": "^8.8.2", + "astring": "^1.8.4", + "edge-error": "^3.0.0", + "edge-lexer": "^5.0.2", "js-stringify": "^1.0.2" } }, "node_modules/edge.js": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/edge.js/-/edge.js-5.5.0.tgz", - "integrity": "sha512-jH6g5wDMJB2xVt+hwSTTlx++hVVItZIPJgt8Q8of/zIt2391eD90IpvHZQM8cG8v2j8H6YdCJ3Rp998ze1BvJA==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/edge.js/-/edge.js-5.5.1.tgz", + "integrity": "sha512-lAhEdj1tW2VOJsP5X38wSHjjaXXwoteZ+8PDAJ50rAKzBxpw4QsdXK2jVzMFgRoTMUf7C+x+Tp51R9yxGTLO0w==", "dev": true, "dependencies": { "@poppinss/inspect": "^1.0.1", "@poppinss/utils": "^5.0.0", - "edge-error": "^2.0.8", - "edge-lexer": "^4.0.10", + "edge-error": "^3.0.0", + "edge-lexer": "^5.0.2", "edge-parser": "^8.2.1", "js-stringify": "^1.0.2", "macroable": "^7.0.1", @@ -8925,9 +8898,9 @@ } }, "node_modules/slugify": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.5.tgz", - "integrity": "sha512-8mo9bslnBO3tr5PEVFzMPIWwWnipGS0xVbYf65zxDqfNwmzYn1LpiKNrR6DlClusuvo+hDHd1zKpmfAe83NQSQ==", + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz", + "integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==", "dev": true, "engines": { "node": ">=8.0.0" @@ -9018,6 +8991,56 @@ "get-source": "^2.0.12" } }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stdin-discarder/node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/stdin-discarder/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -10004,9 +10027,9 @@ "dev": true }, "@athenna/artisan": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-3.8.0.tgz", - "integrity": "sha512-c/4FZ1vOfSBEJ/RCfPRZM7rmpSx/VycsCP/8zywK0H3FTISQQX9tId0b9fgXLVXB4g3q6u2NGDKZH6WQ/NO94g==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-3.9.0.tgz", + "integrity": "sha512-vlxIwXvOacOzOQNs337pUbPLGpUQ9Rb58yQtW0x+Ot7rxB2clX4J7GUD1YMFLCAv6N7qnyh2wxNoCumUdQCosQ==", "dev": true, "requires": { "chalk-rainbow": "^1.0.0", @@ -10015,15 +10038,15 @@ "columnify": "^1.6.0", "commander": "^9.5.0", "figlet": "^1.5.2", - "inquirer": "^9.1.4", + "inquirer": "^9.1.5", "log-update": "^5.0.1", - "ora": "^6.1.2" + "ora": "^6.2.0" }, "dependencies": { "ansi-escapes": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.0.0.tgz", - "integrity": "sha512-IG23inYII3dWlU2EyiAiGj6Bwal5GzsgPMwjYGvc1HPE2dgbj4ZB5ToWBKSquKw74nB3TIuOwaI6/jSULzfgrw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.1.0.tgz", + "integrity": "sha512-bQyg9bzRntwR/8b89DOEhGwctcwCrbWW/TuqTQnpqpy5Fz3aovcOTj5i8NJV6AHc8OGNdMaqdxAWww8pz2kiKg==", "dev": true, "requires": { "type-fest": "^3.0.0" @@ -10041,27 +10064,6 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, - "bl": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", - "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", - "dev": true, - "requires": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "cli-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", @@ -10094,26 +10096,26 @@ } }, "inquirer": { - "version": "9.1.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.1.4.tgz", - "integrity": "sha512-9hiJxE5gkK/cM2d1mTEnuurGTAoHebbkX0BYl3h7iEg7FYfuNIom+nDfBCSWtvSnoSrWCeBxqqBZu26xdlJlXA==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.1.5.tgz", + "integrity": "sha512-3ygAIh8gcZavV9bj6MTdYddG2zPSYswP808fKS46NOwlF0zZljVpnLCHODDqItWJDbDpLb3aouAxGaJbkxoppA==", "dev": true, "requires": { "ansi-escapes": "^6.0.0", - "chalk": "^5.1.2", + "chalk": "^5.2.0", "cli-cursor": "^4.0.0", "cli-width": "^4.0.0", "external-editor": "^3.0.3", "figures": "^5.0.0", "lodash": "^4.17.21", - "mute-stream": "0.0.8", + "mute-stream": "1.0.0", "ora": "^6.1.2", "run-async": "^2.4.0", - "rxjs": "^7.5.7", + "rxjs": "^7.8.0", "string-width": "^5.1.2", "strip-ansi": "^7.0.1", "through": "^2.3.6", - "wrap-ansi": "^8.0.1" + "wrap-ansi": "^8.1.0" } }, "is-interactive": { @@ -10168,19 +10170,25 @@ } } }, + "mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true + }, "ora": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", - "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.0.tgz", + "integrity": "sha512-1/D8uRFY0ay2kgBpmAwmSA404w4OoPVhHMqRqtjvrcK/dnzcEZxMJ+V4DUbyICu8IIVRclHcOf5wlD1tMY4GUQ==", "dev": true, "requires": { - "bl": "^5.0.0", "chalk": "^5.0.0", "cli-cursor": "^4.0.0", "cli-spinners": "^2.6.1", "is-interactive": "^2.0.0", "is-unicode-supported": "^1.1.0", "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", "strip-ansi": "^7.0.1", "wcwidth": "^1.0.1" } @@ -10216,9 +10224,9 @@ } }, "type-fest": { - "version": "3.5.7", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.5.7.tgz", - "integrity": "sha512-6J4bYzb4sdkcLBty4XW7F18VPI66M4boXNE+CY40532oq2OJe6AVMB5NmjOp6skt/jw5mRjz/hLRpuglz0U+FA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.8.0.tgz", + "integrity": "sha512-FVNSzGQz9Th+/9R6Lvv7WIAkstylfHN2/JYxkyhhmKFYh9At2DST8t6L6Lref9eYO8PXFTfG9Sg1Agg0K3vq3Q==", "dev": true }, "wrap-ansi": { @@ -10235,9 +10243,9 @@ } }, "@athenna/common": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@athenna/common/-/common-3.5.1.tgz", - "integrity": "sha512-4WoH5Wx/LfMeqzlBWE3UNeH2A1tnZglW+UnA/B21nrgu09exyQLOMZuVzp7+WWiz9UQFFXYK3+lZENQvesSM1A==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@athenna/common/-/common-3.6.0.tgz", + "integrity": "sha512-5/KAJ2wE1PVyp/lqV+Pf+gXnzrGyncl4jdL/2fcoq8xOx1etVwh9FtekxhSqHce/OjuHuCzd+4IO7/h31WhvhQ==", "dev": true, "requires": { "@fastify/formbody": "^7.4.0", @@ -10247,7 +10255,7 @@ "change-case": "^4.1.2", "collect.js": "^4.34.3", "debug": "^4.3.4", - "fastify": "^4.14.1", + "fastify": "^4.15.0", "got": "^12.6.0", "http-status-codes": "^2.2.0", "is-wsl": "^2.2.0", @@ -10266,9 +10274,9 @@ } }, "@athenna/config": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@athenna/config/-/config-3.5.0.tgz", - "integrity": "sha512-6VjJ0NBMJ2XTLXfH/oVY+WHWfPBaeK6o57pXjHzfmyok3OJmmMPrvsYvzfhmXvHJy7dx200AAoYtKQUxRh+img==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@athenna/config/-/config-3.6.0.tgz", + "integrity": "sha512-MzTc3hrt0pbCdfYHjUAp2Izk1m9kmJdAIvVlRl1Y/nTic9wfRfo2WvfGrlvKOhApFZhV+Oy9GhosP4LVfGrJRA==", "dev": true, "requires": { "dotenv": "^16.0.3", @@ -10277,39 +10285,39 @@ } }, "@athenna/http": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@athenna/http/-/http-3.9.0.tgz", - "integrity": "sha512-K4bpObvS1zlz/NrXKArsgK9teyQSfvzs+WEAIMlTYKib5M1lwrFtvUZR8LDW0NByks+TNMy7shnTcxw6/J5nSw==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/@athenna/http/-/http-3.10.0.tgz", + "integrity": "sha512-tPleZyOzJDQ22/uKHtZbSFGaaJp8zqgF9pIyg4WkQfS5GK6l7TCAsagIyJGqHbkVOtnoEcmjZME7Wm1346HzHQ==", "dev": true, "requires": { "fastify": "^4.15.0" } }, "@athenna/ioc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-3.3.0.tgz", - "integrity": "sha512-e9TS/jk4FRvcnHJ9j905Hf/pntcvVaC1j1BQ3jwE466dMqABnqJQhU4rXPLj80IpJYAlLUGy3P8C+VvZ+H6OHw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-3.4.0.tgz", + "integrity": "sha512-/uPH0VH1Pcw3tIsL8Ep6NhmcTzJFTiWZFQPA/CK9+FOy7UKAacv1QQODDmDsZvOkKgX7sJJ1tqWq705GhIohEQ==", "dev": true, "requires": { "awilix": "^7.0.3" } }, "@athenna/logger": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-3.3.0.tgz", - "integrity": "sha512-J5/o3PjsSLxPwbNTWh32STi67sNLICSzumgkseWhmiAVaXPgdmK4KgSda5ixH8U/gETD1OArbksnwB/jseUmVg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-3.4.0.tgz", + "integrity": "sha512-jdUBePht+5Isj6R0OrLyHeAPlSXQ1HH4d1rI+gE/VqFbv7mIzMD8zRaS4ex/Ofxu55NfPU++D1xcKWc45glatA==", "dev": true, "requires": { + "cls-rtracer": "^2.6.2", "telegraf": "^4.12.2" } }, "@athenna/test": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@athenna/test/-/test-3.5.1.tgz", - "integrity": "sha512-ktagv1IxVHlpgQZq4esanNt1NupdwGh46NRh3eoqKkkcHTb1WuHDBH7ofq/tTRKq13bQozH7VtCRXhIxepb0zA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@athenna/test/-/test-3.6.0.tgz", + "integrity": "sha512-1LeasmDMfQaKGN5Pc066WDTlFmYFUU90vyYZWsuMeO379sbosNntAUuTJ0+w/MN3q+4AfzaKQICr+5Th+rZv3A==", "dev": true, "requires": { - "@athenna/common": "^3.4.4", "@japa/assert": "^1.3.6", "@japa/run-failed-tests": "^1.1.0", "@japa/runner": "^2.2.2", @@ -10319,12 +10327,12 @@ } }, "@athenna/view": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@athenna/view/-/view-3.2.0.tgz", - "integrity": "sha512-hgSYc6Mvb9UVjWMdPmIA2CudDzQGgxiU0YZUekXU7efDN5QwCmX9lWYtEiucLJTDjCHTcsOKS/VLjmlSq/V5gw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@athenna/view/-/view-3.3.0.tgz", + "integrity": "sha512-61vzgH7szfbWrghCBTfS+sqr0qSD8kN2+SMOpSOpSVp4g7Jby5RK3nKNQa2WpUgaoseqnwbPQRTpE/devJ5KZA==", "dev": true, "requires": { - "edge.js": "^5.5.0" + "edge.js": "^5.5.1" } }, "@babel/code-frame": { @@ -11393,9 +11401,9 @@ "dev": true }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true }, "acorn-jsx": { @@ -12749,43 +12757,43 @@ "dev": true }, "edge-error": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/edge-error/-/edge-error-2.0.8.tgz", - "integrity": "sha512-ORKH7rn/LEfgo0qrgoMMwFPfestNFvTO+dRLDmS+zgulhd9BVXfv/p+V6K3OyEeu2L0ysYp/71uHB31GIDe68A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/edge-error/-/edge-error-3.0.0.tgz", + "integrity": "sha512-TJE2A6KFqBMIe3EPyl/5V8veGYcMfpEtSNKfZkrSkQAyz3kh27etQ2erU6o0lkAFqDjjUl11YVzBIO2ij5/Zhw==", "dev": true }, "edge-lexer": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-4.0.10.tgz", - "integrity": "sha512-6hvRE0TkYyqogEGTU6GpNW3vf6PDA0U+zLEXIV4ZhsCRy2YX+FuprzitYpe69ZHC+BZdiFpdCn2Zqf1HOebqEg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-5.0.2.tgz", + "integrity": "sha512-MSpv6JRPD96eZl0uPo8gIvE9cPAXb1eNRfZKlQpFYJ2O8cNdZDpN8RvT2zpu4XqC63HWs/c938qc3dWN+GJhFw==", "dev": true, "requires": { - "edge-error": "^2.0.8" + "edge-error": "^3.0.0" } }, "edge-parser": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-8.2.1.tgz", - "integrity": "sha512-6x2BdSqwU4Oo4IF+ppu3wchpzhZ8Oq05hBPGLYnTOSoSVrQThSV9PK9t+Oz47XQOQSb5V9fugUOYLuUy8iXZGg==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-8.2.2.tgz", + "integrity": "sha512-48iOLaOD4PAxIU0jnLRNXUL8G6ktO79bA4adOGXzNHg2M+mHfudFI7QPdF6IO8gW0NC1N0TPvwLWK3FVkE9bLQ==", "dev": true, "requires": { - "acorn": "^8.8.0", - "astring": "^1.8.3", - "edge-error": "^2.0.8", - "edge-lexer": "^4.0.10", + "acorn": "^8.8.2", + "astring": "^1.8.4", + "edge-error": "^3.0.0", + "edge-lexer": "^5.0.2", "js-stringify": "^1.0.2" } }, "edge.js": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/edge.js/-/edge.js-5.5.0.tgz", - "integrity": "sha512-jH6g5wDMJB2xVt+hwSTTlx++hVVItZIPJgt8Q8of/zIt2391eD90IpvHZQM8cG8v2j8H6YdCJ3Rp998ze1BvJA==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/edge.js/-/edge.js-5.5.1.tgz", + "integrity": "sha512-lAhEdj1tW2VOJsP5X38wSHjjaXXwoteZ+8PDAJ50rAKzBxpw4QsdXK2jVzMFgRoTMUf7C+x+Tp51R9yxGTLO0w==", "dev": true, "requires": { "@poppinss/inspect": "^1.0.1", "@poppinss/utils": "^5.0.0", - "edge-error": "^2.0.8", - "edge-lexer": "^4.0.10", + "edge-error": "^3.0.0", + "edge-lexer": "^5.0.2", "edge-parser": "^8.2.1", "js-stringify": "^1.0.2", "macroable": "^7.0.1", @@ -16655,9 +16663,9 @@ } }, "slugify": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.5.tgz", - "integrity": "sha512-8mo9bslnBO3tr5PEVFzMPIWwWnipGS0xVbYf65zxDqfNwmzYn1LpiKNrR6DlClusuvo+hDHd1zKpmfAe83NQSQ==", + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz", + "integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==", "dev": true }, "snake-case": { @@ -16739,6 +16747,38 @@ "get-source": "^2.0.12" } }, + "stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "requires": { + "bl": "^5.0.0" + }, + "dependencies": { + "bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "requires": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + } + } + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", diff --git a/package.json b/package.json index 83ad758..963a96b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/core", - "version": "3.7.0", + "version": "3.8.0", "description": "The plug and play Node.js framework.", "license": "MIT", "author": "João Lenon ", @@ -62,19 +62,18 @@ "semver": "^7.3.8" }, "devDependencies": { - "@athenna/artisan": "^3.8.0", - "@athenna/common": "^3.5.1", - "@athenna/config": "^3.5.0", - "@athenna/http": "^3.9.0", - "@athenna/ioc": "^3.3.0", - "@athenna/logger": "^3.3.0", - "@athenna/test": "^3.5.1", - "@athenna/view": "^3.2.0", + "@athenna/artisan": "^3.9.0", + "@athenna/common": "^3.6.0", + "@athenna/config": "^3.6.0", + "@athenna/http": "^3.10.0", + "@athenna/ioc": "^3.4.0", + "@athenna/logger": "^3.4.0", + "@athenna/test": "^3.6.0", + "@athenna/view": "^3.3.0", "@swc/core": "^1.3.27", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", "c8": "^7.12.0", - "cls-rtracer": "^2.6.2", "commitizen": "^4.2.6", "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", diff --git a/src/Commands/BuildCommand.ts b/src/Commands/BuildCommand.ts index 6e8d73c..745a1c4 100644 --- a/src/Commands/BuildCommand.ts +++ b/src/Commands/BuildCommand.ts @@ -60,7 +60,10 @@ export class BuildCommand extends BaseCommand { const tsConfig = await this.getTsConfig() await this.logger.promiseSpinner( - () => Exec.command(`${Path.bin('tsc')} --project ${tsConfig.path}`), + () => + Exec.command( + `${Path.nodeModulesBin('tsc')} --project ${tsConfig.path}`, + ), { stream: process.stdout, text: 'Compiling all .ts files from your application', diff --git a/src/Commands/MakeExceptionCommand.ts b/src/Commands/MakeExceptionCommand.ts index 6eca0a4..52db68e 100644 --- a/src/Commands/MakeExceptionCommand.ts +++ b/src/Commands/MakeExceptionCommand.ts @@ -52,7 +52,7 @@ export class MakeExceptionCommand extends BaseCommand { private getDestinationPath(): string { let destination = Config.get( 'rc.commands.make:exception.destination', - Path.app('Exceptions'), + Path.exceptions(), ) if (!isAbsolute(destination)) { diff --git a/src/Commands/MakeServiceCommand.ts b/src/Commands/MakeServiceCommand.ts index 3b8513f..b30fba8 100644 --- a/src/Commands/MakeServiceCommand.ts +++ b/src/Commands/MakeServiceCommand.ts @@ -60,7 +60,7 @@ export class MakeServiceCommand extends BaseCommand { private getDestinationPath(): string { let destination = Config.get( 'rc.commands.make:service.destination', - Path.app('Services'), + Path.services(), ) if (!isAbsolute(destination)) { diff --git a/src/Commands/ReplCommand.ts b/src/Commands/ReplCommand.ts index c852bf5..3bed86f 100644 --- a/src/Commands/ReplCommand.ts +++ b/src/Commands/ReplCommand.ts @@ -34,7 +34,7 @@ export class ReplCommand extends BaseCommand { const entrypoint = Config.get( 'rc.commands.repl.entrypoint', - '#bootstrap/repl', + Path.bootstrap(`repl.${Path.ext()}`), ) await Module.resolve(entrypoint, Config.get('rc.meta')) diff --git a/src/Commands/ServeCommand.ts b/src/Commands/ServeCommand.ts index e1378f8..995b915 100644 --- a/src/Commands/ServeCommand.ts +++ b/src/Commands/ServeCommand.ts @@ -34,7 +34,7 @@ export class ServeCommand extends BaseCommand { const entrypoint = Config.get( 'rc.commands.serve.entrypoint', - '#bootstrap/main', + Path.bootstrap(`main.${Path.ext()}`), ) await Module.resolve(entrypoint, Config.get('rc.meta')) diff --git a/src/Commands/TestCommand.ts b/src/Commands/TestCommand.ts index 417bdf3..6be987c 100644 --- a/src/Commands/TestCommand.ts +++ b/src/Commands/TestCommand.ts @@ -34,7 +34,7 @@ export class TestCommand extends BaseCommand { const entrypoint = Config.get( 'rc.commands.test.entrypoint', - '#bootstrap/test', + Path.bootstrap(`test.${Path.ext()}`), ) process.argv.splice(2, 1) diff --git a/src/Ignite/Ignite.ts b/src/Ignite/Ignite.ts index a560e91..4c185fa 100644 --- a/src/Ignite/Ignite.ts +++ b/src/Ignite/Ignite.ts @@ -8,10 +8,10 @@ */ import { Ioc } from '@athenna/ioc' -import { EnvHelper, Rc } from '@athenna/config' import { Http } from '#src/Applications/Http' import { Repl } from '#src/Applications/Repl' import { PrettyREPLServer } from 'pretty-repl' +import { EnvHelper, Rc } from '@athenna/config' import { resolve, isAbsolute } from 'node:path' import { SemverNode } from '#src/Types/SemverNode' import { Artisan } from '#src/Applications/Artisan' @@ -58,7 +58,6 @@ export class Ignite { bootLogs: true, shutdownLogs: true, loadConfigSafe: true, - configPath: './config', athennaRcPath: './.athennarc.json', uncaughtExceptionHandler: this.handleError, }) @@ -67,10 +66,14 @@ export class Ignite { this.setApplicationRootPath() this.options.envPath = this.resolvePath(this.options.envPath) - this.options.configPath = this.resolvePath(this.options.configPath) this.options.athennaRcPath = this.resolvePath(this.options.athennaRcPath) await this.setRcContentAndAppVars() + + Path.mergeDirs(Config.get('rc.directories', {})) + + this.setApplicationBeforePath() + this.verifyNodeEngineVersion() this.registerItselfToTheContainer() this.setApplicationSignals() @@ -196,35 +199,17 @@ export class Ignite { * where the application is running (JavaScript or TypeScript). * * This method will determine if the application is using TypeScript by the meta url. - * Also, if the application IS NOT using TypeScript, the "beforePath" (second argument - * of this method) will be defined as value of "Path.defaultBeforePath" method. * * Let's check this example when application is running in TypeScript environment: * * @example * ```ts - * const meta = import.meta.url // 'file:///Users/jlenon7/Development/Athenna/AthennaIO/artisan.ts' - * - * this.setApplicationRootPath(meta, '/build') + * this.setApplicationRootPath() * * console.log(Path.ext()) // ts * console.log(Path.pwd()) // /Users/jlenon7/Development/Athenna/AthennaIO * console.log(Path.config(`app.${Path.ext()}`)) // /Users/jlenon7/Development/Athenna/AthennaIO/config/app.ts * ``` - * - * Now let's suppose that we have transpiled our code to JavaScript inside "/build" folder. "Path.pwd" - * will end with "/build" at the end: - * - * @example - * ```ts - * const meta = import.meta.url // 'file:///Users/jlenon7/Development/Athenna/AthennaIO/build/artisan.js' - * - * this.setApplicationRootPath(meta, '/build') - * - * console.log(Path.ext()) // js - * console.log(Path.pwd()) // /Users/jlenon7/Development/Athenna/AthennaIO/build - * console.log(Path.config(`app.${Path.ext()}`)) // /Users/jlenon7/Development/Athenna/AthennaIO/build/config/app.js - * ``` */ public setApplicationRootPath(): void { if (!Config.exists('rc.callPath')) { @@ -241,10 +226,43 @@ export class Ignite { * If env IS_TS is already set, then we cant change it. */ if (Env('IS_TS') === undefined) { - Path.resolveEnvironment(this.meta, this.options.beforePath) + if (this.meta.endsWith('.ts')) { + process.env.IS_TS = 'true' + } else { + process.env.IS_TS = 'false' + } } } + /** + * Set the application before path, in all directories of Path class unless + * the nodeModules and nodeModulesBin directories. + * + * @example + * ```ts + * this.setApplicationBeforePath() + * + * console.log(Path.config(`app.${Path.ext()}`)) // /Users/jlenon7/Development/Athenna/AthennaIO/config/build/app.ts + * ``` + */ + public setApplicationBeforePath(): void { + if (Env('IS_TS') || !this.options.beforePath) { + return + } + + Object.keys(Path.dirs).forEach(dir => { + if (dir === 'nodeModules') { + return + } + + if (dir === 'nodeModulesBin') { + return + } + + Path.dirs[dir] = this.options.beforePath + '/' + Path.dirs[dir] + }) + } + /** * Set the env file that the application will use. The env file path will be * automatically resolved by Athenna (using the NODE_ENV variable) if any @@ -314,9 +332,7 @@ export class Ignite { */ public async setRcContentAndAppVars() { const file = new File(this.options.athennaRcPath, '') - const pkgJson = await new File( - Path.originalPwd('package.json'), - ).getContentAsJson() + const pkgJson = await new File(Path.pwd('package.json')).getContentAsJson() const corePkgJson = await new File('../../package.json').getContentAsJson() const coreSemverVersion = this.parseVersion(corePkgJson.version) @@ -327,11 +343,11 @@ export class Ignite { const athennaRc = { meta: this.meta, typescript: Env('IS_TS', false), - isInPackageJson: false, - version: coreSemverVersion, + version: process.env.APP_VERSION, athennaVersion: process.env.ATHENNA_VERSION, engines: pkgJson.engines || {}, commands: {}, + directories: {}, services: [], preloads: [], providers: [], @@ -374,8 +390,7 @@ export class Ignite { return } - athennaRc.isInPackageJson = true - this.options.athennaRcPath = Path.originalPwd('package.json') + this.options.athennaRcPath = Path.pwd('package.json') Config.set('rc', { ...athennaRc, @@ -401,14 +416,14 @@ export class Ignite { * * @example * ```ts - * await this.setConfigurationFiles(Path.config()) + * await this.setConfigurationFiles() * - * console.log(Path.config('user.database.url')) // some-url - * console.log(Path.config('customer.database.url')) // some-different-url + * console.log(Config('user.database.url')) // some-url + * console.log(Config('customer.database.url')) // some-different-url * ``` */ public async setConfigurationFiles(): Promise { - await Config.loadAll(this.options.configPath, this.options.loadConfigSafe) + await Config.loadAll(Path.config(), this.options.loadConfigSafe) } /** diff --git a/src/Types/IgniteOptions.ts b/src/Types/IgniteOptions.ts index ea0da25..fffa475 100644 --- a/src/Types/IgniteOptions.ts +++ b/src/Types/IgniteOptions.ts @@ -36,13 +36,6 @@ export type IgniteOptions = { */ envPath?: string - /** - * The configuration files path. - * - * @default './config' - */ - configPath?: string - /** * Load the configurations file safelly. If this option is true, Athenna * will not reload configuration files that are already loaded. diff --git a/tests/Helpers/BaseTest.ts b/tests/Helpers/BaseTest.ts index cad5374..1320b77 100644 --- a/tests/Helpers/BaseTest.ts +++ b/tests/Helpers/BaseTest.ts @@ -16,6 +16,7 @@ import { ExitFaker, BeforeEach, AfterEach } from '@athenna/test' import { HttpRouteProvider, HttpServerProvider } from '@athenna/http' export class BaseTest { + public originalDirs = Json.copy(Path.dirs) public originalEnv = Json.copy(process.env) public originalKill = Json.copy(process.kill) public originalPJson = new File(Path.pwd('package.json')).getContentAsJsonSync() @@ -51,8 +52,8 @@ export class BaseTest { ExitFaker.release() LoadHelper.providers = [] LoadHelper.alreadyPreloaded = [] - Path.defaultBeforePath = '' process.kill = this.originalKill + Path.dirs = this.originalDirs process.env = Json.copy(this.originalEnv) process.removeAllListeners('SIGINT') diff --git a/tests/Stubs/.athennarc-dirs.json b/tests/Stubs/.athennarc-dirs.json new file mode 100644 index 0000000..f42ff92 --- /dev/null +++ b/tests/Stubs/.athennarc-dirs.json @@ -0,0 +1,8 @@ +{ + "directories": { + "controllers": "src/http/controllers", + "middlewares": "src/http/middlewares", + "interceptors": "src/http/interceptors", + "terminators": "src/http/terminators" + } +} diff --git a/tests/Unit/Ignite/IgniteTest.ts b/tests/Unit/Ignite/IgniteTest.ts index c64cc6e..df4601b 100644 --- a/tests/Unit/Ignite/IgniteTest.ts +++ b/tests/Unit/Ignite/IgniteTest.ts @@ -28,7 +28,6 @@ export default class IgniteTest extends BaseTest { shutdownLogs: true, beforePath: '', envPath: undefined, - configPath: Path.config(), loadConfigSafe: true, athennaRcPath: Path.pwd('package.json'), }) @@ -54,7 +53,7 @@ export default class IgniteTest extends BaseTest { const ignite = await new Ignite().load(meta, { beforePath: '/dist' }) assert.isFalse(Env('IS_TS', true)) - assert.isTrue(Path.pwd().includes('dist')) + assert.isTrue(Path.app().includes('dist')) assert.equal(ignite.meta, meta) assert.containsSubset(ignite.options, { beforePath: '/dist' }) } @@ -106,10 +105,10 @@ export default class IgniteTest extends BaseTest { @Test() public async shouldBeAbleToFireTheIgniteClassLoadingAllTheRestOfTheApplication({ assert }: TestContext) { Config.set('rc.environments', ['other']) + Config.set('rc.directories', { config: 'tests/Stubs/igniteConfig' }) const ignite = await new Ignite().load(Config.get('meta'), { envPath: Path.stubs('.env'), - configPath: Path.stubs('igniteConfig'), }) await ignite.fire(['console']) @@ -134,8 +133,9 @@ export default class IgniteTest extends BaseTest { process.env.OVERRIDE_ENV = 'true' Config.set('rc.environments', ['other']) + Config.set('rc.directories', { config: 'tests/Stubs/igniteConfig' }) - const ignite = await new Ignite().load(Config.get('meta'), { configPath: Path.stubs('igniteConfig') }) + const ignite = await new Ignite().load(Config.get('meta')) await ignite.fire(['console']) @@ -152,7 +152,9 @@ export default class IgniteTest extends BaseTest { @Test() public async shouldBeAbleToHandleSyntaxErrorExceptionsOfConfigsUsingTheDefaultIgniteHandler({ assert }: TestContext) { - const ignite = await new Ignite().load(Config.get('meta'), { configPath: Path.stubs('syntaxErrorConfig') }) + Config.set('rc.directories', { config: 'tests/Stubs/syntaxErrorConfig' }) + + const ignite = await new Ignite().load(Config.get('meta')) await ignite.fire(['console']) @@ -301,4 +303,15 @@ export default class IgniteTest extends BaseTest { assert.isTrue(ioc.hasDependency('decoratedWelcomeService')) assert.isTrue(ioc.hasDependency('App/Services/DecoratedWelcomeService')) } + + @Test() + public async shouldBeAbleToIgniteTheApplicationWithDifferentDirectoriesRegistered({ assert }: TestContext) { + await new Ignite().load(Config.get('meta'), { athennaRcPath: Path.stubs('.athennarc-dirs.json') }) + + assert.equal(Path.app(), Path.pwd('app')) + assert.equal(Path.controllers(), Path.pwd('src/http/controllers')) + assert.equal(Path.middlewares(), Path.pwd('src/http/middlewares')) + assert.equal(Path.interceptors(), Path.pwd('src/http/interceptors')) + assert.equal(Path.terminators(), Path.pwd('src/http/terminators')) + } }