Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rbcprolabs/dpm

📦 Dart Package Manager
https://github.com/rbcprolabs/dpm

dart dpm flutter package-manager pub

Last synced: about 2 months ago
JSON representation

📦 Dart Package Manager

Awesome Lists containing this project

README

        

Logo



Run commands upon installing & upgrades packages, powerful package management with CLI. Flutter compatible!



Pub


Features •
How to use •
Available Commands

# Features

- Lightweight
- Productive development
- Fast!

# How to use
```bash
$ pub global activate dpm
```

To use packages that integrate with `dpm`, you should run
`dpm get` instead of `pub get`.
Then, all installed packages will have their `get` dpm run.

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

You can run `dpm link` to link executables into `.dpm_bin`.

# Running your own scripts
It is very likely that you want to run your own scripts during
development, or upon package installation. To do so, edit your
`pubspec.yaml` as follows:

```yaml
name: foo
# ...
scripts:
build: gcc -o foo src/foo.cc
post_get:
- dart_gyp configure
- dart_gyp build
post_upgrade: echo ":)"
```

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

Then, in your project root, you can run:
```bash
$ dpm build
```

# Available Commands
* [add](#add)
* [remove](#remove)
* [get](#get)
* [init](#init)
* [upgrade](#upgrade)

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

```bash
# Install the newest version, and apply caret syntax
$ dpm add my-package

# Install a specific version
$ dpm add my-package@^1.0.0
$ dpm add [email protected]+25
$ dpm add "my-package@>=2.0.0 <3.0.0"

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

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

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

# Install multiple packages
$ dpm add my-package my-other-package yet-another-package

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

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

## Remove
Can be used to remove dependencies without need go to file.

```bash
# Remove specific package
$ dpm remove my-package

# Remove multiple packages
$ dpm remove my-package my-other-package
```
## Get
This script simply runs `pub get`.

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

## Upgrade
This script simply runs `pub upgrade`.