Skip to content

Commit bdbe763

Browse files
committed
docs(cursor): update rules and workflows- Add new sections to API rules: description, alwaysApply, and additional guidelines
- Update GitHub workflow for code quality with more descriptive step names - Rename "check-test" script to "check-jest" in package.json - Remove redundant rule about semicolons from project-basic.mdc
1 parent ffb8791 commit bdbe763

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

.cursor/rules/api.mdc

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
---
7+
description:
38
globs: *.ts, src/app/api/*
49
---
510
---
@@ -9,4 +14,7 @@ globs: src/app/api/*
914
- The `schema.prisma` file is located in @/prisma, prisma is in "@/lib/prisma".
1015
- APIs always follow the **RESTFUL** style.
1116
- All api response should use `lib\utils\response.ts` function to generate response.
12-
- Should not include any translate or explanation of error in api, this should be done in front-end.
17+
- All console message should use `lib\utils\logger.ts` function to generate log.
18+
- Should not include any translate or explanation of error in api, this should be done in front-end.
19+
- The environment configuration reader is located at `lib\env.ts`.
20+
- The system configuration/settings reader is located at `lib\config\system-settings.ts`.

.cursor/rules/project-basic.mdc

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ globs: *.tsx, *.css, *.scss
1111
- The `auth.ts` file is in "@/auth", and we are using **nextauth(jsauth) 5 beta**, with API authentication logic located in **middleware**.
1212
- The environment configuration reader is located at `lib\env.ts`.
1313
- The system configuration/settings reader is located at `lib\config\system-settings.ts`.
14-
- 代码末尾默认不加分号,仅在需要的时候加

.github/workflows/code-quality.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,22 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- name: 初检
13+
uses: actions/checkout@v3
1314

14-
- name: 设置 Node.js
15+
- name: 配置环境
1516
uses: actions/setup-node@v3
1617
with:
1718
node-version: '20'
1819
cache: 'npm'
19-
20-
- run: npm ci --legacy-peer-deps
21-
- run: npm run check-lint
22-
- run: npm run check-prettier
23-
- run: npm run check-test
24-
- run: npm run check-security
20+
21+
- name: 配置环境
22+
run: npm ci --legacy-peer-deps
23+
- name: 检查质量
24+
run: npm run check-lint
25+
- name: 检查格式
26+
run: npm run check-prettier
27+
- name: 运行测试
28+
run: npm run check-jest
29+
- name: 依赖检查
30+
run: npm run check-security

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"format": "npx prettier --write \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
1212
"check-lint": "next lint",
1313
"check-prettier": "npx prettier --check \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
14-
"check-test": "npx jest",
14+
"check-jest": "npx jest",
1515
"check-security": "node scripts/security-check.js"
1616
},
1717
"dependencies": {

0 commit comments

Comments
 (0)