Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Repository Guidelines

## Project Structure & Module Organization

This repository contains the Apache Answer website, built with Docusaurus 3
and React. Documentation lives in `docs/`, community content in `community/`,
and posts in `blog/`. Chinese translations live under `i18n/zh-CN/`.

Use `src/pages/` for routes, `src/components/` for reusable UI,
`src/theme/` for Docusaurus theme overrides, and `src/css/` for shared styles.
Static images and data belong in `static/`. Site configuration and navigation
live in `docusaurus.config.js`, `sidebars.js`, and `sidebarsCommunity.js`.
The `plugins/` directory contains custom plugins; `scripts/` contains data
refresh utilities. Generated site output goes to `build/`.

## Build, Test, and Development Commands

Use pnpm; the preinstall hook enforces it. Package requirements are Node.js
18+ and pnpm 8+; CI uses Node.js 20 and pnpm 9.

- `pnpm install`: install dependencies.
- `pnpm start`: run the English development server with live updates.
- `pnpm start:zh`: run the Chinese development server.
- `pnpm build`: generate the production site for configured locales.
- `pnpm serve`: preview the generated site locally.
- `pnpm typecheck`: run TypeScript checks.
- `pnpm clear`: clear Docusaurus caches when generated state becomes stale.

## Coding Style & Naming Conventions

Follow `.editorconfig`: two-space indentation, UTF-8, LF endings, a final
newline, and an 80-character line-length target. Preserve Markdown trailing
spaces when they represent line breaks. Match nearby TypeScript/React style.
Use PascalCase component directories with `index.tsx`, colocated CSS modules,
and descriptive kebab-case documentation filenames.

ESLint configuration extends `plugin:@docusaurus/recommended` and warns about
untranslated text. Use Docusaurus translation helpers for user-facing UI text.
Edit `.drawio.svg` diagrams with Draw.io to preserve their layer information.

## Testing Guidelines

No automated test framework, test script, or coverage threshold is configured.
Run `pnpm typecheck` and `pnpm build` for changes. Broken site links fail the
build; Markdown link warnings also need review. Preview affected routes in
both locales and check navigation, images, and responsive layouts.

## Commit & Pull Request Guidelines

Follow recent commit prefixes: `docs:`, `blog:`, `fix:`, `feat:`, and `chore:`.
Write a concise, action-oriented subject, such as `docs: clarify installation
requirements`. Keep changes focused.

Pull requests should describe the change, link relevant issues, report
validation performed, and include screenshots for visible UI changes.
Flag translation impacts and ensure the CI production build passes.
1 change: 0 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ const config = {
},
],
'docusaurus-plugin-sass',
// '@docusaurus/theme-mermaid',
[
'@docusaurus/plugin-content-docs',
{
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
"@docusaurus/preset-classic": "3.1.1",
"@docusaurus/theme-classic": "^3.1.1",
"@docusaurus/theme-common": "^3.1.1",
"@docusaurus/theme-mermaid": "^3.1.1",
"@docusaurus/theme-search-algolia": "3.1.1",
"@docusaurus/utils": "^3.1.1",
"@easyops-cn/docusaurus-search-local": "0.52.1",
"@mdx-js/react": "^3.0.0",
Expand All @@ -38,9 +36,7 @@
"bootstrap-icons": "^1.11.1",
"clsx": "^1.2.1",
"copy-text-to-clipboard": "^3.1.0",
"hast-util-is-element": "1.1.0",
"lodash": "^4.17.21",
"mixpanel-browser": "^2.47.0",
"prism-react-renderer": "^1.3.5",
"react": "^18.0.0",
"react-bootstrap": "^2.7.4",
Expand All @@ -57,7 +53,6 @@
"@docusaurus/types": "^3.1.1",
"docusaurus-plugin-sass": "^0.2.5",
"sass": "^1.63.3",
"sass-loader": "^13.3.2",
"typescript": "^5.3.2"
},
"browserslist": {
Expand Down
Loading
Loading