text-runner-engine 7.1.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 +36 -0
- package/dist/actions/actions.d.ts +11 -0
- package/dist/actions/actions.js +36 -0
- package/dist/actions/built-in/check-image.d.ts +4 -0
- package/dist/actions/built-in/check-image.js +59 -0
- package/dist/actions/built-in/check-link.d.ts +4 -0
- package/dist/actions/built-in/check-link.js +127 -0
- package/dist/actions/built-in/test.d.ts +3 -0
- package/dist/actions/built-in/test.js +4 -0
- package/dist/actions/export.d.ts +18 -0
- package/dist/actions/export.js +2 -0
- package/dist/actions/external-action-manager.d.ts +10 -0
- package/dist/actions/external-action-manager.js +44 -0
- package/dist/actions/finder.d.ts +29 -0
- package/dist/actions/finder.js +99 -0
- package/dist/actions/index.d.ts +37 -0
- package/dist/actions/index.js +3 -0
- package/dist/actions/name.d.ts +2 -0
- package/dist/actions/name.js +6 -0
- package/dist/activities/extract-dynamic.d.ts +5 -0
- package/dist/activities/extract-dynamic.js +29 -0
- package/dist/activities/extract-images-and-links.d.ts +5 -0
- package/dist/activities/extract-images-and-links.js +32 -0
- package/dist/activities/index.d.ts +20 -0
- package/dist/activities/index.js +14 -0
- package/dist/activities/normalize-action-name.d.ts +3 -0
- package/dist/activities/normalize-action-name.js +13 -0
- package/dist/ast/index.d.ts +3 -0
- package/dist/ast/index.js +3 -0
- package/dist/ast/node-list.d.ts +41 -0
- package/dist/ast/node-list.js +128 -0
- package/dist/ast/node.d.ts +49 -0
- package/dist/ast/node.js +53 -0
- package/dist/commands/command.d.ts +9 -0
- package/dist/commands/command.js +2 -0
- package/dist/commands/debug.d.ts +16 -0
- package/dist/commands/debug.js +122 -0
- package/dist/commands/dynamic.d.ts +13 -0
- package/dist/commands/dynamic.js +57 -0
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/index.js +7 -0
- package/dist/commands/run.d.ts +14 -0
- package/dist/commands/run.js +66 -0
- package/dist/commands/static.d.ts +13 -0
- package/dist/commands/static.js +60 -0
- package/dist/commands/unused.d.ts +13 -0
- package/dist/commands/unused.js +43 -0
- package/dist/configuration/data.d.ts +46 -0
- package/dist/configuration/data.js +2 -0
- package/dist/configuration/defaults.d.ts +5 -0
- package/dist/configuration/defaults.js +50 -0
- package/dist/configuration/index.d.ts +5 -0
- package/dist/configuration/index.js +4 -0
- package/dist/configuration/publication.d.ts +42 -0
- package/dist/configuration/publication.js +51 -0
- package/dist/configuration/publications.d.ts +9 -0
- package/dist/configuration/publications.js +25 -0
- package/dist/errors/error.d.ts +2 -0
- package/dist/errors/error.js +9 -0
- package/dist/errors/node-error.d.ts +3 -0
- package/dist/errors/node-error.js +5 -0
- package/dist/errors/user-error.d.ts +13 -0
- package/dist/errors/user-error.js +16 -0
- package/dist/events/index.d.ts +49 -0
- package/dist/events/index.js +13 -0
- package/dist/filesystem/absolute-dir.d.ts +25 -0
- package/dist/filesystem/absolute-dir.js +42 -0
- package/dist/filesystem/absolute-file.d.ts +18 -0
- package/dist/filesystem/absolute-file.js +28 -0
- package/dist/filesystem/full-dir.d.ts +11 -0
- package/dist/filesystem/full-dir.js +15 -0
- package/dist/filesystem/full-file.d.ts +22 -0
- package/dist/filesystem/full-file.js +35 -0
- package/dist/filesystem/full-link.d.ts +40 -0
- package/dist/filesystem/full-link.js +80 -0
- package/dist/filesystem/full-path.d.ts +31 -0
- package/dist/filesystem/full-path.js +61 -0
- package/dist/filesystem/get-filenames.d.ts +15 -0
- package/dist/filesystem/get-filenames.js +73 -0
- package/dist/filesystem/has-directory.d.ts +2 -0
- package/dist/filesystem/has-directory.js +11 -0
- package/dist/filesystem/index.d.ts +15 -0
- package/dist/filesystem/index.js +15 -0
- package/dist/filesystem/is-markdown-file.d.ts +2 -0
- package/dist/filesystem/is-markdown-file.js +11 -0
- package/dist/filesystem/location.d.ts +17 -0
- package/dist/filesystem/location.js +26 -0
- package/dist/filesystem/relative-dir.d.ts +6 -0
- package/dist/filesystem/relative-dir.js +7 -0
- package/dist/filesystem/relative-link.d.ts +16 -0
- package/dist/filesystem/relative-link.js +18 -0
- package/dist/filesystem/source-dir.d.ts +19 -0
- package/dist/filesystem/source-dir.js +35 -0
- package/dist/filesystem/unknown-link.d.ts +15 -0
- package/dist/filesystem/unknown-link.js +23 -0
- package/dist/helpers/add-leading-dot-unless-empty.d.ts +2 -0
- package/dist/helpers/add-leading-dot-unless-empty.js +10 -0
- package/dist/helpers/add-leading-slash.d.ts +2 -0
- package/dist/helpers/add-leading-slash.js +9 -0
- package/dist/helpers/add-trailing-slash.d.ts +2 -0
- package/dist/helpers/add-trailing-slash.js +7 -0
- package/dist/helpers/index.d.ts +16 -0
- package/dist/helpers/index.js +16 -0
- package/dist/helpers/is-external-link.d.ts +2 -0
- package/dist/helpers/is-external-link.js +5 -0
- package/dist/helpers/is-link-to-anchor-in-other-file.d.ts +2 -0
- package/dist/helpers/is-link-to-anchor-in-other-file.js +4 -0
- package/dist/helpers/is-link-to-anchor-in-same-file.d.ts +2 -0
- package/dist/helpers/is-link-to-anchor-in-same-file.js +4 -0
- package/dist/helpers/is-mailto-link.d.ts +2 -0
- package/dist/helpers/is-mailto-link.js +4 -0
- package/dist/helpers/remove-double-slash.d.ts +3 -0
- package/dist/helpers/remove-double-slash.js +6 -0
- package/dist/helpers/remove-leading-slash.d.ts +2 -0
- package/dist/helpers/remove-leading-slash.js +7 -0
- package/dist/helpers/remove-trailing-colon.d.ts +2 -0
- package/dist/helpers/remove-trailing-colon.js +9 -0
- package/dist/helpers/straighten-link.d.ts +3 -0
- package/dist/helpers/straighten-link.js +15 -0
- package/dist/helpers/trim-all-line-ends.d.ts +3 -0
- package/dist/helpers/trim-all-line-ends.js +5 -0
- package/dist/helpers/trim-extension.d.ts +2 -0
- package/dist/helpers/trim-extension.js +5 -0
- package/dist/helpers/unixify.d.ts +3 -0
- package/dist/helpers/unixify.js +6 -0
- package/dist/link-targets/find.d.ts +4 -0
- package/dist/link-targets/find.js +9 -0
- package/dist/link-targets/index.d.ts +15 -0
- package/dist/link-targets/index.js +3 -0
- package/dist/link-targets/list.d.ts +18 -0
- package/dist/link-targets/list.js +74 -0
- package/dist/link-targets/target-url.d.ts +2 -0
- package/dist/link-targets/target-url.js +8 -0
- package/dist/parsers/html/html-parser.d.ts +28 -0
- package/dist/parsers/html/html-parser.js +153 -0
- package/dist/parsers/html/index.d.ts +2 -0
- package/dist/parsers/html/index.js +2 -0
- package/dist/parsers/html/parse-html-files.d.ts +6 -0
- package/dist/parsers/html/parse-html-files.js +16 -0
- package/dist/parsers/index.d.ts +3 -0
- package/dist/parsers/index.js +3 -0
- package/dist/parsers/markdown/closing-tag-parser.d.ts +13 -0
- package/dist/parsers/markdown/closing-tag-parser.js +29 -0
- package/dist/parsers/markdown/index.d.ts +3 -0
- package/dist/parsers/markdown/index.js +3 -0
- package/dist/parsers/markdown/md-parser.d.ts +50 -0
- package/dist/parsers/markdown/md-parser.js +316 -0
- package/dist/parsers/markdown/open-node-tracker.d.ts +14 -0
- package/dist/parsers/markdown/open-node-tracker.js +33 -0
- package/dist/parsers/markdown/parse.d.ts +5 -0
- package/dist/parsers/markdown/parse.js +15 -0
- package/dist/parsers/tag-mapper.d.ts +31 -0
- package/dist/parsers/tag-mapper.js +112 -0
- package/dist/run/activity-collector.d.ts +29 -0
- package/dist/run/activity-collector.js +35 -0
- package/dist/run/index.d.ts +9 -0
- package/dist/run/index.js +5 -0
- package/dist/run/name-refiner.d.ts +13 -0
- package/dist/run/name-refiner.js +20 -0
- package/dist/run/output-collector.d.ts +13 -0
- package/dist/run/output-collector.js +30 -0
- package/dist/run/parallel.d.ts +11 -0
- package/dist/run/parallel.js +13 -0
- package/dist/run/run-activity.d.ts +8 -0
- package/dist/run/run-activity.js +76 -0
- package/dist/run/sequential.d.ts +7 -0
- package/dist/run/sequential.js +10 -0
- package/dist/run/stopwatch.d.ts +12 -0
- package/dist/run/stopwatch.js +19 -0
- package/dist/text-runner.d.ts +15 -0
- package/dist/text-runner.js +15 -0
- package/dist/workspace/create.d.ts +4 -0
- package/dist/workspace/create.js +10 -0
- package/dist/workspace/index.d.ts +2 -0
- package/dist/workspace/index.js +2 -0
- package/package.json +45 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** allows refining the current name of a test step */
|
|
2
|
+
export class NameRefiner {
|
|
3
|
+
// eslint-disable-next-line no-empty-function
|
|
4
|
+
constructor(name) {
|
|
5
|
+
this.name = name;
|
|
6
|
+
}
|
|
7
|
+
/** returns the refined name */
|
|
8
|
+
finalName() {
|
|
9
|
+
return this.name;
|
|
10
|
+
}
|
|
11
|
+
/** returns a function that can be called to refine the name */
|
|
12
|
+
refineFn() {
|
|
13
|
+
return this.refineName.bind(this);
|
|
14
|
+
}
|
|
15
|
+
/** updates the currently stored name to the given name */
|
|
16
|
+
refineName(newName) {
|
|
17
|
+
this.name = newName;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=name-refiner.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as run from "./index.js";
|
|
2
|
+
/** simulates console.log to collect output from a running action */
|
|
3
|
+
export declare class OutputCollector {
|
|
4
|
+
/** collects the received output */
|
|
5
|
+
content: string[];
|
|
6
|
+
/** appends to the output with a newline */
|
|
7
|
+
log(...args: any[]): void;
|
|
8
|
+
/** returns the "log" function to be used by actions */
|
|
9
|
+
logFn(): run.LogFn;
|
|
10
|
+
/** returns the currently accumulated output */
|
|
11
|
+
toString(): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=output-collector.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as util from "util";
|
|
2
|
+
/** simulates console.log to collect output from a running action */
|
|
3
|
+
export class OutputCollector {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** collects the received output */
|
|
6
|
+
this.content = [];
|
|
7
|
+
}
|
|
8
|
+
/** appends to the output with a newline */
|
|
9
|
+
log(...args) {
|
|
10
|
+
const stringified = [];
|
|
11
|
+
for (const arg of args) {
|
|
12
|
+
if (typeof arg === "string") {
|
|
13
|
+
stringified.push(arg);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
stringified.push(util.inspect(arg, false, Infinity));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
this.content.push(stringified.join(" ") + "\n");
|
|
20
|
+
}
|
|
21
|
+
/** returns the "log" function to be used by actions */
|
|
22
|
+
logFn() {
|
|
23
|
+
return this.log.bind(this);
|
|
24
|
+
}
|
|
25
|
+
/** returns the currently accumulated output */
|
|
26
|
+
toString() {
|
|
27
|
+
return this.content.join("");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=output-collector.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as actions from "../actions/index.js";
|
|
2
|
+
import * as activities from "../activities/index.js";
|
|
3
|
+
import * as commands from "../commands/index.js";
|
|
4
|
+
import * as configuration from "../configuration/index.js";
|
|
5
|
+
import * as linkTargets from "../link-targets/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* Executes the given activities in parallel.
|
|
8
|
+
* Returns the errors they produce.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parallel(activities: activities.List, actionFinder: actions.Finder, targets: linkTargets.List, configuration: configuration.Data, emitter: commands.Command): Promise<boolean>[];
|
|
11
|
+
//# sourceMappingURL=parallel.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { runActivity } from "./run-activity.js";
|
|
2
|
+
/**
|
|
3
|
+
* Executes the given activities in parallel.
|
|
4
|
+
* Returns the errors they produce.
|
|
5
|
+
*/
|
|
6
|
+
export function parallel(activities, actionFinder, targets, configuration, emitter) {
|
|
7
|
+
const result = [];
|
|
8
|
+
for (const activity of activities) {
|
|
9
|
+
result.push(runActivity(activity, actionFinder, configuration, targets, emitter));
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=parallel.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as actions from "../actions/index.js";
|
|
2
|
+
import { Activity } from "../activities/index.js";
|
|
3
|
+
import * as commands from "../commands/index.js";
|
|
4
|
+
import * as configuration from "../configuration/index.js";
|
|
5
|
+
import * as linkTargets from "../link-targets/index.js";
|
|
6
|
+
/** runs the given activity, indicates whether it encountered an error */
|
|
7
|
+
export declare function runActivity(activity: Activity, actionFinder: actions.Finder, configuration: configuration.Data, targets: linkTargets.List, emitter: commands.Command): Promise<boolean>;
|
|
8
|
+
//# sourceMappingURL=run-activity.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import humanize from "humanize-string";
|
|
2
|
+
import * as util from "util";
|
|
3
|
+
import { isUserError, UserError } from "../errors/user-error.js";
|
|
4
|
+
import { errorMessage } from "../text-runner.js";
|
|
5
|
+
import { NameRefiner } from "./name-refiner.js";
|
|
6
|
+
import { OutputCollector } from "./output-collector.js";
|
|
7
|
+
/** runs the given activity, indicates whether it encountered an error */
|
|
8
|
+
export async function runActivity(activity, actionFinder, configuration, targets, emitter) {
|
|
9
|
+
const outputCollector = new OutputCollector();
|
|
10
|
+
const nameRefiner = new NameRefiner(humanize(activity.actionName));
|
|
11
|
+
const args = {
|
|
12
|
+
configuration,
|
|
13
|
+
document: activity.document,
|
|
14
|
+
linkTargets: targets,
|
|
15
|
+
location: activity.location,
|
|
16
|
+
log: outputCollector.logFn(),
|
|
17
|
+
name: nameRefiner.refineFn(),
|
|
18
|
+
region: activity.region,
|
|
19
|
+
SKIPPING: 254
|
|
20
|
+
};
|
|
21
|
+
try {
|
|
22
|
+
const action = await actionFinder.actionFor(activity);
|
|
23
|
+
let actionResult;
|
|
24
|
+
if (action.length === 1) {
|
|
25
|
+
actionResult = await runSyncOrPromiseFunc(action, args);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
actionResult = await runCallbackFunc(action, args);
|
|
29
|
+
}
|
|
30
|
+
if (actionResult === undefined) {
|
|
31
|
+
emitter.emit("result", {
|
|
32
|
+
activity,
|
|
33
|
+
finalName: nameRefiner.finalName(),
|
|
34
|
+
output: outputCollector.toString(),
|
|
35
|
+
status: "success"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else if (actionResult === args.SKIPPING) {
|
|
39
|
+
if (configuration.showSkipped) {
|
|
40
|
+
emitter.emit("result", {
|
|
41
|
+
activity,
|
|
42
|
+
finalName: nameRefiner.finalName(),
|
|
43
|
+
output: outputCollector.toString(),
|
|
44
|
+
status: "skipped"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
throw new Error(`unknown return code from action: ${actionResult}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
let guidance = "";
|
|
54
|
+
if (isUserError(e)) {
|
|
55
|
+
guidance = e.guidance;
|
|
56
|
+
}
|
|
57
|
+
emitter.emit("result", {
|
|
58
|
+
activity,
|
|
59
|
+
error: new UserError(errorMessage(e), guidance, activity.location),
|
|
60
|
+
finalName: nameRefiner.finalName(),
|
|
61
|
+
output: outputCollector.toString(),
|
|
62
|
+
status: "failed"
|
|
63
|
+
});
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
async function runCallbackFunc(func, args) {
|
|
69
|
+
const promisified = util.promisify(func);
|
|
70
|
+
return promisified(args);
|
|
71
|
+
}
|
|
72
|
+
async function runSyncOrPromiseFunc(func, args) {
|
|
73
|
+
const result = await Promise.resolve(func(args));
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=run-activity.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as actions from "../actions/index.js";
|
|
2
|
+
import * as activities from "../activities/index.js";
|
|
3
|
+
import * as commands from "../commands/index.js";
|
|
4
|
+
import * as configuration from "../configuration/index.js";
|
|
5
|
+
import * as linkTargets from "../link-targets/index.js";
|
|
6
|
+
export declare function sequential(activities: activities.List, actionFinder: actions.Finder, configuration: configuration.Data, linkTargets: linkTargets.List, emitter: commands.Command): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=sequential.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { runActivity } from "./run-activity.js";
|
|
2
|
+
export async function sequential(activities, actionFinder, configuration, linkTargets, emitter) {
|
|
3
|
+
for (const activity of activities) {
|
|
4
|
+
const abort = await runActivity(activity, actionFinder, configuration, linkTargets, emitter);
|
|
5
|
+
if (abort) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=sequential.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** StopWatch allows to measure the difference between time periods */
|
|
2
|
+
export declare class StopWatch {
|
|
3
|
+
/** the time when this StopWatch was started */
|
|
4
|
+
private startTime;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* Duration returns a human-readable description of the difference
|
|
8
|
+
* between the current time and when this StopWatch was created.
|
|
9
|
+
*/
|
|
10
|
+
duration(): string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=stopwatch.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** StopWatch allows to measure the difference between time periods */
|
|
2
|
+
export class StopWatch {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.startTime = new Date().getTime();
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Duration returns a human-readable description of the difference
|
|
8
|
+
* between the current time and when this StopWatch was created.
|
|
9
|
+
*/
|
|
10
|
+
duration() {
|
|
11
|
+
const endTime = new Date().getTime();
|
|
12
|
+
const milliseconds = endTime - this.startTime;
|
|
13
|
+
if (milliseconds > 1000) {
|
|
14
|
+
return `${Math.round(milliseconds / 1000)}s`;
|
|
15
|
+
}
|
|
16
|
+
return `${milliseconds}ms`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=stopwatch.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * as exports from "./actions/export.js";
|
|
2
|
+
export * as actions from "./actions/index.js";
|
|
3
|
+
export * as activities from "./activities/index.js";
|
|
4
|
+
export * as ast from "./ast/index.js";
|
|
5
|
+
export * as commands from "./commands/index.js";
|
|
6
|
+
export * as configuration from "./configuration/index.js";
|
|
7
|
+
export { errorMessage } from "./errors/error.js";
|
|
8
|
+
export { isFsError } from "./errors/node-error.js";
|
|
9
|
+
export { isUserError, UserError } from "./errors/user-error.js";
|
|
10
|
+
export * as events from "./events/index.js";
|
|
11
|
+
export * as files from "./filesystem/index.js";
|
|
12
|
+
export * as helpers from "./helpers/index.js";
|
|
13
|
+
export * as parsers from "./parsers/index.js";
|
|
14
|
+
export { ActivityCollector, ActivityResults } from "./run/activity-collector.js";
|
|
15
|
+
//# sourceMappingURL=text-runner.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * as exports from "./actions/export.js";
|
|
2
|
+
export * as actions from "./actions/index.js";
|
|
3
|
+
export * as activities from "./activities/index.js";
|
|
4
|
+
export * as ast from "./ast/index.js";
|
|
5
|
+
export * as commands from "./commands/index.js";
|
|
6
|
+
export * as configuration from "./configuration/index.js";
|
|
7
|
+
export { errorMessage } from "./errors/error.js";
|
|
8
|
+
export { isFsError } from "./errors/node-error.js";
|
|
9
|
+
export { isUserError, UserError } from "./errors/user-error.js";
|
|
10
|
+
export * as events from "./events/index.js";
|
|
11
|
+
export * as files from "./filesystem/index.js";
|
|
12
|
+
export * as helpers from "./helpers/index.js";
|
|
13
|
+
export * as parsers from "./parsers/index.js";
|
|
14
|
+
export { ActivityCollector, ActivityResults } from "./run/activity-collector.js";
|
|
15
|
+
//# sourceMappingURL=text-runner.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { promises as fs } from "fs";
|
|
2
|
+
/** creates the temp directory to run the tests in */
|
|
3
|
+
export async function create(config) {
|
|
4
|
+
const path = config.workspace.platformified();
|
|
5
|
+
if (config.emptyWorkspace) {
|
|
6
|
+
await fs.rm(path, { force: true, recursive: true });
|
|
7
|
+
}
|
|
8
|
+
await fs.mkdir(path, { recursive: true });
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=create.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "text-runner-engine",
|
|
3
|
+
"version": "7.1.0",
|
|
4
|
+
"description": "Tests documentation written in MarkDown",
|
|
5
|
+
"homepage": "https://github.com/kevgo/text-runner",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/kevgo/text-runner.git"
|
|
9
|
+
},
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"author": "Kevin Goslar",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"exports": "./dist/text-runner.js",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/**/*.js",
|
|
16
|
+
"dist/**/*.d.ts"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig-build.json",
|
|
20
|
+
"clean": "rm -rf dist",
|
|
21
|
+
"doc": "text-runner",
|
|
22
|
+
"fix": "eslint --fix --ignore-pattern=dist/ . && dprint fmt && sort-package-json --quiet",
|
|
23
|
+
"lint": "eslint --ignore-pattern=dist/ . && dprint check && sort-package-json --check --quiet && depcheck",
|
|
24
|
+
"stats": "find . -type f | grep -v /node_modules/ | grep -v /dist/ | grep -v \\./\\.git/ | grep -v \\./\\.vscode/ | grep -v \\./tmp/ | xargs scc",
|
|
25
|
+
"unit": "node --test --import tsx 'src/**/*.test.ts'"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@sindresorhus/slugify": "2.2.1",
|
|
29
|
+
"anchor-markdown-header": "0.7.0",
|
|
30
|
+
"globby": "14.1.0",
|
|
31
|
+
"got": "14.4.6",
|
|
32
|
+
"humanize-string": "3.0.0",
|
|
33
|
+
"is-glob": "4.0.3",
|
|
34
|
+
"markdown-it": "14.1.0",
|
|
35
|
+
"parse5": "7.2.1",
|
|
36
|
+
"tmp-promise": "3.0.3"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/got": "9.6.12",
|
|
40
|
+
"@types/is-glob": "4.0.4",
|
|
41
|
+
"@types/markdown-it": "14.1.2",
|
|
42
|
+
"tsx": "4.19.3"
|
|
43
|
+
},
|
|
44
|
+
"gitHead": "bdf119a8e549f679af14f88952f7353648b50759"
|
|
45
|
+
}
|