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