Skip to content

Commit 7afa251

Browse files
committed
Merge branch 'main' into feat-frontend-api-refactor
2 parents ff0011c + 08ceb20 commit 7afa251

File tree

109 files changed

+16966
-1079
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+16966
-1079
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
coverage
4+
.github
5+
.husky
6+
*.config.js

.eslintrc.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:prettier/recommended',
8+
],
9+
plugins: ['@typescript-eslint'],
10+
ignorePatterns: ['node_modules', 'dist', '.turbo', '.next', 'build'],
11+
rules: {
12+
'@typescript-eslint/no-unused-vars': [
13+
'warn',
14+
{
15+
argsIgnorePattern: '^_',
16+
varsIgnorePattern: '^_',
17+
},
18+
],
19+
'no-console': 'warn',
20+
'prefer-const': 'error',
21+
'no-var': 'error',
22+
},
23+
};

.github/workflows/autofix.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: autofix.ci
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ "main" ]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
autofix:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.head_ref }}
22+
fetch-depth: 0
23+
24+
- uses: pnpm/action-setup@v2
25+
with:
26+
version: 8
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '20'
32+
cache: 'pnpm'
33+
34+
- name: Install dependencies
35+
run: pnpm install --no-frozen-lockfile
36+
37+
- name: Cache pnpm modules
38+
uses: actions/cache@v3
39+
with:
40+
path: ~/.pnpm-store
41+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-
44+
45+
- name: Format code with Prettier
46+
id: format
47+
run: |
48+
pnpm exec prettier --write "**/*.{js,jsx,ts,tsx,json,md}"
49+
if [ -n "$(git status --porcelain)" ]; then
50+
echo "FORMAT_HAS_CHANGES=true" >> $GITHUB_ENV
51+
fi
52+
git add .
53+
54+
- name: Run ESLint fix
55+
id: lint
56+
continue-on-error: true
57+
run: |
58+
pnpm exec eslint . --ext .js,.jsx,.ts,.tsx --fix
59+
if [ -n "$(git status --porcelain)" ]; then
60+
echo "LINT_HAS_CHANGES=true" >> $GITHUB_ENV
61+
fi
62+
# Run ESLint again to check remaining issues
63+
pnpm exec eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 || echo "LINT_HAS_ERRORS=true" >> $GITHUB_ENV
64+
git add .
65+
66+
- name: Check TypeScript
67+
continue-on-error: true
68+
run: |
69+
pnpm exec tsc --noEmit
70+
if [ $? -ne 0 ]; then
71+
echo "TS_HAS_ERRORS=true" >> $GITHUB_ENV
72+
fi
73+
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a

.github/workflows/codecov.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Run tests and upload coverage
2+
3+
on:
4+
push
5+
6+
jobs:
7+
test:
8+
name: Run tests and collect coverage
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- uses: pnpm/action-setup@v2
18+
with:
19+
version: 8
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'pnpm'
26+
27+
- name: Get pnpm store directory
28+
id: pnpm-cache
29+
shell: bash
30+
run: |
31+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
32+
33+
- name: Setup pnpm cache
34+
uses: actions/cache@v3
35+
with:
36+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
37+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
38+
restore-keys: |
39+
${{ runner.os }}-pnpm-store-
40+
41+
- name: Install dependencies
42+
run: |
43+
cd backend
44+
pnpm install --frozen-lockfile
45+
46+
- name: Run tests
47+
run: |
48+
cd backend
49+
pnpm exec jest --coverage --maxWorkers=2 --forceExit
50+
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@v4
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
directory: ./backend/coverage
56+
flags: backend
57+
fail_ci_if_error: true
58+
verbose: true

.gitignore

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
*/**.turbo/
2-
*/**/node_modules
3-
*/**/dist
4-
# temp model
5-
*/**/models
1+
# Dependencies
2+
node_modules/
3+
*/**/node_modules/
4+
5+
# Turbo
6+
.turbo/
7+
*/**/.turbo/
8+
9+
# Build outputs
10+
dist/
11+
*/**/dist/
12+
13+
# Models
14+
models/
15+
*/**/models/

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
dist
3+
coverage
4+
.github
5+
package-lock.json
6+
yarn.lock
7+
pnpm-lock.yaml

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
singleQuote: true,
3+
trailingComma: 'es5',
4+
printWidth: 80,
5+
tabWidth: 2,
6+
semi: true,
7+
bracketSpacing: true,
8+
endOfLine: 'lf',
9+
};

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
Still on progress
44

5-
Generator Ai
5+
CodeFox
6+
LOGO
7+
![](./assets/WechatIMG1000.svg)

0 commit comments

Comments
 (0)