From ed094642cb335fae05afbda80700a49828d1be8d Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Thu, 2 Jan 2025 15:46:46 -0300 Subject: [PATCH] chore(npm): update dependencies --- package-lock.json | 30 +++++-------------- package.json | 7 ++--- src/applications/Http.ts | 5 +--- src/commands/ServeCommand.ts | 15 +--------- .../fixtures/consoles/serve-vite-with-logs.ts | 30 ------------------- tests/fixtures/consoles/serve-vite.ts | 28 ----------------- tests/unit/commands/ServeCommandTest.ts | 18 ----------- 7 files changed, 12 insertions(+), 121 deletions(-) delete mode 100644 tests/fixtures/consoles/serve-vite-with-logs.ts delete mode 100644 tests/fixtures/consoles/serve-vite.ts diff --git a/package-lock.json b/package-lock.json index 7513432..5c1ce58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/core", - "version": "5.9.0", + "version": "5.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/core", - "version": "5.9.0", + "version": "5.10.0", "license": "MIT", "dependencies": { "pretty-repl": "^3.1.2", @@ -17,7 +17,7 @@ "@athenna/common": "^5.5.0", "@athenna/config": "^5.1.0", "@athenna/cron": "^5.4.0", - "@athenna/http": "^5.14.0", + "@athenna/http": "^5.15.0", "@athenna/ioc": "^5.0.0", "@athenna/logger": "^5.1.0", "@athenna/test": "^5.2.0", @@ -38,8 +38,7 @@ "lint-staged": "^12.5.0", "nodemon": "^3.1.9", "prettier": "^2.8.8", - "vite": "^6.0.6", - "vite-plugin-restart": "^0.4.2" + "vite": "^6.0.6" }, "engines": { "node": ">=20.0.0" @@ -130,9 +129,9 @@ } }, "node_modules/@athenna/http": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/@athenna/http/-/http-5.14.0.tgz", - "integrity": "sha512-A4hqxlsu6QZBPHwEm5tGaOyQ4FoCF5cfBWcC3aKtM9yhC5ajFBTznezAJ6fZHWpOOO1ph/HyV22ublHTwd68WA==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/@athenna/http/-/http-5.15.0.tgz", + "integrity": "sha512-CC4OprXRjtTbaGQGqH0IGqIv/f8DrILZWuWCqrbny/fPSc8hc9jnn1VFqguwzw7Lv9h4Go2rycP/0MSqsmWaxQ==", "dev": true, "engines": { "node": ">=20.0.0" @@ -12071,21 +12070,6 @@ } } }, - "node_modules/vite-plugin-restart": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/vite-plugin-restart/-/vite-plugin-restart-0.4.2.tgz", - "integrity": "sha512-9aWN2ScJ8hbT7aC8SDeZnsbWapnslz1vhNq6Vgf2GU9WdN4NExlrWhtnu7pmtOUG3Guj8y6lPcUZ+ls7SVP33w==", - "dev": true, - "dependencies": { - "micromatch": "^4.0.8" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - }, - "peerDependencies": { - "vite": "^2.9.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" - } - }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", diff --git a/package.json b/package.json index 4e52007..4627214 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/core", - "version": "5.9.0", + "version": "5.10.0", "description": "One foundation for multiple applications.", "license": "MIT", "author": "João Lenon ", @@ -85,7 +85,7 @@ "@athenna/common": "^5.5.0", "@athenna/config": "^5.1.0", "@athenna/cron": "^5.4.0", - "@athenna/http": "^5.14.0", + "@athenna/http": "^5.15.0", "@athenna/ioc": "^5.0.0", "@athenna/logger": "^5.1.0", "@athenna/test": "^5.2.0", @@ -106,8 +106,7 @@ "lint-staged": "^12.5.0", "nodemon": "^3.1.9", "prettier": "^2.8.8", - "vite": "^6.0.6", - "vite-plugin-restart": "^0.4.2" + "vite": "^6.0.6" }, "c8": { "all": true, diff --git a/src/applications/Http.ts b/src/applications/Http.ts index 0b8a94e..7b4a46f 100644 --- a/src/applications/Http.ts +++ b/src/applications/Http.ts @@ -34,10 +34,7 @@ export class Http { ioc.safeUse('Athenna/Core/HttpRoute').register() - if (process.argv.includes('--vite')) { - await server.viteReady() - } - + await server.viteReady() await server.listen({ host: options.host, port: options.port }) if (Config.notExists('rc.bootLogs') || Config.is('rc.bootLogs', false)) { diff --git a/src/commands/ServeCommand.ts b/src/commands/ServeCommand.ts index 1a7ddc5..44c7c21 100644 --- a/src/commands/ServeCommand.ts +++ b/src/commands/ServeCommand.ts @@ -20,14 +20,6 @@ export class ServeCommand extends BaseCommand { }) public watch: boolean - @Option({ - signature: '-v, --vite', - description: - 'Turn on vite dev server for HMR and static files compilation.', - default: false - }) - public vite: boolean - public static signature(): string { return 'serve' } @@ -44,15 +36,9 @@ export class ServeCommand extends BaseCommand { if (this.watch) { const nodemon = this.getNodemon() - const nodeArgs = [] - - if (this.vite) { - nodeArgs.push('--vite') - } nodemon({ script: entrypoint.replace('.ts', '.js'), - args: nodeArgs, ignore: [ '.git', '.github', @@ -61,6 +47,7 @@ export class ServeCommand extends BaseCommand { '.fleet', 'public', '*.edge', + 'vite.config.*', 'node_modules/**/node_modules' ], watch: [ diff --git a/tests/fixtures/consoles/serve-vite-with-logs.ts b/tests/fixtures/consoles/serve-vite-with-logs.ts deleted file mode 100644 index 674b2c9..0000000 --- a/tests/fixtures/consoles/serve-vite-with-logs.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @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 { Path } from '@athenna/common' -import { ViewProvider } from '@athenna/view' -import { Rc, Config } from '@athenna/config' -import { LoggerProvider } from '@athenna/logger' -import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' - -new ViewProvider().register() -new LoggerProvider().register() -new ArtisanProvider().register() - -await Config.loadAll(Path.fixtures('config')) - -await Rc.setFile(Path.pwd('package.json')) - -Path.mergeDirs(Config.get('rc.directories', {})) - -await new ConsoleKernel().registerCommands() - -Config.set('rc.bootLogs', true) - -await Artisan.parse(process.argv) diff --git a/tests/fixtures/consoles/serve-vite.ts b/tests/fixtures/consoles/serve-vite.ts deleted file mode 100644 index 3964b6c..0000000 --- a/tests/fixtures/consoles/serve-vite.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @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 { Path } from '@athenna/common' -import { ViewProvider } from '@athenna/view' -import { Rc, Config } from '@athenna/config' -import { LoggerProvider } from '@athenna/logger' -import { Artisan, ConsoleKernel, ArtisanProvider } from '@athenna/artisan' - -new ViewProvider().register() -new LoggerProvider().register() -new ArtisanProvider().register() - -await Config.loadAll(Path.fixtures('config')) - -await Rc.setFile(Path.pwd('package.json')) - -Path.mergeDirs(Config.get('rc.directories', {})) - -await new ConsoleKernel().registerCommands() - -await Artisan.parse(process.argv) diff --git a/tests/unit/commands/ServeCommandTest.ts b/tests/unit/commands/ServeCommandTest.ts index 6c8c05c..3dc4906 100644 --- a/tests/unit/commands/ServeCommandTest.ts +++ b/tests/unit/commands/ServeCommandTest.ts @@ -67,22 +67,4 @@ export default class ServeCommandTest extends BaseCommandTest { output.assertSucceeded() } - - @Test() - public async shouldBeAbleToExecuteServeCommandWithVite({ command }: Context) { - const output = await command.run('serve --vite', { - path: Path.fixtures('consoles/serve-vite.ts') - }) - - output.assertSucceeded() - } - - @Test() - public async shouldBeAbleToExecuteServeCommandWithViteWithLogs({ command }: Context) { - const output = await command.run('serve --vite', { - path: Path.fixtures('consoles/serve-vite-with-logs.ts') - }) - - output.assertSucceeded() - } }