playwright-ng-schematics
Version:
Playwright Angular schematics
22 lines (21 loc) • 864 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = e2e;
const core_1 = require("@angular-devkit/core");
const schematics_1 = require("@angular-devkit/schematics");
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
function e2e(options) {
return (tree, _context) => {
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
(0, schematics_1.applyTemplates)({
classify: core_1.strings.classify,
name: options.name,
dasherize: core_1.strings.dasherize,
}),
(0, schematics_1.move)('e2e'),
]);
const rule = (0, schematics_1.chain)([(0, schematics_1.mergeWith)(templateSource)]);
return rule(tree, _context);
};
}