diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3bb5a5e..490aa36 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,8 @@ jobs: uses: actions/checkout@v4 - name: Setup Bun - uses: oven-sh/setup-bun@v1 + # https://github.com/oven-sh/setup-bun/issues/37#issuecomment-2256820622 + uses: oven-sh/setup-bun@feat/implement-wildcard-resolution-into-the-action with: bun-version: 1.0.x diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7bf1660..81f595c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,8 @@ jobs: uses: actions/checkout@v4 - name: Setup Bun - uses: oven-sh/setup-bun@v1 + # https://github.com/oven-sh/setup-bun/issues/37#issuecomment-2256820622 + uses: oven-sh/setup-bun@feat/implement-wildcard-resolution-into-the-action with: bun-version: 1.0.x diff --git a/.mise.toml b/.mise.toml index e4d3255..e5ccf8b 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,2 +1,4 @@ [tools] bun = "1" +# Note: Required for the lefthook pre-commit hook +node = "20.16.0" diff --git a/bun.lockb b/bun.lockb index 30278ce..727d1be 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 71ac7c8..a59336d 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "url": "https://pulsate.dev" }, "scripts": { - "dev": "bun run src/index.ts", - "start": "bun run build/index.js", + "dev": "bun run --watch src/index.ts", + "start": "NODE_ENV=production bun run build/index.js", "build": "bun build --entrypoints ./src/index.ts --outdir ./build --target bun", "format": "bunx @biomejs/biome format --write ./src", "lint": "bunx @biomejs/biome lint ./src", @@ -21,7 +21,7 @@ "postinstall": "lefthook install" }, "dependencies": { - "hono": "^4.1.3", + "elysia": "^1.1.6", "lefthook": "^1.6.7" }, "devDependencies": { @@ -31,5 +31,8 @@ }, "peerDependencies": { "typescript": "^5.0.0" - } + }, + "trustedDependencies": [ + "@biomejs/biome" + ] } diff --git a/src/index.ts b/src/index.ts index 6e73352..6483bc2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,41 +1,32 @@ -import { Hono } from "hono"; - -const app = new Hono(); - -app.get("/", (c) => { - return c.redirect("https://pulsate.dev", 302); -}); - -app.get("/docs", (c) => { - return c.redirect("https://docs.pulsate.dev", 302); -}); - -app.get("/api", (c) => { - return c.redirect("https://api.pulsate.dev/reference", 302); -}); - -app.get("/discord", (c) => { - return c.redirect("https://discord.gg/NmczMnWGvh", 302); -}); - -app.get("/github", (c) => { - return c.redirect("https://github.com/pulsate-dev/", 302); -}); - -app.get("/x", (c) => { - return c.redirect("https://x.com/pulsate_dev", 302); -}); - -app.get("/youtube", (c) => { - return c.redirect("https://youtube.com/@pulsate-dev", 302); -}); - -app.get("/bluesky", (c) => { - return c.redirect("https://bsky.app/profile/pulsate.dev", 302); -}); - -app.get("/discussions", (c) => { - return c.redirect("https://github.com/orgs/pulsate-dev/discussions", 302); -}); - -export default app; +import { Elysia } from "elysia"; + +new Elysia() + .get("/", ({ redirect }) => { + return redirect("https://pulsate.dev", 302); + }) + .get("/docs", ({ redirect }) => { + return redirect("https://docs.pulsate.dev", 302); + }) + .get("/api", ({ redirect }) => { + return redirect("https://api.pulsate.dev/reference", 302); + }) + .get("/discord", ({ redirect }) => { + return redirect("https://discord.gg/NmczMnWGvh", 302); + }) + .get("/github", ({ redirect }) => { + return redirect("https://github.com/pulsate-dev", 302); + }) + .get("/x", ({ redirect }) => { + return redirect("https://x.com/pulsate_dev", 302); + }) + .get("/youtube", ({ redirect }) => { + return redirect("https://youtube.com/@pulsate-dev", 302); + }) + .get("/discussions", ({ redirect }) => { + return redirect("https://github.com/orgs/pulsate-dev/discussions", 302); + }) + .listen(3000); + +if (process.env.NODE_ENV !== "production") { + console.log("Listening on port 3000 - http://localhost:3000"); +}