Skip to content

Releases: stylemistake/juke-build

v0.9.0

20 Aug 07:51
Compare
Choose a tag to compare
v0.9.0 Pre-release
Pre-release

This release is planned to be reverted, because changes to Juke.exec have made build scripts randomly stall on Windows. Additionally, stdio passthrough also makes impossible to prefix the output with the target name (which is something we want to add).

Changed

  • 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.

v0.8.1

12 Aug 15:54
Compare
Choose a tag to compare

Fixed

  • 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) => ...).

v0.8.0

12 Aug 15:53
Compare
Choose a tag to compare

Added

  • new Juke.Target() and new Juke.Parameter() constructors, which work the same way as Juke.createTarget() and Juke.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 to import.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 a singleTarget mode setting, which reconfigures CLI to only accept one target and treat all the remaining arguments (not only flags) as this target's arguments.

Changed

  • Compiled bundle was changed back to index.js from index.cjs, because the latter was not compatible with the default Node.js resolver and TypeScript could not import type definitions properly.

v0.7.0

23 Jul 09:14
Compare
Choose a tag to compare

Added

  • Added args to execution context, which basically passes through all the flags following the target.

Changed

  • Juke.setup now returns a promise with exit code, same as before

v0.6.3

23 Jul 04:24
Compare
Choose a tag to compare

Fixed

  • Replaced ?? syntax with a more compatible one for Node 12.

v0.6.2

23 Jul 03:48
Compare
Choose a tag to compare

BREAKING CHANGES

Juke Build now supports ES modules as build scripts, but this also means that the whole thing was redesigned 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 });

Other setup options were removed. Default target is specified by export default syntax.

v0.5.1

04 Jul 20:25
Compare
Choose a tag to compare

v0.5.0 was skipped because it was built on an out-of-date base.

Added

  • Juke.exec now returns useful data on completion, like code, stdout, stderr and combined (which is stdout + stderr).
  • Juke.exec accepts two new options as the last argument:
    • silent - If true, disables piping of its output to stdout and stderr.
    • throw - If false, it won't throw an exception on a non-zero exit code. Useful if you want to analyze the exit code via it's code variable it returns.
  • Juke.ExitCode constructor is exposed in case if you want to throw a custom exit code in the executes function and fail the target.
    • It is thrown like this: throw new Juke.ExitCode(1)

Changed

With the help of dts-bundle-generator, Juke build is now only two files:

  • dist/index.js
  • dist/index.d.ts

v0.4.0

24 Jun 00:32
Compare
Choose a tag to compare

Added

  • dependsOn, inputs, outputs, and onlyWhen fields now all accept a function with an execution context (a function of format ({ get }) => ...), and all of them can be async. This means that you can easily parametrize every part of the build via CLI parameters.
  • 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

  • Removed the ability to pass arrays of functions to executes and onlyWhen, because nobody will realistically use it, and it increases Juke's code complexity.