Introducing MOPS - a package manager for Motoko with on-chain package registry.
MOPS was created as a simple and convenient alternative to the Vessel. With MOPS it is easier to manage dependencies and it has a simpler config.
You can easily install packages with just one command mops i <package_name>.
Recently, MOPS also supports installing packages from GitHub and vessel configuration (thanks to @tomijaga) mops i https://github.com/dfinity/motoko-base
I’ll be putting a few of my Motoko libraries on MOPS. Vessel works but my biggest concern right now is package discovery. It’s really hard to figure out what exists without asking around.
We might need to compile a list of all the libraries that are out there. I actually do really enjoy vessel. Would be even fine if it is a simple command line that searches vessel libs and returns their urls / github repos and such.
Ya, ive seen the vessel github packages but there has to be better accessibility or only a few packages will end up in that list and its tedious to view.
I havent heard anyone talk about working on vessel, has anyone talked about it future development?
@ZenVoich would you be up for a presentation of MOPS during the next Motoko Bootcamp (16-22 January 2023); I would like to have this tool presented to the next cohort of Motoko dev.
These instructions should work. The extension will automatically detect the mops.toml file and update the type checker accordingly.
I also looked into packaging MOPS directly in the extension (and including a user interface to set up a project, install dependencies, etc). This will eventually be possible after refactoring ic-mops to work as a TypeScript library.
Use mops add <pkg>@<ver> to install specific package version:
For example:
mops add base@0.7.6
Local dependencies support
You can link local deps by providing relative or absolute path to the package directory:
For example mops.toml:
lib = "../shared/lib"
Motoko code:
import Lib "mo:lib";
Path will be resolved to ../shared/lib/src.
You can’t publish a package with local dependencies.
Cache
Now, when installing any package, mops will cache it on disk, so next time it will be installed faster from the disk cache!
New packages published on mops
icrc1 is a full implementation of the ICRC-1 fungible token standard time-consts is a library with time constants to deal with nanoseconds ledger-types is a library with interface to interact with ICP ledger canister. candid_stringify is a library to convert any Candid data to a string cbor is a library that is written in Motoko that enables the encoding and decoding of CBOR between bytes and a CBOR variant type candid is a library that enables encoding/decoding of bytes to candid values. serde is serialization and deserialization library for Motoko. itertools is a library with utility functions and data types for creating efficient iterators in Motoko. xtended-numbers is a library that extends on the Motoko base library for numbers. Maily focuses on encoding of numbers and 16/32 bit precision floats.