Skip to content

refactor(api): modular defineApi layer with shared API_PREFIX - #1181

Merged
zuiidea merged 9 commits into
masterfrom
cursor/api-define-api-layer-5f85
Oct 22, 2026
Merged

zuiidea merged 9 commits into
masterfrom
cursor/api-define-api-layer-5f85

Conversation

@zuiidea

@zuiidea zuiidea commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Introduce schemas → defineApi modules → UI with transport in src/api/request.ts (axios, envelope unwrap, 401 refresh).
  • Split auth/, users/, and shared/ (pagination, params, menu, API_PREFIX) in both apps/basic and apps/with-lingui; MSW handlers reuse the same path constants.
  • Remove legacy utils/http.ts / utils/session.ts; routes import @/api/users and resource functions only.
  • Consolidate agent guidance into per-app AGENTS.md + add-resource skill; drop app .github/instructions and redundant Cursor rules.
  • Update root/app READMEs and apps/docs (en/zh) for folder structure, API layer, and E2E script usage.

Test plan

  • pnpm exec vp check --no-fmt in apps/basic and apps/with-lingui
  • pnpm run test:unit in both template apps
  • pnpm run test:e2e (or focused login/users specs) in both template apps
  • pnpm --filter ./apps/docs lint

Replace ad-hoc fetch httpClient with api/request.ts (axios interceptors,
envelope unwrap, auth refresh) and defineApi-based resource modules.
Move session hydration into api/auth, sync both templates, and update docs.

Co-authored-by: zuiidea <zuiiidea@gmail.com>
@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
antd-admin Ready Ready Preview Oct 18, 2026 1:20pm UTC
antd-admin-doc Ready Ready Preview Oct 18, 2026 1:20pm UTC

zuiidea and others added 2 commits October 18, 2026 17:51
…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 <cursoragent@cursor.com>
Expose fmt via turbo at the monorepo root, apply Oxfmt in basic/with-lingui, and run vp staged through pnpm exec in pre-commit so hooks work without a global vp.

Co-authored-by: Cursor <cursoragent@cursor.com>
Root formatting and lint stay on turbo fmt/lint via Vite+ in workspace apps.

Co-authored-by: Cursor <cursoragent@cursor.com>
zuiidea and others added 3 commits October 18, 2026 18:48
Merge scoped instructions into per-app AGENTS.md, add monorepo AGENTS.md and add-resource skill, and remove template .github Copilot files plus the Cursor app router rule.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align basic with with-lingui for CRUD scaffolding via AGENTS.md and .agents/skills, and drop hardcoded monorepo paths in agent docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move auth and users into folder modules, centralize path constants, and align MSW with endpoint paths in both template apps.

Co-authored-by: Cursor <cursoragent@cursor.com>
Expand template READMEs with src/api layout, fix CLI table and E2E script references.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document API_PREFIX, folder structure, templates, and E2E script usage in en/zh.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zuiidea zuiidea changed the title refactor(api): defineApi + axios request layer refactor(api): modular defineApi layer with shared API_PREFIX Oct 18, 2026
@zuiidea
zuiidea marked this pull request as ready for review October 18, 2026 13:24
@zuiidea
zuiidea merged commit 4dc473b into master Oct 22, 2026
4 checks passed

This branch was successfully deployed

2 active deployments
Preview – antd-admin — b8bb7713 Deployed Oct 18, 2026 by vercel[bot]
Preview – antd-admin-doc — b8bb7713 Deployed Oct 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants