docs: flesh out mops init and fix user set properties#499
Merged
Conversation
mops init had a two-line description that didn't cover the interactive prompts, what files get created, the --yes behavior, or the vessel.dhall migration, forcing users to read the source. Rewrite to document the prompt flow, the files written, and the project/package split. mops user set listed only name/github/twitter, but the CLI also accepts site and email. Add the missing properties. Also clean up a couple of style nits in user set (Example → Examples, drop non-idiomatic phrasing) for consistency with peer docs. Made-with: Cursor
When there is no dfx.json, mops init was silently consulting the installed dfx's --version to pick a default package set, which could pin an old `base` on a fresh standalone Motoko project. Treat the absence of dfx.json as the signal for "standalone Motoko project" and skip the dfx sniff: ask the backend for defaults with an empty version (falls through to latest core) and pin the latest moc in [toolchain] so the project is ready to compile on its own. With dfx.json present the behavior is unchanged — the backend still returns base for old dfx versions and core for newer ones. Made-with: Cursor
Narrating-code comment replaced with a two-line intent comment; the condition duplication is hoisted into a `standalone` local. The mops-cli skill's "New project" section now reflects the new init behavior — `mops toolchain use moc latest` and `mops add core` are redundant when there is no dfx.json. Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
dfx.json presence is the legacy signal for 'something else will provide moc'. Whether the user is building a library or a project deployed via dfx / icp-cli / raw wasm is independent — pin moc whenever dfx is not in the picture, for both project and package. Made-with: Cursor
Made-with: Cursor
toolchain.use validates installed dep manifests via checkRequirements, so it crashes if run before installAll downloads the deps. Caught by smoke-testing `mops init -y` in an empty dir. Made-with: Cursor
The dep-selection behavior didn't actually change — the backend already returns `core` for modern dfx, empty version, or unknown versions via its fallthrough case. The only real change in this PR is pinning latest `moc` when no `dfx.json` is present. Made-with: Cursor
Existing init behavior already returns latest `core` for modern dfx, missing dfx, and unknown versions via the backend's fallthrough case. No CLI change is warranted — just documentation. Made-with: Cursor
- restore ## Examples as h2 on mops user set - split the dfx version matrix description into two sentences and name the 0.9.0-0.27.0 range explicitly instead of 'modern dfx' - call out that vessel dev-dependencies are not migrated - add trailing newline Made-with: Cursor
alexandru-uta
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrites the thin
mops initdocs to cover the interactive prompts, what files get created (including thebase-vs-corematrix keyed on dfx version), thevessel.dhallmigration, and the--yesbehavior.Also adds the missing
site/emailproperties to themops user setdocs — the CLI already accepted them; only the docs were wrong.No code changes.