pubs 0.2.0

  • Installing
  • Versions
  • 21

Pubs - tools for managing Pub packages.

Star this Repo Pub Package Build Status Coverage Status


pub global activate pubs
pub global run pubs



deployable is currently the only implemented command.

pub global run pubs deployable or just pubs deployable if you have ~/.pub-cache/bin added to your path, copies files necessary to deploy your Dart server application into one directory (build/bin by default), similar to pub build bin.

The steps it processes:

  • purge the output directory
  • copy content of bin to build/bin/
  • copy the content of all dependencies to build/bin/packages
  • create a build/bin/.packages file which links to the copied packages.
  • copy build/web to build/bin/web (optional)
  • create a ZIP file build/ containing all files from build/bin

Available options:

  • -o, --output-directory
    The absolute or relative path where the directory should be created.
    (defaults to "build/bin")

  • -b, --bin-directory
    The absolute or relative path to the directory containing the server application entry points.
    (defaults to "bin")

  • -p, --package-discovery-start The directory where the package discovery starts to find a .packages file or a packages directory. Default is the current working directory.

  • -s, --static-source A directory containing static files to copy into the deployable directory.
    (defaults to "build/web")

  • -t, --static-destination The destination directory inside the deployable directory, where to copy the static files to.
    (defaults to "build/bin/web")

  • -k, --[no-]skip-unused Use the analyzer to find which Dart source files are actually used and skip copying all others. If files are imported they will be copied, no matter if the code is actually used. This is no tree-shaking mechanism.

  • -i, --include Explicitly include files and directories of packages which are skipped when "skipUnused" is "true". For example resource files which are not referenced by any import statement.
    "include" is ignored when "skipUnused" is "false". The value needs to be a map as a valid JSON string. The key of the map is the name of the package and the value is a list of paths relative to the packages lib directory. Example {'mypackage': ['config/logconfig.json']}

  • -z, --[no-]create-zip Create a ZIP archive file containing all files copied to the outputDirectory.

  • -n, --zip-name The name of the created ZIP archive file.
    (defaults to "")

  • -h, --help Print this usage information.

Call it from Dart code (like Grinder)
final options = new BuildOptions()
  ..createArchive = true;
new BuildServerDeployable(options).runAll();

For more control you can call call the individual tasks like

new BuildServerDeployable(options)

Another option is to extend BuildServerDeployable

class MyServerDeployable extends {
  void runAll() {
    // add your custom methods before/after/in between as required      
  // - add your own methods
  // - override methods


  • update package_config dependency to 0.1.1
  • migrate to changed .packages file format ':' instead of '='


  • use package_config from hosted instead of Git.
  • fix Grinder task in test project
  • fix copying packages (calculating destination path)
  • fix tests


  • some fixes in the
  • fix homepage in pubspec.yaml


  • add introduction for deployable to the


  • Implement deployable command

1. Depend on it

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

  pubs: "^0.2.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:pubs/pubs.dart';
Version Uploaded Documentation Archive
0.2.0 Jul 15, 2015 Go to the documentation of pubs 0.2.0 Download pubs 0.2.0 archive
0.1.2 May 29, 2015 Go to the documentation of pubs 0.1.2 Download pubs 0.1.2 archive
0.1.1+5 May 26, 2015 Go to the documentation of pubs 0.1.1+5 Download pubs 0.1.1+5 archive
0.1.1+4 May 26, 2015 Go to the documentation of pubs 0.1.1+4 Download pubs 0.1.1+4 archive
0.1.1+3 May 26, 2015 Go to the documentation of pubs 0.1.1+3 Download pubs 0.1.1+3 archive
0.1.1+2 May 26, 2015 Go to the documentation of pubs 0.1.1+2 Download pubs 0.1.1+2 archive
0.1.1+1 May 25, 2015 Go to the documentation of pubs 0.1.1+1 Download pubs 0.1.1+1 archive
0.1.1 May 25, 2015 Go to the documentation of pubs 0.1.1 Download pubs 0.1.1 archive
0.1.0 May 25, 2015 Go to the documentation of pubs 0.1.0 Download pubs 0.1.0 archive


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

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

  • tool failures on Feb 14, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


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


Detected platforms: other

Primary library: package:pubs/pubs.dart with components: io, mirrors.


  • Fix lib/build_server_deployable.dart.

    Strong-mode analysis of lib/build_server_deployable.dart failed with the following error:

    line: 253 col: 15
    The getter 'file' isn't defined for the class 'Source'.

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 1 error(s) and 0 warning(s).

  • 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.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • 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 pubs.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.9.0 <2.0.0
analyzer ^0.25.0+1 0.25.2+1 0.31.1
ansicolor ^0.0.9 0.0.9
archive ^1.0.19 1.0.33
bwu_pub_client ^0.1.0 0.1.0+1
cli_util ^0.0.1+2 0.0.1+2 0.1.2+1
package_config ^0.1.1 0.1.5 1.0.3
path ^1.3.5 1.5.1
unscripted ^0.6.1+1 0.6.2
Transitive dependencies
args 0.13.7 1.3.0
async 2.0.3 2.0.4
charcode 1.1.1
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
csslib 0.13.7+1 0.14.1
html 0.12.2+2 0.13.2+2
http 0.11.3+16
http_parser 3.1.1
logging 0.11.3+1
matcher 0.12.1+4
mockable_filesystem 0.0.3
plugin 0.1.0 0.2.0+2
pub_semver 1.3.2
quiver 0.21.4 0.28.0
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
supports_color 0.1.1
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
when 0.2.0
which 0.1.3
yaml 2.1.13
Dev dependencies
bwu_grinder_tasks ^0.1.0
grinder ^0.7.2
test ^0.12.1