hereby 1.6.0 → 1.6.2

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.
@@ -13,6 +13,7 @@ export function formatTasks(format, tasks, defaultTask) {
13
13
  sections.push({
14
14
  header: "Available tasks",
15
15
  content: tasks.map((task) => {
16
+ var _a;
16
17
  const name = task !== defaultTask
17
18
  ? chalk.blue(task.options.name)
18
19
  : `${chalk.green(task.options.name)} (default)`;
@@ -20,7 +21,7 @@ export function formatTasks(format, tasks, defaultTask) {
20
21
  if (task.options.description) {
21
22
  descriptionParts.push(task.options.description);
22
23
  }
23
- const deps = task.options.dependencies?.filter((task) => !task.options.hiddenFromTaskList);
24
+ const deps = (_a = task.options.dependencies) === null || _a === void 0 ? void 0 : _a.filter((task) => !task.options.hiddenFromTaskList);
24
25
  if (deps && deps.length > 0) {
25
26
  const depNames = deps
26
27
  .map((task) => task.options.name)
package/dist/cli/index.js CHANGED
@@ -25,12 +25,13 @@ export async function main(d) {
25
25
  }
26
26
  }
27
27
  async function mainWorker(d) {
28
+ var _a;
28
29
  const args = parseArgs(d.argv.slice(2));
29
30
  if (args.help) {
30
31
  d.log(getUsage());
31
32
  return;
32
33
  }
33
- let herebyfilePath = args.herebyfile ?? (await findHerebyfile(d.cwd()));
34
+ let herebyfilePath = (_a = args.herebyfile) !== null && _a !== void 0 ? _a : (await findHerebyfile(d.cwd()));
34
35
  herebyfilePath = path.resolve(d.cwd(), herebyfilePath);
35
36
  if (await reexec(d, herebyfilePath)) {
36
37
  return;
@@ -1,5 +1,5 @@
1
1
  import chalk from "chalk";
2
- import fs from "fs/promises";
2
+ import { promises as fs } from "fs";
3
3
  import path from "path";
4
4
  import { pathToFileURL } from "url";
5
5
  import { Task } from "../index.js";
@@ -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/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import fs from "fs/promises";
1
+ import { promises as fs } from "fs";
2
2
  import os from "os";
3
3
  import path from "path";
4
4
  import { fileURLToPath } from "url";
@@ -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/dist/cli.js CHANGED
@@ -1,4 +1,7 @@
1
1
  import { main } from "./cli/index.js";
2
2
  import { real } from "./cli/utils.js";
3
- await main(await real());
3
+ async function run() {
4
+ await main(await real());
5
+ }
6
+ void run();
4
7
  //# sourceMappingURL=cli.js.map
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export class Task {
5
5
  constructor(options) {
6
6
  // Runtime typecheck; consumers of hereby may not have enabled
7
7
  // typechecking, so this is helpful.
8
+ var _a;
8
9
  if (typeof options.name !== "string") {
9
10
  throw new Error("Task name is not a string.");
10
11
  }
@@ -31,7 +32,7 @@ export class Task {
31
32
  if (options.name.startsWith("-")) {
32
33
  throw new Error('Task name must not start with "-".');
33
34
  }
34
- if (!options.dependencies?.length && !options.run) {
35
+ if (!((_a = options.dependencies) === null || _a === void 0 ? void 0 : _a.length) && !options.run) {
35
36
  throw new Error("Task must have at run function or dependencies.");
36
37
  }
37
38
  this._options = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hereby",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "A simple task runner",
5
5
  "repository": "github:jakebailey/hereby",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "makefile"
29
29
  ],
30
30
  "engines": {
31
- "node": ">= 14.16"
31
+ "node": ">= 12.20"
32
32
  },
33
33
  "files": [
34
34
  "README.md",
@@ -48,23 +48,24 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@ava/typescript": "^3.0.1",
51
- "@tsconfig/node14": "^1.0.3",
51
+ "@tsconfig/node12": "^1.0.11",
52
52
  "@types/command-line-args": "^5.2.0",
53
53
  "@types/command-line-usage": "^5.0.2",
54
54
  "@types/node": "^14.18.32",
55
- "@typescript-eslint/eslint-plugin": "^5.40.0",
56
- "@typescript-eslint/parser": "^5.40.0",
57
- "ava": "^4.3.3",
55
+ "@types/tmp": "^0.2.3",
56
+ "@typescript-eslint/eslint-plugin": "^5.40.1",
57
+ "@typescript-eslint/parser": "^5.40.1",
58
+ "ava": "^5.0.1",
58
59
  "c8": "^7.12.0",
59
- "dprint": "^0.32.1",
60
- "eslint": "^8.25.0",
60
+ "dprint": "^0.32.2",
61
+ "eslint": "^8.26.0",
61
62
  "eslint-plugin-ava": "^13.2.0",
62
63
  "eslint-plugin-simple-import-sort": "^8.0.0",
63
64
  "execa": "^6.1.0",
64
65
  "moq.ts": "^9.0.2",
65
66
  "release-it": "^15.5.0",
66
67
  "rimraf": "^3.0.2",
67
- "tempy": "^3.0.0",
68
+ "tmp": "^0.2.1",
68
69
  "typescript": "~4.8.4"
69
70
  },
70
71
  "packageManager": "npm@8.17.0",