UNPKG

@spartacus/schematics

Version:
19 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.migrateConfigDeprecation = void 0; const file_utils_1 = require("../../../shared/utils/file-utils"); const workspace_utils_1 = require("../../../shared/utils/workspace-utils"); function migrateConfigDeprecation(tree, _context, configDeprecations) { const project = workspace_utils_1.getSourceRoot(tree); const sourceFiles = file_utils_1.getAllTsSourceFiles(tree, project); for (const source of sourceFiles) { const sourcePath = source.fileName; for (const configDeprecation of configDeprecations) { const changes = file_utils_1.insertCommentAboveConfigProperty(sourcePath, source, configDeprecation.propertyName, configDeprecation.comment); file_utils_1.commitChanges(tree, sourcePath, changes, file_utils_1.InsertDirection.RIGHT); } } return tree; } exports.migrateConfigDeprecation = migrateConfigDeprecation; //# sourceMappingURL=config-deprecation.js.map