scripts 1.0.0-dev

  • README.md
  • Installing
  • Versions
  • 42

scripts

Run commands upon installing Dart packages, and more. It would be nice if all of these features were eventually integrated into the main pub executable. Until then, this will do.

Usage

$ pub global activate scripts

To use packages that integrate with scripts, you should run scripts get instead of pub get. This will run pub get, and then install package executables into a .scripts-bin directory. Then, all installed packages will have their get scripts run.

Also replace pub upgrade with scripts upgrade. This will run get scripts as well.

You can run scripts link to link executables into .scripts-bin.

Running your own Scripts

It is very likely that you want to run your own scripts during development, or upon package installation. Do as follows in your pubspec.yaml:

name: foo
# ...
scripts:
  build: gcc -o foo src/foo.cc
  get:
  - dart_gyp configure
  - dart_gyp build

Installed dependencies with executables will automatically be filled in to the PATH during script execution.

Then, in your project root, you can run:

$ scripts build

Available Commands

clean

Removes the .scripts-bin directory, if present.

get

This script simply runs pub get, and then calls link.

init

Essentially an npm init for Dart. This command will run you through a series of prompts, after which a pubspec.yaml will be generated for you.

install

Can be used to install dependencies without having to search the Pub directory for the current version.

# Install the newest version, and apply caret syntax
$ scripts install my-package

# Install a specific version
$ scripts install my-package@^1.0.0
$ scripts install my-package@0.0.4+25
$ scripts install "my-package@>=2.0.0 <3.0.0"

# Install a Git dependency
$ scripts install my-package@git://path/to/repo.git

# Specify a commit or ref
$ scripts install my-package@git://path/to/repo.git#bleeding-edge

# Install a local package
$ scripts install my-package@path:/Users/john/Source/Dart/pkg

# Install multiple packages
$ scripts install my-package my-other-package yet-another-package

# Install to dev_dependencies
$ scripts install --dev http test my-package@git://repo#dev

# Preview new `pubspec.yaml`, without actually installing dependencies,
# or modifying the file.
$ scripts install --dry-run my-experimental-package

Creates symlinks to each dependency (in future versions, I will eliminate symlink use), and also creates executable files linked to any dependencies that export executables.

reset

Runs clean, followed by get.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  scripts: "^1.0.0-dev"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:scripts/scripts.dart';
        
Version Uploaded Documentation Archive
1.0.0-dev Nov 24, 2016 Go to the documentation of scripts 1.0.0-dev Download scripts 1.0.0-dev archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
63 / 100
Overall score:
Weighted score of the above. [more]
42

Platforms

Detected platforms: Flutter, other

Primary library: package:scripts/scripts.dart with components: io.

Suggestions

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Package is pre-release.

    Pre-release versions should be used with caution, their API may change in breaking ways.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use scripts.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0
angel_cli ^1.0.0-dev 1.0.0-dev+18 1.2.0+5
args ^0.13.7 0.13.7 1.3.0
console ^2.2.4 2.2.4
html ^0.12.0 0.12.2+2 0.13.2+2
http ^0.11.3 0.11.3+16
id ^1.0.15 1.0.16
path ^1.4.0 1.5.1
yaml ^2.1.12 2.1.13
yamlicious ^0.0.5 0.0.5
Transitive dependencies
async 2.0.3
charcode 1.1.1
collection 1.14.5
csslib 0.13.7+1 0.14.1
glob 1.1.5
http_parser 3.1.1
logging 0.11.3+1
matcher 0.12.1+4
meta 1.1.2
quiver 0.22.0 0.28.0
quiver_iterables 1.0.1
random_string 0.0.1
source_span 1.4.0
stack_trace 1.9.1
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
vector_math 1.4.7 2.0.5
watcher 0.9.7+7
Dev dependencies
test ^0.12.15