Starting by porting bits of the PL javascript library and Google's Closure javascript library to enable some interesting scenarios.
The Dart Bag-of-Tricks ( BOT ) is hosted on pub.dartlang.org. Add the BOT package to your pubspec.yaml
file, selecting a version range that works with your version of the SDK. Always check the BOT page on pub to find the latest release.
See the changelog to find the version that works best for you.
If you'd like to track bleeding edge developments, you can reference the the GitHub repository directly:
dependencies:
bot:
git: https://github.com/kevmoo/bot.dart.git
0.Y.Z
.
Changes to the minor version - Y - will indicate breaking changes.
* Changes to the patch version - Z - indicate non-breaking changes.Array2d
Grouping
of collectionsReadOnlyCollection
RgbColor
, HslColor
with associated conversions back and forthRgbColor
supports to/from hexCoordinate
, Box
, Size
, Vector
, AffineTransfrom
FutureValue
: an abstract model for async conversions via Future<T>
SendPortValue
: an implementation of FutureValue
using isolates.hop
and added hop_unittest
dev dependencies.Array2d
no longer depends on deprecated types.AffineTransform
no longer depends on deprecated tyes.Enumerable.toReadOnlyCollection
is now deprecated.Box
is now deprecated.Cloneable
Disposable
and related classes.EventHandler
and related classes.@protected
annotation.Sequence
and ReadOnlyCollection
Box
and Rectangle
super class.Vector.length
and Coordinate.getDistance
.TarjanCycleDetect
class. Use top-level stronglyConnectedComponents
instead.topologicalSort
: great for figuring out dependencies.streamForEachAsync
: great for running a Future
for each item in a Stream
and pausing while the Future
executes.expandStream
: Like Stream.expand
but allows one to yield a sub-Stream
for each item in the source.bot
into sub-libraries.refresh
to ThrottledStream
bot_async
. Everything is just in bot
now.ThrottledStream
which basically replaces code removed for v0.25.0
bot_web
dart_async
. Recent changes to dart:isolate
make this code unusable. Will need a major refactoring.Box
, Vector
, and Coordinate
now align with the new Rectangle
and Point
classes in dart:math
Box.contains
is now inherited from Rectangle
and expects a Rectangle
. Use Box.containsPoint
instead.bot_async
bot_test
into its own package.pathos
to path
and moved to a dev dependencyhashCode
with ==
EventHandle
no longer extends StreamController
Tiny cleanup. Moved to latest SDK rev.
Sequence
learned itemsEqual
StringLineReader
learned bool get eof
and String peekNextLine()
String
, Iterable
and dart:html
.Enumerable
.ListBase
with Sequence
. Sequence does not implement List
,
but it does have an get indexer [int index]
.dart2js
and dart_analyzer
task on Windowsdartdoc
task on WindowsStream
for eventsAttachedEvent
addHandler
-> getStream
bool hasSubscribers
EventHandle
StreamController
from dart:async
fireEvent
, add
, remove
EventRoot
removed.GlobalId
removed.Property
addhandler
-> getStream
removeHandler
removedPropertyChangedEventArgs
FutureValue
outputChanged
, inputChanged
, error
are all now Stream
Dragger
dragStart
and dragDelta
are now Stream
ResourceLoader
progress
and loaded
are now Stream
AnsiColor
BOLD
and RESET
constsinstance.asBold()
methodConsole
static bool get supportsColor
: An initial attempt to let console apps know if the host console supports color output via a call to String format(bool useColor)
NEW! ShellString
String
-like value that stores a value and an AnsiColor
.MouseManager
cursorProperty
Stream
-basedcursor
style on the target CanvasElement
.Thing
, ThingParent
and Stage
invalidated
now Stream
TextureAnimationRequest.started
is now Stream
getHelpTask
has been removed. Now a config option on runHop
RootTaskContext
Printer
log
changed signature to take an Object
instead of String
. color
argument removed.printCore
removedRunner
is now completely static. All state is stored and passed in via new HopConfig
class.TaskLogger
learned finest
, finer
, and config
log levels.HopConfig
was renamed TaskRegistry
. A lot of members were hidden.createDartDocTask
method that returns a Task
. Supports postBuild
option. Smart defaults.getCompileDocsFunc
and compileDocs
>= 0.4.0+0
BaseConfig
to HopConfig
. BaseConfig
is new deprecated.HopConfig
learned doPrint
. Unifying all printing within hop to allow better redirection.Configuration
class.requiresArgumentContainsPattern
, which deprecates requiresArgumentMatches
.bench
- Output all final results as Duration. Include Standard Error.dart2js
- Added createDart2JsTask
method.bin/shell-completion-generator
that points to bin/shell_completion_generator.dart
COMP_WORDBREAKS
in completion script. No need to mess with these values.>= 0.3.7+6
vendor/dart.js
. Using version from browser
packagebin/shell_completion_generator.dart
for creating shell completion scripts compatible with completion logic in bot_io
Enumerable
learned expand
and deprecated selectMany
. Better alignment with Iterable
requireArgumentMatches
- match an argument against a Pattern
(String
or RegExp
)getDelayedResult
. See the docs. It's fun.requireArgumentValidSha1
- lot's of SHA1 hashes flying around. Nice helper.Tag
class. Represents info in a Git tag object.GitDir
getCommits
, getTags
, showRef
, showOrUpdateBranch
,
commitTree
getTimeoutFuture
enableScriptLogListener
- an easy way to write all log output to disk.example/bot_io/completion/
.sh
. Breaks folks who may be sourcing tool/hop-completion.bash
Task
description
argument to Task
constructors is now named (not positional)ArgParser
to allow completion of task flags.List<TaskArgument> extendedArgs
to fully document command line usage.ConsoleContext
ctor now takes ArgResults and a Task.TaskFailError
. Use TaskContext.fail
insteadgetHelpTask()
which allows hop help <command name>
bin/hop
shell script to pass quoted params fully and accurately to hop_runner.dart
Runner.runTask
.RunResult
now has a descriptive toString
bot_io
completion helpers.Task
features to document flags and argumentsexcludeLibs
and linkApi
flags.getBranchForDirTask
method--list
flag to show all filtered tests, without running them.dart:collection-dev
createDart2JsTask
arg liveTypeAnalysis
defaults to true
- matches `dart2js' impl changeCollectionUtil
: toHashMap
and toHashSet
deprecated.CollectionUtil
: added toMap
Enumerable
now uses join
from Iterable
so the default separator is now empty string
instead of ,
Enumerable
: toHashMap
and toHashSet
deprecated.Enumerable
: added toMap
StringLineReader
- Lazily read lines from a String
. Supports Windows line breaks, too.Util.splitLines
returns Iterable<String>
instead of List<String>
Util
learned padLeft
Commit
parses out a lot more information now.Git.runGit
argument processWorkingDir
is converted to a native path.
Works on Windows now.GitDir
can only be created via "safe", async methods: init
and NEW! fromExisting
GitDir
learned populateBranch
Matcher
finishes
and finishesWith
. These correspond to completes
and completion
in dart:matcher
except instances of ExpectException
are
thrown directly without being wrappedConsoleContext
makes it easy to run hop tasks directly from a console app.LogLevel
comes before message
.
More consistent with logging
compileDocs
now uses new fancy GitDir.populateBranch
.getImmediateFuture
addedhop-completion.bash
when hop is run outside of a "hop" directorycreateBenchTask
addedharness_browser.html
via DumpRenderTree
GitDir
learned getCurrentBranch
Runner
now takes param of ArgResults
Runner
exposes helpers for parsing defaults args and getting usage.runHopcore
prints out nice error info and exits cleanly with bad default argsTaskContext.getSubLogger
compileDocs
provides useful error info if used with bad argscreateDartAnalyzerTask
- thanks, Adam!pipeProcess
method for logging Process
output in real timeCommitReference
, BranchReference
, Commit
, TreeEntry
GitDir
learned getCommitCount
, getBranchNames
, getBranchReferences
, getCommit
, lsTree
GitDir.writeObject
renamed to writeObjects
branchForDir
added an optional workingDir
argumentlogging
dependency to >=v0.3.2
HslColor
DetailedArgumentError
is used incorrectlyrequireArgument
uses DetailedArgumentError
correctlyarguments
property on TaskContext
createUnitTestTask
now uses extra arguments to filter the set of tests that are runNo features were knowingly added, removed, or changed but a lot of code was churned to support the updated SDK.
bot_
prefix.import 'package:bot/bot_retained.dart';
instead of import 'package:bot/retained.dart';
Vector.getAngle
reports a valid valueArray2d
can now be zero width, and non-zero heightgetTimeoutFuture
helper. Wraps window.setTimeout
with nice Future
semantics.TempDir
IoHelper
MouseManager
ClickManager
Thing
instancesThing
instancesCanvasThing
now correctly invalidates child draw when transform changesexpectFutureComplete
and expectFutureFail
throwsAssertionError
matchercreateStartProcessTask
to createProcessTask
Task
args
argument optionaldescription
argumentcreateDart2JsTask
added named params liveTypeAnalysis
and rejectDeprecatedFeatures
dartdoc
now requires packageDir
param. With recent SDK updates,
one can now generate docs for libraries that use external packages.BREAKING Moved dependencies on SDK libraries to versions on pub.dartlang.org.
lerp
to top-level math functions.AffineTransform
fromTranslate
lerpTx
functionThing
alpha
-- or at least uses it nowdrawOverride
.
BREAKING Eliminated 'cacheEnabled' ctor argument.
BREAKING Removed clip
property. It wasn't doing anything.ShapeThing
constructor now uses named arguments.NavLayer
-- copied from the Javascript library. Pretty fun.HorizontalAlignment
and VerticalAlignment
RetainedUtil
learned getOffsetVector
SubCanvasThing
-- similar to ImageThing
, but for drawing contents of a canvas.TextThing
An element to display text. Lot's of work to do, but a good start.StageWrapper
- handles requesting frames and drawing them when the stage updates._RetainedEnum
as a relatively safe, private subclass for other enum types.requires
methods, DetailedArgumentException
io.Color
is now io.AnsiColor
prnt
and prntLine
. A bit silly, no?CanvasUtil
learned setTransform
CanvasUtil
to bot_html
libhop
back in. Circular dependencies just make no sense.qr
into its own repository.hop
files into tool
dir. These are for devs working with bot.dart
not end users.DetailedIllegalArgumentException
ctor is now const
_SimpleSet
. Not used.test
, dart2js
, and docs
to this new system.PElement.draw
renamed to _stageDraw
PElement.updated
event removedElementParentImpl
to ParentElement
PElement
to ParentElement
Add this to your package's pubspec.yaml file:
dependencies:
bot: "^0.28.0"
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.
Now in your Dart code, you can use:
import 'package:bot/bot.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.28.0 | Dec 29, 2014 |
|
|
0.27.0+2 | May 25, 2014 |
|
|
0.27.0+1 | May 13, 2014 |
|
|
0.27.0 | May 6, 2014 |
|
|
0.26.2 | Apr 11, 2014 |
|
|
0.26.1+1 | Mar 17, 2014 |
|
|
0.26.1 | Mar 17, 2014 |
|
|
0.26.0+1 | Feb 8, 2014 |
|
|
0.26.0 | Dec 10, 2013 |
|
|
0.25.3 | Nov 25, 2013 |
|
|
We analyzed this package on Apr 9, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
57 | / 100 |
Health:
Code health derived from static analysis.
[more]
|
90 | / 100 |
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
0 | / 100 |
Overall score:
Weighted score of the above.
[more]
|
56 |
Detected platforms: Flutter, web, other
No platform restriction found in primary library
package:bot/bot.dart
.
Fix analysis and formatting issues.
Analysis or formatting checks reported 9 errors 6 warnings 18 hints.
Strong-mode analysis of
lib/src/collection/enumerable.dart
failed with the following error:line: 22 col: 3
Invalid override. The type of 'Enumerable.map' ('((T) → dynamic) → Enumerable<dynamic>') isn't a subtype of 'Iterable<T>.map' ('<T₀>((T) → T₀) → Iterable<T₀>').Strong-mode analysis of
lib/src/collection/number_enumerable.dart
failed with the following error:line: 17 col: 45
The return type 'int' isn't a 'T', as defined by anonymous closure.Similar analysis of the following files failed:
lib/src/math/coordinate.dart
(error)lib/src/math/vector.dart
(error)lib/src/throttled_stream.dart
(warning)lib/src/collection/array_2d.dart
(hint)lib/src/collection/collection_util.dart
(hint)lib/src/color/hsl_color.dart
(hint)lib/src/color/husl_converter.dart
(hint)lib/src/graph.dart
(hint)lib/src/graph/topo_sort.dart
(hint)lib/src/math/affine_transform.dart
(hint)lib/src/math/size.dart
(hint)lib/src/require.dart
(hint)lib/src/string_line_reader.dart
(hint)lib/src/util.dart
(hint)
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 usebot.dart
.
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=1.0.0 <2.0.0 | ||
Dev dependencies | |||
bot_test | >=0.1.5 <0.3.0 | ||
browser | >=0.9.0 <0.11.0 | ||
hop | >=0.30.2 <0.32.0 | ||
hop_unittest | >=0.1.0 <0.2.0 | ||
unittest | >=0.9.0 <0.12.0 |