Closed lukeed closed 7 years ago
@lukeed
Please, ping me when API
will be stable for 2.*
release.
I work on a tool for migrating from one major version to other one for Fly
.
Basically, it will have web UI where owner of project, that uses Fly
, can add his repo, and then receive PRs from bot
that will scan flyfile
, detect old api parts, etc and suggest changes, that should be done.
@hzlmn Sounds awesome! Will do
@lukeed Hey, I'm writting backend for tool, and wondering, if you have any preferences for tech stack?
I was thinking about Python3.5
+ Aiohttp
and some sort of key-value storage (I pretty familiar with this stack, as used actively at work). For node.js
I thought about Koa
(I don't like callback nature of Express
).
@hzlmn I always write backends in Elixir...or PHP if the current team/project sets that limitation. I don't actually write much Node (Fly pretty much covers it, or other small CLI utilities), but the last time I wrote a web-related Node project, it was with Feathers.js. Although, it's based on express
.
Koa would be interesting, I haven't tried it. But if you wanted to keep the Koa / generator system, you could always just require tj/co
or bluebird
directly & wrap your callbacks.
@hzlmn API is largely complete. Only minor (internal) things may change.
Still working on examples, new docs & readme
@hzlmn Currently published with the beta
flag if you want to start fiddling with it. I haven't had time to write up an "Upgrade Guide" yet, but I surely will.
npm i -D fly@beta
@lukeed thx, will start playing with it.
I just want to say thank you for
Fly can be initialized anywhere programmatically
I've been doing this programmatically for awhile now, but it is basically a copy of how the CLI instantiated a task, so the code looks pretty awful compared to what a public api will look like.
const reporter = require('fly/lib/reporter');
const spawn = require('fly/lib/cli/spawn');
const creed = require('creed');
const path = require('path');
module.exports = function() {
creed.coroutine(spawn)(path.resolve(__dirname, '../../'))
.then(function onSpawn(fly) {
return reporter.call(fly)
.emit('fly_run', { path: fly.file })
.start(['build:dynamic'], { value: opts });
})
}
@akkuma you're welcome, great suggestion! All of the Fly tests use this method in case you need any examples while using the beta flag.
This area is reserved for notes, thoughts, and a (wip) changelog.
Please feel free to comment below 🙇
Notes
Todo
fly.target
(lol) & testsfly.watch
& testsfly.plugin
API definitionfly.plugin
this
instanceChangelog
0.12
to4.6
(LTS)--harmony
flagtj/co
withbluebird.coroutine
generatorsprototype
method must beyield
ed, for performance & consistencyfly.$
) must beyield
ed, for performance & consistencyEventEmitter
with built-inEventEmitter
API
fly.concat
andfly._.cat
fly.flatten
fly.unwrap
(usefly.$.expand
)fly.filter
(usefly.plugin
)fly.exec
(usefly.start
)fly.start
fly._
)fly
instance, if not alreadyopts
object in addition to atask
nameopts
may contain asrc
andval
opts.parallel
(see below)fly.init
ready
statusfly.serial
opts
to be shared & mutated by each chain memberfly.parallel
opts
across all members; does not cascadeyield
edfly.source
fly._.globs
andfly._.files
fly._.files
is an array of modifiedpathObject
s. Each entry consists of:dir
- the full directory path of the source filebase
- the file's name, including extensiondata
- aBuffer
of the file's contentsfly._.host
withfly._.tasks
Utilities
yield
ed, for performance & consistencyfly.$
expand
mkdir
)bind
defer
apply
diff
shallow-copy
arrayToMap
UnknownOption
andUnknownInput
error classes (see CLI)CLI
-m
and--mode
flagserial
tasks
cli.help
contentcli.list
output-f
and--file
to-p
and--pwd
process.cwd()
cli.spawn
withbluebird
yield
edUnknownOption
andUnknownInput
into generic CLI error handlercli.js
child_process.spawn
--harmony
flagPlugins
fly.filter
withfly.plugin
name
,opts
andfunc
name
will be used within fly; eg.babel()
name
, a unique replacment will be generated & used instead. Users will be notified of the conflict & namechange.opts
tell Fly how to run the pluginopts.files
- iftrue
then usefly._.files
else usefly._.globs
opts.every
- iftrue, apply the plugin to **each**
globor
file` individuallyfunc
is a generator method that binds to Fly, allowing you to use any method, including the helper methods (fly.$
)await
ed, which means that each subsequent plugin may read previous values (eg, modifieddata
values) and continue to alter/append custom values.Extras