CLI tool to identify SSR compatibility issues in Laravel Inertia Vue applications
Project description
InertiaSSRPrepper
A modern Python CLI tool that scans Laravel applications using Inertia.js and Vue 3 to identify potential Server-Side Rendering (SSR) compatibility issues.
๐ Table of Contents
- โจ Features
- ๐ก Why InertiaSSRPrepper?
- ๐ Installation
- ๐โโ๏ธ Quick Start
- ๐ Examples
- ๐ Usage
- ๐ Issue Categories
- ๐ค Output Formats
- ๐ ๏ธ Development
- ๐ค Contributing
- ๐ License
- ๐ Acknowledgements
โจ Features
- ๐ Scans your entire Laravel + Inertia.js + Vue 3 codebase for SSR compatibility issues
- ๐ซ Identifies 25+ common SSR problems with detailed pattern matching
- ๐จ Generates colorful, interactive reports in terminal, HTML, or JSON formats
- ๐ง Uses Claude 3.7 AI to provide tailored, contextual solutions for each issue
- โก Shows real-time progress with detailed statistics while scanning large codebases
- ๐ฆ Categorizes issues by severity (critical, major, medium, minor) for prioritization
- ๐ง Customizable ignore patterns and detection rules
- ๐ Supports interactive search and filtering in HTML reports
๐ก Why InertiaSSRPrepper?
Implementing Server-Side Rendering in an existing Laravel Inertia.js application can be challenging due to numerous client-side dependencies and browser-specific code patterns. InertiaSSRPrepper helps you:
- Identify SSR issues before they break your production app - Catch all potential SSR problems early
- Save hours of debugging time - Automatically find issues that would take days to discover manually
- Get expert solutions - Receive AI-powered suggestions for fixing each issue
- Plan your SSR migration - Prioritize fixes based on severity
- Improve overall code quality - Many SSR issues are also general best practices problems
๐ Installation
From source
# Clone this repository
git clone https://github.com/yourusername/inertiassrprepper.git
cd inertiassrprepper
# Install with uv
uv pip install -e .
# Or install with pip
pip install -e .
๐โโ๏ธ Quick Start
Scan your Laravel Inertia.js application in just one step:
# Basic scan with terminal output
inertiassr scan /path/to/your/laravel/app
# Generate HTML report with Claude AI suggestions
inertiassr scan /path/to/your/laravel/app --output report.html --api-key $ANTHROPIC_API_KEY
๐ Examples
Generate HTML Report
inertiassr scan /path/to/app --output report.html --api-key your-anthropic-key
Generate JSON Report
inertiassr scan /path/to/app --output report.json
Scan with Custom Ignore Patterns
inertiassr scan /path/to/app --ignore "*.test.js,*.spec.js,legacy/*"
Scan with Verbose Output
inertiassr scan /path/to/app --verbose
๐ Usage
Command-line Options
| Option | Description |
|---|---|
path |
Path to your Laravel + Inertia.js application (required) |
--api-key, -k |
Anthropic API key for Claude (can also use ANTHROPIC_API_KEY env var) |
--output, -o |
Output file path for report (defaults to stdout) |
--format, -f |
Report format: 'json' or 'html' (defaults to using file extension) |
--ignore, -i |
Additional glob patterns to ignore (already ignores .git, node_modules, vendor, public, storage, etc.) |
--verbose, -v |
Enable verbose output |
--no-verify |
Skip verification of Laravel Inertia app |
--max-files |
Maximum number of files to scan (for testing) |
--version |
Show version information and exit |
Environment Variables
ANTHROPIC_API_KEY: Your Anthropic API key for Claude integration
๐ Issue Categories
Click to expand issue categories
Issues are categorized by severity to help you prioritize fixes:
| Severity | Description |
|---|---|
| Critical | Issues that will completely break SSR functionality |
| Major | Issues likely to cause SSR rendering failures |
| Medium | Issues that may cause inconsistent SSR behavior |
| Minor | Issues that could cause subtle differences between SSR and client rendering |
Critical Issues
- Browser API usage (
window,document,navigator, etc.) - Direct DOM manipulation (
document.getElementById, etc.) - Client-side only libraries (jQuery, etc.)
Major Issues
- Incorrect lifecycle hooks (Vue 2 style instead of Vue 3 Composition API)
- Improper Inertia.js imports
- Legacy Vue instance creation
- Direct event listener attachment
- Dynamic component loading without proper handling
Medium Issues
- Incorrect Inertia props access
- Meta tag manipulation
- Timer functions without proper cleanup
- Missing key attributes on v-for loops
- Component registration issues
Minor Issues
- Import path case sensitivity issues
- Browser-specific CSS features
- Inline scripts in templates
- Third-party script tags
๐ค Output Formats
Terminal Output
- Colorful, interactive report in the terminal
- Tables showing issues grouped by file
- Issues are color-coded by severity
- Syntax-highlighted code snippets
HTML Report
- Interactive HTML report with filters and search
- Collapsible file sections
- Color-coded severities
- Syntax highlighting for code snippets
- Statistics and charts
- Browser-compatible simplified HTML report for maximum compatibility
JSON Report
- Structured JSON data for further processing
- Includes full issue details, file paths, line numbers, and solutions
- Compatible with other tools and integrations
Example Terminal Report
โญโโโ SSR Compatibility Scan Summary โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ SSR Compatibility Scan Complete โ
โ Found 24 potential issues in 8 files โ
โ โ
โ โโโโโโโโโโโโโโฌโโโโโโโโ โ
โ โ Total Issuesโ 24 โ โ
โ โ Files with Issuesโ 8 โ โ
โ โ Issue Typesโ 12 โ โ
โ โโโโโโโโโโโโโโดโโโโโโโโ โ
โ โ
โ โโโโโโโโ Issues by Severity โโโโโโโโโ โ
โ โ Severity โ Count โ Percentage โ Distribution โ
โ โ Critical โ 8 โ 33.3% โ โโโโโโโโโโโโโโโโ โ
โ โ Major โ 10 โ 41.7% โ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Medium โ 4 โ 16.7% โ โโโโโโโโ โ
โ โ Minor โ 2 โ 8.3% โ โโโโ โ
โ โโโโโโโโโโโโโดโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
๐ ๏ธ Development
Setup Development Environment
# Clone the repository
git clone https://github.com/yourusername/inertiassrprepper.git
cd inertiassrprepper
# Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
uv pip install -e ".[dev]"
Running Tests
pytest
Linting
ruff check
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgements
Made with โค๏ธ for the Laravel and Inertia.js community
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inertiassrprepper-0.1.1.tar.gz.
File metadata
- Download URL: inertiassrprepper-0.1.1.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab8813e3d64911e37f58c71236ad44f7a96a7ea07cb1c55c54a4b2f08c5a89a0
|
|
| MD5 |
4bac381c1adb21f54d07dcfa8e928e86
|
|
| BLAKE2b-256 |
a48e1ef00621367ce9fdd75b9215199348100b5e67a816244b1f0977d8276bbe
|
File details
Details for the file inertiassrprepper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: inertiassrprepper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 32.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4d527696a5f4624b60c695086c9e266395118a93b249bb96ceb8dcebff29b07
|
|
| MD5 |
1118e8ad50d4c3c1f9b95318c4ea6267
|
|
| BLAKE2b-256 |
b27981ce70531f797c666d267e401ae110385de49fb46a45d480e4cafc8598da
|