From f87b5e9e76e573c4cf93846b6e8755027246a2e9 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 16 Jun 2026 11:42:20 +0800 Subject: [PATCH] fix --- CONTRIBUTING.md | 21 +++++++++++---------- docs/development.md | 2 +- docs/guidelines-backend.md | 5 ----- docs/guidelines-frontend.md | 35 ++++++++++++++--------------------- docs/testing.md | 2 +- 5 files changed, 27 insertions(+), 38 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 55b006edf71..71087d34468 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,16 +2,17 @@ This document explains how to contribute changes to the Gitea project. Topic-specific guides live in separate files so the essentials are easier to find. -| Topic | Document | -| :---- | :------- | -| Setup and requirements | [docs/setup.md](docs/setup.md) | -| Building and the development workflow | [docs/development.md](docs/development.md) | -| Running the tests | [docs/testing.md](docs/testing.md) | -| Backend architecture and API v1 | [docs/guidelines-backend.md](docs/guidelines-backend.md) | -| Frontend architecture and UI guidelines | [docs/guidelines-frontend.md](docs/guidelines-frontend.md) | -| Refactoring | [docs/guidelines-refactoring.md](docs/guidelines-refactoring.md) | -| Maintainers, TOC, labels, merge queue, commit format for mergers | [docs/community-governance.md](docs/community-governance.md) | -| Release cycle, backports, tagging releases | [docs/release-management.md](docs/release-management.md) | +| Topic | Document | +|:-----------------------|:-----------------------------------------------------------------| +| Setup and requirements | [docs/build-setup.md](docs/build-setup.md) | +| Development workflow | [docs/development.md](docs/development.md) | +| Build from source | [docs/build-source.md](docs/build-source.md) | +| Running the tests | [docs/testing.md](docs/testing.md) | +| Frontend guidelines | [docs/guidelines-frontend.md](docs/guidelines-frontend.md) | +| Backend guidelines | [docs/guidelines-backend.md](docs/guidelines-backend.md) | +| Refactoring | [docs/guidelines-refactoring.md](docs/guidelines-refactoring.md) | +| Community Governance | [docs/community-governance.md](docs/community-governance.md) | +| Release management | [docs/release-management.md](docs/release-management.md) |
Table of Contents diff --git a/docs/development.md b/docs/development.md index 301f7db9f07..e0858a716f9 100644 --- a/docs/development.md +++ b/docs/development.md @@ -2,7 +2,7 @@ This document describes how to build Gitea from source and the day-to-day development workflow. For prerequisites and how to obtain the code, see -[setup.md](setup.md). For running tests, see [testing.md](testing.md). For the +[build-setup.md](build-setup.md). For running tests, see [testing.md](testing.md). For the contribution workflow and review process, see [CONTRIBUTING.md](../CONTRIBUTING.md). Area-specific guidelines: diff --git a/docs/guidelines-backend.md b/docs/guidelines-backend.md index 38af3c3a5ef..5342c1d9716 100644 --- a/docs/guidelines-backend.md +++ b/docs/guidelines-backend.md @@ -62,11 +62,6 @@ Operations that must roll back together should run inside `db.WithTx()` (or Functions that participate in a transaction take a `context.Context` as their first parameter so the transaction can be propagated. -### Implementing `io.Closer` - -Types that implement `io.Closer` must tolerate `Close()` being called more than once -without panicking. - ### XORM gotchas - Never call `x.Update(exemplar)` without an explicit `WHERE` clause — it updates diff --git a/docs/guidelines-frontend.md b/docs/guidelines-frontend.md index 14f3808ff99..61a801ba384 100644 --- a/docs/guidelines-frontend.md +++ b/docs/guidelines-frontend.md @@ -6,9 +6,8 @@ and testing see [development.md](development.md) and [testing.md](testing.md). ## Background -The frontend uses [Vue 3](https://vuejs.org/), [Fomantic-UI](https://fomantic-ui.com/) -(built on jQuery), [htmx](https://htmx.org/) for partial page updates, and -[Tailwind CSS](https://tailwindcss.com/). Pages are rendered with Go HTML templates. +The frontend uses [Vue 3](https://vuejs.org/), [Fomantic-UI](https://fomantic-ui.com/) (built on jQuery) +and [Tailwind CSS](https://tailwindcss.com/). Pages are rendered with Go HTML templates. Source files live in: - `web_src/css/`: CSS styles @@ -28,15 +27,14 @@ reference an existing published version. Mixing frameworks arbitrarily makes code hard to maintain. Recommended combinations: -- Vue with vanilla JavaScript -- Fomantic-UI (jQuery) +- Vue3 - Vanilla JavaScript +- Fomantic-UI (jQuery), deprecated, we vendored a specific version with a lot of changes. -Avoid combinations such as Vue with Fomantic-UI, jQuery with htmx, or htmx with heavy -JavaScript dependencies. Vue components may reuse Fomantic-UI CSS classes for visual -consistency. Use Go templates for simple or SEO-relevant pages and Vue for complex, -interactive pages. Gitea uses Vue 3 **without** JSX to keep HTML and JavaScript -separate. +Avoid combinations such as Vue with Fomantic-UI. +Vue components may reuse Fomantic-UI CSS classes for visual consistency. +Use Go templates for simple or SEO-relevant pages and Vue for complex, interactive pages. +Gitea uses Vue 3 **without** JSX to keep HTML and JavaScript separate. > [!NOTE] > Fomantic-UI is not an accessibility-friendly framework. Gitea patches some ARIA @@ -47,12 +45,9 @@ separate. - Keep features in their own files or directories. - Use kebab-case for HTML `id`s and classes, ideally with 2-3 feature keywords. -- Prefix classes used only as JavaScript hooks with `js-`, and keep them unique - across the project. -- Create a new class name when overriding framework styles instead of editing the - framework's own classes. -- Pass complex data to the frontend via `ctx.PageData["myModuleData"]` rather than - embedding models directly, to avoid leaking sensitive fields. +- Prefix classes to avoid short-name conflicts between different frameworks. +- Create a new class name when overriding framework styles instead of editing the framework's own classes, + or fix the framework's source to fix all cases. - Prefer semantic elements such as `