momoka

    Create a minimal MoonBit module

    module
    Download zip
    Author
    Version
    0.7.4
    License
    AGPL-3.0
    Last updated
    3 days ago
    Downloads
    167

    #Momoka

    Create a minimal MoonBit module か?

    Momoka is a single MoonBit module, kokic/momoka, with two packages:

    DirectoryPackageTargetPurpose
    .kokic/momokanative, wasmshared CLI
    corekokic/momoka/coreanyshared pure logic, no I/O

    core holds the shared templates, settings resolution, and CLI definitions. The CLI shares argument parsing and project creation across both targets. Native builds read and save preferences in ~/.momoka/preferred.json; wasm builds use only command-line arguments and built-in defaults. Conditional compilation excludes preference file access and native-only commands from wasm builds.

    moon run --target native . -- --help moon run --target wasm . -- --help

    #Example

    # native: preferences are read from and saved to ~/.momoka/preferred.json momoka new your-great-project # or, cd <your-existing-project> momoka init # override project defaults for this invocation momoka new your-great-project --username alice --license MIT --host gitlab.com --target js momoka init --username alice # configure or print the saved defaults momoka cfg momoka cfg --show # upgrade all dependencies to their latest versions momoka upgrade # bump the patch version in moon.mod momoka bump # upgrade dependencies, bump the patch version if any changed, run moon check, then commit momoka evol # same, and when dependencies changed, commit on an update-dependencies branch and open a draft PR momoka evol --pr # process modules from separate repositories independently, continuing after failures momoka evol --orphan ../first-module ../second-module # stage all changes, commit a snapshot, and push momoka pin # install a specific MoonBit toolchain version momoka toolchain <version> # install the stable or nightly MoonBit toolchain momoka stable momoka nightly

    upgrade, bump, and evol look for moon.mod in each directory. When it is missing, they read moon.work and process every members entry as a module.

    evol treats all selected modules as one repository, whether selected explicitly or through moon.work. If any dependency changes, it bumps every selected module. It checks all selected modules before making a single commit at the repository root. With --orphan, each module is treated as a separate repository: only its own dependency changes trigger a bump, and a failure does not prevent other modules from being processed and committed. The command exits with an error if any module failed. With --pr, each successful PR creation is followed by git checkout main.

    #WASM

    The wasm build supports new and init only. It never reads or writes ~/.momoka; pass everything on the command line. --username falls back to guest when omitted.

    moon run --target wasm . -- new your-great-project --username alice --license MIT

    Run wasm builds with MoonBit's runtime (moon run / moonrun); the async library requires MoonBit host functions beyond standard WASI.

    #Help

    Usage: momoka <command> Create a minimal MoonBit module. Commands: new Create a new MoonBit module in a new directory. init Initialize a MoonBit module in an existing directory. upgrade Upgrade all dependencies of the project to their latest versions. bump Bump the patch version of the module in moon.mod. evol Upgrade dependencies, bump the patch version if any changed, then run moon check. pin Stage all changes, commit a snapshot, and push. toolchain Install a specified MoonBit toolchain version. stable Install the stable MoonBit toolchain. nightly Install the nightly MoonBit toolchain. cfg Configure default username / license / host / target, or print them. help Print help for the subcommand(s). Options: -h, --help Show help information. -V, --version Show version information.

    momoka toolchain <version> passes the version to the official MoonBit installer. Use latest for the stable release or nightly for the nightly build; momoka stable and momoka nightly remain shortcuts.

    The command list above is for native builds. Use momoka help <command> (or momoka <command> --help) for subcommand details. Both new and init support --username (-u), --license (-l), --host, and --target (-t). These options override the saved preferences for the current invocation without changing them. License, host, and target fall back to Apache-2.0, github.com, and native. Without --username or a saved username, Momoka prompts for one and saves it for future use. Use momoka cfg to configure default username, license, host, and target; press Enter to keep an existing value. Use momoka cfg --show to display all saved preferences.

    emph

    fn emph(String) -> String