warren

Tool for discovering and developing Rabbita applications

live reload
web
rabbita
moon add moonbit-community/warren@0.2.4
Download zip
Version
0.2.4
License
Apache-2.0
Last updated
3 days ago
Downloads
309
README

#warren

warren helps you preview and build MoonBit web applications.

Use it during development for a local browser preview with live reload, and use it before publishing to create a static output directory.

#Install

Install with Moon:

moon install moonbit-community/warren

This gives you the warren command.

#New Project

Create a Rabbita app:

warren new my-app cd my-app warren dev

Choose the smaller bundled template when needed:

warren new my-app --template minimized

#Development Preview

Run inside your app directory:

warren dev

Then open the printed local URL in your browser.

By default, warren dev uses:

  • ./main as the main package directory when it exists
  • the current directory otherwise
  • ./public for static files when it exists
  • port 4300

You can also choose the main package, static files directory, or port:

warren dev path/to/main --public-dir path/to/public --port 4301

To serve the application directly as the top-level page instead, use:

warren dev --direct

Direct mode keeps live reload but does not load the Warren development UI. It is useful for applications that depend on top-level navigation, browser APIs, or end-to-end tests without an iframe.

If the port is already used by a previous warren preview, warren will stop it and continue. If another program is using the port, stop that program manually or choose a different port.

#Release Build

warren build

By default, warren build builds:

  • ./main when it exists
  • the current directory otherwise

You can also pass the main package directory explicitly:

warren build path/to/main

The build output is written to ./dist by default. You can choose another output path:

warren build --dist path/to/dist warren build path/to/main --dist path/to/dist

If public/ exists next to the app directory, its contents are copied into the output directory.

warren build tries to compress the generated JavaScript with terser. If terser is not available, it falls back to the uncompressed release JS.

#public/ Directory

public/ is optional.

If you want to customize the page, create public/ next to your app's main package and add:

  • public/index.html
  • public/styles.css

Common usage:

  • Add public/index.html if you want to control the page structure
  • Add public/styles.css if you want custom styles
  • Both files are optional

When public/index.html is present, warren keeps your page and adds the app entry script when needed. When it is not present, warren creates a default page.

#Help

warren --help warren new --help warren dev --help warren build --help

#
DefaultFixture

pub struct DefaultFixture {
main : MainFixture
public : PublicFixture
moon_mod : String
readme_md : String
}

#
MainFixture

pub struct MainFixture {
main_mbt : String
moon_pkg : String
}

#
MinimizedFixture

pub struct MinimizedFixture {
main_mbt : String
moon_mod : String
moon_pkg : String
}

#
PublicFixture

pub struct PublicFixture {
index_html : String
styles_css : String
}

#
TemplateEntry

type TemplateEntry

#
TemplatesFixture

pub struct TemplatesFixture {
default : DefaultFixture
minimized : MinimizedFixture
}

#
build_project

#
debug_log

fn debug_log(tag : String, msg : String) -> Unit

#
templates

let templates : TemplatesFixture

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io