diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71f5b99..59742ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,74 @@ Thank you for your interest in contributing to MetaSSR! We welcome contributions from the community to help improve and expand the framework. Please follow the guidelines below to ensure your contributions are effective and align with the project's goals. +## Table of contents +- [Development Setup](#development-setup) +- [How to Contribute](#how-to-contribute) + +## Development Setup + +To set up your development environment for MetaSSR, choose one of the following methods based on your preferences and system configuration: + +### Nix Flake (Recommended) + +The fastest way to get started with a fully configured development environment: + +1. **Install Nix** (if not already installed): + ```bash + sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon + ``` + +2. **Enable Nix Flakes**: + ```bash + mkdir -p ~/.config/nix + echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf + ``` + +3. **Enter Development Shell**: + ```bash + nix develop + ``` + +This will automatically set up Rust, MetaCall, and all required dependencies in an isolated environment. + + + + +### Manual Installation + +If you prefer to set up dependencies manually: + +1. **Install Rust Toolchain**: + ```bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + source ~/.cargo/env + ``` + +2. **Install MetaCall Runtime**: + ```bash + curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh + ``` + +3. **Clone and Build**: + ```bash + git clone https://github.com/metacall/metassr.git + cd metassr + cargo build --release + ``` + +4. **Verify Installation**: + ```bash + cargo test + ./target/release/metassr --help + ``` + ## How to Contribute ### 1. Reporting Issues @@ -36,7 +104,7 @@ To contribute code, follow these steps: ```bash git add . - git commit -m "Add feature: Description of the feature" + git commit -m "feat: Description of the feature" ``` 7. **Push Changes**: Push your changes to your forked repository: @@ -83,7 +151,7 @@ also, you can test one of web applications that located at [tests](../../tests/) **Example:** ```bash -$ cargo run --bin metassr-cli -- --root=tests/web-app --debug-mode=all run +$ cargo run --bin metassr -- --root=tests/web-app --debug-mode=all run ``` @@ -96,4 +164,3 @@ Please adhere to our [Code of Conduct](code-of-conduct.md) while participating i If you have any questions or need assistance, feel free to reach out to us through the project's [discussion forum](https://github.com/metacall/metassr/discussions) or open an issue. Thank you for contributing to MetaSSR! - diff --git a/README.md b/README.md index a221895..d005957 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,23 @@ docker run --rm -it metacall/metassr:dev bash ### Nix -```sh -TODO -``` +1. **Install Nix** (if not already installed): + ```bash + sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon + ``` + +2. **Enable Nix Flakes**: + ```bash + mkdir -p ~/.config/nix + echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf + ``` + +3. **Enter Development Shell**: + ```bash + nix develop + ``` + +This will automatically set up Rust, MetaCall, and all required dependencies in an isolated environment. ## Code of Conduct @@ -80,4 +94,4 @@ To ensure a positive and inclusive environment, please review our [Code of Condu ## License -MetaSSR is licensed under the [MIT License](LICENSE). See the LICENSE file for more details. +MetaSSR is licensed under the [MIT License](LICENSE). See the LICENSE file for more details. \ No newline at end of file diff --git a/crates/metassr-watcher/src/lib.rs b/crates/metassr-watcher/src/lib.rs index d94e3c7..10f7656 100644 --- a/crates/metassr-watcher/src/lib.rs +++ b/crates/metassr-watcher/src/lib.rs @@ -2,7 +2,7 @@ pub mod utils; use notify::RecursiveMode; use notify_debouncer_full::{self, DebounceEventResult, DebouncedEvent}; -use std::{ path::Path, time::Duration}; +use std::{path::Path, time::Duration}; use tokio::sync::broadcast; use utils::{format_event, is_relevant_event}; diff --git a/metassr-cli/src/cli/builder.rs b/metassr-cli/src/cli/builder.rs index e979f33..780a1e2 100644 --- a/metassr-cli/src/cli/builder.rs +++ b/metassr-cli/src/cli/builder.rs @@ -63,13 +63,11 @@ impl Exec for Builder { ); } - if (_metacall)() == 0 { - info!( - target = "builder", - message = "Building is completed", - time = format!("{}ms", instant.elapsed().as_millis()) - ); - } + info!( + target = "builder", + message = "Building is completed", + time = format!("{}ms", instant.elapsed().as_millis()) + ); Ok(()) }