@seleniumhq/side-runtime 4.0.0-alpha.10 → 4.0.0-alpha.11
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/plugins.d.ts +2 -1
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +10 -8
- package/dist/plugins.js.map +1 -1
- package/package.json +1 -1
package/dist/plugins.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CustomCommandShape, PluginShape } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const correctPluginPaths: (projectPath: string, plugins: string[]) => string[];
|
|
3
|
+
export declare const loadPlugins: (pluginPaths: string[], importer?: ((fileOrModule: string) => any) | undefined) => Promise<PluginShape[]>;
|
|
3
4
|
export declare const getCustomCommands: (plugins: PluginShape[]) => Record<string, CustomCommandShape>;
|
|
4
5
|
//# sourceMappingURL=plugins.d.ts.map
|
package/dist/plugins.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,eAAO,MAAM,kBAAkB,gBAChB,MAAM,WACV,MAAM,EAAE,KAChB,MAAM,EAKR,CAAA;AAED,eAAO,MAAM,WAAW,gBACT,MAAM,EAAE,6BACK,MAAM,KAAK,GAAG,kBACvC,QAAQ,WAAW,EAAE,CAarB,CAAA;AAEH,eAAO,MAAM,iBAAiB,YACnB,WAAW,EAAE,KACrB,OAAO,MAAM,EAAE,kBAAkB,CAOjC,CAAA"}
|
package/dist/plugins.js
CHANGED
|
@@ -26,16 +26,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getCustomCommands = exports.loadPlugins = void 0;
|
|
29
|
+
exports.getCustomCommands = exports.loadPlugins = exports.correctPluginPaths = void 0;
|
|
30
30
|
const path_1 = __importDefault(require("path"));
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const correctPluginPaths = (projectPath, plugins) => {
|
|
32
|
+
const projectDir = projectPath.split(path_1.default.sep).slice(0, -1).join(path_1.default.sep);
|
|
33
|
+
return plugins.map((pluginPath) => pluginPath.startsWith('.') ? path_1.default.join(projectDir, pluginPath) : pluginPath);
|
|
34
|
+
};
|
|
35
|
+
exports.correctPluginPaths = correctPluginPaths;
|
|
36
|
+
const loadPlugins = async (pluginPaths, importer) => Promise.all(pluginPaths.map(async (pluginPath) => {
|
|
37
|
+
console.debug('Loading plugin from path...', pluginPath);
|
|
36
38
|
let pluginFile = importer
|
|
37
|
-
? await importer(
|
|
38
|
-
: await Promise.resolve().then(() => __importStar(require(
|
|
39
|
+
? await importer(pluginPath)
|
|
40
|
+
: await Promise.resolve().then(() => __importStar(require(pluginPath)));
|
|
39
41
|
const plugin = pluginFile.default
|
|
40
42
|
? pluginFile.default
|
|
41
43
|
: pluginFile;
|
package/dist/plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAuB;AAGhB,MAAM,
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAuB;AAGhB,MAA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