refactor: restore root-level development workflow with enhanced tooling
- Add root package.json with development scripts and dependencies - Move scripts/ from lib back to root for intuitive developer experience - Clean lib/package.json to contain only runtime dependencies - Add comprehensive justfile with cross-platform command shortcuts - Update README.md with new development workflow instructions - Maintain lib as clean, publishable package while enabling root-level commands
This commit is contained in:
50
README.md
50
README.md
@@ -63,28 +63,55 @@ Containers with `class="insertr"` automatically make their viable children edita
|
||||
|
||||
## 🛠️ Quick Start
|
||||
|
||||
### **Development Setup**
|
||||
### **Using Just (Recommended)**
|
||||
```bash
|
||||
# Clone and setup
|
||||
git clone <repository-url>
|
||||
cd insertr
|
||||
|
||||
# Install dependencies and start development
|
||||
just dev-setup
|
||||
|
||||
# Or step by step:
|
||||
just install # Install all dependencies
|
||||
just build-lib # Build the JavaScript library
|
||||
just dev # Start development server
|
||||
```
|
||||
|
||||
### **Using NPM directly**
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone <repository-url>
|
||||
cd insertr
|
||||
|
||||
# Install dependencies
|
||||
npm run install:all
|
||||
|
||||
# Start development server with live reload
|
||||
cd insertr-cli
|
||||
air
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Visit **http://localhost:3000** to see enhanced demo site with live reload.
|
||||
|
||||
### **Available Commands**
|
||||
```bash
|
||||
just --list # Show all available commands
|
||||
just dev # Start development server
|
||||
just build # Build library + CLI
|
||||
just air # Start Air hot-reload for CLI
|
||||
just check # Validate project setup
|
||||
just clean # Clean build artifacts
|
||||
```
|
||||
|
||||
### **Parse Existing Site**
|
||||
```bash
|
||||
cd insertr-cli
|
||||
|
||||
# Analyze HTML for editable elements
|
||||
go run main.go parse ../demo-site/
|
||||
just parse
|
||||
# or: cd insertr-cli && go run main.go parse ../demo-site/
|
||||
|
||||
# Development server with parsing
|
||||
go run main.go servedev -i ../demo-site -p 3000
|
||||
just servedev
|
||||
# or: cd insertr-cli && go run main.go servedev -i ../demo-site -p 3000
|
||||
```
|
||||
|
||||
## 📊 Parser Output Example
|
||||
@@ -180,10 +207,13 @@ Static Site Build → Insertr CLI Enhancement → Enhanced Deployment
|
||||
|
||||
### **Live Development with Hot Reload**
|
||||
```bash
|
||||
cd insertr-cli
|
||||
|
||||
# 🔥 Hot Reload: watches BOTH library AND CLI
|
||||
air
|
||||
just air
|
||||
# or: cd insertr-cli && air
|
||||
|
||||
# Alternative: Watch library only
|
||||
just watch
|
||||
# or: cd lib && npm run dev
|
||||
|
||||
# Library changes: lib/src/**/*.js → Auto rebuild library + CLI
|
||||
# CLI changes: cmd/**/*.go → Auto rebuild CLI
|
||||
|
||||
Reference in New Issue
Block a user