@microsoft/windows-admin-center-sdk 4.87.0 → 4.167.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/angular/assets/strings/cs-CZ/strings.json +1 -1
  2. package/angular/assets/strings/de-DE/strings.json +1 -1
  3. package/angular/assets/strings/es-ES/strings.json +1 -1
  4. package/angular/assets/strings/fr-FR/strings.json +1 -1
  5. package/angular/assets/strings/hu-HU/strings.json +1 -1
  6. package/angular/assets/strings/id-ID/strings.json +1 -1
  7. package/angular/assets/strings/it-IT/strings.json +1 -1
  8. package/angular/assets/strings/ja-JP/strings.json +1 -1
  9. package/angular/assets/strings/ko-KR/strings.json +1 -1
  10. package/angular/assets/strings/nl-NL/strings.json +1 -1
  11. package/angular/assets/strings/pl-PL/strings.json +1 -1
  12. package/angular/assets/strings/pt-BR/strings.json +1 -1
  13. package/angular/assets/strings/pt-PT/strings.json +1 -1
  14. package/angular/assets/strings/ru-RU/strings.json +1 -1
  15. package/angular/assets/strings/strings.json +1 -1
  16. package/angular/assets/strings/sv-SE/strings.json +1 -1
  17. package/angular/assets/strings/tr-TR/strings.json +1 -1
  18. package/angular/assets/strings/zh-CN/strings.json +1 -1
  19. package/angular/assets/strings/zh-TW/strings.json +1 -1
  20. package/angular/esm2020/src/controls/actions/containers/action-bar/action-bar.component.mjs +2 -2
  21. package/angular/esm2020/src/controls/actions/containers/action-container.component.mjs +2 -3
  22. package/angular/esm2020/src/controls/alert-bar/alert-bar.component.mjs +2 -2
  23. package/angular/esm2020/src/controls/breadcrumb-header/breadcrumb-header.component.mjs +1 -1
  24. package/angular/esm2020/src/controls/common/base.component.mjs +1 -1
  25. package/angular/esm2020/src/controls/common/spacer-base.component.mjs +25 -1
  26. package/angular/esm2020/src/controls/context-menu/context-menu.component.mjs +2 -3
  27. package/angular/esm2020/src/controls/data-table/data-table.component.mjs +7 -7
  28. package/angular/esm2020/src/controls/dialog/base-dialog.component.mjs +2 -4
  29. package/angular/esm2020/src/controls/dialog/confirmation-list-dialog/confirmation-list-dialog.component.mjs +2 -2
  30. package/angular/esm2020/src/controls/dropdown/dropdown.component.mjs +1 -4
  31. package/angular/esm2020/src/controls/form/form-field/clock/clock-form-field.component.mjs +10 -7
  32. package/angular/esm2020/src/controls/form/form-field/form-field.component.mjs +1 -1
  33. package/angular/esm2020/src/controls/form/form-field/number/number-form-field.component.mjs +22 -4
  34. package/angular/esm2020/src/controls/form/form-field/radio-group/classic/radio-group-form-field.component.mjs +5 -5
  35. package/angular/esm2020/src/controls/icon/icon-text/icon-text.component.mjs +6 -6
  36. package/angular/esm2020/src/controls/icon/layered-icon/status/status-icon.component.mjs +1 -1
  37. package/angular/esm2020/src/controls/layout/editable-layout.component.mjs +2 -3
  38. package/angular/esm2020/src/controls/node-credentials-form/node-credentials-form.component.mjs +2 -2
  39. package/angular/esm2020/src/controls/property-grid/property-grid.component.mjs +33 -13
  40. package/angular/esm2020/src/controls/schema/tabbed-form-loader.component.mjs +2 -2
  41. package/angular/esm2020/src/controls/settings/common-settings/common-settings.component.mjs +5 -5
  42. package/angular/esm2020/src/controls/settings/settings-form.directive.mjs +3 -7
  43. package/angular/esm2020/src/controls/settings/settings-form.service.mjs +2 -4
  44. package/angular/esm2020/src/controls/snap-in-extension/snap-in-extension.component.mjs +1 -1
  45. package/angular/esm2020/src/controls/split-view/split-view.component.mjs +2 -2
  46. package/angular/esm2020/src/directives/router/router-link.directive.mjs +2 -2
  47. package/angular/esm2020/src/directives/svg/svg.directive.mjs +2 -3
  48. package/angular/esm2020/src/generated/strings.mjs +1 -1
  49. package/angular/esm2020/src/service/navigation.service.mjs +3 -8
  50. package/angular/esm2020/src/service/user-alive.service.mjs +2 -4
  51. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.mjs +128 -73
  52. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.mjs.map +1 -1
  53. package/angular/fesm2020/microsoft-windows-admin-center-sdk-angular.mjs +116 -71
  54. package/angular/fesm2020/microsoft-windows-admin-center-sdk-angular.mjs.map +1 -1
  55. package/angular/package.json +1 -1
  56. package/angular/src/controls/common/spacer-base.component.d.ts +11 -2
  57. package/angular/src/controls/form/form-field/number/number-form-field.component.d.ts +8 -0
  58. package/angular/src/controls/icon/icon-text/icon-text.component.d.ts +1 -1
  59. package/angular/src/controls/property-grid/property-grid.component.d.ts +2 -0
  60. package/angular/src/directives/svg/svg.directive.d.ts +1 -2
  61. package/angular/src/generated/strings.d.ts +12 -0
  62. package/core/assets/strings/cs-CZ/strings.json +1 -1
  63. package/core/assets/strings/es-ES/strings.json +1 -1
  64. package/core/assets/strings/fr-FR/strings.json +1 -1
  65. package/core/assets/strings/hu-HU/strings.json +1 -1
  66. package/core/assets/strings/id-ID/strings.json +1 -1
  67. package/core/assets/strings/it-IT/strings.json +1 -1
  68. package/core/assets/strings/ja-JP/strings.json +1 -1
  69. package/core/assets/strings/ko-KR/strings.json +1 -1
  70. package/core/assets/strings/pl-PL/strings.json +1 -1
  71. package/core/assets/strings/pt-BR/strings.json +1 -1
  72. package/core/assets/strings/pt-PT/strings.json +1 -1
  73. package/core/assets/strings/ru-RU/strings.json +1 -1
  74. package/core/assets/strings/sv-SE/strings.json +1 -1
  75. package/core/assets/strings/tr-TR/strings.json +1 -1
  76. package/core/assets/strings/zh-CN/strings.json +1 -1
  77. package/core/assets/strings/zh-TW/strings.json +1 -1
  78. package/core/azure/azure-constants.d.ts +3 -2
  79. package/core/azure/azure-constants.d.ts.map +1 -1
  80. package/core/azure/azure-constants.js +11 -3
  81. package/core/azure/azure-constants.js.map +1 -1
  82. package/core/base/utilities.d.ts +3 -3
  83. package/core/base/utilities.d.ts.map +1 -1
  84. package/core/base/utilities.js +2 -2
  85. package/core/base/utilities.js.map +1 -1
  86. package/core/data/active-directory/active-directory.d.ts.map +1 -1
  87. package/core/data/active-directory/active-directory.js +1 -1
  88. package/core/data/active-directory/active-directory.js.map +1 -1
  89. package/core/data/cookie.d.ts.map +1 -1
  90. package/core/data/cookie.js +7 -0
  91. package/core/data/cookie.js.map +1 -1
  92. package/core/data/gateway-url-translator.d.ts +1 -0
  93. package/core/data/gateway-url-translator.d.ts.map +1 -1
  94. package/core/data/gateway-url-translator.js +21 -6
  95. package/core/data/gateway-url-translator.js.map +1 -1
  96. package/core/data/gateway-urls.d.ts +6 -0
  97. package/core/data/gateway-urls.d.ts.map +1 -1
  98. package/core/data/gateway-urls.js +8 -0
  99. package/core/data/gateway-urls.js.map +1 -1
  100. package/core/data/node-connection.d.ts.map +1 -1
  101. package/core/data/node-connection.js +0 -2
  102. package/core/data/node-connection.js.map +1 -1
  103. package/core/generated/powershell-scripts.d.ts.map +1 -1
  104. package/core/generated/powershell-scripts.js +1 -1
  105. package/core/generated/powershell-scripts.js.map +1 -1
  106. package/core/resources/scripts/public/inventory/Get-ServerInventory.ps1 +38 -16
  107. package/core/security/tool-condition-validator.d.ts.map +1 -1
  108. package/core/security/tool-condition-validator.js +5 -5
  109. package/core/security/tool-condition-validator.js.map +1 -1
  110. package/core/shared/server-inventory/server-inventory-cache.d.ts.map +1 -1
  111. package/core/shared/server-inventory/server-inventory-cache.js +1 -1
  112. package/core/shared/server-inventory/server-inventory-cache.js.map +1 -1
  113. package/core/shared/server-inventory/server-inventory.d.ts +4 -4
  114. package/core/shared/server-inventory/server-inventory.d.ts.map +1 -1
  115. package/core/shared/server-inventory/server-inventory.js +2 -2
  116. package/core/shared/server-inventory/server-inventory.js.map +1 -1
  117. package/microsoft-windows-admin-center-sdk-4.167.0.tgz +0 -0
  118. package/package.json +10 -8
  119. package/styles/css/main-v2.css +1 -1
  120. package/tools/code-formatter/.eslintrc.base.json +1 -0
  121. package/tools/code-formatter/lint.d.ts.map +1 -1
  122. package/tools/code-formatter/lint.js +7 -1
  123. package/tools/code-formatter/lint.js.map +1 -1
  124. package/tools/code-formatter/utilities.d.ts +7 -0
  125. package/tools/code-formatter/utilities.d.ts.map +1 -0
  126. package/tools/code-formatter/utilities.js +79 -0
  127. package/tools/code-formatter/utilities.js.map +1 -0
  128. package/tools/gulp-update-notes-resource/index.d.ts.map +1 -1
  129. package/tools/gulp-update-notes-resource/index.js +4 -4
  130. package/tools/gulp-update-notes-resource/index.js.map +1 -1
  131. package/tools/module-template/.eslintrc.json +3 -0
  132. package/tools/module-template/build/pipelines/ci-build.yml +2 -2
  133. package/tools/module-template/gulpfile.ts/common/utilities.ts +1 -0
  134. package/tools/wac-cli/src/angular15/configs/angular-json-config.d.ts +2 -7
  135. package/tools/wac-cli/src/angular15/configs/angular-json-config.d.ts.map +1 -1
  136. package/tools/wac-cli/src/angular15/configs/angular-json-config.js +8 -1
  137. package/tools/wac-cli/src/angular15/configs/angular-json-config.js.map +1 -1
  138. package/tools/wac-cli/src/angular15/configs/eslint-auto-fix-config.d.ts +9 -0
  139. package/tools/wac-cli/src/angular15/configs/eslint-auto-fix-config.d.ts.map +1 -0
  140. package/tools/wac-cli/src/angular15/configs/eslint-auto-fix-config.js +16 -0
  141. package/tools/wac-cli/src/angular15/configs/eslint-auto-fix-config.js.map +1 -0
  142. package/tools/wac-cli/src/angular15/configs/package-json-config.d.ts +4 -0
  143. package/tools/wac-cli/src/angular15/configs/package-json-config.d.ts.map +1 -1
  144. package/tools/wac-cli/src/angular15/configs/package-json-config.js +13 -9
  145. package/tools/wac-cli/src/angular15/configs/package-json-config.js.map +1 -1
  146. package/tools/wac-cli/src/angular15/main.d.ts +20 -4
  147. package/tools/wac-cli/src/angular15/main.d.ts.map +1 -1
  148. package/tools/wac-cli/src/angular15/main.js +44 -8
  149. package/tools/wac-cli/src/angular15/main.js.map +1 -1
  150. package/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.d.ts +18 -0
  151. package/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.d.ts.map +1 -0
  152. package/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.js +49 -0
  153. package/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.js.map +1 -0
  154. package/tools/wac-cli/templates/wac-template/package.json +3 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/configs/package-json-config.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,QAAQ,GAAG;IACpB,6BAA6B,EAAE,4BAA4B;IAC3D,gCAAgC,EAAE,+BAA+B;IACjE,+BAA+B,EAAE,8BAA8B;IAC/D,8BAA8B,EAAE,6BAA6B;IAC7D,sCAAsC,EAAE,oCAAoC;IAC5E,sCAAsC,EAAE,qCAAqC;IAC7E,oCAAoC,EAAE,mCAAmC;IACzE,oCAAoC,EAAE,mCAAmC;CAC5E,CAAA;AAEY,QAAA,gBAAgB,GAAG;IAC5B,kCAAkC,EAAE,iCAAiC;IACrE,8BAA8B,EAAE,6BAA6B;IAC7D,gCAAgC,EAAE,+BAA+B;IACjE,4BAA4B,EAAE,2BAA2B;IACzD,6BAA6B,EAAE,4BAA4B;IAC3D,wCAAwC,EAAE,uCAAuC;IACjF,wCAAwC,EAAE,uCAAuC;IACjF,gDAAgD,EAAE,+CAA+C;IACjG,8BAA8B,EAAE,6BAA6B;IAC7D,oBAAoB,EAAE,qBAAqB;IAC3C,mBAAmB,EAAE,mBAAmB;IACxC,iBAAiB,EAAE,kBAAkB;IACrC,qBAAqB,EAAE,qBAAqB;IAC5C,8CAA8C,EAAE,8CAA8C;IAC9F,8CAA8C,EAAE,2CAA2C;IAC3F,oCAAoC,EAAE,qCAAqC;IAC3E,0CAA0C,EAAE,2CAA2C;IACvF,mDAAmD,EAAE,oDAAoD;IACzG,uCAAuC,EAAE,wCAAwC;IACjF,4CAA4C,EAAE,6CAA6C;IAC3F,2BAA2B,EAAE,0BAA0B;IACvD,oCAAoC,EAAE,mCAAmC;IACzE,2BAA2B,EAAE,4BAA4B;IACzD,yBAAyB,EAAE,yBAAyB;IACpD,0BAA0B,EAAE,0BAA0B;IACtD,8CAA8C,EAAE,6CAA6C;IAC7F,uCAAuC,EAAE,sCAAsC;IAC/E,mBAAmB,EAAE,oBAAoB;IACzC,kCAAkC,EAAE,kCAAkC;IACtE,iCAAiC,EAAE,kCAAkC;IACrE,gCAAgC,EAAE,iCAAiC;IACnE,iBAAiB,EAAE,iBAAiB;IACpC,yBAAyB,EAAE,0BAA0B;IACrD,+BAA+B,EAAE,+BAA+B;IAChE,kBAAkB,EAAE,mBAAmB;IACvC,2BAA2B,EAAE,4BAA4B;IACzD,0BAA0B,EAAE,0BAA0B;IACtD,wCAAwC,EAAE,wCAAwC;IAClF,6BAA6B,EAAE,6BAA6B;IAC5D,uBAAuB,EAAE,wBAAwB;IACjD,wBAAwB,EAAE,yBAAyB;IACnD,uBAAuB,EAAE,wBAAwB;IACjD,+BAA+B,EAAE,gCAAgC;IACjE,uBAAuB,EAAE,uBAAuB;IAChD,oBAAoB,EAAE,sBAAsB;IAC5C,uBAAuB,EAAE,uBAAuB;IAChD,wBAAwB,EAAE,4BAA4B;IACtD,iBAAiB,EAAE,iBAAiB;CACvC,CAAA;AAED,kEAAkE;AACrD,QAAA,OAAO,GAAG;IACnB,kCAAkC;IAClC,iCAAiC;IACjC,gBAAgB;IAChB,6BAA6B;IAC7B,wBAAwB;IACxB,8BAA8B;IAC9B,QAAQ;IACR,SAAS;IACT,eAAe;CAClB,CAAA;AAEY,QAAA,IAAI,GAAG;IAChB,mCAAmC,EAAE,sCAAsC;IAC3E,wCAAwC,EAAE,0CAA0C;CACvF,CAAA","file":"package-json-config.js","sourcesContent":["/**\r\n * The configuration file for the package-json-config.ts file upgrading to Angular 15.\r\n */\r\nexport const replaces = {\r\n '\"@msft-sme/core\": \"2.633.0\"': '\"@msft-sme/core\": \"4.12.0\"',\r\n '\"@msft-sme/angular\": \"2.633.0\"': '\"@msft-sme/angular\": \"4.12.0\"',\r\n '\"@msft-sme/styles\": \"2.633.0\"': '\"@msft-sme/styles\": \"4.12.0\"',\r\n '\"@microsoft/windows-admin-center-sdk/tools\": \"2.633.0\"': '\"@microsoft/windows-admin-center-sdk/tools\": \"4.12.0\"',\r\n '\"@msft-sme/file-explorer\": \"2.174.0\"': '\"@msft-sme/file-explorer\": \"4.2.0\"',\r\n '\"@msft-sme/remote-desktop\": \"2.35.0\"': '\"@msft-sme/remote-desktop\": \"4.2.0\"',\r\n '\"@msft-sme/event-viewer\": \"2.88.0\"': '\"@msft-sme/event-viewer\": \"4.1.0\"',\r\n '\"@msft-sme/azure-center\": \"2.47.0\"': '\"@msft-sme/azure-center\": \"4.1.0\"'\r\n}\r\n\r\nexport const replacesPipeline = {\r\n '\"@angular/animations\": \"11.2.14\"': '\"@angular/animations\": \"15.2.9\"',\r\n '\"@angular/common\": \"11.2.14\"': '\"@angular/common\": \"15.2.9\"',\r\n '\"@angular/compiler\": \"11.2.14\"': '\"@angular/compiler\": \"15.2.9\"',\r\n '\"@angular/core\": \"11.2.14\"': '\"@angular/core\": \"15.2.9\"',\r\n '\"@angular/forms\": \"11.2.14\"': '\"@angular/forms\": \"15.2.9\"',\r\n '\"@angular/language-service\": \"11.2.14\"': '\"@angular/language-service\": \"15.2.9\"',\r\n '\"@angular/platform-browser\": \"11.2.14\"': '\"@angular/platform-browser\": \"15.2.9\"',\r\n '\"@angular/platform-browser-dynamic\": \"11.2.14\"': '\"@angular/platform-browser-dynamic\": \"15.2.9\"',\r\n '\"@angular/router\": \"11.2.14\"': '\"@angular/router\": \"15.2.9\"',\r\n '\"core-js\": \"2.6.2\"': '\"core-js\": \"3.30.1\"',\r\n '\"tslib\": \"^2.0.0\"': '\"tslib\": \"^2.3.0\"',\r\n '\"rxjs\": \"6.6.0\"': '\"rxjs\": \"~7.5.0\"',\r\n '\"zone.js\": \"0.11.3\"': '\"zone.js\": \"0.13.1\"',\r\n '\"@angular-builders/custom-webpack\": \"11.1.1\"': '\"@angular-builders/custom-webpack\": \"15.0.0\"',\r\n '\"@angular-devkit/build-angular\": \"0.1102.13\"': '\"@angular-devkit/build-angular\": \"15.2.9\"',\r\n '\"@angular-eslint/builder\": \"4.3.1\"': '\"@angular-eslint/builder\": \"15.2.1\"',\r\n '\"@angular-eslint/eslint-plugin\": \"4.3.1\"': '\"@angular-eslint/eslint-plugin\": \"15.2.1\"',\r\n '\"@angular-eslint/eslint-plugin-template\": \"4.3.1\"': '\"@angular-eslint/eslint-plugin-template\": \"15.2.1\"',\r\n '\"@angular-eslint/schematics\": \"4.3.1\"': '\"@angular-eslint/schematics\": \"15.2.1\"',\r\n '\"@angular-eslint/template-parser\": \"4.3.1\"': '\"@angular-eslint/template-parser\": \"15.2.1\"',\r\n '\"@angular/cli\": \"11.2.13\"': '\"@angular/cli\": \"15.2.9\"',\r\n '\"@angular/compiler-cli\": \"11.2.14\"': '\"@angular/compiler-cli\": \"15.2.9\"',\r\n '\"@types/jasmine\": \"3.6.0\"': '\"@types/jasmine\": \"~4.3.0\"',\r\n '\"@types/karma\": \"5.0.0\"': '\"@types/karma\": \"6.3.4\"',\r\n '\"@types/node\": \"12.11.1\"': '\"@types/node\": \"17.0.21\"',\r\n '\"@typescript-eslint/eslint-plugin\": \"4.16.1\"': '\"@typescript-eslint/eslint-plugin\": \"6.4.1\"',\r\n '\"@typescript-eslint/parser\": \"4.16.1\"': '\"@typescript-eslint/parser\": \"6.4.1\"',\r\n '\"eslint\": \"7.6.0\"': '\"eslint\": \"8.47.0\"',\r\n '\"eslint-plugin-import\": \"2.21.0\"': '\"eslint-plugin-import\": \"2.28.1\"',\r\n '\"eslint-plugin-jsdoc\": \"36.1.1\"': '\"eslint-plugin-jsdoc\": \"^46.5.0\"',\r\n '\"eslint-plugin-jsonc\": \"2.8.0\"': '\"eslint-plugin-jsonc\": \"^2.9.0\"',\r\n '\"gulp\": \"4.0.0\"': '\"gulp\": \"4.0.2\"',\r\n '\"jasmine-core\": \"3.6.0\"': '\"jasmine-core\": \"~4.5.0\"',\r\n '\"\"jasmine-reporters\": \"2.4.0\"': '\"jasmine-reporters\": \"~2.5.2\"',\r\n '\"karma\": \"6.1.0\"': '\"karma\": \"~6.4.0\"',\r\n '\"karma-coverage\": \"2.0.3\"': '\"karma-coverage\": \"~2.2.0\"',\r\n '\"karma-jasmine\": \"4.0.0\"': '\"karma-jasmine\": \"5.1.0\"',\r\n '\"karma-jasmine-html-reporter\": \"1.5.0\"': '\"karma-jasmine-html-reporter\": \"2.1.0\"',\r\n '\"karma-typescript\": \"5.5.1\"': '\"karma-typescript\": \"5.5.4\"',\r\n '\"ng-mocks\": \"11.10.1\"': '\"ng-mocks\": \"~14.11.0\"',\r\n '\"ng-packagr\": \"11.2.4\"': '\"ng-packagr\": \"~15.2.2\"',\r\n '\"puppeteer\": \"10.0.0\"': '\"puppeteer\": \"~21.0.1\"',\r\n '\"selenium-webdriver\": \"3.6.0\"': '\"selenium-webdriver\": \"4.11.1\"',\r\n '\"ts-helpers\": \"1.1.1\"': '\"ts-helpers\": \"1.1.2\"',\r\n '\"ts-node\": \"8.3.0\"': '\"ts-node\": \"~10.9.1\"',\r\n '\"typescript\": \"4.1.5\"': '\"typescript\": \"4.8.2\"',\r\n '\"gulp-eslint\": \"6.0.0\"': '\"gulp-eslint-new\": \"1.8.3\"',\r\n '\"ajv\": \"6.12.6\"': '\"ajv\": \"6.12.6\"'\r\n}\r\n\r\n// wac-uta will be brought back until we fix the dependency issue.\r\nexport const removes = [\r\n \"@angular-devkit/build-ng-packagr\",\r\n \"@angular-devkit/build-optimizer\",\r\n \"@wac-uta/shell\",\r\n \"@wac-uta/ui-test-automation\",\r\n \"@wac-uta/file-explorer\",\r\n \"@msft-sme/ui-test-automation\",\r\n \"jquery\",\r\n \"tsickle\",\r\n \"@msft-sme/e2e\"\r\n]\r\n\r\nexport const adds = {\r\n '\"eslint-plugin-angular\": \"^4.1.0\"': '\"eslint-plugin-deprecation\": \"1.5.0\"',\r\n '\"eslint-plugin-prefer-arrow\": \"^1.2.3\"': '\"eslint-plugin-unused-imports\": \"^3.0.0\"'\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/configs/package-json-config.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E,oBAAoB;IACzC,kCAAkC,EAAE,kCAAkC;IACtE,iCAAiC,EAAE,kCAAkC;IACrE,gCAAgC,EAAE,iCAAiC;IACnE,iBAAiB,EAAE,iBAAiB;IACpC,yBAAyB,EAAE,0BAA0B;IACrD,+BAA+B,EAAE,+BAA+B;IAChE,kBAAkB,EAAE,mBAAmB;IACvC,2BAA2B,EAAE,4BAA4B;IACzD,0BAA0B,EAAE,0BAA0B;IACtD,wCAAwC,EAAE,wCAAwC;IAClF,6BAA6B,EAAE,6BAA6B;IAC5D,uBAAuB,EAAE,wBAAwB;IACjD,wBAAwB,EAAE,yBAAyB;IACnD,uBAAuB,EAAE,wBAAwB;IACjD,+BAA+B,EAAE,gCAAgC;IACjE,uBAAuB,EAAE,uBAAuB;IAChD,oBAAoB,EAAE,sBAAsB;IAC5C,uBAAuB,EAAE,uBAAuB;IAChD,wBAAwB,EAAE,4BAA4B;IACtD,iBAAiB,EAAE,iBAAiB;IACpC,8BAA8B,EAAE,8BAA8B;CACjE,CAAA;AAED,kEAAkE;AACrD,QAAA,OAAO,GAAG;IACnB,kCAAkC;IAClC,iCAAiC;IACjC,gBAAgB;IAChB,6BAA6B;IAC7B,wBAAwB;IACxB,8BAA8B;IAC9B,QAAQ;IACR,SAAS;IACT,eAAe;CAClB,CAAA;AAEY,QAAA,IAAI,GAAG;IAChB,mCAAmC,EAAE,sCAAsC;IAC3E,wCAAwC,EAAE,0CAA0C;CACvF,CAAA","file":"package-json-config.js","sourcesContent":["/**\r\n * The configuration file for the package-json-config.ts file upgrading to Angular 15.\r\n */\r\nexport const replaces = {\r\n '\"@msft-sme/core\": \"2.633.0\"': '\"@msft-sme/core\": \"4.99.0\"',\r\n '\"@msft-sme/angular\": \"2.633.0\"': '\"@msft-sme/angular\": \"4.99.0\"',\r\n '\"@msft-sme/styles\": \"2.633.0\"': '\"@msft-sme/styles\": \"4.99.0\"',\r\n '\"@microsoft/windows-admin-center-sdk/tools\": \"2.633.0\"': '\"@microsoft/windows-admin-center-sdk/tools\": \"4.99.0\"',\r\n '\"@msft-sme/file-explorer\": \"2.174.0\"': '\"@msft-sme/file-explorer\": \"4.10.0\"',\r\n '\"@msft-sme/remote-desktop\": \"2.35.0\"': '\"@msft-sme/remote-desktop\": \"4.9.0\"',\r\n '\"@msft-sme/event-viewer\": \"2.88.0\"': '\"@msft-sme/event-viewer\": \"4.8.0\"',\r\n '\"@msft-sme/azure-center\": \"2.47.0\"': '\"@msft-sme/azure-center\": \"4.9.0\"',\r\n '\"@msft-sme/storage\": \"2.44.0\"': '\"@msft-sme/storage\": \"4.8.0\"',\r\n '\"@msft-sme/local-users-groups\": \"2.45.0\"': '\"@msft-sme/local-users-groups\": \"4.7.0\"',\r\n '\"@msft-sme/powershell-console\": \"2.33.0\"': '\"@msft-sme/powershell-console\": \"4.8.0\"'\r\n}\r\n\r\nexport const replacesPipeline = {\r\n '\"@angular/animations\": \"11.2.14\"': '\"@angular/animations\": \"15.2.9\"',\r\n '\"@angular/common\": \"11.2.14\"': '\"@angular/common\": \"15.2.9\"',\r\n '\"@angular/compiler\": \"11.2.14\"': '\"@angular/compiler\": \"15.2.9\"',\r\n '\"@angular/core\": \"11.2.14\"': '\"@angular/core\": \"15.2.9\"',\r\n '\"@angular/forms\": \"11.2.14\"': '\"@angular/forms\": \"15.2.9\"',\r\n '\"@angular/language-service\": \"11.2.14\"': '\"@angular/language-service\": \"15.2.9\"',\r\n '\"@angular/platform-browser\": \"11.2.14\"': '\"@angular/platform-browser\": \"15.2.9\"',\r\n '\"@angular/platform-browser-dynamic\": \"11.2.14\"': '\"@angular/platform-browser-dynamic\": \"15.2.9\"',\r\n '\"@angular/router\": \"11.2.14\"': '\"@angular/router\": \"15.2.9\"',\r\n '\"core-js\": \"2.6.2\"': '\"core-js\": \"3.30.1\"',\r\n '\"tslib\": \"^2.0.0\"': '\"tslib\": \"^2.3.0\"',\r\n '\"rxjs\": \"6.6.0\"': '\"rxjs\": \"~7.5.0\"',\r\n '\"zone.js\": \"0.11.3\"': '\"zone.js\": \"0.13.1\"',\r\n '\"@angular-builders/custom-webpack\": \"11.1.1\"': '\"@angular-builders/custom-webpack\": \"15.0.0\"',\r\n '\"@angular-devkit/build-angular\": \"0.1102.13\"': '\"@angular-devkit/build-angular\": \"15.2.9\"',\r\n '\"@angular-eslint/builder\": \"4.3.1\"': '\"@angular-eslint/builder\": \"15.2.1\"',\r\n '\"@angular-eslint/eslint-plugin\": \"4.3.1\"': '\"@angular-eslint/eslint-plugin\": \"15.2.1\"',\r\n '\"@angular-eslint/eslint-plugin-template\": \"4.3.1\"': '\"@angular-eslint/eslint-plugin-template\": \"15.2.1\"',\r\n '\"@angular-eslint/schematics\": \"4.3.1\"': '\"@angular-eslint/schematics\": \"15.2.1\"',\r\n '\"@angular-eslint/template-parser\": \"4.3.1\"': '\"@angular-eslint/template-parser\": \"15.2.1\"',\r\n '\"@angular/cli\": \"11.2.13\"': '\"@angular/cli\": \"15.2.9\"',\r\n '\"@angular/compiler-cli\": \"11.2.14\"': '\"@angular/compiler-cli\": \"15.2.9\"',\r\n '\"@types/jasmine\": \"3.6.0\"': '\"@types/jasmine\": \"~4.3.0\"',\r\n '\"@types/karma\": \"5.0.0\"': '\"@types/karma\": \"6.3.4\"',\r\n '\"@types/node\": \"12.11.1\"': '\"@types/node\": \"17.0.21\"',\r\n '\"@typescript-eslint/eslint-plugin\": \"4.16.1\"': '\"@typescript-eslint/eslint-plugin\": \"6.4.1\"',\r\n '\"@typescript-eslint/parser\": \"4.16.1\"': '\"@typescript-eslint/parser\": \"6.4.1\"',\r\n '\"eslint\": \"7.6.0\"': '\"eslint\": \"8.47.0\"',\r\n '\"eslint-plugin-import\": \"2.21.0\"': '\"eslint-plugin-import\": \"2.28.1\"',\r\n '\"eslint-plugin-jsdoc\": \"36.1.1\"': '\"eslint-plugin-jsdoc\": \"^46.5.0\"',\r\n '\"eslint-plugin-jsonc\": \"2.8.0\"': '\"eslint-plugin-jsonc\": \"^2.9.0\"',\r\n '\"gulp\": \"4.0.0\"': '\"gulp\": \"4.0.2\"',\r\n '\"jasmine-core\": \"3.6.0\"': '\"jasmine-core\": \"~4.5.0\"',\r\n '\"\"jasmine-reporters\": \"2.4.0\"': '\"jasmine-reporters\": \"~2.5.2\"',\r\n '\"karma\": \"6.1.0\"': '\"karma\": \"~6.4.0\"',\r\n '\"karma-coverage\": \"2.0.3\"': '\"karma-coverage\": \"~2.2.0\"',\r\n '\"karma-jasmine\": \"4.0.0\"': '\"karma-jasmine\": \"5.1.0\"',\r\n '\"karma-jasmine-html-reporter\": \"1.5.0\"': '\"karma-jasmine-html-reporter\": \"2.1.0\"',\r\n '\"karma-typescript\": \"5.5.1\"': '\"karma-typescript\": \"5.5.4\"',\r\n '\"ng-mocks\": \"11.10.1\"': '\"ng-mocks\": \"~14.11.0\"',\r\n '\"ng-packagr\": \"11.2.4\"': '\"ng-packagr\": \"~15.2.2\"',\r\n '\"puppeteer\": \"10.0.0\"': '\"puppeteer\": \"~21.0.1\"',\r\n '\"selenium-webdriver\": \"3.6.0\"': '\"selenium-webdriver\": \"4.11.1\"',\r\n '\"ts-helpers\": \"1.1.1\"': '\"ts-helpers\": \"1.1.2\"',\r\n '\"ts-node\": \"8.3.0\"': '\"ts-node\": \"~10.9.1\"',\r\n '\"typescript\": \"4.1.5\"': '\"typescript\": \"4.8.2\"',\r\n '\"gulp-eslint\": \"6.0.0\"': '\"gulp-eslint-new\": \"1.8.3\"',\r\n '\"ajv\": \"6.12.6\"': '\"ajv\": \"6.12.6\"',\r\n '\"@playwright/test\": \"1.20.1\"': '\"@playwright/test\": \"1.31.0\"'\r\n}\r\n\r\n// wac-uta will be brought back until we fix the dependency issue.\r\nexport const removes = [\r\n \"@angular-devkit/build-ng-packagr\",\r\n \"@angular-devkit/build-optimizer\",\r\n \"@wac-uta/shell\",\r\n \"@wac-uta/ui-test-automation\",\r\n \"@wac-uta/file-explorer\",\r\n \"@msft-sme/ui-test-automation\",\r\n \"jquery\",\r\n \"tsickle\",\r\n \"@msft-sme/e2e\"\r\n]\r\n\r\nexport const adds = {\r\n '\"eslint-plugin-angular\": \"^4.1.0\"': '\"eslint-plugin-deprecation\": \"1.5.0\"',\r\n '\"eslint-plugin-prefer-arrow\": \"^1.2.3\"': '\"eslint-plugin-unused-imports\": \"^3.0.0\"'\r\n}\r\n"]}
@@ -15,8 +15,13 @@ export declare enum Angular15UpgraderMessages {
15
15
  UpdateBasicPaths = "Updating basic paths for the upgrade...",
16
16
  Initialization = "Initializing upgraders...",
17
17
  FinalizeInfoLintFix = "There are eslint violations that needs fix... After fixing the violations, please run the following commands:\n\n npx eslint . --fix \n\n gulp lintApp \n\n gulp build \n\n ",
18
- CannotRunStageThreeExternal = "The ui-test-automation_legacy is for internal extension upgrade only.",
19
- Completed = "Upgrade completed!"
18
+ InternalCommandOnly = "This command is only available for internal extension.",
19
+ Completed = "Upgrade completed!",
20
+ StartMessageStage0 = "Starting stage 0: the default Angular 15 upgrade stage",
21
+ StartMessageStage1 = "Starting stage 1: the Angular core stage",
22
+ StartMessageStage2 = "Starting stage 2: the Angular 15 unit test stage",
23
+ StartMessageStage3 = "Starting stage 3: the legacy ui-test-automation stage",
24
+ StartMessageStage4 = "Starting stage 4: the eslint to support gulp lintApp --fix command stage"
20
25
  }
21
26
  /**
22
27
  * This is the main class of the EslintUpgrader tool.
@@ -68,6 +73,7 @@ export declare class Angular15Upgrader {
68
73
  private uiTestAutomationLegacyFilePath;
69
74
  private uiTestAutomationLegacyFolderPath;
70
75
  private logFilePath;
76
+ private eslintrcFilePath;
71
77
  /**
72
78
  * The upgrader for each configuration file.
73
79
  */
@@ -87,6 +93,10 @@ export declare class Angular15Upgrader {
87
93
  private logParser;
88
94
  private jasmineTestUpgrader;
89
95
  private uITestAutomationLegacyUpgrader;
96
+ /**
97
+ * The eslint fix upgrader to support linter fix command for stage 4.
98
+ */
99
+ private eslintAutoFixUpgrader;
90
100
  /**
91
101
  * The file names for each configuration file.
92
102
  */
@@ -107,6 +117,7 @@ export declare class Angular15Upgrader {
107
117
  private readonly gulpCompileTsFileName;
108
118
  private readonly gulpIndexTsFileName;
109
119
  private readonly logFileName;
120
+ private readonly eslintrcFileName;
110
121
  constructor();
111
122
  /**
112
123
  * The upgrader main function.
@@ -115,17 +126,22 @@ export declare class Angular15Upgrader {
115
126
  * @param pipeline It determines whether to run this command on the pipeline.
116
127
  * @param debug It determines whether to run the debug mode.
117
128
  * @param internal It determines whether to run angualr 15 upgrade for the internal extension or external sdk.
118
- * @param stage '0' - the default Angular 15 stage, '1' - the Angular core stage, '2' - the Angular 15 unit test stage, '3' - the legacy ui-test-automation stage.
129
+ * @param stage '0' - the default Angular 15 upgrade stage,
130
+ * '1' - the Angular core stage,
131
+ * '2' - the Angular 15 unit test stage,
132
+ * '3' - the legacy ui-test-automation stage.
133
+ * '4' - the eslint to support gulp lintApp --fix command.
119
134
  */
120
135
  upgrade(pipeline?: boolean, stage?: number, internal?: boolean, debug?: boolean): Promise<void>;
121
136
  protected criticalConfigurationFilesUpdates(): Promise<void>;
122
137
  protected initialization(): void;
123
138
  protected updateBasicPaths(): void;
124
139
  protected gulpBuildPostAudit(): Promise<void>;
140
+ protected gulpLintFix(): Promise<void>;
125
141
  protected gulpQuick(): Promise<void>;
126
142
  protected gulpBuildProd(): Promise<void>;
127
143
  protected gulpBuildProdPostAudit(): Promise<void>;
128
- protected installUTALegacy(): Promise<void>;
144
+ protected installUTALegacyDevDependency(): Promise<void>;
129
145
  protected installDependenciesPreparation(): Promise<void>;
130
146
  private checkEslintRCFile;
131
147
  private installMicrosftSignalR;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/main.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AASrD;;GAEG;AACH,oBAAY,WAAW;IACnB,cAAc,mBAAmB;IACjC,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;CAC9B;AAED;;GAEG;AACH,oBAAY,yBAAyB;IAC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QAAQ,CAAC,WAAW,CAAa;;IAQzC;;;;;;;;OAQG;IACU,OAAO,CAAC,QAAQ,UAAQ,EAAE,KAAK,SAAI,EAAE,QAAQ,UAAQ,EAAE,KAAK,UAAQ;cAwEjE,iCAAiC,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BlE,SAAS,CAAC,cAAc;IAoBxB,SAAS,CAAC,gBAAgB,IAAI,IAAI;cAoClB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAInD,SAAS,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAQpC,SAAS,CAAC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;cAQxB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;cAIvC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;cASjC,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC;YAQjD,iBAAiB;YAKjB,sBAAsB;YAOtB,yBAAyB;YAOzB,sBAAsB;YAOtB,eAAe;YAOf,mBAAmB;YAWnB,sCAAsC;YAKtC,eAAe;IAa7B;;;;;OAKG;YACW,4BAA4B;CAK7C","file":"main.d.ts","sourcesContent":["import { Common } from '../common';\r\nimport { PackageJsonUpgrader } from './upgrader/package-json-upgrader';\r\nimport { TSConfigUpgrader } from './upgrader/tsconfig-upgrader';\r\nimport { Logger } from './utils/logger';\r\nimport { GitIgnoreUpgrader } from './upgrader/git-ignore-upgrader';\r\nimport { AngularJsonUpgrader } from './upgrader/angular-json-upgrader';\r\nimport { FileReplacementUpgrader } from './upgrader/file-replacement-upgrader';\r\nimport { CIBuildYmlUpgrader } from './upgrader/ci-build-yml-upgrader';\r\nimport { ReplaceUpgrader } from './upgrader/replace-upgrader';\r\nimport { srcTsConfigLibProdReplaces, srcTsConfigSpecRemoves } from './configs/config';\r\nimport { RemoveUpgrader } from './upgrader/remove-upgrader';\r\nimport { MainDebugger } from './utils/main-debugger';\r\nimport { runCommand } from './utils/command-runner';\r\nimport { LogParser } from './upgrader/audit/log-parser';\r\nimport { VersionJsonUpgrader } from './upgrader/version-json-upgrader';\r\nimport { JasmineTestUpgrader } from './upgrader/jasmine-test-upgrader';\r\nimport { updateShellReferences } from './utils/update-shell-references';\r\nimport { EslintUpgrader } from '../eslint/main';\r\nimport { UITestAutomationLegacyUpgrader } from './upgrader/ui-test-automation-legacy-upgrader';\r\n\r\n/**\r\n * Represents the type of upgrade that needs to be performed.\r\n */\r\nexport enum UpgradeType {\r\n WithBaseConfig = 'WithBaseConfig',\r\n WithoutBaseConfig = 'WithoutBaseConfig',\r\n NoOperation = 'NoOperation'\r\n}\r\n\r\n/**\r\n * Represents the messages that are displayed during the upgrade process.\r\n */\r\nexport enum Angular15UpgraderMessages {\r\n StartingUpgrade = 'Starting Angular 15 upgrade process...',\r\n UpdateBasicPaths = 'Updating basic paths for the upgrade...',\r\n Initialization = 'Initializing upgraders...',\r\n FinalizeInfoLintFix = `There are eslint violations that needs fix... After fixing the violations, please run the following commands:\\n\r\n npx eslint . --fix \\n\r\n gulp lintApp \\n\r\n gulp build \\n\r\n `,\r\n CannotRunStageThreeExternal = 'The ui-test-automation_legacy is for internal extension upgrade only.',\r\n Completed = 'Upgrade completed!'\r\n}\r\n\r\n/**\r\n * This is the main class of the EslintUpgrader tool.\r\n * It is responsible for upgrading the Tslint to Eslint.\r\n */\r\nexport class Angular15Upgrader {\r\n /**\r\n * The debug mode.\r\n */\r\n protected debug = false;\r\n\r\n /**\r\n * It determines whether to run angualr 15 upgrade for the internal extension or external sdk.\r\n */\r\n protected internal = false;\r\n\r\n /**\r\n * If running in the pipeline, the pipeline needs to automatically update for the @msft-sme pacakges instead of WAC CLI.\r\n */\r\n protected pipeline = false;\r\n\r\n /**\r\n * The main debugger.\r\n */\r\n protected mainDebugger: MainDebugger;\r\n\r\n /**\r\n * The main debugger version.\r\n */\r\n private readonly version = '1.0.1';\r\n\r\n /**\r\n * The paths of the configuration files.\r\n */\r\n private tsconfigBaseFilePath: string;\r\n private tsconfigFilePath: string;\r\n private angularJsonFilePath: string;\r\n private gitIgnoreFilePath: string;\r\n private packageJsonFilePath: string;\r\n private versionJsonFilePath: string;\r\n private packageLockJsonFilePath: string;\r\n private nodeModulesFolderPath: string;\r\n private e2eFolderPath: string;\r\n private testTsFilePath: string;\r\n private testTsFileTemplatePath: string;\r\n private cIBuildYmlFilePath: string;\r\n private pullRequestYmlFilePath: string;\r\n private srcTsConfigSpecFilePath: string;\r\n private srcTsConfigLibProdFilePath: string;\r\n private gulpCompileTsFilePath: string;\r\n private gulpCompileTsTemplatePath: string;\r\n private gulpIndexTsFilePath: string;\r\n private gulpIndexTsTemplatePath: string;\r\n private uiTestAutomationLegacyFilePath: string;\r\n private uiTestAutomationLegacyFolderPath: string;\r\n private logFilePath: string;\r\n\r\n /**\r\n * The upgrader for each configuration file.\r\n */\r\n private packageJsonUpgrader: PackageJsonUpgrader;\r\n private versionJsonUpgrader: VersionJsonUpgrader;\r\n private tSConfigUpgrader: TSConfigUpgrader;\r\n private tSConfigBaseUpgrader: TSConfigUpgrader;\r\n private gitIgnoreUpgrader: GitIgnoreUpgrader;\r\n private angularJsonUpgrader: AngularJsonUpgrader;\r\n private testTsUpgrader: FileReplacementUpgrader;\r\n private cIBuildUpgrader: CIBuildYmlUpgrader;\r\n private pullRequestUpgrader: CIBuildYmlUpgrader;\r\n private srcTsConfigLibProdUpgrader: ReplaceUpgrader;\r\n private srcTsConfigSpecUpgrader: RemoveUpgrader;\r\n private gulpCompileTsUpgrader: FileReplacementUpgrader;\r\n private gulpIndexTsUpgrader: FileReplacementUpgrader;\r\n private logParser: LogParser;\r\n private jasmineTestUpgrader: JasmineTestUpgrader;\r\n private uITestAutomationLegacyUpgrader: UITestAutomationLegacyUpgrader;\r\n\r\n /**\r\n * The file names for each configuration file.\r\n */\r\n private readonly tsconfigBaseFileName = 'tsconfig.base.json';\r\n private readonly tsconfigFileName = 'tsconfig.json';\r\n private readonly packageJsonFileName = 'package.json';\r\n private readonly versionJsonFileName = 'version.json';\r\n private readonly packageLockJsonFileName = 'package-lock.json';\r\n private readonly angularFileName = 'angular.json';\r\n private readonly e2eFolderName = 'e2e';\r\n private readonly nodeModulesFolderName = 'node_modules';\r\n private readonly gitIgnoreFileName = '.gitignore';\r\n private readonly testTsFileName = 'test.ts';\r\n private readonly cIBuildYmlFileName = 'ci-build.yml';\r\n private readonly pullRequestYmlFileName = 'pull-request.yml';\r\n private readonly srcTsConfigLibProdFileName = 'tsconfig.lib.prod.json';\r\n private readonly srcTsConfigSpecFileName = 'tsconfig.spec.json';\r\n private readonly gulpCompileTsFileName = 'compile.ts';\r\n private readonly gulpIndexTsFileName = 'index.ts';\r\n private readonly logFileName = 'log.txt';\r\n\r\n constructor() {\r\n Logger.log(Angular15UpgraderMessages.StartingUpgrade);\r\n Common.rootPath = process.cwd();\r\n Logger.log(Common.rootPath);\r\n }\r\n\r\n /**\r\n * The upgrader main function.\r\n * If only runs the unit test\r\n * node ./node_modules/@microsoft/windows-admin-center-sdk/tools/wac-cli/src/index.js angular15Upgrade --pipeline false --stage 2\r\n * @param pipeline It determines whether to run this command on the pipeline.\r\n * @param debug It determines whether to run the debug mode.\r\n * @param internal It determines whether to run angualr 15 upgrade for the internal extension or external sdk.\r\n * @param stage '0' - the default Angular 15 stage, '1' - the Angular core stage, '2' - the Angular 15 unit test stage, '3' - the legacy ui-test-automation stage.\r\n */\r\n public async upgrade(pipeline = false, stage = 0, internal = false, debug = false) {\r\n this.debug = !!debug;\r\n this.pipeline = !!pipeline;\r\n this.internal = !!internal;\r\n Logger.log(this.version);\r\n Logger.log(Angular15UpgraderMessages.StartingUpgrade);\r\n Logger.log('Passed in parameters: ' + this.pipeline + ' ' + stage + ' ' + this.internal + ' ' + this.debug );\r\n\r\n this.mainDebugger = this.debug ? new MainDebugger(): undefined;\r\n\r\n Logger.log(Angular15UpgraderMessages.UpdateBasicPaths);\r\n this.updateBasicPaths();\r\n\r\n Logger.log(Angular15UpgraderMessages.Initialization);\r\n this.initialization();\r\n\r\n switch (stage) {\r\n case 0:\r\n Logger.log('0');\r\n await this.criticalConfigurationFilesUpdates();\r\n await this.installDependenciesPreparation();\r\n await this.installLKGElectronToChromium();\r\n await this.installDependencies();\r\n // Fix any eslint errors that doesn't match the latest eslint rules.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpQuick();\r\n await this.gulpBuildPostAudit();\r\n // Fix any eslint errors that is triggered by audit.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpBuildProd();\r\n await this.gulpBuildProdPostAudit();\r\n // Fix any eslint errors clean-ups.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.jasmineTestUpgrader.run();\r\n break;\r\n case 1:\r\n Logger.log('1');\r\n await this.criticalConfigurationFilesUpdates();\r\n await this.installDependenciesPreparation();\r\n await this.installLKGElectronToChromium();\r\n await this.installDependencies();\r\n // Fix any eslint errors that doesn't match the latest eslint rules.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpQuick();\r\n await this.gulpBuildPostAudit();\r\n // Fix any eslint errors that is triggered by audit.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpBuildProd();\r\n await this.gulpBuildProdPostAudit();\r\n // Fix any eslint errors clean-ups.\r\n await this.fixEslintErrors(this.pipeline);\r\n break;\r\n case 2:\r\n Logger.log('2');\r\n await this.gulpIndexTsUpgrader.run();\r\n await this.testTsUpgrader.run();\r\n await this.jasmineTestUpgrader.run();\r\n break;\r\n case 3:\r\n Logger.log('3');\r\n if (!this.internal) {\r\n Logger.log(Angular15UpgraderMessages.CannotRunStageThreeExternal);\r\n } else {\r\n await this.uITestAutomationLegacyUpgrader.run();\r\n await this.installDependenciesForUITestAutomation();\r\n }\r\n default:\r\n Logger.log('default');\r\n break;\r\n }\r\n }\r\n\r\n protected async criticalConfigurationFilesUpdates(): Promise<void> {\r\n Promise.all([\r\n this.packageJsonUpgrader.run(this.pipeline),\r\n this.versionJsonUpgrader.run(),\r\n this.tSConfigBaseUpgrader.runBase(),\r\n this.tSConfigUpgrader.run(),\r\n this.gitIgnoreUpgrader.run(),\r\n this.angularJsonUpgrader.run(),\r\n this.testTsUpgrader.run(),\r\n this.cIBuildUpgrader.run(),\r\n this.pullRequestUpgrader.run(),\r\n this.srcTsConfigLibProdUpgrader.run(),\r\n this.srcTsConfigSpecUpgrader.run(),\r\n this.gulpCompileTsUpgrader.run(),\r\n this.gulpIndexTsUpgrader.run()\r\n ]).then((results) => {\r\n console.log('All Promises have completed:', results);\r\n\r\n if (this.debug) {\r\n this.mainDebugger.verifyTestData(this).then(() => {\r\n Logger.log(Angular15UpgraderMessages.Completed);\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n Logger.error('At least one Promise encountered an error:' + error);\r\n });\r\n }\r\n\r\n protected initialization() {\r\n this.packageJsonUpgrader = new PackageJsonUpgrader(this.packageJsonFilePath);\r\n this.versionJsonUpgrader = new VersionJsonUpgrader(this.versionJsonFilePath);\r\n this.tSConfigBaseUpgrader = new TSConfigUpgrader(this.tsconfigBaseFilePath, this.tsconfigBaseFileName);\r\n this.tSConfigUpgrader = new TSConfigUpgrader(this.tsconfigFilePath, this.tsconfigFileName);\r\n this.gitIgnoreUpgrader = new GitIgnoreUpgrader(this.gitIgnoreFilePath);\r\n this.angularJsonUpgrader = new AngularJsonUpgrader(this.angularJsonFilePath);\r\n this.testTsUpgrader = new FileReplacementUpgrader(this.testTsFileTemplatePath, this.testTsFilePath);\r\n this.cIBuildUpgrader = new CIBuildYmlUpgrader(this.cIBuildYmlFilePath, this.cIBuildYmlFileName);\r\n this.pullRequestUpgrader = new CIBuildYmlUpgrader(this.pullRequestYmlFilePath, this.pullRequestYmlFileName);\r\n this.srcTsConfigLibProdUpgrader = new ReplaceUpgrader(this.srcTsConfigLibProdFilePath, srcTsConfigLibProdReplaces, this.srcTsConfigLibProdFileName);\r\n this.srcTsConfigSpecUpgrader = new RemoveUpgrader(this.srcTsConfigSpecFilePath, srcTsConfigSpecRemoves, this.srcTsConfigSpecFileName);\r\n this.gulpCompileTsUpgrader = new FileReplacementUpgrader(this.gulpCompileTsTemplatePath, this.gulpCompileTsFilePath);\r\n this.gulpIndexTsUpgrader = new FileReplacementUpgrader(this.gulpIndexTsTemplatePath, this.gulpIndexTsFilePath);\r\n this.jasmineTestUpgrader = new JasmineTestUpgrader(this.testTsFilePath, this.debug);\r\n this.uITestAutomationLegacyUpgrader = new UITestAutomationLegacyUpgrader(this.uiTestAutomationLegacyFilePath, this.packageJsonFileName);\r\n\r\n this.logParser = new LogParser(this.logFilePath, this.logFileName);\r\n }\r\n\r\n protected updateBasicPaths(): void {\r\n this.tsconfigBaseFilePath = Common.rootPath + '\\\\' + this.tsconfigBaseFileName;\r\n this.tsconfigFilePath = Common.rootPath + '\\\\' + this.tsconfigFileName;\r\n this.angularJsonFilePath = Common.rootPath + '\\\\' + this.angularFileName;\r\n this.packageJsonFilePath = Common.rootPath + '\\\\' + this.packageJsonFileName;\r\n this.versionJsonFilePath = Common.rootPath + '\\\\' + this.versionJsonFileName;\r\n this.packageLockJsonFilePath = Common.rootPath + '\\\\' + this.packageLockJsonFileName;\r\n this.nodeModulesFolderPath = Common.rootPath + '\\\\' + this.nodeModulesFolderName;\r\n this.e2eFolderPath = Common.rootPath + '\\\\' + this.e2eFolderName;\r\n this.gitIgnoreFilePath = Common.rootPath + '\\\\' + this.gitIgnoreFileName;\r\n\r\n this.srcTsConfigLibProdFilePath = Common.rootPath + '\\\\src\\\\' + this.srcTsConfigLibProdFileName;\r\n this.srcTsConfigSpecFilePath = Common.rootPath + '\\\\src\\\\' + this.srcTsConfigSpecFileName;\r\n\r\n this.cIBuildYmlFilePath = Common.rootPath + '\\\\build\\\\pipelines\\\\' + this.cIBuildYmlFileName;\r\n this.pullRequestYmlFilePath = Common.rootPath + '\\\\build\\\\pipelines\\\\' + this.pullRequestYmlFileName;\r\n\r\n this.testTsFilePath = Common.rootPath + '\\\\src\\\\' + this.testTsFileName;\r\n this.testTsFileTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\test.ts');\r\n\r\n this.gulpCompileTsFilePath = Common.rootPath + '\\\\gulpfile.ts\\\\common\\\\' + this.gulpCompileTsFileName;\r\n this.gulpCompileTsTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\gulpfile.ts\\\\common\\\\compile.ts');\r\n\r\n this.gulpIndexTsFilePath = Common.rootPath + '\\\\gulpfile.ts\\\\' + this.gulpIndexTsFileName;\r\n this.gulpIndexTsTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\gulpfile.ts\\\\index.ts');\r\n\r\n this.uiTestAutomationLegacyFilePath = Common.rootPath + '\\\\ui-test-automation\\\\' + this.packageJsonFileName;\r\n this.uiTestAutomationLegacyFolderPath = Common.rootPath + '\\\\ui-test-automation\\\\';\r\n\r\n this.logFilePath = Common.rootPath + '\\\\' + this.logFileName;\r\n\r\n if (this.debug) {\r\n this.mainDebugger.updateTestData(this);\r\n }\r\n }\r\n\r\n protected async gulpBuildPostAudit(): Promise<void> {\r\n return this.logParser.run();\r\n }\r\n\r\n protected gulpQuick(): Promise<void> {\r\n const gulpQuick = 'gulp quick';\r\n Logger.log(gulpQuick);\r\n return runCommand(gulpQuick, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected gulpBuildProd(): Promise<void> {\r\n const gulpBuild = 'gulp build --prod';\r\n Logger.log(gulpBuild);\r\n return runCommand(gulpBuild, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected async gulpBuildProdPostAudit(): Promise<void> {\r\n return this.logParser.run();\r\n }\r\n\r\n protected async installUTALegacy(): Promise<void> {\r\n const setprefixCmd = 'npm config set save-prefix=';\r\n Logger.log(setprefixCmd);\r\n await runCommand(setprefixCmd, this.debug);\r\n const cmd = 'npm install @msft-sme/ui-test-automation@latest --save-dev --force';\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n protected async installDependenciesPreparation(): Promise<void> {\r\n await this.removeNodeModuleFolder();\r\n await this.removePackageLockJsonFile();\r\n await this.removeE2EFolder();\r\n await this.checkEslintRCFile();\r\n updateShellReferences('', this.internal);\r\n }\r\n\r\n private async checkEslintRCFile(): Promise<void> {\r\n const esLintUpgrader = new EslintUpgrader();\r\n await esLintUpgrader.replaceEslintConfig();\r\n }\r\n\r\n private async installMicrosftSignalR(): Promise<void> {\r\n const cmd = 'npm install @microsoft/signalr@6.0.8 --save';\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removePackageLockJsonFile(): Promise<void> {\r\n const cmd = `del ${this.packageLockJsonFilePath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removeNodeModuleFolder(): Promise<void> {\r\n const cmd = `rmdir /s /q ${this.nodeModulesFolderPath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removeE2EFolder(): Promise<void> {\r\n const cmd = `rmdir /s /q ${this.e2eFolderPath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async installDependencies(): Promise<void> {\r\n // Needs to be installed on the SDK root dependency.\r\n if (!this.internal) {\r\n await this.installMicrosftSignalR();\r\n }\r\n const cmd = 'npm install --force';\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async installDependenciesForUITestAutomation(): Promise<void> {\r\n const cmd = 'pushd ' + this.uiTestAutomationLegacyFolderPath + '&& del package-lock.json && npm install && popd';\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async fixEslintErrors(ignore = false): Promise<void> {\r\n if (ignore) {\r\n return;\r\n }\r\n \r\n const rootFileLinterFix = 'npx eslint . --fix';\r\n Logger.log(rootFileLinterFix);\r\n await runCommand(rootFileLinterFix, this.debug, true, Angular15UpgraderMessages.FinalizeInfoLintFix);\r\n const projectLinterFix = 'npx ng lint --fix';\r\n Logger.log(projectLinterFix);\r\n await runCommand(projectLinterFix, this.debug, true, Angular15UpgraderMessages.FinalizeInfoLintFix);\r\n }\r\n\r\n /**\r\n * electron-to-chromium 1.4.533 - 1.4.535 are bad versions that is also the latest, meaning any dependency uses ^1.4.xxx are also blocked,\r\n * below are the dependency list:\r\n * /@angular-devkit/build-angular@15.2.8 -> browserslist@4.21.5 that has dependency on ^1.4.284(which always grab 1.4.535)\r\n * always force 1.4.532\r\n */\r\n private async installLKGElectronToChromium(): Promise<void> {\r\n const cmd = 'npm install electron-to-chromium@1.4.532 --force';\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/main.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAUrD;;GAEG;AACH,oBAAY,WAAW;IACnB,cAAc,mBAAmB;IACjC,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;CAC9B;AAED;;GAEG;AACH,oBAAY,yBAAyB;IACjC,eAAe,2CAA2C;IAC1D,gBAAgB,4CAA4C;IAC5D,cAAc,8BAA8B;IAC5C,mBAAmB,yMAIlB;IACD,mBAAmB,2DAA2D;IAC9E,SAAS,uBAAuB;IAChC,kBAAkB,2DAA2D;IAC7E,kBAAkB,6CAA6C;IAC/D,kBAAkB,qDAAqD;IACvE,kBAAkB,0DAA0D;IAC5E,kBAAkB,6EAA6E;CAClG;AAED;;;GAGG;AACH,qBAAa,iBAAiB;IAC1B;;OAEG;IACH,SAAS,CAAC,KAAK,UAAS;IAExB;;OAEG;IACH,SAAS,CAAC,QAAQ,UAAS;IAE3B;;OAEG;IACH,SAAS,CAAC,QAAQ,UAAS;IAE3B;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAErC;;OA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gB,IAAI,IAAI;cAqClB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAInD,SAAS,CAAC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtC,SAAS,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAQpC,SAAS,CAAC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;cAQxB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;cAIvC,6BAA6B,IAAI,OAAO,CAAC,IAAI,CAAC;cAS9C,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC;YAQjD,iBAAiB;YAKjB,sBAAsB;YAOtB,yBAAyB;YAOzB,sBAAsB;YAOtB,eAAe;YAOf,mBAAmB;YAWnB,sCAAsC;YAKtC,eAAe;IAa7B;;;;;OAKG;YACW,4BAA4B;CAK7C","file":"main.d.ts","sourcesContent":["import { Common } from '../common';\r\nimport { PackageJsonUpgrader } from './upgrader/package-json-upgrader';\r\nimport { TSConfigUpgrader } from './upgrader/tsconfig-upgrader';\r\nimport { Logger } from './utils/logger';\r\nimport { GitIgnoreUpgrader } from './upgrader/git-ignore-upgrader';\r\nimport { AngularJsonUpgrader } from './upgrader/angular-json-upgrader';\r\nimport { FileReplacementUpgrader } from './upgrader/file-replacement-upgrader';\r\nimport { CIBuildYmlUpgrader } from './upgrader/ci-build-yml-upgrader';\r\nimport { ReplaceUpgrader } from './upgrader/replace-upgrader';\r\nimport { srcTsConfigLibProdReplaces, srcTsConfigSpecRemoves } from './configs/config';\r\nimport { RemoveUpgrader } from './upgrader/remove-upgrader';\r\nimport { MainDebugger } from './utils/main-debugger';\r\nimport { runCommand } from './utils/command-runner';\r\nimport { LogParser } from './upgrader/audit/log-parser';\r\nimport { VersionJsonUpgrader } from './upgrader/version-json-upgrader';\r\nimport { JasmineTestUpgrader } from './upgrader/jasmine-test-upgrader';\r\nimport { updateShellReferences } from './utils/update-shell-references';\r\nimport { EslintUpgrader } from '../eslint/main';\r\nimport { UITestAutomationLegacyUpgrader } from './upgrader/ui-test-automation-legacy-upgrader';\r\nimport { EslintAutoFixUpgrader } from './upgrader/eslint-auto-fix-upgrader';\r\n\r\n/**\r\n * Represents the type of upgrade that needs to be performed.\r\n */\r\nexport enum UpgradeType {\r\n WithBaseConfig = 'WithBaseConfig',\r\n WithoutBaseConfig = 'WithoutBaseConfig',\r\n NoOperation = 'NoOperation'\r\n}\r\n\r\n/**\r\n * Represents the messages that are displayed during the upgrade process.\r\n */\r\nexport enum Angular15UpgraderMessages {\r\n StartingUpgrade = 'Starting Angular 15 upgrade process...',\r\n UpdateBasicPaths = 'Updating basic paths for the upgrade...',\r\n Initialization = 'Initializing upgraders...',\r\n FinalizeInfoLintFix = `There are eslint violations that needs fix... After fixing the violations, please run the following commands:\\n\r\n npx eslint . --fix \\n\r\n gulp lintApp \\n\r\n gulp build \\n\r\n `,\r\n InternalCommandOnly = 'This command is only available for internal extension.',\r\n Completed = 'Upgrade completed!',\r\n StartMessageStage0 = 'Starting stage 0: the default Angular 15 upgrade stage',\r\n StartMessageStage1 = 'Starting stage 1: the Angular core stage',\r\n StartMessageStage2 = 'Starting stage 2: the Angular 15 unit test stage',\r\n StartMessageStage3 = 'Starting stage 3: the legacy ui-test-automation stage',\r\n StartMessageStage4 = 'Starting stage 4: the eslint to support gulp lintApp --fix command stage'\r\n}\r\n\r\n/**\r\n * This is the main class of the EslintUpgrader tool.\r\n * It is responsible for upgrading the Tslint to Eslint.\r\n */\r\nexport class Angular15Upgrader {\r\n /**\r\n * The debug mode.\r\n */\r\n protected debug = false;\r\n\r\n /**\r\n * It determines whether to run angualr 15 upgrade for the internal extension or external sdk.\r\n */\r\n protected internal = false;\r\n\r\n /**\r\n * If running in the pipeline, the pipeline needs to automatically update for the @msft-sme pacakges instead of WAC CLI.\r\n */\r\n protected pipeline = false;\r\n\r\n /**\r\n * The main debugger.\r\n */\r\n protected mainDebugger: MainDebugger;\r\n\r\n /**\r\n * The main debugger version.\r\n */\r\n private readonly version = '1.0.1';\r\n\r\n /**\r\n * The paths of the configuration files.\r\n */\r\n private tsconfigBaseFilePath: string;\r\n private tsconfigFilePath: string;\r\n private angularJsonFilePath: string;\r\n private gitIgnoreFilePath: string;\r\n private packageJsonFilePath: string;\r\n private versionJsonFilePath: string;\r\n private packageLockJsonFilePath: string;\r\n private nodeModulesFolderPath: string;\r\n private e2eFolderPath: string;\r\n private testTsFilePath: string;\r\n private testTsFileTemplatePath: string;\r\n private cIBuildYmlFilePath: string;\r\n private pullRequestYmlFilePath: string;\r\n private srcTsConfigSpecFilePath: string;\r\n private srcTsConfigLibProdFilePath: string;\r\n private gulpCompileTsFilePath: string;\r\n private gulpCompileTsTemplatePath: string;\r\n private gulpIndexTsFilePath: string;\r\n private gulpIndexTsTemplatePath: string;\r\n private uiTestAutomationLegacyFilePath: string;\r\n private uiTestAutomationLegacyFolderPath: string;\r\n private logFilePath: string;\r\n private eslintrcFilePath: string;\r\n\r\n /**\r\n * The upgrader for each configuration file.\r\n */\r\n private packageJsonUpgrader: PackageJsonUpgrader;\r\n private versionJsonUpgrader: VersionJsonUpgrader;\r\n private tSConfigUpgrader: TSConfigUpgrader;\r\n private tSConfigBaseUpgrader: TSConfigUpgrader;\r\n private gitIgnoreUpgrader: GitIgnoreUpgrader;\r\n private angularJsonUpgrader: AngularJsonUpgrader;\r\n private testTsUpgrader: FileReplacementUpgrader;\r\n private cIBuildUpgrader: CIBuildYmlUpgrader;\r\n private pullRequestUpgrader: CIBuildYmlUpgrader;\r\n private srcTsConfigLibProdUpgrader: ReplaceUpgrader;\r\n private srcTsConfigSpecUpgrader: RemoveUpgrader;\r\n private gulpCompileTsUpgrader: FileReplacementUpgrader;\r\n private gulpIndexTsUpgrader: FileReplacementUpgrader;\r\n private logParser: LogParser;\r\n private jasmineTestUpgrader: JasmineTestUpgrader;\r\n private uITestAutomationLegacyUpgrader: UITestAutomationLegacyUpgrader;\r\n /**\r\n * The eslint fix upgrader to support linter fix command for stage 4.\r\n */\r\n private eslintAutoFixUpgrader: EslintAutoFixUpgrader;\r\n\r\n /**\r\n * The file names for each configuration file.\r\n */\r\n private readonly tsconfigBaseFileName = 'tsconfig.base.json';\r\n private readonly tsconfigFileName = 'tsconfig.json';\r\n private readonly packageJsonFileName = 'package.json';\r\n private readonly versionJsonFileName = 'version.json';\r\n private readonly packageLockJsonFileName = 'package-lock.json';\r\n private readonly angularFileName = 'angular.json';\r\n private readonly e2eFolderName = 'e2e';\r\n private readonly nodeModulesFolderName = 'node_modules';\r\n private readonly gitIgnoreFileName = '.gitignore';\r\n private readonly testTsFileName = 'test.ts';\r\n private readonly cIBuildYmlFileName = 'ci-build.yml';\r\n private readonly pullRequestYmlFileName = 'pull-request.yml';\r\n private readonly srcTsConfigLibProdFileName = 'tsconfig.lib.prod.json';\r\n private readonly srcTsConfigSpecFileName = 'tsconfig.spec.json';\r\n private readonly gulpCompileTsFileName = 'compile.ts';\r\n private readonly gulpIndexTsFileName = 'index.ts';\r\n private readonly logFileName = 'log.txt';\r\n private readonly eslintrcFileName = '.eslintrc.json';\r\n\r\n constructor() {\r\n Logger.log(Angular15UpgraderMessages.StartingUpgrade);\r\n Common.rootPath = process.cwd();\r\n Logger.log(Common.rootPath);\r\n }\r\n\r\n /**\r\n * The upgrader main function.\r\n * If only runs the unit test\r\n * node ./node_modules/@microsoft/windows-admin-center-sdk/tools/wac-cli/src/index.js angular15Upgrade --pipeline false --stage 2\r\n * @param pipeline It determines whether to run this command on the pipeline.\r\n * @param debug It determines whether to run the debug mode.\r\n * @param internal It determines whether to run angualr 15 upgrade for the internal extension or external sdk.\r\n * @param stage '0' - the default Angular 15 upgrade stage,\r\n * '1' - the Angular core stage,\r\n * '2' - the Angular 15 unit test stage,\r\n * '3' - the legacy ui-test-automation stage.\r\n * '4' - the eslint to support gulp lintApp --fix command.\r\n */\r\n public async upgrade(pipeline = false, stage = 0, internal = false, debug = false) {\r\n this.debug = !!debug;\r\n this.pipeline = !!pipeline;\r\n this.internal = !!internal;\r\n Logger.log(this.version);\r\n Logger.log(Angular15UpgraderMessages.StartingUpgrade);\r\n Logger.log('Passed in parameters: ' + this.pipeline + ' ' + stage + ' ' + this.internal + ' ' + this.debug );\r\n\r\n this.mainDebugger = this.debug ? new MainDebugger(): undefined;\r\n\r\n Logger.log(Angular15UpgraderMessages.UpdateBasicPaths);\r\n this.updateBasicPaths();\r\n\r\n Logger.log(Angular15UpgraderMessages.Initialization);\r\n this.initialization();\r\n\r\n switch (stage) {\r\n case 0:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage0);\r\n await this.criticalConfigurationFilesUpdates();\r\n await this.installDependenciesPreparation();\r\n await this.installLKGElectronToChromium();\r\n await this.installDependencies();\r\n // Fix any eslint errors that doesn't match the latest eslint rules.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpQuick();\r\n await this.gulpBuildPostAudit();\r\n // Fix any eslint errors that is triggered by audit.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpBuildProd();\r\n await this.gulpBuildProdPostAudit();\r\n // Fix any eslint errors clean-ups.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.jasmineTestUpgrader.run();\r\n break;\r\n case 1:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage1);\r\n await this.criticalConfigurationFilesUpdates();\r\n await this.installDependenciesPreparation();\r\n await this.installLKGElectronToChromium();\r\n await this.installDependencies();\r\n // Fix any eslint errors that doesn't match the latest eslint rules.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpQuick();\r\n await this.gulpBuildPostAudit();\r\n // Fix any eslint errors that is triggered by audit.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpBuildProd();\r\n await this.gulpBuildProdPostAudit();\r\n // Fix any eslint errors clean-ups.\r\n await this.fixEslintErrors(this.pipeline);\r\n break;\r\n case 2:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage2);\r\n await this.gulpIndexTsUpgrader.run();\r\n await this.testTsUpgrader.run();\r\n await this.jasmineTestUpgrader.run();\r\n break;\r\n case 3:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage3);\r\n if (!this.internal) {\r\n Logger.log(Angular15UpgraderMessages.InternalCommandOnly);\r\n } else {\r\n await this.packageJsonUpgrader.run(this.pipeline),\r\n await this.installUTALegacyDevDependency();\r\n await this.uITestAutomationLegacyUpgrader.run();\r\n await this.installDependenciesForUITestAutomation();\r\n }\r\n case 4:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage4);\r\n if (!this.internal) {\r\n Logger.log(Angular15UpgraderMessages.InternalCommandOnly);\r\n } else {\r\n await this.eslintAutoFixUpgrader.run();\r\n await this.gulpLintFix();\r\n }\r\n default:\r\n Logger.log('default');\r\n break;\r\n }\r\n }\r\n\r\n protected async criticalConfigurationFilesUpdates(): Promise<void> {\r\n Promise.all([\r\n this.packageJsonUpgrader.run(this.pipeline),\r\n this.versionJsonUpgrader.run(),\r\n this.tSConfigBaseUpgrader.runBase(),\r\n this.tSConfigUpgrader.run(),\r\n this.gitIgnoreUpgrader.run(),\r\n this.angularJsonUpgrader.run(),\r\n this.testTsUpgrader.run(),\r\n this.cIBuildUpgrader.run(),\r\n this.pullRequestUpgrader.run(),\r\n this.srcTsConfigLibProdUpgrader.run(),\r\n this.srcTsConfigSpecUpgrader.run(),\r\n this.gulpCompileTsUpgrader.run(),\r\n this.gulpIndexTsUpgrader.run()\r\n ]).then((results) => {\r\n console.log('All Promises have completed:', results);\r\n\r\n if (this.debug) {\r\n this.mainDebugger.verifyTestData(this).then(() => {\r\n Logger.log(Angular15UpgraderMessages.Completed);\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n Logger.error('At least one Promise encountered an error:' + error);\r\n });\r\n }\r\n\r\n protected initialization() {\r\n this.packageJsonUpgrader = new PackageJsonUpgrader(this.packageJsonFilePath);\r\n this.versionJsonUpgrader = new VersionJsonUpgrader(this.versionJsonFilePath);\r\n this.tSConfigBaseUpgrader = new TSConfigUpgrader(this.tsconfigBaseFilePath, this.tsconfigBaseFileName);\r\n this.tSConfigUpgrader = new TSConfigUpgrader(this.tsconfigFilePath, this.tsconfigFileName);\r\n this.gitIgnoreUpgrader = new GitIgnoreUpgrader(this.gitIgnoreFilePath);\r\n this.angularJsonUpgrader = new AngularJsonUpgrader(this.angularJsonFilePath);\r\n this.testTsUpgrader = new FileReplacementUpgrader(this.testTsFileTemplatePath, this.testTsFilePath);\r\n this.cIBuildUpgrader = new CIBuildYmlUpgrader(this.cIBuildYmlFilePath, this.cIBuildYmlFileName);\r\n this.pullRequestUpgrader = new CIBuildYmlUpgrader(this.pullRequestYmlFilePath, this.pullRequestYmlFileName);\r\n this.srcTsConfigLibProdUpgrader = new ReplaceUpgrader(this.srcTsConfigLibProdFilePath, srcTsConfigLibProdReplaces, this.srcTsConfigLibProdFileName);\r\n this.srcTsConfigSpecUpgrader = new RemoveUpgrader(this.srcTsConfigSpecFilePath, srcTsConfigSpecRemoves, this.srcTsConfigSpecFileName);\r\n this.gulpCompileTsUpgrader = new FileReplacementUpgrader(this.gulpCompileTsTemplatePath, this.gulpCompileTsFilePath);\r\n this.gulpIndexTsUpgrader = new FileReplacementUpgrader(this.gulpIndexTsTemplatePath, this.gulpIndexTsFilePath);\r\n this.jasmineTestUpgrader = new JasmineTestUpgrader(this.testTsFilePath, this.debug);\r\n this.uITestAutomationLegacyUpgrader = new UITestAutomationLegacyUpgrader(this.uiTestAutomationLegacyFilePath, this.packageJsonFileName);\r\n this.eslintAutoFixUpgrader = new EslintAutoFixUpgrader(this.eslintrcFilePath);\r\n\r\n this.logParser = new LogParser(this.logFilePath, this.logFileName);\r\n }\r\n\r\n protected updateBasicPaths(): void {\r\n this.tsconfigBaseFilePath = Common.rootPath + '\\\\' + this.tsconfigBaseFileName;\r\n this.tsconfigFilePath = Common.rootPath + '\\\\' + this.tsconfigFileName;\r\n this.angularJsonFilePath = Common.rootPath + '\\\\' + this.angularFileName;\r\n this.packageJsonFilePath = Common.rootPath + '\\\\' + this.packageJsonFileName;\r\n this.versionJsonFilePath = Common.rootPath + '\\\\' + this.versionJsonFileName;\r\n this.packageLockJsonFilePath = Common.rootPath + '\\\\' + this.packageLockJsonFileName;\r\n this.nodeModulesFolderPath = Common.rootPath + '\\\\' + this.nodeModulesFolderName;\r\n this.e2eFolderPath = Common.rootPath + '\\\\' + this.e2eFolderName;\r\n this.gitIgnoreFilePath = Common.rootPath + '\\\\' + this.gitIgnoreFileName;\r\n this.eslintrcFilePath = Common.rootPath + '\\\\' + this.eslintrcFileName;\r\n\r\n this.srcTsConfigLibProdFilePath = Common.rootPath + '\\\\src\\\\' + this.srcTsConfigLibProdFileName;\r\n this.srcTsConfigSpecFilePath = Common.rootPath + '\\\\src\\\\' + this.srcTsConfigSpecFileName;\r\n\r\n this.cIBuildYmlFilePath = Common.rootPath + '\\\\build\\\\pipelines\\\\' + this.cIBuildYmlFileName;\r\n this.pullRequestYmlFilePath = Common.rootPath + '\\\\build\\\\pipelines\\\\' + this.pullRequestYmlFileName;\r\n\r\n this.testTsFilePath = Common.rootPath + '\\\\src\\\\' + this.testTsFileName;\r\n this.testTsFileTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\test.ts');\r\n\r\n this.gulpCompileTsFilePath = Common.rootPath + '\\\\gulpfile.ts\\\\common\\\\' + this.gulpCompileTsFileName;\r\n this.gulpCompileTsTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\gulpfile.ts\\\\common\\\\compile.ts');\r\n\r\n this.gulpIndexTsFilePath = Common.rootPath + '\\\\gulpfile.ts\\\\' + this.gulpIndexTsFileName;\r\n this.gulpIndexTsTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\gulpfile.ts\\\\index.ts');\r\n\r\n this.uiTestAutomationLegacyFilePath = Common.rootPath + '\\\\ui-test-automation\\\\' + this.packageJsonFileName;\r\n this.uiTestAutomationLegacyFolderPath = Common.rootPath + '\\\\ui-test-automation\\\\';\r\n\r\n this.logFilePath = Common.rootPath + '\\\\' + this.logFileName;\r\n\r\n if (this.debug) {\r\n this.mainDebugger.updateTestData(this);\r\n }\r\n }\r\n\r\n protected async gulpBuildPostAudit(): Promise<void> {\r\n return this.logParser.run();\r\n }\r\n\r\n protected gulpLintFix(): Promise<void> {\r\n const gulpLintFixCmd = 'gulp lintApp --fix';\r\n Logger.log(gulpLintFixCmd);\r\n return runCommand(gulpLintFixCmd, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected gulpQuick(): Promise<void> {\r\n const gulpQuick = 'gulp quick';\r\n Logger.log(gulpQuick);\r\n return runCommand(gulpQuick, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected gulpBuildProd(): Promise<void> {\r\n const gulpBuild = 'gulp build --prod';\r\n Logger.log(gulpBuild);\r\n return runCommand(gulpBuild, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected async gulpBuildProdPostAudit(): Promise<void> {\r\n return this.logParser.run();\r\n }\r\n\r\n protected async installUTALegacyDevDependency(): Promise<void> {\r\n const setprefixCmd = 'npm config set save-prefix=';\r\n Logger.log(setprefixCmd);\r\n await runCommand(setprefixCmd, this.debug);\r\n const cmd = 'npm install @msft-sme/ui-test-automation@latest --save-dev --force';\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n protected async installDependenciesPreparation(): Promise<void> {\r\n await this.removeNodeModuleFolder();\r\n await this.removePackageLockJsonFile();\r\n await this.removeE2EFolder();\r\n await this.checkEslintRCFile();\r\n updateShellReferences('', this.internal);\r\n }\r\n\r\n private async checkEslintRCFile(): Promise<void> {\r\n const esLintUpgrader = new EslintUpgrader();\r\n await esLintUpgrader.replaceEslintConfig();\r\n }\r\n\r\n private async installMicrosftSignalR(): Promise<void> {\r\n const cmd = 'npm install @microsoft/signalr@6.0.8 --save';\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removePackageLockJsonFile(): Promise<void> {\r\n const cmd = `del ${this.packageLockJsonFilePath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removeNodeModuleFolder(): Promise<void> {\r\n const cmd = `rmdir /s /q ${this.nodeModulesFolderPath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removeE2EFolder(): Promise<void> {\r\n const cmd = `rmdir /s /q ${this.e2eFolderPath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async installDependencies(): Promise<void> {\r\n // Needs to be installed on the SDK root dependency.\r\n if (!this.internal) {\r\n await this.installMicrosftSignalR();\r\n }\r\n const cmd = 'npm install --force';\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async installDependenciesForUITestAutomation(): Promise<void> {\r\n const cmd = 'pushd ' + this.uiTestAutomationLegacyFolderPath + '&& del package-lock.json && npm install && popd';\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async fixEslintErrors(ignore = false): Promise<void> {\r\n if (ignore) {\r\n return;\r\n }\r\n \r\n const rootFileLinterFix = 'npx eslint . --fix';\r\n Logger.log(rootFileLinterFix);\r\n await runCommand(rootFileLinterFix, this.debug, true, Angular15UpgraderMessages.FinalizeInfoLintFix);\r\n const projectLinterFix = 'npx ng lint --fix';\r\n Logger.log(projectLinterFix);\r\n await runCommand(projectLinterFix, this.debug, true, Angular15UpgraderMessages.FinalizeInfoLintFix);\r\n }\r\n\r\n /**\r\n * electron-to-chromium 1.4.533 - 1.4.535 are bad versions that is also the latest, meaning any dependency uses ^1.4.xxx are also blocked,\r\n * below are the dependency list:\r\n * /@angular-devkit/build-angular@15.2.8 -> browserslist@4.21.5 that has dependency on ^1.4.284(which always grab 1.4.535)\r\n * always force 1.4.532\r\n */\r\n private async installLKGElectronToChromium(): Promise<void> {\r\n const cmd = 'npm install electron-to-chromium@1.4.532 --force';\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n}\r\n"]}
@@ -20,6 +20,7 @@ const jasmine_test_upgrader_1 = require("./upgrader/jasmine-test-upgrader");
20
20
  const update_shell_references_1 = require("./utils/update-shell-references");
21
21
  const main_1 = require("../eslint/main");
22
22
  const ui_test_automation_legacy_upgrader_1 = require("./upgrader/ui-test-automation-legacy-upgrader");
23
+ const eslint_auto_fix_upgrader_1 = require("./upgrader/eslint-auto-fix-upgrader");
23
24
  /**
24
25
  * Represents the type of upgrade that needs to be performed.
25
26
  */
@@ -38,8 +39,13 @@ var Angular15UpgraderMessages;
38
39
  Angular15UpgraderMessages["UpdateBasicPaths"] = "Updating basic paths for the upgrade...";
39
40
  Angular15UpgraderMessages["Initialization"] = "Initializing upgraders...";
40
41
  Angular15UpgraderMessages["FinalizeInfoLintFix"] = "There are eslint violations that needs fix... After fixing the violations, please run the following commands:\n\n npx eslint . --fix \n\n gulp lintApp \n\n gulp build \n\n ";
41
- Angular15UpgraderMessages["CannotRunStageThreeExternal"] = "The ui-test-automation_legacy is for internal extension upgrade only.";
42
+ Angular15UpgraderMessages["InternalCommandOnly"] = "This command is only available for internal extension.";
42
43
  Angular15UpgraderMessages["Completed"] = "Upgrade completed!";
44
+ Angular15UpgraderMessages["StartMessageStage0"] = "Starting stage 0: the default Angular 15 upgrade stage";
45
+ Angular15UpgraderMessages["StartMessageStage1"] = "Starting stage 1: the Angular core stage";
46
+ Angular15UpgraderMessages["StartMessageStage2"] = "Starting stage 2: the Angular 15 unit test stage";
47
+ Angular15UpgraderMessages["StartMessageStage3"] = "Starting stage 3: the legacy ui-test-automation stage";
48
+ Angular15UpgraderMessages["StartMessageStage4"] = "Starting stage 4: the eslint to support gulp lintApp --fix command stage";
43
49
  })(Angular15UpgraderMessages = exports.Angular15UpgraderMessages || (exports.Angular15UpgraderMessages = {}));
44
50
  /**
45
51
  * This is the main class of the EslintUpgrader tool.
@@ -91,6 +97,7 @@ class Angular15Upgrader {
91
97
  uiTestAutomationLegacyFilePath;
92
98
  uiTestAutomationLegacyFolderPath;
93
99
  logFilePath;
100
+ eslintrcFilePath;
94
101
  /**
95
102
  * The upgrader for each configuration file.
96
103
  */
@@ -110,6 +117,10 @@ class Angular15Upgrader {
110
117
  logParser;
111
118
  jasmineTestUpgrader;
112
119
  uITestAutomationLegacyUpgrader;
120
+ /**
121
+ * The eslint fix upgrader to support linter fix command for stage 4.
122
+ */
123
+ eslintAutoFixUpgrader;
113
124
  /**
114
125
  * The file names for each configuration file.
115
126
  */
@@ -130,6 +141,7 @@ class Angular15Upgrader {
130
141
  gulpCompileTsFileName = 'compile.ts';
131
142
  gulpIndexTsFileName = 'index.ts';
132
143
  logFileName = 'log.txt';
144
+ eslintrcFileName = '.eslintrc.json';
133
145
  constructor() {
134
146
  logger_1.Logger.log(Angular15UpgraderMessages.StartingUpgrade);
135
147
  common_1.Common.rootPath = process.cwd();
@@ -142,7 +154,11 @@ class Angular15Upgrader {
142
154
  * @param pipeline It determines whether to run this command on the pipeline.
143
155
  * @param debug It determines whether to run the debug mode.
144
156
  * @param internal It determines whether to run angualr 15 upgrade for the internal extension or external sdk.
145
- * @param stage '0' - the default Angular 15 stage, '1' - the Angular core stage, '2' - the Angular 15 unit test stage, '3' - the legacy ui-test-automation stage.
157
+ * @param stage '0' - the default Angular 15 upgrade stage,
158
+ * '1' - the Angular core stage,
159
+ * '2' - the Angular 15 unit test stage,
160
+ * '3' - the legacy ui-test-automation stage.
161
+ * '4' - the eslint to support gulp lintApp --fix command.
146
162
  */
147
163
  async upgrade(pipeline = false, stage = 0, internal = false, debug = false) {
148
164
  this.debug = !!debug;
@@ -158,7 +174,7 @@ class Angular15Upgrader {
158
174
  this.initialization();
159
175
  switch (stage) {
160
176
  case 0:
161
- logger_1.Logger.log('0');
177
+ logger_1.Logger.log(Angular15UpgraderMessages.StartMessageStage0);
162
178
  await this.criticalConfigurationFilesUpdates();
163
179
  await this.installDependenciesPreparation();
164
180
  await this.installLKGElectronToChromium();
@@ -176,7 +192,7 @@ class Angular15Upgrader {
176
192
  await this.jasmineTestUpgrader.run();
177
193
  break;
178
194
  case 1:
179
- logger_1.Logger.log('1');
195
+ logger_1.Logger.log(Angular15UpgraderMessages.StartMessageStage1);
180
196
  await this.criticalConfigurationFilesUpdates();
181
197
  await this.installDependenciesPreparation();
182
198
  await this.installLKGElectronToChromium();
@@ -193,20 +209,31 @@ class Angular15Upgrader {
193
209
  await this.fixEslintErrors(this.pipeline);
194
210
  break;
195
211
  case 2:
196
- logger_1.Logger.log('2');
212
+ logger_1.Logger.log(Angular15UpgraderMessages.StartMessageStage2);
197
213
  await this.gulpIndexTsUpgrader.run();
198
214
  await this.testTsUpgrader.run();
199
215
  await this.jasmineTestUpgrader.run();
200
216
  break;
201
217
  case 3:
202
- logger_1.Logger.log('3');
218
+ logger_1.Logger.log(Angular15UpgraderMessages.StartMessageStage3);
203
219
  if (!this.internal) {
204
- logger_1.Logger.log(Angular15UpgraderMessages.CannotRunStageThreeExternal);
220
+ logger_1.Logger.log(Angular15UpgraderMessages.InternalCommandOnly);
205
221
  }
206
222
  else {
223
+ await this.packageJsonUpgrader.run(this.pipeline),
224
+ await this.installUTALegacyDevDependency();
207
225
  await this.uITestAutomationLegacyUpgrader.run();
208
226
  await this.installDependenciesForUITestAutomation();
209
227
  }
228
+ case 4:
229
+ logger_1.Logger.log(Angular15UpgraderMessages.StartMessageStage4);
230
+ if (!this.internal) {
231
+ logger_1.Logger.log(Angular15UpgraderMessages.InternalCommandOnly);
232
+ }
233
+ else {
234
+ await this.eslintAutoFixUpgrader.run();
235
+ await this.gulpLintFix();
236
+ }
210
237
  default:
211
238
  logger_1.Logger.log('default');
212
239
  break;
@@ -255,6 +282,7 @@ class Angular15Upgrader {
255
282
  this.gulpIndexTsUpgrader = new file_replacement_upgrader_1.FileReplacementUpgrader(this.gulpIndexTsTemplatePath, this.gulpIndexTsFilePath);
256
283
  this.jasmineTestUpgrader = new jasmine_test_upgrader_1.JasmineTestUpgrader(this.testTsFilePath, this.debug);
257
284
  this.uITestAutomationLegacyUpgrader = new ui_test_automation_legacy_upgrader_1.UITestAutomationLegacyUpgrader(this.uiTestAutomationLegacyFilePath, this.packageJsonFileName);
285
+ this.eslintAutoFixUpgrader = new eslint_auto_fix_upgrader_1.EslintAutoFixUpgrader(this.eslintrcFilePath);
258
286
  this.logParser = new log_parser_1.LogParser(this.logFilePath, this.logFileName);
259
287
  }
260
288
  updateBasicPaths() {
@@ -267,6 +295,7 @@ class Angular15Upgrader {
267
295
  this.nodeModulesFolderPath = common_1.Common.rootPath + '\\' + this.nodeModulesFolderName;
268
296
  this.e2eFolderPath = common_1.Common.rootPath + '\\' + this.e2eFolderName;
269
297
  this.gitIgnoreFilePath = common_1.Common.rootPath + '\\' + this.gitIgnoreFileName;
298
+ this.eslintrcFilePath = common_1.Common.rootPath + '\\' + this.eslintrcFileName;
270
299
  this.srcTsConfigLibProdFilePath = common_1.Common.rootPath + '\\src\\' + this.srcTsConfigLibProdFileName;
271
300
  this.srcTsConfigSpecFilePath = common_1.Common.rootPath + '\\src\\' + this.srcTsConfigSpecFileName;
272
301
  this.cIBuildYmlFilePath = common_1.Common.rootPath + '\\build\\pipelines\\' + this.cIBuildYmlFileName;
@@ -287,6 +316,13 @@ class Angular15Upgrader {
287
316
  async gulpBuildPostAudit() {
288
317
  return this.logParser.run();
289
318
  }
319
+ gulpLintFix() {
320
+ const gulpLintFixCmd = 'gulp lintApp --fix';
321
+ logger_1.Logger.log(gulpLintFixCmd);
322
+ return (0, command_runner_1.runCommand)(gulpLintFixCmd, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {
323
+ console.log(response);
324
+ });
325
+ }
290
326
  gulpQuick() {
291
327
  const gulpQuick = 'gulp quick';
292
328
  logger_1.Logger.log(gulpQuick);
@@ -304,7 +340,7 @@ class Angular15Upgrader {
304
340
  async gulpBuildProdPostAudit() {
305
341
  return this.logParser.run();
306
342
  }
307
- async installUTALegacy() {
343
+ async installUTALegacyDevDependency() {
308
344
  const setprefixCmd = 'npm config set save-prefix=';
309
345
  logger_1.Logger.log(setprefixCmd);
310
346
  await (0, command_runner_1.runCommand)(setprefixCmd, this.debug);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/main.ts"],"names":[],"mappings":";;;AAAA,sCAAmC;AACnC,4EAAuE;AACvE,oEAAgE;AAChE,2CAAwC;AACxC,wEAAmE;AACnE,4EAAuE;AACvE,oFAA+E;AAC/E,4EAAsE;AACtE,kEAA8D;AAC9D,6CAAsF;AACtF,gEAA4D;AAC5D,yDAAqD;AACrD,2DAAoD;AACpD,4DAAwD;AACxD,4EAAuE;AACvE,4EAAuE;AACvE,6EAAwE;AACxE,yCAAgD;AAChD,sGAA+F;AAE/F;;GAEG;AACH,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,gDAAiC,CAAA;IACjC,sDAAuC,CAAA;IACvC,0CAA2B,CAAA;AAC/B,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAED;;GAEG;AACH,IAAY,yBAWX;AAXD,WAAY,yBAAyB;IACjC,uFAA0D,CAAA;IAC1D,yFAA4D,CAAA;IAC5D,yEAA4C,CAAA;IAC5C,yPAIC,CAAA;IACD,kIAAqG,CAAA;IACrG,6DAAgC,CAAA;AACpC,CAAC,EAXW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAWpC;AAED;;;GAGG;AACH,MAAa,iBAAiB;IAC1B;;OAEG;IACO,KAAK,GAAG,KAAK,CAAC;IAExB;;OAEG;IACO,QAAQ,GAAG,KAAK,CAAC;IAE3B;;OAEG;IACO,QAAQ,GAAG,KAAK,CAAC;IAE3B;;OAEG;IACO,YAAY,CAAe;IAErC;;OAEG;IACc,OAAO,GAAG,OAAO,CAAC;IAEnC;;OAE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sourcesContent":["import { Common } from '../common';\r\nimport { PackageJsonUpgrader } from './upgrader/package-json-upgrader';\r\nimport { TSConfigUpgrader } from './upgrader/tsconfig-upgrader';\r\nimport { Logger } from './utils/logger';\r\nimport { GitIgnoreUpgrader } from './upgrader/git-ignore-upgrader';\r\nimport { AngularJsonUpgrader } from './upgrader/angular-json-upgrader';\r\nimport { FileReplacementUpgrader } from './upgrader/file-replacement-upgrader';\r\nimport { CIBuildYmlUpgrader } from './upgrader/ci-build-yml-upgrader';\r\nimport { ReplaceUpgrader } from './upgrader/replace-upgrader';\r\nimport { srcTsConfigLibProdReplaces, srcTsConfigSpecRemoves } from './configs/config';\r\nimport { RemoveUpgrader } from './upgrader/remove-upgrader';\r\nimport { MainDebugger } from './utils/main-debugger';\r\nimport { runCommand } from './utils/command-runner';\r\nimport { LogParser } from './upgrader/audit/log-parser';\r\nimport { VersionJsonUpgrader } from './upgrader/version-json-upgrader';\r\nimport { JasmineTestUpgrader } from './upgrader/jasmine-test-upgrader';\r\nimport { updateShellReferences } from './utils/update-shell-references';\r\nimport { EslintUpgrader } from '../eslint/main';\r\nimport { UITestAutomationLegacyUpgrader } from './upgrader/ui-test-automation-legacy-upgrader';\r\n\r\n/**\r\n * Represents the type of upgrade that needs to be performed.\r\n */\r\nexport enum UpgradeType {\r\n WithBaseConfig = 'WithBaseConfig',\r\n WithoutBaseConfig = 'WithoutBaseConfig',\r\n NoOperation = 'NoOperation'\r\n}\r\n\r\n/**\r\n * Represents the messages that are displayed during the upgrade process.\r\n */\r\nexport enum Angular15UpgraderMessages {\r\n StartingUpgrade = 'Starting Angular 15 upgrade process...',\r\n UpdateBasicPaths = 'Updating basic paths for the upgrade...',\r\n Initialization = 'Initializing upgraders...',\r\n FinalizeInfoLintFix = `There are eslint violations that needs fix... After fixing the violations, please run the following commands:\\n\r\n npx eslint . --fix \\n\r\n gulp lintApp \\n\r\n gulp build \\n\r\n `,\r\n CannotRunStageThreeExternal = 'The ui-test-automation_legacy is for internal extension upgrade only.',\r\n Completed = 'Upgrade completed!'\r\n}\r\n\r\n/**\r\n * This is the main class of the EslintUpgrader tool.\r\n * It is responsible for upgrading the Tslint to Eslint.\r\n */\r\nexport class Angular15Upgrader {\r\n /**\r\n * The debug mode.\r\n */\r\n protected debug = false;\r\n\r\n /**\r\n * It determines whether to run angualr 15 upgrade for the internal extension or external sdk.\r\n */\r\n protected internal = false;\r\n\r\n /**\r\n * If running in the pipeline, the pipeline needs to automatically update for the @msft-sme pacakges instead of WAC CLI.\r\n */\r\n protected pipeline = false;\r\n\r\n /**\r\n * The main debugger.\r\n */\r\n protected mainDebugger: MainDebugger;\r\n\r\n /**\r\n * The main debugger version.\r\n */\r\n private readonly version = '1.0.1';\r\n\r\n /**\r\n * The paths of the configuration files.\r\n */\r\n private tsconfigBaseFilePath: string;\r\n private tsconfigFilePath: string;\r\n private angularJsonFilePath: string;\r\n private gitIgnoreFilePath: string;\r\n private packageJsonFilePath: string;\r\n private versionJsonFilePath: string;\r\n private packageLockJsonFilePath: string;\r\n private nodeModulesFolderPath: string;\r\n private e2eFolderPath: string;\r\n private testTsFilePath: string;\r\n private testTsFileTemplatePath: string;\r\n private cIBuildYmlFilePath: string;\r\n private pullRequestYmlFilePath: string;\r\n private srcTsConfigSpecFilePath: string;\r\n private srcTsConfigLibProdFilePath: string;\r\n private gulpCompileTsFilePath: string;\r\n private gulpCompileTsTemplatePath: string;\r\n private gulpIndexTsFilePath: string;\r\n private gulpIndexTsTemplatePath: string;\r\n private uiTestAutomationLegacyFilePath: string;\r\n private uiTestAutomationLegacyFolderPath: string;\r\n private logFilePath: string;\r\n\r\n /**\r\n * The upgrader for each configuration file.\r\n */\r\n private packageJsonUpgrader: PackageJsonUpgrader;\r\n private versionJsonUpgrader: VersionJsonUpgrader;\r\n private tSConfigUpgrader: TSConfigUpgrader;\r\n private tSConfigBaseUpgrader: TSConfigUpgrader;\r\n private gitIgnoreUpgrader: GitIgnoreUpgrader;\r\n private angularJsonUpgrader: AngularJsonUpgrader;\r\n private testTsUpgrader: FileReplacementUpgrader;\r\n private cIBuildUpgrader: CIBuildYmlUpgrader;\r\n private pullRequestUpgrader: CIBuildYmlUpgrader;\r\n private srcTsConfigLibProdUpgrader: ReplaceUpgrader;\r\n private srcTsConfigSpecUpgrader: RemoveUpgrader;\r\n private gulpCompileTsUpgrader: FileReplacementUpgrader;\r\n private gulpIndexTsUpgrader: FileReplacementUpgrader;\r\n private logParser: LogParser;\r\n private jasmineTestUpgrader: JasmineTestUpgrader;\r\n private uITestAutomationLegacyUpgrader: UITestAutomationLegacyUpgrader;\r\n\r\n /**\r\n * The file names for each configuration file.\r\n */\r\n private readonly tsconfigBaseFileName = 'tsconfig.base.json';\r\n private readonly tsconfigFileName = 'tsconfig.json';\r\n private readonly packageJsonFileName = 'package.json';\r\n private readonly versionJsonFileName = 'version.json';\r\n private readonly packageLockJsonFileName = 'package-lock.json';\r\n private readonly angularFileName = 'angular.json';\r\n private readonly e2eFolderName = 'e2e';\r\n private readonly nodeModulesFolderName = 'node_modules';\r\n private readonly gitIgnoreFileName = '.gitignore';\r\n private readonly testTsFileName = 'test.ts';\r\n private readonly cIBuildYmlFileName = 'ci-build.yml';\r\n private readonly pullRequestYmlFileName = 'pull-request.yml';\r\n private readonly srcTsConfigLibProdFileName = 'tsconfig.lib.prod.json';\r\n private readonly srcTsConfigSpecFileName = 'tsconfig.spec.json';\r\n private readonly gulpCompileTsFileName = 'compile.ts';\r\n private readonly gulpIndexTsFileName = 'index.ts';\r\n private readonly logFileName = 'log.txt';\r\n\r\n constructor() {\r\n Logger.log(Angular15UpgraderMessages.StartingUpgrade);\r\n Common.rootPath = process.cwd();\r\n Logger.log(Common.rootPath);\r\n }\r\n\r\n /**\r\n * The upgrader main function.\r\n * If only runs the unit test\r\n * node ./node_modules/@microsoft/windows-admin-center-sdk/tools/wac-cli/src/index.js angular15Upgrade --pipeline false --stage 2\r\n * @param pipeline It determines whether to run this command on the pipeline.\r\n * @param debug It determines whether to run the debug mode.\r\n * @param internal It determines whether to run angualr 15 upgrade for the internal extension or external sdk.\r\n * @param stage '0' - the default Angular 15 stage, '1' - the Angular core stage, '2' - the Angular 15 unit test stage, '3' - the legacy ui-test-automation stage.\r\n */\r\n public async upgrade(pipeline = false, stage = 0, internal = false, debug = false) {\r\n this.debug = !!debug;\r\n this.pipeline = !!pipeline;\r\n this.internal = !!internal;\r\n Logger.log(this.version);\r\n Logger.log(Angular15UpgraderMessages.StartingUpgrade);\r\n Logger.log('Passed in parameters: ' + this.pipeline + ' ' + stage + ' ' + this.internal + ' ' + this.debug );\r\n\r\n this.mainDebugger = this.debug ? new MainDebugger(): undefined;\r\n\r\n Logger.log(Angular15UpgraderMessages.UpdateBasicPaths);\r\n this.updateBasicPaths();\r\n\r\n Logger.log(Angular15UpgraderMessages.Initialization);\r\n this.initialization();\r\n\r\n switch (stage) {\r\n case 0:\r\n Logger.log('0');\r\n await this.criticalConfigurationFilesUpdates();\r\n await this.installDependenciesPreparation();\r\n await this.installLKGElectronToChromium();\r\n await this.installDependencies();\r\n // Fix any eslint errors that doesn't match the latest eslint rules.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpQuick();\r\n await this.gulpBuildPostAudit();\r\n // Fix any eslint errors that is triggered by audit.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpBuildProd();\r\n await this.gulpBuildProdPostAudit();\r\n // Fix any eslint errors clean-ups.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.jasmineTestUpgrader.run();\r\n break;\r\n case 1:\r\n Logger.log('1');\r\n await this.criticalConfigurationFilesUpdates();\r\n await this.installDependenciesPreparation();\r\n await this.installLKGElectronToChromium();\r\n await this.installDependencies();\r\n // Fix any eslint errors that doesn't match the latest eslint rules.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpQuick();\r\n await this.gulpBuildPostAudit();\r\n // Fix any eslint errors that is triggered by audit.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpBuildProd();\r\n await this.gulpBuildProdPostAudit();\r\n // Fix any eslint errors clean-ups.\r\n await this.fixEslintErrors(this.pipeline);\r\n break;\r\n case 2:\r\n Logger.log('2');\r\n await this.gulpIndexTsUpgrader.run();\r\n await this.testTsUpgrader.run();\r\n await this.jasmineTestUpgrader.run();\r\n break;\r\n case 3:\r\n Logger.log('3');\r\n if (!this.internal) {\r\n Logger.log(Angular15UpgraderMessages.CannotRunStageThreeExternal);\r\n } else {\r\n await this.uITestAutomationLegacyUpgrader.run();\r\n await this.installDependenciesForUITestAutomation();\r\n }\r\n default:\r\n Logger.log('default');\r\n break;\r\n }\r\n }\r\n\r\n protected async criticalConfigurationFilesUpdates(): Promise<void> {\r\n Promise.all([\r\n this.packageJsonUpgrader.run(this.pipeline),\r\n this.versionJsonUpgrader.run(),\r\n this.tSConfigBaseUpgrader.runBase(),\r\n this.tSConfigUpgrader.run(),\r\n this.gitIgnoreUpgrader.run(),\r\n this.angularJsonUpgrader.run(),\r\n this.testTsUpgrader.run(),\r\n this.cIBuildUpgrader.run(),\r\n this.pullRequestUpgrader.run(),\r\n this.srcTsConfigLibProdUpgrader.run(),\r\n this.srcTsConfigSpecUpgrader.run(),\r\n this.gulpCompileTsUpgrader.run(),\r\n this.gulpIndexTsUpgrader.run()\r\n ]).then((results) => {\r\n console.log('All Promises have completed:', results);\r\n\r\n if (this.debug) {\r\n this.mainDebugger.verifyTestData(this).then(() => {\r\n Logger.log(Angular15UpgraderMessages.Completed);\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n Logger.error('At least one Promise encountered an error:' + error);\r\n });\r\n }\r\n\r\n protected initialization() {\r\n this.packageJsonUpgrader = new PackageJsonUpgrader(this.packageJsonFilePath);\r\n this.versionJsonUpgrader = new VersionJsonUpgrader(this.versionJsonFilePath);\r\n this.tSConfigBaseUpgrader = new TSConfigUpgrader(this.tsconfigBaseFilePath, this.tsconfigBaseFileName);\r\n this.tSConfigUpgrader = new TSConfigUpgrader(this.tsconfigFilePath, this.tsconfigFileName);\r\n this.gitIgnoreUpgrader = new GitIgnoreUpgrader(this.gitIgnoreFilePath);\r\n this.angularJsonUpgrader = new AngularJsonUpgrader(this.angularJsonFilePath);\r\n this.testTsUpgrader = new FileReplacementUpgrader(this.testTsFileTemplatePath, this.testTsFilePath);\r\n this.cIBuildUpgrader = new CIBuildYmlUpgrader(this.cIBuildYmlFilePath, this.cIBuildYmlFileName);\r\n this.pullRequestUpgrader = new CIBuildYmlUpgrader(this.pullRequestYmlFilePath, this.pullRequestYmlFileName);\r\n this.srcTsConfigLibProdUpgrader = new ReplaceUpgrader(this.srcTsConfigLibProdFilePath, srcTsConfigLibProdReplaces, this.srcTsConfigLibProdFileName);\r\n this.srcTsConfigSpecUpgrader = new RemoveUpgrader(this.srcTsConfigSpecFilePath, srcTsConfigSpecRemoves, this.srcTsConfigSpecFileName);\r\n this.gulpCompileTsUpgrader = new FileReplacementUpgrader(this.gulpCompileTsTemplatePath, this.gulpCompileTsFilePath);\r\n this.gulpIndexTsUpgrader = new FileReplacementUpgrader(this.gulpIndexTsTemplatePath, this.gulpIndexTsFilePath);\r\n this.jasmineTestUpgrader = new JasmineTestUpgrader(this.testTsFilePath, this.debug);\r\n this.uITestAutomationLegacyUpgrader = new UITestAutomationLegacyUpgrader(this.uiTestAutomationLegacyFilePath, this.packageJsonFileName);\r\n\r\n this.logParser = new LogParser(this.logFilePath, this.logFileName);\r\n }\r\n\r\n protected updateBasicPaths(): void {\r\n this.tsconfigBaseFilePath = Common.rootPath + '\\\\' + this.tsconfigBaseFileName;\r\n this.tsconfigFilePath = Common.rootPath + '\\\\' + this.tsconfigFileName;\r\n this.angularJsonFilePath = Common.rootPath + '\\\\' + this.angularFileName;\r\n this.packageJsonFilePath = Common.rootPath + '\\\\' + this.packageJsonFileName;\r\n this.versionJsonFilePath = Common.rootPath + '\\\\' + this.versionJsonFileName;\r\n this.packageLockJsonFilePath = Common.rootPath + '\\\\' + this.packageLockJsonFileName;\r\n this.nodeModulesFolderPath = Common.rootPath + '\\\\' + this.nodeModulesFolderName;\r\n this.e2eFolderPath = Common.rootPath + '\\\\' + this.e2eFolderName;\r\n this.gitIgnoreFilePath = Common.rootPath + '\\\\' + this.gitIgnoreFileName;\r\n\r\n this.srcTsConfigLibProdFilePath = Common.rootPath + '\\\\src\\\\' + this.srcTsConfigLibProdFileName;\r\n this.srcTsConfigSpecFilePath = Common.rootPath + '\\\\src\\\\' + this.srcTsConfigSpecFileName;\r\n\r\n this.cIBuildYmlFilePath = Common.rootPath + '\\\\build\\\\pipelines\\\\' + this.cIBuildYmlFileName;\r\n this.pullRequestYmlFilePath = Common.rootPath + '\\\\build\\\\pipelines\\\\' + this.pullRequestYmlFileName;\r\n\r\n this.testTsFilePath = Common.rootPath + '\\\\src\\\\' + this.testTsFileName;\r\n this.testTsFileTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\test.ts');\r\n\r\n this.gulpCompileTsFilePath = Common.rootPath + '\\\\gulpfile.ts\\\\common\\\\' + this.gulpCompileTsFileName;\r\n this.gulpCompileTsTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\gulpfile.ts\\\\common\\\\compile.ts');\r\n\r\n this.gulpIndexTsFilePath = Common.rootPath + '\\\\gulpfile.ts\\\\' + this.gulpIndexTsFileName;\r\n this.gulpIndexTsTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\gulpfile.ts\\\\index.ts');\r\n\r\n this.uiTestAutomationLegacyFilePath = Common.rootPath + '\\\\ui-test-automation\\\\' + this.packageJsonFileName;\r\n this.uiTestAutomationLegacyFolderPath = Common.rootPath + '\\\\ui-test-automation\\\\';\r\n\r\n this.logFilePath = Common.rootPath + '\\\\' + this.logFileName;\r\n\r\n if (this.debug) {\r\n this.mainDebugger.updateTestData(this);\r\n }\r\n }\r\n\r\n protected async gulpBuildPostAudit(): Promise<void> {\r\n return this.logParser.run();\r\n }\r\n\r\n protected gulpQuick(): Promise<void> {\r\n const gulpQuick = 'gulp quick';\r\n Logger.log(gulpQuick);\r\n return runCommand(gulpQuick, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected gulpBuildProd(): Promise<void> {\r\n const gulpBuild = 'gulp build --prod';\r\n Logger.log(gulpBuild);\r\n return runCommand(gulpBuild, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected async gulpBuildProdPostAudit(): Promise<void> {\r\n return this.logParser.run();\r\n }\r\n\r\n protected async installUTALegacy(): Promise<void> {\r\n const setprefixCmd = 'npm config set save-prefix=';\r\n Logger.log(setprefixCmd);\r\n await runCommand(setprefixCmd, this.debug);\r\n const cmd = 'npm install @msft-sme/ui-test-automation@latest --save-dev --force';\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n protected async installDependenciesPreparation(): Promise<void> {\r\n await this.removeNodeModuleFolder();\r\n await this.removePackageLockJsonFile();\r\n await this.removeE2EFolder();\r\n await this.checkEslintRCFile();\r\n updateShellReferences('', this.internal);\r\n }\r\n\r\n private async checkEslintRCFile(): Promise<void> {\r\n const esLintUpgrader = new EslintUpgrader();\r\n await esLintUpgrader.replaceEslintConfig();\r\n }\r\n\r\n private async installMicrosftSignalR(): Promise<void> {\r\n const cmd = 'npm install @microsoft/signalr@6.0.8 --save';\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removePackageLockJsonFile(): Promise<void> {\r\n const cmd = `del ${this.packageLockJsonFilePath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removeNodeModuleFolder(): Promise<void> {\r\n const cmd = `rmdir /s /q ${this.nodeModulesFolderPath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removeE2EFolder(): Promise<void> {\r\n const cmd = `rmdir /s /q ${this.e2eFolderPath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async installDependencies(): Promise<void> {\r\n // Needs to be installed on the SDK root dependency.\r\n if (!this.internal) {\r\n await this.installMicrosftSignalR();\r\n }\r\n const cmd = 'npm install --force';\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async installDependenciesForUITestAutomation(): Promise<void> {\r\n const cmd = 'pushd ' + this.uiTestAutomationLegacyFolderPath + '&& del package-lock.json && npm install && popd';\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async fixEslintErrors(ignore = false): Promise<void> {\r\n if (ignore) {\r\n return;\r\n }\r\n \r\n const rootFileLinterFix = 'npx eslint . --fix';\r\n Logger.log(rootFileLinterFix);\r\n await runCommand(rootFileLinterFix, this.debug, true, Angular15UpgraderMessages.FinalizeInfoLintFix);\r\n const projectLinterFix = 'npx ng lint --fix';\r\n Logger.log(projectLinterFix);\r\n await runCommand(projectLinterFix, this.debug, true, Angular15UpgraderMessages.FinalizeInfoLintFix);\r\n }\r\n\r\n /**\r\n * electron-to-chromium 1.4.533 - 1.4.535 are bad versions that is also the latest, meaning any dependency uses ^1.4.xxx are also blocked,\r\n * below are the dependency list:\r\n * /@angular-devkit/build-angular@15.2.8 -> browserslist@4.21.5 that has dependency on ^1.4.284(which always grab 1.4.535)\r\n * always force 1.4.532\r\n */\r\n private async installLKGElectronToChromium(): Promise<void> {\r\n const cmd = 'npm install electron-to-chromium@1.4.532 --force';\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/main.ts"],"names":[],"mappings":";;;AAAA,sCAAmC;AACnC,4EAAuE;AACvE,oEAAgE;AAChE,2CAAwC;AACxC,wEAAmE;AACnE,4EAAuE;AACvE,oFAA+E;AAC/E,4EAAsE;AACtE,kEAA8D;AAC9D,6CAAsF;AACtF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,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,KAAK;QACxC,IAAI,MAAM,EAAE;YACR,OAAO;SACV;QAED,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;QAC/C,eAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC9B,MAAM,IAAA,2BAAU,EAAC,iBAAiB,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;QACrG,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;QAC7C,eAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC7B,MAAM,IAAA,2BAAU,EAAC,gBAAgB,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;IACxG,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,4BAA4B;QACtC,MAAM,GAAG,GAAG,kDAAkD,CAAC;QAC/D,eAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,MAAM,IAAA,2BAAU,EAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ;AAzZD,8CAyZC","file":"main.js","sourcesContent":["import { Common } from '../common';\r\nimport { PackageJsonUpgrader } from './upgrader/package-json-upgrader';\r\nimport { TSConfigUpgrader } from './upgrader/tsconfig-upgrader';\r\nimport { Logger } from './utils/logger';\r\nimport { GitIgnoreUpgrader } from './upgrader/git-ignore-upgrader';\r\nimport { AngularJsonUpgrader } from './upgrader/angular-json-upgrader';\r\nimport { FileReplacementUpgrader } from './upgrader/file-replacement-upgrader';\r\nimport { CIBuildYmlUpgrader } from './upgrader/ci-build-yml-upgrader';\r\nimport { ReplaceUpgrader } from './upgrader/replace-upgrader';\r\nimport { srcTsConfigLibProdReplaces, srcTsConfigSpecRemoves } from './configs/config';\r\nimport { RemoveUpgrader } from './upgrader/remove-upgrader';\r\nimport { MainDebugger } from './utils/main-debugger';\r\nimport { runCommand } from './utils/command-runner';\r\nimport { LogParser } from './upgrader/audit/log-parser';\r\nimport { VersionJsonUpgrader } from './upgrader/version-json-upgrader';\r\nimport { JasmineTestUpgrader } from './upgrader/jasmine-test-upgrader';\r\nimport { updateShellReferences } from './utils/update-shell-references';\r\nimport { EslintUpgrader } from '../eslint/main';\r\nimport { UITestAutomationLegacyUpgrader } from './upgrader/ui-test-automation-legacy-upgrader';\r\nimport { EslintAutoFixUpgrader } from './upgrader/eslint-auto-fix-upgrader';\r\n\r\n/**\r\n * Represents the type of upgrade that needs to be performed.\r\n */\r\nexport enum UpgradeType {\r\n WithBaseConfig = 'WithBaseConfig',\r\n WithoutBaseConfig = 'WithoutBaseConfig',\r\n NoOperation = 'NoOperation'\r\n}\r\n\r\n/**\r\n * Represents the messages that are displayed during the upgrade process.\r\n */\r\nexport enum Angular15UpgraderMessages {\r\n StartingUpgrade = 'Starting Angular 15 upgrade process...',\r\n UpdateBasicPaths = 'Updating basic paths for the upgrade...',\r\n Initialization = 'Initializing upgraders...',\r\n FinalizeInfoLintFix = `There are eslint violations that needs fix... After fixing the violations, please run the following commands:\\n\r\n npx eslint . --fix \\n\r\n gulp lintApp \\n\r\n gulp build \\n\r\n `,\r\n InternalCommandOnly = 'This command is only available for internal extension.',\r\n Completed = 'Upgrade completed!',\r\n StartMessageStage0 = 'Starting stage 0: the default Angular 15 upgrade stage',\r\n StartMessageStage1 = 'Starting stage 1: the Angular core stage',\r\n StartMessageStage2 = 'Starting stage 2: the Angular 15 unit test stage',\r\n StartMessageStage3 = 'Starting stage 3: the legacy ui-test-automation stage',\r\n StartMessageStage4 = 'Starting stage 4: the eslint to support gulp lintApp --fix command stage'\r\n}\r\n\r\n/**\r\n * This is the main class of the EslintUpgrader tool.\r\n * It is responsible for upgrading the Tslint to Eslint.\r\n */\r\nexport class Angular15Upgrader {\r\n /**\r\n * The debug mode.\r\n */\r\n protected debug = false;\r\n\r\n /**\r\n * It determines whether to run angualr 15 upgrade for the internal extension or external sdk.\r\n */\r\n protected internal = false;\r\n\r\n /**\r\n * If running in the pipeline, the pipeline needs to automatically update for the @msft-sme pacakges instead of WAC CLI.\r\n */\r\n protected pipeline = false;\r\n\r\n /**\r\n * The main debugger.\r\n */\r\n protected mainDebugger: MainDebugger;\r\n\r\n /**\r\n * The main debugger version.\r\n */\r\n private readonly version = '1.0.1';\r\n\r\n /**\r\n * The paths of the configuration files.\r\n */\r\n private tsconfigBaseFilePath: string;\r\n private tsconfigFilePath: string;\r\n private angularJsonFilePath: string;\r\n private gitIgnoreFilePath: string;\r\n private packageJsonFilePath: string;\r\n private versionJsonFilePath: string;\r\n private packageLockJsonFilePath: string;\r\n private nodeModulesFolderPath: string;\r\n private e2eFolderPath: string;\r\n private testTsFilePath: string;\r\n private testTsFileTemplatePath: string;\r\n private cIBuildYmlFilePath: string;\r\n private pullRequestYmlFilePath: string;\r\n private srcTsConfigSpecFilePath: string;\r\n private srcTsConfigLibProdFilePath: string;\r\n private gulpCompileTsFilePath: string;\r\n private gulpCompileTsTemplatePath: string;\r\n private gulpIndexTsFilePath: string;\r\n private gulpIndexTsTemplatePath: string;\r\n private uiTestAutomationLegacyFilePath: string;\r\n private uiTestAutomationLegacyFolderPath: string;\r\n private logFilePath: string;\r\n private eslintrcFilePath: string;\r\n\r\n /**\r\n * The upgrader for each configuration file.\r\n */\r\n private packageJsonUpgrader: PackageJsonUpgrader;\r\n private versionJsonUpgrader: VersionJsonUpgrader;\r\n private tSConfigUpgrader: TSConfigUpgrader;\r\n private tSConfigBaseUpgrader: TSConfigUpgrader;\r\n private gitIgnoreUpgrader: GitIgnoreUpgrader;\r\n private angularJsonUpgrader: AngularJsonUpgrader;\r\n private testTsUpgrader: FileReplacementUpgrader;\r\n private cIBuildUpgrader: CIBuildYmlUpgrader;\r\n private pullRequestUpgrader: CIBuildYmlUpgrader;\r\n private srcTsConfigLibProdUpgrader: ReplaceUpgrader;\r\n private srcTsConfigSpecUpgrader: RemoveUpgrader;\r\n private gulpCompileTsUpgrader: FileReplacementUpgrader;\r\n private gulpIndexTsUpgrader: FileReplacementUpgrader;\r\n private logParser: LogParser;\r\n private jasmineTestUpgrader: JasmineTestUpgrader;\r\n private uITestAutomationLegacyUpgrader: UITestAutomationLegacyUpgrader;\r\n /**\r\n * The eslint fix upgrader to support linter fix command for stage 4.\r\n */\r\n private eslintAutoFixUpgrader: EslintAutoFixUpgrader;\r\n\r\n /**\r\n * The file names for each configuration file.\r\n */\r\n private readonly tsconfigBaseFileName = 'tsconfig.base.json';\r\n private readonly tsconfigFileName = 'tsconfig.json';\r\n private readonly packageJsonFileName = 'package.json';\r\n private readonly versionJsonFileName = 'version.json';\r\n private readonly packageLockJsonFileName = 'package-lock.json';\r\n private readonly angularFileName = 'angular.json';\r\n private readonly e2eFolderName = 'e2e';\r\n private readonly nodeModulesFolderName = 'node_modules';\r\n private readonly gitIgnoreFileName = '.gitignore';\r\n private readonly testTsFileName = 'test.ts';\r\n private readonly cIBuildYmlFileName = 'ci-build.yml';\r\n private readonly pullRequestYmlFileName = 'pull-request.yml';\r\n private readonly srcTsConfigLibProdFileName = 'tsconfig.lib.prod.json';\r\n private readonly srcTsConfigSpecFileName = 'tsconfig.spec.json';\r\n private readonly gulpCompileTsFileName = 'compile.ts';\r\n private readonly gulpIndexTsFileName = 'index.ts';\r\n private readonly logFileName = 'log.txt';\r\n private readonly eslintrcFileName = '.eslintrc.json';\r\n\r\n constructor() {\r\n Logger.log(Angular15UpgraderMessages.StartingUpgrade);\r\n Common.rootPath = process.cwd();\r\n Logger.log(Common.rootPath);\r\n }\r\n\r\n /**\r\n * The upgrader main function.\r\n * If only runs the unit test\r\n * node ./node_modules/@microsoft/windows-admin-center-sdk/tools/wac-cli/src/index.js angular15Upgrade --pipeline false --stage 2\r\n * @param pipeline It determines whether to run this command on the pipeline.\r\n * @param debug It determines whether to run the debug mode.\r\n * @param internal It determines whether to run angualr 15 upgrade for the internal extension or external sdk.\r\n * @param stage '0' - the default Angular 15 upgrade stage,\r\n * '1' - the Angular core stage,\r\n * '2' - the Angular 15 unit test stage,\r\n * '3' - the legacy ui-test-automation stage.\r\n * '4' - the eslint to support gulp lintApp --fix command.\r\n */\r\n public async upgrade(pipeline = false, stage = 0, internal = false, debug = false) {\r\n this.debug = !!debug;\r\n this.pipeline = !!pipeline;\r\n this.internal = !!internal;\r\n Logger.log(this.version);\r\n Logger.log(Angular15UpgraderMessages.StartingUpgrade);\r\n Logger.log('Passed in parameters: ' + this.pipeline + ' ' + stage + ' ' + this.internal + ' ' + this.debug );\r\n\r\n this.mainDebugger = this.debug ? new MainDebugger(): undefined;\r\n\r\n Logger.log(Angular15UpgraderMessages.UpdateBasicPaths);\r\n this.updateBasicPaths();\r\n\r\n Logger.log(Angular15UpgraderMessages.Initialization);\r\n this.initialization();\r\n\r\n switch (stage) {\r\n case 0:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage0);\r\n await this.criticalConfigurationFilesUpdates();\r\n await this.installDependenciesPreparation();\r\n await this.installLKGElectronToChromium();\r\n await this.installDependencies();\r\n // Fix any eslint errors that doesn't match the latest eslint rules.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpQuick();\r\n await this.gulpBuildPostAudit();\r\n // Fix any eslint errors that is triggered by audit.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpBuildProd();\r\n await this.gulpBuildProdPostAudit();\r\n // Fix any eslint errors clean-ups.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.jasmineTestUpgrader.run();\r\n break;\r\n case 1:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage1);\r\n await this.criticalConfigurationFilesUpdates();\r\n await this.installDependenciesPreparation();\r\n await this.installLKGElectronToChromium();\r\n await this.installDependencies();\r\n // Fix any eslint errors that doesn't match the latest eslint rules.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpQuick();\r\n await this.gulpBuildPostAudit();\r\n // Fix any eslint errors that is triggered by audit.\r\n await this.fixEslintErrors(this.pipeline);\r\n await this.gulpBuildProd();\r\n await this.gulpBuildProdPostAudit();\r\n // Fix any eslint errors clean-ups.\r\n await this.fixEslintErrors(this.pipeline);\r\n break;\r\n case 2:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage2);\r\n await this.gulpIndexTsUpgrader.run();\r\n await this.testTsUpgrader.run();\r\n await this.jasmineTestUpgrader.run();\r\n break;\r\n case 3:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage3);\r\n if (!this.internal) {\r\n Logger.log(Angular15UpgraderMessages.InternalCommandOnly);\r\n } else {\r\n await this.packageJsonUpgrader.run(this.pipeline),\r\n await this.installUTALegacyDevDependency();\r\n await this.uITestAutomationLegacyUpgrader.run();\r\n await this.installDependenciesForUITestAutomation();\r\n }\r\n case 4:\r\n Logger.log(Angular15UpgraderMessages.StartMessageStage4);\r\n if (!this.internal) {\r\n Logger.log(Angular15UpgraderMessages.InternalCommandOnly);\r\n } else {\r\n await this.eslintAutoFixUpgrader.run();\r\n await this.gulpLintFix();\r\n }\r\n default:\r\n Logger.log('default');\r\n break;\r\n }\r\n }\r\n\r\n protected async criticalConfigurationFilesUpdates(): Promise<void> {\r\n Promise.all([\r\n this.packageJsonUpgrader.run(this.pipeline),\r\n this.versionJsonUpgrader.run(),\r\n this.tSConfigBaseUpgrader.runBase(),\r\n this.tSConfigUpgrader.run(),\r\n this.gitIgnoreUpgrader.run(),\r\n this.angularJsonUpgrader.run(),\r\n this.testTsUpgrader.run(),\r\n this.cIBuildUpgrader.run(),\r\n this.pullRequestUpgrader.run(),\r\n this.srcTsConfigLibProdUpgrader.run(),\r\n this.srcTsConfigSpecUpgrader.run(),\r\n this.gulpCompileTsUpgrader.run(),\r\n this.gulpIndexTsUpgrader.run()\r\n ]).then((results) => {\r\n console.log('All Promises have completed:', results);\r\n\r\n if (this.debug) {\r\n this.mainDebugger.verifyTestData(this).then(() => {\r\n Logger.log(Angular15UpgraderMessages.Completed);\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n Logger.error('At least one Promise encountered an error:' + error);\r\n });\r\n }\r\n\r\n protected initialization() {\r\n this.packageJsonUpgrader = new PackageJsonUpgrader(this.packageJsonFilePath);\r\n this.versionJsonUpgrader = new VersionJsonUpgrader(this.versionJsonFilePath);\r\n this.tSConfigBaseUpgrader = new TSConfigUpgrader(this.tsconfigBaseFilePath, this.tsconfigBaseFileName);\r\n this.tSConfigUpgrader = new TSConfigUpgrader(this.tsconfigFilePath, this.tsconfigFileName);\r\n this.gitIgnoreUpgrader = new GitIgnoreUpgrader(this.gitIgnoreFilePath);\r\n this.angularJsonUpgrader = new AngularJsonUpgrader(this.angularJsonFilePath);\r\n this.testTsUpgrader = new FileReplacementUpgrader(this.testTsFileTemplatePath, this.testTsFilePath);\r\n this.cIBuildUpgrader = new CIBuildYmlUpgrader(this.cIBuildYmlFilePath, this.cIBuildYmlFileName);\r\n this.pullRequestUpgrader = new CIBuildYmlUpgrader(this.pullRequestYmlFilePath, this.pullRequestYmlFileName);\r\n this.srcTsConfigLibProdUpgrader = new ReplaceUpgrader(this.srcTsConfigLibProdFilePath, srcTsConfigLibProdReplaces, this.srcTsConfigLibProdFileName);\r\n this.srcTsConfigSpecUpgrader = new RemoveUpgrader(this.srcTsConfigSpecFilePath, srcTsConfigSpecRemoves, this.srcTsConfigSpecFileName);\r\n this.gulpCompileTsUpgrader = new FileReplacementUpgrader(this.gulpCompileTsTemplatePath, this.gulpCompileTsFilePath);\r\n this.gulpIndexTsUpgrader = new FileReplacementUpgrader(this.gulpIndexTsTemplatePath, this.gulpIndexTsFilePath);\r\n this.jasmineTestUpgrader = new JasmineTestUpgrader(this.testTsFilePath, this.debug);\r\n this.uITestAutomationLegacyUpgrader = new UITestAutomationLegacyUpgrader(this.uiTestAutomationLegacyFilePath, this.packageJsonFileName);\r\n this.eslintAutoFixUpgrader = new EslintAutoFixUpgrader(this.eslintrcFilePath);\r\n\r\n this.logParser = new LogParser(this.logFilePath, this.logFileName);\r\n }\r\n\r\n protected updateBasicPaths(): void {\r\n this.tsconfigBaseFilePath = Common.rootPath + '\\\\' + this.tsconfigBaseFileName;\r\n this.tsconfigFilePath = Common.rootPath + '\\\\' + this.tsconfigFileName;\r\n this.angularJsonFilePath = Common.rootPath + '\\\\' + this.angularFileName;\r\n this.packageJsonFilePath = Common.rootPath + '\\\\' + this.packageJsonFileName;\r\n this.versionJsonFilePath = Common.rootPath + '\\\\' + this.versionJsonFileName;\r\n this.packageLockJsonFilePath = Common.rootPath + '\\\\' + this.packageLockJsonFileName;\r\n this.nodeModulesFolderPath = Common.rootPath + '\\\\' + this.nodeModulesFolderName;\r\n this.e2eFolderPath = Common.rootPath + '\\\\' + this.e2eFolderName;\r\n this.gitIgnoreFilePath = Common.rootPath + '\\\\' + this.gitIgnoreFileName;\r\n this.eslintrcFilePath = Common.rootPath + '\\\\' + this.eslintrcFileName;\r\n\r\n this.srcTsConfigLibProdFilePath = Common.rootPath + '\\\\src\\\\' + this.srcTsConfigLibProdFileName;\r\n this.srcTsConfigSpecFilePath = Common.rootPath + '\\\\src\\\\' + this.srcTsConfigSpecFileName;\r\n\r\n this.cIBuildYmlFilePath = Common.rootPath + '\\\\build\\\\pipelines\\\\' + this.cIBuildYmlFileName;\r\n this.pullRequestYmlFilePath = Common.rootPath + '\\\\build\\\\pipelines\\\\' + this.pullRequestYmlFileName;\r\n\r\n this.testTsFilePath = Common.rootPath + '\\\\src\\\\' + this.testTsFileName;\r\n this.testTsFileTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\test.ts');\r\n\r\n this.gulpCompileTsFilePath = Common.rootPath + '\\\\gulpfile.ts\\\\common\\\\' + this.gulpCompileTsFileName;\r\n this.gulpCompileTsTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\gulpfile.ts\\\\common\\\\compile.ts');\r\n\r\n this.gulpIndexTsFilePath = Common.rootPath + '\\\\gulpfile.ts\\\\' + this.gulpIndexTsFileName;\r\n this.gulpIndexTsTemplatePath = Common.cliRootPath.replace('wac-cli', 'module-template\\\\angular15\\\\gulpfile.ts\\\\index.ts');\r\n\r\n this.uiTestAutomationLegacyFilePath = Common.rootPath + '\\\\ui-test-automation\\\\' + this.packageJsonFileName;\r\n this.uiTestAutomationLegacyFolderPath = Common.rootPath + '\\\\ui-test-automation\\\\';\r\n\r\n this.logFilePath = Common.rootPath + '\\\\' + this.logFileName;\r\n\r\n if (this.debug) {\r\n this.mainDebugger.updateTestData(this);\r\n }\r\n }\r\n\r\n protected async gulpBuildPostAudit(): Promise<void> {\r\n return this.logParser.run();\r\n }\r\n\r\n protected gulpLintFix(): Promise<void> {\r\n const gulpLintFixCmd = 'gulp lintApp --fix';\r\n Logger.log(gulpLintFixCmd);\r\n return runCommand(gulpLintFixCmd, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected gulpQuick(): Promise<void> {\r\n const gulpQuick = 'gulp quick';\r\n Logger.log(gulpQuick);\r\n return runCommand(gulpQuick, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected gulpBuildProd(): Promise<void> {\r\n const gulpBuild = 'gulp build --prod';\r\n Logger.log(gulpBuild);\r\n return runCommand(gulpBuild, this.debug, true, Angular15UpgraderMessages.Completed, this.logFileName).then((response) => {\r\n console.log(response);\r\n });\r\n }\r\n\r\n protected async gulpBuildProdPostAudit(): Promise<void> {\r\n return this.logParser.run();\r\n }\r\n\r\n protected async installUTALegacyDevDependency(): Promise<void> {\r\n const setprefixCmd = 'npm config set save-prefix=';\r\n Logger.log(setprefixCmd);\r\n await runCommand(setprefixCmd, this.debug);\r\n const cmd = 'npm install @msft-sme/ui-test-automation@latest --save-dev --force';\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n protected async installDependenciesPreparation(): Promise<void> {\r\n await this.removeNodeModuleFolder();\r\n await this.removePackageLockJsonFile();\r\n await this.removeE2EFolder();\r\n await this.checkEslintRCFile();\r\n updateShellReferences('', this.internal);\r\n }\r\n\r\n private async checkEslintRCFile(): Promise<void> {\r\n const esLintUpgrader = new EslintUpgrader();\r\n await esLintUpgrader.replaceEslintConfig();\r\n }\r\n\r\n private async installMicrosftSignalR(): Promise<void> {\r\n const cmd = 'npm install @microsoft/signalr@6.0.8 --save';\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removePackageLockJsonFile(): Promise<void> {\r\n const cmd = `del ${this.packageLockJsonFilePath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removeNodeModuleFolder(): Promise<void> {\r\n const cmd = `rmdir /s /q ${this.nodeModulesFolderPath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async removeE2EFolder(): Promise<void> {\r\n const cmd = `rmdir /s /q ${this.e2eFolderPath}`;\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async installDependencies(): Promise<void> {\r\n // Needs to be installed on the SDK root dependency.\r\n if (!this.internal) {\r\n await this.installMicrosftSignalR();\r\n }\r\n const cmd = 'npm install --force';\r\n\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async installDependenciesForUITestAutomation(): Promise<void> {\r\n const cmd = 'pushd ' + this.uiTestAutomationLegacyFolderPath + '&& del package-lock.json && npm install && popd';\r\n await runCommand(cmd, this.debug);\r\n }\r\n\r\n private async fixEslintErrors(ignore = false): Promise<void> {\r\n if (ignore) {\r\n return;\r\n }\r\n \r\n const rootFileLinterFix = 'npx eslint . --fix';\r\n Logger.log(rootFileLinterFix);\r\n await runCommand(rootFileLinterFix, this.debug, true, Angular15UpgraderMessages.FinalizeInfoLintFix);\r\n const projectLinterFix = 'npx ng lint --fix';\r\n Logger.log(projectLinterFix);\r\n await runCommand(projectLinterFix, this.debug, true, Angular15UpgraderMessages.FinalizeInfoLintFix);\r\n }\r\n\r\n /**\r\n * electron-to-chromium 1.4.533 - 1.4.535 are bad versions that is also the latest, meaning any dependency uses ^1.4.xxx are also blocked,\r\n * below are the dependency list:\r\n * /@angular-devkit/build-angular@15.2.8 -> browserslist@4.21.5 that has dependency on ^1.4.284(which always grab 1.4.535)\r\n * always force 1.4.532\r\n */\r\n private async installLKGElectronToChromium(): Promise<void> {\r\n const cmd = 'npm install electron-to-chromium@1.4.532 --force';\r\n Logger.log(cmd);\r\n await runCommand(cmd, this.debug);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The class to upgrade the eslint to support 'gulp lintApp --fix'.
3
+ */
4
+ export declare class EslintAutoFixUpgrader {
5
+ private readonly fileName;
6
+ private filePath;
7
+ private fileWriter;
8
+ private messages;
9
+ /**
10
+ * the constructor.
11
+ * @param filePath the file path.
12
+ */
13
+ constructor(filePath: string);
14
+ /**
15
+ * the run function to resolve the errors.
16
+ */
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAa;IAE/B,OAAO,CAAC,QAAQ,CAEd;IAEF;;;OAGG;gBACS,QAAQ,EAAE,MAAM;IAK5B;;OAEG;IACU,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiBpC","file":"eslint-auto-fix-upgrader.d.ts","sourcesContent":["import { pathExists } from 'fs-extra';\r\nimport { Logger } from '../utils/logger';\r\nimport { FileWriter } from '../utils/file-writer';\r\nimport { adds } from '../configs/eslint-auto-fix-config';\r\n\r\n/**\r\n * The class to upgrade the eslint to support 'gulp lintApp --fix'.\r\n */\r\nexport class EslintAutoFixUpgrader {\r\n private readonly fileName = '.eslintrc.json';\r\n private filePath: string;\r\n private fileWriter: FileWriter;\r\n\r\n private messages = {\r\n notFound: ''\r\n };\r\n\r\n /**\r\n * the constructor.\r\n * @param filePath the file path.\r\n */\r\n constructor(filePath: string) {\r\n this.filePath = filePath;\r\n this.messages.notFound = `${this.fileName} not found at ${this.filePath}.`\r\n }\r\n\r\n /**\r\n * the run function to resolve the errors.\r\n */\r\n public async run(): Promise<void> {\r\n try {\r\n const exists = await pathExists(this.filePath);\r\n\r\n if (exists) {\r\n this.fileWriter = new FileWriter(this.filePath);\r\n\r\n this.fileWriter\r\n .addContent(adds)\r\n .writeFile();\r\n } else {\r\n Logger.log(this.messages.notFound);\r\n }\r\n } catch (error) {\r\n Logger.error(error);\r\n }\r\n }\r\n}\r\n"]}