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.
- package/LICENSE +23 -0
- package/dist/actions/actions.d.ts +1 -1
- package/dist/actions/actions.js +1 -0
- package/dist/actions/built-in/check-image.d.ts +2 -2
- package/dist/actions/built-in/check-image.js +4 -4
- package/dist/actions/built-in/check-link.d.ts +2 -2
- package/dist/actions/built-in/check-link.js +17 -21
- package/dist/actions/built-in/test.d.ts +1 -1
- package/dist/actions/export.d.ts +1 -1
- package/dist/actions/external-action-manager.d.ts +2 -2
- package/dist/actions/external-action-manager.js +3 -2
- package/dist/actions/finder.d.ts +3 -3
- package/dist/actions/finder.js +10 -9
- package/dist/actions/index.d.ts +5 -5
- package/dist/actions/name.js +1 -1
- package/dist/activities/extract-dynamic.d.ts +2 -2
- package/dist/activities/extract-images-and-links.d.ts +1 -1
- package/dist/activities/normalize-action-name.d.ts +1 -1
- package/dist/activities/normalize-action-name.js +1 -1
- package/dist/ast/index.d.ts +1 -1
- package/dist/ast/index.js +1 -1
- package/dist/ast/node-list.d.ts +1 -1
- package/dist/ast/node-list.js +4 -4
- package/dist/ast/node.js +1 -1
- package/dist/commands/command.d.ts +1 -1
- package/dist/commands/debug.d.ts +3 -3
- package/dist/commands/debug.js +2 -2
- package/dist/commands/dynamic.d.ts +3 -3
- package/dist/commands/dynamic.js +1 -1
- package/dist/commands/run.d.ts +3 -3
- package/dist/commands/run.js +1 -1
- package/dist/commands/static.d.ts +3 -3
- package/dist/commands/static.js +1 -1
- package/dist/commands/unused.d.ts +3 -3
- package/dist/commands/unused.js +1 -1
- package/dist/configuration/data.d.ts +2 -2
- package/dist/configuration/defaults.d.ts +1 -1
- package/dist/configuration/defaults.js +1 -1
- package/dist/configuration/publication.js +1 -1
- package/dist/configuration/publications.d.ts +2 -2
- package/dist/errors/user-error.d.ts +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/filesystem/absolute-dir.js +1 -1
- package/dist/filesystem/absolute-file.js +2 -2
- package/dist/filesystem/full-dir.js +1 -1
- package/dist/filesystem/full-file.js +3 -3
- package/dist/filesystem/full-link.d.ts +1 -1
- package/dist/filesystem/full-link.js +5 -5
- package/dist/filesystem/full-path.d.ts +1 -1
- package/dist/filesystem/full-path.js +2 -2
- package/dist/filesystem/get-filenames.d.ts +1 -1
- package/dist/filesystem/has-directory.js +2 -2
- package/dist/filesystem/is-markdown-file.js +2 -2
- package/dist/filesystem/relative-link.d.ts +2 -2
- package/dist/filesystem/source-dir.js +1 -1
- package/dist/filesystem/unknown-link.d.ts +1 -1
- package/dist/helpers/add-leading-dot-unless-empty.js +1 -1
- package/dist/helpers/add-leading-slash.js +1 -1
- package/dist/helpers/add-trailing-slash.js +1 -1
- package/dist/helpers/trim-extension.js +1 -1
- package/dist/link-targets/find.d.ts +1 -1
- package/dist/link-targets/list.d.ts +3 -3
- package/dist/link-targets/target-url.js +0 -1
- package/dist/parsers/html/html-parser.d.ts +2 -2
- package/dist/parsers/html/html-parser.js +6 -4
- package/dist/parsers/html/parse-html-files.d.ts +2 -2
- package/dist/parsers/html/parse-html-files.js +1 -1
- package/dist/parsers/markdown/closing-tag-parser.d.ts +2 -2
- package/dist/parsers/markdown/md-parser.js +2 -2
- package/dist/parsers/markdown/open-node-tracker.d.ts +2 -2
- package/dist/parsers/markdown/parse.d.ts +2 -2
- package/dist/parsers/markdown/parse.js +1 -1
- package/dist/parsers/tag-mapper.d.ts +1 -1
- package/dist/parsers/tag-mapper.js +5 -5
- package/dist/run/activity-collector.d.ts +3 -3
- package/dist/run/name-refiner.d.ts +1 -1
- package/dist/run/output-collector.d.ts +1 -1
- package/dist/run/output-collector.js +3 -2
- package/dist/run/parallel.d.ts +5 -5
- package/dist/run/run-activity.d.ts +5 -5
- package/dist/run/run-activity.js +1 -1
- package/dist/run/sequential.d.ts +5 -5
- package/dist/run/stopwatch.js +2 -2
- package/dist/workspace/create.d.ts +1 -1
- package/dist/workspace/create.js +1 -1
- 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.
|
package/dist/actions/actions.js
CHANGED
|
@@ -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 |
|
|
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
|
-
|
|
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 (
|
|
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"] |
|
|
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
|
-
|
|
24
|
-
return
|
|
23
|
+
checkLinkToAnchorInSameFile(action.location.file, target, action);
|
|
24
|
+
return;
|
|
25
25
|
}
|
|
26
26
|
if (helpers.isLinkToAnchorInOtherFile(target)) {
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
checkLinkToAnchorInOtherFile(action.location, target, action);
|
|
28
|
+
return;
|
|
29
29
|
}
|
|
30
30
|
if (helpers.isExternalLink(target)) {
|
|
31
|
-
|
|
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
|
-
|
|
64
|
+
fullFile = fullPath.toFullFilePath();
|
|
65
65
|
}
|
|
66
|
-
catch (
|
|
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
|
-
|
|
74
|
-
|
|
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()
|
|
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.
|
|
84
|
+
const anchorName = target.substring(1);
|
|
87
85
|
if (!action.linkTargets.hasAnchor(file, anchorName)) {
|
|
88
|
-
|
|
89
|
-
|
|
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 (
|
|
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 (
|
|
119
|
+
catch (_err) {
|
|
124
120
|
throw new Error(`link to non-existing local file ${linkedFile.unixified()}`);
|
|
125
121
|
}
|
|
126
122
|
}
|
package/dist/actions/export.d.ts
CHANGED
|
@@ -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 =
|
|
18
|
+
const moduleName = `textrun-${parts[0]}`;
|
|
19
19
|
const wantAction = actions.name(parts[1]);
|
|
20
|
+
let module;
|
|
20
21
|
try {
|
|
21
|
-
|
|
22
|
+
module = await import(moduleName);
|
|
22
23
|
}
|
|
23
24
|
catch (e) {
|
|
24
25
|
if (!(e instanceof Error)) {
|
package/dist/actions/finder.d.ts
CHANGED
|
@@ -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;
|
package/dist/actions/finder.js
CHANGED
|
@@ -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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
70
|
+
files = await fs.readdir(dir);
|
|
70
71
|
}
|
|
71
|
-
catch (
|
|
72
|
+
catch (_e) {
|
|
72
73
|
// it's okay if there is no dir with custom actions
|
|
73
74
|
return [];
|
|
74
75
|
}
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -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 */
|
package/dist/actions/name.js
CHANGED
|
@@ -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
|
|
@@ -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]
|
|
11
|
+
return `${parts[0]}/${slugify(parts[1])}`;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=normalize-action-name.js.map
|
package/dist/ast/index.d.ts
CHANGED
package/dist/ast/index.js
CHANGED
package/dist/ast/node-list.d.ts
CHANGED
|
@@ -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;
|
package/dist/ast/node-list.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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", "")
|
|
28
|
+
return `${this.type.replace("open", "")}close`;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Returns the content of the "href" attribute for link tags,
|
package/dist/commands/debug.d.ts
CHANGED
|
@@ -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 {
|
package/dist/commands/debug.js
CHANGED
|
@@ -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;
|
package/dist/commands/dynamic.js
CHANGED
package/dist/commands/run.d.ts
CHANGED
|
@@ -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;
|
package/dist/commands/run.js
CHANGED
|
@@ -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;
|
package/dist/commands/static.js
CHANGED
|
@@ -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;
|
package/dist/commands/unused.js
CHANGED
|
@@ -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;
|
|
@@ -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(
|
|
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;
|
package/dist/events/index.d.ts
CHANGED
|
@@ -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,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(
|
|
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() {
|