Skip to main content

CLI tool to identify SSR compatibility issues in Laravel Inertia Vue applications

Project description

InertiaSSRPrepper

PyPI Python License Downloads

A modern Python CLI tool that scans Laravel applications using Inertia.js and Vue 3 to identify potential Server-Side Rendering (SSR) compatibility issues.

InertiaSSRPrepper Demo

๐Ÿ“‹ Table of Contents

โœจ 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

inertiassrprepper-0.2.2.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inertiassrprepper-0.2.2-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

Details for the file inertiassrprepper-0.2.2.tar.gz.

File metadata

  • Download URL: inertiassrprepper-0.2.2.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for inertiassrprepper-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a5ff8eece2192d2e03eb9e44c695fef2cb1015a911a4d18314011349eaa138af
MD5 8decaaf160a778a0da8679457a1b1f38
BLAKE2b-256 189829196b095b9ae3a2ac4e5fcd0ef2023b24edeacccdafa08952825511800f

See more details on using hashes here.

File details

Details for the file inertiassrprepper-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for inertiassrprepper-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 27e2418da6fec3a5f26424a0e3592b09f6bf7e856dcaa0acdc5b437b4e1b7b01
MD5 7340fbf5c7cb2830e917c6fe5b4b292b
BLAKE2b-256 f2f8aa1a40174b3f32912b5a0dfb3b362dc47bd57e270353d132d9b96fc382cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page