From 602ca48e481364ddef2b3c09fd1b1223fa8b66b6 Mon Sep 17 00:00:00 2001 From: Houssam Elbadissi Date: Tue, 28 Jan 2025 18:15:40 +0100 Subject: [PATCH 01/12] Browser extension guide improvements (#213) * Rename browser extension guide file * Update README.md --- CHROME_EXTENSION_GUIDE.md => BROWSER_EXTENSION_GUIDE.md | 2 +- README.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) rename CHROME_EXTENSION_GUIDE.md => BROWSER_EXTENSION_GUIDE.md (97%) diff --git a/CHROME_EXTENSION_GUIDE.md b/BROWSER_EXTENSION_GUIDE.md similarity index 97% rename from CHROME_EXTENSION_GUIDE.md rename to BROWSER_EXTENSION_GUIDE.md index e8a2e26a..b1eb3c75 100644 --- a/CHROME_EXTENSION_GUIDE.md +++ b/BROWSER_EXTENSION_GUIDE.md @@ -1,4 +1,4 @@ -# BrowserExtension Installation Guide +# Browser Extension Installation Guide > [!WARNING] > React Scan's Browser extension is still pending approvals from the Chrome Web Store, Firefox Add-ons, and Brave Browser. Below is a guide to installing the extension manually. diff --git a/README.md b/README.md index 3b7f8b91..b51b5f35 100644 --- a/README.md +++ b/README.md @@ -326,9 +326,11 @@ Also, some personal complaints about React Devtools' highlight feature: Soon :) -**Q: Chrome Extension wen?** +**Q: Browser Extension wen?** -Soon :) +The browser extension is available for Chrome, Firefox, and Brave, but it's awaiting approval from browser extension stores. + +In the meanwhile, you can install it manually by following the instructions in [BROWSER_EXTENSION_GUIDE.md](BROWSER_EXTENSION_GUIDE.md). ## Resources & Contributing Back From d69a3b7a30161389d15519569ac15d1a3694ee06 Mon Sep 17 00:00:00 2001 From: Eden <168986653+EdenMrz@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:45:26 +0300 Subject: [PATCH 02/12] fix: README.md typo (#220) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b51b5f35..476a10e1 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ if (typeof window !== 'undefined') { > Looking for [React Native](https://github.com/aidenybai/react-scan/pull/23)? -If you don't have a localv version of the site, you can use the CLI. This will spin up an isolated browser instance which you can interact or use React Scan with. +If you don't have a local version of the site, you can use the CLI. This will spin up an isolated browser instance which you can interact or use React Scan with. ```bash npx react-scan@latest http://localhost:3000 From 78baa6216ac0849bc06278bdfd7ddab581dfd343 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 29 Jan 2025 20:58:42 +0000 Subject: [PATCH 03/12] Update README.md (#218) fix the link to the browser extension guide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 476a10e1..c71ef397 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Add the script tag to your `index.html`: -If you want to install the Chrome extension, follow the guide [here](https://github.com/aidenybai/react-scan/blob/main/CHROME_EXTENSION_GUIDE.md), or React Native support, see [here](https://github.com/aidenybai/react-scan/pull/23). +If you want to install the Chrome extension, follow the guide [here](https://github.com/aidenybai/react-scan/blob/main/BROWSER_EXTENSION_GUIDE.md), or React Native support, see [here](https://github.com/aidenybai/react-scan/pull/23). ## API Reference From 4b48e8279b9b19ded788ebc3a043e1d330cc0e42 Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Thu, 30 Jan 2025 06:05:14 +0200 Subject: [PATCH 04/12] fix: website improvements (#221) --- .../website/components/installl-guide.tsx | 64 ++++++++++++++++--- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/packages/website/components/installl-guide.tsx b/packages/website/components/installl-guide.tsx index cf2e7bc6..e9694108 100644 --- a/packages/website/components/installl-guide.tsx +++ b/packages/website/components/installl-guide.tsx @@ -37,7 +37,8 @@ const CheckIcon = ({ className }: { className: string }) => ( ); -type Tab = 'script' | 'nextjs-app' | 'nextjs-pages' | 'vite'; +const Tabs = ['script', 'nextjs-app', 'nextjs-pages', 'vite', 'remix'] as const; +type Tab = (typeof Tabs)[number]; export default function InstallGuide() { const [copied, setCopied] = useState(false); @@ -52,8 +53,6 @@ export default function InstallGuide() { } }, [activeTab]); - const tabOrder = ['script', 'nextjs-app', 'nextjs-pages', 'vite'] as const; - const handleTabChange = (tab: Tab) => { if (contentRef.current) { setHeight(`${contentRef.current.scrollHeight}px`); @@ -70,7 +69,12 @@ export default function InstallGuide() { const getCodeForTab = (tab: Tab) => { switch (tab) { case 'script': - return `\n`; + return ` + + + + `; + } + + // Development version remains the same + return ` + `; + }; + + return { + name: PLUGIN_NAME, + enforce: 'pre', + + transform: async (code, id) => { + if (!autoDisplayNames || !isJsxFile(id)) { + return null; + } + + try { + const result = await transformAsync(code, { + plugins: [ + [ + '@babel/plugin-transform-react-jsx', + { + runtime: 'automatic', + }, + ], + babelPluginReactDisplayName, + ], + filename: id, + }); + + if (!result?.code) { + log.warn(`No code generated for ${id}`); + return null; + } + + log.debug(`Successfully transformed ${id}`); + return { code: result.code, map: result.map }; + } catch (error) { + log.error(`Failed to transform ${id}:`, error); + return null; + } + }, + + configResolved(resolvedConfig) { + config = resolvedConfig; + isProduction = config.isProduction; + assetsDir = config.build?.assetsDir || 'assets'; + const base = config.base || '/'; + + // Ensure base path is properly formatted + scanFilePath = path.posix.join(base, assetsDir, 'auto.global.js'); + + log.debug('Plugin initialized with config:', { + mode: config.mode, + base, + enable, + isProduction, + assetsDir, + scanOptions, + scanFilePath, + }); + }, + + transformIndexHtml(html) { + if (!enable) { + log.debug('Plugin disabled'); + return html; + } + + try { + const $ = cheerio.load(html); + const scanScript = generateScanScript(scanOptions); + + // Remove any existing React Scan script to avoid duplicates + let removedCount = 0; + $('script').each((_index: number, element: cheerio.Element) => { + const content = $(element).html() || ''; + if (content.includes(REACT_SCAN_IDENTIFIER)) { + $(element).remove(); + removedCount++; + } + }); + + if (removedCount > 0) { + log.debug(`Removed ${removedCount} existing scan script(s)`); + } + + if (isProduction) { + // In production, insert at the beginning of head + $('head').prepend(scanScript); + log.debug( + 'Injected scan script at the beginning of head (production)', + ); + } else { + // In development, insert after Vite's client script + const viteClientScript = $('script[src="/@vite/client"]'); + if (viteClientScript.length) { + viteClientScript.after(scanScript); + log.debug('Injected scan script after Vite client (development)'); + } else { + $('head').append(scanScript); + log.debug('Injected scan script at end of head (development)'); + } + } + + return $.html(); + } catch (error) { + log.error('Failed to transform HTML:', error); + return html; + } + }, + + resolveId(id) { + if (!isProduction && id === `/@id/${REACT_SCAN_IDENTIFIER}`) { + log.debug('Resolving react-scan module'); + return REACT_SCAN_IDENTIFIER; + } + return null; + }, + + async generateBundle() { + if (isProduction && enable) { + log.debug('Production build started, processing react-scan'); + + try { + const nodeModulesPath = path.resolve('node_modules'); + const reactScanPath = path.join( + nodeModulesPath, + REACT_SCAN_IDENTIFIER, + 'dist', + 'auto.global.js', + ); + const content = await fs.promises.readFile(reactScanPath, 'utf-8'); + + // Let Vite handle the file placement in configured assets directory + const assetFileName = `${assetsDir}/auto.global.js`; + + // Emit the file to the build output + this.emitFile({ + type: 'asset', + fileName: assetFileName, + source: content, + }); + + // Store the full path for use in the script tag + scanFilePath = `/${assetFileName}`; + log.debug('Emitted react-scan as asset:', assetFileName); + } catch (error) { + log.error('Failed to process react-scan:', error); + } + } + }, + + buildEnd() { + if (isProduction) { + log.debug('Build completed'); + } + }, + }; +}; + +export default reactScanPlugin; diff --git a/packages/vite-plugin-react-scan/tsconfig.json b/packages/vite-plugin-react-scan/tsconfig.json new file mode 100644 index 00000000..3de9590a --- /dev/null +++ b/packages/vite-plugin-react-scan/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "ES6", + "lib": [ + "es2016" + ], + "moduleResolution": "node", + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true, + "declaration": true, + "isolatedModules": true, + "resolveJsonModule": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src" + ], + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 51ae63d9..bf791ac7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,14 +65,14 @@ importers: version: 0.7.5 vite-plugin-inspect: specifier: ^0.8.7 - version: 0.8.7(rollup@4.28.0)(vite@5.4.3(@types/node@22.10.2)(terser@5.36.0)) + version: 0.8.7(rollup@4.28.0)(vite@5.4.3(@types/node@22.13.1)(terser@5.36.0)) devDependencies: '@vitejs/plugin-react': specifier: ^4.3.4 - version: 4.3.4(vite@5.4.3(@types/node@22.10.2)(terser@5.36.0)) + version: 4.3.4(vite@5.4.3(@types/node@22.13.1)(terser@5.36.0)) vite: specifier: ^5.4.3 - version: 5.4.3(@types/node@22.10.2)(terser@5.36.0) + version: 5.4.3(@types/node@22.13.1)(terser@5.36.0) packages/extension: dependencies: @@ -106,7 +106,7 @@ importers: version: 0.10.0 '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.3.4(vite@6.0.7(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1)) + version: 4.3.4(vite@6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1)) bestzip: specifier: ^2.2.1 version: 2.2.1 @@ -118,13 +118,13 @@ importers: version: 7.0.3 vite: specifier: ^6.0.7 - version: 6.0.7(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1) + version: 6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1) vite-plugin-web-extension: specifier: ^4.4.3 - version: 4.4.3(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0) + version: 4.4.3(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0) vite-tsconfig-paths: specifier: ^5.1.4 - version: 5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1)) + version: 5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1)) webextension-polyfill: specifier: ^0.10.0 version: 0.10.0 @@ -152,13 +152,13 @@ importers: devDependencies: '@vitejs/plugin-react': specifier: ^4.3.1 - version: 4.3.1(vite@5.4.3(@types/node@22.10.2)(terser@5.36.0)) + version: 4.3.1(vite@5.4.3(@types/node@22.13.1)(terser@5.36.0)) vite: specifier: ^5.4.3 - version: 5.4.3(@types/node@22.10.2)(terser@5.36.0) + version: 5.4.3(@types/node@22.13.1)(terser@5.36.0) vite-plugin-inspect: specifier: ^0.8.7 - version: 0.8.7(rollup@4.28.0)(vite@5.4.3(@types/node@22.10.2)(terser@5.36.0)) + version: 0.8.7(rollup@4.28.0)(vite@5.4.3(@types/node@22.13.1)(terser@5.36.0)) packages/scan: dependencies: @@ -282,6 +282,43 @@ importers: specifier: ^1.0.0 version: 1.0.0(@types/node@20.17.10)(terser@5.36.0) + packages/vite-plugin-react-scan: + dependencies: + react-scan: + specifier: ^0.1.0 + version: 0.1.3(@remix-run/react@2.15.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.3))(next@15.0.3(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react-router-dom@6.28.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-router@6.28.0(react@19.0.0))(react@19.0.0)(rollup@4.28.0) + devDependencies: + '@babel/core': + specifier: ^7.26.0 + version: 7.26.0 + '@babel/plugin-transform-react-jsx': + specifier: ^7.25.9 + version: 7.25.9(@babel/core@7.26.0) + '@biomejs/biome': + specifier: ^1.9.4 + version: 1.9.4 + '@types/babel__core': + specifier: ^7.20.5 + version: 7.20.5 + '@types/cheerio': + specifier: ^0.22.35 + version: 0.22.35 + '@types/node': + specifier: ^22.10.7 + version: 22.13.1 + babel-plugin-add-react-displayname: + specifier: ^0.0.5 + version: 0.0.5 + cheerio: + specifier: ^1.0.0 + version: 1.0.0 + typescript: + specifier: latest + version: 5.7.3 + vite: + specifier: ^6.0.7 + version: 6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1) + packages/website: dependencies: '@vercel/analytics': @@ -358,6 +395,10 @@ packages: resolution: {integrity: sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==} engines: {node: '>=6.9.0'} + '@babel/helper-annotate-as-pure@7.25.9': + resolution: {integrity: sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==} + engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@7.25.9': resolution: {integrity: sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==} engines: {node: '>=6.9.0'} @@ -397,6 +438,12 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/plugin-syntax-jsx@7.25.9': + resolution: {integrity: sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-react-jsx-self@7.25.9': resolution: {integrity: sha512-y8quW6p0WHkEhmErnfe58r7x0A70uKphQm8Sp8cV7tjNQwK56sNVK0M73LK3WuYmsuyrftut4xAkjjgU0twaMg==} engines: {node: '>=6.9.0'} @@ -409,6 +456,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-react-jsx@7.25.9': + resolution: {integrity: sha512-s5XwpQYCqGerXl+Pu6VDL3x0j2d82eiV77UJ8a2mDHAW7j9SWRqQ2y1fNo1Z74CdcYipl5Z41zvjj4Nfzq36rw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/runtime@7.24.7': resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} engines: {node: '>=6.9.0'} @@ -1657,6 +1710,9 @@ packages: '@types/babel__traverse@7.20.6': resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} + '@types/cheerio@0.22.35': + resolution: {integrity: sha512-yD57BchKRvTV+JD53UZ6PD8KWY5g5rvvMLRnZR3EQBCZXiDT/HR+pKpMzFGlWNhFrXlo7VPZXtKvIEwZkAWOIA==} + '@types/chrome@0.0.281': resolution: {integrity: sha512-MH+8FFrJ1POZwKnKRBa+jZcVp+yCFxes6PYKvgFd0qLTzoQe+TdejC3dkA8gSs8UGjFKrKzu4AkZypmswv0NOg==} @@ -1696,6 +1752,9 @@ packages: '@types/node@22.10.2': resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} + '@types/node@22.13.1': + resolution: {integrity: sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==} + '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -2119,6 +2178,9 @@ packages: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} + babel-plugin-add-react-displayname@0.0.5: + resolution: {integrity: sha512-LY3+Y0XVDYcShHHorshrDbt4KFWL4bSeniCtl4SYZbask+Syngk1uMPCeN9+nSiZo6zX5s0RTq/J9Pnaaf/KHw==} + babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110: resolution: {integrity: sha512-WdxXtLxsV4gh/GlEK4fuFDGkcED0Wb9UJEBB6Uc1SFqRFEmJNFKboW+Z4NUS5gYrPImqrjh4IwHAmgS6ZBg4Cg==} @@ -2267,6 +2329,13 @@ packages: check-error@1.0.3: resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + cheerio-select@2.1.0: + resolution: {integrity: sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==} + + cheerio@1.0.0: + resolution: {integrity: sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==} + engines: {node: '>=18.17'} + chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} @@ -2582,6 +2651,9 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + encoding-sniffer@0.2.0: + resolution: {integrity: sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==} + end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} @@ -3188,6 +3260,9 @@ packages: htmlparser2@8.0.2: resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==} + htmlparser2@9.1.0: + resolution: {integrity: sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==} + http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} @@ -3203,6 +3278,10 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} + iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} @@ -3969,6 +4048,15 @@ packages: resolution: {integrity: sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw==} engines: {node: '>=16'} + parse5-htmlparser2-tree-adapter@7.1.0: + resolution: {integrity: sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==} + + parse5-parser-stream@7.1.2: + resolution: {integrity: sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==} + + parse5@7.2.1: + resolution: {integrity: sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==} + path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -4297,6 +4385,26 @@ packages: react-router-dom: optional: true + react-scan@0.1.3: + resolution: {integrity: sha512-mPhceIDUm6KugQPOF6PcQWBxo49/ZX7TnP5+/f/wbz7/36sM1A3ESAIAOXe+Leha30AJPriG1U4nABnEF4N8vQ==} + hasBin: true + peerDependencies: + '@remix-run/react': '>=1.0.0' + next: '>=13.0.0' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-router: ^5.0.0 || ^6.0.0 || ^7.0.0 + react-router-dom: ^5.0.0 || ^6.0.0 || ^7.0.0 + peerDependenciesMeta: + '@remix-run/react': + optional: true + next: + optional: true + react-router: + optional: true + react-router-dom: + optional: true + react@18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} engines: {node: '>=0.10.0'} @@ -4453,6 +4561,9 @@ packages: resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} engines: {node: '>= 0.4'} + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + sax@1.4.1: resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} @@ -4955,6 +5066,10 @@ packages: undici-types@6.20.0: resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + undici@6.21.1: + resolution: {integrity: sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==} + engines: {node: '>=18.17'} + unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} @@ -5144,6 +5259,14 @@ packages: webpack-virtual-modules@0.6.2: resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} + whatwg-encoding@3.1.1: + resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==} + engines: {node: '>=18'} + + whatwg-mimetype@4.0.0: + resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} + engines: {node: '>=18'} + whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} @@ -5341,6 +5464,10 @@ snapshots: '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.0.2 + '@babel/helper-annotate-as-pure@7.25.9': + dependencies: + '@babel/types': 7.26.0 + '@babel/helper-compilation-targets@7.25.9': dependencies: '@babel/compat-data': 7.26.2 @@ -5382,6 +5509,11 @@ snapshots: dependencies: '@babel/types': 7.26.0 + '@babel/plugin-syntax-jsx@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-transform-react-jsx-self@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -5392,6 +5524,17 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-transform-react-jsx@7.25.9(@babel/core@7.26.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.0) + '@babel/types': 7.26.0 + transitivePeerDependencies: + - supports-color + '@babel/runtime@7.24.7': dependencies: regenerator-runtime: 0.14.1 @@ -6057,6 +6200,11 @@ snapshots: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + '@pivanov/utils@0.0.1(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + react: 19.0.0 + react-dom: 19.0.0(react@19.0.0) + '@pkgjs/parseargs@0.11.0': optional: true @@ -6251,6 +6399,10 @@ snapshots: dependencies: '@babel/types': 7.26.0 + '@types/cheerio@0.22.35': + dependencies: + '@types/node': 22.13.1 + '@types/chrome@0.0.281': dependencies: '@types/filesystem': 0.0.36 @@ -6286,6 +6438,10 @@ snapshots: dependencies: undici-types: 6.20.0 + '@types/node@22.13.1': + dependencies: + undici-types: 6.20.0 + '@types/normalize-package-data@2.4.4': {} '@types/prop-types@15.7.13': {} @@ -6614,36 +6770,36 @@ snapshots: - supports-color - vitest - '@vitejs/plugin-react@4.3.1(vite@5.4.3(@types/node@22.10.2)(terser@5.36.0))': + '@vitejs/plugin-react@4.3.1(vite@5.4.3(@types/node@22.13.1)(terser@5.36.0))': dependencies: '@babel/core': 7.26.0 '@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.26.0) '@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.26.0) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.3(@types/node@22.10.2)(terser@5.36.0) + vite: 5.4.3(@types/node@22.13.1)(terser@5.36.0) transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@4.3.4(vite@5.4.3(@types/node@22.10.2)(terser@5.36.0))': + '@vitejs/plugin-react@4.3.4(vite@5.4.3(@types/node@22.13.1)(terser@5.36.0))': dependencies: '@babel/core': 7.26.0 '@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.26.0) '@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.26.0) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.3(@types/node@22.10.2)(terser@5.36.0) + vite: 5.4.3(@types/node@22.13.1)(terser@5.36.0) transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@4.3.4(vite@6.0.7(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1))': + '@vitejs/plugin-react@4.3.4(vite@6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1))': dependencies: '@babel/core': 7.26.0 '@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.26.0) '@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.26.0) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 6.0.7(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1) transitivePeerDependencies: - supports-color @@ -6871,6 +7027,8 @@ snapshots: axobject-query@4.1.0: {} + babel-plugin-add-react-displayname@0.0.5: {} + babel-plugin-react-compiler@19.0.0-beta-a7bf2bd-20241110: dependencies: '@babel/types': 7.26.0 @@ -7039,6 +7197,29 @@ snapshots: dependencies: get-func-name: 2.0.2 + cheerio-select@2.1.0: + dependencies: + boolbase: 1.0.0 + css-select: 5.1.0 + css-what: 6.1.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.1.0 + + cheerio@1.0.0: + dependencies: + cheerio-select: 2.1.0 + dom-serializer: 2.0.0 + domhandler: 5.0.3 + domutils: 3.1.0 + encoding-sniffer: 0.2.0 + htmlparser2: 9.1.0 + parse5: 7.2.1 + parse5-htmlparser2-tree-adapter: 7.1.0 + parse5-parser-stream: 7.1.2 + undici: 6.21.1 + whatwg-mimetype: 4.0.0 + chokidar@3.6.0: dependencies: anymatch: 3.1.3 @@ -7053,7 +7234,7 @@ snapshots: chrome-launcher@1.1.0: dependencies: - '@types/node': 22.10.2 + '@types/node': 22.13.1 escape-string-regexp: 4.0.0 is-wsl: 2.2.0 lighthouse-logger: 2.0.1 @@ -7343,6 +7524,11 @@ snapshots: emoji-regex@9.2.2: {} + encoding-sniffer@0.2.0: + dependencies: + iconv-lite: 0.6.3 + whatwg-encoding: 3.1.1 + end-of-stream@1.4.4: dependencies: once: 1.4.0 @@ -8309,6 +8495,13 @@ snapshots: domutils: 3.1.0 entities: 4.5.0 + htmlparser2@9.1.0: + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.1.0 + entities: 4.5.0 + http-cache-semantics@4.1.1: {} http2-wrapper@2.2.1: @@ -8320,6 +8513,10 @@ snapshots: human-signals@5.0.0: {} + iconv-lite@0.6.3: + dependencies: + safer-buffer: 2.1.2 + ieee754@1.2.1: {} ignore-walk@5.0.1: @@ -9117,6 +9314,19 @@ snapshots: lines-and-columns: 2.0.4 type-fest: 3.13.1 + parse5-htmlparser2-tree-adapter@7.1.0: + dependencies: + domhandler: 5.0.3 + parse5: 7.2.1 + + parse5-parser-stream@7.1.2: + dependencies: + parse5: 7.2.1 + + parse5@7.2.1: + dependencies: + entities: 4.5.0 + path-exists@4.0.0: {} path-is-absolute@1.0.1: {} @@ -9460,6 +9670,37 @@ snapshots: - rollup - supports-color + react-scan@0.1.3(@remix-run/react@2.15.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.3))(next@15.0.3(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react-router-dom@6.28.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-router@6.28.0(react@19.0.0))(react@19.0.0)(rollup@4.28.0): + dependencies: + '@babel/core': 7.26.0 + '@babel/generator': 7.26.2 + '@babel/types': 7.26.0 + '@clack/core': 0.3.5 + '@clack/prompts': 0.8.2 + '@pivanov/utils': 0.0.1(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@preact/signals': 1.3.1(preact@10.25.1) + '@rollup/pluginutils': 5.1.3(rollup@4.28.0) + '@types/node': 20.17.10 + bippy: 0.2.7 + esbuild: 0.24.2 + estree-walker: 3.0.3 + kleur: 4.1.5 + mri: 1.2.0 + playwright: 1.49.0 + preact: 10.25.1 + react: 19.0.0 + react-dom: 19.0.0(react@19.0.0) + tsx: 4.0.0 + optionalDependencies: + '@remix-run/react': 2.15.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.3) + next: 15.0.3(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + react-router: 6.28.0(react@19.0.0) + react-router-dom: 6.28.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + unplugin: 2.1.0 + transitivePeerDependencies: + - rollup + - supports-color + react@18.2.0: dependencies: loose-envify: 1.4.0 @@ -9648,6 +9889,8 @@ snapshots: es-errors: 1.3.0 is-regex: 1.2.0 + safer-buffer@2.1.2: {} + sax@1.4.1: {} scheduler@0.23.2: @@ -10216,6 +10459,8 @@ snapshots: undici-types@6.20.0: {} + undici@6.21.1: {} + unicorn-magic@0.1.0: {} unique-string@3.0.0: @@ -10307,7 +10552,7 @@ snapshots: - terser optional: true - vite-plugin-inspect@0.8.7(rollup@4.28.0)(vite@5.4.3(@types/node@22.10.2)(terser@5.36.0)): + vite-plugin-inspect@0.8.7(rollup@4.28.0)(vite@5.4.3(@types/node@22.13.1)(terser@5.36.0)): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.1.3(rollup@4.28.0) @@ -10318,12 +10563,12 @@ snapshots: perfect-debounce: 1.0.0 picocolors: 1.1.1 sirv: 2.0.4 - vite: 5.4.3(@types/node@22.10.2)(terser@5.36.0) + vite: 5.4.3(@types/node@22.13.1)(terser@5.36.0) transitivePeerDependencies: - rollup - supports-color - vite-plugin-web-extension@4.4.3(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0): + vite-plugin-web-extension@4.4.3(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0): dependencies: ajv: 8.17.1 async-lock: 1.4.1 @@ -10333,7 +10578,7 @@ snapshots: lodash.uniq: 4.5.0 lodash.uniqby: 4.7.0 md5: 2.3.0 - vite: 6.0.7(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1) + vite: 6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1) web-ext-option-types: 8.3.1 web-ext-run: 0.2.2 webextension-polyfill: 0.10.0 @@ -10364,6 +10609,17 @@ snapshots: - supports-color - typescript + vite-tsconfig-paths@5.1.4(typescript@5.7.3)(vite@6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1)): + dependencies: + debug: 4.3.7 + globrex: 0.1.2 + tsconfck: 3.1.4(typescript@5.7.3) + optionalDependencies: + vite: 6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1) + transitivePeerDependencies: + - supports-color + - typescript + vite@5.4.3(@types/node@20.17.10)(terser@5.36.0): dependencies: esbuild: 0.21.5 @@ -10383,6 +10639,17 @@ snapshots: '@types/node': 22.10.2 fsevents: 2.3.3 terser: 5.36.0 + optional: true + + vite@5.4.3(@types/node@22.13.1)(terser@5.36.0): + dependencies: + esbuild: 0.21.5 + postcss: 8.4.49 + rollup: 4.28.0 + optionalDependencies: + '@types/node': 22.13.1 + fsevents: 2.3.3 + terser: 5.36.0 vite@6.0.7(@types/node@22.10.2)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1): dependencies: @@ -10395,6 +10662,19 @@ snapshots: jiti: 1.21.6 terser: 5.36.0 yaml: 2.6.1 + optional: true + + vite@6.0.7(@types/node@22.13.1)(jiti@1.21.6)(terser@5.36.0)(yaml@2.6.1): + dependencies: + esbuild: 0.24.2 + postcss: 8.4.49 + rollup: 4.28.0 + optionalDependencies: + '@types/node': 22.13.1 + fsevents: 2.3.3 + jiti: 1.21.6 + terser: 5.36.0 + yaml: 2.6.1 vitest@1.0.0(@types/node@20.17.10)(terser@5.36.0): dependencies: @@ -10512,6 +10792,12 @@ snapshots: webpack-virtual-modules@0.6.2: optional: true + whatwg-encoding@3.1.1: + dependencies: + iconv-lite: 0.6.3 + + whatwg-mimetype@4.0.0: {} + whatwg-url@7.1.0: dependencies: lodash.sortby: 4.7.0 diff --git a/scripts/version-warning.mjs b/scripts/version-warning.mjs index 3a396800..6e824660 100755 --- a/scripts/version-warning.mjs +++ b/scripts/version-warning.mjs @@ -6,6 +6,8 @@ import chalk from 'chalk'; const __dirname = dirname(fileURLToPath(import.meta.url)); +const pEnd = 38; + // Styling constants const styles = { title: '#7B65D0', @@ -90,10 +92,10 @@ const message = pkgInfo.versions .map(([pkg, version], index, array) => { const prevPkg = index > 0 ? array[index - 1][0] : ''; const needsSpace = prevPkg.startsWith('@') && pkg === 'react-scan'; - return `${needsSpace ? '\n' : ''}${styles.dim(pkg.padEnd(32))}${styles.version(`v${version}`)}`; + return `${needsSpace ? '\n' : ''}${styles.dim(pkg.padEnd(pEnd))}${styles.version(`v${version}`)}`; }) .join('\n')}` - : `${styles.text(MESSAGES.package.text)}\n\n${styles.dim(pkgInfo.name.padEnd(32))}${styles.version(`v${pkgInfo.version}`)}`; + : `${styles.text(MESSAGES.package.text)}\n\n${styles.dim(pkgInfo.name.padEnd(pEnd))}${styles.version(`v${pkgInfo.version}`)}`; // biome-ignore lint/suspicious/noConsole: Intended debug output console.log(