From 0d944b240dd2be8130cb9eb84ba5297416eafc1f Mon Sep 17 00:00:00 2001 From: Muhammed Sanjid Date: Thu, 19 Mar 2026 08:35:28 +0530 Subject: [PATCH 1/7] feat: fix build error 1 --- apps/showcase/app.json | 3 +- apps/showcase/package.json | 9 ++--- package.json | 71 +++++++++++++++++++------------------- 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/apps/showcase/app.json b/apps/showcase/app.json index 3dfe5ad..9a394d8 100644 --- a/apps/showcase/app.json +++ b/apps/showcase/app.json @@ -9,7 +9,8 @@ "userInterfaceStyle": "automatic", "newArchEnabled": true, "ios": { - "supportsTablet": true + "supportsTablet": true, + "bundleIdentifier": "com.pritam2002.showcase" }, "android": { "adaptiveIcon": { diff --git a/apps/showcase/package.json b/apps/showcase/package.json index 9758fc1..3595385 100644 --- a/apps/showcase/package.json +++ b/apps/showcase/package.json @@ -5,8 +5,8 @@ "scripts": { "start": "expo start", "reset-project": "node ./scripts/reset-project.js", - "android": "expo start --android", - "ios": "expo start --ios", + "android": "expo run:android", + "ios": "expo run:ios", "web": "expo start --web", "lint": "expo lint", "build": "tsc" @@ -43,7 +43,8 @@ "react-native-worklets": "0.5.1", "tailwind-merge": "^3.3.1", "tailwindcss": "3.3.2", - "tailwindcss-animate": "^1.0.7" + "tailwindcss-animate": "^1.0.7", + "expo": "~54.0.33" }, "devDependencies": { "@tsconfig/react-native": "^3.0.9", @@ -54,4 +55,4 @@ "typescript": "~5.9.2" }, "private": true -} \ No newline at end of file +} diff --git a/package.json b/package.json index 0182a0e..36123be 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,37 @@ { - "name": "@watermelon/monorepo", - "private": true, - "scripts": { - "dev": "turbo dev", - "dev:docs": "turbo dev --filter=docs", - "dev:showcase": "turbo dev --filter=showcase --concurrency 32", - "dev:showcase:android": "turbo dev:android --filter=showcase --concurrency 32", - "dev:showcase:web": "turbo dev:web --filter=showcase --concurrency 32", - "lint": "turbo lint", - "test": "turbo test", - "build": "turbo build", - "build:showcase": "turbo build --filter=showcase", - "build:docs": "turbo build --filter=docs", - "clean": "turbo clean && rm -rf .turbo node_modules" - }, - "devDependencies": { - "prettier": "^3.6.2", - "prettier-plugin-tailwindcss": "^0.6.14", - "turbo": "^1.12.4", - "typescript": "^5.3.3" - }, - "pnpm": { - "peerDependencyRules": { - "ignoreMissing": [ - "@babel/*", - "expo-modules-*", - "typescript" - ] - } - }, - "engines": { - "node": ">=20.11.0" - }, - "packageManager": "pnpm@9.1.4" -} \ No newline at end of file + "name": "@watermelon/monorepo", + "private": true, + "scripts": { + "dev": "turbo dev", + "dev:docs": "turbo dev --filter=docs", + "dev:showcase": "turbo dev --filter=showcase --concurrency 32", + "dev:showcase:android": "turbo dev:android --filter=showcase --concurrency 32", + "dev:showcase:web": "turbo dev:web --filter=showcase --concurrency 32", + "dev:platform": "turbo dev:web --filter=@watermelon/platform --concurrency 32", + "lint": "turbo lint", + "test": "turbo test", + "build": "turbo build", + "build:showcase": "turbo build --filter=showcase", + "build:docs": "turbo build --filter=docs", + "clean": "turbo clean && rm -rf .turbo node_modules" + }, + "devDependencies": { + "prettier": "^3.6.2", + "prettier-plugin-tailwindcss": "^0.6.14", + "turbo": "^1.12.4", + "typescript": "^5.3.3" + }, + "pnpm": { + "peerDependencyRules": { + "ignoreMissing": [ + "@babel/*", + "expo-modules-*", + "typescript" + ] + } + }, + "engines": { + "node": ">=20.11.0" + }, + "packageManager": "pnpm@9.1.4" +} From 5681bff1c4e6efa96a39929a928464e15a417c65 Mon Sep 17 00:00:00 2001 From: Muhammed Sanjid Date: Thu, 19 Mar 2026 08:37:49 +0530 Subject: [PATCH 2/7] feat: updated build command --- apps/platform/README.md | 12 ++++++++++++ apps/platform/package.json | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/platform/README.md b/apps/platform/README.md index cf50cb2..39cbdde 100644 --- a/apps/platform/README.md +++ b/apps/platform/README.md @@ -33,6 +33,18 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next This app is configured to deploy to Cloudflare Workers via OpenNext. +```bash +npm run build +``` + +Build the Cloudflare Worker bundle with OpenNext. + +```bash +npm run build:next +``` + +Run a plain Next.js production build without generating Cloudflare output. + ```bash npm run preview ``` diff --git a/apps/platform/package.json b/apps/platform/package.json index 62395a0..62a1280 100644 --- a/apps/platform/package.json +++ b/apps/platform/package.json @@ -4,7 +4,8 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build", + "build": "opennextjs-cloudflare build", + "build:next": "next build", "preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview", "deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy", "upload": "opennextjs-cloudflare build && opennextjs-cloudflare upload", From 3650616122b24ad48738bc03e59d2ac38e16931e Mon Sep 17 00:00:00 2001 From: Muhammed Sanjid Date: Thu, 19 Mar 2026 08:50:03 +0530 Subject: [PATCH 3/7] feat: cloudflare update --- apps/platform/README.md | 12 +++++++++--- apps/platform/package.json | 10 +++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/platform/README.md b/apps/platform/README.md index 39cbdde..74a56dc 100644 --- a/apps/platform/README.md +++ b/apps/platform/README.md @@ -37,13 +37,13 @@ This app is configured to deploy to Cloudflare Workers via OpenNext. npm run build ``` -Build the Cloudflare Worker bundle with OpenNext. +Run a plain Next.js production build. ```bash -npm run build:next +npm run build:cloudflare ``` -Run a plain Next.js production build without generating Cloudflare output. +Build the Cloudflare Worker bundle with OpenNext. ```bash npm run preview @@ -57,6 +57,12 @@ npm run deploy Build and deploy to Cloudflare. +In Cloudflare, set the build command to: + +```bash +pnpm run build:cloudflare +``` + ### One-time setup ```bash diff --git a/apps/platform/package.json b/apps/platform/package.json index 62a1280..32bf41e 100644 --- a/apps/platform/package.json +++ b/apps/platform/package.json @@ -4,11 +4,11 @@ "private": true, "scripts": { "dev": "next dev", - "build": "opennextjs-cloudflare build", - "build:next": "next build", - "preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview", - "deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy", - "upload": "opennextjs-cloudflare build && opennextjs-cloudflare upload", + "build": "next build", + "build:cloudflare": "opennextjs-cloudflare build", + "preview": "pnpm run build:cloudflare && opennextjs-cloudflare preview", + "deploy": "pnpm run build:cloudflare && opennextjs-cloudflare deploy", + "upload": "pnpm run build:cloudflare && opennextjs-cloudflare upload", "cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts", "start": "next start", "lint": "eslint" From 8daf0b894988eae935f023eb601f2c0147ff25d0 Mon Sep 17 00:00:00 2001 From: Muhammed Sanjid Date: Thu, 19 Mar 2026 08:58:11 +0530 Subject: [PATCH 4/7] feat: build error fix:2 --- .../animate-ui/components/buttons/copy.tsx | 5 +- .../animate-ui/primitives/buttons/button.tsx | 38 +++++++---- apps/platform/lib/registry-catalog.ts | 68 +++++++------------ apps/platform/lib/registry-data.json | 28 ++++++++ apps/platform/package.json | 1 + apps/platform/scripts/generate-registry.ts | 35 ++++++++++ apps/platform/wrangler.toml | 8 +++ 7 files changed, 122 insertions(+), 61 deletions(-) create mode 100644 apps/platform/lib/registry-data.json create mode 100644 apps/platform/scripts/generate-registry.ts create mode 100644 apps/platform/wrangler.toml diff --git a/apps/platform/components/animate-ui/components/buttons/copy.tsx b/apps/platform/components/animate-ui/components/buttons/copy.tsx index fa1e6c2..f86475c 100644 --- a/apps/platform/components/animate-ui/components/buttons/copy.tsx +++ b/apps/platform/components/animate-ui/components/buttons/copy.tsx @@ -44,12 +44,13 @@ const buttonVariants = cva( }, ); -type CopyButtonProps = Omit & +type CopyButtonProps = Omit & VariantProps & { content: string; copied?: boolean; onCopiedChange?: (copied: boolean, content?: string) => void; delay?: number; + onClick?: (e: React.MouseEvent) => void; }; function CopyButton({ @@ -95,10 +96,10 @@ function CopyButton({ return ( ; -function Button({ - hoverScale = 1.05, - tapScale = 0.95, - asChild = false, - ...props -}: ButtonProps) { - const Component = asChild ? Slot : motion.button; +const Button = React.forwardRef( + ( + { + hoverScale = 1.05, + tapScale = 0.95, + asChild = false, + ...props + }: ButtonProps, + ref, + ) => { + const Component = asChild ? Slot : motion.button; - return ( - - ); -} + return ( + + ); + }, +); + +Button.displayName = 'Button'; export { Button, type ButtonProps }; diff --git a/apps/platform/lib/registry-catalog.ts b/apps/platform/lib/registry-catalog.ts index 722b798..bce7bcc 100644 --- a/apps/platform/lib/registry-catalog.ts +++ b/apps/platform/lib/registry-catalog.ts @@ -1,6 +1,5 @@ -import { readFile } from "node:fs/promises"; -import path from "node:path"; import { COMPONENT_DOC_META } from "@/lib/component-index"; +import registryData from "./registry-data.json"; type RegistryComponentRecord = { name: string; @@ -13,10 +12,6 @@ type RegistryComponentRecord = { registryDependencies?: string[]; }; -type RegistryFile = { - components: Record; -}; - export type ShowcaseComponent = { slug: string; title: string; @@ -42,45 +37,30 @@ function titleCase(value: string) { } export async function getRegistryCatalog(): Promise { - const registryRoot = path.join( - process.cwd(), - "..", - "..", - "packages", - "registry", - ); - const registryPath = path.join(registryRoot, "registry.json"); - const registryRaw = await readFile(registryPath, "utf8"); - const registry = JSON.parse(registryRaw) as RegistryFile; - - const items = await Promise.all( - Object.entries(registry.components).map(async ([slug, component]) => { - const preset = COMPONENT_DOC_META[slug] ?? { - title: titleCase(component.name), - description: "Reusable React Native component from the Watermelon registry.", - category: "Components", - usage: `watermelon add ${slug}`, - preview: "button" as const, - }; - const primaryFile = component.files[0]; - const sourcePath = path.join(registryRoot, "src", primaryFile.path); - const source = await readFile(sourcePath, "utf8"); + const items = registryData.map((component) => { + const slug = component.slug; + const preset = COMPONENT_DOC_META[slug] ?? { + title: titleCase(component.name), + description: "Reusable React Native component from the Watermelon registry.", + category: "Components", + usage: `watermelon add ${slug}`, + preview: "button" as const, + }; - return { - slug, - title: preset.title, - description: preset.description, - category: preset.category, - dependencies: component.dependencies ?? [], - registryDependencies: component.registryDependencies ?? [], - installCommand: `watermelon add ${slug}`, - sourcePath: primaryFile.path, - source, - usage: preset.usage, - preview: preset.preview, - } satisfies ShowcaseComponent; - }), - ); + return { + slug, + title: preset.title, + description: preset.description, + category: preset.category, + dependencies: component.dependencies ?? [], + registryDependencies: component.registryDependencies ?? [], + installCommand: `watermelon add ${slug}`, + sourcePath: component.sourcePath, + source: component.source, + usage: preset.usage, + preview: preset.preview, + } satisfies ShowcaseComponent; + }); const grouped = items.reduce>((acc, item) => { const bucket = acc.get(item.category) ?? []; diff --git a/apps/platform/lib/registry-data.json b/apps/platform/lib/registry-data.json new file mode 100644 index 0000000..2d12be3 --- /dev/null +++ b/apps/platform/lib/registry-data.json @@ -0,0 +1,28 @@ +[ + { + "slug": "button", + "name": "button", + "dependencies": [ + "@rn-primitives/slot", + "class-variance-authority", + "lucide-react-native", + "react-native-svg" + ], + "registryDependencies": [ + "text" + ], + "sourcePath": "components/ui/button.tsx", + "source": "import { TextClassContext } from '@/registry/components/ui/text';\nimport { cn } from '@/registry/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Platform, Pressable } from 'react-native';\nimport * as React from 'react';\n\nconst buttonVariants = cva(\n cn(\n 'group shrink-0 flex-row items-center justify-center gap-2 rounded-md shadow-none',\n Platform.select({\n web: \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n })\n ),\n {\n variants: {\n variant: {\n default: cn(\n 'bg-primary active:bg-primary/90 shadow-sm shadow-black/5',\n Platform.select({ web: 'hover:bg-primary/90' })\n ),\n destructive: cn(\n 'bg-destructive active:bg-destructive/90 dark:bg-destructive/60 shadow-sm shadow-black/5',\n Platform.select({\n web: 'hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',\n })\n ),\n outline: cn(\n 'border-border bg-background active:bg-accent dark:bg-input/30 dark:border-input dark:active:bg-input/50 border shadow-sm shadow-black/5',\n Platform.select({\n web: 'hover:bg-accent dark:hover:bg-input/50',\n })\n ),\n secondary: cn(\n 'bg-secondary active:bg-secondary/80 shadow-sm shadow-black/5',\n Platform.select({ web: 'hover:bg-secondary/80' })\n ),\n ghost: cn(\n 'active:bg-accent dark:active:bg-accent/50',\n Platform.select({ web: 'hover:bg-accent dark:hover:bg-accent/50' })\n ),\n link: '',\n },\n size: {\n default: cn('h-10 px-4 py-2 sm:h-9', Platform.select({ web: 'has-[>svg]:px-3' })),\n sm: cn('h-9 gap-1.5 rounded-md px-3 sm:h-8', Platform.select({ web: 'has-[>svg]:px-2.5' })),\n lg: cn('h-11 rounded-md px-6 sm:h-10', Platform.select({ web: 'has-[>svg]:px-4' })),\n icon: 'h-10 w-10 sm:h-9 sm:w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nconst buttonTextVariants = cva(\n cn(\n 'text-foreground text-sm font-medium',\n Platform.select({ web: 'pointer-events-none transition-colors' })\n ),\n {\n variants: {\n variant: {\n default: 'text-primary-foreground',\n destructive: 'text-white',\n outline: cn(\n 'group-active:text-accent-foreground',\n Platform.select({ web: 'group-hover:text-accent-foreground' })\n ),\n secondary: 'text-secondary-foreground',\n ghost: 'group-active:text-accent-foreground',\n link: cn(\n 'text-primary group-active:underline',\n Platform.select({ web: 'underline-offset-4 hover:underline group-hover:underline' })\n ),\n },\n size: {\n default: '',\n sm: '',\n lg: '',\n icon: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\ntype ButtonProps = React.ComponentProps &\n React.RefAttributes &\n VariantProps;\n\nfunction Button({ className, variant, size, ...props }: ButtonProps) {\n return (\n \n \n \n );\n}\n\nexport { Button, buttonTextVariants, buttonVariants };\nexport type { ButtonProps };\n" + }, + { + "slug": "text", + "name": "text", + "dependencies": [ + "@rn-primitives/slot", + "class-variance-authority" + ], + "registryDependencies": [], + "sourcePath": "components/ui/text.tsx", + "source": "import { cn } from '@/registry/lib/utils';\nimport * as Slot from '@rn-primitives/slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\nimport { Platform, Text as RNText, type Role } from 'react-native';\n\nconst textVariants = cva(\n cn(\n 'text-foreground text-base',\n Platform.select({\n web: 'select-text',\n })\n ),\n {\n variants: {\n variant: {\n default: '',\n h1: cn(\n 'text-center text-4xl font-extrabold tracking-tight',\n Platform.select({ web: 'scroll-m-20 text-balance' })\n ),\n h2: cn(\n 'border-border border-b pb-2 text-3xl font-semibold tracking-tight',\n Platform.select({ web: 'scroll-m-20 first:mt-0' })\n ),\n h3: cn('text-2xl font-semibold tracking-tight', Platform.select({ web: 'scroll-m-20' })),\n h4: cn('text-xl font-semibold tracking-tight', Platform.select({ web: 'scroll-m-20' })),\n p: 'mt-3 leading-7 sm:mt-6',\n blockquote: 'mt-4 border-l-2 pl-3 italic sm:mt-6 sm:pl-6',\n code: cn(\n 'bg-muted relative rounded px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold'\n ),\n lead: 'text-muted-foreground text-xl',\n large: 'text-lg font-semibold',\n small: 'text-sm font-medium leading-none',\n muted: 'text-muted-foreground text-sm',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\ntype TextVariantProps = VariantProps;\n\ntype TextVariant = NonNullable;\n\nconst ROLE: Partial> = {\n h1: 'heading',\n h2: 'heading',\n h3: 'heading',\n h4: 'heading',\n blockquote: Platform.select({ web: 'blockquote' as Role }),\n code: Platform.select({ web: 'code' as Role }),\n};\n\nconst ARIA_LEVEL: Partial> = {\n h1: '1',\n h2: '2',\n h3: '3',\n h4: '4',\n};\n\nconst TextClassContext = React.createContext(undefined);\n\nfunction Text({\n className,\n asChild = false,\n variant = 'default',\n ...props\n}: React.ComponentProps &\n TextVariantProps &\n React.RefAttributes & {\n asChild?: boolean;\n }) {\n const textClass = React.useContext(TextClassContext);\n const Component = asChild ? Slot.Text : RNText;\n return (\n \n );\n}\n\nexport { Text, TextClassContext };\n" + } +] \ No newline at end of file diff --git a/apps/platform/package.json b/apps/platform/package.json index 32bf41e..b89e413 100644 --- a/apps/platform/package.json +++ b/apps/platform/package.json @@ -4,6 +4,7 @@ "private": true, "scripts": { "dev": "next dev", + "prebuild": "bun scripts/generate-registry.ts", "build": "next build", "build:cloudflare": "opennextjs-cloudflare build", "preview": "pnpm run build:cloudflare && opennextjs-cloudflare preview", diff --git a/apps/platform/scripts/generate-registry.ts b/apps/platform/scripts/generate-registry.ts new file mode 100644 index 0000000..2da531d --- /dev/null +++ b/apps/platform/scripts/generate-registry.ts @@ -0,0 +1,35 @@ +import { readFile, writeFile, mkdir } from "node:fs/promises"; +import path from "node:path"; + +async function generateRegistryData() { + const root = process.cwd(); + const registryRoot = path.join(root, "..", "..", "packages", "registry"); + const registryPath = path.join(registryRoot, "registry.json"); + + console.log("Reading registry from:", registryPath); + const registryRaw = await readFile(registryPath, "utf8"); + const registry = JSON.parse(registryRaw); + + const items = await Promise.all( + Object.entries(registry.components).map(async ([slug, component]: [string, any]) => { + const primaryFile = component.files[0]; + const sourcePath = path.join(registryRoot, "src", primaryFile.path); + const source = await readFile(sourcePath, "utf8"); + + return { + slug, + name: component.name, + dependencies: component.dependencies ?? [], + registryDependencies: component.registryDependencies ?? [], + sourcePath: primaryFile.path, + source, + }; + }) + ); + + const outputPath = path.join(root, "lib", "registry-data.json"); + await writeFile(outputPath, JSON.stringify(items, null, 2)); + console.log("Gnerated registry data to:", outputPath); +} + +generateRegistryData().catch(console.error); diff --git a/apps/platform/wrangler.toml b/apps/platform/wrangler.toml new file mode 100644 index 0000000..4493b87 --- /dev/null +++ b/apps/platform/wrangler.toml @@ -0,0 +1,8 @@ +name = "watermelon-platform" +pages_build_output_dir = ".next" + +[vars] +NEXT_TELEMETRY_DISABLED = "1" + +[[package_manager_names]] +package_manager = "pnpm" From f7adc1c1c60508606561f29aacef90f3b89a1ca5 Mon Sep 17 00:00:00 2001 From: Muhammed Sanjid Date: Thu, 19 Mar 2026 09:01:34 +0530 Subject: [PATCH 5/7] feat: mv script --- apps/platform/package.json | 2 +- .../scripts/{generate-registry.ts => generate-registry.mjs} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename apps/platform/scripts/{generate-registry.ts => generate-registry.mjs} (88%) diff --git a/apps/platform/package.json b/apps/platform/package.json index b89e413..307e093 100644 --- a/apps/platform/package.json +++ b/apps/platform/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev", - "prebuild": "bun scripts/generate-registry.ts", + "prebuild": "node scripts/generate-registry.mjs", "build": "next build", "build:cloudflare": "opennextjs-cloudflare build", "preview": "pnpm run build:cloudflare && opennextjs-cloudflare preview", diff --git a/apps/platform/scripts/generate-registry.ts b/apps/platform/scripts/generate-registry.mjs similarity index 88% rename from apps/platform/scripts/generate-registry.ts rename to apps/platform/scripts/generate-registry.mjs index 2da531d..26805bb 100644 --- a/apps/platform/scripts/generate-registry.ts +++ b/apps/platform/scripts/generate-registry.mjs @@ -1,4 +1,4 @@ -import { readFile, writeFile, mkdir } from "node:fs/promises"; +import { readFile, writeFile } from "node:fs/promises"; import path from "node:path"; async function generateRegistryData() { @@ -11,7 +11,7 @@ async function generateRegistryData() { const registry = JSON.parse(registryRaw); const items = await Promise.all( - Object.entries(registry.components).map(async ([slug, component]: [string, any]) => { + Object.entries(registry.components).map(async ([slug, component]) => { const primaryFile = component.files[0]; const sourcePath = path.join(registryRoot, "src", primaryFile.path); const source = await readFile(sourcePath, "utf8"); @@ -29,7 +29,7 @@ async function generateRegistryData() { const outputPath = path.join(root, "lib", "registry-data.json"); await writeFile(outputPath, JSON.stringify(items, null, 2)); - console.log("Gnerated registry data to:", outputPath); + console.log("Generated registry data to:", outputPath); } generateRegistryData().catch(console.error); From 9c6be2e453cf4589a44118ef8203ed5076cb433a Mon Sep 17 00:00:00 2001 From: Muhammed Sanjid Date: Thu, 19 Mar 2026 09:12:45 +0530 Subject: [PATCH 6/7] feat: lint fixes --- .../platform/app/(docs)/installation/page.tsx | 2 +- .../animate-ui/components/buttons/copy.tsx | 1 + .../animate-ui/primitives/animate/slot.tsx | 45 +++++++++++++------ .../animate-ui/primitives/buttons/button.tsx | 1 + .../components/showcase/code-block.tsx | 11 ----- .../components/showcase/component-docs.tsx | 1 - apps/platform/components/ui/iphone.tsx | 6 ++- apps/platform/lib/registry-catalog.ts | 11 ----- 8 files changed, 38 insertions(+), 40 deletions(-) diff --git a/apps/platform/app/(docs)/installation/page.tsx b/apps/platform/app/(docs)/installation/page.tsx index e0ea5fc..5d256e2 100644 --- a/apps/platform/app/(docs)/installation/page.tsx +++ b/apps/platform/app/(docs)/installation/page.tsx @@ -1,4 +1,4 @@ -import { PageHeader, SubTitle, Title } from "@/components/core/typography"; +import { PageHeader } from "@/components/core/typography"; import { CodeBlock } from "@/components/showcase/code-block"; import MotionDiv from "@/components/core/motion-div"; diff --git a/apps/platform/components/animate-ui/components/buttons/copy.tsx b/apps/platform/components/animate-ui/components/buttons/copy.tsx index f86475c..b9728c8 100644 --- a/apps/platform/components/animate-ui/components/buttons/copy.tsx +++ b/apps/platform/components/animate-ui/components/buttons/copy.tsx @@ -96,6 +96,7 @@ function CopyButton({ return ( ( return merged; } +const motionCache = new Map(); + function Slot({ children, ref, ...props }: SlotProps) { - const isAlreadyMotion = - typeof children.type === 'object' && - children.type !== null && - isMotionComponent(children.type); - - const Base = React.useMemo( - () => - isAlreadyMotion - ? (children.type as React.ElementType) - : motion.create(children.type as React.ElementType), - [isAlreadyMotion, children.type], - ); + const isAlreadyMotion = React.useMemo(() => { + if (!React.isValidElement(children)) return false; + return ( + typeof children.type === 'object' && + children.type !== null && + isMotionComponent(children.type) + ); + }, [children]); - if (!React.isValidElement(children)) return null; + const Base = React.useMemo(() => { + if (!React.isValidElement(children)) return null; - const { ref: childRef, ...childProps } = children.props as AnyProps; + if (isAlreadyMotion) return children.type as React.ElementType; + if (typeof children.type === 'string') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (motion as any)[children.type] as React.ElementType; + } + + const type = children.type as React.ElementType; + let Component = motionCache.get(type); + if (!Component) { + Component = motion.create(type); + motionCache.set(type, Component); + } + return Component; + }, [isAlreadyMotion, children]); + + if (!React.isValidElement(children) || !Base) return null; + + const { ref: childRef, ...childProps } = children.props as AnyProps; const mergedProps = mergeProps(childProps, props); return ( + // eslint-disable-next-line react-hooks/static-components , ref)} /> ); } diff --git a/apps/platform/components/animate-ui/primitives/buttons/button.tsx b/apps/platform/components/animate-ui/primitives/buttons/button.tsx index af0f37c..0ae998b 100644 --- a/apps/platform/components/animate-ui/primitives/buttons/button.tsx +++ b/apps/platform/components/animate-ui/primitives/buttons/button.tsx @@ -26,6 +26,7 @@ const Button = React.forwardRef( return ( setCopied(false), 1800); - } catch { - setCopied(false); - } - } - return (
-
)} diff --git a/apps/platform/lib/registry-catalog.ts b/apps/platform/lib/registry-catalog.ts index bce7bcc..ac7dfad 100644 --- a/apps/platform/lib/registry-catalog.ts +++ b/apps/platform/lib/registry-catalog.ts @@ -1,17 +1,6 @@ import { COMPONENT_DOC_META } from "@/lib/component-index"; import registryData from "./registry-data.json"; -type RegistryComponentRecord = { - name: string; - type: string; - files: Array<{ - path: string; - type: string; - }>; - dependencies?: string[]; - registryDependencies?: string[]; -}; - export type ShowcaseComponent = { slug: string; title: string; From 25554e11057d63203e95f8cb188546827604906e Mon Sep 17 00:00:00 2001 From: Muhammed Sanjid Date: Thu, 19 Mar 2026 09:23:04 +0530 Subject: [PATCH 7/7] feat: update wrangler file --- apps/platform/wrangler.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/platform/wrangler.toml b/apps/platform/wrangler.toml index 4493b87..3e9763a 100644 --- a/apps/platform/wrangler.toml +++ b/apps/platform/wrangler.toml @@ -1,8 +1,13 @@ name = "watermelon-platform" -pages_build_output_dir = ".next" +main = ".open-next/worker.js" +compatibility_date = "2024-11-01" [vars] NEXT_TELEMETRY_DISABLED = "1" +[assets] +directory = ".open-next/assets" +binding = "ASSETS" + [[package_manager_names]] package_manager = "pnpm"