Skip to content

Commit b0c432b

Browse files
authored
Merge pull request #6 from PatrickSys/chore/infrastructure-upgrade
chore: finalize v1.3.0 infrastructure and quality checks
2 parents 08de9b6 + 396688c commit b0c432b

26 files changed

+3333
-1497
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,47 @@ on:
77
branches: [master]
88

99
jobs:
10-
test:
10+
quality:
11+
name: Quality Checks
1112
runs-on: ubuntu-latest
1213
steps:
1314
- uses: actions/checkout@v4
14-
1515
- uses: pnpm/action-setup@v2
1616
with:
1717
version: 10
18-
1918
- uses: actions/setup-node@v4
2019
with:
2120
node-version: '20'
2221
cache: 'pnpm'
22+
- run: pnpm install --frozen-lockfile
23+
24+
- name: Lint & Format
25+
run: |
26+
pnpm lint
27+
pnpm format:check
2328
29+
- name: Type Check
30+
run: pnpm type-check
31+
32+
- name: Security Audit
33+
run: pnpm audit
34+
35+
test:
36+
name: Functional Tests
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: pnpm/action-setup@v2
41+
with:
42+
version: 10
43+
- uses: actions/setup-node@v4
44+
with:
45+
node-version: '20'
46+
cache: 'pnpm'
2447
- run: pnpm install --frozen-lockfile
25-
- run: pnpm audit
26-
- run: pnpm build
27-
- run: pnpm test
48+
49+
- name: Build
50+
run: pnpm build
51+
52+
- name: Run Tests
53+
run: pnpm test

.prettierrc

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

CONTRIBUTING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
```bash
66
git clone https://github.com/PatrickSys/codebase-context.git
77
cd codebase-context
8-
npm install
9-
npm run build
8+
pnpm install
9+
pnpm build
10+
1011
```
1112

1213
## Using the Package
@@ -37,7 +38,8 @@ src/
3738

3839
**Better search ranking** - The hybrid search in `src/core/search.ts` could use tuning. Currently uses RRF to combine semantic and keyword scores.
3940

40-
**Tests** - There are none. Any test coverage would be an improvement.
41+
**Tests** - Run `pnpm test`. We use Vitest for unit and smoke testing.
42+
4143

4244
## Adding a Framework Analyzer
4345

@@ -59,7 +61,7 @@ interface FrameworkAnalyzer {
5961
## Running Locally
6062

6163
```bash
62-
npm run build
64+
pnpm build
6365
node dist/index.js /path/to/test/project
6466
```
6567

@@ -68,7 +70,7 @@ The server logs to stderr, so you can see what it's doing.
6870
## Pull Requests
6971

7072
- Fork, branch, make changes
71-
- Run `npm run build` to make sure it compiles
73+
- Run `pnpm build` to make sure it compiles
7274
- Test on an actual project
7375
- Open PR with what you changed and why
7476

eslint.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import js from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import prettier from 'eslint-config-prettier';
4+
import globals from 'globals';
5+
6+
export default tseslint.config(
7+
{ ignores: ['dist', 'node_modules', 'coverage'] },
8+
{
9+
extends: [js.configs.recommended, ...tseslint.configs.recommended, prettier],
10+
files: ['src/**/*.ts', 'tests/**/*.ts'],
11+
languageOptions: {
12+
ecmaVersion: 2020,
13+
globals: globals.node,
14+
},
15+
plugins: {
16+
// import plugin is handled via recommended usually, but kept simple for now
17+
},
18+
rules: {
19+
'@typescript-eslint/no-explicit-any': 'warn',
20+
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_', 'caughtErrorsIgnorePattern': '^_' }],
21+
'no-console': ['warn', { 'allow': ['warn', 'error'] }],
22+
},
23+
},
24+
);

package.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@
7979
"dev": "ts-node src/index.ts",
8080
"watch": "tsc -w",
8181
"test": "vitest run",
82-
"test:watch": "vitest"
82+
"test:watch": "vitest",
83+
"lint": "eslint \"src/**/*.ts\"",
84+
"format": "prettier --write \"src/**/*.ts\"",
85+
"format:check": "prettier --check \"src/**/*.ts\"",
86+
"type-check": "tsc --noEmit"
8387
},
8488
"dependencies": {
8589
"@lancedb/lancedb": "^0.4.0",
@@ -94,10 +98,26 @@
9498
"zod": "^4.3.4"
9599
},
96100
"devDependencies": {
101+
"@eslint/js": "^9.39.2",
97102
"@types/glob": "^8.1.0",
98103
"@types/node": "^20.11.24",
99104
"@types/uuid": "^9.0.8",
105+
"@typescript-eslint/eslint-plugin": "^8.51.0",
106+
"@typescript-eslint/parser": "^8.51.0",
107+
"eslint": "^9.39.2",
108+
"eslint-config-prettier": "^10.1.8",
109+
"eslint-plugin-import": "^2.32.0",
110+
"globals": "^17.0.0",
111+
"prettier": "^3.7.4",
100112
"ts-node": "^10.9.2",
113+
"typescript-eslint": "^8.51.0",
101114
"vitest": "^4.0.16"
115+
},
116+
"pnpm": {
117+
"onlyBuiltDependencies": [
118+
"esbuild",
119+
"protobufjs",
120+
"sharp"
121+
]
102122
}
103123
}

0 commit comments

Comments
 (0)