klenod.

Ruby module bundler

Build Ruby modules like a modern frontend graph.

Klenod brings an ES Module-inspired import system to Ruby. Those imports create a dependency graph for development updates, production bundles, and every file type your plugins understand.

module.rb
Card = import("./Card.haml")
Styles = import("./Card.css")
Logo = import("./logo.svg")
Config = import("./config.toml")
01 gem install klenod— Install
02 klenod build— Build
03 klenod graph dist/klenod.bundle— Inspect
Getting started →
01

Imports define the graph

Ruby modules use import calls inspired by ES Modules. Each resolved import becomes an explicit dependency in the application graph.

02

Development stays live

When a source file changes, Klenod updates that part of the graph and invalidates its dependents. Modules evaluate again only when the application needs them.

03

Build-time dependencies stay behind

Production mode loads the serialized graph with klenod-runtime. Build plugins, compilers, and their dependencies do not need to ship with the application.

04

Any file can be a module

Plugins define how files resolve, transform, and appear at runtime. Plugins make it possible to import Haml, CSS, JavaScript, images, data, or your own formats.

Architecture

One graph. Clear phases.

Collect before evaluation

Klenod can read imports, transform sources, and emit assets without running application code.

Relative by default

Imports resolve from the module that declares them. Canonical module IDs keep every dependency unambiguous.

Framework-neutral

Plugins adapt source files to components and runtime values. Rendering and application policy stay with the framework.

Inspectable output

Export the graph, follow source maps, and see which modules and assets are reachable from an entrypoint.

Ready to build

Build your first Klenod-app.

Start with one Ruby entrypoint, import a dependency, and add plugins as the application grows.