peanut 3.4.2

  • Readme
  • Changelog
  • Installing
  • 58

Pub Package Build Status

Do you ever want to pub run build_runner build into another branch? This is your ticket.

Install #

$ pub global activate peanut

Run #

$ cd ~/my_dart_proj/
$ peanut

This will build your project into a temporary directory, and then it will update the local gh-pages branch with its contents.

Flutter #

Flutter apps can be built by running peanut with the Flutter SDK.

Installing:

$ flutter pub global activate peanut

Running:

$ flutter pub global run peanut:peanut

Options #

$ peanut --help
Usage: peanut [<args>]

Arguments:
-d, --directories                The directories that should be built.
                                 (defaults to "web")

-b, --branch                     The git branch where the built content should
                                 be committed.
                                 (defaults to "gh-pages")

-c, --build-config               The configuration to use when running
                                 `build_runner`.

    --[no-]release               (defaults to on)
-m, --message                    (defaults to "Built <directories>")
    --[no-]source-branch-info    Includes the name of the source branch and SHA
                                 in the commit message
                                 (defaults to on)

    --post-build-dart-script     Optional Dart script to run after all builds
                                 have completed, but before files are committed
                                 to the repository.

    --builder-options            Builder options YAML or a path to a file
                                 containing builder options YAML.
                                 See the README for details.

    --[no-]verbose               Print more details when running.
    --dry-run                    Verifies configuration and prints commands that
                                 would be executed, but does not do any work.

-h, --help                       Prints usage information.
    --version                    Print the current version.

Configuration file #

You can also configure peanut with a configuration file. Convenient if you have one-off settings you'd rather not time you deploy.

The peanut.yaml from this repository:

# Configuration for https://pub.dev/packages/peanut
directories:
- example

Examples #

Git tricks #

The easiest way to push your gh-pages branch to github (without switching from your working branch) is:

$ git push origin --set-upstream gh-pages

To create (or update) your local gh-pages branch to match what's on the server.

$ git update-ref refs/heads/gh-pages origin/gh-pages

This is also useful if you want to undo a peanut run.

3.4.2 #

  • Fixes for running with Flutter.
  • Provide a helpful message when using the Dart SDK with a Flutter package.

3.4.1 #

  • Fix --version.

3.4.0 #

  • Flutter apps are now built if peanut is enabled using flutter pub global activate. Running flutter pub global run peanut:peanut will use the flutter CLI instead of build_runner

3.3.0 #

  • Parse command line arguments when a peaunut.yaml configuration file exists and merge the values, with a preference for the command line arguments. (Before, the configuration file values were ignored.)
  • Added verbose option. For now, it prints out all of the files deleted in the output directory.
  • Added --dry-run command-line flag which verifies the configuration and prints commands that would be executed, but does not do any work.

3.2.1 #

  • Added examples to README.

3.2.0 #

  • If post-build-dart-script is provided, pass a second command line argument after the build directory. A JSON map between the source directory relative to the working directory and the corresponding build directory.

3.1.1 #

  • Print a more helpful error when configuration is invalid.

3.1.0 #

  • Support configuring builder options.
  • Require Dart SDK >=2.3.0-dev.0.1 <3.0.0.

3.0.3 #

  • Improve printed output while running.
  • Updated dependencies.

3.0.2 #

  • Improve printed output while running.

3.0.1 #

  • Fix height of generated index.html page.
  • Include package:peanut version info in commit message.
  • Avoid creating commit messages with a first line longer than 72 characters.

3.0.0 #

  • BREAKING renamed diretory option to directories.
  • Added --[no-]source-branch-info flag.
  • Added --post-build-dart-script option.
  • Add support for peanut.yaml configuration.
  • Exclude *.md and *.yaml from output directory.
  • Require Dart SDK >=2.2.0.

2.0.8 #

  • Support the latest package:build_web_compilers and friends.

2.0.7 #

  • Support the latest package:build_runner and friends.

2.0.6 #

  • Improve --help output.

2.0.5 #

  • Support the latest package:build_runner.

2.0.4 #

  • Support Dart 2 stable.

2.0.3 #

  • Updates to support latest package:build_runner.

2.0.2 #

  • Require Dart >=2.0.0-dev.56.

  • Other updates to support running on Dart 2.

2.0.1 #

  • Support the latest version of package:build_web_compilers.

2.0.0 #

  • BREAKING Now only works with the latest package:build_runner and friends.

  • Removed manual file management that likely caused problems on Windows.

  • The public library has been removed. This package is meant to be an executable only.

1.1.6 #

  • Moved non-executable file out of /bin so it's not activated during pub global activate.

1.1.5 #

  • Run pub from the SDK invoking peanut. Also fixes the case where pub is not in the user's PATH.

  • Send all output to stdout.

  • Improve exit codes and error messages on failure.

1.1.4 #

  • Added **.dart.js.deps, **.dart.js.tar.gz, **.ng_placeholder to the set of files to exclude.

1.1.3 #

  • Only warn if the directory does not exist. Build could still work.

  • Update dependency on pkg:git. Allows running peanut in a subdirectory of a Git repository.

1.1.2 #

  • Support the latest pkg:git.

1.1.1 #

  • Improve sub-process management.

  • Print error/warnings in red – where supported.

1.1.0 #

  • Initial support for build_runner via --build_tool option.

  • Updated Dart SDK lower-bound to 2.0.0-dev.22. Using Iterable.whereType<T> – introduced in this release.

1.0.0 #

  • Set exit code correctly on errors.

0.1.0 #

  • Tweak some things.
  • Update readme.

0.0.2 #

  • Add mode options, to allow pub build to run in debug mode.

0.0.1+2 #

  • Run pub with runInShell to make things work on Windows.

0.0.1+1 #

  • Added instructions to README.md.

0.0.1 #

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate peanut

2. Use it

The package has the following executables:


$ peanut
Popularity:
Describes how popular the package is relative to other packages. [more]
16
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

We analyzed this package on Nov 19, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and peanut.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
args ^1.5.1 1.5.2
build_cli_annotations ^1.0.0 1.1.0
checked_yaml ^1.0.0 1.0.2
git ^1.0.0 1.0.1
glob ^1.1.5 1.2.0
io ^0.3.2+1 0.3.3
json_annotation ^3.0.0 3.0.0
meta ^1.0.0 1.1.8
path ^1.3.4 1.6.4
pub_semver ^1.4.0 1.4.2
yaml ^2.1.0 2.2.0
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
js 0.6.1+1
node_interop 1.0.3
node_io 1.0.1+2
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
Dev dependencies
build_cli ^1.0.0
build_runner ^1.0.0
build_verify ^1.1.1
build_version ^2.0.0
build_web_compilers >=1.0.0 <=3.0.0
json_serializable ^3.2.0
pedantic ^1.3.0 1.8.0+1
test ^1.6.0
test_descriptor ^1.1.1
test_process ^1.0.1