Skip to content

rolo-kit/rolo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

125 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rolo

Build and Check Prettier Lint

Rolo is a modern CLI tool designed to streamline your web development workflow. It provides fast project initialization, hot module reloading (HMR), and quick build capabilities for efficient development.

Features

  • Project Initialization (init): Instantly scaffold new projects with best practices and ready-to-go templates.
  • Hot Module Reloading (HMR): Experience lightning-fast updates in your development environment without full page reloads.
  • Quick Builds: Build your projects rapidly with optimized configurations for both development and production.
  • Template Support: Choose from React and Vanilla JS templates to kickstart your project.
  • Easy CLI Commands: Simple and intuitive commands for all major actions.
  • Easy Configuration: Manage extension settings and permissions easily with rolo config for robust, safe, and interactive project configuration.

Getting Started

  1. Install Rolo (if published to npm):

    npm install -g rolo-cli
  2. Initialize a New Project:

    rolo init
  3. Start Development Server with HMR:

    rolo dev
  4. Build Your Project:

    rolo build

Running Rolo Locally (Development)

To run and test the Rolo CLI locally, use Node.js 20. Follow these steps:

  1. Install dependencies (from the project root):

    cd packages/cli
    npm install
  2. Build the CLI package:

    cd packages/cli
    npm run build --workspace=cli
  3. Link the CLI globally (so you can use rolo from anywhere):

    cd packages/cli
    npm link
  4. Verify Node.js version (should be 20):

    node -v
    # v20.x.x
  5. rolo config [] Command

The rolo config command lets you safely update, merge, append, or remove keys in your rolo.config.json for your extension project. It supports both interactive and non-interactive usage, robust value parsing, and safe merging for arrays and objects.

Usage:

rolo config [options]

Options:

  • -k, --key <key>: Config key to set or remove
  • -v, --value <value>: Value to set for the key (supports JSON, arrays, or strings)
  • -a, --add: Append/merge value to existing array/object (deduplicates arrays)
  • -r, --remove: Remove a key from rolo.config.json

Examples:

  • Set a string value:
    rolo config -k name -v "My Extension"
  • Set an array (e.g., permissions):
    rolo config -k permissions -v '["storage","tabs"]'
  • Append to an array (deduplicates):
    rolo config -k permissions -v '["notifications"]' --add
  • Merge an object:
    rolo config -k options -v '{"foo":1}' --add
  • Remove a key:
    rolo config -r -k permissions

Best Practices:

  • Use JSON for complex values (arrays/objects).
  • Use --add to merge/append instead of replacing arrays/objects.
  • All config changes are safely merged and written to rolo.config.json.
  • You can also manually edit rolo.config.json in your project root if you prefer direct control.

You can now use the rolo command globally for local development and testing.


CLI Commands

  • rolo init – Scaffold a new project
  • rolo dev – Start development server with HMR
  • rolo build – Build the project for production
  • rolo config [options] – Update and manage your extension's configuration (see below)

Templates

  • React: Modern React setup with Vite
  • Vanilla JS: Lightweight vanilla JavaScript template

Build Status

Build and Check Prettier Lint


Contributing

We welcome contributions! To get started:

  1. Fork the repository on GitHub and clone your fork locally.
  2. Create a new branch for your feature or fix.
  3. Write documentation for your changes. You can use the rolo-generate-docs command to help generate or update documentation.
  4. Commit your changes and push your branch to your fork.
  5. Open a Pull Request (PR) to the main repository. Please ensure your code is well-documented and tested.
  6. Your PR will be reviewed by a maintainer. Once approved, it will be merged.

Thank you for helping improve Rolo!

About

Rolo: Framework for modern browser extensions

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors