Skip to content

aduki-org/word

Repository files navigation

Native Web Word Processor

A high-performance, extensible word processor built with native web technologies and powered by Rolldown for ultra-fast builds.

Features

  • 🚀 Native web components (no frameworks)
  • Rolldown bundling - Ultra-fast Rust-based bundler
  • 📝 Rich text editing with modern APIs
  • 🎨 Customizable themes (light/dark)
  • 💾 Local storage with IndexedDB
  • 🔍 Search and replace
  • ✅ Spell checking
  • 📊 Real-time word count
  • 🖨️ Print and export support
  • 🧩 Extensible plugin system
  • 🦀 WebAssembly-powered performance

Quick Start

  1. Clone or download this project
  2. Open a terminal in the project directory
  3. Install dependencies:
    npm install
  4. Start the development server:
    npm run dev
  5. Open http://localhost:8000 in your browser

Quick Start

  1. Clone or download this project
  2. Open a terminal in the project directory
  3. Install dependencies:
    npm install
  4. Start the development server:
    npm run dev
  5. Open http://localhost:8000 in your browser

Build System

This project uses Rolldown - an ultra-fast Rust-based JavaScript bundler that provides lightning-fast builds and optimal performance.

Development

# Standard development server
npm run dev              # Simple file server (fastest startup)
npm start               # Alias for dev

# Development with bundling
npm run dev:bundle      # Rolldown + dev server (fast rebuilds)
npm run bundle:dev      # Development bundle only
npm run bundle:watch    # Watch mode with auto-rebuild

Production Builds

# Full production build
npm run build:prod      # Complete optimized build

# Rolldown-only bundling
npm run bundle:prod     # Production bundle (minified, optimized)
npm run bundle:analysis # Bundle analysis with size reports

Build Modes

# Integrated builds (full pipeline + bundling)
npm run build           # Standard build
npm run build:dev       # Development build with Rolldown
npm run build:rolldown  # Build with Rolldown bundling
npm run build:analysis  # Build with bundle analysis

# Advanced options
npm run preview         # Preview production build
npm run clean          # Clean dist directory

Build Features

  • ⚡ Ultra-fast bundling with Rolldown (Rust-based)
  • 🔍 Tree shaking for optimal bundle size
  • 📦 Code splitting and chunk optimization
  • 🗺️ Source maps for development and debugging
  • 📊 Bundle analysis with detailed size reports
  • 🏗️ Modern ES modules with import/export
  • 🔧 Path aliases (@components, @utils, @styles)
  • 💎 Production optimization (minification, compression)

API

The word processor exposes a rich API for extensions:

// Get the editor instance
const editor = document.querySelector("word-editor");

// Basic operations
await editor.exec("bold");
await editor.exec("italic");
await editor.setContent("<p>Hello world</p>");
const content = editor.getContent();

// History
await editor.undo();
await editor.redo();

Rolldown Configuration

The bundler configuration is located in build/rolldown.config.js. Key features:

  • Multiple build modes: dev, prod, analysis
  • Path aliases: @components, @utils, @styles
  • Advanced chunking: Automatic code splitting
  • Tree shaking: Dead code elimination
  • Source maps: Inline (dev) or external (prod)
  • Asset optimization: File hashing and compression

Customizing the Build

// build/rolldown.config.js
export const rolldownConfig = {
  dev: {
    /* fast development builds */
  },
  prod: {
    /* optimized production builds */
  },
  analysis: {
    /* detailed bundle analysis */
  },
};

Performance

  • Build speed: ~30ms for full production builds
  • Bundle size: Highly optimized (example: 1.3KB main bundle)
  • Development: Near-instant rebuilds with watch mode
  • Modern output: ES2020+ with tree shaking

WebAssembly Integration

The project supports WebAssembly modules for performance-critical operations:

# Build WASM modules
npm run wasm:build      # Build Rust to WASM
npm run wasm:pack       # Package with wasm-pack

License

MIT

About

A high-performance, extensible word processor built with native web technologies and powered by Rolldown for ultra-fast builds.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors