Skip to content

BouyguesTelecom/static.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StaticJS

A modern static site generator for React applications with smart revalidation and hot reloading.

Features

  • ⚑ Fast static site generation with React & TypeScript
  • πŸ”„ WebSocket-based hot reloading during development
  • 🎯 Smart page revalidation - rebuild specific pages without full rebuilds
  • πŸ› οΈ Simple CLI commands
  • πŸ“¦ Optimized production builds with Vite

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 7.0.0

Installation

npm install @bouygues-telecom/staticjs -g

Quick Start

Create a new project

create-staticjs-app
cd your-project
npm install

Development

npm run dev

Your site will be available at http://localhost:3000

Production

npm run build
npm run start

Production server runs at http://localhost:3456

CLI Commands

  • static dev - Start development server with hot reload
  • static build - Build static site for production
  • static start - Serve built files in production mode

See CLI_USAGE.md for detailed command documentation.

Project Structure

your-project/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/          # Your pages
β”‚   β”œβ”€β”€ components/     # Reusable components
β”‚   β”œβ”€β”€ styles/         # Style files
β”‚   └── app.tsx         # App entry point
β”œβ”€β”€ _build/             # Generated static files
└── static.config.ts    # Configuration

Revalidation API

Rebuild specific pages without a full rebuild:

curl -X POST http://localhost:3000/revalidate \
  -H "Content-Type: application/json" \
  -d '{ "paths": ["home.tsx", "about.tsx"] }'

Development Setup (Monorepo)

For contributors working on the StaticJS library itself:

npm install
node setup-dev.js

This sets up the development environment with local package linking.

License

MIT


Built with ❀️ by Bouygues Telecom

About

Transform your React app into minimalist static files πŸš€

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •