From a4206e1adc53ea9958a43bdae6f32712944844f2 Mon Sep 17 00:00:00 2001 From: Oliver Bryan <04oliverbryan@gmail.com> Date: Sun, 7 Dec 2025 21:18:42 +0000 Subject: [PATCH] initial bun server --- .gitignore | 13 +++++++++++++ README.md | 18 ++++++++++++++++++ bun.lock | 26 ++++++++++++++++++++++++++ index.ts | 11 +++++++++++ package.json | 16 ++++++++++++++++ tsconfig.json | 29 +++++++++++++++++++++++++++++ 6 files changed, 113 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 bun.lock create mode 100644 index.ts create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fa523d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +node_modules +out +dist +logs + +# environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +.cache \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..02a932e --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# eussi + +The server for Issue Project Manager + +To install dependencies: +```bash +bun install +``` + +To run "dev" script: +```bash +bun dev +``` + +To run "start" script (for deployment): +```bash +bun start +``` \ No newline at end of file diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..478882f --- /dev/null +++ b/bun.lock @@ -0,0 +1,26 @@ +{ + "lockfileVersion": 1, + "configVersion": 1, + "workspaces": { + "": { + "name": "eussi", + "devDependencies": { + "@types/bun": "latest", + }, + "peerDependencies": { + "typescript": "^5", + }, + }, + }, + "packages": { + "@types/bun": ["@types/bun@1.3.3", "", { "dependencies": { "bun-types": "1.3.3" } }, "sha512-ogrKbJ2X5N0kWLLFKeytG0eHDleBYtngtlbu9cyBKFtNL3cnpDZkNdQj8flVf6WTZUX5ulI9AY1oa7ljhSrp+g=="], + + "@types/node": ["@types/node@24.10.1", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ=="], + + "bun-types": ["bun-types@1.3.3", "", { "dependencies": { "@types/node": "*" } }, "sha512-z3Xwlg7j2l9JY27x5Qn3Wlyos8YAp0kKRlrePAOjgjMGS5IG6E7Jnlx736vH9UVI4wUICwwhC9anYL++XeOgTQ=="], + + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + + "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + } +} diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..dc06a41 --- /dev/null +++ b/index.ts @@ -0,0 +1,11 @@ +const DEV = process.argv.find(arg => ["--dev", "--developer", "-d"].includes(arg.toLowerCase())) != null +const PORT = process.argv.find(arg => arg.toLowerCase().startsWith("--port="))?.split("=")[1] || "3500" + +const server = Bun.serve({ + port: Number(PORT), + routes: { + "/": () => new Response(`eussi - dev mode: ${DEV}`), + } +}); + +console.log(`eussi (issue server) listening on ${server.url}`); diff --git a/package.json b/package.json new file mode 100644 index 0000000..b823ecb --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "eussi", + "module": "index.ts", + "type": "module", + "private": true, + "scripts": { + "dev": "bun --watch index.ts --dev --PORT=3000", + "start": "bun index.ts --PORT=3000" + }, + "devDependencies": { + "@types/bun": "latest" + }, + "peerDependencies": { + "typescript": "^5" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bfa0fea --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + // Environment setup & latest features + "lib": ["ESNext"], + "target": "ESNext", + "module": "Preserve", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + + // Some stricter flags (disabled by default) + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false + } +}