@akaoio/composer
v0.2.4
Published
Atomic document composition engine with real-time template processing
Maintainers
Readme
@akaoio/composer
A powerful, atomic documentation engine that builds comprehensive docs from small reusable content pieces. Self-documenting and production-ready for Node.js, Bun, Deno, and standalone server deployment.
✨ Features
Watch Mode
Automatic rebuilding when source files change, perfect for development workflows.
Template Engine
Built-in template engine with variable substitution supporting nested paths and array access.
Multi-Format Support
Seamlessly works with YAML, JSON, Markdown, HTML, and plain text files.
Flexible Build Pipeline
Configurable build tasks with custom processors for complex content transformations.
📦 Installation
Install via NPM
npm install @akaoio/composerInstall CLI Globally
npm install -g @akaoio/composerInstall via Deno
import { Composer } from "npm:@akaoio/composer@latest"Install via Bun
bun add @akaoio/composer🚀 Usage
Node.js Module Usage
const { Composer, BuildPipeline, ConfigLoader } = require('@akaoio/composer')
// Option 1: Simple usage
const composer = new Composer({
dataPath: './data',
templatesPath: './templates',
outputPath: './dist'
})
await composer.render()
// Option 2: Configuration-based
const loader = new ConfigLoader('./composer.config.js')
const config = await loader.loadConfig()
const pipeline = new BuildPipeline(config)
await pipeline.execute()Deno Module Usage
import { Composer, BuildPipeline } from "npm:@akaoio/composer@latest"
// Deno with permissions
const composer = new Composer({
dataPath: './data',
templatesPath: './templates',
outputPath: './dist'
})
await composer.render()Run with permissions:
deno run --allow-read --allow-write --allow-env your-script.tsBun Module Usage
import { Composer, BuildPipeline, ConfigLoader } from '@akaoio/composer'
// Bun with TypeScript support
const composer = new Composer({
dataPath: './data',
templatesPath: './templates',
outputPath: './dist'
})
await composer.render()
// Hot reload with Bun watch
import { watch } from 'fs'
composer.watch((outputs) => {
console.log(`Rebuilt ${outputs.size} files`)
})CLI Usage
# Initialize a new project
composer init
# Build documentation
composer build
# Watch for changes
composer watch
# Show help
composer help🖥️ Server Deployment
Quick Start Server
# Clone and setup
git clone https://github.com/akaoio/composer.git
cd composer
npm install
npm run build
# Run as daemon service
npm run service:pm2
# Or with systemd
sudo npm run service:installDocker Deployment
# Build image
docker build -f docker/Dockerfile.service -t composer-server .
# Run container
docker run -d \
-p 3000:3000 \
-v $(pwd)/data:/app/data \
-v $(pwd)/output:/app/output \
--name composer-server \
composer-serverHealth Monitoring
# Check service status
curl http://localhost:3000/health
# View build logs
curl http://localhost:3000/api/logs
# Trigger rebuild
curl -X POST http://localhost:3000/api/build🤝 Contributing
Development Setup
Clone and Setup
git clone https://github.com/akaoio/composer.git
cd composer
# Install dependencies
npm install # or `bun install` or `deno install`
# Build TypeScript
npm run build
# Run tests
npm test
# Build documentation (using composer itself!)
npm run build:docDevelopment Principles
When contributing, follow these core principles:
- Class = Directory + Method-per-file - Every class is a directory
- Atomic Documentation - Each piece of content is a separate YAML file
- Test-Driven Development - Write tests first, implementation second
- 100% Real Implementation - No mocks, stubs, or placeholder code
- Zero Technical Debt - Complete every task fully before moving on
- Self-Documenting - This README is generated using Composer itself!
📄 License
MIT
🔗 Links
- Repository: https://github.com/akaoio/composer
- NPM Package: https://www.npmjs.com/package/@akaoio/composer
- Documentation: Generated using Composer itself!
Generated with ❤️ by @akaoio/composer v0.2.3
This README demonstrates atomic documentation - every section is composed from individual YAML files in src/doc/readme/atom/
