@l4yercak3/cli 1.2.20 → 1.2.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l4yercak3/cli",
3
- "version": "1.2.20",
3
+ "version": "1.2.21",
4
4
  "description": "Icing on the L4yercak3 - The sweet finishing touch for your Layer Cake integration",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -90,15 +90,32 @@ function getGitStatus(projectPath) {
90
90
  * Returns true if we should proceed, false if user wants to abort
91
91
  */
92
92
  async function checkGitStatusBeforeGeneration(projectPath) {
93
+ const debug = process.env.L4YERCAK3_DEBUG;
94
+
95
+ if (debug) {
96
+ console.log('\n[DEBUG] Git status check:');
97
+ console.log(` projectPath: "${projectPath}"`);
98
+ }
99
+
93
100
  // Skip if not a git repo
94
101
  if (!isGitRepo(projectPath)) {
102
+ if (debug) {
103
+ console.log(' → Not a git repo, skipping check');
104
+ }
95
105
  return true;
96
106
  }
97
107
 
98
108
  const status = getGitStatus(projectPath);
99
109
 
110
+ if (debug) {
111
+ console.log(` → Git status: "${status.substring(0, 100)}${status.length > 100 ? '...' : ''}"`);
112
+ }
113
+
100
114
  // No uncommitted changes - proceed
101
115
  if (!status) {
116
+ if (debug) {
117
+ console.log(' → No uncommitted changes, proceeding');
118
+ }
102
119
  return true;
103
120
  }
104
121
 
@@ -705,6 +722,15 @@ async function handleSpread() {
705
722
  selectedDatabase,
706
723
  };
707
724
 
725
+ // Debug: Log generation options
726
+ if (process.env.L4YERCAK3_DEBUG) {
727
+ console.log('\n[DEBUG] Spread: Generation options:');
728
+ console.log(` frameworkType: "${generationOptions.frameworkType}"`);
729
+ console.log(` integrationPath: "${generationOptions.integrationPath}"`);
730
+ console.log(` isTypeScript: ${generationOptions.isTypeScript}`);
731
+ console.log(` features: [${generationOptions.features.join(', ')}]`);
732
+ }
733
+
708
734
  const generatedFiles = await fileGenerator.generate(generationOptions);
709
735
 
710
736
  // Display results
@@ -28,10 +28,10 @@ const sortedDetectors = [...detectors].sort((a, b) => b.priority - a.priority);
28
28
 
29
29
  /**
30
30
  * Detect project type
31
- *
31
+ *
32
32
  * Runs all detectors in priority order and returns the first match
33
33
  * with confidence > 0.8, or all results if no high-confidence match.
34
- *
34
+ *
35
35
  * @param {string} projectPath - Path to project directory
36
36
  * @returns {object} Detection results
37
37
  */
@@ -43,11 +43,24 @@ function detectProjectType(projectPath = process.cwd()) {
43
43
  allResults: [], // All detector results (for debugging)
44
44
  };
45
45
 
46
+ const debug = process.env.L4YERCAK3_DEBUG;
47
+
48
+ if (debug) {
49
+ console.log('\n[DEBUG] Registry: Running detectors in priority order:');
50
+ }
51
+
46
52
  // Run all detectors
47
53
  for (const detector of sortedDetectors) {
48
54
  try {
49
55
  const result = detector.detect(projectPath);
50
-
56
+
57
+ if (debug) {
58
+ console.log(` [${detector.name}] priority=${detector.priority}, detected=${result.detected}, confidence=${result.confidence}`);
59
+ if (result.metadata) {
60
+ console.log(` metadata: ${JSON.stringify(result.metadata)}`);
61
+ }
62
+ }
63
+
51
64
  results.allResults.push({
52
65
  detector: detector.name,
53
66
  priority: detector.priority,
@@ -57,9 +70,14 @@ function detectProjectType(projectPath = process.cwd()) {
57
70
  // If this detector found a match with high confidence, use it
58
71
  if (result.detected && result.confidence > 0.8) {
59
72
  if (result.confidence > results.confidence) {
73
+ if (debug) {
74
+ console.log(` → Selected as best match (confidence ${result.confidence} > ${results.confidence})`);
75
+ }
60
76
  results.detected = detector.name;
61
77
  results.confidence = result.confidence;
62
78
  results.metadata = result.metadata;
79
+ } else if (debug) {
80
+ console.log(` → Skipped (confidence ${result.confidence} <= ${results.confidence})`);
63
81
  }
64
82
  }
65
83
  } catch (error) {
@@ -68,6 +86,10 @@ function detectProjectType(projectPath = process.cwd()) {
68
86
  }
69
87
  }
70
88
 
89
+ if (debug) {
90
+ console.log(`\n[DEBUG] Registry: Final result: ${results.detected} (confidence: ${results.confidence})`);
91
+ }
92
+
71
93
  return results;
72
94
  }
73
95
 
@@ -99,8 +99,14 @@ class QuickStartGenerator {
99
99
  // 4. Generate React components (mobile or web)
100
100
  if (options.features && options.features.length > 0) {
101
101
  if (isMobile) {
102
+ if (process.env.L4YERCAK3_DEBUG) {
103
+ console.log(' → Calling mobileComponentGenerator.generate()');
104
+ }
102
105
  results.components = await mobileComponentGenerator.generate(options);
103
106
  } else {
107
+ if (process.env.L4YERCAK3_DEBUG) {
108
+ console.log(' → Calling componentGenerator.generate() (web)');
109
+ }
104
110
  results.components = await componentGenerator.generate(options);
105
111
  }
106
112
  }