From 26143285377fb09e7342b774c14694df28aef9c7 Mon Sep 17 00:00:00 2001 From: zuiidea Date: Sun, 18 Oct 2026 17:51:49 +0800 Subject: [PATCH] chore: unify Cursor rules, fix monorepo install hooks, refresh basic docs Add root preinstall to set githooks and disable parallel vp config git lock races; merge per-app Cursor thin rules into app.mdx; keep template READMEs free of monorepo-only paths and describe basic as default English rather than English-only. Co-authored-by: Cursor --- .cursor/rules/app.mdx | 66 +++++++++++++++++++ .cursor/rules/with-lingui-add-resource.mdc | 15 ----- .cursor/rules/with-lingui-api.mdc | 15 ----- .cursor/rules/with-lingui-frontend.mdc | 15 ----- .cursor/rules/with-lingui-refactor.mdc | 15 ----- .cursor/rules/with-lingui-testing.mdc | 15 ----- .githooks/README.md | 20 +++--- .gitignore | 2 +- README.md | 8 ++- .../instructions/frontend.instructions.md | 4 +- apps/basic/README.md | 14 ++-- apps/docs/content/en/templates/basic.mdx | 8 +-- apps/docs/content/en/templates/index.mdx | 8 +-- .../en/welcome/documentation-intro.mdx | 2 +- apps/docs/content/zh/templates/basic.mdx | 4 +- apps/docs/content/zh/templates/index.mdx | 6 +- apps/with-lingui/README.md | 6 +- package.json | 1 + 18 files changed, 109 insertions(+), 115 deletions(-) create mode 100644 .cursor/rules/app.mdx delete mode 100644 .cursor/rules/with-lingui-add-resource.mdc delete mode 100644 .cursor/rules/with-lingui-api.mdc delete mode 100644 .cursor/rules/with-lingui-frontend.mdc delete mode 100644 .cursor/rules/with-lingui-refactor.mdc delete mode 100644 .cursor/rules/with-lingui-testing.mdc diff --git a/.cursor/rules/app.mdx b/.cursor/rules/app.mdx new file mode 100644 index 0000000..1531ad8 --- /dev/null +++ b/.cursor/rules/app.mdx @@ -0,0 +1,66 @@ +--- +description: "Thin Cursor rules for template apps with-lingui / basic — route by path and task to each app's .github/instructions (Approach A, single source of truth)" +globs: apps/with-lingui/{src,e2e}/**/*.{ts,tsx,css},apps/basic/{src,e2e}/**/*.{ts,tsx,css},apps/with-lingui/playwright.config.ts,apps/basic/playwright.config.ts +alwaysApply: false +--- + +# Template apps — AI rules (thin rule) + +This file at the **monorepo root** is the shared **Cursor thin rule** for `apps/with-lingui` and `apps/basic`. It only maps **which files you edit → which instruction file to follow**. Do **not** duplicate long guidance here. + +**Single source of truth** (on conflict, these win): + +- `apps/with-lingui/.github/instructions/*.instructions.md` +- `apps/basic/.github/instructions/*.instructions.md` + +For full text in chat, `@`-reference the path below. + +--- + +## General + +- When editing template app source or tests matched by `globs`, pick the row in the tables below, then follow that file’s **Do / Do Not / Validation**. +- **with-lingui** includes Lingui i18n; **basic** uses plain string literals in UI (default English; no bundled locale switcher or translation catalogs). +- When **frontend** and **refactor** both apply: **refactor intent** (dedupe, naming, structure, no behavior change) is governed by `refactor.instructions.md`; UI/interaction details still follow `frontend.instructions.md`. +- If you change an instruction file’s `applyTo`, keep this file’s frontmatter `globs` aligned so both apps’ TS/TSX/CSS/E2E paths stay covered. + +--- + +## apps/with-lingui + +| Scenario | Typical paths | Instruction file | +| --- | --- | --- | +| Frontend (UI, routes, components, styles, Ant Design, i18n copy) | `apps/with-lingui/src/**/*.{ts,tsx,css}` | `apps/with-lingui/.github/instructions/frontend.instructions.md` | +| API (clients, Zod, HTTP, MSW handlers) | `apps/with-lingui/src/api/**`, `apps/with-lingui/src/mocks/handlers/**`, `createHandler.ts` | `apps/with-lingui/.github/instructions/api.instructions.md` | +| Testing (Playwright, MSW, test config) | `apps/with-lingui/e2e/**`, `apps/with-lingui/src/mocks/**`, `playwright.config.ts` | `apps/with-lingui/.github/instructions/testing.instructions.md` | +| Refactor (behavior-preserving) | `apps/with-lingui/src/**/*.{ts,tsx}` | `apps/with-lingui/.github/instructions/refactor.instructions.md` | +| Add CRUD resource | `src/api/**`, `src/mocks/**`, `src/routes/_auth/**`, `e2e/**/*.spec.ts` | `apps/with-lingui/.github/instructions/add-resource.instructions.md` (mirror `users`) | + +**@ examples:** + +- `@apps/with-lingui/.github/instructions/frontend.instructions.md` +- `@apps/with-lingui/.github/instructions/add-resource.instructions.md` + +See also `apps/with-lingui/AGENTS.md` (Vite+ / `vp` workflow). + +--- + +## apps/basic + +| Scenario | Typical paths | Instruction file | +| --- | --- | --- | +| Frontend (UI, routes, components, styles, Ant Design, English copy) | `apps/basic/src/**/*.{ts,tsx,css}` | `apps/basic/.github/instructions/frontend.instructions.md` | +| API | `apps/basic/src/api/**`, `apps/basic/src/mocks/handlers/**`, `createHandler.ts` | `apps/basic/.github/instructions/api.instructions.md` | +| Testing | `apps/basic/e2e/**`, `apps/basic/src/mocks/**`, `playwright.config.ts` | `apps/basic/.github/instructions/testing.instructions.md` | +| Refactor | `apps/basic/src/**/*.{ts,tsx}` | `apps/basic/.github/instructions/refactor.instructions.md` | + +**@ example:** `@apps/basic/.github/instructions/frontend.instructions.md` + +See also `apps/basic/AGENTS.md`. + +--- + +## Maintenance + +- Humans and agents should **edit** each app’s `.github/instructions/` first; this file only maintains the routing table and `globs`. +- Comment language is still governed by `.cursor/rules/english-only-comments.md` (not UI copy or docs). diff --git a/.cursor/rules/with-lingui-add-resource.mdc b/.cursor/rules/with-lingui-add-resource.mdc deleted file mode 100644 index 7148017..0000000 --- a/.cursor/rules/with-lingui-add-resource.mdc +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: "Add a new CRUD resource / scaffold (with-lingui)." -globs: apps/with-lingui/src/api/**/*.ts,apps/with-lingui/src/mocks/**/*.ts,apps/with-lingui/src/routes/_auth/**/*.tsx,apps/with-lingui/e2e/**/*.spec.ts -alwaysApply: false ---- - -# with-lingui · Add resource (thin rule) - -**Single source of truth:** - -`apps/with-lingui/.github/instructions/add-resource.instructions.md` - -When adding a resource, follow that recipe (mirror the `users` example). On conflict, the `.instructions.md` file wins. - -`@apps/with-lingui/.github/instructions/add-resource.instructions.md` diff --git a/.cursor/rules/with-lingui-api.mdc b/.cursor/rules/with-lingui-api.mdc deleted file mode 100644 index 3f0cd2c..0000000 --- a/.cursor/rules/with-lingui-api.mdc +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: "API clients, Zod schemas, HTTP, MSW handlers (with-lingui)." -globs: apps/with-lingui/src/api/**/*.ts,apps/with-lingui/src/mocks/handlers/**/*.ts,apps/with-lingui/src/mocks/createHandler.ts -alwaysApply: false ---- - -# with-lingui · API(薄规则) - -**唯一细则来源**: - -`apps/with-lingui/.github/instructions/api.instructions.md` - -编辑符合 `globs` 的文件时,遵守该文件中的约定;冲突以 `.instructions.md` 为准。 - -`@apps/with-lingui/.github/instructions/api.instructions.md` diff --git a/.cursor/rules/with-lingui-frontend.mdc b/.cursor/rules/with-lingui-frontend.mdc deleted file mode 100644 index f848906..0000000 --- a/.cursor/rules/with-lingui-frontend.mdc +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: "React UI, routes, components, styles, layout, i18n, Ant Design (with-lingui)." -globs: apps/with-lingui/src/**/*.{ts,tsx,css} -alwaysApply: false ---- - -# with-lingui · Frontend(薄规则) - -**唯一细则来源**(勿在此文件重复维护长文): - -`apps/with-lingui/.github/instructions/frontend.instructions.md` - -编辑符合 `globs` 的文件时,遵守该文件中的 Do / Do Not / Validation;如有冲突,以 `.instructions.md` 为准。 - -需要全文进上下文时,在对话里引用:`@apps/with-lingui/.github/instructions/frontend.instructions.md`。 diff --git a/.cursor/rules/with-lingui-refactor.mdc b/.cursor/rules/with-lingui-refactor.mdc deleted file mode 100644 index 5963e5c..0000000 --- a/.cursor/rules/with-lingui-refactor.mdc +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: "Refactors without behavior change — dedupe, naming, structure (with-lingui)." -globs: apps/with-lingui/src/**/*.{ts,tsx} -alwaysApply: false ---- - -# with-lingui · Refactor(薄规则) - -**唯一细则来源**: - -`apps/with-lingui/.github/instructions/refactor.instructions.md` - -做行为保持式重构时遵守该文件;与 frontend 规则同时命中时,**重构意图**以本文件指向的 refactor 指令为准,其余 UI 细节仍以 `frontend.instructions.md` 为准。 - -`@apps/with-lingui/.github/instructions/refactor.instructions.md` diff --git a/.cursor/rules/with-lingui-testing.mdc b/.cursor/rules/with-lingui-testing.mdc deleted file mode 100644 index ea60c0a..0000000 --- a/.cursor/rules/with-lingui-testing.mdc +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: "Playwright e2e, MSW mocks, test config (with-lingui)." -globs: apps/with-lingui/e2e/**/*.ts,apps/with-lingui/e2e/**/*.tsx,apps/with-lingui/src/mocks/**/*.ts,apps/with-lingui/playwright.config.ts -alwaysApply: false ---- - -# with-lingui · Testing(薄规则) - -**唯一细则来源**: - -`apps/with-lingui/.github/instructions/testing.instructions.md` - -编辑符合 `globs` 的文件时,遵守该文件中的约定;冲突以 `.instructions.md` 为准。 - -`@apps/with-lingui/.github/instructions/testing.instructions.md` diff --git a/.githooks/README.md b/.githooks/README.md index 7425e1f..327b238 100644 --- a/.githooks/README.md +++ b/.githooks/README.md @@ -1,26 +1,30 @@ -# Git hooks(仓库根) +# Git hooks (repository root) -本目录为 **monorepo 根级** Git 钩子。提交时根据暂存文件路径,在对应子项目目录执行检查(例如 `apps/with-lingui` 下执行 `vp staged`,以便正确读取该目录的 `vite.config.ts`)。 +This directory holds **monorepo root-level** Git hooks. On commit, checks run in the matching subproject based on staged file paths (for example, `vp staged` under `apps/with-lingui` so that directory’s `vite.config.ts` is loaded correctly). -模板应用目录内的 `.vite-hooks/`(如 `apps/with-lingui/.vite-hooks/`)留给 **模板单独拷贝出去使用**;在本仓库开发时请使用根级钩子,避免在仓库根执行 `vp staged` 找不到 `vite.config.ts`。 +Per-app `.vite-hooks/` under template apps (e.g. `apps/with-lingui/.vite-hooks/`) are for **copying a template out on its own**. When developing in this repo, use the root hooks so `vp staged` at the repo root does not fail to find `vite.config.ts`. -## 启用方式(一次性) +## Monorepo and `vp config` -在仓库根目录执行: +The root `package.json` `preinstall` sets `core.hooksPath=.githooks` before dependencies install and writes `vp.hooks.disabled=true` in **this clone** so parallel `prepare` scripts (`vp config`) from multiple workspaces do not fight over `.git/config` and cause lock conflicts. Template apps still use `"prepare": "vp config"`; when copied out alone they do not get the root `preinstall`. + +## Enabling (one-time) + +From the repository root: ```bash git config core.hooksPath .githooks ``` -或使用: +Or: ```bash pnpm run setup:git-hooks ``` -验证: +Verify: ```bash git config core.hooksPath -# 应输出:.githooks +# Expected: .githooks ``` diff --git a/.gitignore b/.gitignore index f63e72f..23920af 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,7 @@ yarn-error.log* # Git worktrees .worktrees/ -# Cursor:仅共享项目规则;其余本机数据仍忽略(方案 A — 细则单源在 apps/with-lingui/.github/instructions) +# Cursor: share project rules only (e.g. .cursor/rules/app.mdx); ignore other local Cursor data (instruction source of truth in each app’s .github/instructions) .cursor/* !.cursor/rules/ !.cursor/rules/** diff --git a/README.md b/README.md index 345d91d..298b1e9 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Antd Admin provides production-style admin templates with modern frontend toolin Available templates: -- `basic`: English-only setup -- `with-lingui`: Bilingual setup (`en` + `zh`) with Lingui +- `basic`: Admin template with plain-string UI copy (default English; no bundled Lingui) +- `with-lingui`: Lingui i18n workflow (`en` + `zh`) with locale switching Scaffolding CLI: @@ -61,6 +61,10 @@ pnpm dlx init-antd-admin@latest my-app --example with-lingui --skip-install For detailed CLI behavior, see `[packages/create/README.md](./packages/create/README.md)`. +### Working in this monorepo (Cursor) + +Template apps ship scoped guidance under each app’s `.github/instructions/` (see each app’s `README.md`). **Monorepo-only:** root [`.cursor/rules/app.mdx`](./.cursor/rules/app.mdx) is a thin router to those files when editing `apps/with-lingui` or `apps/basic`; it is **not** included in `init-antd-admin` output. + Production docs: [https://antd-admin-doc.zuiidea.top](https://antd-admin-doc.zuiidea.top) ## Links diff --git a/apps/basic/.github/instructions/frontend.instructions.md b/apps/basic/.github/instructions/frontend.instructions.md index 1f88597..4034cca 100644 --- a/apps/basic/.github/instructions/frontend.instructions.md +++ b/apps/basic/.github/instructions/frontend.instructions.md @@ -2,7 +2,7 @@ ## applyTo: "src/\*_/_.{ts,tsx,css}" -description: "Use when editing React UI, route pages, components, styles, layout, i18n text, or Ant Design behavior. Keywords: frontend, component, page, ui, layout, style, antd, i18n." +description: "Use when editing React UI, route pages, components, styles, layout, copy, or Ant Design behavior. Keywords: frontend, component, page, ui, layout, style, antd, english copy." # Frontend Instructions @@ -16,7 +16,7 @@ Keep frontend changes predictable, minimal, and reusable for AI-assisted edits. - Prefer reusable components and hooks over copy-paste logic. - Keep styles token-driven using existing theme/store patterns. - For Ant Design styling, follow this priority: component native API (`variant`/`type`/`size`/`styles`/`classNames`) -> `theme.useToken()` with inline `style` -> `className` + external CSS. -- Keep translations compatible with Lingui macros and catalogs. +- Keep user-facing copy in English as plain string literals (this template has no i18n layer). - Follow current folder conventions under src/components and src/routes. ## Do Not diff --git a/apps/basic/README.md b/apps/basic/README.md index 822450c..65e4eb8 100644 --- a/apps/basic/README.md +++ b/apps/basic/README.md @@ -8,7 +8,7 @@
-English-only admin scaffold (no Lingui): MSW mocks, minimal RBAC, full CRUD, and Playwright E2E — built with React 19, Ant Design 6, and Vite+. For Lingui-based i18n (en + zh), use the sibling app [`apps/with-lingui`](../with-lingui/). +Admin scaffold: MSW mocks, minimal RBAC, full CRUD, and Playwright E2E — built with React 19, Ant Design 6, and Vite+. AI-friendly with clear patterns, shared abstractions, scoped AI instructions, and type-safe contracts at every boundary. Default UI language is English; for Lingui i18n (en + zh) out of the box, see [`apps/with-lingui`](../with-lingui/). [![antd](https://img.shields.io/badge/AntD-^6.0.0-1890ff?style=flat-square&logo=ant-design)](https://github.com/ant-design/ant-design) [![react](https://img.shields.io/badge/React-19.2-61dafb?style=flat-square&logo=react)](https://react.dev) @@ -31,7 +31,7 @@ English-only admin scaffold (no Lingui): MSW mocks, minimal RBAC, full CRUD, and | Async State | [TanStack Query v5](https://tanstack.com/query) | | Local State | [Zustand](https://zustand.docs.pmnd.rs) (persisted auth & settings) | | Validation | [Zod v4](https://zod.dev) (schemas, API contracts, form validation) | -| UI language | English strings in source (no i18n framework) | +| UI copy | Plain strings in source (default English); no bundled i18n stack | | Icons | [lucide-react](https://lucide.dev/guide/packages/lucide-react) | | API Mocking | [MSW 2.x](https://mswjs.io) (Service Worker based) | | E2E Testing | [Playwright](https://playwright.dev) | @@ -42,7 +42,7 @@ English-only admin scaffold (no Lingui): MSW mocks, minimal RBAC, full CRUD, and - **JWT Authentication** — Login with access/refresh token flow, persisted via Zustand - **Dynamic Menu & RBAC** — Backend-driven sidebar menu with permission guards and 403 page - **URL-First State** — Table search params (page, pageSize, keyword, sort) synced to URL -- **English-only** — No Lingui or locale catalogs; Ant Design uses a fixed `en_US` locale. See [`apps/with-lingui`](../with-lingui/) for bilingual LinguiJS. +- **Default locale** — UI copy in plain strings (English by default); Ant Design `ConfigProvider` uses `en_US`. - **Dark Mode** — One-click toggle with Ant Design theme algorithm - **Full Type Safety** — Zod schemas validate API boundaries at runtime where used - **Zero-Config Mocking** — MSW intercepts API calls in development, no backend needed @@ -156,16 +156,14 @@ e2e/ # Playwright E2E suites └── url-state.spec.ts ``` -## Language & i18n +## Language -This template is **English-only**: user-facing copy lives in components and routes as plain strings; there is no Lingui catalog or language switcher. - -For **LinguiJS** (English + Chinese, `.po` extract/compile, and Ant Design locale switching), use [`apps/with-lingui`](../with-lingui/). +User-facing copy lives in components and routes as plain strings. **Default language is English**; Ant Design is wired to `en_US` in `__root.tsx`. This template does not include a locale switcher or translation catalogs—you can add your own i18n library or start from the [`with-lingui`](../with-lingui/) template for LinguiJS (en + zh). ## Extending the template - **Real backend:** Point `VITE_API_BASE_URL` in env and disable or remove MSW in `main.tsx` when you no longer need mocks. -- **Add i18n:** Start from [`apps/with-lingui`](../with-lingui/) or port Lingui setup from that app; this `basic` tree intentionally omits it. +- **Add i18n:** Integrate your preferred stack, or copy patterns from [`apps/with-lingui`](../with-lingui/). ## Developer Notes diff --git a/apps/docs/content/en/templates/basic.mdx b/apps/docs/content/en/templates/basic.mdx index 09b47e7..c662ff4 100644 --- a/apps/docs/content/en/templates/basic.mdx +++ b/apps/docs/content/en/templates/basic.mdx @@ -1,6 +1,6 @@ --- title: basic -description: Lightweight admin template for single-language projects +description: Admin template with plain-string UI (default English) --- # basic @@ -9,9 +9,9 @@ description: Lightweight admin template for single-language projects ## Good Fit -- Internal tools -- Small-to-medium dashboard projects -- Teams not requiring i18n yet +- Internal tools and dashboards +- Teams that want a full scaffold first and may add i18n later +- Projects comfortable with English as the default UI language ## Highlights diff --git a/apps/docs/content/en/templates/index.mdx b/apps/docs/content/en/templates/index.mdx index 5080f40..b4a5e30 100644 --- a/apps/docs/content/en/templates/index.mdx +++ b/apps/docs/content/en/templates/index.mdx @@ -7,10 +7,10 @@ description: Choose between basic and with-lingui templates This repository provides two templates: -- **[basic](/en/templates/basic)**: Minimal setup, English UI by default. -- **[with-lingui](/en/templates/with-lingui)**: Includes Lingui i18n workflow and bilingual setup. +- **[basic](/en/templates/basic)**: Full admin template; UI copy as plain strings (default English). +- **[with-lingui](/en/templates/with-lingui)**: Same stack plus Lingui i18n (`en` + `zh`) and locale switching. ## How to Choose -- Choose **basic** if you only need one language. -- Choose **with-lingui** if you need structured multilingual support from day one. +- Choose **basic** for the default stack without a bundled i18n workflow (you can add i18n later). +- Choose **with-lingui** when you want Lingui catalogs and bilingual UI from day one. diff --git a/apps/docs/content/en/welcome/documentation-intro.mdx b/apps/docs/content/en/welcome/documentation-intro.mdx index 6048ab5..1b4ad7e 100644 --- a/apps/docs/content/en/welcome/documentation-intro.mdx +++ b/apps/docs/content/en/welcome/documentation-intro.mdx @@ -15,7 +15,7 @@ If this is your first time here: ## Repo Structure -- `apps/basic`: English-only admin template +- `apps/basic`: Admin template (default English UI; add your own i18n or use `with-lingui`) - `apps/with-lingui`: Internationalized template with Lingui - `apps/docs`: Documentation site diff --git a/apps/docs/content/zh/templates/basic.mdx b/apps/docs/content/zh/templates/basic.mdx index 657f956..5d779f8 100644 --- a/apps/docs/content/zh/templates/basic.mdx +++ b/apps/docs/content/zh/templates/basic.mdx @@ -1,6 +1,6 @@ --- title: Basic 模板 -description: apps/basic — 英文-only 模板说明摘要 +description: apps/basic — 默认英文界面的管理后台模板 --- # Basic 模板 @@ -9,7 +9,7 @@ description: apps/basic — 英文-only 模板说明摘要 ## 定位 -英文界面、**不包含 Lingui**;Ant Design 使用固定 **`en_US`** locale。依赖相对精简,适合只需英文后台或自行接入其它 i18n 方案的团队。 +完整的管理后台模板,UI 文案以源码中的 plain strings 为主,**默认语言为英文**;Ant Design 固定 **`en_US`**。未内置 Lingui 与语言切换,可自行接入 i18n,或选用 **with-lingui** 模板。 ## 技术栈摘要 diff --git a/apps/docs/content/zh/templates/index.mdx b/apps/docs/content/zh/templates/index.mdx index 3352f23..c8c29eb 100644 --- a/apps/docs/content/zh/templates/index.mdx +++ b/apps/docs/content/zh/templates/index.mdx @@ -12,14 +12,14 @@ asIndexPage: true | 项目 | `apps/basic` | `apps/with-lingui` | |------|----------------|---------------------| | **package.json `name`** | `antd-admin-basic` | `antd-admin` | -| **Lingui(i18n)** | 无(英文界面) | 有(`@lingui/core`、`@lingui/react`,en / zh) | +| **Lingui(i18n)** | 无内置(默认英文界面) | 有(`@lingui/core`、`@lingui/react`,en / zh) | | **Ant Design `ConfigProvider` locale** | 固定 `antd/locale/en_US` | 随设置切换:`en` → `en_US`,`zh` → `zh_CN`(见 `src/routes/__root.tsx`) | | **Zustand persist(settings)`name`** | `settings-storage-basic` | `settings-storage` | ## 选型建议 -- 只要英文、希望依赖最少:选 **[Basic](/templates/basic)**。 -- 需要中英文切换、Lingui 工作流与 Ant Design 随语言联动:选 **[With Lingui](/templates/with-lingui)**。 +- 希望先上手完整模板、默认英文、后续可自行加 i18n:选 **[Basic](/templates/basic)**。 +- 需要开箱即用的中英文切换、Lingui 工作流与 Ant Design 随语言联动:选 **[With Lingui](/templates/with-lingui)**。 ## 子页面 diff --git a/apps/with-lingui/README.md b/apps/with-lingui/README.md index 399da8e..c266b93 100644 --- a/apps/with-lingui/README.md +++ b/apps/with-lingui/README.md @@ -2,8 +2,6 @@ Balanced admin scaffold: i18n (Lingui), MSW mocks, minimal RBAC, full CRUD, and Playwright E2E — built with React 19, Ant Design 6, and Vite+. AI-friendly with clear patterns, shared abstractions, scoped AI instructions, and type-safe contracts at every boundary. -**AI rules (Cursor):** `.cursor/rules/with-lingui-*.mdc` at the repo root mirrors `apps/with-lingui/.github/instructions/*.instructions.md` (same intent; `globs` align with each file’s `applyTo`). Prefer updating **both** when you change guidance. - [antd](https://github.com/ant-design/ant-design) [react](https://react.dev) [vite](https://viteplus.dev) @@ -188,9 +186,7 @@ Ant Design strings follow the active locale via `ConfigProvider` in `__root.tsx` ### AI instruction files -**Single source of truth**: `apps/with-lingui/.github/instructions/` (`*.instructions.md`). Both humans and agents should maintain and review guidance from this directory. - -**Cursor**: The root `.cursor/rules/with-lingui-*.mdc` files are intentionally thin rules (Approach A), containing only scope and pointer paths. Keep `globs` aligned with each instruction file's `applyTo`; for full details, reference the target `.instructions.md` file in chat with `@` or open it directly. +**Single source of truth**: `.github/instructions/` (`*.instructions.md`). Both humans and agents should maintain and review guidance from this directory. See also `AGENTS.md` for the Vite+ workflow. In chat, reference files with `@.github/instructions/…` (for example `@.github/instructions/frontend.instructions.md`). ## Developer Notes diff --git a/package.json b/package.json index bfb184c..6b42895 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "dev": "turbo run dev", "lint": "turbo run lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "preinstall": "git config core.hooksPath .githooks && git config --local vp.hooks.disabled true", "setup:git-hooks": "git config core.hooksPath .githooks && git config core.hooksPath" }, "devDependencies": {