Project-Wide Changes
Renaming a Library/Module
Section titled “Renaming a Library/Module”Rename an entire library or module throughout your project:
renamify rename mylib awesome_lib --commit
What This Changes
Section titled “What This Changes”File structure:
src/├── mylib/ → awesome_lib/│ ├── core.js → core.js (contents updated)│ └── utils.js → utils.js (contents updated)├── components/│ └── MyLibWidget.tsx → AwesomeLibWidget.tsx└── tests/ └── mylib.test.js → awesome_lib.test.js
Import statements:
// Beforeimport { helper } from 'mylib/utils';import MyLibWidget from './components/MyLibWidget';
// Afterimport { helper } from 'awesome_lib/utils';import AwesomeLibWidget from './components/AwesomeLibWidget';
Package.json and configuration:
// Before{ "name": "mylib", "main": "src/mylib/index.js"}
// After{ "name": "awesome_lib", "main": "src/awesome_lib/index.js"}
API Endpoint Renaming
Section titled “API Endpoint Renaming”Rename API endpoints consistently:
renamify rename getUserData fetchUserProfile \ --include "**/*.{js,ts,py,go}"
What This Changes
Section titled “What This Changes”Backend code:
# Before@app.route('/api/getUserData')def get_user_data(user_id): ...
# After@app.route('/api/fetchUserProfile')def fetch_user_profile(user_id): ...
Frontend code:
// Beforeconst response = await fetch('/api/getUserData');const getUserData = async (id) => { ... };
// Afterconst response = await fetch('/api/fetchUserProfile');const fetchUserProfile = async (id) => { ... };
Database Schema Changes
Section titled “Database Schema Changes”Rename database-related code:
renamify rename user_profile account_profile \ --include "**/*.{sql,js,py,rb}" \ --exclude "migrations/**"
What This Changes
Section titled “What This Changes”Model definitions:
# Beforeclass UserProfile(models.Model): def get_user_profile_data(self): ...
# Afterclass AccountProfile(models.Model): def get_account_profile_data(self): ...
SQL queries:
-- BeforeSELECT * FROM user_profile WHERE id = ?;UPDATE user_profile SET name = ? WHERE id = ?;
-- AfterSELECT * FROM account_profile WHERE id = ?;UPDATE account_profile SET name = ? WHERE id = ?;
Configuration Key Updates
Section titled “Configuration Key Updates”Update configuration keys across your application:
renamify rename redis_url cache_url \ --include "**/*.{js,py,rb,yml,yaml,json,toml}"
What This Changes
Section titled “What This Changes”Environment files:
# BeforeREDIS_URL=redis://localhost:6379redis_url=redis://localhost:6379
# AfterCACHE_URL=redis://localhost:6379cache_url=redis://localhost:6379
Configuration files:
# Beforedatabase: redis_url: ${REDIS_URL}
# Afterdatabase: cache_url: ${CACHE_URL}
Rename with Exclusions
Section titled “Rename with Exclusions”Sometimes you need to be selective about what gets changed:
renamify rename config settings \ --exclude-match ConfigurationManager,ConfigService \ --include "src/**" \ --exclude "**/*test*"
This will:
- ✅ Change
config
→settings
- ✅ Change
getConfig
→getSettings
- ❌ Skip
ConfigurationManager
(excluded match) - ❌ Skip
ConfigService
(excluded match) - ❌ Skip test files
Root Directory Renaming
Section titled “Root Directory Renaming”Rename the entire project directory:
renamify rename myproject awesome_project \ --rename-root \ --commit
After confirmation, you’ll see:
✅ Applied successfully!
Next Steps:1. cd ../awesome_project2. npm install # or cargo build, etc.3. Update any IDE project settings
Safety Considerations
Section titled “Safety Considerations”- Always commit changes before root directory rename
- Update build scripts and CI/CD pipelines
- Consider impact on deployment scripts
- Update documentation and README files
Performance Tips for Large Projects
Section titled “Performance Tips for Large Projects”Limit Scope
Section titled “Limit Scope”# Only process source files, not dependenciesrenamify rename old_name new_name \ --include "src/**/*.{js,ts,tsx}" \ --exclude "node_modules/**"
# Or use specific pathsrenamify rename old_name new_name src/ lib/
Use Dry Run First
Section titled “Use Dry Run First”# Explore the scope before committingrenamify dry-run old_name new_name src/
# Or with patternsrenamify dry-run old_name new_name --include "src/**"
# Count potential matchesrenamify dry-run old_name new_name | grep -c "│"
Parallel Workflow
Section titled “Parallel Workflow”# Create plan and review while system is idlerenamify plan large_change huge_change --preview json > plan.json
# Apply later when readyrenamify apply --plan plan.json