Forky

Forky is a monorepo for rust utilities.

Very early stage warning:

  • breaking changes on patch versions
  • continued development not guaranteed
  • outdated docs

Crates

Command Line Interface

Installation

cargo install forky_cli
forky --help

	Welcome to the Forky CLI!
	
	Usage: Forky CLI [COMMAND]
	
	Commands:
	  auto-fs  generate mod and css files
	  watch    execute command on file change
	  serve    serve static files
	  style    Generate types for styles
	  mod      generate mod files for your project
	  help     Print this message or the help of the given subcommand(s)

watch

Analagous to cargo watch but allows for watch globs.

usage:

forky watch
Usage: forky.exe watch [OPTIONS] <cmd>...

Arguments:
  <cmd>...  the space seperated command to run, ie forky watch -- echo howdy

Options:
  -w, --watch <watch>    paths to watch
  -i, --ignore <ignore>  paths to ignore
      --once             only run once instead of watching indefinitely

Mod

usage:

forky mod

I like to organize projects by many small files and including them becomes a headache so I use a cli to auto-generate mod files that include all files in a directory.

Its current incarnation is zero config and opinionated so you may want to play around with it on an empty project before integrating with existing codebases.

Contributing

If this project is of interest to you feel free to have a dig around!

Everything is very early days so there are no doubt lots of bugs and missing features. If you find something that could be improved please open an issue or PR.

Getting Started

Most of this is for my own reference, but you may find it useful:

  1. Install Rust
    • Installer
    • Use powershell and be sure to carefully follow steps for build tools
  2. Install Depedencies
    •   	choco install just
        	choco install cygwin
        	# check
        	just all check
        	# tools
        	cargo install cargo-watch cargo-edit
        	rustup toolchain install nightly
        	rustup component add rustfmt --toolchain nightly
        	cargo +nightly fmt
        	rustup default nightly
        	# test - compilation will take several minutes
        	just all test
      

Cygwin

Justfiles require cygwin to work on windows.

  1. install cygwin
  2. add to path: C:\tools\cygwin\bin

Wasm

  • follow the bevy guide
  • setup
    rustup target install wasm32-unknown-unknown
    cargo install wasm-server-runner
    cargo install -f wasm-bindgen-cli
    #.cargo/config.toml
    [target.wasm32-unknown-unknown]
    runner = "wasm-server-runner"
    
  • run
    #run
    cargo run -p forky_play --example maze --target wasm32-unknown-unknown
    #compile
    cargo build -p forky_play --example maze --release --target wasm32-unknown-unknown
    #build bindings
    wasm-bindgen --out-dir ./html/maze --target web ./target/wasm32-unknown-unknown/release/examples/maze.wasm
    cd html && live-server