UNPKG

@alyle/ui

Version:

Minimal Design, a set of components for Angular

24 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = default_1; const schematics_1 = require("@angular-devkit/schematics"); const styles_1 = require("../utils/styles"); function updateFiles(options) { return (host) => { const directivePath = host.actions.filter(action => action.path.endsWith('.directive.ts'))[0].path; const buffer = host.read(directivePath).toString(); // remove style blank host.overwrite(directivePath, buffer.replace(/\,?\n styles: \[\]/, '')); return (0, schematics_1.chain)([ (0, styles_1.setUpStyles)(options, directivePath, 'Directive') ]); }; } function default_1(options) { const newOptions = Object.assign(Object.assign({}, options), { inlineStyle: true }); return (0, schematics_1.chain)([ (0, schematics_1.externalSchematic)('@schematics/angular', 'directive', newOptions), updateFiles(newOptions) ]); } //# sourceMappingURL=index.js.map