Giter VIP home page Giter VIP logo

dfn's Introduction

dfn: Dart as Functions + Scripting

Install via:

  • pub.dev: dart pub global activate dfn
  • local development: dart pub global activate -spath .
  • git repo: dart pub global activate -sgit https://github.com/Luckey-Elijah/dfn.git

Usage

Overview:

dfn <command> description
dfn core tool
dfn <script> run a registered script
dfn <args> forward args to dart run (tries scripts first)
dfn config for managing scripts (see add/rm)
dfn config add <script/path> for registering scripts
dfn config remove <script/path> for un-registering scripts (alias dfn config rm)
dfn list for showing all registered scripts (alias dfn ls)

Example:

  1. Register script(s):
$ dfn config add example # via "package" with a "scripts" directory
Registered 1 new script from /path/to/example/scripts
  - hello_from_folder -> /path/to/example/scripts/hello_from_folder.dart

$ dfn config add example/hello_from_standalone.dart 
Registered hello_from_standalone
  1. List all scripts:
$ dfn list
โœ“ 2 scripts available:
  - hello_from_standalone -> /path/to/example/hello_from_standalone.dart
  - hello_from_folder -> /path/to/example/scripts
  1. Run the scripts:
$ dfn hello_from_standalone
Hello from standalone file!

$ dfn hello_from_folder
Hello from script folder!
  1. Remove the scripts:
$ dfn config rm hello_from_standalone # rm or remove are both valid
Removed: /path/to/example/hello_from_standalone.dart

$ dfn config remove example # need to pass the directory for "packages"
Removed: /path/to/example
  1. Forward args to dart run:
$ dfn test:test test/some_test.dart

dfn's People

Contributors

dependabot[bot] avatar luckey-elijah avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

dfn's Issues

feat: check if `dfn` has updates

Description

dfn could routinely check if there are updates available for the tool

Requirements

  • when dfn is run and has not checked in the last ~48 hours for an update
  • could use https://pub.dev/api/packages/dfn and check a bundled version of the cli
  • write to dfn cache

feat: add script completions

Description

bash and zsh are shells that support code completion. There should be a command to enable code completions for the registered dfn scripts.

Requirements

  • add dfn config completion command
  • support zsh
  • support bash

Additional Context

Add any other context or screenshots about the feature request go here.

feat: Improve `--verbose` logging

Description

When --verbose logging is enabled, every step should be uniformly logged to the console.
Perhaps write meaningful information to a cache as well (user opt-in).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.