textrun-extension 0.1.2 → 0.2.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/dist/actions/run-textrunner.d.ts +2 -2
- package/dist/actions/run-textrunner.js +5 -9
- package/dist/actions/runnable-region.d.ts +2 -2
- package/dist/actions/runnable-region.js +7 -11
- package/dist/helpers/call-args.d.ts +0 -1
- package/dist/helpers/call-args.js +2 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -9
- package/package.json +18 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as textRunner from "text-runner-core";
|
|
2
2
|
/** runs Text-Runner in the workspace */
|
|
3
|
-
export declare function runTextrunner(action:
|
|
3
|
+
export declare function runTextrunner(action: textRunner.actions.Args): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=run-textrunner.d.ts.map
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.runTextrunner = void 0;
|
|
4
|
-
const tr = require("text-runner-core");
|
|
5
|
-
const util = require("util");
|
|
1
|
+
import * as textRunner from "text-runner-core";
|
|
2
|
+
import * as util from "util";
|
|
6
3
|
/** runs Text-Runner in the workspace */
|
|
7
|
-
async function runTextrunner(action) {
|
|
4
|
+
export async function runTextrunner(action) {
|
|
8
5
|
action.name("Running Text-Runner in workspace");
|
|
9
|
-
const command = new
|
|
6
|
+
const command = new textRunner.commands.Run({
|
|
10
7
|
sourceDir: action.configuration.workspace.joinStr(action.region[0].attributes["dir"] || "."),
|
|
11
8
|
workspace: ".",
|
|
12
9
|
emptyWorkspace: false,
|
|
13
10
|
});
|
|
14
|
-
const activityCollector = new
|
|
11
|
+
const activityCollector = new textRunner.ActivityCollector(command);
|
|
15
12
|
await command.execute();
|
|
16
13
|
for (const result of activityCollector.results()) {
|
|
17
14
|
action.log(util.inspect(result));
|
|
@@ -20,5 +17,4 @@ async function runTextrunner(action) {
|
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
|
-
exports.runTextrunner = runTextrunner;
|
|
24
20
|
//# sourceMappingURL=run-textrunner.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as textRunner from "text-runner-core";
|
|
2
2
|
/** runs the given content in Text-Runner */
|
|
3
|
-
export declare function runnableRegion(action:
|
|
3
|
+
export declare function runnableRegion(action: textRunner.actions.Args): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=runnable-region.d.ts.map
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const tr = require("text-runner-core");
|
|
6
|
-
const util = require("util");
|
|
1
|
+
import { promises as fs } from "fs";
|
|
2
|
+
import * as textRunner from "text-runner-core";
|
|
3
|
+
import * as util from "util";
|
|
7
4
|
/** runs the given content in Text-Runner */
|
|
8
|
-
async function runnableRegion(action) {
|
|
5
|
+
export async function runnableRegion(action) {
|
|
9
6
|
action.name("execute Markdown in Text-Runner");
|
|
10
7
|
const content = action.region.text().trim();
|
|
11
8
|
if (content === "") {
|
|
12
9
|
throw new Error("no content to run found");
|
|
13
10
|
}
|
|
14
|
-
await
|
|
15
|
-
const command = new
|
|
11
|
+
await fs.writeFile(action.configuration.workspace.joinStr("runnable-region.md"), content);
|
|
12
|
+
const command = new textRunner.commands.Run({
|
|
16
13
|
sourceDir: action.configuration.workspace.platformified(),
|
|
17
14
|
workspace: ".",
|
|
18
15
|
emptyWorkspace: false,
|
|
19
16
|
});
|
|
20
|
-
const activityCollector = new
|
|
17
|
+
const activityCollector = new textRunner.ActivityCollector(command);
|
|
21
18
|
await command.execute();
|
|
22
19
|
for (const result of activityCollector.results()) {
|
|
23
20
|
action.log(util.inspect(result));
|
|
@@ -26,5 +23,4 @@ async function runnableRegion(action) {
|
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
exports.runnableRegion = runnableRegion;
|
|
30
26
|
//# sourceMappingURL=runnable-region.js.map
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.callArgs = void 0;
|
|
4
|
-
function callArgs(command, platform) {
|
|
1
|
+
export function callArgs(command, platform) {
|
|
5
2
|
if (platform === "win32") {
|
|
6
3
|
return ["cmd", "/c", command.replace(/\//g, "\\")];
|
|
7
4
|
}
|
|
8
5
|
else {
|
|
9
|
-
return ["
|
|
6
|
+
return ["sh", "-c", command];
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
exports.callArgs = callArgs;
|
|
13
9
|
//# sourceMappingURL=call-args.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { runTextrunner } from "./actions/run-textrunner";
|
|
2
|
-
import { runnableRegion } from "./actions/runnable-region";
|
|
3
|
-
import { callArgs } from "./helpers/call-args";
|
|
1
|
+
import { runTextrunner } from "./actions/run-textrunner.js";
|
|
2
|
+
import { runnableRegion } from "./actions/runnable-region.js";
|
|
3
|
+
import { callArgs } from "./helpers/call-args.js";
|
|
4
4
|
declare const textrunActions: {
|
|
5
5
|
runnableRegion: typeof runnableRegion;
|
|
6
6
|
runTextrunner: typeof runTextrunner;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const call_args_1 = require("./helpers/call-args");
|
|
7
|
-
Object.defineProperty(exports, "callArgs", { enumerable: true, get: function () { return call_args_1.callArgs; } });
|
|
8
|
-
const textrunActions = { runnableRegion: runnable_region_1.runnableRegion, runTextrunner: run_textrunner_1.runTextrunner };
|
|
9
|
-
exports.textrunActions = textrunActions;
|
|
1
|
+
import { runTextrunner } from "./actions/run-textrunner.js";
|
|
2
|
+
import { runnableRegion } from "./actions/runnable-region.js";
|
|
3
|
+
import { callArgs } from "./helpers/call-args.js";
|
|
4
|
+
const textrunActions = { runnableRegion, runTextrunner };
|
|
5
|
+
export { callArgs, textrunActions };
|
|
10
6
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "textrun-extension",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Text-Runner actions for verifying the documentation of Text-Runner extensions",
|
|
5
5
|
"license": "ISC",
|
|
6
|
-
"
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": "./dist/index.js",
|
|
7
8
|
"files": [
|
|
8
9
|
"dist/**/*.js",
|
|
9
10
|
"dist/**/*.d.ts"
|
|
10
11
|
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc -p tsconfig-build.json",
|
|
14
|
+
"clean": "rm -rf dist",
|
|
15
|
+
"cuke": "cucumber-js --format=progress",
|
|
16
|
+
"doc": "text-run static --format=summary && text-run dynamic --format=progress",
|
|
17
|
+
"fix": "eslint --fix --ignore-pattern=dist/ . && prettier --write .",
|
|
18
|
+
"lint": "prettier -l . && eslint --ignore-pattern=dist/ . && depcheck",
|
|
19
|
+
"unit": "env NODE_NO_WARNINGS=1 mocha --reporter=dot 'src/**/*.test.ts'"
|
|
20
|
+
},
|
|
11
21
|
"dependencies": {
|
|
12
|
-
"text-runner-core": "
|
|
22
|
+
"text-runner-core": "6.0.1"
|
|
13
23
|
},
|
|
14
24
|
"devDependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
25
|
+
"shared-cucumber-steps": "*",
|
|
26
|
+
"text-runner": "6.0.1",
|
|
27
|
+
"textrun-action": "0.2.1",
|
|
28
|
+
"tsx": "4.19.3"
|
|
17
29
|
},
|
|
18
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "e479ff08fba71c7b2f6d1e3e14001b7818a38e12"
|
|
19
31
|
}
|