peanut 3.5.1

  • Readme
  • Changelog
  • Installing
  • 54

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.


$ flutter pub global activate peanut


$ flutter pub global run peanut:peanut

Options #

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

-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

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

    --canvas-kit                 Builds Flutter web apps with CanvasKit.
-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
- 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.5.1 #

  • Added .dart_tool/** to the default exclude set.
  • Require Dart SDK >=2.6.0 <3.0.0.

3.5.0 #

  • Added --canvas-kit flag for Flutter web.

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

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
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: parsing /dart-sdk/lib/async/async.dart... parsing /dart-sdk/lib/collection/collection.dart... parsing /dart-sdk/lib/internal/internal.dart... parsing /dart-sdk/lib/convert/convert.dart... parsing /dart-sdk/lib/typed_data/typed_data.dart... parsing /dart-sdk/lib/core/core.dart... parsing /dart-sdk/lib/math/math.dart... parsing /dart-sdk/lib/developer/developer.dart... parsing /dart-sdk/lib/isolate/isolate.dart... parsing /dart-sdk/lib/ffi/ffi.dart... parsing /dart-sdk/lib/html/dart2js/html_dart2js.dart... parsing /dart-sdk/lib/html/html_common/html_common_dart2js.dart... parsing /dart-sdk/lib/web_gl/dart2js/web_gl_dart2js.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/native_typed_data.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/interceptors.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_helper.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/foreign_helper.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_names.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/rti.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart... parsing /dart-sdk/lib/js_util/dart2js/js_util_dart2js.dart... parsing /dart-sdk/lib/html/html_common/metadata.dart... parsing /dart-sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart... parsing /dart-sdk/lib/svg/dart2js/svg_dart2js.dart... parsing /dart-sdk/lib/web_audio/dart2js/web_audio_dart2js.dart... parsing /dart-sdk/lib/web_sql/dart2js/web_sql_dart2js.dart... parsing /dart-sdk/lib/_http/http.dart... parsing /dart-sdk/lib/io/io.dart... parsing /dart-sdk/lib/js/dart2js/js_dart2js.dart... parsing /dart-sdk/lib/js/_js.dart... parsing /dart-sdk/lib/mirrors/mirrors.dart... parsing /dart-sdk/lib/html/dartium/nativewrappers.dart... parsing /dart-sdk/lib/cli/cli.dart... parsing /dart-sdk/lib/wasm/wasm.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_primitives.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart... Initialized dartdoc with 37 libraries in 28.9 seconds documenting peanut Validating docs... no issues found Documented 0 public libraries in 1.5 seconds stderr: Documenting peanut... Unhandled exception: dartdoc could not find any libraries to document #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:196:7)

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/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
args ^1.5.1 1.6.0
build_cli_annotations ^1.0.0 1.2.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.4
json_annotation ^3.0.0 3.0.1
meta ^1.0.0 1.1.8
path ^1.3.4 1.6.4
pub_semver ^1.4.0 1.4.4
yaml ^2.1.0 2.2.0
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
js 0.6.1+1
node_interop 1.0.3
node_io 1.0.1+2
source_span 1.7.0
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.9.0
source_gen ^0.9.5
test ^1.6.0
test_descriptor ^1.1.1
test_process ^1.0.1