@sun-asterisk/sunlint 1.3.3 โ†’ 1.3.4

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.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,35 @@
2
2
 
3
3
  ---
4
4
 
5
- ## ๐Ÿš€ **v1.3.3 - Performance & File Limits Optimization (September 4, 2025)**
5
+ ## ๏ฟฝ **v1.3.4 - Engine Auto Hotfix (September 5, 2025)**
6
+
7
+ **Release Date**: September 5, 2025
8
+ **Type**: Critical Hotfix
9
+
10
+ ### ๐Ÿšจ **Critical Bug Fix**
11
+ - **FIXED**: Engine "auto" validation and selection logic
12
+ - **Issue**: `--engine=auto` causing "Invalid engine: auto" error in v1.3.3
13
+ - **Root Cause**: Missing auto engine support in validation and orchestrator
14
+ - **Solution**: Comprehensive auto engine implementation
15
+ - Added "auto" case to engine factory with heuristic fallback
16
+ - Updated CLI validation to include "auto" in valid engines
17
+ - Enhanced orchestrator to resolve "auto" to actual engines (heuristic + eslint)
18
+ - Fixed CLI action handler auto-detection logic
19
+
20
+ ### ๐Ÿงช **Validation Results**
21
+ - **โœ… Auto engine**: Works correctly (auto-selects heuristic + eslint)
22
+ - **โœ… Heuristic engine**: Unchanged, working properly
23
+ - **โœ… ESLint engine**: Unchanged, working properly
24
+ - **โœ… CLI help**: Shows all engines including auto option
25
+
26
+ ### ๐Ÿ“ฆ **Upgrade Notes**
27
+ - **Zero breaking changes** - seamless upgrade from v1.3.3
28
+ - **Default `--engine=auto`** now works as intended
29
+ - **All existing commands** continue to work unchanged
30
+
31
+ ---
32
+
33
+ ## ๏ฟฝ๐Ÿš€ **v1.3.3 - Performance & File Limits Optimization (September 4, 2025)**
6
34
 
7
35
  **Release Date**: September 4, 2025
8
36
  **Type**: Performance Enhancement & User Experience
@@ -21,7 +49,14 @@
21
49
  - **Auto-detection**: Smart defaults for 90% of use cases
22
50
  - **Manual tuning**: Fine control for enterprise projects
23
51
 
24
- ### ๐Ÿ“š **Documentation Expansion**
52
+ ### ๏ฟฝ **Bug Fixes**
53
+ - **FIXED**: Engine "auto" validation and selection logic
54
+ - **Engine Factory**: Added "auto" case with fallback to heuristic engine
55
+ - **CLI Validation**: Added "auto" to valid engines list
56
+ - **Orchestrator**: Auto-resolve "auto" to actual engines (heuristic + eslint)
57
+ - **Engine Selection**: Auto-detection works correctly for rule preferences
58
+
59
+ ### ๏ฟฝ๐Ÿ“š **Documentation Expansion**
25
60
  - **NEW**: [FILE_LIMITS_EXPLANATION.md](./docs/FILE_LIMITS_EXPLANATION.md) - Comprehensive guide (5.7KB)
26
61
  - **NEW**: [QUICK_FILE_LIMITS.md](./docs/QUICK_FILE_LIMITS.md) - Quick reference (1.8KB)
27
62
  - **ENHANCED**: CLI help with clear usage examples
@@ -345,6 +345,12 @@ class AnalysisOrchestrator {
345
345
  getEnginePreference(rule, config) {
346
346
  // If user specified a specific engine via --engine option, use only that engine
347
347
  if (config.requestedEngine) {
348
+ // Handle "auto" engine selection
349
+ if (config.requestedEngine === 'auto') {
350
+ // Auto-select best engines: default to heuristic, add eslint for JS/TS
351
+ return ['heuristic', 'eslint'];
352
+ }
353
+
348
354
  return [config.requestedEngine];
349
355
  }
350
356
 
@@ -164,6 +164,20 @@ class CliActionHandler {
164
164
  determineEnabledEngines(config) {
165
165
  // If specific engine is requested via --engine option, use only that engine
166
166
  if (this.options.engine) {
167
+ // Handle "auto" engine selection
168
+ if (this.options.engine === 'auto') {
169
+ // Auto-select best engines: default to heuristic for compatibility
170
+ const autoEngines = ['heuristic'];
171
+
172
+ // Add ESLint for JS/TS files if available
173
+ if (this.hasJavaScriptTypeScriptFiles() || config.eslint?.enabled !== false) {
174
+ autoEngines.push('eslint');
175
+ }
176
+
177
+ return autoEngines;
178
+ }
179
+
180
+ // Return specific engine as requested
167
181
  return [this.options.engine];
168
182
  }
169
183
 
@@ -272,7 +286,7 @@ class CliActionHandler {
272
286
  validateInput(config) {
273
287
  // Validate engine option if specified (check this first, always)
274
288
  if (this.options.engine) {
275
- const validEngines = ['eslint', 'heuristic', 'openai'];
289
+ const validEngines = ['auto', 'eslint', 'heuristic', 'openai'];
276
290
  if (!validEngines.includes(this.options.engine)) {
277
291
  throw new Error(
278
292
  chalk.red(`โŒ Invalid engine: ${this.options.engine}\n`) +
@@ -51,6 +51,13 @@ class EngineFactory {
51
51
  let engine = null;
52
52
 
53
53
  switch (engineType.toLowerCase()) {
54
+ case 'auto':
55
+ // Auto-detection: default to heuristic for best performance/compatibility
56
+ engine = new HeuristicEngine();
57
+ if (this.verbose) {
58
+ console.log('๐Ÿค– Auto-detected engine: heuristic (best performance/compatibility)');
59
+ }
60
+ break;
54
61
  case 'heuristic':
55
62
  engine = new HeuristicEngine();
56
63
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sun-asterisk/sunlint",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "โ˜€๏ธ SunLint - Multi-language static analysis tool for code quality and security | Sun* Engineering Standards",
5
5
  "main": "cli.js",
6
6
  "bin": {