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

Reducing mops.one load time
Thanks to certification v2 and more aggresive caching, https://mops.one now loads much faster.
Package changelog
On package “Versions” tab now you can see what changed in each package version including:
- Release notes from CHANGELOG.md
- Dependencies changes
- 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:
- parse
CHANGELOG.md
- find header with our package version → ## 0.10.0 (2023-09-11)
- 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:
Integration with VSCode Motoko extension
Added new command “Motoko: Import Mops Package…”.
-
Hit
Ctrl+Shift+P
then typemops
to find the command -
Select “Import Mops Package…”
- Search for Motoko package
- 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.
Looks like README header links are not working properly (redirect to the Github not found page)
Also, is there a way to fetch release notes from Github in addition to parsing CHANGELOG?
Thanks for the report, will be fixing that
I think it’s feasible, I’ll add it to the backlog
- Fixed anchor links
- Replaced the markdown library with a faster one, opening https://mops.one/map 4s → 0.3s
- On package publish, if there are no CHANGELOG.md file, mops will fetch release notes from GitHub releases (mops cli 0.28.0)
That was quick! Thanks.
So this will only affect new publications, existing versions won’t receive release notes, will they?
Yes, new publications only, also you need to update mops cli to version 0.28.0
Package badges
Now you can add mops badges to your package!
- Click on the “Badges” button on the right panel of your package page
- Copy the badge code in markdown format and add it to your
README.md
file
- Success!
Hello @ZenVoich, I’m trying to publish the IC WebSocket Motoko CDK on mops from a GitHub action for the first time, but I’m getting a weird error:
Uploading files [: ]
Error: Unauthorized
You can see the detailed logs at: Release ic-websocket-cdk-mo · omnia-network/ic-websocket-cdk-mo@504f223 · GitHub.
What am I missing?
Hi @ilbert
I suspect that in GitHub action mops import-identity
does not complete because it asks for a password to encrypt identity.
I just added --no-encrypt
flag to mops import-identity
command. Please try this:
mops import-identity --no-encrypt -- "$(dfx identity export ...
It works perfectly, see:
@ZenVoich thanks a lot!
@ZenVoich I’m now getting an error when I try to run mops publish
(including docs generation) in the same GitHub Action:
dfx identity use action
mops import-identity --no-encrypt -- "$(dfx identity export action)"
mops publish
echo "version=$(cat mops.toml | grep "version =" | cut -d\" -f2)" >> "$GITHUB_OUTPUT"
shell: /usr/bin/bash -e {0}
env:
DFX_TELEMETRY_DISABLED: 1
CARGO_REGISTRY_TOKEN:
Using identity: "action".
Success
hurtj-3s4qx-bdvzf-7gsd4-6e4ts-2qiog-wpenq-uvw4x-tehho-2y3y3-sae
Publishing ic-websocket-cdk@0.2.0
Generating documentation...
node:events:495
throw er; // Unhandled 'error' event
^
Error: spawn /home/runner/.cache/dfinity/versions/0.14.1/mo-doc ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:284:19)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:290:12)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /home/runner/.cache/dfinity/versions/0.14.1/mo-doc',
path: '/home/runner/.cache/dfinity/versions/0.14.1/mo-doc',
spawnargs: [
'--source=/home/runner/work/ic-websocket-cdk-mo/ic-websocket-cdk-mo/src',
'--output=.mops/.docs',
'--format=adoc'
]
}
Node.js v18.18.2
Error: Process completed with exit code 1.
Run that failed: Release ic-websocket-cdk-mo · omnia-network/ic-websocket-cdk-mo@fe6520e · GitHub.
If I run the command with --no-docs
, it works.
Locally, it works with docs included.
Not sure why mo-doc
from dfx is not there.
You can add this line before publish:
- name: install moc
run: npx mocv use latest
This will install the latest moc
and mo-doc
so mops can use them.
I installed mocv in the same script of mops:
But I keep getting the error, and I think that’s because the script is looking for mo-docs
at /home/runner/.cache/dfinity/versions/0.14.1/mo-doc
path:
Error: spawn /home/runner/.cache/dfinity/versions/0.14.1/mo-doc ENOENT
You also need to run mocv use latest
to take effect
npm i mocv -g
mocv use latest
or
npx mocv use latest
It worked now! Thanks a lot again
HatTip to @ZenVoich who has provided amazing support for MOPS!