Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 0 additions & 98 deletions .github/workflows/test-registry-installations.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# dependencies
/node_modules
**/node_modules
/.pnp
.pnp.*
.yarn/*
Expand Down Expand Up @@ -40,3 +41,7 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
.aider*
/test-shadcn-install
/tmp-test-*
/test-minimal-*
/test-registry-*
46 changes: 42 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ The repository uses Husky to run `pnpm lint` and `pnpm registry:build` before ea

**Key Technologies:**
- Next.js 15 with React 19
- Farcaster Frame SDK (@farcaster/frame-sdk, @farcaster/frame-core)
- Farcaster MiniApp SDK (@farcaster/miniapp-sdk, @farcaster/miniapp-core)
- Daimo Pay integration (@daimo/pay, @daimo/contract)
- Wagmi for Ethereum interaction
- Tailwind CSS for styling
Expand All @@ -199,8 +199,9 @@ Components can depend on other registry items via `registryDependencies` field i
When adding new components:
1. Create component files in `registry/mini-app/blocks/<name>/`
2. Add registry entry to `registry.json` with proper metadata
3. The pre-commit hook will automatically run `registry:build` to generate public files
4. Deploy triggers automatic Vercel deployment
3. Add the component to `lib/components-config.tsx` so it appears on the homepage for users to test (components only, not hooks or utils)
4. The pre-commit hook will automatically run `registry:build` to generate public files
5. Deploy triggers automatic Vercel deployment

## Important Notes

Expand Down Expand Up @@ -304,4 +305,41 @@ The shadcn CLI sometimes adds extra quotes around string literals during install
if (typeof x === "object") {}
```

3. **Test registry output** - After running `pnpm registry:build`, check the generated JSON files in `public/r/` to ensure no transformation issues
3. **Test registry output** - After running `pnpm registry:build`, check the generated JSON files in `public/r/` to ensure no transformation issues

### Critical: TypeScript typeof Comparisons

The shadcn CLI has a bug where it adds extra quotes around string literals in typeof comparisons, breaking TypeScript builds:

```typescript
// BEFORE installation (in registry):
if (typeof width === "string") { }

// AFTER installation (broken - extra quotes):
if (typeof width === "'string'") { }
```

**Solution: Always use double quotes for typeof comparisons and test after installation:**

```typescript
// ✅ REQUIRED: Use double quotes consistently
if (typeof value === "string") { }
if (typeof value === "number") { }
if (typeof value === "bigint") { }
if (typeof value === "object") { }
if (typeof value === "boolean") { }
if (typeof value === "undefined") { }
if (typeof value === "function") { }
if (typeof value === "symbol") { }

// ❌ NEVER: Don't use single quotes
if (typeof value === 'string') { } // Will break during installation
```

**Common locations where this occurs:**
- Width/height checks: `typeof width === "string"`
- Data validation: `typeof data !== "object"`
- Number checks: `typeof value === "number"`
- BigInt validation: `typeof id !== "bigint"`

**Always run `pnpm registry:build` and test installation before committing!**
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,54 @@ Website: [https://hellno-mini-app-ui.vercel.app](https://hellno-mini-app-ui.verc

Website: [https://hellno-mini-app-ui.vercel.app](https://hellno-mini-app-ui.vercel.app)

### Install a component
### Quick Start (Recommended)

Example to install simple token transfer button:
Install the most popular components:

```bash
# NFT display and minting
pnpm dlx shadcn@latest add https://hellno-mini-app-ui.vercel.app/r/nft-card.json
pnpm dlx shadcn@latest add https://hellno-mini-app-ui.vercel.app/r/nft-mint-flow.json

# User search (Farcaster, ENS, addresses)
pnpm dlx shadcn@latest add https://hellno-mini-app-ui.vercel.app/r/onchain-user-search.json

# Payment button
pnpm dlx shadcn@latest add https://hellno-mini-app-ui.vercel.app/r/daimo-pay-transfer-button.json
```

### Install individual components

```bash
pnpm dlx shadcn@latest add https://hellno-mini-app-ui.vercel.app/r/[component-name].json
```

### Install all components

Install all components with a single command:

```bash
pnpm dlx shadcn@latest add https://hellno-mini-app-ui.vercel.app/r/all-components.json
# Default: Skip existing files
curl -sSL https://hellno-mini-app-ui.vercel.app/r/install-all.sh | bash

# Force overwrite existing files
curl -sSL https://hellno-mini-app-ui.vercel.app/r/install-all-overwrite.sh | bash
```

This will install all available components and their dependencies at once.
### Local Development

When developing the registry locally:

```bash
# Start the registry locally first (in mini-app-ui repo)
pnpm dev

# Install individual components from localhost
pnpm dlx shadcn@latest add http://localhost:3000/r/nft-card.json --yes

# Note: install-all.sh may reference production URLs in dependencies
# For local development, install components individually
```


## Component Development Guide
Expand Down
63 changes: 63 additions & 0 deletions app/component/onchain-user-search/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"use client";

import { OnchainUserSearch } from "@/registry/mini-app/blocks/onchain-user-search/onchain-user-search";

export default function OnchainUserSearchDemo() {
const neynarApiKey = process.env.NEXT_PUBLIC_NEYNAR_API_KEY || "";

return (
<div className="container mx-auto py-8">
<div className="max-w-2xl mx-auto space-y-8">
<div>
<h1 className="text-3xl font-bold mb-2">Onchain User Search</h1>
<p className="text-muted-foreground">
Search for users by Farcaster username, ENS name, or Ethereum
address. All results are unified with the onchain address as the
primary identifier.
</p>
</div>

<div className="space-y-4">
<h2 className="text-xl font-semibold">Try searching for:</h2>
<ul className="list-disc list-inside space-y-1 text-muted-foreground">
<li>Farcaster username: &quot;vitalik&quot;, &quot;dwr&quot;</li>
<li>ENS name: &quot;vitalik.eth&quot;, &quot;nick.eth&quot;</li>
<li>
Ethereum address: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
</li>
</ul>
</div>

<OnchainUserSearch
apiKey={neynarApiKey}
placeholder="Search by farcaster username, ENS, or address..."
autoSearch={true}
maxResults={10}
showAddresses={true}
showENS={true}
onUserClick={(user) => {
// Example: Navigate to Farcaster profile
if (user.farcaster) {
window.open(`https://farcaster.xyz/${user.farcaster.username}`, "_blank");
} else if (user.ensName) {
window.open(`https://app.ens.domains/${user.ensName}`, "_blank");
} else {
window.open(`https://etherscan.io/address/${user.primaryAddress}`, "_blank");
}
}}
/>

<div className="mt-8 p-4 bg-muted rounded-lg">
<h3 className="font-semibold mb-2">Features:</h3>
<ul className="list-disc list-inside space-y-1 text-sm">
<li>Auto-detects input type (username, ENS, or address)</li>
<li>Resolves ENS names to addresses and vice versa</li>
<li>Finds Farcaster accounts associated with addresses</li>
<li>Shows all identities in unified cards</li>
<li>Supports pagination for username searches</li>
</ul>
</div>
</div>
</div>
);
}
Loading
Loading