Giter Club home page Giter Club logo

pubspec-dependency-sorter's Introduction

Package helps to sort the flutter/dart packages and plugins alphabetically, This makes it easier when managing too many packages and when working with teams

Features

  • sort dependencies
  • prevent dependecy conflicts
  • clean up the pubspec.yaml file

Getting started

Install flutter or dart sdk then depend on the package.

dev_dependencies:
  pubspec_dependency_sorter: ^1.0.4

Usage

To use the package run in your flutter/dart app root directory

   dart run pubspec_dependency_sorter

if your pubspec.yam is located somewhere else use the following command by passing the path of the directory where the pubspec.yaml file is located.

  dart run pubspec_dependency_sorter PATH-TO-YOUR-DIRECTORY

sample output

dependency_sorter sample output

Additional information

Feel free to add features,improvemets and fix bugs then create a PR.

pubspec-dependency-sorter's People

Contributors

bluecloudy avatar danchengash avatar famasf1 avatar jbmangold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pubspec-dependency-sorter's Issues

doesn't sort dependencies with keys

Thanks for making this package!
I keep getting the sort_pub_dependency error after running flutter pub run pubspec_dependency_sorter

What I expect:

dev_dependencies: 
  build_runner: ^2.2.1
  fake_cloud_firestore: ^1.3.1
  flutter_test: 
    sdk: flutter
  freezed: ^2.1.0+1
  json_serializable: ^6.4.1
  mocktail: ^0.3.0
  pubspec_dependency_sorter: ^0.0.2
  test: ^1.14.4
  very_good_analysis: ^3.1.0

What I get:

Another note: It would be great if the package didn't remove inline comments, so I can keep useful documentation in the file.

Sorting removes all comments

Hi, I love the idea of this package!

Our pubspec.yaml is highly documented, so removing all the comments is not an option.

I am unsure whether this is a warning to other devs or a feature request.

Thanks,

"flutter" dependency not sorted correctly

The dart linter is giving me a sort warning even after running flutter pub run pubspec_dependency_sorter. The flutter dependency seems to be listed below the rest instead of alphabetical. Is this on purpose just because it's required for flutter?

For now I'll just set sort_pub_dependencies: false in the analysis_options.yaml and call it a day.

Cheers!

unsorted-dependencies-flutter-line

Full pubspec.yaml:

name: tenthousandshotchallenge
version: 1.1.0+17
publish_to: none
description: A flutter project for the Ten Thousand Shot Challenge app
environment: 
  sdk: '>=2.12.0 <4.0.0'
dependencies: 
  auto_size_text: ^3.0.0
  charts_flutter: ^0.12.0
  chewie: ^1.3.3
  cloud_firestore: ^4.17.0
  connectivity_plus: ^6.0.2
  cupertino_icons: ^1.0.2
  data_connection_checker_nulls: ^0.0.2
  firebase_analytics: ^10.10.2
  firebase_auth: ^4.19.2
  firebase_core: ^2.30.0
  firebase_messaging: ^14.8.2
  firebase_remote_config: ^4.4.2
  flutter_barcode_scanner: ^2.0.0
  flutter_cache_manager: ^3.1.1
  flutter_datetime_picker_plus: ^2.2.0
  flutter_html: ^3.0.0-alpha.5
  flutter_local_notifications: ^17.0.1
  fluttertoast: ^8.0.7
  font_awesome_flutter: ^10.7.0
  global_configuration: ^2.0.0-nullsafety.1
  google_sign_in: ^6.2.1
  html: ^0.15.0
  http: ^1.2.1
  intl: ^0.17.0
  introduction_screen: ^3.0.0
  numberpicker: ^2.1.1
  package_info: ^2.0.2
  password_strength: ^0.2.0
  prompt_dialog: ^1.0.0
  provider: ^6.0.1
  pubspec_dependency_sorter: ^1.0.4
  qr_flutter: ^4.0.0
  settings_ui: ^2.0.1
  share_plus: ^9.0.0
  shared_preferences: ^2.0.5
  sign_in_button: ^3.2.0
  sliding_up_panel: ^2.0.0+1
  the_apple_sign_in: ^1.1.1
  url_launcher: ^6.0.6
  vibration: ^1.7.3
  video_player: any
  youtube_player_flutter: ^9.0.1
  flutter: 
    sdk: flutter
dev_dependencies: 
  flutter_launcher_icons: ^0.13.1
  flutter_lints: ^3.0.2
  flutter_test: 
    sdk: flutter
flutter_icons: 
  android: launcher_icon
  image_path: assets/images/app-icon.png
  ios: true
flutter: 
  assets: 
    - assets/cfg/
    - assets/images/
    - assets/images/avatars/
    - assets/images/avatars/teams/
    - assets/images/avatars/players/
    - assets/images/avatars/characters/
    - assets/images/shop/
    - assets/fonts/
    - assets/animations/
  fonts: 
    - 
      family: NovecentoSans
      fonts: 
        - 
          asset: assets/fonts/novecento-sans-condensed-medium.otf
  uses-material-design: true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.