mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
BREAKING CHANGE: Package paths have been reorganized for clarity ## Major Changes ### Package Structure - Collapsed engine/core → engine (removed unnecessary nesting) - Moved core/types → types (top-level types package) - Added root facade for single-import experience - Removed redundant factory.go ### SDK Improvements All SDKs now provide single-import interfaces: - Go: import "github.com/luxfi/consensus" - Python: import lux_consensus as consensus - Rust: use lux_consensus::* ### Documentation - Added comprehensive introduction and architecture docs - Created AI/ML integration guide for researchers - Added research section with papers and experiments - Improved sidebar organization and discoverability ### Benefits - Shallow, obvious import paths - One responsibility per package - DRY, composable, orthogonal design - Idiomatic patterns for each language - Consistent API across all SDKs This refactor provides a clean, intuitive developer experience where one import is enough and things work one way only.
71 lines
1.8 KiB
Bash
Executable File
71 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "🚀 Deploying Lux Consensus Documentation to GitHub Pages..."
|
|
|
|
# Colors for output
|
|
GREEN='\033[0;32m'
|
|
BLUE='\033[0;34m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Get repository information
|
|
REPO_URL=$(git remote get-url origin)
|
|
REPO_NAME=$(basename -s .git "$REPO_URL")
|
|
REPO_OWNER=$(echo "$REPO_URL" | sed -n 's/.*github.com[:/]\([^/]*\).*/\1/p')
|
|
|
|
echo -e "${BLUE}📦 Repository: ${REPO_OWNER}/${REPO_NAME}${NC}"
|
|
|
|
# Navigate to project root
|
|
cd "$(dirname "$0")/.."
|
|
|
|
# Check if docs/out exists
|
|
if [ ! -d "docs/out" ]; then
|
|
echo -e "${RED}❌ Error: docs/out directory not found${NC}"
|
|
echo "Please run 'scripts/build-docs.sh' first"
|
|
exit 1
|
|
fi
|
|
|
|
# Create temporary directory for deployment
|
|
TEMP_DIR=$(mktemp -d)
|
|
echo -e "${BLUE}📁 Using temp directory: ${TEMP_DIR}${NC}"
|
|
|
|
# Copy built site to temp directory
|
|
cp -r docs/out/* "$TEMP_DIR/"
|
|
|
|
# Initialize git in temp directory
|
|
cd "$TEMP_DIR"
|
|
git init
|
|
git config user.name "GitHub Actions"
|
|
git config user.email "[email protected]"
|
|
|
|
# Create CNAME file for custom domain (if needed)
|
|
echo "consensus.lux.network" > CNAME
|
|
|
|
# Add .nojekyll to prevent Jekyll processing
|
|
touch .nojekyll
|
|
|
|
# Commit all files
|
|
git add -A
|
|
git commit -m "Deploy documentation $(date '+%Y-%m-%d %H:%M:%S')"
|
|
|
|
# Force push to gh-pages branch
|
|
echo -e "${BLUE}📤 Pushing to gh-pages branch...${NC}"
|
|
git push -f "$REPO_URL" HEAD:gh-pages
|
|
|
|
# Clean up
|
|
cd - > /dev/null
|
|
rm -rf "$TEMP_DIR"
|
|
|
|
echo -e "${GREEN}✅ Documentation deployed successfully!${NC}"
|
|
echo -e "${GREEN}🌐 View at: https://${REPO_OWNER}.github.io/${REPO_NAME}${NC}"
|
|
echo -e "${GREEN}🌐 Or: https://consensus.lux.network${NC}"
|
|
|
|
# Optional: Open in browser
|
|
if command -v open &> /dev/null; then
|
|
read -p "Open in browser? (y/n) " -n 1 -r
|
|
echo
|
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
open "https://${REPO_OWNER}.github.io/${REPO_NAME}"
|
|
fi
|
|
fi |