lukeed / taskr Goto Github PK
View Code? Open in Web Editor NEWA fast, concurrency-focused task automation tool.
License: MIT License
A fast, concurrency-focused task automation tool.
License: MIT License
This may be an issue with the Parsec
package itself, but when using the fly
CLI it parses arguments in a strange way. Instead of throwing an error when an incorrect flag has been passed it will ignore what it doesn't parse as valid and attempt to run whatever command it may find. It should not be parsing potential flags from incorrect flags; it should require the exact flag needed and nothing more. Some examples:
fly -vdf
// > fly, 0.3.4
// returns the version, should throw an error that -vdf is not a valid flag
fly -l12312312312
//> Available tasks
//> default
// returns available tasks, should throw an error
fly -12345
//> [11:02:59] Flying with /Users/xxxx/xxxx/flytest/Flyfile.babel.js...
//> [11:02:59] -12345 not found in Flyfile.
// any argument with a preceeding - should be considered a flag, not a task
It should work much like the node
CLI does, and throw errors if the flags are not valid.
node -v
// > v0.12.0
// returns node version
node -v123
// > node: bad option: -v123
// throws appropriate error
CLI arguments are one thing that should require strict equality between whats defined and whats passed at runtime.
Currently fly supports "node": ">= 0.11.16", but co fly are using supports"node": ">= 0.12.0". What do you think about to update supporting version to same version with co?
Instead of
[06:51:36] Finished "default" in 24420 ms
Display
[06:51:36] Finished "default" in 24.4 s
Hi, can you help me understand what am I doing wrong?
export default async function () {
this.watch([paths.scripts], ["build"]);
}
export async function build () {
await this.clear(paths.lib);
await this
.source(paths.scripts)
.babel({ stage: 1, optional: ["bluebirdCoroutines"] })
.target(paths.lib);
}
Flyjs doesn't continue watching files, though. It executes once on start, then exits. What's wrong with my setup? I've tried swapping async/await for generators, same results.
I am running iojs 2.4.0 on Ubuntu 15.04
[17:06:13] Flying with .../flyfile.babel.js...
[17:06:13] Starting "default"
[17:06:13] Watching files...
[17:06:13] Starting "build"
[17:06:13] Finished "default" in 6 ms
[17:06:14] Finished "build" in 945 ms
git:(master) ✗
parallel
option to run filter application to expanded glob → files
in parallel (almost 40% faster according to my eye-percent tests). In the future we want to run tasks in parallel as well.main
is no longer treated as the default task. Default tasks are either a task named default
or the default export from your Flyfile.util.js
from core and put into its own module. This module is already published and fully tested.This can be passed via options directly from the Flyfile, but maybe plugins could hide this bit and provide direct support to produce sourcemaps by default or via only one option.
Thoughts?
@watilde @kashiro @morishitter
@MadcapJake @iamstarkov
@DrKraken @TrySound
Check whether Fly honors file extensions if the last filter does not return { extension: ".." }
.
For example:
yield this.source("coffee/src/**/*.coffee")
.coffee()
.uglify()
.target("coffee/dist/")
If uglify
does not set the file extension, Fly should use whatever extension set by coffee
and so on.
link allows you to symlink directories into your node_modules
folder. You type npm link
inside your plugin's directory and it creates a symlink into your global node packages directory. Then type npm link fly-pluginName
inside a test app directory and npm will symlink your plugin into your test app's node_modules
.
Due to fly checking package.json
and that npm link
does not add anything to package.json
, fly does not work with symlinked packages.
Currently, a workaround is npm install --save path/to/plugin
or just to add your symlinked package manually with
"fly-pluginName": "file:./node_modules/fly-pluginName"
I think that fs.readdir might be a solution to searching the node_modules
directory but I am not sure how it handles directories or how it handles symlinks.
Can you please tell me why I would use Fly? I am using gulp now. Thanks.
This is good catch: wendux/fly#47
How about to add the following sentence to the guideline for creating fly-plugin? This make things possible to search awesome plugins easily.
Set
fly-plugin
to the keyword field in your package.json.
why does we need it inside? https://github.com/flyjs/fly/blob/master/src/fly.js#L134-L149
Just upgraded to 0.4 - was having problems with 0.3.3/0.3.4 that seemed to be related to the Node 0.12 template string issue you noted in fly-utils
.
Switched to iojs 2.3.4 and reinstalled/rebuilt everything. Now I'm getting this when trying to use the CLI:
Error: Cannot find module '/Users/me/my_project/dist'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Function.Module.runMain (module.js:471:10)
at startup (node.js:117:18)
at node.js:948:3
I've tried naming the Flyfile - Flyfile.babel.js
& later - Flyfile.js
, flyfile.js
as this issue seemed to recommend: #64
On OS X 10.10.4
dove into fly source code and cannot get who fly can use babel for Flyfile.babel.js. can you help me?
From #53
Internal implementation changed since 0.2.0
causing async/await
syntax to break.
Tasks do run but the await
does not cause the function to exit and later reentered.
This could be solved adding support into tj/co
directly. This will be revised after tests land in 0.3.0
.
I was reading API docs and didnt found "quickstart" linked in the bottom
https://github.com/flyjs/fly/blob/master/docs/README.md#api
https://github.com/flyjs/fly/blob/master/docs/quickstart
Fly supports plugins written in ES6. Let's use this feature 😄
What if user needs to use version 1 of library X, but fly-X always ships with the latest version? How should we deal with this?
Hey there,
What would the plan be for using Browserify/Watchify with Fly? Does it require a plugin to work, or will the fact that Browserify supports streams already (see how it works with Gulp OOTB) mean that we could avoid having a wrapper unnecessarily?
Are there any issues having import
's in your Flyfile, specifically for Browserify transformers?
Cheers
gaze
from deps.add
and unlink
to the watcher.Fly.prototype.reset
should be private.When trying to test the quickstart guide against 0.3.4
I found that fly
is now throwing an error when running or query tasks from a Flyfile
with ES6 syntax.
stack:
- ~/.dev/flytest/Flyfile.babel.js:1
- (function (exports, require, module, __filename, __dirname) { export default f
- ^^^^^^
- SyntaxError: Unexpected token export
- at exports.runInThisContext (vm.js 73:16)
- at Module._compile (module.js 443:25)
- at Object.Module._extensions..js (module.js 478:10)
- at Module.load (module.js 355:32)
- at Function.Module._load (module.js 310:12)
- at Module.require (module.js 365:17)
- at require (module.js 384:17)
- at Object.list (~/.npm-packages/lib/node_modules/fly/dist/cli/list.js 28:14)
- at callee$0$0$ (~/.npm-packages/lib/node_modules/fly/dist/index.js 81:13)
- at tryCatch (~/.npm-packages/lib/node_modules/fly/node_modules/babel-runtime/regenerator/runtime.js 67:40)
message:
"""
~/.dev/flytest/Flyfile.babel.js:1
(function (exports, require, module, __filename, __dirname) { export default f
^^^^^^
Unexpected token export
"""
This did not occur prior to 0.3.4
as far as I tested, and I am able to reproduce with a clean install of fly
on my machine. This also does not occur when using ES5 syntax.
Say 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.
Support this.
why does fly cli use shell runner?
isnt it bad experience for windows users?
It's common thing to increase issues arising from using old version of module. How about to put update-notifier for to be able to receive an update of fly version in CLI?
Hey there, wanted to check Fly out but have had no luck so far.
I have a file in my root called Flyfile.babel.js
with the following task in it:
export async function log() {
this.log("Yesssss");
}
My package.json
has the following packages in it:
{
// ...
"devDependencies": {
"babel-eslint": "^3.1.1",
"babel-plugin-rewire": "^0.1.5",
"babelify": "^6.1.1",
"better-console": "^0.2.4",
"brfs": "^1.4.0",
"browser-sync": "^2.7.1",
"browserify": "^9.0.8",
"browserify-shim": "^3.8.7",
"chai": "^2.3.0",
"chai-as-promised": "^5.0.0",
"connect-history-api-fallback": "^1.1.0",
"envify": "^3.4.0",
"eslint": "^0.21.0",
"eslint-plugin-react": "^2.3.0",
"fly": "^0.1.11",
"fly-babel": "^0.1.1",
"fly-eslint": "^0.1.0",
"fly-mocha": "^0.1.3",
"fly-uglify": "^0.1.0",
"gulp": "^3.8.11",
"gulp-autoprefixer": "^2.3.0",
"gulp-if": "^1.2.5",
"gulp-imagemin": "^2.2.1",
"gulp-less": "^3.0.2",
"gulp-minify-css": "^1.0.0",
"gulp-mocha": "^2.0.1",
"gulp-nodemon": "^2.0.3",
"gulp-notify": "^2.2.0",
"gulp-plumber": "^1.0.0",
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.4",
"jsdom": "^5.4.1",
"mocha-jsdom": "^0.3.0",
"mocha-notifier-reporter": "^0.1.1",
"mocha-sinon": "^1.1.4",
"react-iscroll": "0.0.4",
"react-test-tree": "^0.1.6",
"reactify": "^1.1.1",
"sinon": "^1.14.1",
"sinon-as-promised": "^4.0.0",
"strictify": "^0.2.0",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"vinyl-transform": "^1.0.0",
"watchify": "^3.1.1",
"yargs": "^3.9.1"
},
"dependencies": {
"axios": "^0.5.4",
"babel": "^5.1.13",
"babel-core": "^5.3.1",
"body-parser": "^1.13.2",
"cheerio": "^0.19.0",
"child-process-promise": "^1.1.0",
"classnames": "^2.1.1",
"common-history": "0.0.1",
"deep-diff": "^0.3.2",
"eventwheel": "^0.3.1",
"express": "^4.12.4",
"flummox": "^4.0.0-alpha",
"html-entities": "^1.1.2",
"isomorphic-fetch": "^2.0.2",
"jquery": "^2.1.4",
"konami-keyboard": "0.0.1",
"lodash": "^3.8.0",
"node-jsx": "^0.13.3",
"promisify-node": "^0.1.5",
"query-string": "^2.1.0",
"quinn": "^3.2.1",
"react": "0.13.2",
"react-google-maps": "1.3.1",
"react-router-component": "^0.24.4",
"scroll": "git+https://github.com/studionone/scroll.git",
"serve-favicon": "^2.2.1",
"swig": "^1.4.2",
"verge": "^1.9.1"
},
"jshintConfig": {
"esnext": true
},
"browserify": {
"transform": [
"browserify-shim"
]
},
"browserify-shim": {
"google": "global:google"
}
}
I have also installed Fly (and fly-babel
, and babel
itself) globally, but it simply won't work. The error I receive is:
✗ fly -f Flyfile7.babel.js
stack:
- ~/Work/Projects/viewfinder-1.3/code/Flyfile7.babel.js:1
- (function (exports, require, module, __filename, __dirname) { export async fun
- ^^^^^^
- SyntaxError: Unexpected reserved word
- at exports.runInThisContext (vm.js 53:16)
- at Module._compile (module.js 414:25)
- at Object.Module._extensions..js (module.js 449:10)
- at Module.load (module.js 356:32)
- at Function.Module._load (module.js 311:12)
- at Module.require (module.js 366:17)
- at require (module.js 385:17)
- at Object.callee$0$0$ (/usr/local/Cellar/nvm/0.25.1/versions/io.js/v2.0.2/lib/node_modules/fly/dist/cli/spawn.js 30:16)
- at tryCatch (/usr/local/Cellar/nvm/0.25.1/versions/io.js/v2.0.2/lib/node_modules/fly/node_modules/babel-runtime/regenerator/runtime.js 67:40)
- at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/Cellar/nvm/0.25.1/versions/io.js/v2.0.2/lib/node_modules/fly/node_modules/babel-runtime/regenerator/runtime.js 315:22)
message:
"""
~/Work/Projects/viewfinder-1.3/code/Flyfile7.babel.js:1
(function (exports, require, module, __filename, __dirname) { export async fun
^^^^^^
Unexpected reserved word
"""
This is being run on iojs
-- would that be causing the issue? What's the go here?
chalk has a great community and mature enough. what is wrong with it?
There is a https://github.com/pstadler/flightplan package. And it's CLI is also uses fly as a bin name.
Scroll to bottom for screencast.
mkdir fly-sandbox && cd $_
npm i fly fly-eslint
touch Flyfile.js source.js
Flyfile.js
console.log('Flyfile.js 1');
exports.main = function* () {
yield this
.source('./source.js')
.eslint();
}
source.js
console.log('source.js')
$(npm bin)/fly main
Flyfile.js 1
stack:
- TypeError: Cannot read property 'filter' of undefined
- at plugins (~/Desktop/fly-sandbox/node_modules/fly/dist/util.js 247:14)
- at Object.callee$0$0$ (~/Desktop/fly-sandbox/node_modules/fly/dist/cli/spawn.js 49:38)
- at tryCatch (~/Desktop/fly-sandbox/node_modules/fly/node_modules/babel-runtime/regenerator/runtime.js 67:40)
- at GeneratorFunctionPrototype.invoke [as _invoke] (~/Desktop/fly-sandbox/node_modules/fly/node_modules/babel-runtime/regenerator/runtime.js 297:22)
- at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (~/Desktop/fly-sandbox/node_modules/fly/node_modules/babel-runtime/regenerator/runtime.js 100:21)
- at onFulfilled (~/Desktop/fly-sandbox/node_modules/fly/node_modules/co/index.js 64:19)
- at ~/Desktop/fly-sandbox/node_modules/fly/node_modules/co/index.js 53:5
- at co (~/Desktop/fly-sandbox/node_modules/fly/node_modules/co/index.js 49:10)
- at toPromise (~/Desktop/fly-sandbox/node_modules/fly/node_modules/co/index.js 117:63)
- at next (~/Desktop/fly-sandbox/node_modules/fly/node_modules/co/index.js 98:29)
message: Cannot read property 'filter' of undefined
Thanks.
Thanks for participating in this project. Please leave your comments, feedbacks and/or suggestions below. 👍
Suppose I have a function that transforms a source of data asynchronously. How do I create a plugin for this function?
The current strategy for error formatting inside plugins is that plugins are responsible for their special formatting needs.
The following is fine, since Fly will catch that plugin's task's error and show some output, but in the future plugins should trace errors more gracefully.
module.exports = function () {
return this.filter("pluginName", (src, opts) => {
try {
return ....
} catch (e) {
this.notify("plugin_error", { plugin: "pluginName", { ... } })
throw e
}
})
}
Specially stack traces we can use prettyjson
for the output.
I am thinking something along the lines of
function trace (e) {
error(pretty.render(e)
.replace(/(\sFunction|\sObject)\./g, `${fmt.blue("$1")}.`)
.replace(/\((~?\/.*)\)/g, `(${fmt.gray("$1")})`)
.replace(/:([0-9]*):([0-9]*)/g, ` ${fmt.yellow("$1")}:${fmt.yellow("$2")}`)
.replace(new RegExp(process.env.HOME, "g"), "~")
)
return process
}
I prefer gulp, so I will prefer use lowercased filename for fly config
Hi!
Looks like Fly not respects files order.
I'm trying to implement ng-filesort
plugin, code works fine and returns files in right order, but .concat
can't see it.
Plugin code:
const ngDeps = require('ng-dependencies')
const R = require('ramda')
function collectFileDep(file) {
var deps = ngDeps(file.data);
return {
file: file,
deps: deps,
dependencies: deps.dependencies,
modules: R.keys(deps.modules)
}
}
function sortDeps(depFiles){
if(!depFiles || depFiles.length === 0){
return []
} else {
var declaredModules = R.uniq(R.reduce(function(modules, dep){
return modules.concat(dep.modules)
}, [], depFiles))
var classifiedByDeps = R.groupBy(function(dep){
if (0 < R.intersection(declaredModules, dep.dependencies).length){
return 'depended'
} else {
return 'independed'
}
}, depFiles)
return classifiedByDeps.independed.concat(sortDeps(classifiedByDeps.depended))
}
}
function sortFiles(files){
return R.map(function(depFile){
return depFile.file
}, sortDeps(R.map(function(file){
return collectFileDep(file)
}, files)))
}
module.exports = function (){
this.ngFilesort = function(options){
this.unwrap().then(function(files){
return sortFiles(files)
})
return this
}
}
Hello,
Is it possible to use the ES7 async/await syntax with fly ? I have seen it is already available for node with https://github.com/yortus/asyncawait , without any major gotchas. I really like this syntax compared to yield/askterisks, and I think it would ease the transition when ES7 specifications will come to Node.js (presumably end 2016 ?). What do you think ?
See => wendux/fly#6
See: https://github.com/pstadler/flightplan. It's a library for deployment scripts and it also uses the fly
name for the binary. I don't know if it's a big issue, just telling.
The same code pass on node
but error in iojs:
[SyntaxError:node_modules/fly-babel/index.js:2
return this.filter("babel", (src, opts) => {
^^
Unexpected token =>]
Just stumbled on this project. I was wondering if compatibility with gulp-plugins is something that is feasible to achieve.
Working on this ASAP.
We also need a strategy for testing plugins reliably. This will be included in the generator @DrKraken.
Fly tests should land in 0.2.0
.
EDIT: Fly tests should land in 0.3.0
I think this is the most important topic and post it in own issue.
We shouldn't let any plugins have access to another. In this case we need to initialize every plugin call with own instance which will be initialized with some properties of previous instance.
I am not completely against this. I find filter
an acceptable name, but I agree transform is also a great one. I also like reduce
.
See #1 for more information.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.