Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta: Build system overhaul #1057

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move to the esbuild bundler
esbuild has built-in TypeScript support (so no more ts-node required)
and allows us to use any Node version (as it transforms newer JS
features into older syntax)
It is also just a great deal faster than tsc
  • Loading branch information
CommandMC committed May 18, 2024
commit fc324f2f0183004950cba0bd12bea5750b801f8d
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -4,15 +4,11 @@
"description": "SerenityOS Discord Bot",
"main": "index.js",
"license": "BSD-2-Clause",
"engines": {
"node": ">=16 <=18.17.1"
},
"scripts": {
"lint": "eslint . --ext .ts",
"lint-and-fix": "eslint . --ext .ts --fix",
"start:dev": "nodemon --watch './src/**' --ext 'ts,js,json' --exec \"ts-node --files ./src/index.ts\"",
"prebuild": "rimraf ./build",
"build": "tsc",
"start:dev": "nodemon",
"build": "esbuild src/index.ts --minify --bundle --platform=node --packages=external --outfile=build/index.js",
"prestart": "npm run build",
"start": "node build/index.js",
"test": "mocha -r ts-node/register tests/**/*.test.ts"
@@ -23,7 +19,7 @@
],
"ext": ".ts,.js",
"ignore": [],
"exec": "ts-node --files ./src/index.ts"
"exec": "npm run start"
},
"repository": {
"type": "git",
@@ -63,9 +59,9 @@
"bufferutil": "^4.0.7",
"discord.js": "^14.7.1",
"dotenv": "^16.0.3",
"esbuild": "^0.21.2",
"mastodon": "^1.2.2",
"octokit-plugin-create-pull-request": "^4.1.1",
"rimraf": "^5.0.0",
"typescript": "^5.0.4",
"utf-8-validate": "^6.0.3",
"zlib-sync": "^0.1.8"
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -14,12 +14,12 @@
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "build", /* Redirect output structure to the directory. */
// "outDir": "build", /* Redirect output structure to the directory. */
"rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
"noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
Loading