Releases: lukeed/taskr
v0.6.0
- Improve build workflow by removing
dist
from repository and usingnpm prepublish
step to compile Fly. - 💥 💥 Fix encoding bug that was corrupting non-text files. Now Fly can read/filter/write any type of files, but there is a minor caveat:
Now filters and plugins, will receive the raw data as opposed to a string. This means if the filter/plugin is expecting a string, (for example
fly-coffescript
expects the source code to compile as a string) you need to convert the data to a string before you can call anyString.prototype
methods on it.
For example:
export default function* () {
yield this
.source("words.txt")
.filter((data) => `${data}\n`)
.target("dist")
}
or
export default function* () {
yield this
.source("words.txt")
.filter((data) => data.toString() + "\n")
.target("dist")
}
Documentation, examples and existing plugins have been updated.
- 💥 Following up on the above mentioned fix,
Fly.proto.encoding
has been deprecated starting from this@0.6.0
.
v0.5.0
-
💥 Fix Fly's own
flyfile.js
to compile with fly. If you have fly installed globally just typefly
to compile fly, otherwise typebin/index
. For full instrumentation type:DEBUG="fly*" fly
orenv DEBUG="fly*" fly
. -
💥 Upgrade to
parsec@1.3.0
that featured a complete rewrite and several improvements. -
💥 Fix bug where plugin closures created by
Fly.proto.filter
where bound to the fly instance.filter
instead of the Fly instance that would exist during concurrent execution.Loading plugins (invoking each plugin's default export function) occurs only once during Fly's instantiation by the CLI. Some plugins may inject dependencies directly into the Fly instance or use
Fly.proto.filter
at this time. Before,.filter
would create a closure by means of an arrow function bound to the new Fly instance. This would break concurrent tasks usingfly-*
plugins as described by #73.Each task running in parallel is invoked bound to a copy of the Fly instance which is obtained via
Object.create(fly)
. This fix does not bind the closure created in.filter
to any object, thus the correctthis
reference to any Fly instance is always picked up. -
Fix encoding issue during
.source
→.target
simple file copies of non-text files. Fixes #72 -
Fix bug in
Fly.proto.target
where target directory name was not specified, and only the new file name was used to copy to target. The result was each.target
write operation would create a flat tree skipping subdirectories and writing everything to the target directory. -
Improve
Fly.proto.target
with more instrumentation and simplify recursive reduce filter. -
Improve multi tasking examples under
examples/multi
. -
Review examples directory and refactor inconsistencies.
v0.4.0
-
💥 new in addition to Flyfiles, plugins can now be written in ES6/7 out of the box. To accomplish this, node's
require
is bound usingbabel-core/register
before loading plugins.Support for plugins written in any language is under discussion.
-
💥 new Flyfiles are transpiled by default with Babel. This adds a small perf penalty when running a modified flyfile the first time, but will allow us to support more versions of node in the future.
-
💥 new full tests! Check out
test/
. -
💥 new instrumentation 🔦 Set
DEBUG="*"
orDEBUG="fly:*"
for extensive logs. Seedebug
's documentation for advance use. -
💥 new [Optional] plugins are now invoked with a contextualized
debug
object that can be used to add instrumentation to your plugin.this.debug
is also available, useful to debug tasks in a flyfile.
export default function (debug) {
debug("init")
//
debug("finish")
}
You are not required to instrument your plugins, but now it's very easy to do so and your users will appreciate the effort you put in making your code easier to debug.
- new
examples/watch
to illustrate a watch task. - improve tests are now written in a mix of ES5 and ES6. if you are hacking on Fly and want to run the tests yourself, you need to run
iojs
. Check outn
for an excellent version manager for node. - improve revise documentation, fix typos, simplify and add more examples.
- improve more concise comments, simplify CLI engine.
- improve simpler and friendlier shell runner
bin/index
. Full Windows support is just around the corner. - improve errors are handled in
index.js
now (they were atbin/index
before). - improve
index.js
is much simpler now. a newFly
instance is created viacli.spawn
which hides the complexity of resolving the path andcli.list
does not accept a path anymore, but a loadedflyfile
object. - change
Flypath.js
is no longer a valid name for a Flyfile. Please , name your Flyfiles eitherflyfile.js
orFlyfile.js
. - bugfix
Fly.prototype.watch
was failing due tofly-util
watch
not being correctly exported and not callingflatten
on the specified globs. - change fix an inconsistency where a
default
task with a watch would end before any tasks ran inside. This bug was resolved by returning a promise.
This affects
watch
tasks in your Flyfile. Pleaseyield
watch tasks from now:
export default function* () {
yield this.watch(globs, tasks)
}
- change
Fly.prototype.warn
was renamed to the more accuratealert
.
v0.3.3
- Refactor:
fly.js
largely rewritten. Sharper code, cleaner syntax, don't overuse recursive reducers. 5~10% less LOC. - Bugifx: ES7 using
async/await
now works as expected. - Bugfix:
cli/spawn.js
was crashing if no plugins were found insidenode_modules
. - Improve: Better error handling and stack tracing across Fly. No more silent crashes.
- Update:
reporter.js
andfmt.js
to latestfly-util
- Remove:
Flyfile.js
from root and useFlyfile.babel.js
instead. - Improve: Documentation and code comments.
Multitasking
-
Run tasks in parallel via
Fly.prototype.run([tasks], { parallel: true })
.Imagine you have 10 functions that implement an asynchronous transformation on a data source, each taking about 1 minute to complete. Assume these functions are truly async by relying on native extensions or Node's IO API.
Assign each transform to a different task. If you run all tasks sequentially you will have to wait at least 10 minutes. If you run all tasks in parallel you will have to wait at least 1 minute.
- See
examples/multi
for examples.
- See
New Examples
-
Examples are now organized in directories by category, such as
multi
,async
,maps
,css
,lint
, etc. Each directory contains one or more Flyfiles describing related tasks. To run the examples, install its dependencies first using Fly:fly -f examples/
See examples/README.
Cascading Tasks
- Important: Default tasks named as
main
will be deprecated in0.2.0
. Please update your code accordingly. (This "feature" was originally introduced inv0.1.0
)
Cascading Tasks
Inpired by Koa.js cascading middleware.
- Now it's possible to return a value from a task and receive it in the task executing right after. This opens the door to other ways for tasks to interact with each other.
This change is possible without breaking the API and easily by making Fly.prototype.start([tasks])
return a promise. Up until now start
was used in by the CLI engine in /index.js
and by Fly.prototype.watch()
to run tasks without checking on the return value.
This change also fixes a bug that was causing the reporter to incorrectly display the default
task as finished before time sometimes.
Basically it works as follows:
export function* first () {
return { secret: 42 }
}
export function* second ({ secret }) {
this.log(`The secret is ${secret}`)
}
export default function* () {
yield this.start(["first", "second"])
}
See examples/Flyfile-Start.babel.js
.
- Code refactoring and comments improvement in
fly.js
,index.js
,util.js
- The
co
-routine used in the CLI is no longer required inbin/index.js
and this it is now encapsulated inindex.js
- The
- Now
util
just exportsconsole.log.bind(console)
andconsole.error.bind(console)
, this may change in the future if Fly needs to provide a different low level logging mechanism. - Updated documentation in English and 日本語.
- Earl Gray's dependencies were removed. Please
npm i earlgrey earlgrey-runtime
if you are writing Flyfiles in Earl Gray.
v0.1.3~0.1.6
v0.1.6
- Fly now uses your module actual default export as its
default
task. Before you needed to name your taskdefault
explicitly which is fine the CommonJS syntax:
exports.default = function* () {}
But was problematic in the ES6~ syntax since default
is a reserved word in JavaScript. Now it's also possible to do:
module.exports = function* () {}
Which is specially useful if you write your Flyfiles in the ES6/7 syntax:
export default function* () {}
v0.1.5
- Fix bug in
util.error
, where function's argumenterror
was shadowing function nameerror
. - Fix bug in
util.find/hook
that was still breaking the require hook for some type of files. Basically the problem isjsVariant
either exposes an array with dependencies that should be loaded or a string. In the case of arrays its contents could be strings or object literals with amodule
property. The following check patches this:
require(modules[0].module
? modules[0].module
: modules[0])
Note to Earl Gray users:
interpret@0.6.2
does not support earl at the moment. Please refer to this PR. Make sure to install bothearlgray
andearlgray-runtime
if you are usingFlyfile.eg
files. Seeexamples/Flyfile.eg
for an Earl Gray Flyfile example.
v0.1.4
- Fix bug in
util.find/hook
where jsVariants that expose the transformer module name using an array without amodule
property was being called causing Flyfiles in languages other than ES5/6/7 to fail.
v0.1.3
v0.1.1
-
Now Fly uses Fly to build itself. See
Flyfile.babel.js
at the root of the project. -
Improved error tracing.
This should be useful during development. In the future advanced error tracing should be configurable via
process.env.DEVELOPMENT
. -
Add consistent support for multiple Node versions.
-
Support Flyfile, flyfile, Flypath and flypath mapped to all the available
jsVariant
extensions by default when you runfly
on the command line.
Before you had to use fly -f path/to/file
in order to run a specific Flyfile. You can still use -f
, but now Fly will automatically attempt to load Flyfiles based in the extension automatically.
- Improve handling of globs by allowing nested arrays (See
util.flatten
). - Improve documentation and revise CONTRIBUTING.md
Fly now speaks ES6/7 and drinks Coffee
- Multi-Flyfile Support (ES6/ES7/Coffee/etc)
- Plugin API update
watch
API update
See CHANGELOG.