From 60ba19559b47258e858d840b087e328323b444d6 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 21 Nov 2025 13:14:06 -0500 Subject: [PATCH 1/3] Update route import in next-env.d.ts and add early return in iframe selection script to prevent execution in top window --- next-env.d.ts | 2 +- .../src/presentation/utils/iframe-selection-script.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/next-env.d.ts b/next-env.d.ts index 9edff1c7..c4b7818f 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/types/routes.d.ts"; +import "./.next/dev/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/packages/theme-studio/src/presentation/utils/iframe-selection-script.js b/packages/theme-studio/src/presentation/utils/iframe-selection-script.js index 03578cfb..083b9f3f 100644 --- a/packages/theme-studio/src/presentation/utils/iframe-selection-script.js +++ b/packages/theme-studio/src/presentation/utils/iframe-selection-script.js @@ -67,6 +67,9 @@ export function iframeSelectionScript(storeDomain) { return `(function() { 'use strict'; + if (window.self === window.top) { + return; + } var NS_KEY = '__FASTTIFY_THEME_STUDIO_NS__'; if (window[NS_KEY]) { return; From e836688a5308b2468cf821f164412746061c7687 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 24 Nov 2025 10:00:13 -0500 Subject: [PATCH 2/3] Remove commented-out code from ThemeStudio component for cleaner implementation --- .../theme-studio/src/presentation/components/ThemeStudio.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/theme-studio/src/presentation/components/ThemeStudio.tsx b/packages/theme-studio/src/presentation/components/ThemeStudio.tsx index b29e12a5..1f386731 100644 --- a/packages/theme-studio/src/presentation/components/ThemeStudio.tsx +++ b/packages/theme-studio/src/presentation/components/ThemeStudio.tsx @@ -1,7 +1,3 @@ -/* - * Theme Studio - Presentación (sin Polaris Frame para evitar scroll) - */ - 'use client'; import { Sidebar } from './sidebar/Sidebar'; From 76e07f8aee96d765f33ab41844d04c602a78acb0 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 24 Nov 2025 10:01:28 -0500 Subject: [PATCH 3/3] Refactor Jest configuration and setup files by removing commented-out code for improved clarity and maintainability --- jest.config.ts | 3 --- jest.setup.ts | 3 --- 2 files changed, 6 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index d8333013..dfdbc49b 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -2,11 +2,9 @@ import type { Config } from 'jest'; import nextJest from 'next/jest.js'; const createJestConfig = nextJest({ - // Provide the path to your Next.js app to load next.config.js and .env files in your test environment dir: './', }); -// Add any custom config to be passed to Jest const config: Config = { coverageProvider: 'v8', testEnvironment: 'jsdom', @@ -49,5 +47,4 @@ const config: Config = { ], }; -// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async export default createJestConfig(config); diff --git a/jest.setup.ts b/jest.setup.ts index 167b65bd..52c5e812 100644 --- a/jest.setup.ts +++ b/jest.setup.ts @@ -1,19 +1,16 @@ import '@testing-library/jest-dom'; -// Configurar variables de entorno para los tests process.env.APP_ENV = 'test'; process.env.DEV_CACHE_ENABLED = 'true'; global.console.warn = jest.fn(); -// Polyfill para structuredClone si no está disponible (Node < 17) if (typeof global.structuredClone === 'undefined') { global.structuredClone = (obj: any) => { return JSON.parse(JSON.stringify(obj)); }; } -// Polyfill para Request y Response (necesario para el SDK de Polar) global.Request = global.Request || class Request {