Supporting packages not in root directory
I have a motoko package here that I'd like to deploy to mops. However, I have it in a folder called motoko, but mops insists on having the package in the root folder. Can we support an option to specify the directory where the package is?
As a very hacky solution for now, I temporarily move the package to the root, publish on mops, then move it back again (I know, ridiculous).
I suppose it is about repository verification. Less hacky way would be to put a copy of mops.toml in the root folder. It can be not up to date, just make sure there is name = "llm":
[package]
name = "llm"
and just publish from motoko folder
Good to know, thanks. Perhaps a cleaner way would be to allow specifying the directory within the repo in the mops.toml file?
We (OpenChat) have exactly the same issue with the package living in a Motoko subfolder. We have SDKs for various languages including Motoko and so Motoko can't be at the root.
https://github.com/open-chat-labs/open-chat-bots
Implemented subfolder support for repo url. https://github.com/open-chat-labs/open-chat-bots/motoko should work now
@fspreiss you can specify sub-directory in repository url #264 (comment)
@ZenVoich, for both
- repository = "https://github.com/dfinity/vetkeys" and
- repository = "https://github.com/dfinity/vetkeys/tree/main/backend/mo/ic_vetkeys"
I got
Error: Repository verification failed: Response status 404. Please double-check the repository URL and make sure the mops.toml file exists in the repository root.
using
mops --version
CLI 1.8.0
API 1.3
Try repository = "https://github.com/dfinity/vetkeys/backend/mo/ic_vetkeys" (without tree/main/)
Thanks! In the meanwhile I did publish the package without the repository field as 0.1.0 (here): I guess I cannot update this now, so I can only try this next time, e.g., when we publish 0.2.0.
It probably would make sense to document how sub-directories can be used in https://docs.mops.one/mops.toml. For example, by giving a concrete example URL where the mops.toml doesn't live in the repository root.
In the meanwhile I did publish the package without the
repositoryfield as 0.1.0 (here): I guess I cannot update this now, so I can only try this next time, e.g., when we publish 0.2.0.
Yes, published versions are immutable
It probably would make sense to document how sub-directories can be used in https://docs.mops.one/mops.toml. For example, by giving a concrete example URL where the mops.toml doesn't live in the repository root.
👍
so I can only try this next time, e.g., when we publish 0.2.0
@ZenVoich, I just published https://mops.one/[email protected] and indeed repository = "https://github.com/dfinity/vetkeys/backend/mo/ic_vetkeys (without tree/main/) worked. Thanks!
Should this issue be closed then? I also confirm that it works in dfinity/llm
Glad everything working! Closing issue...