mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
## Summary Complete migration to React 19.2.0 across all 5 packages with full test coverage and automated npm publishing. ## Packages Updated - @hanzo/ui - v5.1.1 - @hanzo/auth - Latest - @hanzo/commerce - Latest - @hanzo/brand - Latest - @hanzo/react - v1.0.0 ## Test Results - pkg/ui: 207/207 tests passing (99.5% from 206/207) - pkg/react: 10/10 tests passing (100%) - Total: 217/217 tests passing ✅ ## Key Changes ### Type Declarations - Created hanzo-ui.d.ts for @hanzo/auth and @hanzo/commerce - Workarounds for React 19 type incompatibilities in third-party packages - Proper module exports instead of bare namespace declarations ### Test Infrastructure - Switched from jsdom to happy-dom for React 19 compatibility - Fixed ResizeObserver mock (class constructor vs function) - Created vitest config for pkg/react - Fixed login form test query to avoid multiple button matches ### Dependencies - Added pnpm overrides for [email protected] and [email protected] - Updated vitest, vite, eslint-config-next, @types/node - All peer dependency warnings expected and acceptable ### CI/CD Publishing - Updated publish-on-tag.yml to build and publish all 5 packages - Updated npm-publish.yml to include brand and react packages - Created PUBLISH_GUIDE.md with comprehensive publishing instructions - Tag-based automatic publishing with provenance ### TypeScript Compilation - Added skipLibCheck and strict: false to commerce tsconfig - Fixed namespace type errors (CarouselApi, MediaStackDef, etc.) - Resolved ForwardRefExoticComponent type conflicts ## Publishing Ready for automated npm publishing via git tag: ```bash git tag v5.2.0 git push origin v5.2.0 ``` This will trigger GitHub Actions to: 1. Run all tests (pkg/ui and pkg/react) 2. Build all 5 packages 3. Version all packages to match tag 4. Publish to npm with provenance 5. Create GitHub release 6. Deploy docs to GitHub Pages
16 lines
3.7 KiB
JSON
16 lines
3.7 KiB
JSON
{
|
|
"name": "newsletter-05",
|
|
"registryDependencies": [
|
|
"button",
|
|
"input"
|
|
],
|
|
"files": [
|
|
{
|
|
"name": "newsletter-05.tsx",
|
|
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ArrowRight } from \"lucide-react\"\n\nimport { Button } from \"@/registry/default/ui/button\"\nimport { Input } from \"@/registry/default/ui/input\"\n\nexport default function NewsletterBlock() {\n const [email, setEmail] = React.useState(\"\")\n const [isSubmitting, setIsSubmitting] = React.useState(false)\n const [isSubscribed, setIsSubscribed] = React.useState(false)\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault()\n setIsSubmitting(true)\n await new Promise((resolve) => setTimeout(resolve, 1000))\n setIsSubscribed(true)\n setIsSubmitting(false)\n setEmail(\"\")\n setTimeout(() => setIsSubscribed(false), 3000)\n }\n\n return (\n <section className=\"flex min-h-screen items-center justify-center\">\n <div className=\"w-full bg-primary px-4 py-16 text-primary-foreground sm:px-6 lg:px-8\">\n <div className=\"mx-auto max-w-7xl\">\n <div className=\"grid gap-8 lg:grid-cols-2 lg:gap-12 lg:items-center\">\n {/* Content */}\n <div className=\"space-y-4\">\n <div className=\"inline-block rounded-full bg-primary-foreground/10 px-3 py-1 text-sm font-medium\">\n Newsletter\n </div>\n <h2 className=\"text-4xl font-bold tracking-tight sm:text-5xl lg:text-6xl\">\n Never miss an update\n </h2>\n <p className=\"text-lg text-primary-foreground/90 sm:text-xl\">\n Join thousands of subscribers getting exclusive insights,\n tutorials, and early access to new features.\n </p>\n </div>\n\n {/* Form */}\n <div className=\"lg:pl-8\">\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <div className=\"flex flex-col gap-3 sm:flex-row\">\n <Input\n type=\"email\"\n placeholder=\"[email protected]\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n required\n disabled={isSubmitting}\n className=\"h-12 flex-1 border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground placeholder:text-primary-foreground/60\"\n />\n <Button\n type=\"submit\"\n size=\"lg\"\n disabled={isSubmitting || isSubscribed}\n variant=\"secondary\"\n className=\"sm:min-w-[140px]\"\n >\n {isSubmitting ? (\n \"Subscribing...\"\n ) : isSubscribed ? (\n \"Subscribed! ✓\"\n ) : (\n <>\n Subscribe\n <ArrowRight className=\"ml-2 h-4 w-4\" />\n </>\n )}\n </Button>\n </div>\n {isSubscribed && (\n <p className=\"text-sm text-primary-foreground/90\">\n Welcome aboard! Confirmation email sent.\n </p>\n )}\n <p className=\"text-xs text-primary-foreground/70\">\n We respect your privacy. Unsubscribe at any time.\n </p>\n </form>\n </div>\n </div>\n </div>\n </div>\n </section>\n )\n}\n"
|
|
}
|
|
],
|
|
"type": "components:block",
|
|
"category": "Marketing",
|
|
"subcategory": "Newsletter"
|
|
} |