@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.
- package/bin/index.js +82 -12
- package/package.json +2 -2
- package/src/arc/__tests__/arc.test.cjs +1251 -0
- package/src/arc/adapters/accordion.cjs +32 -0
- package/src/arc/adapters/dialog.cjs +26 -0
- package/src/arc/adapters/embla.cjs +29 -0
- package/src/arc/adapters/gallery.cjs +23 -0
- package/src/arc/adapters/picture-source.cjs +71 -0
- package/src/arc/adapters/registry.cjs +156 -0
- package/src/arc/adapters/slick.cjs +26 -0
- package/src/arc/adapters/swiper.cjs +29 -0
- package/src/arc/adapters/tabs.cjs +29 -0
- package/src/arc/adapters/ui-frameworks.cjs +140 -0
- package/src/arc/adapters.cjs +20 -151
- package/src/arc/canonical-paths.cjs +95 -0
- package/src/arc/data-flow.cjs +158 -0
- package/src/arc/diff.cjs +136 -0
- package/src/arc/explain.cjs +113 -0
- package/src/arc/field-paths.cjs +25 -13
- package/src/arc/fs-utils.cjs +3 -0
- package/src/arc/index.cjs +126 -7
- package/src/arc/ir-builder.cjs +581 -0
- package/src/arc/manifest.cjs +18 -0
- package/src/arc/planner.cjs +106 -2
- package/src/arc/printer.cjs +18 -5
- package/src/arc/residual.cjs +9 -3
- package/src/arc/rsc-boundary.cjs +154 -0
- package/src/arc/runtime-validator.cjs +286 -0
- package/src/arc/semantic.cjs +217 -16
- package/src/arc/text-fragment-analyzer.cjs +173 -0
- package/src/arc/transformer.cjs +819 -20
- package/src/arc/version.cjs +1 -1
- package/src/tools/deneb-doctor.cjs +53 -9
package/src/arc/version.cjs
CHANGED
|
@@ -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,
|
|
19
|
-
const
|
|
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
|
-
|
|
25
|
-
const
|
|
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
|
-
|
|
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
|
|