Skip to content

Commit e26075f

Browse files
committed
Translate CLAUDE.md to English, update CI matrix to Node 20 + 22
1 parent b97a237 commit e26075f

2 files changed

Lines changed: 40 additions & 40 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: [18, 20]
14+
node-version: [20, 22]
1515

1616
steps:
1717
- uses: actions/checkout@v4

CLAUDE.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
# Lambda Doctor — Implementation Guide
22

3-
Bu projenin scaffold'u hazır. Aşağıdaki sırayla implement et.
3+
Project scaffold is ready. Implement in the following order.
44

55
## Implementation Order
66

77
### 1. `src/analyzers/bundle-size.ts`
8-
- `fast-glob` ile `node_modules/` altındaki tüm dosyaları tara
9-
- @scoped paketleri doğru grupla (`@aws-sdk/client-dynamodb``@aws-sdk/client-dynamodb`)
10-
- `fs.stat` ile dosya boyutlarını topla
11-
- Top 10 en büyük dependency'yi raporla
8+
- Scan all files under `node_modules/` using `fast-glob`
9+
- Group scoped packages correctly (`@aws-sdk/client-dynamodb``@aws-sdk/client-dynamodb`)
10+
- Collect file sizes via `fs.stat`
11+
- Report top 10 largest dependencies
1212
- Thresholds: >50MB critical, >10MB warning, single dep >5MB critical, >1MB warning
1313

1414
### 2. `src/analyzers/heavy-dependencies.ts`
15-
- `package.json` oku, `dependencies` ve `devDependencies` ayrıştır
16-
- Her dependency'yi `known-heavy-packages.ts` ile karşılaştır
17-
- typescript, ts-node gibi dev tool'ların `dependencies`'de olmasını critical olarak flag'le
18-
- Match olan her paket için alternative ve estimatedSavingsMs değerlerini diagnostic'e ekle
15+
- Read `package.json`, split `dependencies` and `devDependencies`
16+
- Check each dependency against `known-heavy-packages.ts`
17+
- Flag dev tools (typescript, ts-node) in `dependencies` as critical
18+
- Add alternative and estimatedSavingsMs to each diagnostic
1919

2020
### 3. `src/analyzers/import-analysis.ts`
21-
- `fast-glob` ile `.ts`, `.js`, `.mjs` dosyalarını bul (node_modules hariç)
22-
- Regex ile import/require pattern'lerini çıkar:
21+
- Find `.ts`, `.js`, `.mjs` files using `fast-glob` (excluding node_modules)
22+
- Extract import/require patterns with regex:
2323
- ESM: `/^import\s+.*\s+from\s+['"](.+)['"]/gm`
2424
- CJS: `/^(?:const|let|var)\s+.*=\s*require\(['"](.+)['"]\)/gm`
25-
- Top-level vs function-body tespiti: satır indentation 0-1 ise top-level
26-
- Heavy paket top-level import'ını flag'le
27-
- `import * as` pattern'ini flag'le (tree-shaking engelliyor)
25+
- Top-level vs function-body detection: line indentation 0-1 = top-level
26+
- Flag top-level imports of heavy packages
27+
- Flag `import * as` patterns (blocks tree-shaking)
2828

2929
### 4. `src/analyzers/aws-sdk.ts`
30-
- package.json'da `aws-sdk` (v2) varsa → critical
31-
- `@aws-sdk/client-*` varsa → good, count et
32-
- İkisi birden varsa → warning (incomplete migration)
33-
- 5'ten fazla @aws-sdk client → info (çok fazla client)
34-
- Source'da `@aws-sdk/client-sso` import'u → warning (Lambda'da gereksiz)
30+
- `aws-sdk` (v2) in package.json → critical
31+
- `@aws-sdk/client-*` present → good, count them
32+
- Both v2 and v3 → warning (incomplete migration)
33+
- More than 5 @aws-sdk clients → info (too many clients)
34+
- `@aws-sdk/client-sso` import in source → warning (unnecessary in Lambda)
3535

3636
### 5. `src/analyzers/bundler-detection.ts`
37-
- package.json devDependencies'de bundler var mı: esbuild, webpack, rollup, tsup, parcel
38-
- Config dosyaları var mı: webpack.config.*, rollup.config.*, tsup.config.*, esbuild.config.*
39-
- package.json scripts'te bundler keyword'leri var mı
40-
- serverless.yml'de serverless-esbuild veya serverless-webpack var mı
41-
- `"type": "module"` set mi (ESM check)
42-
- Hiç bundler yoksa → critical (en büyük iyileştirme fırsatı)
37+
- Check devDependencies for bundlers: esbuild, webpack, rollup, tsup, parcel
38+
- Check for config files: webpack.config.*, rollup.config.*, tsup.config.*, esbuild.config.*
39+
- Check package.json scripts for bundler keywords
40+
- Check serverless.yml for serverless-esbuild or serverless-webpack
41+
- Check for `"type": "module"` (ESM)
42+
- No bundler found → critical (biggest optimization opportunity)
4343

4444
### 6. `src/reporters/console.ts`
45-
- chalk ile renkli output
45+
- Colored output with chalk
4646
- Severity icon mapping: critical=🔴, warning=⚠️, info=💡
47-
- Bundle size breakdown (top dependencies tablosu)
48-
- Diagnostics severity'ye göre sıralı
49-
- Footer'da toplam estimated improvement
47+
- Bundle size breakdown (top dependencies table)
48+
- Diagnostics sorted by severity
49+
- Footer with total estimated improvement
5050

5151
### 7. `src/bin/cli.ts`
52-
- ora spinner göster analiz sırasında
53-
- Error handling: path yoksa, package.json yoksa anlamlı hata mesajı
54-
- JSON output formatı desteği
55-
- Critical issue varsa exit code 1
52+
- Show ora spinner during analysis
53+
- Error handling: meaningful messages for missing path or package.json
54+
- JSON output format support
55+
- Exit code 1 if critical issues found
5656

5757
## Quality Standards
5858

59-
- Her analyzer kendi AnalyzerResult'unu döner
60-
- Tüm file I/O async olmalı (fs/promises)
61-
- Her diagnostic'te mutlaka: title, description, recommendation, estimatedImpactMs
62-
- Hiçbir analyzer crash etmemeli — hata durumunda boş result dön, console'a warning bas
63-
- Test fixtures'daki unhealthy-lambda'da en az 8 issue bulunmalı
64-
- Test fixtures'daki healthy-lambda'da 0 critical issue bulunmalı
59+
- Each analyzer returns its own AnalyzerResult
60+
- All file I/O must be async (fs/promises)
61+
- Every diagnostic must have: title, description, recommendation, estimatedImpactMs
62+
- No analyzer should crash — return empty result on error, log warning to console
63+
- Test fixtures: unhealthy-lambda must have at least 8 issues
64+
- Test fixtures: healthy-lambda must have 0 critical issues
6565

6666
## Run & Verify
6767

0 commit comments

Comments
 (0)