@deneb-ui/cli 2.0.84 → 2.0.86

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  const ARC_NAME = 'Deneb ARC';
4
4
  const ARC_FULL_NAME = 'Deneb Adaptive Refactoring Compiler — AI-Augmented';
5
- const ARC_VERSION = '2.1.0';
5
+ const ARC_VERSION = '2.2.0';
6
6
  const SCHEMA_VERSION = 2;
7
7
  const ENGINE_ID = 'deneb-arc';
8
8
 
@@ -13,17 +13,49 @@ const fs = require('fs');
13
13
  const path = require('path');
14
14
  const { spawnSync } = require('child_process');
15
15
  const { matchRecipeForProject, loadAllRecipes } = require('./recipe-engine.cjs');
16
- const { healMissingSiteDataHooks, healBroadContainerMarkers, healSectionOverflowHidden } = require('../arc/transformer.cjs');
16
+ const { healMissingSiteDataHooks, healBroadContainerMarkers, healSectionOverflowHidden, healUnguardedModalConditionalsInSource } = require('../arc/transformer.cjs');
17
+
18
+ function getVisualWidth(str) {
19
+ if (!str) return 0;
20
+ const stripped = String(str).replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '');
21
+ let width = 0;
22
+ for (const char of stripped) {
23
+ const code = char.codePointAt(0);
24
+ if (
25
+ (code >= 0x1100 && code <= 0x115F) ||
26
+ (code >= 0x2E80 && code <= 0xA4CF) ||
27
+ (code >= 0xAC00 && code <= 0xD7A3) ||
28
+ (code >= 0xF900 && code <= 0xFAFF) ||
29
+ (code >= 0xFE10 && code <= 0xFE19) ||
30
+ (code >= 0xFE30 && code <= 0xFE6F) ||
31
+ (code >= 0xFF00 && code <= 0xFF60) ||
32
+ (code >= 0xFFE0 && code <= 0xFFE6) ||
33
+ (code >= 0x1F000 && code <= 0x1FAFF) ||
34
+ (code >= 0x2600 && code <= 0x27BF)
35
+ ) {
36
+ width += 2;
37
+ } else if (code > 0xFFFF) {
38
+ width += 2;
39
+ } else {
40
+ width += 1;
41
+ }
42
+ }
43
+ return width;
44
+ }
17
45
 
18
- function createBox(lines, width = 60) {
19
- const horizontal = '═'.repeat(width - 2);
46
+ function createBox(lines, preferredWidth = 66) {
47
+ const visualLengths = lines.map((l) => getVisualWidth(l));
48
+ const maxLineVisual = Math.max(...visualLengths, 0);
49
+ const boxWidth = Math.max(preferredWidth, maxLineVisual + 6);
50
+ const innerWidth = boxWidth - 4;
51
+
52
+ const horizontal = '═'.repeat(boxWidth - 2);
20
53
  const top = ` ╔${horizontal}╗`;
21
54
  const bottom = ` ╚${horizontal}╝`;
22
55
 
23
- const content = lines.map((line) => {
24
- // Strip ANSI colors for length calculation
25
- const stripped = line.replace(/\x1b\[[0-9;]*m/g, '');
26
- const padding = Math.max(0, width - 4 - stripped.length);
56
+ const content = lines.map((line, idx) => {
57
+ const vLen = visualLengths[idx];
58
+ const padding = Math.max(0, innerWidth - vLen);
27
59
  const leftPad = Math.floor(padding / 2);
28
60
  const rightPad = padding - leftPad;
29
61
  return ` ║ ${' '.repeat(leftPad)}${line}${' '.repeat(rightPad)} ║`;
@@ -289,17 +321,29 @@ function runDoctor(targetDirInput = '.', options = {}) {
289
321
  addCheck(suite2, 'err', 'Platform Engine Compatibility', 'Detected packages requiring Node >=22. Run "deneb doctor --fix" to inject Node 20 overrides.', { code: 'DNB-ENG-001' }) //, 'Detected packages requiring Node >=22. Run "deneb doctor --fix" to inject Node 20 overrides.');
290
322
  }
291
323
 
292
- // Pre-heal missing useSiteData hooks before tsc runs when --fix is enabled
324
+ // Pre-heal missing useSiteData hooks and unguarded modals before tsc runs when --fix is enabled
293
325
  if (shouldFix) {
294
326
  for (const file of sourceFiles) {
295
327
  if (!/\.(tsx|jsx|ts|js)$/.test(file)) continue;
296
328
  let c = fs.readFileSync(file, 'utf-8');
329
+ let modified = false;
297
330
  if (c.includes('siteData')) {
298
331
  const healed = healMissingSiteDataHooks(c, file);
299
332
  if (healed && healed !== c) {
300
- fs.writeFileSync(file, healed, 'utf8');
333
+ c = healed;
334
+ modified = true;
335
+ }
336
+ }
337
+ if (c.includes('AnimatePresence') || c.includes('fixed inset-0')) {
338
+ const modalHealed = healUnguardedModalConditionalsInSource(c, file);
339
+ if (modalHealed && modalHealed.updated) {
340
+ c = modalHealed.code;
341
+ modified = true;
301
342
  }
302
343
  }
344
+ if (modified) {
345
+ fs.writeFileSync(file, c, 'utf8');
346
+ }
303
347
  }
304
348
  }
305
349