@athenna/core
Advanced tools
Comparing version 5.6.0 to 5.7.0
{ | ||
"name": "@athenna/core", | ||
"version": "5.6.0", | ||
"version": "5.7.0", | ||
"description": "One foundation for multiple applications.", | ||
@@ -85,6 +85,6 @@ "license": "MIT", | ||
"@athenna/artisan": "^5.3.0", | ||
"@athenna/common": "^5.3.0", | ||
"@athenna/common": "^5.5.0", | ||
"@athenna/config": "^5.1.0", | ||
"@athenna/cron": "^5.4.0", | ||
"@athenna/http": "^5.6.0", | ||
"@athenna/http": "^5.10.0", | ||
"@athenna/ioc": "^5.0.0", | ||
@@ -91,0 +91,0 @@ "@athenna/logger": "^5.1.0", |
@@ -28,2 +28,5 @@ /** | ||
ioc.safeUse('Athenna/Core/HttpRoute').register(); | ||
if (process.argv.includes('--vite')) { | ||
await server.viteReady(); | ||
} | ||
await server.listen({ host: options.host, port: options.port }); | ||
@@ -60,2 +63,3 @@ if (Config.notExists('rc.bootLogs') || Config.is('rc.bootLogs', false)) { | ||
await kernel.registerSwagger(); | ||
await kernel.registerVite(); | ||
await kernel.registerRateLimit(); | ||
@@ -62,0 +66,0 @@ await kernel.registerRTracer(options.trace); |
@@ -81,35 +81,6 @@ /** | ||
async getViteConfig(vite) { | ||
const defaultConfig = { | ||
root: Path.pwd(), | ||
assetsUrl: '/assets', | ||
buildDirectory: 'public/assets', | ||
logLevel: 'silent', | ||
css: { | ||
preprocessorOptions: { | ||
scss: { | ||
api: 'modern' | ||
} | ||
} | ||
}, | ||
build: { | ||
assetsDir: '', | ||
manifest: true, | ||
emptyOutDir: true, | ||
outDir: 'public/assets', | ||
assetsInlineLimit: 0, | ||
rollupOptions: { | ||
output: { | ||
entryFileNames: '[name].js', | ||
chunkFileNames: '[name].js', | ||
assetFileNames: '[name].[ext]' | ||
} | ||
} | ||
} | ||
}; | ||
const { config: fileConfig } = await vite.loadConfigFromFile({ | ||
const { config } = await vite.loadConfigFromFile({ | ||
command: 'build', | ||
mode: 'development' | ||
mode: 'production' | ||
}, undefined, Path.pwd()); | ||
const config = vite.mergeConfig(defaultConfig, fileConfig); | ||
await vite.build(config); | ||
return config; | ||
@@ -116,0 +87,0 @@ } |
@@ -17,4 +17,2 @@ /** | ||
getNodemon(): any; | ||
getVite(): Promise<typeof import("vite")>; | ||
getViteConfig(vite: any): Promise<any>; | ||
} |
@@ -31,13 +31,2 @@ /** | ||
const entrypoint = Config.get('rc.commands.serve.entrypoint', Path.bin(`main.${Path.ext()}`)); | ||
if (this.vite) { | ||
const formerNodeEnv = Env('NODE_ENV'); | ||
const vite = await this.getVite(); | ||
const config = await this.getViteConfig(vite); | ||
await vite.build(config); | ||
Log.channelOrVanilla('application').success('Static files successfully compiled with ({yellow} vite)'); | ||
/** | ||
* Vite changes NODE_ENV when building which we need to avoid. | ||
*/ | ||
process.env.NODE_ENV = formerNodeEnv; | ||
} | ||
if (this.watch) { | ||
@@ -77,13 +66,2 @@ const nodemon = this.getNodemon(); | ||
console.clear(); | ||
if (this.vite) { | ||
const formerNodeEnv = Env('NODE_ENV'); | ||
const vite = await this.getVite(); | ||
const config = await this.getViteConfig(vite); | ||
await vite.build(config); | ||
Log.channelOrVanilla('application').success('Static files successfully recompiled with ({yellow} vite)'); | ||
/** | ||
* Vite changes NODE_ENV when building which we need to avoid. | ||
*/ | ||
process.env.NODE_ENV = formerNodeEnv; | ||
} | ||
Log.channelOrVanilla('application').success('Application successfully restarted'); | ||
@@ -102,41 +80,2 @@ }) | ||
} | ||
async getVite() { | ||
return import('vite'); | ||
} | ||
async getViteConfig(vite) { | ||
const defaultConfig = { | ||
root: Path.pwd(), | ||
assetsUrl: '/assets', | ||
buildDirectory: 'public/assets', | ||
logLevel: 'silent', | ||
css: { | ||
preprocessorOptions: { | ||
scss: { | ||
api: 'modern' | ||
} | ||
} | ||
}, | ||
build: { | ||
assetsDir: '', | ||
manifest: true, | ||
emptyOutDir: true, | ||
outDir: 'public/assets', | ||
assetsInlineLimit: 0, | ||
rollupOptions: { | ||
output: { | ||
entryFileNames: '[name].js', | ||
chunkFileNames: '[name].js', | ||
assetFileNames: '[name].[ext]' | ||
} | ||
} | ||
} | ||
}; | ||
const { config: fileConfig } = await vite.loadConfigFromFile({ | ||
command: 'build', | ||
mode: 'development' | ||
}, undefined, Path.pwd()); | ||
const config = vite.mergeConfig(defaultConfig, fileConfig); | ||
await vite.build(config); | ||
return config; | ||
} | ||
} | ||
@@ -154,3 +93,3 @@ __decorate([ | ||
signature: '-v, --vite', | ||
description: 'Use vite to build your application static files.', | ||
description: 'Turn on vite dev server for HMR and static files compilation.', | ||
default: false | ||
@@ -157,0 +96,0 @@ }), |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
11
123121
3267