パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.2

sort_pubspec_dependencies

pubspec.yaml 内の依存関係および開発依存関係を並べ替えるための Flutter/Dart パッケージ

AndroidiOSLinuxmacOSWindows
30日間ダウンロード
11.4万
いいね数
6
Pub ポイント
160

パッケージをインストール

flutter pub add sort_pubspec_dependencies

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

pubspec.yaml ファイル内の依存関係と dev_dependencies を自動的に並べ替える開発ツール。このパッケージは、依存関係の順序を一貫して整然としていることを保証し、Flutter プロジェクトの読みやすさと保守性を向上させます。Flutter CLI とシームレスに統合されており、開発者は簡単なコマンドで依存関係を並べ替えられます。コードスタイルの基準を遵守するチームや、依存関係管理が重要な大規模アプリケーションの維持管理に最適です。

用途

  • きれいな pubspec.yaml ファイルを維持する
  • チームプロジェクトにおける一貫した依存関係の順序の強制
  • CI/CD 中での依存関係のフォーマットを自動化
  • 依存関係リストの可読性の向上
  • マージコンフリクトの解決を簡素化する

主な機能

  • 依存関係の自動並べ替え
  • シンプルな CLI インテグレーション
  • dependencies および dev_dependencies の両方をサポートしています
  • 既存の構造とコメントを保持する
  • すべての主要プラットフォームと互換性があります

適している対象

  • Flutter開発者
  • チームベースのプロジェクトメンテナー
  • CI/CD パイプライン統合ツール
  • コード品質の提唱者
  • 頻繁な依存関係の更新を行うプロジェクト

注意事項

  • カスタムフォーマットを使用した場合、並べ替え後に手動での確認が必要になる場合があります
  • 実行時での使用を想定していません
  • 依存関係のバージョンを検証しません
  • pubspec.yaml ファイルの構造にのみ影響します
  • Dart SDK 2.15 以上が必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Description

A Dart CLI tool for sorting dependencies in your pubspec.yaml file.

Keep your pubspec.yaml organized by alphabetically sorting dependencies: and dev_dependencies:. This tool ensures better readability and consistency across projects.

Features

  • Sorts dependencies and dev_dependencies alphabetically.
  • Maintains additional metadata for dependencies (e.g., paths, Git URLs and refs, version constraints).
  • CLI support for easy integration into development workflows.
  • The package is implemented exclusively using Dart tools, there are no transitive dependencies.
  • Lightweight and fast.

Installation

Add sort_pubspec_dependencies as a dev dependency in your project:

dev_dependencies:
  sort_pubspec_dependencies: <latest-version>

Usage

Run the tool locally

dart run sort_pubspec_dependencies

Options

You can create a sort_dependencies.yaml config in the root of your project for:

  • Your pubspec.yaml is located outside the main project directory, you can explicitly specify the path to it using the key: pubspecPath
  • If you want to run flutter pub get after sorting, set the value true to the key needRunPubGetAfterSorting

The sort_dependencies.yaml example:

pubspecPath: 'pubspec.yaml'
needRunPugGetAfterSorting: true

Also, you can run the tool via dart run sort_pubspec_dependencies --pubspec-path=<path>/p=<path> --with-run-pub-get to avoid creating a config and get the same effect

Conclution

Feel free to modify this template to suit your preferences or project needs

Also, you can open issues with a description of the problem if you find unexpected behavior

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。

ランキング