@alyle/ui
Version:
Minimal Design, a set of components for Angular
24 lines • 994 B
JavaScript
;
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 componentPath = host.actions.filter(action => action.path.endsWith('.component.ts'))[0].path;
const buffer = host.read(componentPath).toString();
// remove style blank
host.overwrite(componentPath, buffer.replace(/\,?\n styles: \[\]/, ''));
return (0, schematics_1.chain)([
(0, styles_1.setUpStyles)(options, componentPath)
]);
};
}
function default_1(options) {
const newOptions = Object.assign(Object.assign({}, options), { inlineStyle: true });
return (0, schematics_1.chain)([
(0, schematics_1.externalSchematic)('@schematics/angular', 'component', newOptions),
updateFiles(newOptions)
]);
}
//# sourceMappingURL=index.js.map