diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b257ed..ddb5121 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,5 +95,4 @@ jobs: run: cargo install trunk --locked - name: Build - working-directory: crates/app run: trunk build --release diff --git a/AGENTS.md b/AGENTS.md index 6709842..f6fafde 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -399,13 +399,17 @@ Default to starting with Phase 1. ## 11. Common Commands ```bash -trunk serve # dev server + hot reload (run from crates/app) -trunk build --release # production build +trunk serve # dev server + hot reload (from workspace root) +trunk build --release # production build (from workspace root) cargo check --workspace --target wasm32-unknown-unknown cargo clippy --workspace --target wasm32-unknown-unknown -- -D warnings cargo test --workspace --exclude app # test only models/github-api (no wasm target needed) ``` +All commands run from the workspace root: the Trunk assets (`index.html`, +`Trunk.toml`, `favicon.svg`) live at the root and point at +`crates/app/Cargo.toml`, so no `cd crates/app` is ever needed. + --- ## 12. Notes for AI Agents Continuing This Work diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b19b250..e6be9ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,6 @@ git clone https://github.com/anomalyco/lepo cd lepo # Start the dev server with HMR (http://127.0.0.1:3000) -cd crates/app trunk serve --port 3000 --open ``` @@ -48,10 +47,10 @@ cargo fmt --all --check cargo test --workspace --exclude app # Start the dev server with HMR (http://127.0.0.1:3000) -cd crates/app && trunk serve --port 3000 --open +trunk serve --port 3000 --open -# Production build → crates/app/dist/ -cd crates/app && trunk build --release +# Production build → dist/ +trunk build --release ``` > CI (`.github/workflows/ci.yml`) runs `cargo check`, `cargo clippy`, `cargo fmt --check`, diff --git a/Makefile b/Makefile deleted file mode 100644 index 171202c..0000000 --- a/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# Lepo — GitHub Repo Monitor -# -# Convenience targets so the app can be built/served from the workspace ROOT, -# even though Trunk requires index.html next to the `app` crate (crates/app). -# Trunk 0.21 has no `-C` flag, so each target changes into crates/app first. - -APP_DIR := crates/app - -.PHONY: serve build release check clippy clippy-wasm test fmt fmt-check clean - -## serve: start the Trunk dev server with hot reload (from root) -serve: - cd $(APP_DIR) && trunk serve - -## build: build the wasm bundle into crates/app/dist -build: - cd $(APP_DIR) && trunk build - -## release: optimized production build -release: - cd $(APP_DIR) && trunk build --release - -## check: type-check the app for wasm -check: - cargo check -p app --target wasm32-unknown-unknown - -## clippy: lint everything (native) -clippy: - cargo clippy --workspace -- -D warnings - -## clippy-wasm: lint everything for wasm -clippy-wasm: - cargo clippy --workspace --target wasm32-unknown-unknown -- -D warnings - -## test: run offline unit tests (models + github-api) -test: - cargo test --workspace --exclude app - -## fmt: format all crates -fmt: - cargo fmt --all - -## fmt-check: verify formatting -fmt-check: - cargo fmt --all --check - -## clean: remove build artifacts -clean: - cargo clean - rm -rf $(APP_DIR)/dist diff --git a/README.md b/README.md index fbee0dc..16b10d9 100644 --- a/README.md +++ b/README.md @@ -65,18 +65,16 @@ crates/ ### Development ```bash -cd crates/app trunk serve --port 3000 --open ``` ### Build (production) ```bash -cd crates/app trunk build --release ``` -Output is in `crates/app/dist/` — deploy the folder to any static host. +Output is in `dist/` — deploy the folder to any static host. ## Scripts @@ -86,8 +84,8 @@ Output is in `crates/app/dist/` — deploy the folder to any static host. | `cargo clippy --workspace --target wasm32-unknown-unknown -- -D clippy::correctness -D clippy::suspicious` | Lint | | `cargo fmt --all --check` | Format check (2-space indent, edition 2024) | | `cargo test --workspace --exclude app` | Run library unit tests | -| `cd crates/app && trunk serve --port 3000 --open` | Dev server with HMR | -| `cd crates/app && trunk build --release` | Production build | +| `trunk serve --port 3000 --open` | Dev server with HMR | +| `trunk build --release` | Production build | ## Security @@ -111,8 +109,8 @@ To report a vulnerability privately, see [SECURITY.md](./SECURITY.md). ## Deployment (Vercel) 1. Connect the repository to Vercel. -2. Set build command: `cd crates/app && trunk build --release` -3. Set output directory: `crates/app/dist` +2. Set build command: `trunk build --release` +3. Set output directory: `dist` 4. The app calls `api.github.com` directly from the browser (CORS-enabled), so no backend or proxy is required. diff --git a/Trunk.toml b/Trunk.toml new file mode 100644 index 0000000..441f414 --- /dev/null +++ b/Trunk.toml @@ -0,0 +1,24 @@ +# Trunk config for the Lepo workspace. +# +# This file must exist at the workspace root: without it, Trunk auto-detects +# the workspace-root Cargo.toml as its config source and fails because a +# virtual manifest has no root package. The Rust app is wired up in +# index.html via ``, so `trunk serve` / `trunk build` run from the root. + +[build] +target = "index.html" +dist = "dist" +public_url = "/" +release = true +inject_scripts = true +minify = "on_release" + +[watch] +ignore = ["target", "dist"] + +[serve] +addresses = ["127.0.0.1"] +port = 3000 +open = false +no_spa = false diff --git a/crates/app/Trunk.toml b/crates/app/Trunk.toml deleted file mode 100644 index 1e44ea8..0000000 --- a/crates/app/Trunk.toml +++ /dev/null @@ -1,22 +0,0 @@ -[build] -target = "index.html" -release = true -dist = "dist" -public_url = "/" -filehash = true -inject_scripts = true -minify = "on_release" -no_sri = false -cross_origin = "" - -[watch] -watch = [] -ignore = [] - -[serve] -addresses = ["127.0.0.1"] -port = 3000 -open = false -no_autoreload = false -no_error_reporting = false -no_spa = false diff --git a/crates/app/public/favicon.svg b/favicon.svg similarity index 100% rename from crates/app/public/favicon.svg rename to favicon.svg diff --git a/crates/app/index.html b/index.html similarity index 90% rename from crates/app/index.html rename to index.html index 3ad5e2d..c47bef7 100644 --- a/crates/app/index.html +++ b/index.html @@ -21,7 +21,7 @@ Lepo — GitHub Repo Monitor - + @@ -45,10 +45,10 @@ - + - + diff --git a/vercel.json b/vercel.json index 0e58ef5..ee1fa63 100644 --- a/vercel.json +++ b/vercel.json @@ -2,8 +2,8 @@ "$schema": "https://openapi.vercel.sh/vercel.json", "trailingSlash": false, - "buildCommand": "cd crates/app && cargo install trunk --locked && rustup target add wasm32-unknown-unknown && trunk build --release", - "outputDirectory": "crates/app/dist", + "buildCommand": "cargo install trunk --locked && rustup target add wasm32-unknown-unknown && trunk build --release", + "outputDirectory": "dist", "rewrites": [ {