-
Notifications
You must be signed in to change notification settings - Fork 2
Development Workflow
Git workflow and best practices for D1 Database Manager development.
D1 Manager follows a simplified Git workflow optimized for open-source collaboration.
main branch:
- Production-ready code
- Protected branch
- All changes via pull requests
- Requires code review
Naming convention:
feature/feature-name
fix/bug-name
docs/documentation-update
refactor/code-improvement
Examples:
feature/cascade-simulator
fix/filter-persistence-bug
docs/update-api-reference
refactor/extract-filter-logic
Fork the repository:
GitHub → Fork button → Create fork
Clone your fork:
git clone https://github.com/YOUR_USERNAME/d1-manager.git
cd d1-managerAdd upstream remote:
git remote add upstream https://github.com/neverinfamous/d1-manager.gitUpdate main:
git checkout main
git pull upstream mainCreate branch:
git checkout -b feature/your-featureDevelopment workflow:
# Make code changes
# Test locally (see Local Development guide)
# Commit frequently with clear messagesCommit messages:
git add .
git commit -m "feat: add cascade impact simulator"Follow Conventional Commits:
-
feat:- New feature -
fix:- Bug fix -
docs:- Documentation -
style:- Formatting -
refactor:- Code restructuring -
test:- Tests -
chore:- Maintenance
Sync with upstream:
git fetch upstream
git rebase upstream/mainResolve conflicts if any:
# Fix conflicts
git add .
git rebase --continueFirst push:
git push origin feature/your-featureAfter rebase:
git push origin feature/your-feature --force-with-lease- Go to original repository on GitHub
- Click "New Pull Request"
- Select your branch
- Fill out PR template
- Submit for review
After submitting PR:
- Wait for automated checks
- Wait for maintainer review (1-3 days)
- Address feedback promptly
- Push updates to same branch
- Request re-review
Responding to feedback:
- Be professional and courteous
- Ask questions if unclear
- Explain your reasoning
- Make requested changes
- Mark conversations as resolved
Review checklist:
- Code quality and readability
- Tests pass
- Documentation updated
- No breaking changes (or documented)
- Follows coding standards
- No security issues
- Performance considerations
Providing feedback:
- Be constructive and specific
- Suggest improvements
- Praise good work
- Explain reasoning
- Mark comments as blocking or non-blocking
Minimum requirements:
# Start both dev servers
npm run dev # Terminal 1
npx wrangler dev --config wrangler.dev.toml --local # Terminal 2
# Test your changes thoroughly
# Check browser console for errors
# Test in multiple browsers (Chrome, Firefox)
# Test responsive designManual testing checklist:
- Feature works as expected
- No console errors
- No TypeScript errors
- UI looks correct in light/dark themes
- Mobile responsive
- No broken links
Deploy to your Cloudflare account:
# Set up your own wrangler.toml
cp wrangler.toml.example wrangler.toml
# Add your configuration
# Build and deploy
npm run build
npx wrangler deploy
# Test with real D1 databasesCommit often:
- Small, logical changes
- One feature/fix per commit
- Easier to review
- Easier to revert
Examples:
git commit -m "feat: add cascade graph visualization"
git commit -m "feat: add row count calculation"
git commit -m "feat: add export functionality"Good commit messages:
feat: add database comparison feature
- Compare schemas between two databases
- Show tables only in source/target
- Display column differences
- Include API endpoint for comparison
Bad commit messages:
fixed stuff
update
wip
.
Before merging:
- May be asked to squash commits
- Combines multiple commits into one
- Cleaner history
Interactive rebase:
git rebase -i HEAD~3 # Last 3 commits
# Mark commits to squash
# Update commit message
git push --force-with-leaseWhen rebasing:
git fetch upstream
git rebase upstream/main
# If conflicts occur:
# 1. Fix conflicts in files
# 2. Stage resolved files
git add .
# 3. Continue rebase
git rebase --continue
# If too complex:
git rebase --abort
# Ask for helpKeep branch updated:
# Sync regularly with upstream
git fetch upstream
git rebase upstream/main
git push --force-with-leaseMaintainers only:
- Update VERSION file
- Update CHANGELOG.md
- Create release tag
- Build and deploy
- Update documentation
- Announce release
# Make requested changes
git add .
git commit -m "fix: address review feedback"
git push origin feature/your-featuregit fetch upstream
git rebase upstream/main
git push origin feature/your-feature --force-with-lease# Last commit only
git commit --amend -m "feat: corrected commit message"
git push --force-with-lease# Make additional changes
git add .
git commit --amend --no-edit
git push --force-with-leaseCheck status:
git status
git log --onelineUndo changes:
git checkout -- file.txt # Undo unstaged changes
git reset HEAD file.txt # Unstage file
git reset --soft HEAD~1 # Undo last commit, keep changesStash changes:
git stash # Save changes temporarily
git stash pop # Restore stashed changes
git stash list # List stashesCherry-pick commit:
git cherry-pick <commit-hash>Install:
# macOS
brew install gh
# Windows
winget install GitHub.cliUsage:
gh pr create # Create PR from command line
gh pr list # List PRs
gh pr checkout 123 # Checkout PR #123Automated checks:
- TypeScript compilation
- ESLint checks
- Build successful
- Tests pass (if any)
All checks must pass before merge.
Always update docs when:
- Adding new features
- Changing APIs
- Modifying configuration
- Fixing bugs affecting usage
Files to check:
- README.md
- Wiki pages
- Code comments
- CHANGELOG.md
If stuck:
- Ask in PR comments
- Open a discussion on GitHub
- Check existing issues
- Review documentation
- Contributing Guide - Contribution guidelines
- Code Style Guide - Coding standards
- Testing Guide - Testing procedures
- Local Development - Development setup
Happy coding! 🚀
- Database Management
- Table Operations
- Query Console
- Column Management
- Bulk Operations
- Job History
- Time Travel
- Foreign Key Navigation
- Foreign Key Visualizer
- Foreign Key Dependencies
- Circular Dependency Detector
- Cascade Impact Simulator
- Constraint Validator
- Index Analyzer
- Undo Rollback
- Schema Designer
- Row Level Filtering