Skip to content

Commit 5d485c9

Browse files
committed
Merge branch 'dev'
2 parents b821a30 + 7f3fcb4 commit 5d485c9

3 files changed

Lines changed: 411 additions & 12 deletions

File tree

CLAUDE.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
Mirror Web CLI v1.0 is a **professional website mirroring tool** with intelligent framework preservation capabilities. The tool features **comprehensive framework detection**, **beautiful modern terminal UI**, and **advanced asset optimization** for creating offline-ready websites.
7+
Mirror Web CLI v1.1.3 is a **professional website mirroring tool** with intelligent framework preservation capabilities. The tool features **comprehensive framework detection**, **beautiful modern terminal UI**, and **advanced asset optimization** for creating offline-ready websites.
88

9-
### **Version 1.0 - Production Ready Release**
9+
### **Version 1.1.3 - Enhanced Production Release**
1010

1111
- **🎯 Comprehensive JSDoc Documentation**: All modules fully documented with detailed API documentation, examples, and usage patterns
1212
- **🎨 Modern Terminal UI**: Professional gradient-based interface with progress tracking, animated spinners, and status cards
1313
- **⚡ Enhanced Framework Detection**: Supports 14+ frameworks with intelligent pattern matching and confidence scoring
1414
- **🔧 Professional Code Organization**: Well-structured modular architecture with clear separation of concerns
15-
- **📦 Complete Package Metadata**: Version 1.0.0 with comprehensive npm package configuration and platform support
15+
- **📦 Complete Package Metadata**: Version 1.1.3 with comprehensive npm package configuration and platform support
1616
- **🛡️ Security & Privacy**: Advanced tracking removal with comprehensive database of analytics and monitoring scripts
1717
- **🎥 Advanced Video Support**: Comprehensive video and audio handling with 14+ formats, extended timeouts, and proper URL rewriting
18+
- **🔧 Enhanced Environment Variable Loading**: Priority-based .env loading with shell environment preservation
19+
- **🚀 Next.js Image Optimizer Support**: Robust handling of Next.js image optimization endpoints with runtime asset rewriting
20+
- **🎯 Runtime Asset Rewriter**: DOM mutation observer for dynamic content and hover/popover asset capture
21+
- **📊 Microlink Integration**: Support for Microlink screenshot services and JSON endpoint resolution
1822

1923
## Common Commands
2024

@@ -663,6 +667,64 @@ node demo-claude-style.js
663667

664668
This showcases all available animations with exact Claude Code styling and timing.
665669

670+
## Latest Improvements (v1.1.3)
671+
672+
### Enhanced Environment Variable Loading System
673+
674+
**Priority-based Environment Loading** (`src/cli.js:25-48`):
675+
- **Shell Environment**: Highest priority (preserves existing shell variables)
676+
- **.env.local**: Overrides `.env` values but not shell variables
677+
- **.env**: Base configuration (lowest priority)
678+
679+
```javascript
680+
// Enhanced environment loading with priority preservation
681+
function loadEnvWithPriority() {
682+
const preexisting = new Set(Object.keys(process.env));
683+
684+
// Load base .env (lowest priority)
685+
dotenv.config({ path: '.env', override: false });
686+
687+
// Load .env.local, but preserve shell variables
688+
if (fs.existsSync('.env.local')) {
689+
const parsed = dotenv.parse(fs.readFileSync('.env.local'));
690+
for (const [k, v] of Object.entries(parsed)) {
691+
if (preexisting.has(k)) continue; // preserve shell vars
692+
process.env[k] = v;
693+
}
694+
}
695+
}
696+
```
697+
698+
### Next.js Image Optimizer Handling
699+
700+
**Robust Next.js Image Processing** (`src/core/asset-manager.js:50-54`):
701+
- **Automatic Detection**: Identifies `/_next/image` optimizer URLs
702+
- **Original Image Extraction**: Parses `url=` parameter to get source image
703+
- **Alias System**: Maps optimizer URLs to original files for offline compatibility
704+
- **HTTP 402 Avoidance**: Skips direct downloads of optimizer endpoints
705+
706+
### Runtime Asset Rewriter System
707+
708+
**Dynamic Asset Rewriting** (from CHANGELOG.md):
709+
- **DOM Mutation Observer**: Monitors dynamic content changes
710+
- **Comprehensive URL Rewriting**: Handles `src`, `href`, `poster`, `style` background-image
711+
- **Responsive Image Support**: Rewrites `srcset` and `imagesrcset` attributes
712+
- **Hover/Popover Content**: Captures dynamic preview content that appears on interaction
713+
714+
### Microlink Integration
715+
716+
**Microlink Screenshot Support**:
717+
- **JSON Endpoint Resolution**: Follows Microlink API to actual screenshot URLs
718+
- **Automatic Image Capture**: Downloads final image bytes for offline use
719+
- **Indirection Handling**: Resolves complex URL chains to final resources
720+
721+
### Automatic JavaScript Mode Selection
722+
723+
**Intelligent JS Handling** (`src/core/mirror-cloner.js:26-44`):
724+
- **Auto Mode**: Engine automatically decides JavaScript ON/OFF based on framework
725+
- **Preflight Analysis**: Determines optimal strategy before processing
726+
- **Framework-Specific Logic**: Different handling for React/Next.js vs static sites
727+
666728
## Troubleshooting
667729

668730
### Common Issues

0 commit comments

Comments
 (0)