Files
orangecat/scripts/dev/merge-env.js
T
Your NameandClaude 4d26977e39 feat: Implement consistent navigation naming across app
Major consistency improvements:
- Renamed "My Journey" → "My Timeline" in sidebar
- Added "My" prefix to sidebar items (My Wallets, My Info)
- Added People tab to public profiles
- Renamed /journey route to /timeline
- Updated all code references from journey to timeline

Sidebar Navigation (My View):
- Dashboard
- My Timeline (was: My Journey)
- My Projects
- My People
- My Wallets (was: Wallets)
- My Info (new)

Public Profile Tabs:
- Overview (matches Dashboard)
- Timeline
- Projects
- People (new)
- Wallets
- Info

Route Changes:
- /journey → /timeline

Files Changed:
- src/config/navigationConfig.ts - Updated sidebar nav
- src/components/profile/PublicProfileClient.tsx - Added People tab
- src/components/profile/ProfilePeopleTab.tsx - New component
- src/components/timeline/SocialTimeline.tsx - journey → timeline
- src/app/(authenticated)/timeline/ - Renamed from journey
- src/app/(authenticated)/timeline/page.tsx - Updated references

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 16:14:30 +01:00

79 lines
1.9 KiB
JavaScript

#!/usr/bin/env node
/**
* Safe ENV merge:
* - Reads .env.local (if exists) and .env.vercel (pulled from Vercel)
* - Preserves existing keys in .env.local
* - Adds missing keys from .env.vercel
* - Explicitly preserves sensitive tokens like VERCEL_TOKEN
* - Creates a backup: .env.local.backup
*/
const fs = require('fs');
const path = require('path');
const LOCAL = path.join(process.cwd(), '.env.local');
const VERCEL = path.join(process.cwd(), '.env.vercel');
const BACKUP = path.join(process.cwd(), '.env.local.backup');
function parseEnv(text) {
const out = {};
text.split(/\r?\n/).forEach(line => {
const m = line.match(/^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)\s*$/);
if (m) {
let val = m[2];
// remove optional surrounding quotes
if (
(val.startsWith('"') && val.endsWith('"')) ||
(val.startsWith("'") && val.endsWith("'"))
) {
val = val.slice(1, -1);
}
out[m[1]] = val;
}
});
return out;
}
function serializeEnv(obj) {
return (
Object.entries(obj)
.map(([k, v]) => `${k}=${JSON.stringify(String(v))}`)
.join('\n') + '\n'
);
}
function readFileSafe(p) {
try {
return fs.readFileSync(p, 'utf8');
} catch {
return '';
}
}
function main() {
const localText = readFileSafe(LOCAL);
const vercelText = readFileSafe(VERCEL);
if (!vercelText) {
console.error('No .env.vercel found. Run: vercel env pull .env.vercel');
process.exit(1);
}
const local = parseEnv(localText);
const pulled = parseEnv(vercelText);
// Preserve local keys (including tokens) and add any missing from pulled
const merged = { ...pulled, ...local };
// Backup existing local file
if (localText) {
fs.writeFileSync(BACKUP, localText, 'utf8');
console.log(`💾 Backup created: ${BACKUP}`);
}
fs.writeFileSync(LOCAL, serializeEnv(merged), 'utf8');
console.log('✅ Merged .env.vercel into .env.local (preserving existing keys).');
}
main();