From 08be8e5a9d962f175cad4f99a046f2fda118f50a Mon Sep 17 00:00:00 2001 From: rish Date: Fri, 4 Apr 2025 04:26:30 +0530 Subject: [PATCH 1/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e3309f..446d785 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Frames v2 Quickstart by Neynar 🪐 +# Farcaster mini apps (formerly frames) Quickstart by Neynar 🪐 A Farcaster Frames v2 quickstart npx script. From f2ec709e2d94c01b03e363f60e0a86b159053c2a Mon Sep 17 00:00:00 2001 From: lucas-neynar Date: Thu, 3 Apr 2025 16:36:33 -0700 Subject: [PATCH 2/6] fix: read .env.local in dev script --- scripts/dev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dev.js b/scripts/dev.js index c9ba273..65021c4 100755 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -6,7 +6,7 @@ import path from 'path'; import { fileURLToPath } from 'url'; // Load environment variables -dotenv.config(); +dotenv.config({ path: '.env.local' }); const __dirname = path.dirname(fileURLToPath(import.meta.url)); const projectRoot = path.join(__dirname, '..'); From 63a480ebda8f1208e2b711ae7d273d41bbabf622 Mon Sep 17 00:00:00 2001 From: lucas-neynar Date: Thu, 3 Apr 2025 17:09:38 -0700 Subject: [PATCH 3/6] fix: use vercel link to deploy with github --- package.json | 2 +- scripts/deploy.js | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 6068e07..5bc697d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/create-farcaster-mini-app", - "version": "1.2.9", + "version": "1.2.10", "type": "module", "private": false, "access": "public", diff --git a/scripts/deploy.js b/scripts/deploy.js index f44f2d0..5d0cfd2 100755 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -466,21 +466,22 @@ async function deployToVercel(useGitHub = false) { // Deploy the project if (useGitHub) { - console.log('\n📦 Deploying with GitHub integration...'); - execSync('vercel deploy --prod --git', { + console.log('\nSetting up GitHub integration...'); + execSync('vercel link', { cwd: projectRoot, stdio: 'inherit', env: process.env }); + console.log('\n📦 Deploying with GitHub integration...'); } else { console.log('\n📦 Deploying local code directly...'); - execSync('vercel deploy --prod', { - cwd: projectRoot, - stdio: 'inherit', - env: process.env - }); } + execSync('vercel deploy --prod', { + cwd: projectRoot, + stdio: 'inherit', + env: process.env + }); // Verify the actual domain after deployment console.log('\n🔍 Verifying deployment domain...'); From 551b59d05c66fcfd2499561ea6c1d347f5e0f868 Mon Sep 17 00:00:00 2001 From: Manan Date: Fri, 4 Apr 2025 12:37:43 -0700 Subject: [PATCH 4/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 446d785..dbd7cb7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Farcaster mini apps (formerly frames) Quickstart by Neynar 🪐 +# Farcaster Mini Apps (formerly Frames) Quickstart by Neynar 🪐 -A Farcaster Frames v2 quickstart npx script. +A Farcaster Mini Apps quickstart npx script. This is a [NextJS](https://nextjs.org/) + TypeScript + React app. From fb67300f551a9e18b8933eb73a93c3423d59eb84 Mon Sep 17 00:00:00 2001 From: lucas-neynar Date: Thu, 3 Apr 2025 19:04:06 -0700 Subject: [PATCH 5/6] fix: add missing packages --- bin/init.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/init.js b/bin/init.js index 01813da..38a5d26 100644 --- a/bin/init.js +++ b/bin/init.js @@ -350,6 +350,7 @@ export async function init() { // Add dependencies packageJson.dependencies = { + "@farcaster/auth-client": "^0.3.0", "@farcaster/auth-kit": "^0.6.0", "@farcaster/frame-core": "^0.0.29", "@farcaster/frame-node": "^0.0.18", @@ -362,6 +363,7 @@ export async function init() { "clsx": "^2.1.1", "dotenv": "^16.4.7", "lucide-react": "^0.469.0", + "mipd": "^0.0.7", "next": "15.0.3", "next-auth": "^4.24.11", "react": "^18", @@ -369,7 +371,8 @@ export async function init() { "tailwind-merge": "^2.6.0", "tailwindcss-animate": "^1.0.7", "viem": "^2.23.6", - "wagmi": "^2.14.12" + "wagmi": "^2.14.12", + "zod": "^3.24.2" }; packageJson.devDependencies = { From df9769a27078571dc89d2b9f79d0af8124210cd2 Mon Sep 17 00:00:00 2001 From: lucas-neynar Date: Fri, 4 Apr 2025 18:42:54 -0700 Subject: [PATCH 6/6] feat: make cli scripts more beginner friendly --- bin/init.js | 18 +++++------------- scripts/build.js | 13 ++++++++++--- scripts/dev.js | 8 +++----- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/bin/init.js b/bin/init.js index 38a5d26..2f9baed 100644 --- a/bin/init.js +++ b/bin/init.js @@ -193,7 +193,7 @@ export async function init() { { type: 'input', name: 'projectName', - message: '⚠️ Note: choosing a longer, more unique project name will help avoid conflicts with other existing domains\nWhat is the name of your frame?', + message: 'What is the name of your frame?', default: defaultFrameName, validate: (input) => { if (input.trim() === '') { @@ -206,7 +206,7 @@ export async function init() { type: 'input', name: 'description', message: 'Give a one-line description of your frame (optional):', - default: 'A Farcaster mini-app created with @neynar/create-farcaster-mini-app' + default: 'A Farcaster mini-app created with Neynar' }, { type: 'input', @@ -227,17 +227,9 @@ export async function init() { { type: 'confirm', name: 'useTunnel', - message: 'Would you like to use a tunnel for development?\n\n' + - 'Using a tunnel:\n' + - '- No sudo privileges required\n' + - '- Works with all Warpcast Frame Developer Tools\n' + - '- Possible to test on mobile devices\n\n' + - 'Using localhost:\n' + - '- Requires sudo privileges to enable HTTPS\n' + - '- Only works with the "Preview Frame" Warpcast tool\n' + - '- Cannot test frame embeds or mobile devices\n\n' + - 'Note: You can always switch between localhost and tunnel by editing the USE_TUNNEL environment variable in .env.local\n\n' + - 'Use tunnel?', + message: 'Would you like to test on mobile, or through a desktop browser?\n' + + 'Mobile testing requires setting up a tunnel to serve your app from localhost to the broader internet.\n' + + 'Configure mobile testing?', default: false } ]); diff --git a/scripts/build.js b/scripts/build.js index 256fbcf..43ebb80 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -7,6 +7,11 @@ import inquirer from 'inquirer'; import dotenv from 'dotenv'; import crypto from 'crypto'; +// ANSI color codes +const yellow = '\x1b[33m'; +const italic = '\x1b[3m'; +const reset = '\x1b[0m'; + // Load environment variables in specific order // First load .env for main config dotenv.config({ path: '.env' }); @@ -45,7 +50,7 @@ async function loadEnvLocal() { { type: 'confirm', name: 'loadLocal', - message: 'Found .env.local - would you like to load its values? (except for SEED_PHRASE, values will be written to .env)', + message: 'Found .env.local, likely created by the install script - would you like to load its values?', default: false } ]); @@ -286,14 +291,16 @@ async function main() { } } - // Get seed phrase from user if not already in .env.local + // Get seed phrase from user let seedPhrase = process.env.SEED_PHRASE; if (!seedPhrase) { const { seedPhrase: inputSeedPhrase } = await inquirer.prompt([ { type: 'password', name: 'seedPhrase', - message: 'Enter your seed phrase (this will only be used to sign the frame manifest):', + message: 'Your farcaster custody account seed phrase is required to create a signature proving this app was created by you.\n' + + `⚠️ ${yellow}${italic}seed phrase is only used to sign the frame manifest, then discarded${reset} ⚠️\n` + + 'Seed phrase:', validate: async (input) => { try { await validateSeedPhrase(input); diff --git a/scripts/dev.js b/scripts/dev.js index 65021c4..d125545 100755 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -119,15 +119,13 @@ async function startDev() { 5. Click "Preview" (note that it may take ~10 seconds to load) `); } else { - frameUrl = 'https://localhost:3000'; + frameUrl = 'http://localhost:3000'; console.log(` 💻 To test your frame: 1. Open the Warpcast Frame Developer Tools: https://warpcast.com/~/developers/frames 2. Scroll down to the "Preview Frame" tool 3. Enter this URL: ${frameUrl} - 4. Click "Preview" to test your frame - -Note: You may need to accept the self-signed certificate in your browser when first visiting ${frameUrl} + 4. Click "Preview" to test your frame (note that it may take ~5 seconds to load the first time) `); } @@ -136,7 +134,7 @@ Note: You may need to accept the self-signed certificate in your browser when fi ? path.join(projectRoot, 'node_modules', '.bin', 'next.cmd') : path.join(projectRoot, 'node_modules', '.bin', 'next'); - nextDev = spawn(nextBin, ['dev', ...(useTunnel ? [] : ['--experimental-https'])], { + nextDev = spawn(nextBin, ['dev'], { stdio: 'inherit', env: { ...process.env, NEXT_PUBLIC_URL: frameUrl, NEXTAUTH_URL: frameUrl }, cwd: projectRoot