From 091e90c9f19b647264764c3ad9f9d0c1e1b455d2 Mon Sep 17 00:00:00 2001 From: lucas-neynar Date: Fri, 14 Mar 2025 18:58:43 -0700 Subject: [PATCH] Revert "update to .env.local" This reverts commit c6d8dbafde986db5d9cbbf216edb125f9b6056b0. --- bin/index.js | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/bin/index.js b/bin/index.js index 6fc5ebf..b0f9c1d 100755 --- a/bin/index.js +++ b/bin/index.js @@ -161,7 +161,7 @@ async function init() { { type: 'password', name: 'seedPhrase', - message: 'Enter your Farcaster custody account seed phrase to generate a signed manifest for your frame\n(optional -- leave blank to create an unsigned frame)\n(seed phrase is only ever stored in .env.local)\n\nSeed phrase:', + message: 'Enter your Farcaster custody account seed phrase to generate a signed manifest for your frame\n(optional -- leave blank to create an unsigned frame)\n(seed phrase is only ever stored locally)\n\nSeed phrase:', default: null } ]); @@ -301,12 +301,12 @@ async function init() { // Handle .env file console.log('\nSetting up environment variables...'); const envExamplePath = path.join(projectPath, '.env.example'); - const envLocalPath = path.join(projectPath, '.env.local'); + const envPath = path.join(projectPath, '.env'); if (fs.existsSync(envExamplePath)) { // Read the example file content const envExampleContent = fs.readFileSync(envExamplePath, 'utf8'); - // Write it to .env.local - fs.writeFileSync(envLocalPath, envExampleContent); + // Write it to .env + fs.writeFileSync(envPath, envExampleContent); // Generate custody address from seed phrase if (answers.seedPhrase) { @@ -318,32 +318,27 @@ async function init() { const neynarApiKey = answers.useNeynar ? answers.neynarApiKey : 'FARCASTER_V2_FRAMES_DEMO'; const fid = await lookupFidByCustodyAddress(custodyAddress, neynarApiKey); - // Write seed phrase and FID to .env.local for manifest signature generation - fs.appendFileSync(envLocalPath, `\nSEED_PHRASE="${answers.seedPhrase}"`); - fs.appendFileSync(envLocalPath, `\nFID="${fid}"`); + // Write seed phrase and FID to .env for manifest signature generation + fs.appendFileSync(envPath, `\nSEED_PHRASE="${answers.seedPhrase}"`); + fs.appendFileSync(envPath, `\nFID="${fid}"`); } if (answers.splashImageUrl) { - fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_SPLASH_IMAGE_URL="${answers.splashImageUrl}"`); + fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_SPLASH_IMAGE_URL="${answers.splashImageUrl}"`); } if (answers.iconImageUrl) { - fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_ICON_IMAGE_URL="${answers.iconImageUrl}"`); + fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_ICON_IMAGE_URL="${answers.iconImageUrl}"`); } // Append all remaining environment variables - fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_NAME="${answers.projectName}"`); - fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_DESCRIPTION="${answers.description}"`); - fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_BUTTON_TEXT="${answers.buttonText}"`); - fs.appendFileSync(envLocalPath, `\nNEYNAR_API_KEY="${answers.useNeynar ? answers.neynarApiKey : 'FARCASTER_V2_FRAMES_DEMO'}"`); + fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_NAME="${answers.projectName}"`); + fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_DESCRIPTION="${answers.description}"`); + fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_BUTTON_TEXT="${answers.buttonText}"`); + fs.appendFileSync(envPath, `\nNEYNAR_API_KEY="${answers.useNeynar ? answers.neynarApiKey : 'FARCASTER_V2_FRAMES_DEMO'}"`); fs.unlinkSync(envExamplePath); - console.log('\nCreated .env.local file from .env.example'); - - // Add .env.local to .gitignore - const gitignorePath = path.join(projectPath, '.gitignore'); - fs.appendFileSync(gitignorePath, '\n\n# Local environment variables\n.env.local\n.env.local.*'); - console.log('Added .env.local to .gitignore'); + console.log('\nCreated .env file from .env.example'); } else { console.log('\n.env.example does not exist, skipping copy and remove operations'); }