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

feat(cli): remove backup/restore/force options from set-version #1687

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

holic
Copy link
Member

@holic holic commented Oct 3, 2023

closes #1678

@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2023

🦋 Changeset detected

Latest commit: 5a3f2bb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@latticexyz/cli Major
@latticexyz/abi-ts Major
@latticexyz/block-logs-stream Major
@latticexyz/common Major
@latticexyz/config Major
create-mud Major
@latticexyz/dev-tools Major
@latticexyz/ecs-browser Major
@latticexyz/faucet Major
@latticexyz/gas-report Major
@latticexyz/network Major
@latticexyz/noise Major
@latticexyz/phaserx Major
@latticexyz/protocol-parser Major
@latticexyz/react Major
@latticexyz/recs Major
@latticexyz/schema-type Major
@latticexyz/services Major
@latticexyz/solecs Major
solhint-config-mud Major
solhint-plugin-mud Major
@latticexyz/std-client Major
@latticexyz/std-contracts Major
@latticexyz/store-cache Major
@latticexyz/store-indexer Major
@latticexyz/store-sync Major
@latticexyz/store Major
@latticexyz/utils Major
@latticexyz/world-modules Major
@latticexyz/world Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mud-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 4:59pm

"@latticexyz/cli": major
---

Removes `.mudbackup` file handling and `--backup`, `--restore, `--force` options from `mud set-version` command. Git will do a better job of this!
Copy link
Member

@alvrs alvrs Oct 3, 2023

Choose a reason for hiding this comment

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

Should we add some quick instructions for how to do the same with git to the changelog?

e.g.

# restore all package.json to the version on <commit>
git checkout <commit> -- package.json && \
git checkout <commit> -- packages/contracts/package.json && \
git checkout <commit> -- packages/client/package.json

# restore all package.json the version on the `main` branch
git checkout main -- package.json && \
git checkout main -- packages/contracts/package.json && \
git checkout main -- packages/client/package.json

(Note i haven't actually tested these, we should make sure this works)

Now that i'm typing this out i wonder if git is actually doing a better job here? What if more packages changed in the meantime? (Is there another way to do this via git that i'm missing here?)

Copy link
Member Author

@holic holic Oct 3, 2023

Choose a reason for hiding this comment

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

Ultimately I don't really think it's our job to figure out a user's upgrade path and how they resolve diffs in their files (it's hard to get this right and not worth the complexity). In my mind, set-version is and should be just a shortcut for doing something like

pnpm up -r "@latticexyz/*@next"

except it takes into account all packages (not all of ours are prefixed with @latticexyz/) and has support for linking all packages too.

Edit: looks like this CLI doesn't support non-prefixed packages, but probably ought to

Copy link
Member

Choose a reason for hiding this comment

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

I agree the restore feature can be easily replaced with looking at the git history and then using pnpm mud set-version <prev-version> to reset it (especially since all MUD packages should have aligned versions). Still think that if we remove a feature we need to add instructions to the changeset for how to do the same with with the now recommended way (even if it's just "look up the previous version with git diff main package.json and run pnpm mud set-version <prev-version>")

@holic
Copy link
Member Author

holic commented Oct 3, 2023

Did a little refactor to support all MUD packages

(note how these include e.g. solhint-plugin-mud)

Fetching available versions
Latest version with tag next: 2.0.0-next.10
Updating package.json
@latticexyz/cli: link:../../packages/cli -> 2.0.0-next.10
Updating packages/client-phaser/package.json
@latticexyz/common: link:../../../../packages/common -> 2.0.0-next.10
@latticexyz/dev-tools: link:../../../../packages/dev-tools -> 2.0.0-next.10
@latticexyz/phaserx: link:../../../../packages/phaserx -> 2.0.0-next.10
@latticexyz/react: link:../../../../packages/react -> 2.0.0-next.10
@latticexyz/recs: link:../../../../packages/recs -> 2.0.0-next.10
@latticexyz/schema-type: link:../../../../packages/schema-type -> 2.0.0-next.10
@latticexyz/services: link:../../../../packages/services -> 2.0.0-next.10
@latticexyz/store-sync: link:../../../../packages/store-sync -> 2.0.0-next.10
@latticexyz/utils: link:../../../../packages/utils -> 2.0.0-next.10
@latticexyz/world: link:../../../../packages/world -> 2.0.0-next.10
Updating packages/client-react/package.json
@latticexyz/common: link:../../../../packages/common -> 2.0.0-next.10
@latticexyz/dev-tools: link:../../../../packages/dev-tools -> 2.0.0-next.10
@latticexyz/faucet: link:../../../../packages/faucet -> 2.0.0-next.10
@latticexyz/react: link:../../../../packages/react -> 2.0.0-next.10
@latticexyz/recs: link:../../../../packages/recs -> 2.0.0-next.10
@latticexyz/schema-type: link:../../../../packages/schema-type -> 2.0.0-next.10
@latticexyz/services: link:../../../../packages/services -> 2.0.0-next.10
@latticexyz/store-sync: link:../../../../packages/store-sync -> 2.0.0-next.10
@latticexyz/utils: link:../../../../packages/utils -> 2.0.0-next.10
@latticexyz/world: link:../../../../packages/world -> 2.0.0-next.10
Updating packages/client-vanilla/package.json
@latticexyz/common: link:../../../../packages/common -> 2.0.0-next.10
@latticexyz/dev-tools: link:../../../../packages/dev-tools -> 2.0.0-next.10
@latticexyz/recs: link:../../../../packages/recs -> 2.0.0-next.10
@latticexyz/schema-type: link:../../../../packages/schema-type -> 2.0.0-next.10
@latticexyz/services: link:../../../../packages/services -> 2.0.0-next.10
@latticexyz/store-sync: link:../../../../packages/store-sync -> 2.0.0-next.10
@latticexyz/utils: link:../../../../packages/utils -> 2.0.0-next.10
@latticexyz/world: link:../../../../packages/world -> 2.0.0-next.10
Updating packages/contracts/package.json
@latticexyz/cli: link:../../../../packages/cli -> 2.0.0-next.10
@latticexyz/config: link:../../../../packages/config -> 2.0.0-next.10
@latticexyz/faucet: link:../../../../packages/faucet -> 2.0.0-next.10
@latticexyz/schema-type: link:../../../../packages/schema-type -> 2.0.0-next.10
@latticexyz/store: link:../../../../packages/store -> 2.0.0-next.10
@latticexyz/world: link:../../../../packages/world -> 2.0.0-next.10
@latticexyz/world-modules: link:../../../../packages/world-modules -> 2.0.0-next.10
solhint-config-mud: file:../../../../packages/solhint-config-mud -> 2.0.0-next.10
solhint-plugin-mud: file:../../../../packages/solhint-plugin-mud -> 2.0.0-next.10
Updating packages/plugin-example/package.json
@latticexyz/common: link:../../../../packages/common -> 2.0.0-next.10
@latticexyz/config: link:../../../../packages/config -> 2.0.0-next.10
@latticexyz/store: link:../../../../packages/store -> 2.0.0-next.10
@latticexyz/world: link:../../../../packages/world -> 2.0.0-next.10

@holic holic requested a review from alvrs October 3, 2023 17:00
@holic holic merged commit 3d0b3ed into main Oct 3, 2023
@holic holic deleted the holic/remove-mudbackup branch October 3, 2023 17:50
@github-actions github-actions bot mentioned this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove .mudbackup from cli set-version
2 participants