textrun-extension 0.1.2 → 0.2.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.
@@ -1,4 +1,4 @@
1
- import * as tr from "text-runner-core";
1
+ import * as textRunner from "text-runner-core";
2
2
  /** runs Text-Runner in the workspace */
3
- export declare function runTextrunner(action: tr.actions.Args): Promise<void>;
3
+ export declare function runTextrunner(action: textRunner.actions.Args): Promise<void>;
4
4
  //# sourceMappingURL=run-textrunner.d.ts.map
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 tr.commands.Run({
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 tr.ActivityCollector(command);
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 tr from "text-runner-core";
1
+ import * as textRunner from "text-runner-core";
2
2
  /** runs the given content in Text-Runner */
3
- export declare function runnableRegion(action: tr.actions.Args): Promise<void>;
3
+ export declare function runnableRegion(action: textRunner.actions.Args): Promise<void>;
4
4
  //# sourceMappingURL=runnable-region.d.ts.map
@@ -1,23 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runnableRegion = void 0;
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 fs_1.promises.writeFile(action.configuration.workspace.joinStr("runnable-region.md"), content);
15
- const command = new tr.commands.Run({
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 tr.ActivityCollector(command);
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,3 +1,3 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  export declare function callArgs(command: string, platform: NodeJS.Platform): string[];
3
3
  //# sourceMappingURL=call-args.d.ts.map
@@ -1,13 +1,9 @@
1
- "use strict";
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 ["bash", "-c", command];
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.textrunActions = exports.callArgs = void 0;
4
- const run_textrunner_1 = require("./actions/run-textrunner");
5
- const runnable_region_1 = require("./actions/runnable-region");
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.2",
3
+ "version": "0.2.0",
4
4
  "description": "Text-Runner actions for verifying the documentation of Text-Runner extensions",
5
5
  "license": "ISC",
6
- "main": "dist/index.js",
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 --ext=.ts --ignore-path=../.eslintignore && prettier --write .",
18
+ "lint": "prettier -l . && eslint . --ext=.ts --ignore-path=../.eslintignore && depcheck",
19
+ "unit": "env NODE_NO_WARNINGS=1 mocha --reporter=dot 'src/**/*.test.ts'"
20
+ },
11
21
  "dependencies": {
12
- "text-runner-core": "^5.0.2"
22
+ "text-runner-core": "6.0.0"
13
23
  },
14
24
  "devDependencies": {
15
- "text-runner": "^5.0.2",
16
- "textrun-action": "^0.1.2"
25
+ "shared-cucumber-steps": "*",
26
+ "text-runner": "6.0.0",
27
+ "textrun-action": "0.2.0",
28
+ "ts-node": "10.9.1"
17
29
  },
18
- "gitHead": "1dca29620ef3189c64a62d706ded97c9b99deda3"
30
+ "gitHead": "5434976346f2e02bc08c0a6ea9f7cbfa67d68c4e"
19
31
  }