fluttercommunity / import_sorter

🎯 Automatically organize your dart imports. Maintainer: @gleich
https://pub.dev/packages/import_sorter
MIT License
174 stars 40 forks source link

feat: Simplify import_sorter command #76

Closed mrgnhnt96 closed 10 months ago

mrgnhnt96 commented 10 months ago

The current command to run import sorter is

# as a dev dependency
dart run import_sorter:main

# globally
dart pub global run import_sorter:main

With this change, the :main can be omitted, making the command more intuitive

# as dev dependency
dart run import_sorter

# globally
dart pub global run import_sorter

The :main command will not be removed to avoid breaking existing projects using import_sorter, but could be considered in the future. I've added a deprecated warning whenever import_sorter:main is used.

image

vkammerer commented 10 months ago

Thanks @mrgnhnt96 for the PR, I think it's a good idea.

But if the idea is to deprecate the :main syntax in a future version, could you please redo your PR this way:

Then please force push your branch.

That way, when we remove support for the :main syntax, we'll just have to delete the bin/main.dart file. It will also keep the deprecation warning isolated, not mixed with the rest of the logic.

vkammerer commented 10 months ago

Also, please add a third commit that removes references to :main from the documentation. See all current occurrences at https://github.com/search?q=repo%3Afluttercommunity%2Fimport_sorter%20%3Amain&type=code

pythonhubdev commented 10 months ago

@vkammerer once this is merged can we make a new release to pub.dev?

vkammerer commented 10 months ago

@mrgnhnt96 Thanks for updating your PR.

Could you look into why the import_sorter Github action is failing? https://github.com/fluttercommunity/import_sorter/actions/runs/7592158197/job/20790428773

mrgnhnt96 commented 10 months ago

@mrgnhnt96 Thanks for updating your PR.

Could you look into why the import_sorter Github action is failing? https://github.com/fluttercommunity/import_sorter/actions/runs/7592158197/job/20790428773

I hadn't run import sorter lol, I just fixed it. It should pass now

vkammerer commented 10 months ago

Thanks @mrgnhnt96 , that made the tests pass.

I'll update the CHANGELOG and prepare a release to pub.dev

vkammerer commented 10 months ago

@slightfoot We would like to make a new release to pub.dev. Would you be able to help us with it?

vkammerer commented 4 months ago

This was finally published on pub.dev, under the version 5.0.0-releasecandidate.1