textrun-make 0.3.1 → 0.4.0

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
@@ -40,8 +40,8 @@ Text-Runner verifies that the `Makefile` contains the `foo` target.
40
40
  ### Verify Make targets
41
41
 
42
42
  The <b type="action/name-full">make/target</b> action verifies that the
43
- mentioned Make target exists. <a type="workspace/additional-file-content"> In
44
- our example codebase the **README.md** file could contain another part:
43
+ mentioned Make target exists. <a type="workspace/append-file"> In our example
44
+ codebase the **README.md** file could contain another part:
45
45
 
46
46
  ```html
47
47
  If it doesn't work, just run the <code type="make/target">foo</code> target
@@ -1,5 +1,5 @@
1
- import * as color from "colorette";
2
1
  import { promises as fs } from "fs";
2
+ import { styleText } from "node:util";
3
3
  import * as os from "os";
4
4
  import * as textRunner from "text-runner-engine";
5
5
  import { makefileTargets } from "../helpers/makefile-targets.js";
@@ -10,17 +10,17 @@ export async function command(action) {
10
10
  throw new textRunner.UserError("No Make commands found", `Make commands must start with "make"`, action.location);
11
11
  }
12
12
  else if (wants.length === 1) {
13
- action.name(`make command: ${color.cyan(wants[0])}`);
13
+ action.name(`make command: ${styleText("cyan", wants[0])}`);
14
14
  }
15
15
  else {
16
- action.name(`make commands: ${color.cyan(wants.join(", "))}`);
16
+ action.name(`make commands: ${styleText("cyan", wants.join(", "))}`);
17
17
  }
18
18
  const makefilePath = action.configuration.sourceDir.joinStr(action.location.file.directory().platformified(), action.region[0].attributes["dir"] || ".", "Makefile");
19
19
  const makefileContent = await fs.readFile(makefilePath, "utf8");
20
20
  const haves = makefileTargets(makefileContent);
21
21
  for (const want of wants) {
22
22
  if (!haves.includes(want)) {
23
- throw new Error(`Makefile does not contain command make ${color.cyan(want)} but these targets: ${color.cyan(haves.join(", "))}`);
23
+ throw new Error(`Makefile does not contain command make ${styleText("cyan", want)} but these targets: ${styleText("cyan", haves.join(", "))}`);
24
24
  }
25
25
  }
26
26
  }
@@ -1,5 +1,5 @@
1
- import * as color from "colorette";
2
1
  import { promises as fs } from "fs";
2
+ import { styleText } from "node:util";
3
3
  import { makefileTargets } from "../helpers/makefile-targets.js";
4
4
  /** verifies that the Makefile in the sourceDir contains the enclosed target */
5
5
  export async function target(action) {
@@ -7,12 +7,12 @@ export async function target(action) {
7
7
  if (target === "") {
8
8
  throw new Error("Empty make target");
9
9
  }
10
- action.name(`make target ${color.cyan(target)}`);
10
+ action.name(`make target ${styleText("cyan", target)}`);
11
11
  const makePath = action.configuration.sourceDir.joinStr(action.region[0].attributes["dir"] || ".", "Makefile");
12
12
  const makefile = await fs.readFile(makePath, "utf8");
13
13
  const targets = makefileTargets(makefile);
14
14
  if (!targets.includes(target)) {
15
- throw new Error(`Makefile does not contain target ${color.cyan(target)} but these ones: ${color.cyan(targets.join(", "))}`);
15
+ throw new Error(`Makefile does not contain target ${styleText("cyan", target)} but these ones: ${styleText("cyan", targets.join(", "))}`);
16
16
  }
17
17
  }
18
18
  //# sourceMappingURL=target.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "textrun-make",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -11,23 +11,22 @@
11
11
  "build": "tsc -p tsconfig-build.json",
12
12
  "cuke": "cucumber-js --format=progress",
13
13
  "doc": "text-runner",
14
- "fix": "eslint --fix --ignore-pattern=dist/ . && dprint fmt && sort-package-json --quiet",
14
+ "fix": "eslint --fix --ignore-pattern=dist/ . && dprint fmt && sort-package-json --quiet && ../tools/rta ghokin fmt replace features",
15
15
  "lint": "dprint check && sort-package-json --check --quiet && eslint --ignore-pattern=dist/ . && depcheck --config=../.depcheckrc",
16
16
  "reset": "rm -rf dist && yarn run build",
17
17
  "unit": "node --test --import tsx 'src/**/*.test.ts'"
18
18
  },
19
19
  "dependencies": {
20
- "colorette": "2.0.20",
21
- "text-runner-engine": "7.1.2"
20
+ "text-runner-engine": "7.2.0"
22
21
  },
23
22
  "devDependencies": {
24
23
  "shared-cucumber-steps": "*",
25
- "text-runner": "7.1.2",
26
- "textrun-action": "0.3.1",
27
- "textrun-extension": "0.3.1",
28
- "textrun-npm": "0.3.1",
29
- "textrun-workspace": "0.3.1",
30
- "tsx": "4.19.3"
24
+ "text-runner": "7.2.0",
25
+ "textrun-action": "0.4.0",
26
+ "textrun-extension": "0.4.0",
27
+ "textrun-npm": "0.4.0",
28
+ "textrun-workspace": "0.4.0",
29
+ "tsx": "4.20.6"
31
30
  },
32
- "gitHead": "8aa3f5d9fbf24776eae6516b96ebde4863ad33a2"
31
+ "gitHead": "aecf7efd5e22e88535fe97ad7341b1a057520268"
33
32
  }