From 8c68562830c8aa5f0b2a0d3eaf147e3673788271 Mon Sep 17 00:00:00 2001 From: "[dyad]" Date: Wed, 21 Jan 2026 07:53:01 +0100 Subject: [PATCH] [dyad] Added system detection tab - wrote 4 file(s) --- src/app/actions.ts | 59 +++++++++++++++++++ src/components/meta-form.tsx | 30 ++++++++-- src/components/system-display.tsx | 98 +++++++++++++++++++++++++++++++ src/lib/types.ts | 8 ++- 4 files changed, 188 insertions(+), 7 deletions(-) create mode 100644 src/components/system-display.tsx diff --git a/src/app/actions.ts b/src/app/actions.ts index 80f068d..2738f9c 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -28,6 +28,10 @@ export interface LinkData { rel: string; } +export interface DetectedSystem { + name: string; +} + export async function extractMetaData(url: string, keyword?: string) { if (!url) { return { error: "URL is required." }; @@ -225,6 +229,60 @@ export async function extractMetaData(url: string, keyword?: string) { links.push({ href: absoluteUrl, text, type, rel }); }); + const detectedSystems: DetectedSystem[] = []; + const htmlContent = $.html(); + const uniqueSystems = new Set(); + + // WordPress + if ( + $('meta[name="generator"][content*="WordPress"]').length > 0 || + htmlContent.includes("/wp-content/") || + htmlContent.includes("/wp-includes/") + ) { + uniqueSystems.add("WordPress"); + } + + // Shopify + if ( + htmlContent.includes("cdn.shopify.com") || + htmlContent.includes("Shopify.theme") + ) { + uniqueSystems.add("Shopify"); + } + + // Next.js + if ($("#__next").length > 0) { + uniqueSystems.add("Next.js"); + uniqueSystems.add("React"); // Next.js uses React + } + + // React (generic) + if ($("#root").length > 0) { + uniqueSystems.add("React"); + } + + // Webflow + if ( + $('meta[name="generator"][content="Webflow"]').length > 0 || + htmlContent.includes("