textrun-action 0.0.11 → 0.1.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/name-full.js CHANGED
@@ -2,14 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.nameFull = void 0;
4
4
  const tr = require("text-runner-core");
5
- function nameFull(action) {
5
+ async function nameFull(action) {
6
6
  const want = action.region.text();
7
7
  action.name(`verify full name of action "${want}"`);
8
8
  const wantStd = tr.actions.name(want);
9
- // eslint-disable-next-line @typescript-eslint/no-var-requires
10
- const pkgJson = require(action.configuration.sourceDir.joinStr("package.json"));
11
- // eslint-disable-next-line @typescript-eslint/no-var-requires
12
- const main = require(action.configuration.sourceDir.joinStr(pkgJson.main));
9
+ const pkgJson = await Promise.resolve().then(() => require(action.configuration.sourceDir.joinStr("package.json")));
10
+ const main = await Promise.resolve().then(() => require(action.configuration.sourceDir.joinStr(pkgJson.main)));
13
11
  const allNames = Object.keys(main.textrunActions);
14
12
  const allNamesStd = allNames.map(tr.actions.name);
15
13
  if (!allNamesStd.includes(wantStd)) {
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.nameShort = void 0;
4
+ const fs_1 = require("fs");
4
5
  const tr = require("text-runner-core");
5
- function nameShort(action) {
6
+ async function nameShort(action) {
6
7
  const want = action.region.text();
7
8
  const wantStd = tr.actions.name(want);
8
- // eslint-disable-next-line @typescript-eslint/no-var-requires
9
- const pkgJson = require(action.configuration.sourceDir.joinStr("package.json"));
10
- // eslint-disable-next-line @typescript-eslint/no-var-requires
11
- const main = require(action.configuration.sourceDir.joinStr(pkgJson.main));
9
+ const pkgJson = JSON.parse(await fs_1.promises.readFile(action.configuration.sourceDir.joinStr("package.json"), "utf-8"));
10
+ const main = await Promise.resolve().then(() => require(action.configuration.sourceDir.joinStr(pkgJson.main)));
12
11
  const allNames = Object.keys(main.textrunActions);
13
12
  const allNamesStd = allNames.map(tr.actions.name);
14
13
  if (!allNamesStd.includes(wantStd)) {
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "textrun-action",
3
- "version": "0.0.11",
3
+ "version": "0.1.1",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/**/*.js"
7
7
  ],
8
8
  "license": "ISC",
9
9
  "dependencies": {
10
- "text-runner-core": "5.0.0-pre10"
10
+ "text-runner-core": "5.0.1"
11
11
  },
12
12
  "devDependencies": {
13
- "text-runner": "5.0.0-pre10"
13
+ "text-runner": "5.0.1"
14
14
  },
15
- "gitHead": "0daa6e0620e60b423f4cde725936d61468b61a52"
15
+ "gitHead": "1380706cc871cb3a5adfeba9e996694c6d8bf892"
16
16
  }