text-runner-engine 7.4.0 → 7.5.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.
Files changed (86) hide show
  1. package/LICENSE +23 -0
  2. package/dist/actions/actions.d.ts +1 -1
  3. package/dist/actions/actions.js +1 -0
  4. package/dist/actions/built-in/check-image.d.ts +2 -2
  5. package/dist/actions/built-in/check-image.js +4 -4
  6. package/dist/actions/built-in/check-link.d.ts +2 -2
  7. package/dist/actions/built-in/check-link.js +17 -21
  8. package/dist/actions/built-in/test.d.ts +1 -1
  9. package/dist/actions/export.d.ts +1 -1
  10. package/dist/actions/external-action-manager.d.ts +2 -2
  11. package/dist/actions/external-action-manager.js +3 -2
  12. package/dist/actions/finder.d.ts +3 -3
  13. package/dist/actions/finder.js +10 -9
  14. package/dist/actions/index.d.ts +5 -5
  15. package/dist/actions/name.js +1 -1
  16. package/dist/activities/extract-dynamic.d.ts +2 -2
  17. package/dist/activities/extract-images-and-links.d.ts +1 -1
  18. package/dist/activities/normalize-action-name.d.ts +1 -1
  19. package/dist/activities/normalize-action-name.js +1 -1
  20. package/dist/ast/index.d.ts +1 -1
  21. package/dist/ast/index.js +1 -1
  22. package/dist/ast/node-list.d.ts +1 -1
  23. package/dist/ast/node-list.js +4 -4
  24. package/dist/ast/node.js +1 -1
  25. package/dist/commands/command.d.ts +1 -1
  26. package/dist/commands/debug.d.ts +3 -3
  27. package/dist/commands/debug.js +2 -2
  28. package/dist/commands/dynamic.d.ts +3 -3
  29. package/dist/commands/dynamic.js +1 -1
  30. package/dist/commands/run.d.ts +3 -3
  31. package/dist/commands/run.js +1 -1
  32. package/dist/commands/static.d.ts +3 -3
  33. package/dist/commands/static.js +1 -1
  34. package/dist/commands/unused.d.ts +3 -3
  35. package/dist/commands/unused.js +1 -1
  36. package/dist/configuration/data.d.ts +2 -2
  37. package/dist/configuration/defaults.d.ts +1 -1
  38. package/dist/configuration/defaults.js +1 -1
  39. package/dist/configuration/publication.js +1 -1
  40. package/dist/configuration/publications.d.ts +2 -2
  41. package/dist/errors/user-error.d.ts +1 -1
  42. package/dist/events/index.d.ts +1 -1
  43. package/dist/filesystem/absolute-dir.js +1 -1
  44. package/dist/filesystem/absolute-file.js +2 -2
  45. package/dist/filesystem/full-dir.js +1 -1
  46. package/dist/filesystem/full-file.js +3 -3
  47. package/dist/filesystem/full-link.d.ts +1 -1
  48. package/dist/filesystem/full-link.js +5 -5
  49. package/dist/filesystem/full-path.d.ts +1 -1
  50. package/dist/filesystem/full-path.js +2 -2
  51. package/dist/filesystem/get-filenames.d.ts +1 -1
  52. package/dist/filesystem/has-directory.js +2 -2
  53. package/dist/filesystem/is-markdown-file.js +2 -2
  54. package/dist/filesystem/relative-link.d.ts +2 -2
  55. package/dist/filesystem/source-dir.js +1 -1
  56. package/dist/filesystem/unknown-link.d.ts +1 -1
  57. package/dist/helpers/add-leading-dot-unless-empty.js +1 -1
  58. package/dist/helpers/add-leading-slash.js +1 -1
  59. package/dist/helpers/add-trailing-slash.js +1 -1
  60. package/dist/helpers/trim-extension.js +1 -1
  61. package/dist/link-targets/find.d.ts +1 -1
  62. package/dist/link-targets/list.d.ts +3 -3
  63. package/dist/link-targets/target-url.js +0 -1
  64. package/dist/parsers/html/html-parser.d.ts +2 -2
  65. package/dist/parsers/html/html-parser.js +6 -4
  66. package/dist/parsers/html/parse-html-files.d.ts +2 -2
  67. package/dist/parsers/html/parse-html-files.js +1 -1
  68. package/dist/parsers/markdown/closing-tag-parser.d.ts +2 -2
  69. package/dist/parsers/markdown/md-parser.js +2 -2
  70. package/dist/parsers/markdown/open-node-tracker.d.ts +2 -2
  71. package/dist/parsers/markdown/parse.d.ts +2 -2
  72. package/dist/parsers/markdown/parse.js +1 -1
  73. package/dist/parsers/tag-mapper.d.ts +1 -1
  74. package/dist/parsers/tag-mapper.js +5 -5
  75. package/dist/run/activity-collector.d.ts +3 -3
  76. package/dist/run/name-refiner.d.ts +1 -1
  77. package/dist/run/output-collector.d.ts +1 -1
  78. package/dist/run/output-collector.js +3 -2
  79. package/dist/run/parallel.d.ts +5 -5
  80. package/dist/run/run-activity.d.ts +5 -5
  81. package/dist/run/run-activity.js +1 -1
  82. package/dist/run/sequential.d.ts +5 -5
  83. package/dist/run/stopwatch.js +2 -2
  84. package/dist/workspace/create.d.ts +1 -1
  85. package/dist/workspace/create.js +1 -1
  86. package/package.json +7 -7
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ SPDX-License-Identifier: ISC
2
+
3
+ Copyright 2026 Kevin Goslar
4
+
5
+ Permission to use, copy, modify, and/or distribute this software
6
+ for any purpose with or without fee is hereby granted,
7
+ provided that the above copyright notice
8
+ and this permission notice appear in all copies.
9
+
10
+ THE SOFTWARE IS PROVIDED “AS IS”
11
+ AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
+ WITH REGARD TO THIS SOFTWARE
13
+ INCLUDING ALL IMPLIED WARRANTIES
14
+ OF MERCHANTABILITY AND FITNESS.
15
+
16
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE
17
+ FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
18
+ OR ANY DAMAGES WHATSOEVER
19
+ RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20
+ WHETHER IN AN ACTION OF CONTRACT,
21
+ NEGLIGENCE OR OTHER TORTIOUS ACTION,
22
+ ARISING OUT OF OR IN CONNECTION WITH
23
+ THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1,4 +1,4 @@
1
- import { Action, FunctionRepo } from "./index.js";
1
+ import type { Action, FunctionRepo } from "./index.js";
2
2
  export declare class Actions {
3
3
  list: FunctionRepo;
4
4
  constructor();
@@ -10,6 +10,7 @@ export class Actions {
10
10
  names() {
11
11
  return Object.keys(this.list).sort();
12
12
  }
13
+ // biome-ignore lint/suspicious/noExplicitAny: too many possible types here
13
14
  register(fileBasedName, action) {
14
15
  if (typeof action === "function") {
15
16
  this.list[fileBasedName] = action;
@@ -1,4 +1,4 @@
1
- import * as actions from "../index.js";
1
+ import type * as actions from "../index.js";
2
2
  /** The "checkImage" action checks for broken images. */
3
- export declare function checkImage(action: actions.Args): Promise<number | void>;
3
+ export declare function checkImage(action: actions.Args): Promise<number | undefined>;
4
4
  //# sourceMappingURL=check-image.d.ts.map
@@ -1,4 +1,4 @@
1
- import { promises as fs } from "fs";
1
+ import { promises as fs } from "node:fs";
2
2
  import got, { HTTPError, TimeoutError } from "got";
3
3
  import * as files from "../../filesystem/index.js";
4
4
  /** The "checkImage" action checks for broken images. */
@@ -16,15 +16,15 @@ export async function checkImage(action) {
16
16
  else {
17
17
  // local image here
18
18
  const imageFullFile = new files.FullFilePath(imagePath.startsWith("/") ? imagePath : node.location.file.directory().joinStr(imagePath));
19
- const result = await checkLocalImage(imageFullFile, action.configuration);
20
- return result;
19
+ await checkLocalImage(imageFullFile, action.configuration);
21
20
  }
21
+ return;
22
22
  }
23
23
  async function checkLocalImage(image, c) {
24
24
  try {
25
25
  await fs.stat(c.sourceDir.joinFullFile(image).platformified());
26
26
  }
27
- catch (err) {
27
+ catch (_err) {
28
28
  throw new Error(`image ${image.unixified()} does not exist`);
29
29
  }
30
30
  }
@@ -1,4 +1,4 @@
1
- import { Args } from "../index.js";
1
+ import type { Args } from "../index.js";
2
2
  /** The "checkLink" action checks for broken hyperlinks. */
3
- export declare function checkLink(action: Args): Promise<Args["SKIPPING"] | void>;
3
+ export declare function checkLink(action: Args): Promise<Args["SKIPPING"] | undefined>;
4
4
  //# sourceMappingURL=check-link.d.ts.map
@@ -1,4 +1,4 @@
1
- import { promises as fs } from "fs";
1
+ import { promises as fs } from "node:fs";
2
2
  import got, { HTTPError, TimeoutError } from "got";
3
3
  import { errorMessage } from "../../errors/error.js";
4
4
  import { UserError } from "../../errors/user-error.js";
@@ -20,16 +20,15 @@ export async function checkLink(action) {
20
20
  return action.SKIPPING;
21
21
  }
22
22
  if (helpers.isLinkToAnchorInSameFile(target)) {
23
- const result = checkLinkToAnchorInSameFile(action.location.file, target, action);
24
- return result;
23
+ checkLinkToAnchorInSameFile(action.location.file, target, action);
24
+ return;
25
25
  }
26
26
  if (helpers.isLinkToAnchorInOtherFile(target)) {
27
- const result = checkLinkToAnchorInOtherFile(action.location, target, action);
28
- return result;
27
+ checkLinkToAnchorInOtherFile(action.location, target, action);
28
+ return;
29
29
  }
30
30
  if (helpers.isExternalLink(target)) {
31
- const result = await checkExternalLink(target, action);
32
- return result;
31
+ return await checkExternalLink(target, action);
33
32
  }
34
33
  await checkLinkToFilesystem(target, action);
35
34
  return;
@@ -60,35 +59,32 @@ function checkLinkToAnchorInOtherFile(containingLocation, target, action) {
60
59
  const absoluteLink = link.absolutify(containingLocation, action.configuration.publications);
61
60
  const anchorName = absoluteLink.anchor();
62
61
  const fullPath = absoluteLink.localize(action.configuration.publications, action.configuration.defaultFile);
62
+ let fullFile;
63
63
  try {
64
- var fullFile = fullPath.toFullFilePath();
64
+ fullFile = fullPath.toFullFilePath();
65
65
  }
66
- catch (e) {
66
+ catch (_e) {
67
67
  throw new Error(`link to non-existing file ${fullPath.unixified()}`);
68
68
  }
69
69
  if (!action.linkTargets.hasFile(fullFile)) {
70
70
  throw new Error(`link to anchor #${anchorName} in non-existing file ${helpers.removeLeadingSlash(fullFile.unixified())}`);
71
71
  }
72
72
  if (!action.linkTargets.hasAnchor(fullFile, anchorName)) {
73
- throw new UserError(`link to non-existing anchor ${"#" + anchorName} in ${fullFile.unixified()}`, `File ${fullFile.unixified()} contains these anchors: ${action.linkTargets
74
- .getAnchors(fullFile)
75
- .map(anchor => `#${anchor}`)
76
- .join(", ")}`);
73
+ const anchors = action.linkTargets.getAnchors(fullFile).map(anchor => `#${anchor}`);
74
+ throw new UserError(`link to non-existing anchor ${`#${anchorName}`} in ${fullFile.unixified()}`, `File ${fullFile.unixified()} contains these anchors: ${anchors.join(", ")}`);
77
75
  }
78
76
  if (action.linkTargets.anchorType(fullFile, anchorName) === "heading") {
79
- action.name(`link to heading ${fullFile.unixified() + "#" + anchorName}`);
77
+ action.name(`link to heading ${`${fullFile.unixified()}#${anchorName}`}`);
80
78
  }
81
79
  else {
82
80
  action.name(`link to ${fullFile.unixified()}#${anchorName}`);
83
81
  }
84
82
  }
85
83
  function checkLinkToAnchorInSameFile(file, target, action) {
86
- const anchorName = target.substr(1);
84
+ const anchorName = target.substring(1);
87
85
  if (!action.linkTargets.hasAnchor(file, anchorName)) {
88
- throw new UserError(`link to non-existing local anchor ${target}`, `These local anchors exist: ${action.linkTargets
89
- .getAnchors(file)
90
- .map(anchor => `#${anchor}`)
91
- .join(", ")}`, action.location);
86
+ const anchors = action.linkTargets.getAnchors(file).map(anchor => `#${anchor}`);
87
+ throw new UserError(`link to non-existing local anchor ${target}`, `These local anchors exist: ${anchors.join(", ")}`, action.location);
92
88
  }
93
89
  if (action.linkTargets.anchorType(file, anchorName) === "heading") {
94
90
  action.name(`link to local heading ${target}`);
@@ -112,7 +108,7 @@ async function checkLinkToFilesystem(target, action) {
112
108
  return;
113
109
  }
114
110
  }
115
- catch (e) {
111
+ catch (_e) {
116
112
  // we can ignore errors here since we keep checking the file below
117
113
  }
118
114
  }
@@ -120,7 +116,7 @@ async function checkLinkToFilesystem(target, action) {
120
116
  try {
121
117
  await fs.stat(fullPath);
122
118
  }
123
- catch (err) {
119
+ catch (_err) {
124
120
  throw new Error(`link to non-existing local file ${linkedFile.unixified()}`);
125
121
  }
126
122
  }
@@ -1,3 +1,3 @@
1
- import { Args } from "../index.js";
1
+ import type { Args } from "../index.js";
2
2
  export declare function test(action: Args): void;
3
3
  //# sourceMappingURL=test.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as actions from "./index.js";
1
+ import type * as actions from "./index.js";
2
2
  export type Action = CbAction | PromiseAction | SyncAction;
3
3
  export type CbAction = (action: actions.Args, done: DoneFunction) => void;
4
4
  /** continuous-passing-style callback function */
@@ -1,5 +1,5 @@
1
- import { Activity } from "../activities/index.js";
2
- import { Action, FunctionRepo } from "./index.js";
1
+ import type { Activity } from "../activities/index.js";
2
+ import type { Action, FunctionRepo } from "./index.js";
3
3
  /** ExternalActionManager provides external actions from their own NPM modules */
4
4
  export declare class ExternalActionManager {
5
5
  actions: FunctionRepo;
@@ -15,10 +15,11 @@ export class ExternalActionManager {
15
15
  if (parts.length > 2) {
16
16
  throw new UserError(`Too many slashes in action name "${activity.actionName}"`, "Activities are only allowed to have one slash in them: to separate the npm module name from the action name", activity.location);
17
17
  }
18
- const moduleName = "textrun-" + parts[0];
18
+ const moduleName = `textrun-${parts[0]}`;
19
19
  const wantAction = actions.name(parts[1]);
20
+ let module;
20
21
  try {
21
- var module = await import(moduleName);
22
+ module = await import(moduleName);
22
23
  }
23
24
  catch (e) {
24
25
  if (!(e instanceof Error)) {
@@ -1,8 +1,8 @@
1
- import * as activities from "../activities/index.js";
2
- import * as files from "../filesystem/index.js";
1
+ import type * as activities from "../activities/index.js";
2
+ import type * as files from "../filesystem/index.js";
3
3
  import { Actions } from "./actions.js";
4
4
  import { ExternalActionManager } from "./external-action-manager.js";
5
- import { Action } from "./index.js";
5
+ import type { Action } from "./index.js";
6
6
  /** ActionFinder provides runnable action instances for activities. */
7
7
  export declare class Finder {
8
8
  private readonly builtinActions;
@@ -1,6 +1,6 @@
1
- import { promises as fs } from "fs";
2
- import path from "path";
3
- import * as url from "url";
1
+ import { promises as fs } from "node:fs";
2
+ import path from "node:path";
3
+ import * as url from "node:url";
4
4
  import * as actions from "../actions/index.js";
5
5
  import { UserError } from "../errors/user-error.js";
6
6
  import { Actions } from "./actions.js";
@@ -27,10 +27,10 @@ export class Finder {
27
27
  }
28
28
  /** actionFor provides the action function for the given Activity. */
29
29
  async actionFor(activity) {
30
- return (this.builtinActions.get(activity.actionName)
31
- || this.customActions.get(activity.actionName)
32
- || (await this.externalActions.get(activity))
33
- || this.errorUnknownAction(activity));
30
+ return (this.builtinActions.get(activity.actionName) ||
31
+ this.customActions.get(activity.actionName) ||
32
+ (await this.externalActions.get(activity)) ||
33
+ this.errorUnknownAction(activity));
34
34
  }
35
35
  /** customActionNames returns the names of all built-in actions. */
36
36
  customActionNames() {
@@ -65,10 +65,11 @@ export async function builtinActionFilePaths() {
65
65
  return result;
66
66
  }
67
67
  export async function customActionFilePaths(dir) {
68
+ let files;
68
69
  try {
69
- var files = await fs.readdir(dir);
70
+ files = await fs.readdir(dir);
70
71
  }
71
- catch (e) {
72
+ catch (_e) {
72
73
  // it's okay if there is no dir with custom actions
73
74
  return [];
74
75
  }
@@ -1,8 +1,8 @@
1
- import * as ast from "../ast/index.js";
2
- import * as config from "../configuration/index.js";
3
- import * as files from "../filesystem/index.js";
4
- import * as linkTargets from "../link-targets/index.js";
5
- import * as run from "../run/index.js";
1
+ import type * as ast from "../ast/index.js";
2
+ import type * as config from "../configuration/index.js";
3
+ import type * as files from "../filesystem/index.js";
4
+ import type * as linkTargets from "../link-targets/index.js";
5
+ import type * as run from "../run/index.js";
6
6
  export { Finder } from "./finder.js";
7
7
  export * from "./name.js";
8
8
  /** A user-defined or built-in function that tests an active block */
@@ -1,5 +1,5 @@
1
+ import * as path from "node:path";
1
2
  import slugify from "@sindresorhus/slugify";
2
- import * as path from "path";
3
3
  export function name(filepath) {
4
4
  return slugify(path.basename(filepath, path.extname(filepath)));
5
5
  }
@@ -1,5 +1,5 @@
1
- import * as ast from "../ast/index.js";
2
- import { List } from "./index.js";
1
+ import type * as ast from "../ast/index.js";
2
+ import type { List } from "./index.js";
3
3
  /** returns all activities found in the given ast.NodeLists */
4
4
  export declare function extractDynamic(docs: ast.NodeList[], regionMarker: string): List;
5
5
  //# sourceMappingURL=extract-dynamic.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import * as ast from "../ast/index.js";
2
- import { List } from "./index.js";
2
+ import type { List } from "./index.js";
3
3
  /** extracts activities that check images and links from the given ActivityLists */
4
4
  export declare function extractImagesAndLinks(ASTs: ast.NodeList[]): List;
5
5
  //# sourceMappingURL=extract-images-and-links.d.ts.map
@@ -1,3 +1,3 @@
1
- import * as files from "../filesystem/index.js";
1
+ import type * as files from "../filesystem/index.js";
2
2
  export declare function normalizeActionName(actionName: string, location: files.Location): string;
3
3
  //# sourceMappingURL=normalize-action-name.d.ts.map
@@ -8,6 +8,6 @@ export function normalizeActionName(actionName, location) {
8
8
  if (parts.length > 2) {
9
9
  throw new UserError(`Illegal activity name: "${actionName}" contains ${parts.length} slashes`, "", location);
10
10
  }
11
- return parts[0] + "/" + slugify(parts[1]);
11
+ return `${parts[0]}/${slugify(parts[1])}`;
12
12
  }
13
13
  //# sourceMappingURL=normalize-action-name.js.map
@@ -1,3 +1,3 @@
1
- export * from "./node-list.js";
2
1
  export * from "./node.js";
2
+ export * from "./node-list.js";
3
3
  //# sourceMappingURL=index.d.ts.map
package/dist/ast/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./node-list.js";
2
1
  export * from "./node.js";
2
+ export * from "./node-list.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { Node, NodeScaffoldDataReadonly } from "./node.js";
1
+ import { Node, type NodeScaffoldDataReadonly } from "./node.js";
2
2
  export declare class NodeList extends Array<Node> {
3
3
  /** Creates a new ast.NodeList containing an Node scaffoldedd from the given data */
4
4
  static scaffold(data?: NodeScaffoldDataReadonly): NodeList;
@@ -10,7 +10,7 @@ export class NodeList extends Array {
10
10
  /** Returns whether this ast.NodeList contains a node of the given type. */
11
11
  hasNodeOfType(nodeType) {
12
12
  const types = [nodeType];
13
- types.push(nodeType + "_open");
13
+ types.push(`${nodeType}_open`);
14
14
  return this.some(node => types.includes(node.type));
15
15
  }
16
16
  /**
@@ -66,7 +66,7 @@ ${new Error().stack}`);
66
66
  const expectedTypes = [];
67
67
  for (const nodeType of nodeTypes) {
68
68
  expectedTypes.push(nodeType);
69
- expectedTypes.push(nodeType + "_open");
69
+ expectedTypes.push(`${nodeType}_open`);
70
70
  }
71
71
  for (const node of this) {
72
72
  if (expectedTypes.includes(node.type)) {
@@ -101,7 +101,7 @@ ${new Error().stack}`);
101
101
  textInNodeOfType(...nodeTypes) {
102
102
  for (const nodeType of nodeTypes) {
103
103
  if (!nodeType.endsWith("_open")) {
104
- nodeTypes.push(nodeType + "_open");
104
+ nodeTypes.push(`${nodeType}_open`);
105
105
  }
106
106
  }
107
107
  return this.textInNode(this.nodeOfTypes(...nodeTypes));
@@ -119,7 +119,7 @@ ${new Error().stack}`);
119
119
  textInNodesOfType(...nodeTypes) {
120
120
  for (const nodeType of nodeTypes) {
121
121
  if (!nodeType.endsWith("_open")) {
122
- nodeTypes.push(nodeType + "_open");
122
+ nodeTypes.push(`${nodeType}_open`);
123
123
  }
124
124
  }
125
125
  return this.nodesOfTypes(...nodeTypes).map(node => this.textInNode(node));
package/dist/ast/node.js CHANGED
@@ -25,7 +25,7 @@ export class Node {
25
25
  if (!this.isOpeningNode()) {
26
26
  throw new Error("not an opening node");
27
27
  }
28
- return this.type.replace("open", "") + "close";
28
+ return `${this.type.replace("open", "")}close`;
29
29
  }
30
30
  /**
31
31
  * Returns the content of the "href" attribute for link tags,
@@ -1,4 +1,4 @@
1
- import * as events from "../events/index.js";
1
+ import type * as events from "../events/index.js";
2
2
  /** Command describes a Text-Runner command */
3
3
  export interface Command {
4
4
  emit(event: events.Name, payload: events.Args): void;
@@ -1,7 +1,7 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as configuration from "../configuration/index.js";
3
- import * as events from "../events/index.js";
4
- import { Command } from "./command.js";
3
+ import type * as events from "../events/index.js";
4
+ import type { Command } from "./command.js";
5
5
  export declare const DebugSubCommandValues: readonly ["activities", "ast", "images", "links", "linkTargets"];
6
6
  export type DebugSubcommand = (typeof DebugSubCommandValues)[number];
7
7
  export declare class Debug implements Command {
@@ -1,5 +1,5 @@
1
- import { EventEmitter } from "events";
2
- import * as util from "util";
1
+ import { EventEmitter } from "node:events";
2
+ import * as util from "node:util";
3
3
  import * as activities from "../activities/index.js";
4
4
  import * as ast from "../ast/index.js";
5
5
  import * as configuration from "../configuration/index.js";
@@ -1,7 +1,7 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as configuration from "../configuration/index.js";
3
- import * as events from "../events/index.js";
4
- import { Command } from "./command.js";
3
+ import type * as events from "../events/index.js";
4
+ import type { Command } from "./command.js";
5
5
  export declare class Dynamic implements Command {
6
6
  emitter: EventEmitter;
7
7
  userConfig: configuration.APIData;
@@ -1,4 +1,4 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as actions from "../actions/index.js";
3
3
  import * as activities from "../activities/index.js";
4
4
  import * as configuration from "../configuration/index.js";
@@ -1,7 +1,7 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as configuration from "../configuration/index.js";
3
- import * as events from "../events/index.js";
4
- import * as command from "./index.js";
3
+ import type * as events from "../events/index.js";
4
+ import type * as command from "./index.js";
5
5
  /** executes "text-runner run", prints everything, returns the number of errors encountered */
6
6
  export declare class Run implements command.Command {
7
7
  emitter: EventEmitter;
@@ -1,4 +1,4 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as actions from "../actions/index.js";
3
3
  import * as activities from "../activities/index.js";
4
4
  import * as configuration from "../configuration/index.js";
@@ -1,7 +1,7 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as configuration from "../configuration/index.js";
3
- import * as events from "../events/index.js";
4
- import { Command } from "./command.js";
3
+ import type * as events from "../events/index.js";
4
+ import type { Command } from "./command.js";
5
5
  export declare class Static implements Command {
6
6
  emitter: EventEmitter;
7
7
  userConfig: configuration.APIData;
@@ -1,4 +1,4 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as actions from "../actions/index.js";
3
3
  import { extractImagesAndLinks } from "../activities/extract-images-and-links.js";
4
4
  import * as configuration from "../configuration/index.js";
@@ -1,7 +1,7 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as configuration from "../configuration/index.js";
3
- import * as events from "../events/index.js";
4
- import { Command } from "./command.js";
3
+ import type * as events from "../events/index.js";
4
+ import type { Command } from "./command.js";
5
5
  export declare class Unused implements Command {
6
6
  emitter: EventEmitter;
7
7
  userConfig: configuration.APIData;
@@ -1,4 +1,4 @@
1
- import { EventEmitter } from "events";
1
+ import { EventEmitter } from "node:events";
2
2
  import * as actions from "../actions/index.js";
3
3
  import * as activities from "../activities/index.js";
4
4
  import * as configuration from "../configuration/index.js";
@@ -1,5 +1,5 @@
1
- import * as files from "../filesystem/index.js";
2
- import { Publications } from "./publications.js";
1
+ import type * as files from "../filesystem/index.js";
2
+ import type { Publications } from "./publications.js";
3
3
  /** configuration values used by the Text-Runner API */
4
4
  export type APIData = Partial<CompleteAPIData>;
5
5
  /** a full set of configuration values used by the Text-Runner API */
@@ -1,4 +1,4 @@
1
- import * as configuration from "./index.js";
1
+ import type * as configuration from "./index.js";
2
2
  export declare function addDefaults(partial: configuration.APIData): Promise<configuration.Data>;
3
3
  /** provides the default configuration values to use when no values are provided via CLI or config file */
4
4
  export declare function defaults(): configuration.CompleteAPIData;
@@ -1,4 +1,4 @@
1
- import * as path from "path";
1
+ import * as path from "node:path";
2
2
  import * as tmp from "tmp-promise";
3
3
  import { UserError } from "../errors/user-error.js";
4
4
  import * as files from "../filesystem/index.js";
@@ -16,7 +16,7 @@ export class Publication {
16
16
  * according to the rules of this publication
17
17
  */
18
18
  publish(localPath) {
19
- const re = new RegExp("^" + this.localPath);
19
+ const re = new RegExp(`^${this.localPath}`);
20
20
  const linkPath = helpers.addLeadingSlash(localPath.unixified()).replace(re, this.publicPath);
21
21
  const result = new files.FullLink(linkPath);
22
22
  if (this.publicExtension == null) {
@@ -1,5 +1,5 @@
1
- import * as files from "../filesystem/index.js";
2
- import { Publication, PublicationConfig } from "./publication.js";
1
+ import type * as files from "../filesystem/index.js";
2
+ import { Publication, type PublicationConfig } from "./publication.js";
3
3
  export declare class Publications extends Array<Publication> {
4
4
  static fromConfigs(configs?: PublicationConfig[]): Publications;
5
5
  forFilePath(filePath: files.FullPath): Publication | undefined;
@@ -1,4 +1,4 @@
1
- import * as files from "../filesystem/index.js";
1
+ import type * as files from "../filesystem/index.js";
2
2
  /**
3
3
  * Represents a UserError that has not been printed via the formatter.
4
4
  * This happens for user errors before the formatter could be instantiated
@@ -1,4 +1,4 @@
1
- import { Activity } from "../activities/index.js";
1
+ import type { Activity } from "../activities/index.js";
2
2
  export type Args = Failed | Skipped | Start | string | Success | Warning;
3
3
  /** signals a failed activity */
4
4
  export interface Failed {
@@ -1,4 +1,4 @@
1
- import * as path from "path";
1
+ import * as path from "node:path";
2
2
  import * as helpers from "../helpers/index.js";
3
3
  import * as files from "./index.js";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import * as path from "path";
1
+ import * as path from "node:path";
2
2
  import * as files from "./index.js";
3
3
  /** represents an absolute path to a file, i.e. from filesystem root to the file */
4
4
  export class AbsoluteFilePath {
@@ -7,7 +7,7 @@ export class AbsoluteFilePath {
7
7
  }
8
8
  /** provides the directory that contains this file */
9
9
  directory() {
10
- return new files.AbsoluteDirPath(path.dirname(this.value) + "/");
10
+ return new files.AbsoluteDirPath(`${path.dirname(this.value)}/`);
11
11
  }
12
12
  /**
13
13
  * provides this file path with platform specific path separators,
@@ -1,4 +1,4 @@
1
- import * as path from "path";
1
+ import * as path from "node:path";
2
2
  /** represents the full path to a directory inside the document base, i.e. from the document root */
3
3
  export class FullDir {
4
4
  constructor(value) {
@@ -1,6 +1,6 @@
1
- import * as path from "path";
1
+ import * as path from "node:path";
2
2
  import * as files from "./index.js";
3
- const sepRE = new RegExp("\\" + path.sep, "g");
3
+ const sepRE = new RegExp(`\\${path.sep}`, "g");
4
4
  /**
5
5
  * represents a full path to a file,
6
6
  * i.e. a path from the document base to a file.
@@ -11,7 +11,7 @@ export class FullFilePath {
11
11
  }
12
12
  /** Returns the directory that contains this file */
13
13
  directory() {
14
- return new files.FullPath(path.dirname(this.value) + "/");
14
+ return new files.FullPath(`${path.dirname(this.value)}/`);
15
15
  }
16
16
  /** Returns the file extension of this path */
17
17
  extName() {
@@ -1,4 +1,4 @@
1
- import * as configuration from "../configuration/index.js";
1
+ import type * as configuration from "../configuration/index.js";
2
2
  import * as files from "./index.js";
3
3
  /**
4
4
  * Represents a link to another Markdown file,