@sjcrh/proteinpaint-rust
v2.84.0
Published
Rust-based utilities for proteinpaint
Downloads
322
Readme
Rust-compiled utilities
This directory holds the source code for rust-compiled utilities.
Code layout
All source code files should be directly under the src/
directory. For a source
code file to be compiled, create a [[bin]]
entry for it in the Cargo.toml file:
[[bin]]
name="tool0"
path="src/tool0.rs"
[[bin]]
name="othertool1"
path="src/othertool1.rs"
Note that the default package.autobins has been disabled, so that we avoid using
the src/bin subdirectory to hold uncompiled source code files. The convention in
the Proteinpaint project is to put bundled or compiled code under a bin/
folder,
which goes against rust cargo's assumptions of having source code under src/bin
.
Using from nodejs
// assuming a js file from server/src
const run_rust = require('@sjcrh/proteinpaint-rust').run_rust
// or
// import * as utils from './utils'
// 'indel' may be replaced by any binary name as specified in Cargo.toml
const out = await run_rust('indel', input_data)
Test
From the proteinpaint/server
directory,
npx test
Build
npm run build # cargo build --release
The compiled dependencies and target binaries will be generated under ./target/release
.
Release
Use Github Actions to coordinate the release of related package updates.
The package versioning, build, and deployment uses the standard npm tooling under the hood
(version
, pack
, and publish
, respectively).