chore: optimize Bun and TypeScript configuration for improved development workflow

- Update bunfig.toml with environment-specific settings and performance optimizations
- Enhance package.json scripts with additional development and maintenance commands
- Refactor tsconfig.json for better Bun and TypeScript compatibility
- Add hot reloading, profiling, and type checking configurations
- Improve build and development scripts with minification and frozen lockfile options
This commit is contained in:
jango-blockchained
2025-02-04 03:25:46 +01:00
parent 790a37e49f
commit e503da1dfd
3 changed files with 35 additions and 26 deletions

View File

@@ -21,3 +21,16 @@ disable = false
[debug] [debug]
port = 9229 port = 9229
[env]
# Environment-specific configurations
development.LOG_LEVEL = "debug"
production.LOG_LEVEL = "warn"
[hot]
restart = true
reload = true
[performance]
gc = true
optimize = true

View File

@@ -6,14 +6,18 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "bun run dist/index.js", "start": "bun run dist/index.js",
"dev": "bun run --watch src/index.ts", "dev": "bun --hot --watch src/index.ts",
"build": "bun build ./src/index.ts --outdir ./dist --target node", "build": "bun build ./src/index.ts --outdir ./dist --target node --minify",
"test": "bun test", "test": "bun test",
"test:watch": "bun test --watch", "test:watch": "bun test --watch",
"test:coverage": "bun test --coverage", "test:coverage": "bun test --coverage",
"lint": "eslint . --ext .ts", "lint": "eslint . --ext .ts",
"format": "prettier --write \"src/**/*.ts\"", "format": "prettier --write \"src/**/*.ts\"",
"prepare": "husky install" "prepare": "husky install",
"profile": "bun --inspect src/index.ts",
"clean": "rm -rf dist .bun",
"typecheck": "bun x tsc --noEmit",
"preinstall": "bun install --frozen-lockfile"
}, },
"dependencies": { "dependencies": {
"@elysiajs/cors": "^1.2.0", "@elysiajs/cors": "^1.2.0",

View File

@@ -1,44 +1,36 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES2022", "target": "esnext",
"module": "NodeNext", "module": "esnext",
"moduleResolution": "NodeNext", "lib": [
"outDir": "dist", "esnext",
"rootDir": ".", "dom"
],
"strict": true, "strict": true,
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true, "skipLibCheck": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true, "resolveJsonModule": true,
"declaration": true, "isolatedModules": true,
"sourceMap": true, "noEmit": true,
"allowJs": true, "jsx": "react-jsx",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": [ "types": [
"bun-types" "bun-types"
], ],
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"ES2022"
],
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"*": [ "@/*": [
"node_modules/*" "./src/*"
] ]
} }
}, },
"include": [ "include": [
"src/**/*", "src/**/*",
"__tests__/**/*", "__tests__/**/*"
"jest.config.ts"
], ],
"exclude": [ "exclude": [
"node_modules", "node_modules",
"dist", "dist"
"coverage"
] ]
} }