@aiready/consistency 0.6.5 → 0.6.7

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,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/consistency@0.6.5 build /Users/pengcao/projects/aiready/packages/consistency
3
+ > @aiready/consistency@0.6.7 build /Users/pengcao/projects/aiready/packages/consistency
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/chunk-ON73WHHU.mjs 34.85 KB
13
- ESM dist/index.mjs 14.04 KB
12
+ CJS dist/index.js 46.99 KB
13
+ CJS dist/cli.js 45.90 KB
14
+ CJS ⚡️ Build success in 55ms
14
15
  ESM dist/cli.mjs 8.55 KB
15
- ESM ⚡️ Build success in 40ms
16
- CJS dist/cli.js 45.11 KB
17
- CJS dist/index.js 50.15 KB
18
- CJS ⚡️ Build success in 40ms
16
+ ESM dist/index.mjs 9.73 KB
17
+ ESM dist/chunk-WTBDNCEN.mjs 36.20 KB
18
+ ESM ⚡️ Build success in 55ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 1037ms
20
+ DTS ⚡️ Build success in 1008ms
21
21
  DTS dist/cli.d.ts 20.00 B
22
- DTS dist/index.d.ts 2.73 KB
22
+ DTS dist/index.d.ts 2.77 KB
23
23
  DTS dist/cli.d.mts 20.00 B
24
- DTS dist/index.d.mts 2.73 KB
24
+ DTS dist/index.d.mts 2.77 KB
@@ -1,12 +1,13 @@
1
1
 
2
2
  
3
- > @aiready/consistency@0.6.5 test /Users/pengcao/projects/aiready/packages/consistency
3
+ > @aiready/consistency@0.6.7 test /Users/pengcao/projects/aiready/packages/consistency
4
4
  > vitest run
5
5
 
6
6
 
7
7
   RUN  v2.1.9 /Users/pengcao/projects/aiready/packages/consistency
8
8
 
9
- [?25l · should detect single letter variables
9
+ [?25l · analyzeNaming (8)
10
+ · should detect single letter variables
10
11
  · should NOT flag acceptable abbreviations
11
12
  · should NOT flag common short English words
12
13
  · should detect snake_case in TypeScript files
@@ -25,26 +26,7 @@
25
26
  · should generate relevant recommendations
26
27
  · should suggest standardizing error handling
27
28
  · should suggest using async/await consistently
28
- [?25l[?25l[?25l[?25l[?25l[?25l[?25l ✓ should detect single letter variables
29
- ✓ should NOT flag acceptable abbreviations
30
- ✓ should NOT flag common short English words
31
- ✓ should detect snake_case in TypeScript files
32
- ✓ should detect unclear boolean names
33
- ✓ should allow common abbreviations
34
- ✓ should NOT flag multi-line arrow function parameters (Phase 3)
35
- ✓ should NOT flag short-lived comparison variables (Phase 3)
36
- ✓ analyzePatterns (3)
37
- ✓ should detect mixed error handling
38
- ✓ should detect mixed async patterns
39
- ✓ should detect mixed import styles
40
- ✓ consistency scoring (2)
41
- ✓ should calculate consistency score correctly
42
- ✓ should weight critical issues more than info
43
- ✓ recommendations (3)
44
- ✓ should generate relevant recommendations
45
- ✓ should suggest standardizing error handling
46
- ✓ should suggest using async/await consistently
47
-  ✓ src/__tests__/analyzer.test.ts (18)
29
+ [?25l[?25l[?25l[?25l[?25l[?25l[?25l ✓ src/__tests__/analyzer.test.ts (18)
48
30
  ✓ analyzeConsistency (2)
49
31
  ✓ should analyze naming issues
50
32
  ✓ should detect minimum severity filtering
@@ -71,7 +53,7 @@
71
53
 
72
54
   Test Files  1 passed (1)
73
55
   Tests  18 passed (18)
74
-  Start at  01:15:32
75
-  Duration  615ms (transform 90ms, setup 0ms, collect 263ms, tests 130ms, environment 0ms, prepare 47ms)
56
+  Start at  18:32:20
57
+  Duration  616ms (transform 97ms, setup 0ms, collect 259ms, tests 138ms, environment 0ms, prepare 47ms)
76
58
 
77
59
  [?25h[?25h
package/README.md CHANGED
@@ -6,20 +6,50 @@ Helps teams maintain consistent coding practices across their codebase, making i
6
6
 
7
7
  ## 🚀 Quick Start
8
8
 
9
- **Recommended: Use the unified CLI** (includes consistency checking + more tools):
9
+ **Zero config, works out of the box:**
10
10
 
11
11
  ```bash
12
- npm install -g @aiready/cli
13
- aiready consistency ./src
12
+ # Run without installation (recommended)
13
+ npx @aiready/consistency ./src
14
+
15
+ # Or use the unified CLI (includes all AIReady tools)
16
+ npx @aiready/cli scan ./src
17
+
18
+ # Or install globally for simpler command and faster runs
19
+ npm install -g @aiready/consistency
20
+ aiready-consistency ./src
14
21
  ```
15
22
 
16
- **Or use this package directly:**
23
+ ### 🎯 Input & Output
17
24
 
25
+ **Input:** Path to your source code directory
18
26
  ```bash
19
- npm install -g @aiready/consistency
20
27
  aiready-consistency ./src
21
28
  ```
22
29
 
30
+ **Output:** Terminal report + optional JSON file (saved to `.aiready/` directory)
31
+ ```
32
+ 📊 Consistency Analysis
33
+ ━━━━━━━━━━━━━━━━━━━━━━━━
34
+ 📁 Files analyzed: 47
35
+ ⚠️ Issues found: 15 naming + 8 pattern issues
36
+
37
+ CRITICAL (2 files)
38
+ src/utils/helpers.ts:12 - poor-naming: x
39
+ src/api/users.ts:45 - convention-mix: user_name
40
+ ```
41
+
42
+ ### ✨ Smart Defaults (Zero Config)
43
+
44
+ - ✅ **Auto-excludes** test files (`**/*.test.*`, `**/*.spec.*`, `**/__tests__/**`)
45
+ - ✅ **Auto-excludes** build outputs (`dist/`, `build/`, `.next/`)
46
+ - ✅ **Auto-excludes** dependencies (`node_modules/`)
47
+ - ✅ **Context-aware**: Skips common iterators (i, j, k) in loops
48
+ - ✅ **100+ built-in** acceptable abbreviations (env, api, url, ctx, etc.)
49
+ - ✅ **Smart detection**: Recognizes arrow functions, factory patterns, callbacks
50
+
51
+ > Override defaults with `--include-tests` or `--exclude <patterns>` as needed
52
+
23
53
  ## 🎯 What It Does
24
54
 
25
55
  Inconsistent code patterns confuse AI models and reduce their effectiveness. This tool analyzes:
@@ -258,6 +288,10 @@ This tool is part of the [AIReady](https://github.com/caopengau/aiready) ecosyst
258
288
  - [Contributing Guide](./CONTRIBUTING.md)
259
289
  - [AIReady Main Repo](https://github.com/caopengau/aiready)
260
290
 
291
+ ## 🌐 Visit Our Website
292
+
293
+ **Try AIReady tools online and maintain code consistency:** [getaiready.dev](https://getaiready.dev)
294
+
261
295
  ## 📄 License
262
296
 
263
297
  MIT © AIReady Team