mops icon indicating copy to clipboard operation
mops copied to clipboard

Local package reference w/o duplicating MOPS dependencies

Open Gekctek opened this issue 6 months ago • 3 comments

One problem that i run across often when developing is if I update my mops.toml file to have a dependency in my local system like

liminal = "../../src"

Then i run into the issue of needing to essentially copy and paste the referenced mops.toml file dependencies into mine. Like if liminals was

a = "0.0.1"
b = "0.0.2"

Then my mops.toml file would end up looking like

liminal = "../../src"
a = "0.0.1"
b = "0.0.2"

otherwise i get errors that i am missing those packages

Is there a way around this? or can this be changed to have MOPS use the referenced package's mops.toml file instead of having to duplicate it?

My main case is i want to have my example projects reference the package locally vs using a published number for others to have the latest and for me to test without having to publish

Gekctek avatar Jun 06 '25 19:06 Gekctek

Mops should resolve deps of local deps. Do you see missing package error in vscode or/and in terminal also(when you build canister or run tests)? Is the missing package listed in mops sources output?

I tried to import local dep with mops deps, and it shows error in my Cursor editor but works fine if I run tests

Image

ZenVoich avatar Jun 07 '25 09:06 ZenVoich

Oh, well i tried a few different things and i think I fixed it

I was originally referencing the "../../src" which would only output --package liminal ../../src with mops sources But when i changed it to "../.." (where the top level mops.toml is) it starts to work and all the sources are listed

Where should the mops.toml be in the src or top level? This works fine, ill just use the top level vs src from now on

Image

Gekctek avatar Jun 10 '25 03:06 Gekctek

Where should the mops.toml be in the src or top level?

top level

ZenVoich avatar Jun 10 '25 06:06 ZenVoich