@aiready/context-analyzer 0.9.35 → 0.9.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- github: ["caopengau"]
1
+ github: ['caopengau']
2
2
  custom:
3
3
  - https://github.com/sponsors/caopengau
4
4
  - https://receiptclaimer.com
5
- - mailto:caopengau@gmail.com
5
+ - mailto:caopengau@gmail.com
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.9.35 build /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.9.38 build /Users/pengcao/projects/aiready/packages/context-analyzer
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -9,16 +9,16 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
- ESM dist/cli.mjs 18.50 KB
12
+ CJS dist/index.js 75.45 KB
13
+ CJS dist/cli.js 87.04 KB
14
+ CJS ⚡️ Build success in 279ms
13
15
  ESM dist/index.mjs 666.00 B
14
- ESM dist/python-context-PAETRLDY.mjs 5.48 KB
15
- ESM dist/chunk-EVX2W2BK.mjs 65.61 KB
16
- ESM ⚡️ Build success in 1679ms
17
- CJS dist/cli.js 85.15 KB
18
- CJS dist/index.js 74.12 KB
19
- CJS ⚡️ Build success in 1680ms
16
+ ESM dist/cli.mjs 19.14 KB
17
+ ESM dist/python-context-TBI5FVFY.mjs 5.66 KB
18
+ ESM dist/chunk-EBXG2Q5Y.mjs 66.77 KB
19
+ ESM ⚡️ Build success in 280ms
20
20
  DTS Build start
21
- DTS ⚡️ Build success in 68534ms
21
+ DTS ⚡️ Build success in 10724ms
22
22
  DTS dist/cli.d.ts 20.00 B
23
23
  DTS dist/index.d.ts 8.07 KB
24
24
  DTS dist/cli.d.mts 20.00 B
@@ -0,0 +1,6 @@
1
+
2
+ 
3
+ > @aiready/context-analyzer@0.9.36 lint /Users/pengcao/projects/aiready/packages/context-analyzer
4
+ > eslint src
5
+
6
+  ELIFECYCLE  Command failed.
@@ -1,34 +1,35 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.9.35 test /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.9.38 test /Users/pengcao/projects/aiready/packages/context-analyzer
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/context-analyzer
8
8
 
9
- ✓ dist/__tests__/scoring.test.js (7 tests) 2ms
10
- ✓ src/__tests__/fragmentation-log.test.ts (3 tests) 3ms
11
- ✓ dist/__tests__/auto-detection.test.js (8 tests) 376ms
12
- ✓ src/__tests__/fragmentation-advanced.test.ts (3 tests) 6ms
13
- ✓ src/__tests__/analyzer.test.ts (14 tests) 461ms
14
- ✓ should build a basic dependency graph  368ms
15
- ✓ dist/__tests__/analyzer.test.js (14 tests) 430ms
16
- ✓ should build a basic dependency graph  342ms
17
- ✓ src/__tests__/auto-detection.test.ts (8 tests) 267ms
18
- ✓ src/__tests__/scoring.test.ts (7 tests) 67ms
19
- ✓ src/__tests__/file-classification.test.ts (63 tests) 241ms
20
- ✓ dist/__tests__/fragmentation-coupling.test.js (2 tests) 526ms
21
- ✓ src/__tests__/fragmentation-coupling.test.ts (2 tests) 478ms
22
- ✓ src/__tests__/enhanced-cohesion.test.ts (6 tests) 213ms
23
- ✓ dist/__tests__/fragmentation-advanced.test.js (3 tests) 21ms
24
- ✓ dist/__tests__/enhanced-cohesion.test.js (6 tests) 6ms
25
- ✓ src/__tests__/structural-cohesion.test.ts (4 tests) 95ms
26
- ✓ dist/__tests__/fragmentation-log.test.js (3 tests) 4ms
27
- ✓ dist/__tests__/structural-cohesion.test.js (4 tests) 6ms
9
+ ✓ dist/__tests__/scoring.test.js (7 tests) 8ms
10
+ ✓ src/__tests__/fragmentation-log.test.ts (3 tests) 5ms
11
+ ✓ src/__tests__/structural-cohesion.test.ts (4 tests) 4ms
12
+ ✓ src/__tests__/fragmentation-coupling.test.ts (2 tests) 60ms
13
+ ✓ src/__tests__/file-classification.test.ts (63 tests) 36ms
14
+ ✓ dist/__tests__/auto-detection.test.js (8 tests) 283ms
15
+ ✓ dist/__tests__/analyzer.test.js (14 tests) 520ms
16
+ ✓ src/__tests__/auto-detection.test.ts (8 tests) 418ms
17
+ ✓ should auto-detect domain keywords from folder paths  367ms
18
+ ✓ dist/__tests__/fragmentation-coupling.test.js (2 tests) 499ms
19
+ ✓ does not apply discount when files have no shared imports  475ms
20
+ ✓ dist/__tests__/fragmentation-advanced.test.js (3 tests) 5ms
21
+ ✓ src/__tests__/analyzer.test.ts (14 tests) 760ms
22
+ ✓ should build a basic dependency graph  427ms
23
+ ✓ dist/__tests__/structural-cohesion.test.js (4 tests) 96ms
24
+ ✓ dist/__tests__/fragmentation-log.test.js (3 tests) 3ms
25
+ ✓ src/__tests__/scoring.test.ts (7 tests) 12ms
26
+ ✓ dist/__tests__/enhanced-cohesion.test.js (6 tests) 38ms
27
+ ✓ src/__tests__/enhanced-cohesion.test.ts (6 tests) 27ms
28
+ ✓ src/__tests__/fragmentation-advanced.test.ts (3 tests) 54ms
28
29
 
29
30
   Test Files  17 passed (17)
30
31
   Tests  157 passed (157)
31
-  Start at  14:39:24
32
-  Duration  16.56s (transform 13.09s, setup 0ms, import 111.90s, tests 3.20s, environment 3ms)
32
+  Start at  00:56:30
33
+  Duration  15.56s (transform 16.50s, setup 0ms, import 90.61s, tests 2.83s, environment 29ms)
33
34
 
34
35
  [?25h
package/CONTRIBUTING.md CHANGED
@@ -14,6 +14,7 @@ The Context Analyzer measures and optimizes **context window usage** - how much
14
14
  ## 🐛 Reporting Issues
15
15
 
16
16
  Found a bug or have a feature request? [Open an issue](https://github.com/caopengau/aiready-context-analyzer/issues) with:
17
+
17
18
  - Clear description of the problem or feature
18
19
  - Sample code that demonstrates the issue
19
20
  - Expected vs actual behavior
@@ -42,6 +43,7 @@ pnpm test
42
43
  ## 📝 Making Changes
43
44
 
44
45
  1. **Fork the repository** and create a new branch:
46
+
45
47
  ```bash
46
48
  git checkout -b fix/import-depth-calculation
47
49
  # or
@@ -55,15 +57,17 @@ pnpm test
55
57
  - Keep analysis logic modular and focused
56
58
 
57
59
  3. **Test your changes**:
60
+
58
61
  ```bash
59
62
  pnpm build
60
63
  pnpm test
61
-
64
+
62
65
  # Test on real codebases
63
66
  ./dist/cli.js /path/to/test-repo
64
67
  ```
65
68
 
66
69
  4. **Commit using conventional commits**:
70
+
67
71
  ```bash
68
72
  git commit -m "fix: accurate import depth calculation"
69
73
  git commit -m "feat: add cohesion metric"
@@ -93,6 +97,7 @@ We use [Conventional Commits](https://www.conventionalcommits.org/):
93
97
  - Verify output formats (console, JSON)
94
98
 
95
99
  Example test:
100
+
96
101
  ```typescript
97
102
  test('calculates import depth correctly', () => {
98
103
  const result = analyzeFile('src/utils/helper.ts', [...files]);
@@ -121,9 +126,10 @@ src/
121
126
  ### Adding a New Metric
122
127
 
123
128
  1. Create `src/metrics/your-metric.ts`:
129
+
124
130
  ```typescript
125
131
  import type { FileAnalysis } from '../types';
126
-
132
+
127
133
  export function calculateYourMetric(file: FileAnalysis): number {
128
134
  // Your calculation logic
129
135
  return metricValue;
@@ -143,6 +149,7 @@ src/
143
149
  ## 🎯 Areas for Contribution
144
150
 
145
151
  Great places to start:
152
+
146
153
  - **New metrics**: Add new context quality measurements
147
154
  - **Better calculations**: Improve token estimation accuracy
148
155
  - **Language support**: Add analysis for more file types
@@ -167,6 +174,7 @@ Great places to start:
167
174
  ## 💡 Feature Ideas
168
175
 
169
176
  Looking for inspiration? Consider:
177
+
170
178
  - Language-specific context costs (TypeScript vs Python)
171
179
  - Framework-aware analysis (React hooks, Vue composables)
172
180
  - Bundle size estimation