Skip to content
Snippets Groups Projects
Commit 3608e95a authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

refactor repo architecture (!161)

## changelog
- `src/main.rs` has been moved to a new crate: `bins/saclin` which stands for **S**emi-**A**VID **CLI** in **N**ushell
- dependencies of `komodo` have been fixed
- Nushell and Rust tests have been split in the Makefile: by default, only Rust tests will run locally and Nushell tests and examples can be run manually if desired. The CI will still run everything.
- the README has been updated
- test images have been moved to `assets/`
- the majority of the old `./nu-utils/` module have been moved to internals of `./benchmarks/` and imports have been fixed
- `cargo.nu` has been moved to `./bins/` and a new `./bins/README.md` mentions it
- `./bins/saclin/` has been created and should be a self-contained Rust crate + Nushell module
parent 0977677f
No related branches found
No related tags found
1 merge request!161refactor repo architecture
Pipeline #5727 passed with stages
in 1 minute and 44 seconds
Showing
with 65 additions and 66 deletions
const MODULES = [ const MODULES = [
"nu-utils/math.nu",
"nu-utils/formats.nu",
"benchmarks/", "benchmarks/",
] ]
...@@ -9,8 +7,4 @@ def log-load [m: string] { ...@@ -9,8 +7,4 @@ def log-load [m: string] {
} }
log-load $MODULES.0 log-load $MODULES.0
use $MODULES.0 * use $MODULES.0
log-load $MODULES.1
use $MODULES.1 *
log-load $MODULES.2
use $MODULES.2
...@@ -16,15 +16,15 @@ rs_merkle = "1.4.1" ...@@ -16,15 +16,15 @@ rs_merkle = "1.4.1"
thiserror = "1.0.50" thiserror = "1.0.50"
tracing = "0.1.40" tracing = "0.1.40"
tracing-subscriber = "0.3.17" tracing-subscriber = "0.3.17"
# `main.rs` dependencies
ark-bls12-381 = "0.4.0"
rand = "0.8.5"
[workspace] [workspace]
members = [ members = [
"benchmarks", "benchmarks",
"bins/rank", "bins/rank",
"bins/saclin",
] ]
[dev-dependencies] [dev-dependencies]
ark-bls12-381 = "0.4.0"
itertools = "0.13.0" itertools = "0.13.0"
rand = "0.8.5"
.PHONY: fmt fmt-check check clippy test example show build-examples .PHONY: fmt fmt-check check clippy test-rs test-nu test example show build-examples
DEFAULT_GOAL: fmt-check check clippy test DEFAULT_GOAL: fmt-check check clippy test-rs
fmt-check: fmt-check:
cargo fmt --all -- --check cargo fmt --all -- --check
...@@ -14,15 +14,18 @@ check: ...@@ -14,15 +14,18 @@ check:
clippy: clippy:
cargo clippy --workspace --all-targets -- -D warnings cargo clippy --workspace --all-targets -- -D warnings
test: test-rs:
cargo test --workspace --verbose cargo test --workspace --verbose
cargo test --examples --verbose cargo test --examples --verbose
nu tests/cli.nu
nu tests/binary.nu test-nu:
nu tests/color.nu nu bins/saclin/tests/cli.nu
nu bins/saclin/tests/binary.nu
test: test-rs test-nu
example: example:
nu examples/cli.nu nu bins/saclin/examples/cli.nu
show: show:
rustup --version rustup --version
......
# Komodo: Cryptographically-proven Erasure Coding # Komodo: Cryptographically-proven Erasure Coding
## Usage
Komodo can either be used as a library or as a binary application.
## the library ## the library
see `cargo doc` see `cargo doc` or [the library itself](src/)
## the binary application ## the tests
below is an example of how to use the binary application with Nushell: ```shell
```bash make
./examples/cli.nu ```
or
```shell
make check clippy test-rs
``` ```
> **Note** ### some extra tests
> requires Nushell 0.95.0 or later this project defines some tests written in [Nushell](https://www.nushell.sh/) to test an
[implementation of Komodo in a CLI application](bins/saclin/).
tests for the binary application can also be run with If you have [Nushell installed](https://www.nushell.sh/book/installation.html), you can run these
```bash with the following command:
nu tests/cli.nu ```shell
make test-nu
``` ```
## other binaries ## examples
Komodo provides a bunch of other binaries that might be interesting of useful to use. A [CLI example](bins/saclin/examples/cli.nu) is also provided and can be run with
```shell
The easiest is to use the `cargo.nu` Nushell module as follows make example
```bash
use nu-utils cargo "cargo bin"
help cargo bin
``` ```
## the benchmarks ## the benchmarks
see [the `README`](benchmarks/README.md) see [`benchmarks/`](benchmarks/README.md)
File moved
File moved
use ../../nu-utils log use utils log
use ../../nu-utils math * use utils math *
use ../../nu-utils fs check-file use utils fs check-file
use ../../nu-utils plot [ into-axis-options, COMMON_OPTIONS, gplt ] use utils plot [ into-axis-options, COMMON_OPTIONS, gplt ]
use std formats * use std formats *
......
use ../../../nu-utils math * use ../utils math *
use ../../../nu-utils plot [ into-axis-options, COMMON_OPTIONS ] use ../utils plot [ into-axis-options, COMMON_OPTIONS ]
use ../../../nu-utils fs check-file use ../utils fs check-file
use ../../../nu-utils plot gplt use ../utils plot gplt
use std formats * use std formats *
......
use ../../../nu-utils log use ../utils log
use ../../../nu-utils formats * use ../utils formats *
use std formats * use std formats *
......
use ../../nu-utils log use utils log
use ../../nu-utils math * use utils math *
use ../../nu-utils fs check-file use utils fs check-file
use ../../nu-utils plot [ into-axis-options, COMMON_OPTIONS, gplt ] use utils plot [ into-axis-options, COMMON_OPTIONS, gplt ]
use std formats * use std formats *
......
use ../../nu-utils log use utils log
use ../../nu-utils formats * use utils formats *
use ../../nu-utils math * use utils math *
use ../../nu-utils plot [ into-axis-options, COMMON_OPTIONS, gplt ] use utils plot [ into-axis-options, COMMON_OPTIONS, gplt ]
use ../../nu-utils fs check-file use utils fs check-file
use std formats * use std formats *
......
use ../../nu-utils log use utils log
use ../../nu-utils math * use utils math *
use ../../nu-utils fs check-file use utils fs check-file
use ../../nu-utils plot [ into-axis-options, COMMON_OPTIONS, gplt ] use utils plot [ into-axis-options, COMMON_OPTIONS, gplt ]
use std formats * use std formats *
......
File moved
File moved
File moved
File moved
export module binary.nu
export module cargo.nu
export module color.nu
export module error.nu
export module formats.nu export module formats.nu
export module fs.nu export module fs.nu
export module log.nu
export module math.nu export module math.nu
export module parse.nu export module parse.nu
export module plot.nu export module plot.nu
export module log.nu
File moved
File moved
## running binaries
If you have [Nushell](https://www.nushell.sh/) installed, the easiest is to use the `cargo.nu`
module as follows:
```bash
use ./bins/cargo.nu "cargo bin"
help cargo bin
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment