mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: simplified build script
This commit is contained in:
1 parent
38f912dc0a
commit
876fb0fc5e
4 files changed
+39
-40
No files matched your search
@@ -5,3 +5,13 @@ One of the biggest updates ever! This changelog's size does not truly represent
|
|||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
- Disabled the `/clan-event` command
|
- Disabled the `/clan-event` command
|
||||||
|
|
||||||
|
## Technical Changes
|
||||||
|
|
||||||
|
- Removed all server assets
|
||||||
|
- Simplified build script to only compile the bot
|
||||||
|
- Upgraded the build script to TypeScript
|
||||||
|
- Moved docs build to `dist/docs`
|
||||||
|
- Split `tsconfig.json` for Next.js and esbuild
|
||||||
|
- Removed Gitpod config
|
||||||
|
- Use
|
||||||
+2
-5
@@ -1,21 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkrieg",
|
"name": "blitzkrieg",
|
||||||
"version": "1.12.9",
|
"version": "1.30.0",
|
||||||
"description": "🎉 All-in-one Discord bot for everything World of Tanks Blitz",
|
"description": "🎉 All-in-one Discord bot for everything World of Tanks Blitz",
|
||||||
"main": "src/server.ts",
|
"main": "src/server.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:bot": "node scripts/build --build=bot",
|
"build:bot": "vite-node --script scripts/build",
|
||||||
"build:server": "node scripts/build --build=server",
|
|
||||||
"build:website": "next build",
|
"build:website": "next build",
|
||||||
"build:docs": "vitepress build docs",
|
"build:docs": "vitepress build docs",
|
||||||
"build:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard",
|
"build:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard",
|
||||||
"dev:bot": "yarn build:bot && yarn start:bot",
|
"dev:bot": "yarn build:bot && yarn start:bot",
|
||||||
"dev:server": "yarn build:server && yarn start:server",
|
|
||||||
"dev:docs": "vitepress dev docs",
|
"dev:docs": "vitepress dev docs",
|
||||||
"dev:website": "next dev",
|
"dev:website": "next dev",
|
||||||
"start:bot": "node --enable-source-maps --trace-warnings dist/bot/index.cjs",
|
"start:bot": "node --enable-source-maps --trace-warnings dist/bot/index.cjs",
|
||||||
"start:server": "node --enable-source-maps --trace-warnings dist/server/index.cjs",
|
|
||||||
"start:website": "next start",
|
"start:website": "next start",
|
||||||
"host:docs": "vitepress preview docs",
|
"host:docs": "vitepress preview docs",
|
||||||
"publish:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard --publish",
|
"publish:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard --publish",
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
import { build } from 'esbuild';
|
|
||||||
import { argv } from 'process';
|
|
||||||
|
|
||||||
const targetFile = argv
|
|
||||||
.find((arg) => arg.startsWith('--build='))
|
|
||||||
?.split('=')[1];
|
|
||||||
const files = targetFile ? [targetFile] : ['bot', 'server'];
|
|
||||||
|
|
||||||
files.forEach(async (file) => {
|
|
||||||
console.log(`Building ${file}...`);
|
|
||||||
|
|
||||||
await build({
|
|
||||||
entryPoints: [`src/${file}.ts`],
|
|
||||||
outfile: `dist/${file}/index.cjs`,
|
|
||||||
|
|
||||||
platform: 'node',
|
|
||||||
tsconfig: 'tsconfig.esbuild.json',
|
|
||||||
loader: {
|
|
||||||
'.node': 'copy',
|
|
||||||
'.ttf': 'file',
|
|
||||||
},
|
|
||||||
format: 'cjs',
|
|
||||||
jsx: 'transform',
|
|
||||||
|
|
||||||
bundle: true,
|
|
||||||
sourcemap: true,
|
|
||||||
minifyIdentifiers: false, // cause goofy errors
|
|
||||||
minifySyntax: true,
|
|
||||||
minifyWhitespace: true,
|
|
||||||
|
|
||||||
logLevel: 'info',
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Built ${file}`);
|
|
||||||
});
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { build } from 'esbuild';
|
||||||
|
|
||||||
|
console.log('Building bot...');
|
||||||
|
|
||||||
|
await build({
|
||||||
|
entryPoints: ['src/bot.ts'],
|
||||||
|
outfile: 'dist/bot/index.cjs',
|
||||||
|
|
||||||
|
platform: 'node',
|
||||||
|
tsconfig: 'tsconfig.esbuild.json',
|
||||||
|
loader: {
|
||||||
|
'.node': 'copy',
|
||||||
|
'.ttf': 'file',
|
||||||
|
},
|
||||||
|
format: 'cjs',
|
||||||
|
jsx: 'transform',
|
||||||
|
|
||||||
|
bundle: true,
|
||||||
|
sourcemap: true,
|
||||||
|
minifyIdentifiers: false, // cause goofy errors
|
||||||
|
minifySyntax: true,
|
||||||
|
minifyWhitespace: true,
|
||||||
|
|
||||||
|
logLevel: 'info',
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('Built bot');
|
||||||
Reference in new issue
Block a user