Develop #1
No files matched your search
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
**Date:** 2026-07-12
|
**Date:** 2026-07-12
|
||||||
**Branch:** `feature/matcha-multi-runtime` (off `develop`)
|
**Branch:** `feature/matcha-multi-runtime` (off `develop`)
|
||||||
**Goal:** `matcha new <name> --runtime <node|deno|bun>` scaffolds the starter for the chosen runtime. Shared app files are written once; only `main.ts` + runtime config + `matcha.toml` differ per runtime. Default runtime: **deno**.
|
**Goal:** `matcha new <name> --runtime <node|deno|bun>` scaffolds the starter for the chosen runtime. Shared app files are written once; only `main.ts` + runtime config + `matcha.toml` differ per runtime. Default runtime: **node** (green-tea is developed node-first; Node is the reference implementation. deno/bun via `--runtime`).
|
||||||
|
|
||||||
## Verified framework facts (from Green-Tea/core)
|
## Verified framework facts (from Green-Tea/core)
|
||||||
- `@green-tea/core` imports `reflect-metadata` internally (`src/index.ts:6`) — consumers need NO explicit import; it installs transitively with the package.
|
- `@green-tea/core` imports `reflect-metadata` internally (`src/index.ts:6`) — consumers need NO explicit import; it installs transitively with the package.
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||||
pub enum Runtime {
|
pub enum Runtime {
|
||||||
Node,
|
Node,
|
||||||
@@ -9,7 +8,6 @@ pub enum Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Runtime {
|
impl Runtime {
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn from_str(s: &str) -> Option<Runtime> {
|
pub fn from_str(s: &str) -> Option<Runtime> {
|
||||||
match s.trim() {
|
match s.trim() {
|
||||||
"node" => Some(Runtime::Node),
|
"node" => Some(Runtime::Node),
|
||||||
@@ -20,13 +18,11 @@ impl Runtime {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn exists(dir: &Path, name: &str) -> bool {
|
fn exists(dir: &Path, name: &str) -> bool {
|
||||||
dir.join(name).exists()
|
dir.join(name).exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reads `runtime = "..."` from matcha.toml without a TOML dep (one field only).
|
/// Reads `runtime = "..."` from matcha.toml without a TOML dep (one field only).
|
||||||
#[allow(dead_code)]
|
|
||||||
fn override_from_toml(dir: &Path) -> Option<Runtime> {
|
fn override_from_toml(dir: &Path) -> Option<Runtime> {
|
||||||
let text = std::fs::read_to_string(dir.join("matcha.toml")).ok()?;
|
let text = std::fs::read_to_string(dir.join("matcha.toml")).ok()?;
|
||||||
for line in text.lines() {
|
for line in text.lines() {
|
||||||
@@ -39,7 +35,6 @@ fn override_from_toml(dir: &Path) -> Option<Runtime> {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn detect(dir: &Path) -> Option<Runtime> {
|
pub fn detect(dir: &Path) -> Option<Runtime> {
|
||||||
if let Some(r) = override_from_toml(dir) {
|
if let Some(r) = override_from_toml(dir) {
|
||||||
return Some(r);
|
return Some(r);
|
||||||
|
|||||||
Reference in new issue
Block a user