diff --git a/framework-boilerplates/elysia-bun/.gitignore b/framework-boilerplates/elysia-bun/.gitignore new file mode 100644 index 0000000000..87e56100f8 --- /dev/null +++ b/framework-boilerplates/elysia-bun/.gitignore @@ -0,0 +1,42 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel + +**/*.trace +**/*.zip +**/*.tar.gz +**/*.tgz +**/*.log +package-lock.json +**/*.bun \ No newline at end of file diff --git a/framework-boilerplates/elysia-bun/README.md b/framework-boilerplates/elysia-bun/README.md new file mode 100644 index 0000000000..bebf061007 --- /dev/null +++ b/framework-boilerplates/elysia-bun/README.md @@ -0,0 +1,19 @@ +# Elysia with Bun runtime + +## Getting Started + +To get started with this template, simply paste this command into your terminal: + +```bash +bun create elysia ./elysia-example +``` + +## Development + +To start the development server run: + +```bash +bun run dev +``` + +Open http://localhost:3000/ with your browser to see the result. diff --git a/framework-boilerplates/elysia-bun/bun.lock b/framework-boilerplates/elysia-bun/bun.lock new file mode 100644 index 0000000000..f940ce15cd --- /dev/null +++ b/framework-boilerplates/elysia-bun/bun.lock @@ -0,0 +1,64 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "app", + "dependencies": { + "elysia": "latest", + "typescript": "^5.9.3", + }, + "devDependencies": { + "bun-types": "latest", + }, + }, + }, + "packages": { + "@borewit/text-codec": ["@borewit/text-codec@0.1.1", "", {}, "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA=="], + + "@sinclair/typebox": ["@sinclair/typebox@0.34.41", "", {}, "sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g=="], + + "@tokenizer/inflate": ["@tokenizer/inflate@0.2.7", "", { "dependencies": { "debug": "^4.4.0", "fflate": "^0.8.2", "token-types": "^6.0.0" } }, "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg=="], + + "@tokenizer/token": ["@tokenizer/token@0.3.0", "", {}, "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="], + + "@types/node": ["@types/node@24.9.2", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA=="], + + "@types/react": ["@types/react@19.2.2", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="], + + "bun-types": ["bun-types@1.3.1", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-NMrcy7smratanWJ2mMXdpatalovtxVggkj11bScuWuiOoXTiKIu2eVS1/7qbyI/4yHedtsn175n4Sm4JcdHLXw=="], + + "cookie": ["cookie@1.0.2", "", {}, "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA=="], + + "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], + + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + + "elysia": ["elysia@1.4.13", "", { "dependencies": { "cookie": "^1.0.2", "exact-mirror": "0.2.2", "fast-decode-uri-component": "^1.0.1", "memoirist": "^0.4.0" }, "peerDependencies": { "@sinclair/typebox": ">= 0.34.0 < 1", "@types/bun": ">= 1.2.0", "file-type": ">= 20.0.0", "openapi-types": ">= 12.0.0", "typescript": ">= 5.0.0" }, "optionalPeers": ["@types/bun", "typescript"] }, "sha512-6QaWQEm7QN1UCo1TPpEjaRJPHUmnM7R29y6LY224frDGk5PrpAnWmdHkoZxkcv+JRWp1j2ROr2IHbxHbG/jRjw=="], + + "exact-mirror": ["exact-mirror@0.2.2", "", { "peerDependencies": { "@sinclair/typebox": "^0.34.15" }, "optionalPeers": ["@sinclair/typebox"] }, "sha512-CrGe+4QzHZlnrXZVlo/WbUZ4qQZq8C0uATQVGVgXIrNXgHDBBNFD1VRfssRA2C9t3RYvh3MadZSdg2Wy7HBoQA=="], + + "fast-decode-uri-component": ["fast-decode-uri-component@1.0.1", "", {}, "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg=="], + + "fflate": ["fflate@0.8.2", "", {}, "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A=="], + + "file-type": ["file-type@21.0.0", "", { "dependencies": { "@tokenizer/inflate": "^0.2.7", "strtok3": "^10.2.2", "token-types": "^6.0.0", "uint8array-extras": "^1.4.0" } }, "sha512-ek5xNX2YBYlXhiUXui3D/BXa3LdqPmoLJ7rqEx2bKJ7EAUEfmXgW0Das7Dc6Nr9MvqaOnIqiPV0mZk/r/UpNAg=="], + + "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], + + "memoirist": ["memoirist@0.4.0", "", {}, "sha512-zxTgA0mSYELa66DimuNQDvyLq36AwDlTuVRbnQtB+VuTcKWm5Qc4z3WkSpgsFWHNhexqkIooqpv4hdcqrX5Nmg=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "openapi-types": ["openapi-types@12.1.3", "", {}, "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw=="], + + "strtok3": ["strtok3@10.3.4", "", { "dependencies": { "@tokenizer/token": "^0.3.0" } }, "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg=="], + + "token-types": ["token-types@6.1.1", "", { "dependencies": { "@borewit/text-codec": "^0.1.0", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" } }, "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ=="], + + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + + "uint8array-extras": ["uint8array-extras@1.5.0", "", {}, "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A=="], + + "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + } +} diff --git a/framework-boilerplates/elysia-bun/package.json b/framework-boilerplates/elysia-bun/package.json new file mode 100644 index 0000000000..e1e54ef80f --- /dev/null +++ b/framework-boilerplates/elysia-bun/package.json @@ -0,0 +1,17 @@ +{ + "name": "app", + "version": "1.0.50", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "dev": "bun run --watch src/index.ts" + }, + "type": "module", + "dependencies": { + "elysia": "latest", + "typescript": "^5.9.3" + }, + "devDependencies": { + "bun-types": "latest" + }, + "module": "src/index.js" +} diff --git a/framework-boilerplates/elysia-bun/src/index.ts b/framework-boilerplates/elysia-bun/src/index.ts new file mode 100644 index 0000000000..39f36ab52d --- /dev/null +++ b/framework-boilerplates/elysia-bun/src/index.ts @@ -0,0 +1,10 @@ +import { Elysia } from 'elysia' + +const runtime = typeof globalThis.Bun !== 'undefined' ? 'bun' : 'node' + +const app = new Elysia() + .get('/', () => `Hello from Elysia, running on ${runtime}`) + .get('/user/:id', ({ params: { id } }) => id) + .post('/form', ({ body }) => body) + +export default app diff --git a/framework-boilerplates/elysia-bun/tsconfig.json b/framework-boilerplates/elysia-bun/tsconfig.json new file mode 100644 index 0000000000..d693ee1031 --- /dev/null +++ b/framework-boilerplates/elysia-bun/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "module": "nodenext", + "moduleResolution": "nodenext", + "types": ["bun-types"], + "strict": true, + "skipLibCheck": true + } +} diff --git a/framework-boilerplates/elysia-bun/vercel.json b/framework-boilerplates/elysia-bun/vercel.json new file mode 100644 index 0000000000..2b6ae973d6 --- /dev/null +++ b/framework-boilerplates/elysia-bun/vercel.json @@ -0,0 +1,3 @@ +{ + "bunVersion": "1.x" +} diff --git a/framework-boilerplates/hono-bun/src/index.ts b/framework-boilerplates/hono-bun/src/index.ts index e261f9a634..e2e287d140 100644 --- a/framework-boilerplates/hono-bun/src/index.ts +++ b/framework-boilerplates/hono-bun/src/index.ts @@ -1,14 +1,14 @@ -import { Hono } from "hono"; +import { Hono } from 'hono' -const app = new Hono(); +const app = new Hono() const welcomeStrings = [ `Hello Hono from Bun ${process.versions.bun}!`, - "To learn more about Hono + Bun on Vercel, visit https://vercel.com/docs/frameworks/backend/hono", -]; + 'To learn more about Hono + Bun on Vercel, visit https://vercel.com/docs/frameworks/backend/hono', +] -app.get("/", (c) => { - return c.text(welcomeStrings.join("\n\n")); -}); +app.get('/', (c) => { + return c.text(welcomeStrings.join('\n\n')) +}) -export default app; +export default app diff --git a/framework-boilerplates/nitro-bun/nitro.config.ts b/framework-boilerplates/nitro-bun/nitro.config.ts index 7779c777d5..27d5812188 100644 --- a/framework-boilerplates/nitro-bun/nitro.config.ts +++ b/framework-boilerplates/nitro-bun/nitro.config.ts @@ -1,5 +1,5 @@ //https://nitro.unjs.io/config export default defineNitroConfig({ - srcDir: "server", - compatibilityDate: "2025-10-28", -}); + srcDir: 'server', + compatibilityDate: '2025-10-28', +})