hereby 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![npm](https://img.shields.io/npm/v/hereby.svg)](https://npmjs.com/package/hereby)
4
4
  [![node](https://img.shields.io/node/v/hereby.svg)](https://nodejs.org)
5
5
  [![install size](https://packagephobia.com/badge?p=hereby)](https://packagephobia.com/result?p=hereby)
6
+ ![tokei](https://img.shields.io/tokei/lines/github/jakebailey/hereby.svg)
6
7
  [![ci](https://github.com/jakebailey/hereby/actions/workflows/ci.yml/badge.svg)](https://github.com/jakebailey/hereby/actions/workflows/ci.yml)
7
8
  [![codecov](https://codecov.io/gh/jakebailey/hereby/branch/main/graph/badge.svg?token=YL2Z1uk5dh)](https://codecov.io/gh/jakebailey/hereby)
8
9
 
@@ -8,7 +8,10 @@ export class Runner {
8
8
  this._d = d;
9
9
  }
10
10
  async runTasks(...tasks) {
11
- await Promise.all(tasks.map((task) => {
11
+ // Using allSettled here so that we don't immediately exit; it could be
12
+ // the case that a task has code that needs to run before, e.g. a
13
+ // cleanup function in a "finally" or something.
14
+ const results = await Promise.allSettled(tasks.map((task) => {
12
15
  const cached = this._addedTasks.get(task);
13
16
  if (cached) {
14
17
  return cached;
@@ -17,6 +20,11 @@ export class Runner {
17
20
  this._addedTasks.set(task, promise);
18
21
  return promise;
19
22
  }));
23
+ for (const result of results) {
24
+ if (result.status === "rejected") {
25
+ throw result.reason;
26
+ }
27
+ }
20
28
  }
21
29
  async _runTask(task) {
22
30
  const { dependencies, run } = task.options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hereby",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "A simple task runner",
5
5
  "repository": "github:jakebailey/hereby",
6
6
  "type": "module",