搜尋套件、儲存庫與 APP 分類

套件詳情v2.16.0

cli_pkg

用於發布 Dart CLI 套件的 Grinder 任務。

macOSWindowsLinux
近 30 天下載
7.6萬
喜歡數
23
Pub 分數
110

安裝套件

flutter pub add cli_pkg

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

cli_pkg 是一個 Dart 套件,旨在簡化命令列介面(CLI)套件的發佈流程。它提供 Grinder 任務,可自動化常見的發布工作流程,例如版本管理、測試和產生發佈說明。由 sass-lang.com 開發並託管於 GitHub,支援 macOS、Windows 和 Linux,非常適合維護跨平台 CLI 工具的開發者。該套件與 Flutter 和 Dart 生態系統無縫整合,在套件發佈過程中減少手動步驟。

適用情境

  • 自動化 CLI 包發佈
  • 管理 CLI 項目的版本控制
  • 產生發行說明
  • 跨平台 CLI 開發
  • 優化CI/CD流程

主要特色

  • 預定義的 Grinder 任務
  • 版本升級自動化
  • 發行說明產生
  • 跨平台支援
  • 與 Dart pub 的整合

適合對象

  • Dart CLI 工具維護者
  • 開源套件發行者
  • CI/CD 流水線整合商
  • 使用 Grinder 的開發人員
  • 管理頻繁發佈的工作團隊

使用建議

  • 需要磨床設定
  • 僅限 CLI 套件工作流程
  • 依賴 GitHub 進行發佈工作流程
  • 不適用於非CLI套件
  • 需要手動設定以實現自訂發佈邏輯

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Dart CLI Packager

This package provides a set of Grinder tasks that make it easy to release a Dart command-line application on many different release channels, to Dart users and non-Dart users alike. It also integrates with Travis CI to make it easy to automatically deploy packages.

To use this package, import package:cli_pkg/cli_pkg.dart and call pkg.addAllTasks() before calling grind():

import 'package:cli_pkg/cli_pkg.dart' as pkg;
import 'package:grinder/grinder.dart';

void main(List<String> args) {
  pkg.addAllTasks();
  grind(args);
}

The following sets of tasks are provided, each of which can also be enabled individually:

It's strongly recommended that this package be imported with the prefix pkg.

Configuration

This package is highly configurable, using ConfigVariable fields defined at the top level of the library. By default, it infers as much configuration as possible from the package's pubspec, but almost all properties can be overridden in the main() method:

import 'package:cli_pkg/cli_pkg.dart' as pkg;
import 'package:grinder/grinder.dart';

void main(List<String> args) {
  pkg.name.value = "bot-name";
  pkg.humanName.value = "My App";

  pkg.addAllTasks();
  grind(args);
}

ConfigVariables whose values are expensive to compute or that might fail under some circumstances can also be set to callback functions, which are called lazily when the variables are used by the Grinder tasks:

import 'package:cli_pkg/cli_pkg.dart' as pkg;
import 'package:grinder/grinder.dart';

void main(List<String> args) {
  pkg.githubReleaseNotes.fn = () => File.read("RELNOTES.md");

  pkg.addAllTasks();
  grind(args);
}

Each task describes exactly which configuration variables it uses. Configuration that just applies to one set of tasks is always prefixed with a corresponding name. For example, pkg.jsFlags applies to JavaScript compilation.

所屬分類

依賴

依賴清單 25 項

原始碼儲存庫

使用此套件的專案