2.0.1 • Published 2 years ago

@nomad-xyz/configuration v2.0.1

Weekly downloads
-
License
MIT OR Apache-2.0
Repository
github
Last release
2 years ago

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.

Usage

Typescript

import * as configuration from "@nomad-xyz/configuration"

const config = configuration.getBuiltin("production")

console.log(`Environment: ${config.environment}`)

Rust

// TODO

Building

  • $ cargo build

To build the wasm library:

wasm-pack docs are found here.

Testing

  • $ cargo test

Documenting

  • $ cargo docs --open

Releasing

Prepare Release

  • Update Changelog from unreleased to next version
  • Bump package version in cargo.toml to <new-package-version>
  • Run the tests locally: cargo test
  • Make a PR and merge it

Release / Publish

  • Tag newly-merged commit: git tag -s @nomad-xyz/configuration@<new-package-version>
  • Push tags: git push --tags
  • Publish to NPM: ./publish_npm.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 :)

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0-rc.1

2 years ago

0.1.0

2 years ago

0.1.0-rc.19

2 years ago

0.1.0-rc.18

2 years ago

0.1.0-rc.20

2 years ago

0.1.0-rc.24

2 years ago

0.1.0-rc.23

2 years ago

0.1.0-rc.22

2 years ago

0.1.0-rc.21

2 years ago

0.1.0-rc.25

2 years ago

0.1.0-rc.9

2 years ago

0.1.0-rc.7

2 years ago

0.1.0-rc.8

2 years ago

0.1.0-rc.5

2 years ago

0.1.0-rc.6

2 years ago

0.1.0-rc.4

2 years ago

0.1.0-rc.12

2 years ago

0.1.0-rc.11

2 years ago

0.1.0-rc.10

2 years ago

0.1.0-rc.16

2 years ago

0.1.0-rc.15

2 years ago

0.1.0-rc.14

2 years ago

0.1.0-rc.3

2 years ago

0.1.0-rc.2

2 years ago

0.1.0-rc.1

2 years ago