Skip to content

Commit 648cd37

Browse files
authored
Merge pull request #68 from phantom5099/workflow
add check and fix test failed
2 parents 6767043 + 4aa047f commit 648cd37

261 files changed

Lines changed: 18302 additions & 7264 deletions

File tree

Some content is hidden

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

.github/workflows/pr-check.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: PR Check
2+
3+
on:
4+
pull_request:
5+
branches: [main, master]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
changes:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
code: ${{ steps.filter.outputs.code }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: dorny/paths-filter@v3
22+
id: filter
23+
with:
24+
filters: |
25+
code:
26+
- 'packages/**'
27+
- 'package.json'
28+
- 'pnpm-lock.yaml'
29+
- 'tsconfig*.json'
30+
- 'vitest.config.ts'
31+
- 'eslint.config.mjs'
32+
- '.prettierrc'
33+
34+
lint:
35+
needs: changes
36+
if: ${{ needs.changes.outputs.code == 'true' }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: pnpm/action-setup@v3
41+
- uses: actions/setup-node@v4
42+
with:
43+
node-version: '22'
44+
cache: 'pnpm'
45+
- run: pnpm install
46+
- run: pnpm run lint
47+
48+
format-check:
49+
needs: changes
50+
if: ${{ needs.changes.outputs.code == 'true' }}
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: pnpm/action-setup@v3
55+
- uses: actions/setup-node@v4
56+
with:
57+
node-version: '22'
58+
cache: 'pnpm'
59+
- run: pnpm install
60+
- run: pnpm run format:check
61+
62+
typecheck:
63+
needs: changes
64+
if: ${{ needs.changes.outputs.code == 'true' }}
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: pnpm/action-setup@v3
69+
- uses: actions/setup-node@v4
70+
with:
71+
node-version: '22'
72+
cache: 'pnpm'
73+
- run: pnpm install
74+
- run: pnpm run typecheck
75+
76+
test:
77+
needs: changes
78+
if: ${{ needs.changes.outputs.code == 'true' }}
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v4
82+
- uses: pnpm/action-setup@v3
83+
- uses: actions/setup-node@v4
84+
with:
85+
node-version: '22'
86+
cache: 'pnpm'
87+
- run: pnpm install
88+
- run: pnpm vitest run
89+
90+
build-desktop:
91+
needs: [changes, lint, format-check, typecheck, test]
92+
if: ${{ needs.changes.outputs.code == 'true' }}
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
- uses: pnpm/action-setup@v3
97+
- uses: actions/setup-node@v4
98+
with:
99+
node-version: '22'
100+
cache: 'pnpm'
101+
- run: pnpm install
102+
- run: pnpm --filter @codingcode/desktop run build

.pnpmfile.cjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
hooks: {
3+
readPackage(pkg) {
4+
if (pkg.name === 'vitest' || pkg.name === '@vitest/mocker' || pkg.name === 'vite-node') {
5+
if (pkg.dependencies?.vite) {
6+
pkg.dependencies.vite = '^6.4.2';
7+
}
8+
if (pkg.peerDependencies?.vite) {
9+
pkg.peerDependencies.vite = '^6.4.2';
10+
}
11+
}
12+
return pkg;
13+
}
14+
}
15+
};

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dist/
2+
out/
3+
node_modules/
4+
package-lock.json
5+
pnpm-lock.yaml
6+
*.md

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 100
7+
}

eslint.config.mjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
4+
export default tseslint.config(
5+
eslint.configs.recommended,
6+
tseslint.configs.recommended,
7+
{
8+
ignores: ['dist/**', 'out/**', 'node_modules/**', '**/electron/**'],
9+
},
10+
{
11+
rules: {
12+
'@typescript-eslint/no-explicit-any': 'off',
13+
'@typescript-eslint/no-unused-vars': [
14+
'warn',
15+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
16+
],
17+
'no-empty': ['warn', { allowEmptyCatch: true }],
18+
'no-useless-escape': 'warn',
19+
'require-yield': 'warn',
20+
'no-useless-assignment': 'warn',
21+
'prefer-const': 'warn',
22+
'@typescript-eslint/ban-ts-comment': 'warn',
23+
'@typescript-eslint/no-this-alias': 'warn',
24+
},
25+
}
26+
);

package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "coding-agent",
33
"version": "0.1.0",
4+
"packageManager": "pnpm@11.3.0",
45
"type": "module",
56
"workspaces": [
67
"packages/infra",
@@ -12,7 +13,11 @@
1213
"start": "tsx packages/codingcode/src/cli.ts",
1314
"dev": "tsx --watch packages/codingcode/src/cli.ts",
1415
"test": "vitest",
15-
"typecheck": "tsc --noEmit",
16+
"typecheck": "tsc -b",
17+
"lint": "eslint \"packages/*/src/**/*.ts\" \"packages/*/src/**/*.tsx\" \"packages/*/test/**/*.ts\"",
18+
"lint:fix": "eslint \"packages/*/src/**/*.ts\" \"packages/*/src/**/*.tsx\" \"packages/*/test/**/*.ts\" --fix",
19+
"format": "prettier --write \"packages/**/*.{ts,tsx,json}\" \"*.json\" \"*.ts\"",
20+
"format:check": "prettier --check \"packages/**/*.{ts,tsx,json}\" \"*.json\" \"*.ts\"",
1621
"debug": "tsx src/debug.ts"
1722
},
1823
"dependencies": {
@@ -35,10 +40,20 @@
3540
"zod": "^4.4.3"
3641
},
3742
"devDependencies": {
43+
"@eslint/js": "^10.0.1",
3844
"@types/node": "^22.0.0",
45+
"eslint": "^10.4.1",
3946
"playwright-core": "^1.60.0",
47+
"prettier": "^3.8.3",
4048
"tsx": "^4.19.0",
4149
"typescript": "^5.8.0",
50+
"typescript-eslint": "^8.60.1",
51+
"vite": "^6.4.2",
4252
"vitest": "^3.0.0"
53+
},
54+
"pnpm": {
55+
"overrides": {
56+
"vite": "^6.4.2"
57+
}
4358
}
4459
}

packages/codingcode/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"dependencies": {
1212
"@ai-sdk/deepseek": "^2.0.35",
1313
"@ai-sdk/openai": "^3.0.63",
14+
"@ai-sdk/provider": "^3.0.0",
15+
"@ai-sdk/provider-utils": "^4.0.0",
1416
"ai": "^6.0.180",
1517
"effect": "^3.21.2",
1618
"hono": "^4.12.19",
1719
"zod": "^4.4.3",
18-
"@codingcode/infra": "*"
20+
"@codingcode/infra": "workspace:*"
1921
}
2022
}

0 commit comments

Comments
 (0)