@rbnx/webdriverio
Version:
webdriverio plugin for nx
27 lines • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const devkit_1 = require("@nx/devkit");
const generator_1 = tslib_1.__importDefault(require("../init/generator"));
const add_project_config_1 = require("./lib/add-project-config");
const add_project_files_1 = require("./lib/add-project-files");
const normalize_options_1 = require("./lib/normalize-options");
async function projectGenerator(tree, options) {
const { project, skipFormat } = options;
const normalizedOptions = (0, normalize_options_1.normalizeOptions)(tree, options);
const workspaceProjects = (0, devkit_1.getProjects)(tree);
if (project && !workspaceProjects.has(project)) {
return Promise.reject(`${project} is not a valid project in the workspace`);
}
const initTask = await (0, generator_1.default)(tree, {
...normalizedOptions,
skipFormat: true,
});
(0, add_project_config_1.addProjectConfig)(tree, normalizedOptions);
await (0, add_project_files_1.addProjectFiles)(tree, normalizedOptions);
if (!skipFormat)
await (0, devkit_1.formatFiles)(tree);
return initTask;
}
exports.default = projectGenerator;
//# sourceMappingURL=generator.js.map