From e5ac137bd46ac8f1f0165392ebe1abd71081403a Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Tue, 27 Feb 2024 04:40:45 +0000 Subject: [PATCH 1/2] fix: upgrade semver from 7.5.4 to 7.6.0 Snyk has created this PR to upgrade semver from 7.5.4 to 7.6.0. See this package in npm: https://www.npmjs.com/package/semver See this project in Snyk: https://app.snyk.io/org/jlenon7/project/b85f9aed-eaac-4dbd-9342-1cb73fb51458?utm_source=github&utm_medium=referral&page=upgrade-pr --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 321ace3..06453a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "pretty-repl": "^3.1.2", - "semver": "^7.5.4" + "semver": "^7.6.0" }, "devDependencies": { "@athenna/artisan": "^4.37.0", @@ -10505,9 +10505,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, diff --git a/package.json b/package.json index 1d4e391..5e0feac 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ }, "dependencies": { "pretty-repl": "^3.1.2", - "semver": "^7.5.4" + "semver": "^7.6.0" }, "devDependencies": { "@athenna/artisan": "^4.37.0", From 09c2e3723a77a3176d9b2421502f9318278a202e Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Mon, 4 Mar 2024 13:02:16 +0000 Subject: [PATCH 2/2] feat(cmd): add install command --- package-lock.json | 72 +++++++++--------- package.json | 20 +++-- src/applications/Console.ts | 2 +- src/applications/Http.ts | 2 +- src/commands/InstallCommand.ts | 75 +++++++++++++++++++ src/commands/ReplCommand.ts | 2 +- src/commands/ServeCommand.ts | 2 +- src/commands/TestCommand.ts | 2 +- src/constants/InternalReplProps.ts | 2 - src/ignite/Ignite.ts | 2 +- src/testing/BaseConsoleTest.ts | 2 +- src/testing/BaseHttpTest.ts | 2 +- .../fixtures/consoles/absolute-path-entry.ts | 1 + tests/fixtures/consoles/base-console.ts | 1 + .../consoles/console-mock-dest-import.ts | 1 + tests/fixtures/consoles/dont-copy-dot-env.ts | 1 + .../consoles/import-alias-path-entry.ts | 1 + tests/fixtures/consoles/include-files-glob.ts | 1 + tests/fixtures/consoles/include-files.ts | 1 + .../fixtures/consoles/include-folders-glob.ts | 1 + tests/fixtures/consoles/include-folders.ts | 1 + tests/fixtures/consoles/outdir-not-set.ts | 1 + .../fixtures/consoles/relative-path-entry.ts | 1 + .../consoles/relative-path-tsconfig.ts | 1 + .../consoles/resolve-outdir-setting.ts | 1 + tests/fixtures/consoles/watch-mode-logs.ts | 1 + tests/fixtures/consoles/watch-mode.ts | 1 + tests/helpers/BaseCommandTest.ts | 2 +- tests/unit/applications/ConsoleTest.ts | 1 + tests/unit/applications/HttpTest.ts | 1 + tests/unit/applications/ReplTest.ts | 2 +- tests/unit/commands/BuildCommandTest.ts | 2 +- tests/unit/commands/InstallCommandTest.ts | 27 +++++++ tests/unit/commands/ReplCommandTest.ts | 1 + tests/unit/commands/ServeCommandTest.ts | 1 + tests/unit/commands/TestCommandTest.ts | 1 + tests/unit/helpers/LoadHelperTest.ts | 1 + tests/unit/ignite/IgniteTest.ts | 1 + tests/unit/providers/CoreProviderTest.ts | 1 + tests/unit/repl/ReplImplTest.ts | 1 + 40 files changed, 185 insertions(+), 57 deletions(-) create mode 100644 src/commands/InstallCommand.ts create mode 100644 tests/unit/commands/InstallCommandTest.ts diff --git a/package-lock.json b/package-lock.json index 321ace3..ac32794 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,27 +1,27 @@ { "name": "@athenna/core", - "version": "4.30.0", + "version": "4.31.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/core", - "version": "4.30.0", + "version": "4.31.0", "license": "MIT", "dependencies": { "pretty-repl": "^3.1.2", "semver": "^7.5.4" }, "devDependencies": { - "@athenna/artisan": "^4.37.0", - "@athenna/common": "^4.34.0", - "@athenna/config": "^4.16.0", - "@athenna/http": "^4.23.0", - "@athenna/ioc": "^4.16.0", - "@athenna/logger": "^4.17.0", + "@athenna/artisan": "^4.38.0", + "@athenna/common": "^4.35.0", + "@athenna/config": "^4.18.0", + "@athenna/http": "^4.24.0", + "@athenna/ioc": "^4.18.0", + "@athenna/logger": "^4.18.0", "@athenna/test": "^4.22.0", "@athenna/tsconfig": "^4.12.0", - "@athenna/view": "^4.18.0", + "@athenna/view": "^4.20.0", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "commitizen": "^4.2.6", @@ -97,9 +97,9 @@ "dev": true }, "node_modules/@athenna/artisan": { - "version": "4.37.0", - "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-4.37.0.tgz", - "integrity": "sha512-Zyfn/M3IEM094Cx4FXi8cXpGhbQSGiKiTGCmqNFT9QFaXt5ehON56GNq35sHDt884iRci8boyanN8c2xsWyqnA==", + "version": "4.38.0", + "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-4.38.0.tgz", + "integrity": "sha512-UZ9bDAIxaC88aALlxgdtQV92yE4k1siGXqXaZf4FOJkJgs5MjOLSvMrwtrsTy5Q9iQBoSGhZjrqExzap6O6KFA==", "dev": true, "dependencies": { "chalk-rainbow": "^1.0.0", @@ -108,7 +108,7 @@ "columnify": "^1.6.0", "commander": "^9.5.0", "figlet": "^1.7.0", - "inquirer": "^9.2.13", + "inquirer": "^9.2.14", "log-update": "^5.0.1", "ora": "^6.3.1" }, @@ -117,9 +117,9 @@ } }, "node_modules/@athenna/common": { - "version": "4.34.0", - "resolved": "https://registry.npmjs.org/@athenna/common/-/common-4.34.0.tgz", - "integrity": "sha512-2rIUEB4M7AsUXC8wNotTrVmuFj2PpJao41otaM3yMa7A8rc7c+aRIMHgX/IMk4wfOy3ajdF5v9cEkn6W/6skUw==", + "version": "4.35.0", + "resolved": "https://registry.npmjs.org/@athenna/common/-/common-4.35.0.tgz", + "integrity": "sha512-f5JRdrjdozbtHjG0YgqVLXv6fjmss7PKAQWeyqGLg4dpGmheZ19xXYONZYf3ng6d0k2+YQ7IjLzGmfwSsrO+wA==", "dev": true, "dependencies": { "@fastify/formbody": "^7.4.0", @@ -130,7 +130,7 @@ "collect.js": "^4.36.1", "csv-parser": "^3.0.0", "execa": "^8.0.1", - "fastify": "^4.26.0", + "fastify": "^4.26.1", "got": "^12.6.1", "http-status-codes": "^2.2.0", "is-wsl": "^2.2.0", @@ -172,12 +172,12 @@ } }, "node_modules/@athenna/config": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/@athenna/config/-/config-4.16.0.tgz", - "integrity": "sha512-uR0hyTApbaOp1YK143BkeczeygbU8SmLHnJLwRAweplauDydRW8TZw9pETO1w1TwMnK6iDobjl/GX2NWoid6rw==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@athenna/config/-/config-4.18.0.tgz", + "integrity": "sha512-nAxoFSJoNF63gJY582J42sFFN0NMsk4jL4rtZKfTKb6URICoO/1rv6DqNc6hBSeiJoLDLZTO72QUzyty+iDfKw==", "dev": true, "dependencies": { - "dotenv": "^16.4.0", + "dotenv": "^16.4.1", "magicast": "^0.3.3", "syntax-error": "^1.4.0" }, @@ -186,18 +186,18 @@ } }, "node_modules/@athenna/http": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@athenna/http/-/http-4.23.0.tgz", - "integrity": "sha512-RXLsbMyxZBorafQXg/ZSmfUCdTaXuxLxODPg3a3AFOQ2mwvr3XI1rliksr2OKQUITOWPGYlwZHC6EPuWw6HMtQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@athenna/http/-/http-4.24.0.tgz", + "integrity": "sha512-fpxkM7O6bJ5wuijeOmK+Y39i5KsUitrG3khU+OvYPs5QYDaWByivBOmJ0V8AAi1DNGVmEKMqE+xdWrG5tpJgyQ==", "dev": true, "engines": { "node": ">=20.0.0" } }, "node_modules/@athenna/ioc": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-4.16.0.tgz", - "integrity": "sha512-oq6PP26VMOmdyMqTbv/iaGrP1ACK7mVVsyAyTc+z8xrpLyAeQ++r53bAK7obZz+LIPDNNPd/cgmk6WH0zq6paA==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-4.18.0.tgz", + "integrity": "sha512-Ocz7Miaj5dvtnp66brol9Bf6vU97XaBfeXP+RfQtzSyyQs70nSIvCmIXK4oAya15OqHFpqJtR6JXikkQuOVIXw==", "dev": true, "dependencies": { "awilix": "^7.0.3" @@ -207,9 +207,9 @@ } }, "node_modules/@athenna/logger": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-4.17.0.tgz", - "integrity": "sha512-Xlaz56JVyyy4BrsaqGlHyR2WahDN7aW4r+WdkYDU40EluOFeisSBg/dR8PBZzIohMUFZEJHye+G+d7DoNEGNDg==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-4.18.0.tgz", + "integrity": "sha512-mUGqj5Guh6ZdYflijGAdnn6Zrse2I7SG9fj5jMxSdrQ3hFMCGIgpWIk/ctXCGhPnsHlrVfAmEJeqnCxbtaytZQ==", "dev": true, "dependencies": { "@aws-lambda-powertools/logger": "^1.18.0", @@ -252,9 +252,9 @@ } }, "node_modules/@athenna/view": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@athenna/view/-/view-4.18.0.tgz", - "integrity": "sha512-PnBShkzzXeGtI2kfYOfN7JmE/Y+vpDRx7QDGyHhpH9vzyDG8tMABq34kkLjyiY2EgNtm25ZmYERQV8N3IFL/jQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@athenna/view/-/view-4.20.0.tgz", + "integrity": "sha512-eAoCPn53GM5zGU9lY0rTNnv8PTSmYNMauy1w9/8BE0OAuedN0a0qVt2W1E1m9IJDsYd29dmV/K63xL6fOR8Ydw==", "dev": true, "dependencies": { "edge.js": "^6.0.1" @@ -10505,9 +10505,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, diff --git a/package.json b/package.json index 1d4e391..300c0b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/core", - "version": "4.30.0", + "version": "4.31.0", "description": "One foundation for multiple applications.", "license": "MIT", "author": "João Lenon ", @@ -57,6 +57,7 @@ "./commands/ServeCommand": "./src/commands/ServeCommand.js", "./commands/TestCommand": "./src/commands/TestCommand.js", "./commands/BuildCommand": "./src/commands/BuildCommand.js", + "./commands/InstallCommand": "./src/commands/InstallCommand.js", "./testing/BaseHttpTest": "./src/testing/BaseHttpTest.js", "./testing/BaseConsoleTest": "./src/testing/BaseConsoleTest.js" }, @@ -76,15 +77,15 @@ "semver": "^7.5.4" }, "devDependencies": { - "@athenna/artisan": "^4.37.0", - "@athenna/common": "^4.34.0", - "@athenna/config": "^4.16.0", - "@athenna/http": "^4.23.0", - "@athenna/ioc": "^4.16.0", - "@athenna/logger": "^4.17.0", + "@athenna/artisan": "^4.38.0", + "@athenna/common": "^4.35.0", + "@athenna/config": "^4.18.0", + "@athenna/http": "^4.24.0", + "@athenna/ioc": "^4.18.0", + "@athenna/logger": "^4.18.0", "@athenna/test": "^4.22.0", "@athenna/tsconfig": "^4.12.0", - "@athenna/view": "^4.18.0", + "@athenna/view": "^4.20.0", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "commitizen": "^4.2.6", @@ -249,6 +250,9 @@ "path": "#src/commands/BuildCommand", "tsconfig": "./tests/fixtures/tsconfig.json", "outDir": "build" + }, + "install": { + "path": "#src/commands/InstallCommand" } }, "providers": [ diff --git a/src/applications/Console.ts b/src/applications/Console.ts index 2be95c9..1c54331 100644 --- a/src/applications/Console.ts +++ b/src/applications/Console.ts @@ -9,8 +9,8 @@ import { debug } from '#src/debug' import { Log } from '@athenna/logger' -import { Module, Options } from '@athenna/common' import type { ArtisanImpl } from '@athenna/artisan' +import { Path, Module, Options } from '@athenna/common' import type { ConsoleOptions } from '#src/types/ConsoleOptions' export class Console { diff --git a/src/applications/Http.ts b/src/applications/Http.ts index 3b3c584..cc4eb42 100644 --- a/src/applications/Http.ts +++ b/src/applications/Http.ts @@ -10,8 +10,8 @@ import { debug } from '#src/debug' import { Log } from '@athenna/logger' import type { ServerImpl } from '@athenna/http' -import { Is, Module, Options } from '@athenna/common' import type { HttpOptions } from '#src/types/HttpOptions' +import { Is, Path, Module, Options } from '@athenna/common' export class Http { /** diff --git a/src/commands/InstallCommand.ts b/src/commands/InstallCommand.ts new file mode 100644 index 0000000..a9403ea --- /dev/null +++ b/src/commands/InstallCommand.ts @@ -0,0 +1,75 @@ +/** + * @athenna/core + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { File, Module, Path } from '@athenna/common' +import { Argument, BaseCommand, Option } from '@athenna/artisan' + +export class InstallCommand extends BaseCommand { + @Argument({ + signature: '<...libraries>', + description: 'The libraries to install in your project.' + }) + public libraries: string[] + + @Option({ + signature: '--registry', + description: + 'Change the package manager that will be used to install the libraries', + default: 'npm' + }) + public registry: string + + @Option({ + signature: '-D, --save-dev', + description: 'Install libraries as devDependencies.', + default: false + }) + public isDev: boolean + + public static signature(): string { + return 'install' + } + + public static description(): string { + return 'Install libraries and automatically run the configurer if it exist.' + } + + public async handle(): Promise { + this.logger.simple('({bold,green} [ INSTALLING LIBRARIES ])\n') + + const task = this.logger.task() + + task.addPromise(`Installing ${this.libraries.join(', ')} libraries`, () => { + return this.npm.install(this.libraries, { + registry: Config.get('rc.commands.install.registry', this.registry), + dev: this.isDev + }) + }) + + for (const library of this.libraries) { + const path = Path.nodeModules(`${library}/configurer/index.js`) + + if (!(await File.exists(path))) { + continue + } + + task.addPromise(`Configuring ${library}`, async () => { + const Configurer = await Module.getFrom(path) + + return new Configurer().setPath(path).configure() + }) + } + + await task.run() + + this.logger.success( + `Successfully installed ${this.libraries.join(', ')} libraries` + ) + } +} diff --git a/src/commands/ReplCommand.ts b/src/commands/ReplCommand.ts index 24ea539..a420132 100644 --- a/src/commands/ReplCommand.ts +++ b/src/commands/ReplCommand.ts @@ -7,7 +7,7 @@ * file that was distributed with this source code. */ -import { Module } from '@athenna/common' +import { Path, Module } from '@athenna/common' import { BaseCommand } from '@athenna/artisan' export class ReplCommand extends BaseCommand { diff --git a/src/commands/ServeCommand.ts b/src/commands/ServeCommand.ts index dd25c82..89c71ea 100644 --- a/src/commands/ServeCommand.ts +++ b/src/commands/ServeCommand.ts @@ -9,7 +9,7 @@ import { Log } from '@athenna/logger' import { Config } from '@athenna/config' -import { Module } from '@athenna/common' +import { Path, Module } from '@athenna/common' import { BaseCommand, Option } from '@athenna/artisan' export class ServeCommand extends BaseCommand { diff --git a/src/commands/TestCommand.ts b/src/commands/TestCommand.ts index 1a013d4..72d5d42 100644 --- a/src/commands/TestCommand.ts +++ b/src/commands/TestCommand.ts @@ -7,7 +7,7 @@ * file that was distributed with this source code. */ -import { Module } from '@athenna/common' +import { Path, Module } from '@athenna/common' import { BaseCommand, Commander } from '@athenna/artisan' export class TestCommand extends BaseCommand { diff --git a/src/constants/InternalReplProps.ts b/src/constants/InternalReplProps.ts index f11113a..bcafb84 100644 --- a/src/constants/InternalReplProps.ts +++ b/src/constants/InternalReplProps.ts @@ -10,8 +10,6 @@ /** * All node:repl internal properties to remove * from list when using ".ls" command. - * - * @type {string[]} */ export const INTERNAL_REPL_PROPS = [ 'global', diff --git a/src/ignite/Ignite.ts b/src/ignite/Ignite.ts index 7aac4ad..39abe4b 100644 --- a/src/ignite/Ignite.ts +++ b/src/ignite/Ignite.ts @@ -24,7 +24,7 @@ import { CommanderHandler } from '@athenna/artisan' import { LoadHelper } from '#src/helpers/LoadHelper' import { Log, LoggerProvider } from '@athenna/logger' import { Repl as ReplApp } from '#src/applications/Repl' -import { File, Is, Module, Options } from '@athenna/common' +import { Is, Path, File, Module, Options } from '@athenna/common' import { parse as semverParse, satisfies as semverSatisfies } from 'semver' import { NotSatisfiedNodeVersion } from '#src/exceptions/NotSatisfiedNodeVersion' diff --git a/src/testing/BaseConsoleTest.ts b/src/testing/BaseConsoleTest.ts index 6a470a5..f4cfa52 100644 --- a/src/testing/BaseConsoleTest.ts +++ b/src/testing/BaseConsoleTest.ts @@ -7,8 +7,8 @@ * file that was distributed with this source code. */ -import { Json, Options } from '@athenna/common' import { AfterAll, BeforeAll } from '@athenna/test' +import { Path, Json, Options } from '@athenna/common' import { Ignite, type IgniteOptions } from '@athenna/core' import { TestCommand } from '@athenna/artisan/testing/plugins' diff --git a/src/testing/BaseHttpTest.ts b/src/testing/BaseHttpTest.ts index 32fd443..0ce3b49 100644 --- a/src/testing/BaseHttpTest.ts +++ b/src/testing/BaseHttpTest.ts @@ -8,8 +8,8 @@ */ import { ServerImpl } from '@athenna/http' -import { Json, Options } from '@athenna/common' import { AfterAll, BeforeAll } from '@athenna/test' +import { Path, Json, Options } from '@athenna/common' import { Ignite, type HttpOptions, type IgniteOptions } from '@athenna/core' export class BaseHttpTest { diff --git a/tests/fixtures/consoles/absolute-path-entry.ts b/tests/fixtures/consoles/absolute-path-entry.ts index aaa525c..fb9ab89 100644 --- a/tests/fixtures/consoles/absolute-path-entry.ts +++ b/tests/fixtures/consoles/absolute-path-entry.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { ViewProvider } from '@athenna/view' import { Rc, Config } from '@athenna/config' import { LoggerProvider } from '@athenna/logger' diff --git a/tests/fixtures/consoles/base-console.ts b/tests/fixtures/consoles/base-console.ts index 8a03dae..3964b6c 100644 --- a/tests/fixtures/consoles/base-console.ts +++ b/tests/fixtures/consoles/base-console.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { ViewProvider } from '@athenna/view' import { Rc, Config } from '@athenna/config' import { LoggerProvider } from '@athenna/logger' diff --git a/tests/fixtures/consoles/console-mock-dest-import.ts b/tests/fixtures/consoles/console-mock-dest-import.ts index ae5eaf3..9502364 100644 --- a/tests/fixtures/consoles/console-mock-dest-import.ts +++ b/tests/fixtures/consoles/console-mock-dest-import.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { ViewProvider } from '@athenna/view' import { Rc, Config } from '@athenna/config' import { LoggerProvider } from '@athenna/logger' diff --git a/tests/fixtures/consoles/dont-copy-dot-env.ts b/tests/fixtures/consoles/dont-copy-dot-env.ts index 0986ac2..bb2824e 100644 --- a/tests/fixtures/consoles/dont-copy-dot-env.ts +++ b/tests/fixtures/consoles/dont-copy-dot-env.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' diff --git a/tests/fixtures/consoles/import-alias-path-entry.ts b/tests/fixtures/consoles/import-alias-path-entry.ts index 82a7d72..af42334 100644 --- a/tests/fixtures/consoles/import-alias-path-entry.ts +++ b/tests/fixtures/consoles/import-alias-path-entry.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { ViewProvider } from '@athenna/view' import { Rc, Config } from '@athenna/config' import { LoggerProvider } from '@athenna/logger' diff --git a/tests/fixtures/consoles/include-files-glob.ts b/tests/fixtures/consoles/include-files-glob.ts index c61a7ad..097f8a3 100644 --- a/tests/fixtures/consoles/include-files-glob.ts +++ b/tests/fixtures/consoles/include-files-glob.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' diff --git a/tests/fixtures/consoles/include-files.ts b/tests/fixtures/consoles/include-files.ts index ba92ba8..0098604 100644 --- a/tests/fixtures/consoles/include-files.ts +++ b/tests/fixtures/consoles/include-files.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' diff --git a/tests/fixtures/consoles/include-folders-glob.ts b/tests/fixtures/consoles/include-folders-glob.ts index 0c39da4..0574a16 100644 --- a/tests/fixtures/consoles/include-folders-glob.ts +++ b/tests/fixtures/consoles/include-folders-glob.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' diff --git a/tests/fixtures/consoles/include-folders.ts b/tests/fixtures/consoles/include-folders.ts index 61e4b31..c942157 100644 --- a/tests/fixtures/consoles/include-folders.ts +++ b/tests/fixtures/consoles/include-folders.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' diff --git a/tests/fixtures/consoles/outdir-not-set.ts b/tests/fixtures/consoles/outdir-not-set.ts index b23db7c..a6176fe 100644 --- a/tests/fixtures/consoles/outdir-not-set.ts +++ b/tests/fixtures/consoles/outdir-not-set.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' diff --git a/tests/fixtures/consoles/relative-path-entry.ts b/tests/fixtures/consoles/relative-path-entry.ts index 9e7a278..2f8d0db 100644 --- a/tests/fixtures/consoles/relative-path-entry.ts +++ b/tests/fixtures/consoles/relative-path-entry.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { ViewProvider } from '@athenna/view' import { Rc, Config } from '@athenna/config' import { LoggerProvider } from '@athenna/logger' diff --git a/tests/fixtures/consoles/relative-path-tsconfig.ts b/tests/fixtures/consoles/relative-path-tsconfig.ts index 70076c0..cae52e6 100644 --- a/tests/fixtures/consoles/relative-path-tsconfig.ts +++ b/tests/fixtures/consoles/relative-path-tsconfig.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' diff --git a/tests/fixtures/consoles/resolve-outdir-setting.ts b/tests/fixtures/consoles/resolve-outdir-setting.ts index 70076c0..cae52e6 100644 --- a/tests/fixtures/consoles/resolve-outdir-setting.ts +++ b/tests/fixtures/consoles/resolve-outdir-setting.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' diff --git a/tests/fixtures/consoles/watch-mode-logs.ts b/tests/fixtures/consoles/watch-mode-logs.ts index 967663b..0acfb63 100644 --- a/tests/fixtures/consoles/watch-mode-logs.ts +++ b/tests/fixtures/consoles/watch-mode-logs.ts @@ -8,6 +8,7 @@ */ import { Mock } from '@athenna/test' +import { Path } from '@athenna/common' import { ViewProvider } from '@athenna/view' import { Rc, Config } from '@athenna/config' import { LoggerProvider } from '@athenna/logger' diff --git a/tests/fixtures/consoles/watch-mode.ts b/tests/fixtures/consoles/watch-mode.ts index ac40c38..835099e 100644 --- a/tests/fixtures/consoles/watch-mode.ts +++ b/tests/fixtures/consoles/watch-mode.ts @@ -8,6 +8,7 @@ */ import { Mock } from '@athenna/test' +import { Path } from '@athenna/common' import { ViewProvider } from '@athenna/view' import { Rc, Config } from '@athenna/config' import { LoggerProvider } from '@athenna/logger' diff --git a/tests/helpers/BaseCommandTest.ts b/tests/helpers/BaseCommandTest.ts index e4a79b2..bd5a015 100644 --- a/tests/helpers/BaseCommandTest.ts +++ b/tests/helpers/BaseCommandTest.ts @@ -7,9 +7,9 @@ * file that was distributed with this source code. */ -import { File, Folder } from '@athenna/common' import { LoggerProvider } from '@athenna/logger' import { ArtisanProvider } from '@athenna/artisan' +import { Path, File, Folder } from '@athenna/common' import { BeforeEach, AfterEach, Mock } from '@athenna/test' import { TestCommand } from '@athenna/artisan/testing/plugins' diff --git a/tests/unit/applications/ConsoleTest.ts b/tests/unit/applications/ConsoleTest.ts index c79944d..29ef001 100644 --- a/tests/unit/applications/ConsoleTest.ts +++ b/tests/unit/applications/ConsoleTest.ts @@ -8,6 +8,7 @@ */ import { Rc } from '@athenna/config' +import { Path } from '@athenna/common' import { Console } from '#src/applications/Console' import { Log, LoggerProvider } from '@athenna/logger' import { Artisan, ArtisanProvider, CommanderHandler } from '@athenna/artisan' diff --git a/tests/unit/applications/HttpTest.ts b/tests/unit/applications/HttpTest.ts index e0a615c..b5daffe 100644 --- a/tests/unit/applications/HttpTest.ts +++ b/tests/unit/applications/HttpTest.ts @@ -8,6 +8,7 @@ */ import { Rc } from '@athenna/config' +import { Path } from '@athenna/common' import { Http } from '#src/applications/Http' import { CommanderHandler } from '@athenna/artisan' import { Log, LoggerProvider } from '@athenna/logger' diff --git a/tests/unit/applications/ReplTest.ts b/tests/unit/applications/ReplTest.ts index 211e25e..5bdc6b4 100644 --- a/tests/unit/applications/ReplTest.ts +++ b/tests/unit/applications/ReplTest.ts @@ -11,9 +11,9 @@ import figlet from 'figlet' import chalkRainbow from 'chalk-rainbow' import { Rc } from '@athenna/config' -import { Color } from '@athenna/common' import { Repl } from '#src/facades/Repl' import { Ls } from '#src/repl/commands/Ls' +import { Path, Color } from '@athenna/common' import { Clean } from '#src/repl/commands/Clean' import { CommanderHandler } from '@athenna/artisan' import { Repl as ReplApp } from '#src/applications/Repl' diff --git a/tests/unit/commands/BuildCommandTest.ts b/tests/unit/commands/BuildCommandTest.ts index 0a37aeb..aef5335 100644 --- a/tests/unit/commands/BuildCommandTest.ts +++ b/tests/unit/commands/BuildCommandTest.ts @@ -7,8 +7,8 @@ * file that was distributed with this source code. */ -import { File, Folder } from '@athenna/common' import { Test, type Context } from '@athenna/test' +import { Path, File, Folder } from '@athenna/common' import { BaseCommandTest } from '#tests/helpers/BaseCommandTest' export default class BuildCommandTest extends BaseCommandTest { diff --git a/tests/unit/commands/InstallCommandTest.ts b/tests/unit/commands/InstallCommandTest.ts new file mode 100644 index 0000000..355662f --- /dev/null +++ b/tests/unit/commands/InstallCommandTest.ts @@ -0,0 +1,27 @@ +/** + * @athenna/core + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Test, type Context } from '@athenna/test' +import { BaseCommandTest } from '#tests/helpers/BaseCommandTest' + +export default class InstallCommandTest extends BaseCommandTest { + @Test() + public async shouldBeAbleToInstallLibrariesAndRunConfigurerIfItExists({ command }: Context) { + const output = await command.run('install semver') + + output.assertSucceeded() + } + + @Test() + public async shouldBeAbleToInstallLibrariesInDevModeAndRunConfigurerIfItExists({ command }: Context) { + const output = await command.run('install @athenna/tsconfig -D') + + output.assertSucceeded() + } +} diff --git a/tests/unit/commands/ReplCommandTest.ts b/tests/unit/commands/ReplCommandTest.ts index edf087d..e45c4d7 100644 --- a/tests/unit/commands/ReplCommandTest.ts +++ b/tests/unit/commands/ReplCommandTest.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { Test, type Context } from '@athenna/test' import { BaseCommandTest } from '#tests/helpers/BaseCommandTest' diff --git a/tests/unit/commands/ServeCommandTest.ts b/tests/unit/commands/ServeCommandTest.ts index 724c381..3dc4906 100644 --- a/tests/unit/commands/ServeCommandTest.ts +++ b/tests/unit/commands/ServeCommandTest.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { Test, type Context } from '@athenna/test' import { BaseCommandTest } from '#tests/helpers/BaseCommandTest' diff --git a/tests/unit/commands/TestCommandTest.ts b/tests/unit/commands/TestCommandTest.ts index ce1a043..b420174 100644 --- a/tests/unit/commands/TestCommandTest.ts +++ b/tests/unit/commands/TestCommandTest.ts @@ -7,6 +7,7 @@ * file that was distributed with this source code. */ +import { Path } from '@athenna/common' import { Test, type Context } from '@athenna/test' import { BaseCommandTest } from '#tests/helpers/BaseCommandTest' diff --git a/tests/unit/helpers/LoadHelperTest.ts b/tests/unit/helpers/LoadHelperTest.ts index 95bae12..85e393f 100644 --- a/tests/unit/helpers/LoadHelperTest.ts +++ b/tests/unit/helpers/LoadHelperTest.ts @@ -8,6 +8,7 @@ */ import { LoadHelper } from '#src' +import { Path } from '@athenna/common' import { Log, LoggerProvider } from '@athenna/logger' import { CALLED_MAP } from '#tests/helpers/CalledMap' import { Test, BeforeEach, type Context, Mock, AfterEach } from '@athenna/test' diff --git a/tests/unit/ignite/IgniteTest.ts b/tests/unit/ignite/IgniteTest.ts index 6c391f9..f2e89f6 100644 --- a/tests/unit/ignite/IgniteTest.ts +++ b/tests/unit/ignite/IgniteTest.ts @@ -8,6 +8,7 @@ */ import { Rc } from '@athenna/config' +import { Path } from '@athenna/common' import { sep, resolve } from 'node:path' import { Ignite, LoadHelper } from '#src' import { Repl } from '#src/applications/Repl' diff --git a/tests/unit/providers/CoreProviderTest.ts b/tests/unit/providers/CoreProviderTest.ts index 2fa05d6..9bef04d 100644 --- a/tests/unit/providers/CoreProviderTest.ts +++ b/tests/unit/providers/CoreProviderTest.ts @@ -8,6 +8,7 @@ */ import { CoreProvider } from '#src' +import { Path } from '@athenna/common' import { Test, type Context, AfterEach, BeforeEach } from '@athenna/test' export default class CoreProviderTest { diff --git a/tests/unit/repl/ReplImplTest.ts b/tests/unit/repl/ReplImplTest.ts index f836177..7821827 100644 --- a/tests/unit/repl/ReplImplTest.ts +++ b/tests/unit/repl/ReplImplTest.ts @@ -9,6 +9,7 @@ import { sep } from 'node:path' import { ReplImpl } from '#src' +import { Path } from '@athenna/common' import { Ls } from '#src/repl/commands/Ls' import { Test, type Context, Mock, Cleanup, AfterEach } from '@athenna/test'