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 +1 -0
- package/dist/cli/reexec.js +9 -0
- package/dist/cli/runner.js +9 -1
- package/dist/cli/utils.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://npmjs.com/package/hereby)
|
|
4
4
|
[](https://nodejs.org)
|
|
5
5
|
[](https://packagephobia.com/result?p=hereby)
|
|
6
|
+

|
|
6
7
|
[](https://github.com/jakebailey/hereby/actions/workflows/ci.yml)
|
|
7
8
|
[](https://codecov.io/gh/jakebailey/hereby)
|
|
8
9
|
|
package/dist/cli/reexec.js
CHANGED
|
@@ -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 {
|
package/dist/cli/runner.js
CHANGED
|
@@ -8,7 +8,10 @@ export class Runner {
|
|
|
8
8
|
this._d = d;
|
|
9
9
|
}
|
|
10
10
|
async runTasks(...tasks) {
|
|
11
|
-
|
|
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