Juke.exec
now spawns processes with inherited stdio by default.- This means that stdout/stderr will not be available in the return value by default, but can be changed via
captureOutput: true
. - This API might be changed in the future.
- This means that stdout/stderr will not be available in the return value by default, but can be changed via
- Juke will properly exit with a non-zero exit code if any target has failed. As before, this is overridable via
Juke.setup().then((code) => ...)
.
new Juke.Target()
andnew Juke.Parameter()
constructors, which work the same way asJuke.createTarget()
andJuke.createParameter()
respectively. Constructors are more direct than creator functions, so using them is preferred.Juke.chdir()
was added as an easy way to change directories relative toimport.meta.url
.Juke.glob()
is now generally available for unix-style pathname pattern expansion.Juke.rm()
was added as a common file removal tool. It has a subset of Node 16 API but is compatible with Node 12, and has an built-in support for globs.Juke.setup()
accepts asingleTarget
mode setting, which reconfigures CLI to only accept one target and treat all the remaining arguments (not only flags) as this target's arguments.
- Compiled bundle was changed back to
index.js
fromindex.cjs
, because the latter was not compatible with the default Node.js resolver and TypeScript could not import type definitions properly.
- Added
args
to execution context, which basically passes through all the flags following the target.
- Juke.setup now returns a promise with exit code, same as before
- Replaced
??
syntax with a more compatible one for Node 12.
Re-released due to issues with packaging. Updated local juke build binary and removed unnecessary console logs.
Juke Build now supports ES modules as build scripts, which was a good opportunity to redesign the whole thing to support named exports. When target/parameter is exported, you may omit the name
property completely, and it will be automatically picked up from the name of the exported variable.
Targets are no longer automatically registered, and you must export them via export
keyword in ES modules, or module.exports
in CommonJS.
You must now call Juke.setup()
to point the executor to the build script that you want to parse/run:
// ES modules variant
Juke.setup({ file: import.meta.url });
// CommonJS variant
Juke.setup({ file: __filename });
Re-released due to issues with packaging.
Juke.exec
now returns useful data on completion, likecode
,stdout
,stderr
andcombined
(which isstdout
+stderr
).Juke.exec
accepts two new options as the last argument:silent
- Iftrue
, disables piping of its output tostdout
andstderr
.throw
- Iffalse
, it won't throw an exception on a non-zero exit code. Useful if you want to analyze the exit code via it'scode
variable it returns.
Juke.ExitCode
constructor is exposed in case if you want to throw a custom exit code in theexecutes
function and fail the target.- It is thrown like this:
throw new Juke.ExitCode(1)
- It is thrown like this:
With the help of dts-bundle-generator, Juke build is now only two files:
dist/index.js
dist/index.d.ts
dependsOn
,inputs
,outputs
, andonlyWhen
fields now all accept functions with execution context, and all of them can be async.- Async
dependsOn
will block initialization of the task runner due to the way dependency resolution is currently implemented. Prefer sync functions over async, otherwise use carefully.
- Removed the ability to pass arrays of functions to
executes
andonlyWhen
, because nobody will realistically use it, and it increases Juke's code complexity.
- Await
onlyWhen
conditions, which can possibly be async.
- Added
onlyWhen
property to targets for specifying build conditions.