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

패키지 상세v1.5.0

derry

스크립트 단축키를 정의하고 쉽게, 효율적으로 사용할 수 있도록 도와주는 스크립트 관리자입니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
8.4천
좋아요
232
Pub 점수
140

패키지 설치

flutter pub add derry

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Derry는 플러터 개발자를 위한 가벼운 스크립트 관리 도구로, 사용자가 쉽게 맞춤형 스크립트 단축키를 정의하고 실행할 수 있도록 해줍니다. 반복적인 개발 작업을 간소화하여 재사용 가능한 명령어를 만들 수 있게 하여 봐일러플레이트를 줄이고, 다양한 플랫폼에서 작업 흐름의 효율성을 향상시킵니다. 플러터 프로젝트 내에서 더 빠르고 체계적인 스크립팅 기능을 원하는 팀과 개인 개발자에게 이상적입니다.

사용 사례

  • 빌드 프로세스 자동화
  • 테스트 스위트 실행 중
  • 배포 스크립트 관리
  • CI/CD 워크플로우 간소화
  • 프로젝트 설정 작업 실행

주요 기능

  • 스크립트 단축키 정의
  • 고성능 실행
  • 크로스 플랫폼 지원
  • 간단한 구성
  • 확장 가능한 명령 시스템

적합한 대상

  • Flutter 개발자
  • CI/CD 파이프라인 통합자
  • 팀 개발 환경
  • CLI 전문 사용자
  • 프로젝트 자동화 열광자

고려 사항

  • 수동 스크립트 설정이 필요합니다
  • 제한된 GUI 인터페이스
  • 명령줄 사용에 따라 다릅니다
  • 런타임 앱 로직용이 아님
  • 개발 전용 작업에 가장 적합

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Derry

Derry is a script manager for Dart.

Overview

Derry helps you define shortcut scripts, and save you from having to type very long and forgettable long lines of scripts, again and again.

Instead of running this every time,

dart run build_runner build --delete-conflicting-outputs

Add this to pubspec.yaml,

scripts:
  build: dart run build_runner build --delete-conflicting-outputs

and run

derry build

Installation

Install derry as a global dependency from pub.dev like this.

dart pub global activate derry

Then use derry to run a command from the current dart/flutter project.

derry [script]

Usage

When called, derry will look for a pubspec.yaml file in the current directory, and will throw an error if it doesn't exist. The scripts can be declared within the scripts node of the pubspec.yaml file.

scripts:
  build: dart run build_runner build
derry build
# or even with additional arguments
derry build -- --delete-conflicting-outputs

API Documentation

Use definition file

Scripts can be configured just inside the pubspec.yaml file or within a separate file. When using a separate file to configure scripts, pass the file name as the value of the scripts node in the pubspec.yaml file.

# pubspec.yaml
scripts: derry.yaml
# derry.yaml
build: dart run build_runner build

Use scripts as List

A script can either be a single string or a list of strings. If it is a list, the strings inside of the list will be executed synchronously in the given order of the list.

build:
  - dart test
  - echo "test completed"
  - dart run build_runner build

Nested scripts

Scripts can be nested as the user needed. For example, you can use them to use different implementations of the build script based on operating system.

build:
  windows:
    - echo 0 # do something
  mac:
    - echo 1 # do something else

And you can use them by calling derry build windows on windows and derry build mac on macOS.

Pre and post scripts

With pre & post scripts, you can easily define a script to run before and after a specific script without hassling with references. Derry automatically understands them from the names.

prepublish:
  - cargo build && copy target blob
  - dart test
publish:
  - dart pub publish
postpublish:
  - rm -rf blob

Configure script descriptions

You can add a string to (description) option, which can be useful when viewing through a list of available via derry ls -d command. When you are using (description) field, you must use (script) field to define scripts.

build:
  (description): script to be called after every update to x.dart file
  (scripts):
    - cat generated.txt
    - dart run build_runner build

Configure multiline scripts

Note that in the list of scripts, executions will happen in separate processes. You can use && to execute multiple scripts in the same process.

# > or | can be used to define multiline strings, this is a standard YAML syntax
build: >
  cat generated.txt &&
  dart run build_runner build

# the second line won't be called if generated.txt does not exist

Use references

When defining scripts, you can reference to other scripts via $ syntax. These references to scripts won't be executed with a separate derry process. For example,

test:
  - dart run test
  - echo "test completed"
build:
  - $test # instead of using derry test
  - $test --ignored # even with arguments
  - flutter build
generate:
  env:
    - echo env
release:
  - $generate:env # use nested references via :
  - $build

derry test will spawn a new derry process to execute, while references won't, reducing the time took to run dart code, and spawn that process. But note that references will take a whole line of script. For example, you have to give a separate line for a subcommand, you can't use them together with other scripts or sandwiched in a string.

List available scripts

Use this command to see what scripts are available in the current configuration.

derry ls # --description or -d to output descriptions

Check the location of the derry scripts

Use this command to see the location (both absolute and relative) path of the derry script file. You can also use this to check if the scripts are correctly formatted or the location is correct.

derry source # --absolute or -a to show absolute path

Upgrade derry

dart pub global activate derry # or
derry upgrade # will run `dart pub global activate derry`

Why & How

Honestly, I needed it. It was easy to make, though I had a hard time implementing the script execution. Since Dart's Process isn't good at executing system commands, I used Rust with the help of Foreign Function Interfaces. For execution, currently cmd is used for Windows and bash is used for Linux and Mac.


Currently Supported Platforms

64bit Linux, Windows, and Mac are currently supported.

카테고리

의존성

의존성 목록 10 개

소스 저장소

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