hereby 1.6.1 → 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
 
@@ -12,6 +12,15 @@ export async function reexec(d, herebyfilePath) {
12
12
  //
13
13
  // TODO: Rather than spawning a child process, perhaps we could instead
14
14
  // import the CLI from the other version and run it.
15
+ if (d.isPnP) {
16
+ // When we are running within PnP, we can't really figure out what to
17
+ // do. import-meta-resolve doesn't implement this, so we can't do
18
+ // anything until import.meta.resolve is no longer experimental.
19
+ //
20
+ // Just assume that everything is okay; we will error later if there's
21
+ // a mismatch.
22
+ return false;
23
+ }
15
24
  const thisCLI = await resolveToPath("hereby/cli", new URL(import.meta.url));
16
25
  let otherCLI;
17
26
  try {
@@ -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/dist/cli/utils.js CHANGED
@@ -62,6 +62,7 @@ export async function real() {
62
62
  process.exitCode = code;
63
63
  },
64
64
  version,
65
+ isPnP: !!process.versions["pnp"],
65
66
  foregroundChild,
66
67
  resolve,
67
68
  prettyMilliseconds,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hereby",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "A simple task runner",
5
5
  "repository": "github:jakebailey/hereby",
6
6
  "type": "module",