Run Pubspec Script (RPS)

Related tags

Templates rps
Overview

Run Pubspec Script (RPS)

Define and use scripts from your pubspec.yaml file.

Getting started

  1. Install this package.

    dart pub global activate rps
  2. Define script inside the pubspec.yaml

    name: my_great_app
    version: 1.0.0
    
    scripts:
       # run is a default script. To use it, simply type
       # in the command line: "rps" - that's all!
       run: "flutter run -t lib/main_development.dart --flavor development"
          # you can define more commands like this: "rps gen"
          gen: "flutter pub run build_runner watch --delete-conflicting-outputs"
          # and even nest them!
          build:
          android:
          # rps build android apk
          apk: "flutter build --release apk --flavor production"
          # rps build android appbundle
          appbundle: "flutter build --release appbundle --flavor production"
          # and so on...
    
    # the rest of your pubspec file...
    dependencies:
       path: ^1.7.0
  3. Use your custom command.

    Like this gen command that we defined in the previous step:

    rps gen

    instead of

     flutter pub run build_runner watch --delete-conflicting-outputs
  4. Safe a time and become a power user! 😈

    Less time typing long commands more time watching funny cats. 🐈

Hooks

You can use commands that will be executed before or after some command. Have a look at these scripts in the pubspec.yaml file.

scripts:
  test:
    before-echo: echo "before-test"
    echo: echo "test" 
    after-echo: echo "after-test"

Running rps test echo command produces following output:

test echo $ echo "test" test > test after-echo $ echo "after-test" after-test">
> test before-echo
$ echo "before-test"

before-test
> test echo
$ echo "test"

test
> test after-echo
$ echo "after-test"

after-test

Motivation

I got bored of typing the same long commands over and over again... I even got bored of pressing that boring (and even small on a MacBook) up arrow key to find my previous command in history. So, as befits a programmer, to save time, I spent more time writing this library than searching/writing commands for the last year...

stonks

Soon

  • Further hooks improvements.

Hey you! This package is still in development (bugs may occur 🐛 😏 ).

Comments
  • Terminal keeps busy after running command

    Terminal keeps busy after running command

    Hello, thanks for the great idea and package. I'm trying to run the rps command on the Macbook M1 machine. Commands run successfully but the terminal keeps showing a result message. I'm not able to run a new command without ctrl+c.

    scripts:
       # run is a default script. To use it, simply type
       # in the command line: "rps" - that's all!
       run: "flutter run -t lib/main.dart --flavor development"
       # you can define more commands like this: "rps gen"
       gen: "flutter pub run build_runner watch --delete-conflicting-outputs"
       build:
          android:
             apk-dev: "flutter build apk --dart-define FLAVOR=\"development\""
          ios:
             ipa-dev: "flutter build ipa --export-method ad-hoc --dart-define FLAVOR=\"development\""
    

    I'm running rps gen

    ❯ rps gen
    > gen
    $ flutter pub run build_runner watch --delete-conflicting-outputs
    

    And then the terminal keeps stuck as below

    Screen Shot 2022-07-20 at 13 26 31

    This works as expected

    > flutter pub run build_runner build --delete-conflicting-outputs
    
    opened by sezer 2
  • Missing script error

    Missing script error

    The readme shows script labels intended after run:

    scripts:
       # run is a default script. To use it, simply type
       # in the command line: "rps" - that's all!
       run: "flutter run -t lib/main_development.dart --flavor development"
          # you can define more commands like this: "rps gen"
          gen: "flutter pub run build_runner watch --delete-conflicting-outputs"
    

    but this results in a missing script error.

    Being not super familiar with yaml syntax I didn't see the problem and couldn't figure it out until I noticed in this project's pubspec.yaml, the test: label is not indented beyond run:.

    bug 
    opened by jibbers42 1
  • Duplicated `version` outout

    Duplicated `version` outout

    For some reason on run it on windows as rps --version the output is duplicated:

    image

    Environment

    Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "windows_x64"
    
    Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 18116933e7 (4 months ago) • 2021-10-15 10:46:35 -0700
    Engine • revision d3ea636dc5
    Tools • Dart 2.14.4
    
    bug nofix 
    opened by alexrintt 1
  • Packages upgrades

    Packages upgrades

    I really like rps, good job!

    I upgraded some updated packages and I made some fixes to improve the package score.

    My motivation was due the outdated ffi package.

    opened by udiedrichsen 0
  • Multiple commands

    Multiple commands

    Hey there! Great library.

    Can you define multiple commands to be run within the same keyword?

    scripts:
       run:
          "fvm flutter pub clean"
          "fvm flutter pub get"
          "fvm flutter pub run build_runner watch --delete-conflicting-outputs"
    

    Because otherwise we have to do the following which is really not ideal:

    scripts:
       run: "fvm flutter pub clean && fvm flutter pub get && fvm flutter pub run build_runner watch --delete-conflicting-outputs"
    
    opened by om-ha 0
Owner
Kamil Klyta
Dart (Flutter), TypeScript/JavaScript (React, Node.js) full stack developer.
Kamil Klyta
Extract pubspec details (such as package version, author and description) into Dart code.

build_pubspec This package helps you convert fields from your pubspec.yaml file into Dart code. Based on the fields in your pubspec, this package will

dartside.dev 9 Jul 15, 2021
Asset manager helps you auto-generate the assets code and add it to your pubspec.yaml .

Asset Manager Asset manager helps you auto-generate the assets code and add it to your pubspec.yaml . Quick start dart pub global activate asset_manag

Rutvik Tak 9 Nov 1, 2022
A package script for allowing coverage test tool to see all Dart files

full_coverage Coverage tools like codecov only see the files that were actually triggered by tests. This means that a coverage of 100% can easily be a

Flutterando 2 Mar 18, 2022
A script to disable and re-enable CORS checks for Flutter's Chrome instance

A script to disable and re-enable CORS checks for Flutter's Chrome instance Note This script only disables CORS checks for local testing, and will not

Rexios 26 Nov 15, 2022
Flutter Multi-platform allows developers to unleash their app to run on the wide variety of different platforms with little or no change.

Flutter Multi-platform sample Flutter Multi-platform allows developers to unleash their app to run on the wide variety of different platforms with lit

MindInventory 22 Dec 31, 2022
An E-Commerce application developed on Flutter, which helps to run the app on Android / IOS / Windows's OS / MacOS / Web Browser from a single codebase

BuySmart An E-Commerce application developed on Flutter, which helps to run the app on Android / IOS / Windows's OS / MacOS / Web Browser from a singl

Sumit Kumar 11 Oct 10, 2022
Learn how to build a tensorflow model on Techable Machine and then run it on flutter app.

Ml With Flutter Learn how to build a tensorflow model on Techable Machine and then run it on flutter app. Youtube Tutorial Show Support Recommend Me O

Sanskar Tiwari 133 Jan 3, 2023
This is the standard Flutter template application, modified to run on desktop.

Desktop Flutter Example This is the standard Flutter template application, modified to run on desktop. The linux, macos, and windows directories serve

Sheikh Shofiullah 8 Sep 26, 2022
Run your MIT App Inventor projects on (nearly) any operating system!

xaif Run your MIT App Inventor projects on (nearly) any operating system! This tool is in an early development phase, see the disclaimer below. Prereq

null 14 Oct 17, 2022
Just collection of UI designs build with flutter. Can run on any mobile, web & desktop.

Flutter UI Designs True cross platform app runs on web, mobile & desktop Download Requirements to run locally Flutter stable v2.0.0+ Dart VM version:

Hamza Iqbal 222 Dec 28, 2022
Win32 runner - Run a Flutter app without needing a lick of C/C++ code. Just Dart

Experimental package for running Flutter apps from a Dart runner, instead of the

Tim Sneath 51 Sep 25, 2022
Flutter cloud functions - A sample project demonstrating how to run backend tasks in Flutter

Flutter Cloud Functions A sample project demonstrating how to run backend tasks

Souvik Biswas 2 Feb 15, 2022
Helper app to run code on Aliucord iOS via websocket.

aliucordebug A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Zoey 2 Jan 25, 2022
Integration Test Preview allows tests on multiple screen sizes in a single e2e test run.

Integration Test Preview has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage (using Android and iOS pl

The Mobile Applications Community 3 Aug 23, 2022
This is an application that uses the Flutter framework, SQFLite as a database to record blood pressure, blood sugar, BMI, or create medication reminders in multi mobile platforms You can run this project on iOS, Android

This is an application that uses the Flutter framework, SQFLite as a database to record blood pressure, blood sugar, BMI, or create medication reminders in multi mobile platforms You can run this project on iOS, Android

null 14 Dec 29, 2022
Schedule & run Dart code in the background on both Android & iOS

flt_worker The flt_worker plugin allows you to schedule and execute Dart-written background tasks in a dedicated isolate, by utilizing the WorkManager

Yingxin Wu 26 Nov 27, 2022
Bluecherry DVR client to run across range of devices. 💙

Bluecherry Client Bluecherry DVR client to run across range of devices. Website • Purchase • Chat [work-in-progress] Download iOS (coming soon) Androi

null 9 Dec 2, 2022
A CLI for syncing Dart dependency versions between pubspec.yaml and pubspec.lock files.

lockpick A CLI for syncing Dart dependency versions between pubspec.yaml and pubspec.lock files. ?? Usage # Activate lockpick pub global activate lock

Jeroen Meijer (Jay) 34 Oct 17, 2022
Ens resolver script - Super simple ENS/Address Resolver Dart Script

Ens resolver script - Super simple ENS/Address Resolver Dart Script

null 1 Feb 20, 2022