Skip to content

Releases: dsherret/dax

0.11.0

28 Aug 17:35
c3feef8
Compare
Choose a tag to compare

Stdout and stderr are now inherited by default.

There are several reasons for doing this:

  1. It's more efficient.
  2. I find myself writing a lot of commands without needing to capture the majority of the time.
  3. There are now helper methods like const text = await `some_command`.text(), which will automatically capture when necessary and people should prefer using those.
  4. Helps keep stdout and stderr printed in order (#17)

Note especially point 3. You should be using the .text(), .json(), .lines() methods which will automatically configure the command to capture. If you need more similar helper methods then please open an issue.

Old Default

If you want the old default, you can use the command builder to create a custom $ like so and set stdout and stderr to "inheritPiped", which will inherit and pipe at the same time:

import {
  build$,
  CommandBuilder,
} from "...";

const commandBuilder = new CommandBuilder()
  .stdout("inheritPiped")
  .stderr("inheritPiped");
  
const $ = build$({ commandBuilder });

0.10.0

25 Aug 16:18
Compare
Choose a tag to compare

$.logIndent(...) is deprecated and replaced with a new $.logGroup that works similarly to console.group and console.groupEnd. You can still provide just a function though as it handles de-indenting for you when errors are thrown.

// log indented within (handles de-indenting when an error is thrown)
await $.logGroup(async () => {
  $.log("This will be indented.");
  await $.logGroup(async () => {
    $.log("This will indented even more.");
    // do maybe async stuff here
  });
});

// or use $.logGroup with $.logGroupEnd
$.logGroup();
$.log("Indented 1");
$.logGroup("Level 2");
$.log("Indented 2");
$.logGroupEnd();
$.logGroupEnd();

0.9.0

04 Aug 23:51
Compare
Choose a tag to compare
  • feat: add .printCommand() for outputting a command's text before running the command

For example:

const text = "example";
await $`echo ${text}`.printCommand();

Outputs:

> echo example
example

Instead of just:

example

Full Changelog: 0.8.0...0.9.0

0.8.0

30 Jul 18:31
65080fc
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.7.1...0.8.0

0.7.1

19 Jul 19:59
Compare
Choose a tag to compare
  • fix: do not panic parsing some git hashes 1d0327c