Skip to content

Commit 9860f32

Browse files
committed
Add Elysia option to init webframeworks
1 parent 7ed1991 commit 9860f32

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

packages/cli/src/init/const.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
export const PACKAGE_MANAGER = ["deno", "pnpm", "bun", "yarn", "npm"] as const;
2-
export const WEB_FRAMEWORK = ["hono", "nitro", "next", "express"] as const;
2+
export const WEB_FRAMEWORK = [
3+
"hono",
4+
"nitro",
5+
"next",
6+
"elysia",
7+
"express",
8+
] as const;
39
export const MESSAGE_QUEUE = ["denokv", "redis", "postgres", "amqp"] as const;
410
export const KV_STORE = ["denokv", "redis", "postgres"] as const;

packages/cli/src/init/webframeworks.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,32 @@ const webFrameworks: WebFrameworks = {
7979
}),
8080
defaultPort: 8000,
8181
},
82+
elysia: {
83+
label: "ElysiaJS",
84+
packageManagers: ["bun"],
85+
init: ({ projectName, packageManager: pm }) => ({
86+
dependencies: {
87+
elysia: "^1.3.6",
88+
"@fedify/elysia": PACKAGE_VERSION,
89+
},
90+
devDependencies: {
91+
"@types/bun": "^1.2.19",
92+
},
93+
federationFile: "src/federation.ts",
94+
loggingFile: "src/logging.ts",
95+
files: {
96+
"src/index.ts": readTemplate("elysia/index.ts")
97+
.replace(/\/\* logger \*\//, projectName),
98+
},
99+
compilerOptions: undefined,
100+
tasks: {
101+
"dev": "bun run --hot ./src/index.ts",
102+
"prod": "bun run ./src/index.ts",
103+
},
104+
instruction: getInstruction(pm, 3000),
105+
}),
106+
defaultPort: 3000,
107+
},
82108
express: {
83109
label: "Express",
84110
packageManagers: PACKAGE_MANAGER,

0 commit comments

Comments
 (0)