MOPS - on-chain package manager for Motoko!

Currently, there is no such feature, but would be nice to have. I will think about it!

Another question about dependencies. When I write in mops.toml for example

[dependencies]
base = "0.9.7"

and run mops i then that will download exactly that version (0.9.7) even if I already have a newer version (say 0.9.8) installed.

Now I am wondering what happens if I have a project that depends on two packages, A and B, both of which in turn depend on base but on different versions. Say A depends on 0.9.7 and B on 0.9.8. When I build this project then both base versions get installed and used. Does that increase the binary size because two copies of the same library get compiled into the wasm?

No, there can be only one package resolved to specific name. So base will be resolved to 0.9.7, you can run mops sources and see which package will actually be used in the build.

both will be downloaded but only one of them will be used. Probably I will move downloading and resolution out of local .mops cache dir to global cache dir, so .mops folder will remain simple.

That’s strange. I made a tool two months ago that imports files based on their content hashes and it reduced the compiled binary with 20-30kb

Update

:snail::rocket: Reducing mops.one load time

Thanks to certification v2 and more aggresive caching, https://mops.one now loads much faster.

:new: Package changelog

On package “Versions” tab now you can see what changed in each package version including:

  1. Release notes from CHANGELOG.md
  2. Dependencies changes
  3. Tests changes

Dependency and test changes computed automatically.
Release notes parsed on mops publish from CHANGELOG.md file from packge version paragraph

For example CHANGELOG.md

# Motoko compiler changelog

## 0.10.0 (2023-09-11)

* Added a new stable `Region` type of dynamically allocated, independently growable and
    isolated regions of IC stable memory (#580). See documentation.

* Exposed conversions between adjacent fixed-width types (#585).

## 0.9.8 (2023-08-11)

* motoko (`moc`)

  * Added numerical type conversions between adjacent fixed-width types (#4139).

  * Administrative: legacy-named release artefacts are no longer created (#4111).
...

When publishing package version 0.10.0, mops will:

  1. parse CHANGELOG.md
  2. find header with our package version → ## 0.10.0 (2023-09-11)
  3. publish whole paragraph:
* Added a new stable `Region` type of dynamically allocated, independently growable and
    isolated regions of IC stable memory (#580). See documentation.

* Exposed conversions between adjacent fixed-width types (#585).

How it looks like:

:new: Integration with VSCode Motoko extension

Added new command “Motoko: Import Mops Package…”.

  1. Hit Ctrl+Shift+P then type mops to find the command

  2. Select “Import Mops Package…”

  1. Search for Motoko package

  1. Select package and press Enter

The package will be installed and saved to the mops.toml file, then the package import line will be added to the currently open *.mo file.

6 Likes