@deneb-ui/cli 2.0.24 → 2.0.25

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": "@deneb-ui/cli",
3
- "version": "2.0.24",
3
+ "version": "2.0.25",
4
4
  "description": "Official DENEB CLI — scaffold, convert, validate, and package Fivora-ready storefront templates.",
5
5
  "bin": {
6
6
  "deneb": "bin/index.js",
@@ -48,7 +48,7 @@
48
48
  "license": "MIT",
49
49
  "dependencies": {
50
50
  "@babel/parser": "^7.28.0",
51
- "@deneb-ui/core": "^2.0.24",
51
+ "@deneb-ui/core": "^2.0.25",
52
52
  "adm-zip": "^0.6.0",
53
53
  "recast": "^0.23.11"
54
54
  },
@@ -580,11 +580,36 @@ function inferPageKey(relativeFile) {
580
580
  return 'home';
581
581
  }
582
582
 
583
+ function ensureHtmlBodyHydration(ast) {
584
+ recast.types.visit(ast, {
585
+ visitJSXOpeningElement(pathNode) {
586
+ const name = pathNode.node.name;
587
+ const tag = name && name.type === 'JSXIdentifier' ? name.name : '';
588
+ if (tag === 'html' || tag === 'body') {
589
+ const has = (pathNode.node.attributes || []).some(
590
+ (attr) => attr.type === 'JSXAttribute' && attr.name && attr.name.name === 'suppressHydrationWarning',
591
+ );
592
+ if (!has) {
593
+ pathNode.node.attributes.push(b.jsxAttribute(b.jsxIdentifier('suppressHydrationWarning')));
594
+ }
595
+ }
596
+ this.traverse(pathNode);
597
+ },
598
+ });
599
+ }
600
+
583
601
  function instrumentLayoutSource(code, siteDataImport) {
584
602
  if (/SiteDataProvider|DenebDataProvider/.test(code)) {
585
- return { code, updated: false };
603
+ if (/suppressHydrationWarning/.test(code)) {
604
+ return { code, updated: false };
605
+ }
606
+ const ast = parseSource(code, 'layout.tsx');
607
+ ensureHtmlBodyHydration(ast);
608
+ return { code: printSource(ast, code), updated: true };
586
609
  }
610
+
587
611
  const ast = parseSource(code, 'layout.tsx');
612
+ ensureHtmlBodyHydration(ast);
588
613
  ensureImport(ast, '@deneb-ui/ui', ['SiteDataProvider']);
589
614
  ensureDefaultImport(ast, siteDataImport, 'initialSiteData');
590
615