From caabb51ae0b15f3498c72adc0915ddc2f4178b3b Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sat, 11 Jul 2026 12:56:54 -0500 Subject: [PATCH] =?UTF-8?q?fix(starter):=20make=20scaffolded=20app=20runna?= =?UTF-8?q?ble=20=E2=80=94=20mountpoint,=20Deno=20entrypoint,=20import=20m?= =?UTF-8?q?ap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Diego Resendez --- src/template.rs | 3 +++ template/starter/deno.json | 7 ++++++- template/starter/src/app.module.ts | 2 +- template/starter/src/main.ts | 7 +++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 template/starter/src/main.ts diff --git a/src/template.rs b/src/template.rs index 1bcf073..ef97caa 100644 --- a/src/template.rs +++ b/src/template.rs @@ -45,5 +45,8 @@ mod tests { assert!(!html.contains("{{project_name}}")); assert!(d.path().join("src/controllers/home.controller.ts").exists()); assert!(d.path().join("matcha.toml").exists()); + assert!(d.path().join("src/main.ts").exists()); + let module = std::fs::read_to_string(d.path().join("src/app.module.ts")).unwrap(); + assert!(module.contains("mountpoint")); } } diff --git a/template/starter/deno.json b/template/starter/deno.json index 92ad661..700555c 100644 --- a/template/starter/deno.json +++ b/template/starter/deno.json @@ -1 +1,6 @@ -{ "tasks": { "dev": "deno run --watch --allow-net --allow-read src/main.ts" } } +{ + "compilerOptions": { "experimentalDecorators": true }, + "unstable": ["sloppy-imports"], + "imports": { "@green-tea/core": "npm:@green-tea/core@^26.7.0-beta.0" }, + "tasks": { "dev": "deno run --watch --allow-net --allow-read --allow-env src/main.ts" } +} diff --git a/template/starter/src/app.module.ts b/template/starter/src/app.module.ts index 5a4752b..4d303e0 100644 --- a/template/starter/src/app.module.ts +++ b/template/starter/src/app.module.ts @@ -1,5 +1,5 @@ import { Module } from '@green-tea/core'; import { HomeController } from './controllers/home.controller'; -@Module({ controllers: [HomeController] }) +@Module({ mountpoint: '/', controllers: [HomeController] }) export class AppModule {} diff --git a/template/starter/src/main.ts b/template/starter/src/main.ts new file mode 100644 index 0000000..23445c9 --- /dev/null +++ b/template/starter/src/main.ts @@ -0,0 +1,7 @@ +import { createApp } from '@green-tea/core'; +import { AppModule } from './app.module'; + +const app = createApp({ modules: [AppModule] }); + +Deno.serve({ port: 8000 }, app.fetch); +console.log('🍵 green-tea running on http://localhost:8000');