Skip to content

Releases: lukeed/taskr

v0.6.0

16 Aug 18:04
Compare
Choose a tag to compare
  • Improve build workflow by removing dist from repository and using npm 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 any String.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

15 Aug 17:28
Compare
Choose a tag to compare
  • 💥 Fix Fly's own flyfile.js to compile with fly. If you have fly installed globally just type fly to compile fly, otherwise type bin/index. For full instrumentation type: DEBUG="fly*" fly or env 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 using fly-* 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 correct this 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

03 Aug 11:37
Compare
Choose a tag to compare
  • 💥 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 using babel-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="*" or DEBUG="fly:*" for extensive logs. See debug'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 out n 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 at bin/index before).
  • improve index.js is much simpler now. a new Fly instance is created via cli.spawn which hides the complexity of resolving the path and cli.list does not accept a path anymore, but a loaded flyfile object.
  • change Flypath.js is no longer a valid name for a Flyfile. Please , name your Flyfiles either flyfile.js or Flyfile.js.
  • bugfix Fly.prototype.watch was failing due to fly-util watch not being correctly exported and not calling flatten 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. Please yield watch tasks from now:

export default function* () {
  yield this.watch(globs, tasks)
}
  • change Fly.prototype.warn was renamed to the more accurate alert.

v0.3.3

15 Jul 14:54
Compare
Choose a tag to compare
  • 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 inside node_modules.
  • Improve: Better error handling and stack tracing across Fly. No more silent crashes.
  • Update: reporter.js and fmt.js to latest fly-util
  • Remove: Flyfile.js from root and use Flyfile.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.

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

05 Jul 22:04
Compare
Choose a tag to compare
  • Important: Default tasks named as main will be deprecated in 0.2.0. Please update your code accordingly. (This "feature" was originally introduced in v0.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 in bin/index.js and this it is now encapsulated in index.js
  • Now util just exports console.log.bind(console) and console.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

05 Jul 07:17
Compare
Choose a tag to compare

v0.1.6

  • Fly now uses your module actual default export as its default task. Before you needed to name your task default 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 argument error was shadowing function name error. :feelsgood:
  • Fix bug in util.find/hook that was still breaking the require hook for some type of files. Basically the problem is jsVariant 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 a module 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 both earlgray and earlgray-runtime if you are using Flyfile.eg files. See examples/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 a module property was being called causing Flyfiles in languages other than ES5/6/7 to fail.

v0.1.3

04 Jul 15:41
Compare
Choose a tag to compare
  • Revise CLI engine, minor refactoring.
  • Fixed critical bug in util.plugins where CLI engine was failing to load if there were no listed plugins.
  • util.plugins renamed to util.searchPlugins
  • Bug fix: Rename main in package.json from dist/index to dist/index.json.

v0.1.1

04 Jul 07:28
Compare
Choose a tag to compare
  • 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 run fly 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

03 Jul 15:26
Compare
Choose a tag to compare
  • Multi-Flyfile Support (ES6/ES7/Coffee/etc)
  • Plugin API update
  • watch API update

See CHANGELOG.