Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use npx to run mops #288

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

chore: use npx to run mops #288

wants to merge 8 commits into from

Conversation

ggreif
Copy link
Contributor

@ggreif ggreif commented Feb 14, 2025

This PR removes the dependency of the somewhat ad-hoc mops-cli command (and instead building with moc directly), and makes mops available as a dev tool from npm. Furthermore it bumps base to a more recent one.

Note: mops has the nasty habit of changing DFX_MOC_PATH in the GitHub environment, env GITHUB_ENV=/dev/null makes sure that it cannot mess with it.

@ggreif ggreif changed the title chore: use npx to run mops-cli chore: use npx to run mops Feb 15, 2025
@ggreif ggreif self-assigned this Feb 15, 2025
@ggreif ggreif requested a review from rvanasa February 15, 2025 10:03
@ggreif ggreif added the dependencies Pull requests that update a dependency file label Feb 15, 2025
"build": ["mops-cli build service/saved/Saved.mo"],
"candid": "target/Saved/Saved.did",
"wasm": "target/Saved/Saved.wasm",
"build": ["mkdir -p target/saved && $(dfx cache show)/moc $(npx mops sources) service/saved/Saved.mo -o target/saved/saved.wasm --release --idl --stable-types --public-metadata candid:service"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be npx ic-mops rather than npx mops to reference the ic-mops npm package.

I usually also include the --no flag (npx --no ic-mops) to remove the prompt to globally install Mops if the developer hasn't yet run npm install.

@@ -1,8 +1,7 @@
[dependencies]
base = "0.12.1"
base = "0.13.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we able to use the latest base library version?

Suggested change
base = "0.13.4"
base = "0.14.1

Copy link
Contributor Author

@ggreif ggreif Feb 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had that, lamentably it is not compatible as a primitive is missing. I'll update when dfx 0.25 is out.

287eaf7#diff-f51126c5f74c75e290067ee5f31e8c8d13eb2aaba192977e167c148c1222b625R2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants