Skip to content

autrk/pluggable-calculator

Repository files navigation

go devbox

Instant, easy, and predictable go development environment

Getting Started

This project uses devbox to manage its development environment.

Install devbox:

curl -fsSL https://get.jetpack.io/devbox | bash

Start the devbox shell:

devbox shell

Run a script in the devbox environment:

devbox run <script>

Scripts

Scripts are custom commands that can be run using this project's environment. This project has the following scripts:

Environment

GOPATH="${HOME}/go/"
LIBRARY_PATH="/home/ckihm/workspace-ckl/wasm/pluggable-calculator/.devbox/nix/profile/default/lib"
PATH="${PATH}:${HOME}/go/bin"
RUSTUP_HOME="/home/ckihm/workspace-ckl/wasm/pluggable-calculator/.devbox/virtenv/rustup"

Shell Init Hook

The Shell Init Hook is a script that runs whenever the devbox environment is instantiated. It runs on devbox shell and on devbox run.

test -z $DEVBOX_COREPACK_ENABLED || corepack enable --install-directory "/home/ckihm/workspace-ckl/wasm/pluggable-calculator/.devbox/virtenv/nodejs/corepack-bin/"
test -z $DEVBOX_COREPACK_ENABLED || export PATH="/home/ckihm/workspace-ckl/wasm/pluggable-calculator/.devbox/virtenv/nodejs/corepack-bin/:$PATH"
export "GOROOT=$(go env GOROOT)"
rustup default stable
cargo fetch

Packages

Script Details

devbox run build-add

pushd ./plugins/src/add > /dev/null
zig build
cp ./zig-out/bin/add.wasm ../../wasm
popd > /dev/null

devbox run build-multiply

pushd ./plugins/src/multiply > /dev/null
cargo build --target wasm32-unknown-unknown --release
cp ./target/wasm32-unknown-unknown/release/multiply.wasm ../../wasm
popd > /dev/null

devbox run build-power

pushd ./plugins/src/power > /dev/null
tinygo build -target wasi -o power.wasm main.go
cp ./power.wasm ../../wasm
popd > /dev/null

devbox run build-substract

pushd ./plugins/src/substract > /dev/null
npm run build
cp ./dist/substract.wasm ../../wasm
popd > /dev/null

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published