mvn-tree-visualizer 1.3.0__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.github/SECURITY.md +2 -1
- mvn_tree_visualizer-1.5.0/.github/copilot-instructions.md +87 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.github/dependabot.yml +13 -0
- mvn_tree_visualizer-1.5.0/.github/instructions/copilot-instructions.md +92 -0
- mvn_tree_visualizer-1.5.0/.github/workflows/release.yml +58 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/CHANGELOG.md +34 -4
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/CONTRIBUTING.md +41 -1
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/PKG-INFO +23 -6
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/README.md +22 -5
- mvn_tree_visualizer-1.5.0/RELEASE.md +185 -0
- mvn_tree_visualizer-1.5.0/ROADMAP.md +149 -0
- mvn_tree_visualizer-1.5.0/docs/THEMES.md +106 -0
- mvn_tree_visualizer-1.5.0/examples/README.md +164 -0
- mvn_tree_visualizer-1.5.0/examples/complex-project/diagram-dark.html +649 -0
- mvn_tree_visualizer-1.5.0/examples/complex-project/diagram-minimal.html +624 -0
- mvn_tree_visualizer-1.5.0/examples/complex-project/maven_dependency_file +129 -0
- mvn_tree_visualizer-1.5.0/examples/simple-project/dependencies.json +192 -0
- mvn_tree_visualizer-1.5.0/examples/simple-project/diagram-dark.html +410 -0
- mvn_tree_visualizer-1.5.0/examples/simple-project/diagram-minimal.html +385 -0
- mvn_tree_visualizer-1.5.0/examples/simple-project/maven_dependency_file +44 -0
- mvn_tree_visualizer-1.5.0/issues.md +79 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/pyproject.toml +31 -1
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/cli.py +13 -3
- mvn_tree_visualizer-1.5.0/src/mvn_tree_visualizer/enhanced_template.py +281 -0
- mvn_tree_visualizer-1.5.0/src/mvn_tree_visualizer/outputs/html_output.py +132 -0
- mvn_tree_visualizer-1.5.0/src/mvn_tree_visualizer/themes.py +202 -0
- mvn_tree_visualizer-1.5.0/tests/test_github_issue_7.py +147 -0
- mvn_tree_visualizer-1.5.0/tests/test_html_output.py +200 -0
- mvn_tree_visualizer-1.5.0/tests/test_large_diagram_support.py +199 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/tests/test_watch_mode.py +2 -1
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/uv.lock +301 -1
- mvn_tree_visualizer-1.3.0/.github/workflows/publish.yml +0 -29
- mvn_tree_visualizer-1.3.0/ROADMAP.md +0 -100
- mvn_tree_visualizer-1.3.0/examples/README.md +0 -62
- mvn_tree_visualizer-1.3.0/examples/complex-project/diagram.html +0 -145
- mvn_tree_visualizer-1.3.0/examples/complex-project/maven_dependency_file +0 -84
- mvn_tree_visualizer-1.3.0/examples/simple-project/dependencies.json +0 -40
- mvn_tree_visualizer-1.3.0/examples/simple-project/diagram.html +0 -70
- mvn_tree_visualizer-1.3.0/examples/simple-project/maven_dependency_file +0 -9
- mvn_tree_visualizer-1.3.0/issues.md +0 -73
- mvn_tree_visualizer-1.3.0/src/mvn_tree_visualizer/TEMPLATE.py +0 -61
- mvn_tree_visualizer-1.3.0/src/mvn_tree_visualizer/outputs/html_output.py +0 -65
- mvn_tree_visualizer-1.3.0/tests/test_html_output.py +0 -159
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.github/FUNDING.yml +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.github/ISSUE_TEMPLATE/question.md +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.github/workflows/ci.yml +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.gitignore +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/.python-version +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/CODE_OF_CONDUCT.md +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/LICENSE +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/docs/INTEGRATION.md +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/docs/README.md +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/examples/watch-test/README.md +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/examples/watch-test/test_maven_file +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/ruff.toml +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/__init__.py +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/__main__.py +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/diagram.py +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/exceptions.py +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/file_watcher.py +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/get_dependencies_in_one_file.py +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/outputs/json_output.py +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/src/mvn_tree_visualizer/validation.py +0 -0
- {mvn_tree_visualizer-1.3.0 → mvn_tree_visualizer-1.5.0}/tests/test_json_output.py +0 -0
|
@@ -6,8 +6,9 @@ We actively support the following versions of mvn-tree-visualizer:
|
|
|
6
6
|
|
|
7
7
|
| Version | Supported |
|
|
8
8
|
| ------- | ------------------ |
|
|
9
|
+
| 1.3.x | :white_check_mark: |
|
|
9
10
|
| 1.2.x | :white_check_mark: |
|
|
10
|
-
| 1.1.x | :
|
|
11
|
+
| 1.1.x | :x: |
|
|
11
12
|
| 1.0.x | :x: |
|
|
12
13
|
|
|
13
14
|
## Reporting a Vulnerability
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Maven Dependency Tree Visualizer - AI Coding Agent Instructions
|
|
2
|
+
|
|
3
|
+
## Architecture Overview
|
|
4
|
+
|
|
5
|
+
This is a **command-line tool** that converts Maven dependency tree output into interactive HTML diagrams and JSON data. The tool follows a **pipeline architecture**:
|
|
6
|
+
|
|
7
|
+
1. **Input Processing**: Merges multiple `maven_dependency_file` files from different Maven modules (`get_dependencies_in_one_file.py`)
|
|
8
|
+
2. **Data Transformation**: Parses Maven tree format and converts to Mermaid diagram syntax (`diagram.py`, `outputs/html_output.py`)
|
|
9
|
+
3. **Output Generation**: Creates themed HTML with interactive features or structured JSON (`outputs/`)
|
|
10
|
+
4. **Watch Mode**: Real-time file monitoring for development workflows (`file_watcher.py`)
|
|
11
|
+
|
|
12
|
+
## Key Components & Data Flow
|
|
13
|
+
|
|
14
|
+
### Core Pipeline (`cli.py`)
|
|
15
|
+
- Entry point validates inputs → merges dependency files → generates outputs
|
|
16
|
+
- **Error handling is comprehensive** - uses custom exception hierarchy in `exceptions.py`
|
|
17
|
+
- Supports both HTML (interactive) and JSON (programmatic) output formats
|
|
18
|
+
|
|
19
|
+
### Multi-Module Maven Support (`get_dependencies_in_one_file.py`)
|
|
20
|
+
- **Critical pattern**: Recursively finds and merges `maven_dependency_file` from all subdirectories
|
|
21
|
+
- Maven projects often have complex module structures - tool handles this automatically
|
|
22
|
+
- Generated intermediate file `dependency_tree.txt` is cleaned up unless `--keep-tree` is used
|
|
23
|
+
|
|
24
|
+
### Mermaid.js Conversion (`outputs/html_output.py`)
|
|
25
|
+
- **Node classification logic**: Root (blue), intermediate (orange), leaf (green) based on dependency relationships
|
|
26
|
+
- **Sanitization pattern**: Maven artifact names → valid Mermaid node IDs (hyphens to underscores)
|
|
27
|
+
- Tracks parent/child relationships to determine node types for consistent styling
|
|
28
|
+
|
|
29
|
+
### Theme System (`themes.py`, `enhanced_template.py`)
|
|
30
|
+
- **Consistent color scheme** across all themes via `STANDARD_COLORS`
|
|
31
|
+
- Dark theme has specific text visibility fixes for Mermaid.js compatibility
|
|
32
|
+
- Template includes pan/zoom, download functionality, keyboard shortcuts
|
|
33
|
+
|
|
34
|
+
## Maven Integration Workflow
|
|
35
|
+
|
|
36
|
+
The tool expects this Maven command to be run first:
|
|
37
|
+
```bash
|
|
38
|
+
mvn dependency:tree -DoutputFile=maven_dependency_file -DappendOutput=true
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Why this matters**: The tool is designed around Maven's specific output format and file placement in `target/` directories.
|
|
42
|
+
|
|
43
|
+
## Development Conventions
|
|
44
|
+
|
|
45
|
+
### Error Handling
|
|
46
|
+
- Custom exception hierarchy: `MvnTreeVisualizerError` → specific error types
|
|
47
|
+
- **Pattern**: Validate early, fail fast with helpful error messages including Maven commands
|
|
48
|
+
- File operations wrapped with encoding and permission checks
|
|
49
|
+
|
|
50
|
+
### Testing Patterns (`tests/`)
|
|
51
|
+
- **Key test pattern**: Use temporary directories for file operations
|
|
52
|
+
- Mock file system events for watch mode testing
|
|
53
|
+
- Mermaid output validation focuses on relationships and styling classes
|
|
54
|
+
|
|
55
|
+
### Code Organization
|
|
56
|
+
- **Outputs as pluggable modules**: `outputs/html_output.py`, `outputs/json_output.py`
|
|
57
|
+
- Validation logic centralized in `validation.py`
|
|
58
|
+
- Theme configuration as data classes, not inheritance
|
|
59
|
+
|
|
60
|
+
## Critical Implementation Details
|
|
61
|
+
|
|
62
|
+
### Watch Mode (`file_watcher.py`)
|
|
63
|
+
- Uses `watchdog` library with custom event handlers
|
|
64
|
+
- Monitors for changes to any file named `maven_dependency_file` in directory tree
|
|
65
|
+
- Callback-based architecture for diagram regeneration
|
|
66
|
+
|
|
67
|
+
### Version Display Logic
|
|
68
|
+
- `--show-versions` flag affects both HTML and JSON output
|
|
69
|
+
- Version info stripped/included during Mermaid conversion, not at template level
|
|
70
|
+
|
|
71
|
+
### File Path Handling
|
|
72
|
+
- **Windows compatibility**: Uses `pathlib.Path` consistently
|
|
73
|
+
- Intermediate files created in output directory, not temp
|
|
74
|
+
- Directory creation is recursive (`parents=True, exist_ok=True`)
|
|
75
|
+
|
|
76
|
+
## Common Debugging Workflows
|
|
77
|
+
|
|
78
|
+
1. **No dependency files found**: Check if Maven command was run and generated files in `target/` dirs
|
|
79
|
+
2. **Empty diagrams**: Verify Maven output format and encoding (UTF-8 expected)
|
|
80
|
+
3. **Theme rendering issues**: Dark theme has specific CSS overrides for Mermaid.js text visibility
|
|
81
|
+
4. **Watch mode not triggering**: Ensure file names match exactly (`maven_dependency_file`)
|
|
82
|
+
|
|
83
|
+
## Extension Points
|
|
84
|
+
|
|
85
|
+
- **New output formats**: Add modules to `outputs/` directory following existing pattern
|
|
86
|
+
- **Custom themes**: Extend `THEMES` dict in `themes.py` with `Theme` objects
|
|
87
|
+
- **New validation rules**: Add to `validation.py` following existing error patterns
|
|
@@ -12,6 +12,19 @@ updates:
|
|
|
12
12
|
labels:
|
|
13
13
|
- "dependencies"
|
|
14
14
|
- "python"
|
|
15
|
+
|
|
16
|
+
- package-ecosystem: "uv"
|
|
17
|
+
directory: "/"
|
|
18
|
+
schedule:
|
|
19
|
+
interval: "weekly"
|
|
20
|
+
open-pull-requests-limit: 10
|
|
21
|
+
commit-message:
|
|
22
|
+
prefix: "deps"
|
|
23
|
+
prefix-development: "deps-dev"
|
|
24
|
+
labels:
|
|
25
|
+
- "dependencies"
|
|
26
|
+
- "uv"
|
|
27
|
+
- "python"
|
|
15
28
|
|
|
16
29
|
# Enable version updates for GitHub Actions
|
|
17
30
|
- package-ecosystem: "github-actions"
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# GitHub Copilot Instructions for mvn-tree-visualizer
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
This is a Python CLI tool that parses Maven dependency trees (`mvn dependency:tree` output) and generates interactive HTML diagrams (using Mermaid.js) or JSON outputs. The tool supports watch mode for real-time regeneration and has a modular architecture focused on error handling and user experience.
|
|
5
|
+
|
|
6
|
+
## Architecture & Key Components
|
|
7
|
+
|
|
8
|
+
### Core Flow
|
|
9
|
+
1. **Input Validation** (`validation.py`) - Find and validate Maven dependency files
|
|
10
|
+
2. **File Merging** (`get_dependencies_in_one_file.py`) - Combine multiple dependency files
|
|
11
|
+
3. **Parsing** (`diagram.py`) - Read merged dependency tree
|
|
12
|
+
4. **Output Generation** (`outputs/`) - Generate HTML (Mermaid.js) or JSON
|
|
13
|
+
5. **Watch Mode** (`file_watcher.py`) - Monitor files for changes using watchdog
|
|
14
|
+
|
|
15
|
+
### Module Structure
|
|
16
|
+
```
|
|
17
|
+
src/mvn_tree_visualizer/
|
|
18
|
+
├── cli.py # Entry point with comprehensive error handling
|
|
19
|
+
├── exceptions.py # Custom exception hierarchy
|
|
20
|
+
├── validation.py # File discovery and validation logic
|
|
21
|
+
├── diagram.py # Core dependency tree processing
|
|
22
|
+
├── file_watcher.py # Real-time file monitoring
|
|
23
|
+
├── get_dependencies... # Multi-file merging logic
|
|
24
|
+
├── TEMPLATE.py # Jinja2 HTML template for Mermaid.js
|
|
25
|
+
└── outputs/
|
|
26
|
+
├── html_output.py # Mermaid diagram generation
|
|
27
|
+
└── json_output.py # Structured JSON output
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Development Conventions
|
|
31
|
+
|
|
32
|
+
### Error Handling Pattern
|
|
33
|
+
- Use custom exceptions from `exceptions.py`: `DependencyFileNotFoundError`, `DependencyParsingError`, `OutputGenerationError`
|
|
34
|
+
- Provide actionable error messages with Maven commands and file paths
|
|
35
|
+
- Follow the pattern in `cli.py:generate_diagram()` for comprehensive error handling
|
|
36
|
+
|
|
37
|
+
### Testing Approach
|
|
38
|
+
- Use pytest with descriptive test names like `test_convert_to_mermaid_deeper_tree()`
|
|
39
|
+
- Test both positive cases and error conditions
|
|
40
|
+
- Include realistic Maven dependency tree samples in test data
|
|
41
|
+
- Run tests with: `uv run pytest tests/ -v`
|
|
42
|
+
|
|
43
|
+
### Package Management
|
|
44
|
+
- Uses `uv` as package manager - always use `uv run` for commands
|
|
45
|
+
- Core dependencies: `jinja2` (templating), `watchdog` (file monitoring)
|
|
46
|
+
- Entry point: `mvn-tree-visualizer` command maps to `cli:cli`
|
|
47
|
+
|
|
48
|
+
### Code Quality
|
|
49
|
+
- Lint with: `uv run ruff check .`
|
|
50
|
+
- Type hints required throughout (project uses Python 3.13+)
|
|
51
|
+
- Follow existing patterns for file validation and path handling
|
|
52
|
+
|
|
53
|
+
## Critical Implementation Details
|
|
54
|
+
|
|
55
|
+
### Maven Dependency Parsing
|
|
56
|
+
- Input format: `[INFO] groupId:artifactId:type:version:scope` with tree structure using `+`, `|`, `\`
|
|
57
|
+
- Handle both 4-part and 5-part dependency strings (see `html_output.py:_convert_to_mermaid`)
|
|
58
|
+
- Depth calculation based on whitespace: `depth = len(parts[0].split(" ")) - 1`
|
|
59
|
+
|
|
60
|
+
### File Discovery Pattern
|
|
61
|
+
- Multi-file support: searches directory tree for `maven_dependency_file` (configurable)
|
|
62
|
+
- Merges files from different Maven modules into single intermediate file
|
|
63
|
+
- Validates file existence, permissions, and content before processing
|
|
64
|
+
|
|
65
|
+
### Output Generation
|
|
66
|
+
- HTML uses Mermaid.js with `graph LR` format
|
|
67
|
+
- Version display controlled by `--show-versions` flag
|
|
68
|
+
- JSON output maintains tree structure with parent-child relationships
|
|
69
|
+
|
|
70
|
+
### Watch Mode Implementation
|
|
71
|
+
- Uses watchdog library for cross-platform file monitoring
|
|
72
|
+
- Monitors specific filename pattern across directory tree
|
|
73
|
+
- Debounces changes and provides timestamped feedback
|
|
74
|
+
|
|
75
|
+
## Common Development Tasks
|
|
76
|
+
|
|
77
|
+
### Adding New Output Formats
|
|
78
|
+
1. Create new module in `outputs/` directory
|
|
79
|
+
2. Follow pattern from `html_output.py` and `json_output.py`
|
|
80
|
+
3. Add format option to CLI and update `generate_diagram()` in `cli.py`
|
|
81
|
+
|
|
82
|
+
### Error Message Improvements
|
|
83
|
+
- All user-facing errors should include specific file paths and suggested Maven commands
|
|
84
|
+
- Use `print_maven_help()` pattern for guiding users to generate dependency files
|
|
85
|
+
- Test error scenarios in addition to happy path
|
|
86
|
+
|
|
87
|
+
### Testing New Features
|
|
88
|
+
- Include realistic Maven dependency trees in test data
|
|
89
|
+
- Test both single-module and multi-module project scenarios
|
|
90
|
+
- Verify error handling with invalid/missing files
|
|
91
|
+
|
|
92
|
+
Remember: This tool processes Maven output files, not Maven projects directly. Users must run `mvn dependency:tree -DoutputFile=maven_dependency_file` first.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: Semantic Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master ]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
id-token: write
|
|
16
|
+
issues: write
|
|
17
|
+
pull-requests: write
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
25
|
+
|
|
26
|
+
- name: Set up Python
|
|
27
|
+
uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: '3.13'
|
|
30
|
+
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@v6
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: |
|
|
36
|
+
uv sync --dev
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: |
|
|
40
|
+
uv run pytest tests/ -v
|
|
41
|
+
|
|
42
|
+
- name: Run linting
|
|
43
|
+
run: |
|
|
44
|
+
uv run ruff check .
|
|
45
|
+
|
|
46
|
+
- name: Python Semantic Release
|
|
47
|
+
id: release
|
|
48
|
+
uses: python-semantic-release/python-semantic-release@v10.2.0
|
|
49
|
+
with:
|
|
50
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
51
|
+
|
|
52
|
+
- name: Publish to PyPI
|
|
53
|
+
if: steps.release.outputs.released == 'true'
|
|
54
|
+
env:
|
|
55
|
+
TWINE_USERNAME: __token__
|
|
56
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
57
|
+
run: |
|
|
58
|
+
uv run twine upload dist/*
|
|
@@ -5,10 +5,7 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
### Added
|
|
11
|
-
- Placeholder for future features
|
|
8
|
+
<!--next-version-placeholder-->
|
|
12
9
|
|
|
13
10
|
## [1.3.0] - 2025-07-09
|
|
14
11
|
|
|
@@ -48,6 +45,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
48
45
|
|
|
49
46
|
### Changed
|
|
50
47
|
- Enhanced CLI help text to reflect new features
|
|
48
|
+
- Improved JSON output structure for better programmatic access
|
|
49
|
+
- Updated documentation with version feature examples
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
- Type annotation issues and improved code clarity
|
|
53
|
+
- JSON serialization for complex dependency structures
|
|
54
|
+
|
|
55
|
+
## [1.1.0] - 2025-07-05
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
- JSON output format option for programmatic consumption
|
|
59
|
+
- Multi-file support for Maven modules (searches for multiple `maven_dependency_file`)
|
|
60
|
+
- File merging functionality for complex projects
|
|
61
|
+
- Comprehensive error handling for file operations
|
|
62
|
+
- Enhanced CLI with format selection
|
|
63
|
+
|
|
64
|
+
### Changed
|
|
65
|
+
- Improved project structure with organized outputs directory
|
|
66
|
+
- Better separation of concerns between HTML and JSON generation
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
- File handling issues with large dependency trees
|
|
70
|
+
- Output format validation and error messages
|
|
71
|
+
|
|
72
|
+
## [1.0.0] - 2025-07-01
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
- Initial release of mvn-tree-visualizer
|
|
76
|
+
- HTML diagram generation using Mermaid.js
|
|
77
|
+
- CLI interface for processing Maven dependency files
|
|
78
|
+
- Basic error handling and validation
|
|
79
|
+
- Support for Maven dependency tree parsing
|
|
80
|
+
- Interactive HTML output with visual dependency graphs
|
|
51
81
|
- Improved code documentation and readability with type hints
|
|
52
82
|
- Updated README.md with new feature documentation and usage examples
|
|
53
83
|
|
|
@@ -47,8 +47,48 @@ pytest
|
|
|
47
47
|
|
|
48
48
|
### Commit and push
|
|
49
49
|
|
|
50
|
+
We use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages to enable automatic versioning and changelog generation.
|
|
51
|
+
|
|
52
|
+
**Commit Message Format:**
|
|
53
|
+
```
|
|
54
|
+
<type>[optional scope]: <description>
|
|
55
|
+
|
|
56
|
+
[optional body]
|
|
57
|
+
|
|
58
|
+
[optional footer(s)]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Types:**
|
|
62
|
+
- `feat`: A new feature (triggers minor version bump)
|
|
63
|
+
- `fix`: A bug fix (triggers patch version bump)
|
|
64
|
+
- `docs`: Documentation only changes
|
|
65
|
+
- `style`: Changes that do not affect the meaning of the code
|
|
66
|
+
- `refactor`: A code change that neither fixes a bug nor adds a feature
|
|
67
|
+
- `perf`: A code change that improves performance (triggers patch version bump)
|
|
68
|
+
- `test`: Adding missing tests or correcting existing tests
|
|
69
|
+
- `chore`: Changes to the build process or auxiliary tools
|
|
70
|
+
- `ci`: Changes to CI configuration files and scripts
|
|
71
|
+
|
|
72
|
+
**Examples:**
|
|
73
|
+
```bash
|
|
74
|
+
feat: add theme support with --theme option
|
|
75
|
+
fix: resolve dependency parsing error with special characters
|
|
76
|
+
docs: update README with new theme examples
|
|
77
|
+
chore: update dependencies to latest versions
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**BREAKING CHANGES:**
|
|
81
|
+
For breaking changes, add `!` after the type or include `BREAKING CHANGE:` in the footer:
|
|
82
|
+
```bash
|
|
83
|
+
feat!: change CLI interface for better usability
|
|
84
|
+
# or
|
|
85
|
+
feat: change CLI interface
|
|
86
|
+
|
|
87
|
+
BREAKING CHANGE: --output-format flag renamed to --format
|
|
88
|
+
```
|
|
89
|
+
|
|
50
90
|
```bash
|
|
51
|
-
git commit -m "
|
|
91
|
+
git commit -m "feat: add your new feature description"
|
|
52
92
|
git push origin 123-add-a-feature
|
|
53
93
|
```
|
|
54
94
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mvn-tree-visualizer
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: A simple command line tool to visualize the dependency tree of a Maven project in a graphical format.
|
|
5
5
|
Project-URL: source, https://github.com/dyka3773/mvn-tree-visualizer
|
|
6
6
|
Author-email: Iraklis Konsoulas <dyka3773@gmail.com>
|
|
@@ -55,12 +55,12 @@ pip install mvn-tree-visualizer
|
|
|
55
55
|
- **🌐 Multiple Output Formats:**
|
|
56
56
|
- **HTML:** Generates an interactive HTML diagram of your dependency tree using Mermaid.js.
|
|
57
57
|
- **JSON:** Creates a structured JSON representation of the dependency tree, perfect for scripting or integration with other tools.
|
|
58
|
+
- **🎨 Theme System:** Choose from 2 built-in themes (minimal, dark) for clean and consistent diagram styling.
|
|
58
59
|
- **🔄 Watch Mode:** Automatically regenerates diagrams when Maven dependency files change using the `--watch` flag.
|
|
59
|
-
- **📋 Version Display:**
|
|
60
|
-
-
|
|
61
|
-
- **📂 File
|
|
62
|
-
-
|
|
63
|
-
- **💾 SVG Export:** Download the generated diagram as an SVG file directly from the HTML page.
|
|
60
|
+
- **📋 Version Display:** Toggle dependency versions in outputs with `--show-versions`
|
|
61
|
+
- **💾 Enhanced Downloads:** SVG and PNG export directly from browser
|
|
62
|
+
- **📂 Smart File Handling:** Automatically finds and merges multiple `maven_dependency_file` files from different subdirectories.
|
|
63
|
+
- **🎯 Color Coding:** Visual distinction between root, intermediate, and leaf dependencies
|
|
64
64
|
|
|
65
65
|
## How to Use
|
|
66
66
|
|
|
@@ -93,6 +93,15 @@ mvn_tree_visualizer --filename "maven_dependency_file" --output "dependencies.js
|
|
|
93
93
|
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html" --show-versions
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
#### With Custom Themes
|
|
97
|
+
```bash
|
|
98
|
+
# Dark theme for low-light environments
|
|
99
|
+
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html" --theme dark
|
|
100
|
+
|
|
101
|
+
# Default minimal theme (clean monospace design)
|
|
102
|
+
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html"
|
|
103
|
+
```
|
|
104
|
+
|
|
96
105
|
#### JSON Output with Versions
|
|
97
106
|
```bash
|
|
98
107
|
mvn_tree_visualizer --filename "maven_dependency_file" --output "dependencies.json" --format json --show-versions
|
|
@@ -129,12 +138,20 @@ Each example includes:
|
|
|
129
138
|
| `--filename` | The name of the file containing the Maven dependency tree | `maven_dependency_file` |
|
|
130
139
|
| `--output` | The name of the output file | `diagram.html` |
|
|
131
140
|
| `--format` | The output format (`html` or `json`) | `html` |
|
|
141
|
+
| `--theme` | Theme for HTML diagrams (`minimal`, `dark`) | `minimal` |
|
|
132
142
|
| `--show-versions` | Show dependency versions in the diagram | `False` |
|
|
133
143
|
| `--watch` | Watch for file changes and auto-regenerate diagram | `False` |
|
|
134
144
|
| `--directory` | The directory to scan for the Maven dependency file(s) | current directory |
|
|
135
145
|
| `--keep-tree` | Keep the intermediate `dependency_tree.txt` file | `False` |
|
|
136
146
|
| `--help` | Show the help message and exit | - |
|
|
137
147
|
|
|
148
|
+
### Theme Options
|
|
149
|
+
|
|
150
|
+
- **`minimal`**: Clean monospace design with simple black borders (default)
|
|
151
|
+
- **`dark`**: Same minimal styling but with white text on black background
|
|
152
|
+
|
|
153
|
+
📖 **See the complete [Theme Documentation](docs/THEMES.md) for detailed information about themes and interactive features.**
|
|
154
|
+
|
|
138
155
|
## Performance
|
|
139
156
|
|
|
140
157
|
**For Large Projects:**
|
|
@@ -35,12 +35,12 @@ pip install mvn-tree-visualizer
|
|
|
35
35
|
- **🌐 Multiple Output Formats:**
|
|
36
36
|
- **HTML:** Generates an interactive HTML diagram of your dependency tree using Mermaid.js.
|
|
37
37
|
- **JSON:** Creates a structured JSON representation of the dependency tree, perfect for scripting or integration with other tools.
|
|
38
|
+
- **🎨 Theme System:** Choose from 2 built-in themes (minimal, dark) for clean and consistent diagram styling.
|
|
38
39
|
- **🔄 Watch Mode:** Automatically regenerates diagrams when Maven dependency files change using the `--watch` flag.
|
|
39
|
-
- **📋 Version Display:**
|
|
40
|
-
-
|
|
41
|
-
- **📂 File
|
|
42
|
-
-
|
|
43
|
-
- **💾 SVG Export:** Download the generated diagram as an SVG file directly from the HTML page.
|
|
40
|
+
- **📋 Version Display:** Toggle dependency versions in outputs with `--show-versions`
|
|
41
|
+
- **💾 Enhanced Downloads:** SVG and PNG export directly from browser
|
|
42
|
+
- **📂 Smart File Handling:** Automatically finds and merges multiple `maven_dependency_file` files from different subdirectories.
|
|
43
|
+
- **🎯 Color Coding:** Visual distinction between root, intermediate, and leaf dependencies
|
|
44
44
|
|
|
45
45
|
## How to Use
|
|
46
46
|
|
|
@@ -73,6 +73,15 @@ mvn_tree_visualizer --filename "maven_dependency_file" --output "dependencies.js
|
|
|
73
73
|
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html" --show-versions
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
#### With Custom Themes
|
|
77
|
+
```bash
|
|
78
|
+
# Dark theme for low-light environments
|
|
79
|
+
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html" --theme dark
|
|
80
|
+
|
|
81
|
+
# Default minimal theme (clean monospace design)
|
|
82
|
+
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html"
|
|
83
|
+
```
|
|
84
|
+
|
|
76
85
|
#### JSON Output with Versions
|
|
77
86
|
```bash
|
|
78
87
|
mvn_tree_visualizer --filename "maven_dependency_file" --output "dependencies.json" --format json --show-versions
|
|
@@ -109,12 +118,20 @@ Each example includes:
|
|
|
109
118
|
| `--filename` | The name of the file containing the Maven dependency tree | `maven_dependency_file` |
|
|
110
119
|
| `--output` | The name of the output file | `diagram.html` |
|
|
111
120
|
| `--format` | The output format (`html` or `json`) | `html` |
|
|
121
|
+
| `--theme` | Theme for HTML diagrams (`minimal`, `dark`) | `minimal` |
|
|
112
122
|
| `--show-versions` | Show dependency versions in the diagram | `False` |
|
|
113
123
|
| `--watch` | Watch for file changes and auto-regenerate diagram | `False` |
|
|
114
124
|
| `--directory` | The directory to scan for the Maven dependency file(s) | current directory |
|
|
115
125
|
| `--keep-tree` | Keep the intermediate `dependency_tree.txt` file | `False` |
|
|
116
126
|
| `--help` | Show the help message and exit | - |
|
|
117
127
|
|
|
128
|
+
### Theme Options
|
|
129
|
+
|
|
130
|
+
- **`minimal`**: Clean monospace design with simple black borders (default)
|
|
131
|
+
- **`dark`**: Same minimal styling but with white text on black background
|
|
132
|
+
|
|
133
|
+
📖 **See the complete [Theme Documentation](docs/THEMES.md) for detailed information about themes and interactive features.**
|
|
134
|
+
|
|
118
135
|
## Performance
|
|
119
136
|
|
|
120
137
|
**For Large Projects:**
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Release Procedure
|
|
2
|
+
|
|
3
|
+
This document describes the automated release process for `mvn-tree-visualizer` using `python-semantic-release`.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The project uses automated releases with **python-semantic-release**:
|
|
8
|
+
- **Automatic versioning** based on conventional commit messages
|
|
9
|
+
- **Automatic CHANGELOG.md generation** from commit history
|
|
10
|
+
- **Automatic PyPI publication** when code is pushed to `master`
|
|
11
|
+
- **Automatic GitHub releases** with release notes
|
|
12
|
+
|
|
13
|
+
### Workflow Branches:
|
|
14
|
+
- `develop` - Active development branch where features are integrated
|
|
15
|
+
- `master` - Protected production branch, triggers automated releases
|
|
16
|
+
- `feature/*` - Individual feature branches
|
|
17
|
+
|
|
18
|
+
## Conventional Commits
|
|
19
|
+
|
|
20
|
+
All commits must follow [Conventional Commits](https://www.conventionalcommits.org/) specification:
|
|
21
|
+
|
|
22
|
+
### Commit Types and Version Impact:
|
|
23
|
+
- `feat:` - New feature → **MINOR** version bump (1.3.0 → 1.4.0)
|
|
24
|
+
- `fix:` - Bug fix → **PATCH** version bump (1.3.0 → 1.3.1)
|
|
25
|
+
- `perf:` - Performance improvement → **PATCH** version bump
|
|
26
|
+
- `feat!:` or `BREAKING CHANGE:` → **MAJOR** version bump (1.3.0 → 2.0.0)
|
|
27
|
+
- `docs:`, `style:`, `refactor:`, `test:`, `chore:` - No version bump
|
|
28
|
+
|
|
29
|
+
### Examples:
|
|
30
|
+
```bash
|
|
31
|
+
feat: add theme support with --theme option
|
|
32
|
+
fix: resolve dependency parsing error with special characters
|
|
33
|
+
feat!: change CLI interface for better usability
|
|
34
|
+
docs: update README with theme examples
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Automated Release Process
|
|
38
|
+
|
|
39
|
+
### 1. Development Workflow
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Create feature branch from develop
|
|
43
|
+
git checkout develop
|
|
44
|
+
git pull origin develop
|
|
45
|
+
git checkout -b feature/add-theme-support
|
|
46
|
+
|
|
47
|
+
# Make changes and commit using conventional commits
|
|
48
|
+
git add .
|
|
49
|
+
git commit -m "feat: add theme system with dark/light modes"
|
|
50
|
+
git push origin feature/add-theme-support
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Create Pull Request to Develop
|
|
54
|
+
|
|
55
|
+
Create a pull request from your feature branch to `develop`:
|
|
56
|
+
- Title: Clear description of the feature
|
|
57
|
+
- Description: Details of changes and any breaking changes
|
|
58
|
+
- Ensure all tests pass in CI
|
|
59
|
+
|
|
60
|
+
### 3. Merge to Develop
|
|
61
|
+
|
|
62
|
+
Once the PR is reviewed and approved, merge it into `develop`.
|
|
63
|
+
|
|
64
|
+
### 4. Release to Master
|
|
65
|
+
|
|
66
|
+
When ready for a release:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Create release PR from develop to master
|
|
70
|
+
git checkout develop
|
|
71
|
+
git pull origin develop
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Create a pull request from `develop` to `master`:
|
|
75
|
+
- Title: "Release: Prepare for next version"
|
|
76
|
+
- Description: Summary of changes since last release
|
|
77
|
+
- List any breaking changes
|
|
78
|
+
|
|
79
|
+
### 5. Automated Release (Master Branch)
|
|
80
|
+
|
|
81
|
+
When the release PR is merged to `master`, the automation triggers:
|
|
82
|
+
|
|
83
|
+
1. **python-semantic-release analyzes commits** since the last release
|
|
84
|
+
2. **Determines version bump** based on conventional commit types
|
|
85
|
+
3. **Updates version** in `pyproject.toml`
|
|
86
|
+
4. **Generates CHANGELOG.md** from commit messages
|
|
87
|
+
5. **Creates Git tag** with new version
|
|
88
|
+
6. **Builds package** using `python -m build`
|
|
89
|
+
7. **Publishes to PyPI** automatically
|
|
90
|
+
8. **Creates GitHub release** with generated release notes
|
|
91
|
+
|
|
92
|
+
## Manual Release (Emergency)
|
|
93
|
+
|
|
94
|
+
For emergency releases or manual intervention:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Install semantic-release locally
|
|
98
|
+
uv sync --dev
|
|
99
|
+
|
|
100
|
+
# Preview what will be released (dry-run)
|
|
101
|
+
uv run semantic-release --dry-run
|
|
102
|
+
|
|
103
|
+
# Force a specific version type
|
|
104
|
+
uv run semantic-release --patch # or --minor, --major
|
|
105
|
+
|
|
106
|
+
# Generate changelog only
|
|
107
|
+
uv run semantic-release changelog
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Monitoring Releases
|
|
111
|
+
|
|
112
|
+
### Check Release Status:
|
|
113
|
+
1. **GitHub Actions**: Monitor the [release workflow](https://github.com/dyka3773/mvn-tree-visualizer/actions)
|
|
114
|
+
2. **PyPI**: Verify new version appears on [PyPI](https://pypi.org/project/mvn-tree-visualizer/)
|
|
115
|
+
3. **GitHub Releases**: Check [GitHub releases page](https://github.com/dyka3773/mvn-tree-visualizer/releases)
|
|
116
|
+
|
|
117
|
+
### Troubleshooting:
|
|
118
|
+
|
|
119
|
+
**Failed Release:**
|
|
120
|
+
- Check GitHub Actions logs for specific errors
|
|
121
|
+
- Verify conventional commit format in recent commits
|
|
122
|
+
- Ensure GITHUB_TOKEN has sufficient permissions
|
|
123
|
+
- Check PyPI trusted publishing configuration
|
|
124
|
+
|
|
125
|
+
**No Version Bump:**
|
|
126
|
+
- Ensure commits follow conventional commit format
|
|
127
|
+
- Check that commits include `feat:` or `fix:` types
|
|
128
|
+
- Verify commits are not filtered out by semantic-release config
|
|
129
|
+
|
|
130
|
+
## Configuration
|
|
131
|
+
|
|
132
|
+
The release behavior is configured in `pyproject.toml`:
|
|
133
|
+
|
|
134
|
+
```toml
|
|
135
|
+
[tool.semantic_release]
|
|
136
|
+
version_toml = ["pyproject.toml:project.version"]
|
|
137
|
+
build_command = "python -m build"
|
|
138
|
+
upload_to_pypi = true
|
|
139
|
+
upload_to_release = true
|
|
140
|
+
|
|
141
|
+
[tool.semantic_release.commit_parser_options]
|
|
142
|
+
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"]
|
|
143
|
+
minor_tags = ["feat"]
|
|
144
|
+
patch_tags = ["fix", "perf"]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Migration from Manual Process
|
|
148
|
+
|
|
149
|
+
**Previous manual steps no longer needed:**
|
|
150
|
+
- ❌ Manual version updates in `pyproject.toml`
|
|
151
|
+
- ❌ Manual CHANGELOG.md editing
|
|
152
|
+
- ❌ Manual Git tag creation
|
|
153
|
+
- ❌ Manual PyPI uploads
|
|
154
|
+
|
|
155
|
+
**New automated process:**
|
|
156
|
+
- ✅ Conventional commit messages
|
|
157
|
+
- ✅ Automatic version management
|
|
158
|
+
- ✅ Automatic changelog generation
|
|
159
|
+
- ✅ Automatic PyPI publishing
|
|
160
|
+
- ✅ Automatic GitHub releases
|
|
161
|
+
|
|
162
|
+
## Emergency Procedures
|
|
163
|
+
|
|
164
|
+
### Rollback a Release:
|
|
165
|
+
```bash
|
|
166
|
+
# Revert the problematic release commit
|
|
167
|
+
git revert <release-commit-hash>
|
|
168
|
+
|
|
169
|
+
# Push to master to trigger new patch release
|
|
170
|
+
git push origin master
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Hotfix Process:
|
|
174
|
+
```bash
|
|
175
|
+
# Create hotfix branch from master
|
|
176
|
+
git checkout master
|
|
177
|
+
git checkout -b hotfix/critical-bug-fix
|
|
178
|
+
|
|
179
|
+
# Make minimal fix
|
|
180
|
+
git commit -m "fix: resolve critical security vulnerability"
|
|
181
|
+
|
|
182
|
+
# Create PR directly to master (bypass develop for emergencies)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
This automated approach ensures consistent, reliable releases while reducing manual effort and human error.
|