API:
-
sh
function now accepts different set of options. Most importantly it does not acceptstdio
option anymore. By default it will be always instdio=pipe
mode forstdout
andstderr
process streams. It will also print out results to the terminal unlesssilent=true
option given. -
sh
function accepts alsotransform
option which allows to transform output of shell process. Usefull if we want to add prefixes to the output. -
introducing
prefixTransform
function. It is dedicated for usage along withsh
function as value fortransform
option.
API:
help
function as second argument now accepts onlystring
, for third argument accepts detailed help information aboutoptions
andparams
- removing
option
andoptions
helper, nowoptions
will be passed always as a first argument to the task - introducing
rawArgs
function, which returns raw, unparsed args which were provided to the task - renaming
run
function tosh
- introducing
cli
function which exposes tasks functions to the cli
Mechanics:
options
are always passed as a first argument to the task function- calling tasks occurs through
npx task
notnpx run
script or by callingtasksfile.js
directly (node tasksfile.js
). Tasks file now behaves like a CLI script - to be able to call tasks from
tasksfile.js
they must be exposed bycli
function. Exporting tasks functions won't do the job anymore. - to be able to call a task through
npx task
, entry tonpm scripts
must be added:"task": "node ./tasksfile.js"
.npx task
always try to executetask
npm script, it's just an alias. - namespaces now can have
default
task - removing autocomplete feature, as it required too much configuration and it seems not used by the users
- full support for
TypeScript
. Types files are included within the project. UsingTypeScript
fortasksfile
is possible. It just require different entry innpm scripts
:"task": "ts-node ./tasksfile.ts"
Other:
- renaming project from
runjs
totasksfile
- source code migrated from
Flow/Babel
toTypeScript
- adding experimental bash autocompletion feature
Changes:
- introducing
help
utility function - improving task docs generation by annotations
Dev env:
- improving e2e tests
- using external module
microcli
as for cli args parsing and--help
handling
- remove log option from
run
api command - upgrade dependent packages
- introducing
options
helper, deprecatingoption
- better printing of methods list when calling
run
For development env:
- add tests coverage check
- introducing
flow
types
Changes:
- removing
ask
andgenerate
helpers from api, to keep runjs codebase more focused about its main purpose - dropping support for
node
< 6.11.1 - support for other than
Babel
transpilers, likeTypeScript
- log option to run function, when
false
it does not log the command - documentation updates
- support for
async
/await
option
helper
Migration from 3.x to 4.x procedure:
- make sure you have node version >=6.11.1
- if you use Babel you need to add
"runjs": {requires: ["./node_modules/babel-register"]}
config to your package.json, otherwise Babel transpiler won't be picked up - find alternatives for ask and generate, those are not supported by runjs anymore
- changing documentation format for calling
run
without arguments (task documentation) - changing name of the prop for documentation from doc to help
- when typing
--help
option with task run it will provide documentation only for that task (run sometask --help
)
- migrating to
yarn
- removing task execution logging (decoration function) as it not working well with exporting pure functions
- passing task options through
this.options
inside a task function
- fixes within handling dashed arguments when calling tasks, dashed arguments can be "spaced" by "-" or "." now, for example:
--some-argument
or--some.argument
(#49)
- documenting tasks args when calling
run
without arguments - presenting list of available tasks from
runfile.js
in more readable way - passing
stdio
directly tospawn
/execSync
- changing run api where now it resolves/returns null by default and resolves/returns with value for option stdio: 'pipe'. This - allows to return colours to the terminal if provided by commands outcome.
- Bug fix: pass
process.env
by default tospawn
andexecSync
- fixes #43
stderr
maxBuffer exceeded error (usespawn
forasync
calls notexec
) runfile.js
example update in README- drops support for
node
< 4.8.0
- task name spacing/nesting, better for scaling tasks into many files
- task descriptions
ask
function- handling dash arguments in tasks (for example
--test
,-t
) - logging tasks arguments to console when executing tasks
- fixing exit codes when task not found
run
function returns an output of a command now- improving documentation
- deep code refactor, more unit tests
- bugfix: streaming
stderr
also forasync
process
- streaming output of an
async
command by default (run
api function)
- presenting straightforward message when no
runfile.js
found
- bringing backwards compatibility with
node
>= 4.0.0 (previouslynode
>= 6.0.0 required) run
command inasync
mode now returns aPromise
- handling config from
package.json
to define a custom path tobabel-register
- executing async commands through
child_process.span
(betterstdio
handling)
- removing watch method from api
- RunJS will fallback to pure node now if user
babel-register
not found (falling back to it's ownbabel-register
before) adding information to README: Why RunJS ? and other README update
- dropping Babel 5 support
- handling new
exports.default
after babel update
- more explicit exceptions
- handling existing
babel-register
orbabel/register
require hooks from the user package
- new functions available as part of runjs api:
watch
andgenerate
- broader README with extensive
runfile.js
example
- dropping
es5
andcoffeescript
support in favor ofes6
(handled by babel) - dropping support for
node
< 4.0