hereby 1.3.1 → 1.4.1

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/bin/hereby.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/cli.js";
@@ -1,11 +1,14 @@
1
1
  import chalk from "chalk";
2
2
  import commandLineUsage from "command-line-usage";
3
3
  import { stringSorter, taskSorter } from "./utils.js";
4
- export function formatTasks(tasks, defaultTask) {
4
+ export function formatTasks(format, tasks, defaultTask) {
5
5
  tasks = tasks
6
6
  .slice(0)
7
7
  .filter((task) => !task.options.hiddenFromTaskList)
8
8
  .sort(taskSorter);
9
+ if (format === "simple") {
10
+ return tasks.map((task) => task.options.name).join("\n");
11
+ }
9
12
  const sections = [];
10
13
  sections.push({
11
14
  header: "Available tasks",
package/dist/cli/index.js CHANGED
@@ -40,10 +40,12 @@ async function mainWorker(d) {
40
40
  return;
41
41
  }
42
42
  d.chdir(path.dirname(herebyfilePath));
43
- d.log(`Using ${simplifyPath(herebyfilePath)}`);
43
+ if (!args.printTasks) {
44
+ d.log(`Using ${simplifyPath(herebyfilePath)}`);
45
+ }
44
46
  const herebyfile = await loadHerebyfile(herebyfilePath);
45
47
  if (args.printTasks) {
46
- d.log(formatTasks(herebyfile.tasks, herebyfile.defaultTask));
48
+ d.log(formatTasks(args.printTasks, herebyfile.tasks, herebyfile.defaultTask));
47
49
  return;
48
50
  }
49
51
  const tasks = selectTasks(herebyfile, args.run);
@@ -9,6 +9,7 @@ export function parseArgs(argv) {
9
9
  { name: "run", multiple: true, defaultOption: true, type: String },
10
10
  { name: "herebyfile", type: String },
11
11
  { name: "tasks", alias: "T", type: Boolean },
12
+ { name: "tasks-simple", type: Boolean },
12
13
  { name: "help", alias: "h", type: Boolean },
13
14
  { name: "version", type: Boolean },
14
15
  ], {
@@ -19,7 +20,7 @@ export function parseArgs(argv) {
19
20
  help: options["help"],
20
21
  run: options["run"],
21
22
  herebyfile: options["herebyfile"],
22
- printTasks: options["tasks"],
23
+ printTasks: options["tasks"] ? "normal" : options["tasks-simple"] ? "simple" : undefined,
23
24
  version: options["version"],
24
25
  };
25
26
  }
@@ -1,4 +1,3 @@
1
- import chalk from "chalk";
2
1
  import { fileURLToPath, pathToFileURL } from "url";
3
2
  import { UserError } from "./utils.js";
4
3
  export async function reexec(d, herebyfilePath) {
@@ -24,8 +23,6 @@ export async function reexec(d, herebyfilePath) {
24
23
  if (thisCLI === otherCLI) {
25
24
  return false;
26
25
  }
27
- // TODO: If this turns out to be common, remove this warning.
28
- d.error(`${chalk.yellow("Warning")}: re-running hereby as imported by the Herebyfile.`);
29
26
  const args = [...d.execArgv, otherCLI, ...d.argv.slice(2)];
30
27
  d.foregroundChild(d.execPath, args);
31
28
  return true;
package/dist/cli.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  import { main } from "./cli/index.js";
3
2
  import { real } from "./cli/utils.js";
4
3
  await main(await real());
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "hereby",
3
- "version": "1.3.1",
3
+ "version": "1.4.1",
4
4
  "description": "A simple task runner",
5
5
  "repository": "github:jakebailey/hereby",
6
6
  "type": "module",
7
- "bin": "./dist/cli.js",
7
+ "bin": "./bin/hereby.js",
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",
10
10
  "exports": {
@@ -52,9 +52,9 @@
52
52
  "@tsconfig/node14": "^1.0.3",
53
53
  "@types/command-line-args": "^5.2.0",
54
54
  "@types/command-line-usage": "^5.0.2",
55
- "@types/node": "^14.18.30",
56
- "@typescript-eslint/eslint-plugin": "^5.38.0",
57
- "@typescript-eslint/parser": "^5.38.0",
55
+ "@types/node": "^14.18.31",
56
+ "@typescript-eslint/eslint-plugin": "^5.38.1",
57
+ "@typescript-eslint/parser": "^5.38.1",
58
58
  "ava": "^4.3.3",
59
59
  "c8": "^7.12.0",
60
60
  "eslint": "^8.24.0",
@@ -67,7 +67,7 @@
67
67
  "release-it": "^15.4.2",
68
68
  "rimraf": "^3.0.2",
69
69
  "tempy": "^3.0.0",
70
- "typescript": "~4.8.3"
70
+ "typescript": "~4.8.4"
71
71
  },
72
72
  "packageManager": "npm@8.17.0",
73
73
  "volta": {