Blaze Monorepo

website·Indexed 31 days ago

https://blaze-monorepo.dev/

A monorepo management tool featuring workspace and project configurations defined via JSON schemas. Blaze provides capabilities for declaring targets, managing dependencies, implementing caching strategies, and executing commands across multiple projects. It supports custom executors written in Node.js and Rust, and includes built-in executors for npm and Cargo.

Tokens
17.9K
Snippets
104
Records
147
Agent score
48%

What's inside Blaze

  1. Overview of Blaze monorepo management

    Blaze is a performance-oriented monorepo tool written in Rust designed to manage dependencies between projects and facilitate collaboration across teams. It supports parallel task execution and is language-agnostic, meaning it works with any language or framework without requiring changes to the application code.
  2. Display project information for the workspace

    The workspace command displays information about projects within a workspace. By default, it prints a table containing the project's name, description, relative path from the workspace root, and declared tags for all projects.
    workspace
  3. Understand the monorepo concept

    A monorepo is a version control strategy where all code and assets for every component of a project (e.g., web apps, servers, design systems) are stored in a single repository rather than separate repositories for each component. This approach provides several advantages:

    • Reusability: Easier sharing of libraries, tools, and CI/CD parts across projects.
    • Simplicity: Only one repository to sync, simplifying integration and deployment.
    • Dependency Management: Easier coordination of dependencies between projects during development.
    • Collaboration: Improved team collaboration as all projects reside in one place.
    • Versioning: Enables atomic commits across multiple projects.
    ├── my-company/
    |   ├── web-app/
    |   |   ├── src/
    |   ├── server/
    |   |   ├── src/
    |   ├── design-system/
    |   |   ├── src/
    ├── .git/
  4. Blaze build system overview

    Blaze is a fast, flexible, and free build system written in Rust. Its primary purpose is to efficiently run multiple tasks across a monorepo, though it can also be used for general task running and productivity tooling.

    Key features include:

    • Fully configurable cache
    • Task parallelization
    • Support for JSON, YAML, and Jsonnet with advanced templating
    • A flexible plugin system for executing tasks.
  5. Resolve executors from Git repositories

    Blaze allows you to resolve an executor from any Git repository. This supports various transport protocols to fetch the required executor logic from a remote repository.
  6. Define project targets in project.json

    Each project in the workspace has its own project.json file containing targets. A target represents a unit of work (e.g., build, test, deploy). Each target configuration includes:

    • The executor to run the code (standard or custom).
    • Dependencies on other targets (e.g., web-app:build depending on design-system:build).
    • Cache configuration to determine if the target needs to be re-executed.
  7. Display target information for a project using the CLI

    Use the project command to display information about targets within a specific project. By default, the output is a table containing the target's name, description, and a summary of its dependencies. You can optionally filter the output to specific targets or use a summary view that lists only target names line-by-line.
    # General syntax
    project [-s | --summary] <PROJECT> [<TARGETS>]...
    
    # Example: Describe all targets in 'my-project'
    project my-project
    
    # Example: Describe specific targets in 'my-project'
    project my-project target1 target2
    
    # Example: Display only target names for 'my-project'
    project --summary my-project
  8. Create custom Blaze executors using Node.js

    Custom Blaze executors can be developed using the Node.js JavaScript runtime, allowing for extensible execution logic within the Blaze monorepo environment.
  9. Understand and use Blaze executors

    An executor in Blaze is a piece of code that defines how to execute a target. Every target defined in a project must reference an executor. Executors are categorized into two types: Standard executors (provided out-of-the-box) and Custom executors (user-defined and resolvable from various sources).
  10. Use the `describe` CLI command to get workspace information

    The describe command is used to display information about the workspace. It requires a subcommand to specify the type of item to be described. Each subcommand may support its own specific options.
    describe <SUBCOMMAND>
  11. Execute system commands using the std:commands executor

    The std:commands executor allows you to run system-level commands as part of your build or task pipeline within the Blaze monorepo.
  12. Develop custom Blaze executors using Node.js

    Custom Blaze executors can be implemented using the Node.js JavaScript runtime, allowing developers to extend the build system's execution capabilities with custom logic.