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:
2025-09-08 18:16:34 +02:00
parent bc1dcdffbd
commit 91cf377d77
8 changed files with 2609 additions and 40 deletions

93
justfile Normal file
View File

@@ -0,0 +1,93 @@
# Insertr Development Commands
# Use `just <command>` to run any of these tasks
# Default recipe - show available commands
default:
@just --list
# Install all dependencies (root + lib)
install:
npm install
cd lib && npm install
# Start development server with live reload
dev:
npm run dev
# Start development server for about page
dev-about:
npm run dev:about
# Check project status and validate setup
check:
npm run dev:check
# Show demo instructions
demo:
npm run dev:demo
# Build the entire project (library + CLI)
build:
npm run build
# Build only the JavaScript library
build-lib:
npm run build:lib
# Watch library files for changes (auto-rebuild)
watch:
cd lib && npm run dev
# Start Air hot-reload for Go CLI development
air:
cd insertr-cli && air
# Build Go CLI only
build-cli:
cd insertr-cli && go build -o insertr
# Run CLI help
cli-help:
cd insertr-cli && go run main.go --help
# Parse demo site with CLI
parse:
cd insertr-cli && go run main.go parse ../demo-site/
# Start CLI development server
servedev:
cd insertr-cli && go run main.go servedev -i ../demo-site -p 3000
# Clean all build artifacts
clean:
rm -rf lib/dist
rm -rf insertr-cli/insertr
rm -rf node_modules
rm -rf lib/node_modules
# Lint code (placeholder for now)
lint:
npm run lint
# Run tests (placeholder for now)
test:
npm run test
# Development workflow: install deps, build lib, start dev server
dev-setup: install build-lib dev
# Production workflow: install deps, build everything
prod-build: install build
# Show project status
status:
@echo "🏗️ Insertr Project Status"
@echo "========================="
@echo "📁 Root files:"
@ls -la package.json justfile 2>/dev/null || echo " Missing files"
@echo "\n📚 Library files:"
@ls -la lib/package.json lib/src lib/dist 2>/dev/null || echo " Missing library components"
@echo "\n🔧 CLI files:"
@ls -la insertr-cli/main.go insertr-cli/insertr 2>/dev/null || echo " Missing CLI components"
@echo "\n🌐 Demo site:"
@ls -la demo-site/index.html demo-site/about.html 2>/dev/null || echo " Missing demo files"