New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@nomad-xyz/config

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomad-xyz/config

Nomad project configuration file utilities

latest
Source
npmnpm
Version
0.1.0-rc.1
Version published
Weekly downloads
33
200%
Maintainers
4
Weekly downloads
 
Created
Source

Nomad Config file

This is a crate for working with nomad configuration files. These config files contain information about the state of Nomad deployments.

It also includes an auto-generated TS/WASM library.

Design Notes

The core library is mostly a JSON config file format. We define Rust structs and TS types for all parts of this config.

In TS, the object is a native JS object. It is not a reference to a wasm type. Assignment and access can be done as normal. However, we have also exported functions that perform consistency-critical operations like addNetwork and addCore. We strongly recommend using these instead of assigning to the relevant sections.

Building

  • $ cargo build

To build the wasm library:

  • Install wasm-pack
  • $ ./package-it.sh

wasm-pack docs are found here.

Testing

  • $ cargo test

Documenting

  • $ cargo docs --open

Publishing

  • $ cargo publish
  • $ ./publish_it.sh

Development note

To work around some wasm-bindgen limitations, we currently (unfortunately) have to manually define TS types for the rust structs. These are found in the data directory. When a rust struct is updated or added, the corresponding definitions should be added in data/definitions.ts and data/types.rs. At compile-time these files are combind to src/wasm/types.rs.

In the future it'd be cool to auto-generate this code :)

FAQs

Package last updated on 10 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts