UNPKG

@microsoft/windows-admin-center-sdk

Version:

Microsoft - Windows Admin Center Shell

62 lines (60 loc) 2.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ErrorUpdaterAngular15 = void 0; const error_updater_1 = require("../../../upgrade/error-updater"); const logger_1 = require("../../utils/logger"); /** * Updater for Angular 15 errors. */ class ErrorUpdaterAngular15 extends error_updater_1.ErrorUpdater { /** * The function to parse the log file and update the errors. * @param log the input log.txt file data. * @param updateSource the update source. * @returns the count for unresolved errors. */ async resolveLogBuildErrors(log, updateSource = []) { const unresolvedErrorCount = await this.fixErrors(false, this.parseLogBuildErrors(log), updateSource, '15'); logger_1.Logger.log('INFO - unresolvedErrorCount:' + unresolvedErrorCount); this.checkNestedDependencies(log); return new Promise((resolve) => resolve(unresolvedErrorCount)); } /** * The function to parse the log file and update the warnings. * @param log the input log.txt file data. * @param updateSource the update source. * @returns the count for unresolved errors. */ async resolveLogBuildWarnings(log, updateSource = []) { const unresolvedWarningCount = await this.fixErrors(false, this.parseLogBuildWarning(log), updateSource, '15'); logger_1.Logger.log('INFO - unresolvedWarningCount:' + unresolvedWarningCount); return new Promise((resolve) => resolve(unresolvedWarningCount)); } /** * Gets the error results from the log file data. * @param log the log file data. * @returns the parsed error results. */ parseLogBuildErrors(log) { return this.parseBuildErrorsCore(log); } /** * Gets the warning results from the log file data. * @param log the log file data. * @returns the parsed warning results. */ parseLogBuildWarning(log) { return this.parseBuildWarningsCore(log); } /** * Checks if there are nested dependencies. * @param log the log file data. */ checkNestedDependencies(log) { log.includes('NG3003') ? logger_1.Logger.log('INFO - Nested dependencies found. Please manually fix them and verify by running: gulp build --prod\n') : logger_1.Logger.log('INFO - No nested dependencies found.'); } } exports.ErrorUpdaterAngular15 = ErrorUpdaterAngular15; //# sourceMappingURL=error-updater-angular15.js.map