패키지, 저장소 및 앱 카테고리 검색

패키지 상세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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.

순위