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

Support for upgrading code with packages #57

Open
gampleman opened this issue Feb 7, 2024 · 2 comments
Open

Support for upgrading code with packages #57

gampleman opened this issue Feb 7, 2024 · 2 comments

Comments

@gampleman
Copy link

I'd like to establish a convention such that if a package contains an upgrade/Upgrade.elm file at the top level, than the package indicates that it can automatically update user code along with itself. This is at the moment best achieved via elm-review. Such an Upgrade.elm file would contain a dictionary of source versions to review configurations. The proposal would be that elm-json would detect when a user wishes to upgrade such a package and would offer the user to also modify their codebase. It would do this by dynamically generating an elm-review configuration based on the users current version of the dependency, then running elm-review --fix-all.

@lue-bird
Copy link

lue-bird commented Feb 7, 2024

If feel like this would stretch the scope of elm-json too much.
So far it has been just a tool to correctly edit the elm.json config file; with this change it would change your code, have elm-review and a github query package as a depencency etc.

In my eyes, the idea is cool but I worry it messes with elm-json "doing one thing, and one thing well" as a user expectation.
So maybe this is better as it's own project using elm-json and elm-review?

@gampleman
Copy link
Author

gampleman commented Feb 8, 2024

Perhaps, but I think you are looking at the "one thing" from the perspective of a developer of tooling, not from the perspective of user of tooling.

From the perspective of a user, I don't particularly care what dependencies need to be added or exactly how this works, I want to have one tool to manage my dependencies. It would be best if that tool was elm, but for better or worse in practice that tool is elm-json.

Last thing I want to remember is that I can use elm-json to add, remove, and do patch and minor updates of packages, but for major updates I'm supposed to use elm-upgrade or whatever because... reasons.


That said, if the behaviour that changes your code was behind a flag or some such, that would be fine with me, if we believe that it would be against user expectation to do this by default.

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

No branches or pull requests

2 participants