chore(frontend): remove the legacy vanilla-JS frontend and its tooling

The SvelteKit app under /frontend has fully superseded the legacy
vanilla-JS/CSS frontend in /static, which was only ever served by a
debug `cargo run` / `PROFILE=dev` and never shipped to production.
Remove it together with the whole subsystem that existed only to
support it (~54k lines).

Frontend & assets:
- Delete /static (js/, css/, *.html, sw.js, basemaps/, locales symlink).
- Relocate the brand/PWA assets (logo/, favicon.ico, manifest.webmanifest)
  to frontend/static/ so they ship with the SPA. This also fixes the
  favicon, which app.html referenced but was missing from the prod bundle.
- Migrate the Nextcloud login-flow redirects from /nextcloud-error.html
  to the SvelteKit /nextcloud/error route.

Web layer:
- Simplify resolve_static_path: drop the PROFILE=dev branch; always prefer
  the Vite static-dist/ build, fall back to the configured path.
- Resolve i18n locales from the served SPA dir with a frontend/static
  fallback so `just dev` works without a prior build.

Build:
- Prune build.rs from 1262 to ~70 lines (git metadata only); the Rust asset
  pipeline and the OXICLOUD_RUST_ASSETS rollback flag are gone.
- Drop the now-unused build-dependencies (oxc_*, lightningcss).
- Remove the COPY static lines from the Dockerfile (cacher + builder).

Tooling & docs:
- Delete biome.json, jsconfig.json, tools/check-*.py, identifier.sh.
- Remove the legacy front-* justfile recipes; repoint the design-system
  scripts (locales, dead-tokens, brand-drift, token-docs) at the frontend,
  and drop check-contrast/check-headings (coupled to the old token
  taxonomy / multi-page HTML).
- Repoint docs/DESIGN-SYSTEM.md links; remove 5 superseded docs/plan/*.

Backend dead code:
- Remove the dead `folder_repo` field from FileBlobWriteRepository.
- Remove the deprecated GET /api/folders/{id}/listing endpoint
  (superseded by /resources).

Verified: cargo clippy (all-features/all-targets) clean, cargo test
--workspace 448 passed, cargo fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
DioCrafts
2026-06-21 03:17:34 +02:00
parent 6be3c99580
commit 54639d466a
211 changed files with 171 additions and 53965 deletions
+19 -11
View File
@@ -59,7 +59,7 @@ use common::di::AppServiceFactory;
use infrastructure::db::create_database_pools;
use interfaces::{
create_api_routes, create_health_routes, create_public_api_routes,
web::{content_security_policy, create_web_routes},
web::{content_security_policy, create_web_routes, resolve_static_path},
};
fn parse_addr(host: &str, port: u16) -> Result<SocketAddr, String> {
@@ -277,17 +277,25 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
None
};
// Locales directory for i18n. Derived from the configured static path
// (OXICLOUD_STATIC_PATH, defaults to ./static) so deployments that ship
// assets from a non-default location — or the build.rs-bundled
// `./static-dist` in release — find their locale files correctly.
// Locales directory for i18n. Resolved from wherever the SPA is actually
// served (the Vite `static-dist/` build, or the configured static path in
// the container) so deployments find their locale files correctly. A source
// checkout without a built SPA still has the canonical locales under the
// frontend static assets, so fall back to those for `just dev`.
//
// Read-only at runtime: locales ship as static assets (build.rs bundles
// them into static-dist, the Dockerfile copies them into /app/static).
// Fail-fast if the path is missing rather than silently creating an
// empty directory and limping along with a "translation missing" error
// on every request later.
let locales_path = config.static_path.join("locales");
// Read-only at runtime: locales ship as static assets (Vite copies
// `frontend/static/locales` into the build, the Dockerfile copies that into
// /app/static). Fail-fast if the path is missing rather than silently
// creating an empty directory and limping along with a "translation missing"
// error on every request later.
let locales_path = {
let served = resolve_static_path(&config).join("locales");
if served.is_dir() {
served
} else {
std::path::PathBuf::from("frontend/static/locales")
}
};
if !locales_path.is_dir() {
panic!(
"FATAL: locales directory not found at {}. \