|
| 1 | +# Commit From Branch - Web Preview |
| 2 | + |
| 3 | +A web-based configuration preview tool for the `commit-from-branch` npm package. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🎯 **Real-time Preview**: See how your commit messages will be transformed instantly |
| 8 | +- ⚙️ **Configuration Testing**: Test different configuration settings without making actual commits |
| 9 | +- 📚 **Example Scenarios**: Pre-built examples for common use cases |
| 10 | +- 📱 **Responsive Design**: Works on desktop and mobile devices |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +1. **Configure Settings**: Set up your `includePattern`, `format`, `fallbackFormat`, and `exclude` patterns |
| 15 | +2. **Test Input**: Enter a branch name and commit message to see how they would be processed |
| 16 | +3. **View Results**: See the final commit message and processing details in real-time |
| 17 | +4. **Try Examples**: Use the example scenarios to understand different patterns |
| 18 | + |
| 19 | +## Development |
| 20 | + |
| 21 | +```bash |
| 22 | +# Install dependencies |
| 23 | +npm install |
| 24 | + |
| 25 | +# Start development server |
| 26 | +npm run dev |
| 27 | + |
| 28 | +# Build for production |
| 29 | +npm run build |
| 30 | +``` |
| 31 | + |
| 32 | +## Available Configuration Options |
| 33 | + |
| 34 | +- **includePattern**: Glob patterns for branches to include (e.g., `feature/*`, `bugfix/*`) |
| 35 | +- **format**: Template for commit messages when ticket is found (e.g., `${ticket}: ${msg}`) |
| 36 | +- **fallbackFormat**: Template when no ticket is found (e.g., `${segs[0]}: ${msg}`) |
| 37 | +- **exclude**: Patterns to exclude certain sources |
| 38 | + |
| 39 | +## Template Tokens |
| 40 | + |
| 41 | +- `${ticket}`: Extracted ticket number (e.g., ABC-123) |
| 42 | +- `${msg}`: Original commit message |
| 43 | +- `${branch}`: Full branch name |
| 44 | +- `${segs[0]}`, `${segs[1]}`: Branch segments split by `/` |
| 45 | +- `${segments}`: All segments joined with `/` |
| 46 | +- `${prefix:n}`: First n segments joined with `/` |
| 47 | + |
| 48 | +## Examples |
| 49 | + |
| 50 | +Try the built-in example scenarios to understand: |
| 51 | +- JIRA ticket format patterns |
| 52 | +- Simple prefix additions |
| 53 | +- Template replacement modes |
| 54 | +- Skip conditions and duplicate detection |
| 55 | + |
| 56 | +Visit http://localhost:5173 after running `npm run dev` to use the preview tool. |
0 commit comments