UNPKG

@yolkai/nx-workspace

Version:

Extensible Dev Tools for Monorepos

22 lines (21 loc) 894 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const schematics_1 = require("@angular-devkit/schematics"); const nx_workspace_1 = require("@yolkai/nx-workspace"); const nx_workspace_2 = require("@yolkai/nx-workspace"); function default_1(schema) { const options = normalizeOptions(schema); const templateSource = schematics_1.apply(schematics_1.url('./files'), [ schematics_1.template(Object.assign({ dot: '.', tmpl: '' }, options)), schematics_1.move('tools/schematics') ]); return schematics_1.chain([ schematics_1.branchAndMerge(schematics_1.chain([schematics_1.mergeWith(templateSource)])), nx_workspace_1.formatFiles(options) ]); } exports.default = default_1; function normalizeOptions(options) { const name = nx_workspace_2.toFileName(options.name); return Object.assign({}, options, { name }); }