@microsoft/windows-admin-center-sdk 4.52.0 → 4.87.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 (97) hide show
  1. package/angular/esm2020/src/controls/master-view/master-view.component.mjs +8 -6
  2. package/angular/esm2020/src/controls/ux/sme-ux-footer/sme-ux-footer-template/sme-wizard-lite-footer-template/sme-wizard-lite-footer-template.component.mjs +56 -1
  3. package/angular/esm2020/src/service/navigation.service.mjs +3 -1
  4. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.mjs +64 -5
  5. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.mjs.map +1 -1
  6. package/angular/fesm2020/microsoft-windows-admin-center-sdk-angular.mjs +64 -5
  7. package/angular/fesm2020/microsoft-windows-admin-center-sdk-angular.mjs.map +1 -1
  8. package/angular/src/controls/master-view/master-view.component.d.ts +6 -2
  9. package/angular/src/controls/ux/sme-ux-footer/sme-ux-footer-template/sme-wizard-lite-footer-template/sme-wizard-lite-footer-template.component.d.ts +64 -0
  10. package/core/assets/strings/cs-CZ/strings.json +1 -1
  11. package/core/assets/strings/de-DE/strings.json +1 -1
  12. package/core/assets/strings/es-ES/strings.json +1 -1
  13. package/core/assets/strings/fr-FR/strings.json +1 -1
  14. package/core/assets/strings/hu-HU/strings.json +1 -1
  15. package/core/assets/strings/id-ID/strings.json +1 -1
  16. package/core/assets/strings/it-IT/strings.json +1 -1
  17. package/core/assets/strings/ja-JP/strings.json +1 -1
  18. package/core/assets/strings/ko-KR/strings.json +1 -1
  19. package/core/assets/strings/nl-NL/strings.json +1 -1
  20. package/core/assets/strings/pl-PL/strings.json +1 -1
  21. package/core/assets/strings/pt-BR/strings.json +1 -1
  22. package/core/assets/strings/pt-PT/strings.json +1 -1
  23. package/core/assets/strings/ru-RU/strings.json +1 -1
  24. package/core/assets/strings/strings.json +1 -1
  25. package/core/assets/strings/sv-SE/strings.json +1 -1
  26. package/core/assets/strings/tr-TR/strings.json +1 -1
  27. package/core/assets/strings/zh-CN/strings.json +1 -1
  28. package/core/assets/strings/zh-TW/strings.json +1 -1
  29. package/core/azure/azure-constants.d.ts +6 -3
  30. package/core/azure/azure-constants.d.ts.map +1 -1
  31. package/core/azure/azure-constants.js +7 -4
  32. package/core/azure/azure-constants.js.map +1 -1
  33. package/core/azure/models/azureArcStatusEnum.d.ts +4 -2
  34. package/core/azure/models/azureArcStatusEnum.d.ts.map +1 -1
  35. package/core/azure/models/azureArcStatusEnum.js +3 -1
  36. package/core/azure/models/azureArcStatusEnum.js.map +1 -1
  37. package/core/data/gateway-connection.d.ts +12 -0
  38. package/core/data/gateway-connection.d.ts.map +1 -1
  39. package/core/data/gateway-connection.js +16 -0
  40. package/core/data/gateway-connection.js.map +1 -1
  41. package/core/data/gateway-url-translator.d.ts +1 -0
  42. package/core/data/gateway-url-translator.d.ts.map +1 -1
  43. package/core/data/gateway-url-translator.js +15 -0
  44. package/core/data/gateway-url-translator.js.map +1 -1
  45. package/core/data/net.d.ts +1 -0
  46. package/core/data/net.d.ts.map +1 -1
  47. package/core/data/net.js +26 -1
  48. package/core/data/net.js.map +1 -1
  49. package/core/data/websocket-stream.d.ts.map +1 -1
  50. package/core/data/websocket-stream.js +2 -2
  51. package/core/data/websocket-stream.js.map +1 -1
  52. package/core/generated/strings.d.ts +3 -0
  53. package/core/generated/strings.d.ts.map +1 -1
  54. package/core/generated/strings.js.map +1 -1
  55. package/core/notification/notification.d.ts.map +1 -1
  56. package/core/notification/notification.js +1 -3
  57. package/core/notification/notification.js.map +1 -1
  58. package/core/shared/server-inventory/server-inventory-cache.d.ts.map +1 -1
  59. package/core/shared/server-inventory/server-inventory-cache.js +0 -1
  60. package/core/shared/server-inventory/server-inventory-cache.js.map +1 -1
  61. package/package.json +3 -3
  62. package/styles/css/main-v2.css +1 -1
  63. package/tools/wac-cli/src/angular15/configs/ui-test-automation-lagacy-config.d.ts +14 -0
  64. package/tools/wac-cli/src/angular15/configs/ui-test-automation-lagacy-config.d.ts.map +1 -0
  65. package/tools/wac-cli/src/angular15/configs/ui-test-automation-lagacy-config.js +21 -0
  66. package/tools/wac-cli/src/angular15/configs/ui-test-automation-lagacy-config.js.map +1 -0
  67. package/tools/wac-cli/src/angular15/main.d.ts +32 -2
  68. package/tools/wac-cli/src/angular15/main.d.ts.map +1 -1
  69. package/tools/wac-cli/src/angular15/main.js +66 -6
  70. package/tools/wac-cli/src/angular15/main.js.map +1 -1
  71. package/tools/wac-cli/src/angular15/test/ui-test-automation-package.json/after.json +14 -0
  72. package/tools/wac-cli/src/angular15/test/ui-test-automation-package.json/before.json +13 -0
  73. package/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.d.ts +15 -0
  74. package/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.d.ts.map +1 -0
  75. package/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.js +48 -0
  76. package/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.js.map +1 -0
  77. package/tools/wac-cli/src/angular15/utils/main-debugger.d.ts.map +1 -1
  78. package/tools/wac-cli/src/angular15/utils/main-debugger.js +3 -0
  79. package/tools/wac-cli/src/angular15/utils/main-debugger.js.map +1 -1
  80. package/tools/wac-cli/src/angular15/utils/update-shell-references.d.ts +2 -0
  81. package/tools/wac-cli/src/angular15/utils/update-shell-references.d.ts.map +1 -0
  82. package/tools/wac-cli/src/angular15/utils/update-shell-references.js +69 -0
  83. package/tools/wac-cli/src/angular15/utils/update-shell-references.js.map +1 -0
  84. package/tools/wac-cli/src/common.d.ts +6 -0
  85. package/tools/wac-cli/src/common.d.ts.map +1 -1
  86. package/tools/wac-cli/src/common.js +13 -0
  87. package/tools/wac-cli/src/common.js.map +1 -1
  88. package/tools/wac-cli/src/create/main.d.ts.map +1 -1
  89. package/tools/wac-cli/src/create/main.js +3 -51
  90. package/tools/wac-cli/src/create/main.js.map +1 -1
  91. package/tools/wac-cli/src/eslint/main.d.ts +5 -1
  92. package/tools/wac-cli/src/eslint/main.d.ts.map +1 -1
  93. package/tools/wac-cli/src/eslint/main.js +17 -2
  94. package/tools/wac-cli/src/eslint/main.js.map +1 -1
  95. package/tools/wac-cli/src/index.d.ts.map +1 -1
  96. package/tools/wac-cli/src/index.js +2 -2
  97. package/tools/wac-cli/src/index.js.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.ts"],"names":[],"mappings":"AAKA,qBAAa,8BAA8B;IACvC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAa;IAE/B,OAAO,CAAC,QAAQ,CAEd;IAEF;;;;OAIG;gBACS,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAK/C;;OAEG;IACU,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmBpC","file":"ui-test-automation-legacy-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, replaces } from '../configs/ui-test-automation-lagacy-config';\r\n\r\nexport class UITestAutomationLegacyUpgrader {\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 * @param fileName the file name.\r\n */\r\n constructor(filePath: string, fileName?: string) {\r\n this.filePath = filePath;\r\n this.messages.notFound = `${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 Logger.log(this.filePath);\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 .replaceContent(replaces)\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"]}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UITestAutomationLegacyUpgrader = void 0;
4
+ const fs_extra_1 = require("fs-extra");
5
+ const logger_1 = require("../utils/logger");
6
+ const file_writer_1 = require("../utils/file-writer");
7
+ const ui_test_automation_lagacy_config_1 = require("../configs/ui-test-automation-lagacy-config");
8
+ class UITestAutomationLegacyUpgrader {
9
+ filePath;
10
+ fileWriter;
11
+ messages = {
12
+ notFound: ''
13
+ };
14
+ /**
15
+ * the constructor.
16
+ * @param filePath the file path.
17
+ * @param fileName the file name.
18
+ */
19
+ constructor(filePath, fileName) {
20
+ this.filePath = filePath;
21
+ this.messages.notFound = `${fileName} not found at ${this.filePath}.`;
22
+ }
23
+ /**
24
+ * the run function to resolve the errors.
25
+ */
26
+ async run() {
27
+ try {
28
+ logger_1.Logger.log(this.filePath);
29
+ const exists = await (0, fs_extra_1.pathExists)(this.filePath);
30
+ if (exists) {
31
+ this.fileWriter = new file_writer_1.FileWriter(this.filePath);
32
+ this.fileWriter
33
+ .replaceContent(ui_test_automation_lagacy_config_1.replaces)
34
+ .addContent(ui_test_automation_lagacy_config_1.adds)
35
+ .writeFile();
36
+ }
37
+ else {
38
+ logger_1.Logger.log(this.messages.notFound);
39
+ }
40
+ }
41
+ catch (error) {
42
+ logger_1.Logger.error(error);
43
+ }
44
+ }
45
+ }
46
+ exports.UITestAutomationLegacyUpgrader = UITestAutomationLegacyUpgrader;
47
+
48
+ //# sourceMappingURL=ui-test-automation-legacy-upgrader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AACtC,4CAAyC;AACzC,sDAAkD;AAClD,kGAA6E;AAE7E,MAAa,8BAA8B;IAC/B,QAAQ,CAAS;IACjB,UAAU,CAAa;IAEvB,QAAQ,GAAG;QACf,QAAQ,EAAE,EAAE;KACf,CAAC;IAEF;;;;OAIG;IACH,YAAY,QAAgB,EAAE,QAAiB;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,GAAG,QAAQ,iBAAiB,IAAI,CAAC,QAAQ,GAAG,CAAA;IACzE,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,GAAG;QACZ,IAAI;YACA,eAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1B,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAE/C,IAAI,MAAM,EAAE;gBACR,IAAI,CAAC,UAAU,GAAG,IAAI,wBAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAEhD,IAAI,CAAC,UAAU;qBACV,cAAc,CAAC,2CAAQ,CAAC;qBACxB,UAAU,CAAC,uCAAI,CAAC;qBAChB,SAAS,EAAE,CAAC;aACpB;iBAAM;gBACC,eAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;aAC1C;SACJ;QAAC,OAAO,KAAK,EAAE;YACZ,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACvB;IACL,CAAC;CACJ;AAxCD,wEAwCC","file":"ui-test-automation-legacy-upgrader.js","sourcesContent":["import { pathExists } from 'fs-extra';\r\nimport { Logger } from '../utils/logger';\r\nimport { FileWriter } from '../utils/file-writer';\r\nimport { adds, replaces } from '../configs/ui-test-automation-lagacy-config';\r\n\r\nexport class UITestAutomationLegacyUpgrader {\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 * @param fileName the file name.\r\n */\r\n constructor(filePath: string, fileName?: string) {\r\n this.filePath = filePath;\r\n this.messages.notFound = `${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 Logger.log(this.filePath);\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 .replaceContent(replaces)\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"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/utils/main-debugger.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,qBAAa,YAAY;IACrB;;;OAGG;IACI,cAAc,CAAC,KAAK,EAAE,GAAG;IA8BhC;;;OAGG;IACU,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtD;;OAEG;YACW,eAAe;CAKhC","file":"main-debugger.d.ts","sourcesContent":["import assert from \"assert\";\r\nimport { fileComparison } from \"./file-comparison\";\r\nimport { Logger } from \"./logger\";\r\nimport { runCommand } from \"./command-runner\";\r\n\r\n/**\r\n * the main debugger test.\r\n */\r\nexport class MainDebugger {\r\n /**\r\n * the main debugger test to update test data.\r\n * @param input the input.\r\n */\r\n public updateTestData(input: any) {\r\n input.packageJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\package.json\\\\before.json';\r\n input.packageJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\package.json\\\\after.json';\r\n input.versionJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\version.json\\\\before.json';\r\n input.versionJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\version.json\\\\after.json';\r\n input.tsconfigBaseFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.base.json\\\\before.json';\r\n input.tsconfigBaseFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.base.json\\\\after.json';\r\n input.tsconfigFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.json\\\\before.json';\r\n input.tsconfigFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.json\\\\after.json';\r\n input.gitIgnoreFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gitignore\\\\before';\r\n input.gitIngoreFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gitignore\\\\after';\r\n input.angularJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\angular.json\\\\before.json';\r\n input.angularJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\angular.json\\\\after.json';\r\n input.cIBuildYmlFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ci-build.yml\\\\before.yml';\r\n input.cIBuildYmlFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ci-build.yml\\\\after.yml';\r\n input.pullRequestYmlFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\pull-request.yml\\\\before.yml';\r\n input.pullRequestYmlFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\pull-request.yml\\\\after.yml';\r\n input.srcTsConfigLibProdFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.lib.prod.json\\\\before.json';\r\n input.srcTsConfigLibProdFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.lib.prod.json\\\\after.json';\r\n input.srcTsConfigSpecFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.spec.json\\\\before.json';\r\n input.srcTsConfigSpecFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.spec.json\\\\after.json';\r\n input.testTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\test.ts\\\\before.ts';\r\n input.testTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\test.ts\\\\after.ts';\r\n input.gulpCompileTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpfiles\\\\compile.ts';\r\n input.gulpCompileTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\module-template\\\\angular15\\\\gulpfile.ts\\\\common\\\\compile.ts';\r\n input.gulpIndexTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpfiles\\\\index.ts';\r\n input.gulpIndexTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\module-template\\\\angular15\\\\gulpfile.ts\\\\index.ts';\r\n input.logFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpbuild\\\\log3.txt';\r\n }\r\n\r\n /**\r\n * the main debugger test to verify test data.\r\n * @param input the input.\r\n */\r\n public async verifyTestData(input: any): Promise<void> {\r\n assert(fileComparison(input.packageJsonFilePath, input.packageJsonFilePathAfter));\r\n assert(fileComparison(input.versionJsonFilePath, input.versionJsonFilePathAfter));\r\n assert(fileComparison(input.tsconfigBaseFilePath, input.tsconfigBaseFilePathAfter));\r\n assert(fileComparison(input.tsconfigFilePath, input.tsconfigFilePathAfter));\r\n assert(fileComparison(input.gitIgnoreFilePath, input.gitIngoreFilePathAfter));\r\n assert(fileComparison(input.angularJsonFilePath, input.angularJsonFilePathAfter));\r\n assert(fileComparison(input.testTsFilePath, input.testTsFilePathAfter));\r\n assert(fileComparison(input.cIBuildYmlFilePath, input.cIBuildYmlFilePathAfter));\r\n assert(fileComparison(input.pullRequestYmlFilePath, input.pullRequestYmlFilePathAfter));\r\n assert(fileComparison(input.srcTsConfigLibProdFilePath, input.srcTsConfigLibProdFilePathAfter));\r\n assert(fileComparison(input.srcTsConfigSpecFilePath, input.srcTsConfigSpecFilePathAfter));\r\n assert(fileComparison(input.gulpCompileTsFilePath, input.gulpCompileTsFilePathAfter));\r\n assert(fileComparison(input.gulpIndexTsFilePath, input.gulpIndexTsFilePathAfter));\r\n\r\n await this.cleanUpTestData();\r\n }\r\n\r\n /**\r\n * the main debugger test to clean up test data.\r\n */\r\n private async cleanUpTestData(): Promise<void> {\r\n const cmd = 'git checkout packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test';\r\n Logger.log(cmd);\r\n await runCommand(cmd);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/utils/main-debugger.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,qBAAa,YAAY;IACrB;;;OAGG;IACI,cAAc,CAAC,KAAK,EAAE,GAAG;IAgChC;;;OAGG;IACU,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBtD;;OAEG;YACW,eAAe;CAKhC","file":"main-debugger.d.ts","sourcesContent":["import assert from \"assert\";\r\nimport { fileComparison } from \"./file-comparison\";\r\nimport { Logger } from \"./logger\";\r\nimport { runCommand } from \"./command-runner\";\r\n\r\n/**\r\n * the main debugger test.\r\n */\r\nexport class MainDebugger {\r\n /**\r\n * the main debugger test to update test data.\r\n * @param input the input.\r\n */\r\n public updateTestData(input: any) {\r\n input.packageJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\package.json\\\\before.json';\r\n input.packageJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\package.json\\\\after.json';\r\n input.versionJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\version.json\\\\before.json';\r\n input.versionJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\version.json\\\\after.json';\r\n input.tsconfigBaseFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.base.json\\\\before.json';\r\n input.tsconfigBaseFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.base.json\\\\after.json';\r\n input.tsconfigFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.json\\\\before.json';\r\n input.tsconfigFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.json\\\\after.json';\r\n input.gitIgnoreFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gitignore\\\\before';\r\n input.gitIngoreFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gitignore\\\\after';\r\n input.angularJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\angular.json\\\\before.json';\r\n input.angularJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\angular.json\\\\after.json';\r\n input.cIBuildYmlFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ci-build.yml\\\\before.yml';\r\n input.cIBuildYmlFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ci-build.yml\\\\after.yml';\r\n input.pullRequestYmlFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\pull-request.yml\\\\before.yml';\r\n input.pullRequestYmlFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\pull-request.yml\\\\after.yml';\r\n input.srcTsConfigLibProdFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.lib.prod.json\\\\before.json';\r\n input.srcTsConfigLibProdFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.lib.prod.json\\\\after.json';\r\n input.srcTsConfigSpecFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.spec.json\\\\before.json';\r\n input.srcTsConfigSpecFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.spec.json\\\\after.json';\r\n input.testTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\test.ts\\\\before.ts';\r\n input.testTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\test.ts\\\\after.ts';\r\n input.gulpCompileTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpfiles\\\\compile.ts';\r\n input.gulpCompileTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\module-template\\\\angular15\\\\gulpfile.ts\\\\common\\\\compile.ts';\r\n input.gulpIndexTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpfiles\\\\index.ts';\r\n input.gulpIndexTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\module-template\\\\angular15\\\\gulpfile.ts\\\\index.ts';\r\n input.uiTestAutomationLegacyFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ui-test-automation-package.json\\\\before.json';\r\n input.uiTestAutomationLegacyFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ui-test-automation-package.json\\\\after.json';\r\n input.logFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpbuild\\\\log3.txt';\r\n }\r\n\r\n /**\r\n * the main debugger test to verify test data.\r\n * @param input the input.\r\n */\r\n public async verifyTestData(input: any): Promise<void> {\r\n assert(fileComparison(input.packageJsonFilePath, input.packageJsonFilePathAfter));\r\n assert(fileComparison(input.versionJsonFilePath, input.versionJsonFilePathAfter));\r\n assert(fileComparison(input.tsconfigBaseFilePath, input.tsconfigBaseFilePathAfter));\r\n assert(fileComparison(input.tsconfigFilePath, input.tsconfigFilePathAfter));\r\n assert(fileComparison(input.gitIgnoreFilePath, input.gitIngoreFilePathAfter));\r\n assert(fileComparison(input.angularJsonFilePath, input.angularJsonFilePathAfter));\r\n assert(fileComparison(input.testTsFilePath, input.testTsFilePathAfter));\r\n assert(fileComparison(input.cIBuildYmlFilePath, input.cIBuildYmlFilePathAfter));\r\n assert(fileComparison(input.pullRequestYmlFilePath, input.pullRequestYmlFilePathAfter));\r\n assert(fileComparison(input.srcTsConfigLibProdFilePath, input.srcTsConfigLibProdFilePathAfter));\r\n assert(fileComparison(input.srcTsConfigSpecFilePath, input.srcTsConfigSpecFilePathAfter));\r\n assert(fileComparison(input.gulpCompileTsFilePath, input.gulpCompileTsFilePathAfter));\r\n assert(fileComparison(input.gulpIndexTsFilePath, input.gulpIndexTsFilePathAfter));\r\n assert(fileComparison(input.uiTestAutomationLegacyFilePath, input.uiTestAutomationLegacyFilePathAfter));\r\n\r\n await this.cleanUpTestData();\r\n }\r\n\r\n /**\r\n * the main debugger test to clean up test data.\r\n */\r\n private async cleanUpTestData(): Promise<void> {\r\n const cmd = 'git checkout packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test';\r\n Logger.log(cmd);\r\n await runCommand(cmd);\r\n }\r\n}\r\n"]}
@@ -41,6 +41,8 @@ class MainDebugger {
41
41
  input.gulpCompileTsFilePathAfter = 'C:\\Branches\\shell2\\msft-sme-shell\\packages\\tools\\module-template\\angular15\\gulpfile.ts\\common\\compile.ts';
42
42
  input.gulpIndexTsFilePath = 'C:\\Branches\\shell2\\msft-sme-shell\\packages\\tools\\wac-cli\\src\\angular15\\test\\gulpfiles\\index.ts';
43
43
  input.gulpIndexTsFilePathAfter = 'C:\\Branches\\shell2\\msft-sme-shell\\packages\\tools\\module-template\\angular15\\gulpfile.ts\\index.ts';
44
+ input.uiTestAutomationLegacyFilePath = 'C:\\Branches\\shell2\\msft-sme-shell\\packages\\tools\\wac-cli\\src\\angular15\\test\\ui-test-automation-package.json\\before.json';
45
+ input.uiTestAutomationLegacyFilePathAfter = 'C:\\Branches\\shell2\\msft-sme-shell\\packages\\tools\\wac-cli\\src\\angular15\\test\\ui-test-automation-package.json\\after.json';
44
46
  input.logFilePath = 'C:\\Branches\\shell2\\msft-sme-shell\\packages\\tools\\wac-cli\\src\\angular15\\test\\gulpbuild\\log3.txt';
45
47
  }
46
48
  /**
@@ -61,6 +63,7 @@ class MainDebugger {
61
63
  (0, assert_1.default)((0, file_comparison_1.fileComparison)(input.srcTsConfigSpecFilePath, input.srcTsConfigSpecFilePathAfter));
62
64
  (0, assert_1.default)((0, file_comparison_1.fileComparison)(input.gulpCompileTsFilePath, input.gulpCompileTsFilePathAfter));
63
65
  (0, assert_1.default)((0, file_comparison_1.fileComparison)(input.gulpIndexTsFilePath, input.gulpIndexTsFilePathAfter));
66
+ (0, assert_1.default)((0, file_comparison_1.fileComparison)(input.uiTestAutomationLegacyFilePath, input.uiTestAutomationLegacyFilePathAfter));
64
67
  await this.cleanUpTestData();
65
68
  }
66
69
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/utils/main-debugger.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,uDAAmD;AACnD,qCAAkC;AAClC,qDAA8C;AAE9C;;GAEG;AACH,MAAa,YAAY;IACrB;;;OAGG;IACI,cAAc,CAAC,KAAU;QAC5B,KAAK,CAAC,mBAAmB,GAAG,iHAAiH,CAAC;QAC9I,KAAK,CAAC,wBAAwB,GAAG,gHAAgH,CAAC;QAClJ,KAAK,CAAC,mBAAmB,GAAG,iHAAiH,CAAC;QAC9I,KAAK,CAAC,wBAAwB,GAAG,gHAAgH,CAAC;QAClJ,KAAK,CAAC,oBAAoB,GAAG,uHAAuH,CAAC;QACrJ,KAAK,CAAC,yBAAyB,GAAG,sHAAsH,CAAC;QACzJ,KAAK,CAAC,gBAAgB,GAAG,kHAAkH,CAAC;QAC5I,KAAK,CAAC,qBAAqB,GAAG,iHAAiH,CAAC;QAChJ,KAAK,CAAC,iBAAiB,GAAG,yGAAyG,CAAC;QACpI,KAAK,CAAC,sBAAsB,GAA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AC,GAAG,CAAC,CAAC;QAChB,MAAM,IAAA,2BAAU,EAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACJ;AAjED,oCAiEC","file":"main-debugger.js","sourcesContent":["import assert from \"assert\";\r\nimport { fileComparison } from \"./file-comparison\";\r\nimport { Logger } from \"./logger\";\r\nimport { runCommand } from \"./command-runner\";\r\n\r\n/**\r\n * the main debugger test.\r\n */\r\nexport class MainDebugger {\r\n /**\r\n * the main debugger test to update test data.\r\n * @param input the input.\r\n */\r\n public updateTestData(input: any) {\r\n input.packageJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\package.json\\\\before.json';\r\n input.packageJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\package.json\\\\after.json';\r\n input.versionJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\version.json\\\\before.json';\r\n input.versionJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\version.json\\\\after.json';\r\n input.tsconfigBaseFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.base.json\\\\before.json';\r\n input.tsconfigBaseFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.base.json\\\\after.json';\r\n input.tsconfigFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.json\\\\before.json';\r\n input.tsconfigFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.json\\\\after.json';\r\n input.gitIgnoreFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gitignore\\\\before';\r\n input.gitIngoreFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gitignore\\\\after';\r\n input.angularJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\angular.json\\\\before.json';\r\n input.angularJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\angular.json\\\\after.json';\r\n input.cIBuildYmlFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ci-build.yml\\\\before.yml';\r\n input.cIBuildYmlFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ci-build.yml\\\\after.yml';\r\n input.pullRequestYmlFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\pull-request.yml\\\\before.yml';\r\n input.pullRequestYmlFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\pull-request.yml\\\\after.yml';\r\n input.srcTsConfigLibProdFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.lib.prod.json\\\\before.json';\r\n input.srcTsConfigLibProdFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.lib.prod.json\\\\after.json';\r\n input.srcTsConfigSpecFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.spec.json\\\\before.json';\r\n input.srcTsConfigSpecFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.spec.json\\\\after.json';\r\n input.testTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\test.ts\\\\before.ts';\r\n input.testTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\test.ts\\\\after.ts';\r\n input.gulpCompileTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpfiles\\\\compile.ts';\r\n input.gulpCompileTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\module-template\\\\angular15\\\\gulpfile.ts\\\\common\\\\compile.ts';\r\n input.gulpIndexTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpfiles\\\\index.ts';\r\n input.gulpIndexTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\module-template\\\\angular15\\\\gulpfile.ts\\\\index.ts';\r\n input.logFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpbuild\\\\log3.txt';\r\n }\r\n\r\n /**\r\n * the main debugger test to verify test data.\r\n * @param input the input.\r\n */\r\n public async verifyTestData(input: any): Promise<void> {\r\n assert(fileComparison(input.packageJsonFilePath, input.packageJsonFilePathAfter));\r\n assert(fileComparison(input.versionJsonFilePath, input.versionJsonFilePathAfter));\r\n assert(fileComparison(input.tsconfigBaseFilePath, input.tsconfigBaseFilePathAfter));\r\n assert(fileComparison(input.tsconfigFilePath, input.tsconfigFilePathAfter));\r\n assert(fileComparison(input.gitIgnoreFilePath, input.gitIngoreFilePathAfter));\r\n assert(fileComparison(input.angularJsonFilePath, input.angularJsonFilePathAfter));\r\n assert(fileComparison(input.testTsFilePath, input.testTsFilePathAfter));\r\n assert(fileComparison(input.cIBuildYmlFilePath, input.cIBuildYmlFilePathAfter));\r\n assert(fileComparison(input.pullRequestYmlFilePath, input.pullRequestYmlFilePathAfter));\r\n assert(fileComparison(input.srcTsConfigLibProdFilePath, input.srcTsConfigLibProdFilePathAfter));\r\n assert(fileComparison(input.srcTsConfigSpecFilePath, input.srcTsConfigSpecFilePathAfter));\r\n assert(fileComparison(input.gulpCompileTsFilePath, input.gulpCompileTsFilePathAfter));\r\n assert(fileComparison(input.gulpIndexTsFilePath, input.gulpIndexTsFilePathAfter));\r\n\r\n await this.cleanUpTestData();\r\n }\r\n\r\n /**\r\n * the main debugger test to clean up test data.\r\n */\r\n private async cleanUpTestData(): Promise<void> {\r\n const cmd = 'git checkout packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test';\r\n Logger.log(cmd);\r\n await runCommand(cmd);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/utils/main-debugger.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,uDAAmD;AACnD,qCAAkC;AAClC,qDAA8C;AAE9C;;GAEG;AACH,MAAa,YAAY;IACrB;;;OAGG;IACI,c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EAAC,IAAA,gCAAc,EAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC;QAChG,IAAA,gBAAM,EAAC,IAAA,gCAAc,EAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC;QAC1F,IAAA,gBAAM,EAAC,IAAA,gCAAc,EAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;QACtF,IAAA,gBAAM,EAAC,IAAA,gCAAc,EAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC;QAClF,IAAA,gBAAM,EAAC,IAAA,gCAAc,EAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,mCAAmC,CAAC,CAAC,CAAC;QAExG,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,eAAe;QACzB,MAAM,GAAG,GAAG,6DAA6D,CAAC;QAC1E,eAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,MAAM,IAAA,2BAAU,EAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACJ;AApED,oCAoEC","file":"main-debugger.js","sourcesContent":["import assert from \"assert\";\r\nimport { fileComparison } from \"./file-comparison\";\r\nimport { Logger } from \"./logger\";\r\nimport { runCommand } from \"./command-runner\";\r\n\r\n/**\r\n * the main debugger test.\r\n */\r\nexport class MainDebugger {\r\n /**\r\n * the main debugger test to update test data.\r\n * @param input the input.\r\n */\r\n public updateTestData(input: any) {\r\n input.packageJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\package.json\\\\before.json';\r\n input.packageJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\package.json\\\\after.json';\r\n input.versionJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\version.json\\\\before.json';\r\n input.versionJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\version.json\\\\after.json';\r\n input.tsconfigBaseFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.base.json\\\\before.json';\r\n input.tsconfigBaseFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.base.json\\\\after.json';\r\n input.tsconfigFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.json\\\\before.json';\r\n input.tsconfigFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.json\\\\after.json';\r\n input.gitIgnoreFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gitignore\\\\before';\r\n input.gitIngoreFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gitignore\\\\after';\r\n input.angularJsonFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\angular.json\\\\before.json';\r\n input.angularJsonFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\angular.json\\\\after.json';\r\n input.cIBuildYmlFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ci-build.yml\\\\before.yml';\r\n input.cIBuildYmlFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ci-build.yml\\\\after.yml';\r\n input.pullRequestYmlFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\pull-request.yml\\\\before.yml';\r\n input.pullRequestYmlFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\pull-request.yml\\\\after.yml';\r\n input.srcTsConfigLibProdFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.lib.prod.json\\\\before.json';\r\n input.srcTsConfigLibProdFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.lib.prod.json\\\\after.json';\r\n input.srcTsConfigSpecFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.spec.json\\\\before.json';\r\n input.srcTsConfigSpecFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\tsconfig.spec.json\\\\after.json';\r\n input.testTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\test.ts\\\\before.ts';\r\n input.testTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\test.ts\\\\after.ts';\r\n input.gulpCompileTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpfiles\\\\compile.ts';\r\n input.gulpCompileTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\module-template\\\\angular15\\\\gulpfile.ts\\\\common\\\\compile.ts';\r\n input.gulpIndexTsFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpfiles\\\\index.ts';\r\n input.gulpIndexTsFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\module-template\\\\angular15\\\\gulpfile.ts\\\\index.ts';\r\n input.uiTestAutomationLegacyFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ui-test-automation-package.json\\\\before.json';\r\n input.uiTestAutomationLegacyFilePathAfter = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\ui-test-automation-package.json\\\\after.json';\r\n input.logFilePath = 'C:\\\\Branches\\\\shell2\\\\msft-sme-shell\\\\packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test\\\\gulpbuild\\\\log3.txt';\r\n }\r\n\r\n /**\r\n * the main debugger test to verify test data.\r\n * @param input the input.\r\n */\r\n public async verifyTestData(input: any): Promise<void> {\r\n assert(fileComparison(input.packageJsonFilePath, input.packageJsonFilePathAfter));\r\n assert(fileComparison(input.versionJsonFilePath, input.versionJsonFilePathAfter));\r\n assert(fileComparison(input.tsconfigBaseFilePath, input.tsconfigBaseFilePathAfter));\r\n assert(fileComparison(input.tsconfigFilePath, input.tsconfigFilePathAfter));\r\n assert(fileComparison(input.gitIgnoreFilePath, input.gitIngoreFilePathAfter));\r\n assert(fileComparison(input.angularJsonFilePath, input.angularJsonFilePathAfter));\r\n assert(fileComparison(input.testTsFilePath, input.testTsFilePathAfter));\r\n assert(fileComparison(input.cIBuildYmlFilePath, input.cIBuildYmlFilePathAfter));\r\n assert(fileComparison(input.pullRequestYmlFilePath, input.pullRequestYmlFilePathAfter));\r\n assert(fileComparison(input.srcTsConfigLibProdFilePath, input.srcTsConfigLibProdFilePathAfter));\r\n assert(fileComparison(input.srcTsConfigSpecFilePath, input.srcTsConfigSpecFilePathAfter));\r\n assert(fileComparison(input.gulpCompileTsFilePath, input.gulpCompileTsFilePathAfter));\r\n assert(fileComparison(input.gulpIndexTsFilePath, input.gulpIndexTsFilePathAfter));\r\n assert(fileComparison(input.uiTestAutomationLegacyFilePath, input.uiTestAutomationLegacyFilePathAfter));\r\n\r\n await this.cleanUpTestData();\r\n }\r\n\r\n /**\r\n * the main debugger test to clean up test data.\r\n */\r\n private async cleanUpTestData(): Promise<void> {\r\n const cmd = 'git checkout packages\\\\tools\\\\wac-cli\\\\src\\\\angular15\\\\test';\r\n Logger.log(cmd);\r\n await runCommand(cmd);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function updateShellReferences(primaryDisplayName: string, internal: boolean): void;
2
+ export declare function cleanFile(key: string, values: any): void;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/utils/update-shell-references.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CA+CzF;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAiBxD","file":"update-shell-references.d.ts","sourcesContent":["import fse from 'fs-extra';\r\nimport { Logger } from \"./logger\";\r\n\r\nexport function updateShellReferences(primaryDisplayName: string, internal: boolean): void {\r\n Logger.log('Updating shell references...');\r\n Logger.log('Detected internal: ' + internal);\r\n const internalShellReference = '@msft-sme';\r\n const externalShellReference = '@microsoft/windows-admin-center-sdk';\r\n const find = internal ? externalShellReference : internalShellReference;\r\n const replace = internal ? internalShellReference : externalShellReference;\r\n\r\n // For performance reasons, all applicable files are listed here, rather than scanning all files\r\n const extensionDirectory = ('./' + primaryDisplayName + '/').replace('//', '/');\r\n const extensionSrcDirectory = extensionDirectory + 'src/';\r\n const extensionAppDirectory = extensionSrcDirectory + 'app/';\r\n const gulpFileDirectory = extensionDirectory + 'gulpfile.ts/';\r\n const gulpFileCommonDirectory = gulpFileDirectory + 'common/';\r\n\r\n const filesWithShellReferences = [\r\n extensionDirectory + 'angular.json',\r\n gulpFileDirectory + 'config-data.ts',\r\n gulpFileDirectory + 'index.ts',\r\n gulpFileCommonDirectory + 'pack.ts',\r\n gulpFileCommonDirectory + 'powershell.ts',\r\n gulpFileCommonDirectory + 'resjson.ts',\r\n gulpFileCommonDirectory + 'test.ts',\r\n gulpFileCommonDirectory + 'validate.ts',\r\n extensionSrcDirectory + 'main.ts',\r\n extensionSrcDirectory + 'manifest.json',\r\n extensionSrcDirectory + 'polyfills.ts',\r\n extensionSrcDirectory + 'test.ts',\r\n extensionAppDirectory + 'app-routing.module.ts',\r\n extensionAppDirectory + 'app.component.ts',\r\n extensionAppDirectory + 'app.module.ts',\r\n extensionDirectory + '.eslintrc.json'\r\n ];\r\n\r\n const cleanFiles = {};\r\n\r\n filesWithShellReferences.forEach((file) => {\r\n cleanFiles[file] = {\r\n [find]: replace\r\n };\r\n });\r\n\r\n for (const key in cleanFiles) {\r\n if (Object.prototype.hasOwnProperty.call(cleanFiles, key)) {\r\n cleanFile(key, cleanFiles[key]);\r\n }\r\n }\r\n}\r\n\r\nexport function cleanFile(key: string, values: any): void {\r\n Logger.log('Updating: ' + key + ' ' + JSON.stringify(values));\r\n for (const valuesKey in values) {\r\n let a = 0;\r\n if (Object.prototype.hasOwnProperty.call(values, valuesKey)) {\r\n let fileData = fse.readFileSync(key, 'utf8');\r\n let displayNameIndex = fileData.indexOf(valuesKey);\r\n\r\n while (displayNameIndex > 0) {\r\n Logger.log('Found key: ' + valuesKey + ' at index: ' + displayNameIndex);\r\n fileData = fileData.replace(valuesKey, values[valuesKey]);\r\n displayNameIndex = fileData.indexOf(valuesKey);\r\n }\r\n\r\n fse.outputFileSync(key, fileData);\r\n }\r\n }\r\n}"]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cleanFile = exports.updateShellReferences = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
6
+ const logger_1 = require("./logger");
7
+ function updateShellReferences(primaryDisplayName, internal) {
8
+ logger_1.Logger.log('Updating shell references...');
9
+ logger_1.Logger.log('Detected internal: ' + internal);
10
+ const internalShellReference = '@msft-sme';
11
+ const externalShellReference = '@microsoft/windows-admin-center-sdk';
12
+ const find = internal ? externalShellReference : internalShellReference;
13
+ const replace = internal ? internalShellReference : externalShellReference;
14
+ // For performance reasons, all applicable files are listed here, rather than scanning all files
15
+ const extensionDirectory = ('./' + primaryDisplayName + '/').replace('//', '/');
16
+ const extensionSrcDirectory = extensionDirectory + 'src/';
17
+ const extensionAppDirectory = extensionSrcDirectory + 'app/';
18
+ const gulpFileDirectory = extensionDirectory + 'gulpfile.ts/';
19
+ const gulpFileCommonDirectory = gulpFileDirectory + 'common/';
20
+ const filesWithShellReferences = [
21
+ extensionDirectory + 'angular.json',
22
+ gulpFileDirectory + 'config-data.ts',
23
+ gulpFileDirectory + 'index.ts',
24
+ gulpFileCommonDirectory + 'pack.ts',
25
+ gulpFileCommonDirectory + 'powershell.ts',
26
+ gulpFileCommonDirectory + 'resjson.ts',
27
+ gulpFileCommonDirectory + 'test.ts',
28
+ gulpFileCommonDirectory + 'validate.ts',
29
+ extensionSrcDirectory + 'main.ts',
30
+ extensionSrcDirectory + 'manifest.json',
31
+ extensionSrcDirectory + 'polyfills.ts',
32
+ extensionSrcDirectory + 'test.ts',
33
+ extensionAppDirectory + 'app-routing.module.ts',
34
+ extensionAppDirectory + 'app.component.ts',
35
+ extensionAppDirectory + 'app.module.ts',
36
+ extensionDirectory + '.eslintrc.json'
37
+ ];
38
+ const cleanFiles = {};
39
+ filesWithShellReferences.forEach((file) => {
40
+ cleanFiles[file] = {
41
+ [find]: replace
42
+ };
43
+ });
44
+ for (const key in cleanFiles) {
45
+ if (Object.prototype.hasOwnProperty.call(cleanFiles, key)) {
46
+ cleanFile(key, cleanFiles[key]);
47
+ }
48
+ }
49
+ }
50
+ exports.updateShellReferences = updateShellReferences;
51
+ function cleanFile(key, values) {
52
+ logger_1.Logger.log('Updating: ' + key + ' ' + JSON.stringify(values));
53
+ for (const valuesKey in values) {
54
+ let a = 0;
55
+ if (Object.prototype.hasOwnProperty.call(values, valuesKey)) {
56
+ let fileData = fs_extra_1.default.readFileSync(key, 'utf8');
57
+ let displayNameIndex = fileData.indexOf(valuesKey);
58
+ while (displayNameIndex > 0) {
59
+ logger_1.Logger.log('Found key: ' + valuesKey + ' at index: ' + displayNameIndex);
60
+ fileData = fileData.replace(valuesKey, values[valuesKey]);
61
+ displayNameIndex = fileData.indexOf(valuesKey);
62
+ }
63
+ fs_extra_1.default.outputFileSync(key, fileData);
64
+ }
65
+ }
66
+ }
67
+ exports.cleanFile = cleanFile;
68
+
69
+ //# sourceMappingURL=update-shell-references.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/utils/update-shell-references.ts"],"names":[],"mappings":";;;;AAAA,gEAA2B;AAC3B,qCAAkC;AAElC,SAAgB,qBAAqB,CAAC,kBAA0B,EAAE,QAAiB;IAC/E,eAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,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BAiBC","file":"update-shell-references.js","sourcesContent":["import fse from 'fs-extra';\r\nimport { Logger } from \"./logger\";\r\n\r\nexport function updateShellReferences(primaryDisplayName: string, internal: boolean): void {\r\n Logger.log('Updating shell references...');\r\n Logger.log('Detected internal: ' + internal);\r\n const internalShellReference = '@msft-sme';\r\n const externalShellReference = '@microsoft/windows-admin-center-sdk';\r\n const find = internal ? externalShellReference : internalShellReference;\r\n const replace = internal ? internalShellReference : externalShellReference;\r\n\r\n // For performance reasons, all applicable files are listed here, rather than scanning all files\r\n const extensionDirectory = ('./' + primaryDisplayName + '/').replace('//', '/');\r\n const extensionSrcDirectory = extensionDirectory + 'src/';\r\n const extensionAppDirectory = extensionSrcDirectory + 'app/';\r\n const gulpFileDirectory = extensionDirectory + 'gulpfile.ts/';\r\n const gulpFileCommonDirectory = gulpFileDirectory + 'common/';\r\n\r\n const filesWithShellReferences = [\r\n extensionDirectory + 'angular.json',\r\n gulpFileDirectory + 'config-data.ts',\r\n gulpFileDirectory + 'index.ts',\r\n gulpFileCommonDirectory + 'pack.ts',\r\n gulpFileCommonDirectory + 'powershell.ts',\r\n gulpFileCommonDirectory + 'resjson.ts',\r\n gulpFileCommonDirectory + 'test.ts',\r\n gulpFileCommonDirectory + 'validate.ts',\r\n extensionSrcDirectory + 'main.ts',\r\n extensionSrcDirectory + 'manifest.json',\r\n extensionSrcDirectory + 'polyfills.ts',\r\n extensionSrcDirectory + 'test.ts',\r\n extensionAppDirectory + 'app-routing.module.ts',\r\n extensionAppDirectory + 'app.component.ts',\r\n extensionAppDirectory + 'app.module.ts',\r\n extensionDirectory + '.eslintrc.json'\r\n ];\r\n\r\n const cleanFiles = {};\r\n\r\n filesWithShellReferences.forEach((file) => {\r\n cleanFiles[file] = {\r\n [find]: replace\r\n };\r\n });\r\n\r\n for (const key in cleanFiles) {\r\n if (Object.prototype.hasOwnProperty.call(cleanFiles, key)) {\r\n cleanFile(key, cleanFiles[key]);\r\n }\r\n }\r\n}\r\n\r\nexport function cleanFile(key: string, values: any): void {\r\n Logger.log('Updating: ' + key + ' ' + JSON.stringify(values));\r\n for (const valuesKey in values) {\r\n let a = 0;\r\n if (Object.prototype.hasOwnProperty.call(values, valuesKey)) {\r\n let fileData = fse.readFileSync(key, 'utf8');\r\n let displayNameIndex = fileData.indexOf(valuesKey);\r\n\r\n while (displayNameIndex > 0) {\r\n Logger.log('Found key: ' + valuesKey + ' at index: ' + displayNameIndex);\r\n fileData = fileData.replace(valuesKey, values[valuesKey]);\r\n displayNameIndex = fileData.indexOf(valuesKey);\r\n }\r\n\r\n fse.outputFileSync(key, fileData);\r\n }\r\n }\r\n}"]}
@@ -31,6 +31,12 @@ export declare class Common {
31
31
  * @returns {boolean} indicates whether the file was written successfully.
32
32
  */
33
33
  static writeFileData(filePath: any, newContent: any): boolean;
34
+ /**
35
+ * Creates the file with content.
36
+ * @param {string} filePath Target file path
37
+ * @param {string} newContent Content to write to the file
38
+ */
39
+ static writeFile(filePath: any, newContent: any): Promise<void>;
34
40
  /**
35
41
  * Retrieves content of given JSON file and parses into an object
36
42
  * @param {string} filePath Target file path
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/common.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,YAAY;IACpB,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC5B;AAED,qBAAa,MAAM;IACf,gBAAuB,WAAW,SAAgD;IAClF,gBAAuB,kBAAkB,SAAuE;IAEhH,OAAO,CAAC,MAAM,CAAC,SAAS,CAAS;IAEjC;;;OAGG;IACH,WAAkB,QAAQ,WAEzB;IAED;;;OAGG;IACH,WAAkB,QAAQ,CAAC,IAAI,QAAA,EAE9B;IAED;;;;OAIG;WACW,YAAY,CAAC,QAAQ,KAAA;IAYnC;;;;OAIG;WACW,aAAa,CAAC,QAAQ,KAAA,EAAE,UAAU,KAAA,GAAG,OAAO;IAc1D;;;;OAIG;WACW,YAAY,CAAC,QAAQ,KAAA;IAYnC;;;;;;OAMG;WACW,eAAe,CAAC,cAAc,KAAA,EAAE,cAAc,KAAA,EAAE,SAAS,KAAA;CAG1E","file":"common.d.ts","sourcesContent":["const fs = require('fs');\r\nconst fse = require('fs-extra');\r\n\r\n/**\r\n * Error resolution states\r\n */\r\nexport enum ResolveState {\r\n Resolved = 'RESOLVED',\r\n Unresolved = 'UNRESOLVED'\r\n}\r\n\r\nexport class Common {\r\n public static readonly cliRootPath = __dirname.substring(0, __dirname.length - 3);\r\n public static readonly moduleTemplatePath = __dirname.substring(0, __dirname.length - 11) + 'module-template\\\\';\r\n\r\n private static _rootPath: string;\r\n\r\n /**\r\n * Gets the root path for the current repository\r\n * @returns {string} Root path for the current repository\r\n */\r\n public static get rootPath() {\r\n return Common._rootPath;\r\n }\r\n\r\n /**\r\n * Sets the root path for the current repository\r\n * @param {string} path Root path for the current repository\r\n */\r\n public static set rootPath(path) {\r\n Common._rootPath = path;\r\n }\r\n\r\n /**\r\n * Retrieves content of given file\r\n * @param {string} filePath Target file path\r\n * @returns {string | null} String representation of file content or null if file was not found\r\n */\r\n public static readFileData(filePath) {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return null;\r\n }\r\n\r\n return fse.readFileSync(filePath, 'utf8');\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Writes to the content of given file\r\n * @param {string} filePath Target file path\r\n * @returns {boolean} indicates whether the file was written successfully.\r\n */\r\n public static writeFileData(filePath, newContent): boolean {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return false;\r\n }\r\n\r\n fse.writeFileSync(filePath, newContent, 'utf8');\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Retrieves content of given JSON file and parses into an object\r\n * @param {string} filePath Target file path\r\n * @returns {any | null} Parsed JSON object or null if file was not found\r\n */\r\n public static readFileJSON(filePath) {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return null;\r\n }\r\n\r\n return fse.readJSONSync(filePath);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Replaces part of target string with a new string using given regex\r\n * @param {string} originalString Target string\r\n * @param {RegExp} regexToReplace Regex to apply to target string\r\n * @param {string} newString String that will replace regex matches\r\n * @returns {string} New string created from replacing regex matches or original string if no matches were found\r\n */\r\n public static replaceInString(originalString, regexToReplace, newString) {\r\n return originalString.replace(regexToReplace, newString);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/common.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,YAAY;IACpB,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC5B;AAED,qBAAa,MAAM;IACf,gBAAuB,WAAW,SAAgD;IAClF,gBAAuB,kBAAkB,SAAuE;IAEhH,OAAO,CAAC,MAAM,CAAC,SAAS,CAAS;IAEjC;;;OAGG;IACH,WAAkB,QAAQ,WAEzB;IAED;;;OAGG;IACH,WAAkB,QAAQ,CAAC,IAAI,QAAA,EAE9B;IAED;;;;OAIG;WACW,YAAY,CAAC,QAAQ,KAAA;IAYnC;;;;OAIG;WACW,aAAa,CAAC,QAAQ,KAAA,EAAE,UAAU,KAAA,GAAG,OAAO;IAc1D;;;;OAIG;WACiB,SAAS,CAAC,QAAQ,KAAA,EAAE,UAAU,KAAA,GAAG,OAAO,CAAC,IAAI,CAAC;IASlE;;;;OAIG;WACW,YAAY,CAAC,QAAQ,KAAA;IAYnC;;;;;;OAMG;WACW,eAAe,CAAC,cAAc,KAAA,EAAE,cAAc,KAAA,EAAE,SAAS,KAAA;CAG1E","file":"common.d.ts","sourcesContent":["const fs = require('fs');\r\nconst fse = require('fs-extra');\r\n\r\n/**\r\n * Error resolution states\r\n */\r\nexport enum ResolveState {\r\n Resolved = 'RESOLVED',\r\n Unresolved = 'UNRESOLVED'\r\n}\r\n\r\nexport class Common {\r\n public static readonly cliRootPath = __dirname.substring(0, __dirname.length - 3);\r\n public static readonly moduleTemplatePath = __dirname.substring(0, __dirname.length - 11) + 'module-template\\\\';\r\n\r\n private static _rootPath: string;\r\n\r\n /**\r\n * Gets the root path for the current repository\r\n * @returns {string} Root path for the current repository\r\n */\r\n public static get rootPath() {\r\n return Common._rootPath;\r\n }\r\n\r\n /**\r\n * Sets the root path for the current repository\r\n * @param {string} path Root path for the current repository\r\n */\r\n public static set rootPath(path) {\r\n Common._rootPath = path;\r\n }\r\n\r\n /**\r\n * Retrieves content of given file\r\n * @param {string} filePath Target file path\r\n * @returns {string | null} String representation of file content or null if file was not found\r\n */\r\n public static readFileData(filePath) {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return null;\r\n }\r\n\r\n return fse.readFileSync(filePath, 'utf8');\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Writes to the content of given file\r\n * @param {string} filePath Target file path\r\n * @returns {boolean} indicates whether the file was written successfully.\r\n */\r\n public static writeFileData(filePath, newContent): boolean {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return false;\r\n }\r\n\r\n fse.writeFileSync(filePath, newContent, 'utf8');\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Creates the file with content.\r\n * @param {string} filePath Target file path\r\n * @param {string} newContent Content to write to the file\r\n */\r\n public static async writeFile(filePath, newContent): Promise<void> {\r\n await fs.writeFile(filePath, newContent, (err) => {\r\n if (err) {\r\n console.error('Error creating file:', err);\r\n return;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Retrieves content of given JSON file and parses into an object\r\n * @param {string} filePath Target file path\r\n * @returns {any | null} Parsed JSON object or null if file was not found\r\n */\r\n public static readFileJSON(filePath) {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return null;\r\n }\r\n\r\n return fse.readJSONSync(filePath);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Replaces part of target string with a new string using given regex\r\n * @param {string} originalString Target string\r\n * @param {RegExp} regexToReplace Regex to apply to target string\r\n * @param {string} newString String that will replace regex matches\r\n * @returns {string} New string created from replacing regex matches or original string if no matches were found\r\n */\r\n public static replaceInString(originalString, regexToReplace, newString) {\r\n return originalString.replace(regexToReplace, newString);\r\n }\r\n}\r\n"]}
@@ -58,6 +58,19 @@ class Common {
58
58
  }
59
59
  return false;
60
60
  }
61
+ /**
62
+ * Creates the file with content.
63
+ * @param {string} filePath Target file path
64
+ * @param {string} newContent Content to write to the file
65
+ */
66
+ static async writeFile(filePath, newContent) {
67
+ await fs.writeFile(filePath, newContent, (err) => {
68
+ if (err) {
69
+ console.error('Error creating file:', err);
70
+ return;
71
+ }
72
+ });
73
+ }
61
74
  /**
62
75
  * Retrieves content of given JSON file and parses into an object
63
76
  * @param {string} filePath Target file path
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/common.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEhC;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,qCAAqB,CAAA;IACrB,yCAAyB,CAAA;AAC7B,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,MAAa,MAAM;IACR,MAAM,CAAU,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3E,MAAM,CAAU,kBAAkB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,mBAAmB,CAAC;IAExG,MAAM,CAAC,SAAS,CAAS;IAEjC;;;OAGG;IACI,MAAM,KAAK,QAAQ;QACtB,OAAO,MAAM,CAA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SAAS;QACnE,OAAO,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;;AApFL,wBAqFC","file":"common.js","sourcesContent":["const fs = require('fs');\r\nconst fse = require('fs-extra');\r\n\r\n/**\r\n * Error resolution states\r\n */\r\nexport enum ResolveState {\r\n Resolved = 'RESOLVED',\r\n Unresolved = 'UNRESOLVED'\r\n}\r\n\r\nexport class Common {\r\n public static readonly cliRootPath = __dirname.substring(0, __dirname.length - 3);\r\n public static readonly moduleTemplatePath = __dirname.substring(0, __dirname.length - 11) + 'module-template\\\\';\r\n\r\n private static _rootPath: string;\r\n\r\n /**\r\n * Gets the root path for the current repository\r\n * @returns {string} Root path for the current repository\r\n */\r\n public static get rootPath() {\r\n return Common._rootPath;\r\n }\r\n\r\n /**\r\n * Sets the root path for the current repository\r\n * @param {string} path Root path for the current repository\r\n */\r\n public static set rootPath(path) {\r\n Common._rootPath = path;\r\n }\r\n\r\n /**\r\n * Retrieves content of given file\r\n * @param {string} filePath Target file path\r\n * @returns {string | null} String representation of file content or null if file was not found\r\n */\r\n public static readFileData(filePath) {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return null;\r\n }\r\n\r\n return fse.readFileSync(filePath, 'utf8');\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Writes to the content of given file\r\n * @param {string} filePath Target file path\r\n * @returns {boolean} indicates whether the file was written successfully.\r\n */\r\n public static writeFileData(filePath, newContent): boolean {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return false;\r\n }\r\n\r\n fse.writeFileSync(filePath, newContent, 'utf8');\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Retrieves content of given JSON file and parses into an object\r\n * @param {string} filePath Target file path\r\n * @returns {any | null} Parsed JSON object or null if file was not found\r\n */\r\n public static readFileJSON(filePath) {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return null;\r\n }\r\n\r\n return fse.readJSONSync(filePath);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Replaces part of target string with a new string using given regex\r\n * @param {string} originalString Target string\r\n * @param {RegExp} regexToReplace Regex to apply to target string\r\n * @param {string} newString String that will replace regex matches\r\n * @returns {string} New string created from replacing regex matches or original string if no matches were found\r\n */\r\n public static replaceInString(originalString, regexToReplace, newString) {\r\n return originalString.replace(regexToReplace, newString);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/common.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEhC;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,qCAAqB,CAAA;IACrB,yCAAyB,CAAA;AAC7B,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,MAAa,MAAM;IACR,MAAM,CAAU,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3E,MAAM,CAAU,kBAAkB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,mBAAmB,CAAC;IAExG,MAAM,CAAC,SAAS,CAAS;IAEjC;;;OAGG;IACI,MAAM,KAAK,QAAQ;QACtB,OAAO,MAAM,CAAC,SAAS,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,QAAQ,CAAC,IAAI;QAC3B,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,YAAY,CAAC,QAAQ;QAC/B,IAAI,CAAC,EAAE,CAAC,QAAQ,CA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,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,eAAe,CAAC,cAAc,EAAE,cAAc,EAAE,SAAS;QACnE,OAAO,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;;AAlGL,wBAmGC","file":"common.js","sourcesContent":["const fs = require('fs');\r\nconst fse = require('fs-extra');\r\n\r\n/**\r\n * Error resolution states\r\n */\r\nexport enum ResolveState {\r\n Resolved = 'RESOLVED',\r\n Unresolved = 'UNRESOLVED'\r\n}\r\n\r\nexport class Common {\r\n public static readonly cliRootPath = __dirname.substring(0, __dirname.length - 3);\r\n public static readonly moduleTemplatePath = __dirname.substring(0, __dirname.length - 11) + 'module-template\\\\';\r\n\r\n private static _rootPath: string;\r\n\r\n /**\r\n * Gets the root path for the current repository\r\n * @returns {string} Root path for the current repository\r\n */\r\n public static get rootPath() {\r\n return Common._rootPath;\r\n }\r\n\r\n /**\r\n * Sets the root path for the current repository\r\n * @param {string} path Root path for the current repository\r\n */\r\n public static set rootPath(path) {\r\n Common._rootPath = path;\r\n }\r\n\r\n /**\r\n * Retrieves content of given file\r\n * @param {string} filePath Target file path\r\n * @returns {string | null} String representation of file content or null if file was not found\r\n */\r\n public static readFileData(filePath) {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return null;\r\n }\r\n\r\n return fse.readFileSync(filePath, 'utf8');\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Writes to the content of given file\r\n * @param {string} filePath Target file path\r\n * @returns {boolean} indicates whether the file was written successfully.\r\n */\r\n public static writeFileData(filePath, newContent): boolean {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return false;\r\n }\r\n\r\n fse.writeFileSync(filePath, newContent, 'utf8');\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Creates the file with content.\r\n * @param {string} filePath Target file path\r\n * @param {string} newContent Content to write to the file\r\n */\r\n public static async writeFile(filePath, newContent): Promise<void> {\r\n await fs.writeFile(filePath, newContent, (err) => {\r\n if (err) {\r\n console.error('Error creating file:', err);\r\n return;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Retrieves content of given JSON file and parses into an object\r\n * @param {string} filePath Target file path\r\n * @returns {any | null} Parsed JSON object or null if file was not found\r\n */\r\n public static readFileJSON(filePath) {\r\n if (!fs.statSync(filePath).isDirectory()) {\r\n if (!fse.existsSync(filePath)) {\r\n return null;\r\n }\r\n\r\n return fse.readJSONSync(filePath);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Replaces part of target string with a new string using given regex\r\n * @param {string} originalString Target string\r\n * @param {RegExp} regexToReplace Regex to apply to target string\r\n * @param {string} newString String that will replace regex matches\r\n * @returns {string} New string created from replacing regex matches or original string if no matches were found\r\n */\r\n public static replaceInString(originalString, regexToReplace, newString) {\r\n return originalString.replace(regexToReplace, newString);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/create/main.ts"],"names":[],"mappings":"AAKA,qBAAa,gBAAgB;IAUb,OAAO,CAAC,IAAI;IATxB;;;;;;;;MAQE;gBACkB,IAAI,EAAE,GAAG;IAEtB,MAAM,IAAI,IAAI;IAyBrB,OAAO,CAAC,YAAY;IAgDpB,OAAO,CAAC,qBAAqB;IA+C7B,OAAO,CAAC,WAAW;IA+EnB,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,cAAc;CAGzB","file":"main.d.ts","sourcesContent":["import fse from 'fs-extra';\r\nimport { Guid } from 'guid-typescript';\r\nimport pathExists from 'path-exists';\r\nimport { Common } from '../common';\r\n\r\nexport class ExtensionCreator {\r\n /**\r\n * Arguments:\r\n *\t--company - name of the company or person making the extension.\r\n *\t--tool - name of the tool / extension that is being built.\r\n * --solution - name of the solution / extension that is being built.\r\n *\t--version - tag of the version to use.\r\n * --internal - instead of referring to SDK, references point to internal shell library\r\n * @param {any} argv Object containing command arguments\r\n */\r\n constructor(private argv: any) { }\r\n\r\n public create(): void {\r\n const normalizedCompany = this.normalizeString(this.argv.company ? this.argv.company : '');\r\n const normalizedTool = this.normalizeString(this.argv.tool ? this.argv.tool : '');\r\n\r\n const version = this.argv.version ? this.argv.version.toLowerCase() : '';\r\n const extensionType = this.argv.solution ? 'solution' : 'tool';\r\n const normalizedSolution = this.argv.solution ? this.normalizeString(this.argv.solution) : '';\r\n const internal = this.argv.internal;\r\n\r\n if (this.argv.length === 0 || !this.isValidVersion(version) || !normalizedCompany || !normalizedTool) {\r\n console.error('Usage: wac create --company <company-name> --name <tool-name> --version <version-tag> [--verbose]');\r\n console.log('or');\r\n console.log('wac create --company <company-name> --solution <solution-name> --tool <tool-name> --type <tool-type> --version <version-tag> [--verbose]');\r\n console.log('Valid version tags: \\'latest\\', \\'insider\\', \\'next\\', \\'experimental\\'');\r\n console.log('More information can be found here:');\r\n process.exit(1);\r\n }\r\n\r\n if (normalizedSolution === '') {\r\n this.createHelper(extensionType, normalizedCompany, normalizedTool, '', version, internal);\r\n } else {\r\n this.createHelper(extensionType, normalizedCompany, normalizedSolution, normalizedTool, version, internal);\r\n }\r\n }\r\n\r\n private createHelper(\r\n type: string,\r\n company: string,\r\n primaryDisplayName: string,\r\n secondaryDisplayName: string,\r\n version: string,\r\n internal: boolean\r\n ): void {\r\n const ignoresPath = Common.cliRootPath + 'templates\\\\ignores';\r\n const internalPath = Common.cliRootPath + 'templates\\\\internal';\r\n const solutionPath = Common.cliRootPath + 'templates\\\\solution';\r\n const templatePath = Common.cliRootPath + 'templates\\\\wac-template';\r\n const gulpPath = Common.moduleTemplatePath;\r\n\r\n if (pathExists.sync(primaryDisplayName)) {\r\n console.error('This tool definition already exists. No changes have been made.');\r\n } else {\r\n const productPath = './' + primaryDisplayName;\r\n fse.mkdirSync(primaryDisplayName);\r\n console.log('Created ' + productPath);\r\n\r\n fse.copySync(templatePath, productPath);\r\n fse.copySync(gulpPath + '\\\\gulpfile.ts', productPath + '\\\\gulpfile.ts');\r\n fse.copySync(gulpPath + '\\\\build', productPath + '\\\\build');\r\n fse.copyFileSync(gulpPath + '\\\\.eslintrc.json', productPath + '\\\\.eslintrc.json');\r\n fse.copyFileSync(templatePath + '\\\\gulpfile.ts\\\\config-data.ts', productPath + '\\\\gulpfile.ts\\\\config-data.ts');\r\n fse.copyFileSync(ignoresPath + '\\\\git.txt', productPath + '\\\\.gitignore');\r\n fse.copyFileSync(ignoresPath + '\\\\npm.txt', productPath + '\\\\.npmignore');\r\n fse.copyFileSync(ignoresPath + '\\\\browserslistrc.txt', productPath + '\\\\.browserslistrc');\r\n\r\n // For solution extensions, overwrite manifest and strings file\r\n if (type === 'solution') {\r\n fse.copyFileSync(solutionPath + '\\\\manifest.json', productPath + '\\\\src\\\\manifest.json');\r\n fse.copyFileSync(solutionPath + '\\\\strings.resjson', productPath + '\\\\src\\\\resources\\\\strings\\\\strings.resjson');\r\n }\r\n\r\n // For internal developers, overwrite package.json and add .npmrc\r\n if (internal) {\r\n fse.copyFileSync(internalPath + '\\\\package.json', productPath + '\\\\package.json');\r\n fse.copyFileSync(internalPath + '\\\\npmrc.txt', productPath + '\\\\.npmrc');\r\n }\r\n\r\n this.updateShellReferences(primaryDisplayName, internal);\r\n this.updateFiles(company, primaryDisplayName, secondaryDisplayName, version, internal);\r\n this.printOutro(primaryDisplayName);\r\n }\r\n }\r\n\r\n private updateShellReferences(primaryDisplayName: string, internal: boolean): void {\r\n const internalShellReference = '@msft-sme';\r\n const externalShellReference = '@microsoft/windows-admin-center-sdk';\r\n const find = internal ? externalShellReference : internalShellReference;\r\n const replace = internal ? internalShellReference : externalShellReference;\r\n\r\n // For performance reasons, all applicable files are listed here, rather than scanning all files\r\n const extensionDirectory = './' + primaryDisplayName + '/';\r\n const extensionSrcDirectory = extensionDirectory + 'src/';\r\n const extensionAppDirectory = extensionSrcDirectory + 'app/';\r\n const gulpFileDirectory = extensionDirectory + 'gulpfile.ts/';\r\n const gulpFileCommonDirectory = gulpFileDirectory + 'common/';\r\n\r\n const filesWithShellReferences = [\r\n extensionDirectory + 'angular.json',\r\n extensionDirectory + '.eslintrc.json',\r\n gulpFileDirectory + 'config-data.ts',\r\n gulpFileDirectory + 'index.ts',\r\n gulpFileCommonDirectory + 'pack.ts',\r\n gulpFileCommonDirectory + 'powershell.ts',\r\n gulpFileCommonDirectory + 'resjson.ts',\r\n gulpFileCommonDirectory + 'test.ts',\r\n gulpFileCommonDirectory + 'validate.ts',\r\n extensionSrcDirectory + 'main.ts',\r\n extensionSrcDirectory + 'manifest.json',\r\n extensionSrcDirectory + 'polyfills.ts',\r\n extensionSrcDirectory + 'test.ts',\r\n extensionAppDirectory + 'app-routing.module.ts',\r\n extensionAppDirectory + 'app.component.ts',\r\n extensionAppDirectory + 'app.module.ts'\r\n ];\r\n\r\n const cleanFiles = {};\r\n\r\n filesWithShellReferences.forEach((file) => {\r\n cleanFiles[file] = {\r\n [find]: replace\r\n };\r\n });\r\n\r\n for (const key in cleanFiles) {\r\n if (Object.prototype.hasOwnProperty.call(cleanFiles, key)) {\r\n this.cleanFile(key, cleanFiles[key]);\r\n }\r\n }\r\n }\r\n\r\n private updateFiles(\r\n company: string,\r\n primaryDisplayName: string,\r\n secondaryDisplayName: string,\r\n version: string,\r\n internal: boolean\r\n ): void {\r\n /*\r\n / files that need updating:\r\n /\troot package.json\r\n /\tsrc/manifest.json\r\n /\tsrc/resources/strings/strings.resjson\r\n /\tsrc/main.ts\r\n /\tin Experimental: gulpfile.js\r\n */\r\n const cleanDirectory = {};\r\n const rootPackagePath = './' + primaryDisplayName + '/package.json';\r\n const manifestFilePath = './' + primaryDisplayName + '/src/manifest.json';\r\n const mainFilePath = './' + primaryDisplayName + '/src/main.ts';\r\n const stringsFilePath = './' + primaryDisplayName + '/src/resources/strings/strings.resjson';\r\n const gulpFilePath = './' + primaryDisplayName + '/gulpfile.ts/config-data.ts';\r\n\r\n const packageName = '@' + company.toLowerCase() + '/' + primaryDisplayName.toLowerCase();\r\n const manifestName = company.toLowerCase() + '.' + primaryDisplayName.toLowerCase();\r\n const stringsProduct = primaryDisplayName.split('-').join(''); // Strings file cannot handle dashes.\r\n const stringsCompany = company.split('-').join('');\r\n const companyPackageIdentifier = company.split('-').join('') + primaryDisplayName.split('-').join('');\r\n\r\n /*\r\n / Default version is 'latest' in wac-template/package.json\r\n */\r\n if (version === 'next' || version === 'insider' || version === 'experimental') {\r\n const existingVersion = '\"@microsoft/windows-admin-center-sdk\": \"latest\",';\r\n cleanDirectory[rootPackagePath] = {\r\n '@{!company-name}/{!product-name}': packageName,\r\n '\"@microsoft/windows-admin-center-sdk\": \"latest\",': existingVersion.replace('latest', version)\r\n };\r\n } else {\r\n cleanDirectory[rootPackagePath] = { '@{!company-name}/{!product-name}': packageName };\r\n }\r\n\r\n if (!internal) {\r\n this.cleanInternalPackages(rootPackagePath);\r\n }\r\n\r\n cleanDirectory[gulpFilePath] = {\r\n '{!company-name}.{!module-name}': manifestName,\r\n '{!CompanyName}{!ProductName}': stringsCompany + stringsProduct,\r\n '{!guid}': Guid.create(),\r\n '{!company-package-id}': companyPackageIdentifier\r\n };\r\n\r\n cleanDirectory[manifestFilePath] = {\r\n '{!company-name}.{!module-name}': manifestName,\r\n '{!company-name}.{!product-name}': manifestName,\r\n '{!primary-display-name}': primaryDisplayName,\r\n '{!primary-url-name}': primaryDisplayName.toLowerCase(),\r\n '{!secondary-display-name}': secondaryDisplayName,\r\n '{!secondary-url-name}': secondaryDisplayName.toLowerCase()\r\n };\r\n\r\n cleanDirectory[stringsFilePath] = {\r\n '{!product-display-name}': stringsProduct,\r\n '{!product-title}': stringsProduct,\r\n '{!primary-display-name}': primaryDisplayName,\r\n '{!secondary-display-name}': secondaryDisplayName,\r\n '{!ProductName}': stringsProduct,\r\n '{!CompanyName}': stringsCompany\r\n };\r\n\r\n cleanDirectory[mainFilePath] = { '{!company-name}.{!product-name}': manifestName };\r\n\r\n for (const key in cleanDirectory) {\r\n if (Object.prototype.hasOwnProperty.call(cleanDirectory, key)) {\r\n this.cleanFile(key, cleanDirectory[key]);\r\n }\r\n }\r\n }\r\n\r\n private cleanFile(key: string, values: any): void {\r\n console.log('Updating: ' + key);\r\n for (const valuesKey in values) {\r\n if (Object.prototype.hasOwnProperty.call(values, valuesKey)) {\r\n let fileData = fse.readFileSync(key, 'utf8');\r\n let displayNameIndex = fileData.indexOf(valuesKey);\r\n while (displayNameIndex > 0) {\r\n fileData = fileData.replace(valuesKey, values[valuesKey]);\r\n displayNameIndex = fileData.indexOf(valuesKey);\r\n }\r\n\r\n fse.outputFileSync(key, fileData);\r\n }\r\n }\r\n }\r\n\r\n private cleanInternalPackages(packagesFilePath: string): void {\r\n const packages = Common.readFileJSON(packagesFilePath);\r\n const dependencies = [packages.peerDependencies, packages.devDependencies];\r\n\r\n const shellPackageFile = Common.cliRootPath + 'src\\\\config\\\\shell-package-list.json';\r\n const shellPackages = Common.readFileJSON(shellPackageFile).packages;\r\n\r\n dependencies.forEach((target) => {\r\n for (const pack of shellPackages) {\r\n delete target[pack];\r\n }\r\n });\r\n\r\n fse.writeJSONSync(packagesFilePath, packages, { spaces: 2 });\r\n }\r\n\r\n private printOutro(product: string): void {\r\n console.log('');\r\n console.log('Thank you for using the Windows Admin Center CLI.');\r\n console.log('');\r\n console.log('Next steps:');\r\n console.log('cd into your new directory (cd ' + product + ') and then run \\'npm install\\' -> \\'gulp build\\' to build your new extension');\r\n console.log('After that, \\'gulp serve --port 4200\\' to serve your new extension on port 4200');\r\n console.log('Additional information can be found here: https://aka.ms/wacsdkdocs');\r\n }\r\n\r\n private normalizeString(input: string): string {\r\n return input.split(' ').join('-');\r\n }\r\n\r\n private isValidVersion(version: string): boolean {\r\n return version === 'latest' || version === 'next' || version === 'insider' || version === 'release' || version === '' || version === 'experimental';\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/create/main.ts"],"names":[],"mappings":"AAMA,qBAAa,gBAAgB;IAUb,OAAO,CAAC,IAAI;IATxB;;;;;;;;MAQE;gBACkB,IAAI,EAAE,GAAG;IAEtB,MAAM,IAAI,IAAI;IAyBrB,OAAO,CAAC,YAAY;IAgDpB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,WAAW;IA+EnB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,cAAc;CAGzB","file":"main.d.ts","sourcesContent":["import fse from 'fs-extra';\r\nimport { Guid } from 'guid-typescript';\r\nimport pathExists from 'path-exists';\r\nimport { Common } from '../common';\r\nimport { cleanFile, updateShellReferences } from '../angular15/utils/update-shell-references';\r\n\r\nexport class ExtensionCreator {\r\n /**\r\n * Arguments:\r\n *\t--company - name of the company or person making the extension.\r\n *\t--tool - name of the tool / extension that is being built.\r\n * --solution - name of the solution / extension that is being built.\r\n *\t--version - tag of the version to use.\r\n * --internal - instead of referring to SDK, references point to internal shell library\r\n * @param {any} argv Object containing command arguments\r\n */\r\n constructor(private argv: any) { }\r\n\r\n public create(): void {\r\n const normalizedCompany = this.normalizeString(this.argv.company ? this.argv.company : '');\r\n const normalizedTool = this.normalizeString(this.argv.tool ? this.argv.tool : '');\r\n\r\n const version = this.argv.version ? this.argv.version.toLowerCase() : '';\r\n const extensionType = this.argv.solution ? 'solution' : 'tool';\r\n const normalizedSolution = this.argv.solution ? this.normalizeString(this.argv.solution) : '';\r\n const internal = this.argv.internal;\r\n\r\n if (this.argv.length === 0 || !this.isValidVersion(version) || !normalizedCompany || !normalizedTool) {\r\n console.error('Usage: wac create --company <company-name> --name <tool-name> --version <version-tag> [--verbose]');\r\n console.log('or');\r\n console.log('wac create --company <company-name> --solution <solution-name> --tool <tool-name> --type <tool-type> --version <version-tag> [--verbose]');\r\n console.log('Valid version tags: \\'latest\\', \\'insider\\', \\'next\\', \\'experimental\\'');\r\n console.log('More information can be found here:');\r\n process.exit(1);\r\n }\r\n\r\n if (normalizedSolution === '') {\r\n this.createHelper(extensionType, normalizedCompany, normalizedTool, '', version, internal);\r\n } else {\r\n this.createHelper(extensionType, normalizedCompany, normalizedSolution, normalizedTool, version, internal);\r\n }\r\n }\r\n\r\n private createHelper(\r\n type: string,\r\n company: string,\r\n primaryDisplayName: string,\r\n secondaryDisplayName: string,\r\n version: string,\r\n internal: boolean\r\n ): void {\r\n const ignoresPath = Common.cliRootPath + 'templates\\\\ignores';\r\n const internalPath = Common.cliRootPath + 'templates\\\\internal';\r\n const solutionPath = Common.cliRootPath + 'templates\\\\solution';\r\n const templatePath = Common.cliRootPath + 'templates\\\\wac-template';\r\n const gulpPath = Common.moduleTemplatePath;\r\n\r\n if (pathExists.sync(primaryDisplayName)) {\r\n console.error('This tool definition already exists. No changes have been made.');\r\n } else {\r\n const productPath = './' + primaryDisplayName;\r\n fse.mkdirSync(primaryDisplayName);\r\n console.log('Created ' + productPath);\r\n\r\n fse.copySync(templatePath, productPath);\r\n fse.copySync(gulpPath + '\\\\gulpfile.ts', productPath + '\\\\gulpfile.ts');\r\n fse.copySync(gulpPath + '\\\\build', productPath + '\\\\build');\r\n fse.copyFileSync(gulpPath + '\\\\.eslintrc.json', productPath + '\\\\.eslintrc.json');\r\n fse.copyFileSync(templatePath + '\\\\gulpfile.ts\\\\config-data.ts', productPath + '\\\\gulpfile.ts\\\\config-data.ts');\r\n fse.copyFileSync(ignoresPath + '\\\\git.txt', productPath + '\\\\.gitignore');\r\n fse.copyFileSync(ignoresPath + '\\\\npm.txt', productPath + '\\\\.npmignore');\r\n fse.copyFileSync(ignoresPath + '\\\\browserslistrc.txt', productPath + '\\\\.browserslistrc');\r\n\r\n // For solution extensions, overwrite manifest and strings file\r\n if (type === 'solution') {\r\n fse.copyFileSync(solutionPath + '\\\\manifest.json', productPath + '\\\\src\\\\manifest.json');\r\n fse.copyFileSync(solutionPath + '\\\\strings.resjson', productPath + '\\\\src\\\\resources\\\\strings\\\\strings.resjson');\r\n }\r\n\r\n // For internal developers, overwrite package.json and add .npmrc\r\n if (internal) {\r\n fse.copyFileSync(internalPath + '\\\\package.json', productPath + '\\\\package.json');\r\n fse.copyFileSync(internalPath + '\\\\npmrc.txt', productPath + '\\\\.npmrc');\r\n }\r\n\r\n this.updateShellReferences(primaryDisplayName, internal);\r\n this.updateFiles(company, primaryDisplayName, secondaryDisplayName, version, internal);\r\n this.printOutro(primaryDisplayName);\r\n }\r\n }\r\n\r\n private updateShellReferences(primaryDisplayName: string, internal: boolean): void {\r\n updateShellReferences(primaryDisplayName, internal);\r\n }\r\n\r\n private updateFiles(\r\n company: string,\r\n primaryDisplayName: string,\r\n secondaryDisplayName: string,\r\n version: string,\r\n internal: boolean\r\n ): void {\r\n /*\r\n / files that need updating:\r\n /\troot package.json\r\n /\tsrc/manifest.json\r\n /\tsrc/resources/strings/strings.resjson\r\n /\tsrc/main.ts\r\n /\tin Experimental: gulpfile.js\r\n */\r\n const cleanDirectory = {};\r\n const rootPackagePath = './' + primaryDisplayName + '/package.json';\r\n const manifestFilePath = './' + primaryDisplayName + '/src/manifest.json';\r\n const mainFilePath = './' + primaryDisplayName + '/src/main.ts';\r\n const stringsFilePath = './' + primaryDisplayName + '/src/resources/strings/strings.resjson';\r\n const gulpFilePath = './' + primaryDisplayName + '/gulpfile.ts/config-data.ts';\r\n\r\n const packageName = '@' + company.toLowerCase() + '/' + primaryDisplayName.toLowerCase();\r\n const manifestName = company.toLowerCase() + '.' + primaryDisplayName.toLowerCase();\r\n const stringsProduct = primaryDisplayName.split('-').join(''); // Strings file cannot handle dashes.\r\n const stringsCompany = company.split('-').join('');\r\n const companyPackageIdentifier = company.split('-').join('') + primaryDisplayName.split('-').join('');\r\n\r\n /*\r\n / Default version is 'latest' in wac-template/package.json\r\n */\r\n if (version === 'next' || version === 'insider' || version === 'experimental') {\r\n const existingVersion = '\"@microsoft/windows-admin-center-sdk\": \"latest\",';\r\n cleanDirectory[rootPackagePath] = {\r\n '@{!company-name}/{!product-name}': packageName,\r\n '\"@microsoft/windows-admin-center-sdk\": \"latest\",': existingVersion.replace('latest', version)\r\n };\r\n } else {\r\n cleanDirectory[rootPackagePath] = { '@{!company-name}/{!product-name}': packageName };\r\n }\r\n\r\n if (!internal) {\r\n this.cleanInternalPackages(rootPackagePath);\r\n }\r\n\r\n cleanDirectory[gulpFilePath] = {\r\n '{!company-name}.{!module-name}': manifestName,\r\n '{!CompanyName}{!ProductName}': stringsCompany + stringsProduct,\r\n '{!guid}': Guid.create(),\r\n '{!company-package-id}': companyPackageIdentifier\r\n };\r\n\r\n cleanDirectory[manifestFilePath] = {\r\n '{!company-name}.{!module-name}': manifestName,\r\n '{!company-name}.{!product-name}': manifestName,\r\n '{!primary-display-name}': primaryDisplayName,\r\n '{!primary-url-name}': primaryDisplayName.toLowerCase(),\r\n '{!secondary-display-name}': secondaryDisplayName,\r\n '{!secondary-url-name}': secondaryDisplayName.toLowerCase()\r\n };\r\n\r\n cleanDirectory[stringsFilePath] = {\r\n '{!product-display-name}': stringsProduct,\r\n '{!product-title}': stringsProduct,\r\n '{!primary-display-name}': primaryDisplayName,\r\n '{!secondary-display-name}': secondaryDisplayName,\r\n '{!ProductName}': stringsProduct,\r\n '{!CompanyName}': stringsCompany\r\n };\r\n\r\n cleanDirectory[mainFilePath] = { '{!company-name}.{!product-name}': manifestName };\r\n\r\n for (const key in cleanDirectory) {\r\n if (Object.prototype.hasOwnProperty.call(cleanDirectory, key)) {\r\n this.cleanFile(key, cleanDirectory[key]);\r\n }\r\n }\r\n }\r\n\r\n private cleanFile(key: string, values: any): void {\r\n cleanFile(key, values);\r\n }\r\n\r\n private cleanInternalPackages(packagesFilePath: string): void {\r\n const packages = Common.readFileJSON(packagesFilePath);\r\n const dependencies = [packages.peerDependencies, packages.devDependencies];\r\n\r\n const shellPackageFile = Common.cliRootPath + 'src\\\\config\\\\shell-package-list.json';\r\n const shellPackages = Common.readFileJSON(shellPackageFile).packages;\r\n\r\n dependencies.forEach((target) => {\r\n for (const pack of shellPackages) {\r\n delete target[pack];\r\n }\r\n });\r\n\r\n fse.writeJSONSync(packagesFilePath, packages, { spaces: 2 });\r\n }\r\n\r\n private printOutro(product: string): void {\r\n console.log('');\r\n console.log('Thank you for using the Windows Admin Center CLI.');\r\n console.log('');\r\n console.log('Next steps:');\r\n console.log('cd into your new directory (cd ' + product + ') and then run \\'npm install\\' -> \\'gulp build\\' to build your new extension');\r\n console.log('After that, \\'gulp serve --port 4200\\' to serve your new extension on port 4200');\r\n console.log('Additional information can be found here: https://aka.ms/wacsdkdocs');\r\n }\r\n\r\n private normalizeString(input: string): string {\r\n return input.split(' ').join('-');\r\n }\r\n\r\n private isValidVersion(version: string): boolean {\r\n return version === 'latest' || version === 'next' || version === 'insider' || version === 'release' || version === '' || version === 'experimental';\r\n }\r\n}\r\n"]}
@@ -6,6 +6,7 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
6
6
  const guid_typescript_1 = require("guid-typescript");
7
7
  const path_exists_1 = tslib_1.__importDefault(require("path-exists"));
8
8
  const common_1 = require("../common");
9
+ const update_shell_references_1 = require("../angular15/utils/update-shell-references");
9
10
  class ExtensionCreator {
10
11
  argv;
11
12
  /**
@@ -79,45 +80,7 @@ class ExtensionCreator {
79
80
  }
80
81
  }
81
82
  updateShellReferences(primaryDisplayName, internal) {
82
- const internalShellReference = '@msft-sme';
83
- const externalShellReference = '@microsoft/windows-admin-center-sdk';
84
- const find = internal ? externalShellReference : internalShellReference;
85
- const replace = internal ? internalShellReference : externalShellReference;
86
- // For performance reasons, all applicable files are listed here, rather than scanning all files
87
- const extensionDirectory = './' + primaryDisplayName + '/';
88
- const extensionSrcDirectory = extensionDirectory + 'src/';
89
- const extensionAppDirectory = extensionSrcDirectory + 'app/';
90
- const gulpFileDirectory = extensionDirectory + 'gulpfile.ts/';
91
- const gulpFileCommonDirectory = gulpFileDirectory + 'common/';
92
- const filesWithShellReferences = [
93
- extensionDirectory + 'angular.json',
94
- extensionDirectory + '.eslintrc.json',
95
- gulpFileDirectory + 'config-data.ts',
96
- gulpFileDirectory + 'index.ts',
97
- gulpFileCommonDirectory + 'pack.ts',
98
- gulpFileCommonDirectory + 'powershell.ts',
99
- gulpFileCommonDirectory + 'resjson.ts',
100
- gulpFileCommonDirectory + 'test.ts',
101
- gulpFileCommonDirectory + 'validate.ts',
102
- extensionSrcDirectory + 'main.ts',
103
- extensionSrcDirectory + 'manifest.json',
104
- extensionSrcDirectory + 'polyfills.ts',
105
- extensionSrcDirectory + 'test.ts',
106
- extensionAppDirectory + 'app-routing.module.ts',
107
- extensionAppDirectory + 'app.component.ts',
108
- extensionAppDirectory + 'app.module.ts'
109
- ];
110
- const cleanFiles = {};
111
- filesWithShellReferences.forEach((file) => {
112
- cleanFiles[file] = {
113
- [find]: replace
114
- };
115
- });
116
- for (const key in cleanFiles) {
117
- if (Object.prototype.hasOwnProperty.call(cleanFiles, key)) {
118
- this.cleanFile(key, cleanFiles[key]);
119
- }
120
- }
83
+ (0, update_shell_references_1.updateShellReferences)(primaryDisplayName, internal);
121
84
  }
122
85
  updateFiles(company, primaryDisplayName, secondaryDisplayName, version, internal) {
123
86
  /*
@@ -185,18 +148,7 @@ class ExtensionCreator {
185
148
  }
186
149
  }
187
150
  cleanFile(key, values) {
188
- console.log('Updating: ' + key);
189
- for (const valuesKey in values) {
190
- if (Object.prototype.hasOwnProperty.call(values, valuesKey)) {
191
- let fileData = fs_extra_1.default.readFileSync(key, 'utf8');
192
- let displayNameIndex = fileData.indexOf(valuesKey);
193
- while (displayNameIndex > 0) {
194
- fileData = fileData.replace(valuesKey, values[valuesKey]);
195
- displayNameIndex = fileData.indexOf(valuesKey);
196
- }
197
- fs_extra_1.default.outputFileSync(key, fileData);
198
- }
199
- }
151
+ (0, update_shell_references_1.cleanFile)(key, values);
200
152
  }
201
153
  cleanInternalPackages(packagesFilePath) {
202
154
  const packages = common_1.Common.readFileJSON(packagesFilePath);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/tools/wac-cli/src/create/main.ts"],"names":[],"mappings":";;;;AAAA,gEAA2B;AAC3B,qDAAuC;AACvC,sEAAqC;AACrC,sCAAmC;AAEnC,MAAa,gBAAgB;IAUL;IATpB;;;;;;;;MAQE;IACF,YAAoB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAI,CAAC;IAE3B,MAAM;QACT,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3F,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAElF,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/D,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9F,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QAEpC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI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AI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,cAAc,CAAC;IACxJ,CAAC;CACJ;AApQD,4CAoQC","file":"main.js","sourcesContent":["import fse from 'fs-extra';\r\nimport { Guid } from 'guid-typescript';\r\nimport pathExists from 'path-exists';\r\nimport { Common } from '../common';\r\n\r\nexport class ExtensionCreator {\r\n /**\r\n * Arguments:\r\n *\t--company - name of the company or person making the extension.\r\n *\t--tool - name of the tool / extension that is being built.\r\n * --solution - name of the solution / extension that is being built.\r\n *\t--version - tag of the version to use.\r\n * --internal - instead of referring to SDK, references point to internal shell library\r\n * @param {any} argv Object containing command arguments\r\n */\r\n constructor(private argv: any) { }\r\n\r\n public create(): void {\r\n const normalizedCompany = this.normalizeString(this.argv.company ? this.argv.company : '');\r\n const normalizedTool = this.normalizeString(this.argv.tool ? this.argv.tool : '');\r\n\r\n const version = this.argv.version ? this.argv.version.toLowerCase() : '';\r\n const extensionType = this.argv.solution ? 'solution' : 'tool';\r\n const normalizedSolution = this.argv.solution ? this.normalizeString(this.argv.solution) : '';\r\n const internal = this.argv.internal;\r\n\r\n if (this.argv.length === 0 || !this.isValidVersion(version) || !normalizedCompany || !normalizedTool) {\r\n console.error('Usage: wac create --company <company-name> --name <tool-name> --version <version-tag> [--verbose]');\r\n console.log('or');\r\n console.log('wac create --company <company-name> --solution <solution-name> --tool <tool-name> --type <tool-type> --version <version-tag> [--verbose]');\r\n console.log('Valid version tags: \\'latest\\', \\'insider\\', \\'next\\', \\'experimental\\'');\r\n console.log('More information can be found here:');\r\n process.exit(1);\r\n }\r\n\r\n if (normalizedSolution === '') {\r\n this.createHelper(extensionType, normalizedCompany, normalizedTool, '', version, internal);\r\n } else {\r\n this.createHelper(extensionType, normalizedCompany, normalizedSolution, normalizedTool, version, internal);\r\n }\r\n }\r\n\r\n private createHelper(\r\n type: string,\r\n company: string,\r\n primaryDisplayName: string,\r\n secondaryDisplayName: string,\r\n version: string,\r\n internal: boolean\r\n ): void {\r\n const ignoresPath = Common.cliRootPath + 'templates\\\\ignores';\r\n const internalPath = Common.cliRootPath + 'templates\\\\internal';\r\n const solutionPath = Common.cliRootPath + 'templates\\\\solution';\r\n const templatePath = Common.cliRootPath + 'templates\\\\wac-template';\r\n const gulpPath = Common.moduleTemplatePath;\r\n\r\n if (pathExists.sync(primaryDisplayName)) {\r\n console.error('This tool definition already exists. No changes have been made.');\r\n } else {\r\n const productPath = './' + primaryDisplayName;\r\n fse.mkdirSync(primaryDisplayName);\r\n console.log('Created ' + productPath);\r\n\r\n fse.copySync(templatePath, productPath);\r\n fse.copySync(gulpPath + '\\\\gulpfile.ts', productPath + '\\\\gulpfile.ts');\r\n fse.copySync(gulpPath + '\\\\build', productPath + '\\\\build');\r\n fse.copyFileSync(gulpPath + '\\\\.eslintrc.json', productPath + '\\\\.eslintrc.json');\r\n fse.copyFileSync(templatePath + '\\\\gulpfile.ts\\\\config-data.ts', productPath + '\\\\gulpfile.ts\\\\config-data.ts');\r\n fse.copyFileSync(ignoresPath + '\\\\git.txt', productPath + '\\\\.gitignore');\r\n fse.copyFileSync(ignoresPath + '\\\\npm.txt', productPath + '\\\\.npmignore');\r\n fse.copyFileSync(ignoresPath + '\\\\browserslistrc.txt', productPath + '\\\\.browserslistrc');\r\n\r\n // For solution extensions, overwrite manifest and strings file\r\n if (type === 'solution') {\r\n fse.copyFileSync(solutionPath + '\\\\manifest.json', productPath + '\\\\src\\\\manifest.json');\r\n fse.copyFileSync(solutionPath + '\\\\strings.resjson', productPath + '\\\\src\\\\resources\\\\strings\\\\strings.resjson');\r\n }\r\n\r\n // For internal developers, overwrite package.json and add .npmrc\r\n if (internal) {\r\n fse.copyFileSync(internalPath + '\\\\package.json', productPath + '\\\\package.json');\r\n fse.copyFileSync(internalPath + '\\\\npmrc.txt', productPath + '\\\\.npmrc');\r\n }\r\n\r\n this.updateShellReferences(primaryDisplayName, internal);\r\n this.updateFiles(company, primaryDisplayName, secondaryDisplayName, version, internal);\r\n this.printOutro(primaryDisplayName);\r\n }\r\n }\r\n\r\n private updateShellReferences(primaryDisplayName: string, internal: boolean): void {\r\n const internalShellReference = '@msft-sme';\r\n const externalShellReference = '@microsoft/windows-admin-center-sdk';\r\n const find = internal ? externalShellReference : internalShellReference;\r\n const replace = internal ? internalShellReference : externalShellReference;\r\n\r\n // For performance reasons, all applicable files are listed here, rather than scanning all files\r\n const extensionDirectory = './' + primaryDisplayName + '/';\r\n const extensionSrcDirectory = extensionDirectory + 'src/';\r\n const extensionAppDirectory = extensionSrcDirectory + 'app/';\r\n const gulpFileDirectory = extensionDirectory + 'gulpfile.ts/';\r\n const gulpFileCommonDirectory = gulpFileDirectory + 'common/';\r\n\r\n const filesWithShellReferences = [\r\n extensionDirectory + 'angular.json',\r\n extensionDirectory + '.eslintrc.json',\r\n gulpFileDirectory + 'config-data.ts',\r\n gulpFileDirectory + 'index.ts',\r\n gulpFileCommonDirectory + 'pack.ts',\r\n gulpFileCommonDirectory + 'powershell.ts',\r\n gulpFileCommonDirectory + 'resjson.ts',\r\n gulpFileCommonDirectory + 'test.ts',\r\n gulpFileCommonDirectory + 'validate.ts',\r\n extensionSrcDirectory + 'main.ts',\r\n extensionSrcDirectory + 'manifest.json',\r\n extensionSrcDirectory + 'polyfills.ts',\r\n extensionSrcDirectory + 'test.ts',\r\n extensionAppDirectory + 'app-routing.module.ts',\r\n extensionAppDirectory + 'app.component.ts',\r\n extensionAppDirectory + 'app.module.ts'\r\n ];\r\n\r\n const cleanFiles = {};\r\n\r\n filesWithShellReferences.forEach((file) => {\r\n cleanFiles[file] = {\r\n [find]: replace\r\n };\r\n });\r\n\r\n for (const key in cleanFiles) {\r\n if (Object.prototype.hasOwnProperty.call(cleanFiles, key)) {\r\n this.cleanFile(key, cleanFiles[key]);\r\n }\r\n }\r\n }\r\n\r\n private updateFiles(\r\n company: string,\r\n primaryDisplayName: string,\r\n secondaryDisplayName: string,\r\n version: string,\r\n internal: boolean\r\n ): void {\r\n /*\r\n / files that need updating:\r\n /\troot package.json\r\n /\tsrc/manifest.json\r\n /\tsrc/resources/strings/strings.resjson\r\n /\tsrc/main.ts\r\n /\tin Experimental: gulpfile.js\r\n */\r\n const cleanDirectory = {};\r\n const rootPackagePath = './' + primaryDisplayName + '/package.json';\r\n const manifestFilePath = './' + primaryDisplayName + '/src/manifest.json';\r\n const mainFilePath = './' + primaryDisplayName + '/src/main.ts';\r\n const stringsFilePath = './' + primaryDisplayName + '/src/resources/strings/strings.resjson';\r\n const gulpFilePath = './' + primaryDisplayName + '/gulpfile.ts/config-data.ts';\r\n\r\n const packageName = '@' + company.toLowerCase() + '/' + primaryDisplayName.toLowerCase();\r\n const manifestName = company.toLowerCase() + '.' + primaryDisplayName.toLowerCase();\r\n const stringsProduct = primaryDisplayName.split('-').join(''); // Strings file cannot handle dashes.\r\n const stringsCompany = company.split('-').join('');\r\n const companyPackageIdentifier = company.split('-').join('') + primaryDisplayName.split('-').join('');\r\n\r\n /*\r\n / Default version is 'latest' in wac-template/package.json\r\n */\r\n if (version === 'next' || version === 'insider' || version === 'experimental') {\r\n const existingVersion = '\"@microsoft/windows-admin-center-sdk\": \"latest\",';\r\n cleanDirectory[rootPackagePath] = {\r\n '@{!company-name}/{!product-name}': packageName,\r\n '\"@microsoft/windows-admin-center-sdk\": \"latest\",': existingVersion.replace('latest', version)\r\n };\r\n } else {\r\n cleanDirectory[rootPackagePath] = { '@{!company-name}/{!product-name}': packageName };\r\n }\r\n\r\n if (!internal) {\r\n this.cleanInternalPackages(rootPackagePath);\r\n }\r\n\r\n cleanDirectory[gulpFilePath] = {\r\n '{!company-name}.{!module-name}': manifestName,\r\n '{!CompanyName}{!ProductName}': stringsCompany + stringsProduct,\r\n '{!guid}': Guid.create(),\r\n '{!company-package-id}': companyPackageIdentifier\r\n };\r\n\r\n cleanDirectory[manifestFilePath] = {\r\n '{!company-name}.{!module-name}': manifestName,\r\n '{!company-name}.{!product-name}': manifestName,\r\n '{!primary-display-name}': primaryDisplayName,\r\n '{!primary-url-name}': primaryDisplayName.toLowerCase(),\r\n '{!secondary-display-name}': secondaryDisplayName,\r\n '{!secondary-url-name}': secondaryDisplayName.toLowerCase()\r\n };\r\n\r\n cleanDirectory[stringsFilePath] = {\r\n '{!product-display-name}': stringsProduct,\r\n '{!product-title}': stringsProduct,\r\n '{!primary-display-name}': primaryDisplayName,\r\n '{!secondary-display-name}': secondaryDisplayName,\r\n '{!ProductName}': stringsProduct,\r\n '{!CompanyName}': stringsCompany\r\n };\r\n\r\n cleanDirectory[mainFilePath] = { '{!company-name}.{!product-name}': manifestName };\r\n\r\n for (const key in cleanDirectory) {\r\n if (Object.prototype.hasOwnProperty.call(cleanDirectory, key)) {\r\n this.cleanFile(key, cleanDirectory[key]);\r\n }\r\n }\r\n }\r\n\r\n private cleanFile(key: string, values: any): void {\r\n console.log('Updating: ' + key);\r\n for (const valuesKey in values) {\r\n if (Object.prototype.hasOwnProperty.call(values, valuesKey)) {\r\n let fileData = fse.readFileSync(key, 'utf8');\r\n let displayNameIndex = fileData.indexOf(valuesKey);\r\n while (displayNameIndex > 0) {\r\n fileData = fileData.replace(valuesKey, values[valuesKey]);\r\n displayNameIndex = fileData.indexOf(valuesKey);\r\n }\r\n\r\n fse.outputFileSync(key, fileData);\r\n }\r\n }\r\n }\r\n\r\n private cleanInternalPackages(packagesFilePath: string): void {\r\n const packages = Common.readFileJSON(packagesFilePath);\r\n const dependencies = [packages.peerDependencies, packages.devDependencies];\r\n\r\n const shellPackageFile = Common.cliRootPath + 'src\\\\config\\\\shell-package-list.json';\r\n const shellPackages = Common.readFileJSON(shellPackageFile).packages;\r\n\r\n dependencies.forEach((target) => {\r\n for (const pack of shellPackages) {\r\n delete target[pack];\r\n }\r\n });\r\n\r\n fse.writeJSONSync(packagesFilePath, packages, { spaces: 2 });\r\n }\r\n\r\n private printOutro(product: string): void {\r\n console.log('');\r\n console.log('Thank you for using the Windows Admin Center CLI.');\r\n console.log('');\r\n console.log('Next steps:');\r\n console.log('cd into your new directory (cd ' + product + ') and then run \\'npm install\\' -> \\'gulp build\\' to build your new extension');\r\n console.log('After that, \\'gulp serve --port 4200\\' to serve your new extension on port 4200');\r\n console.log('Additional information can be found here: https://aka.ms/wacsdkdocs');\r\n }\r\n\r\n private normalizeString(input: string): string {\r\n return input.split(' ').join('-');\r\n }\r\n\r\n private isValidVersion(version: string): boolean {\r\n return version === 'latest' || version === 'next' || version === 'insider' || version === 'release' || version === '' || version === 'experimental';\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/tools/wac-cli/src/create/main.ts"],"names":[],"mappings":";;;;AAAA,gEAA2B;AAC3B,qDAAuC;AACvC,sEAAqC;AACrC,sCAAmC;AACnC,wFAA8F;AAE9F,MAAa,gBAAgB;IAUL;IATpB;;;;;;;;MAQE;IACF,YAAoB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAI,CAAC;IAE3B,MAAM;QACT,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3F,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAElF,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/D,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ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AAI,CAAC,CAAC;aACvB;QACL,CAAC,CAAC,CAAC;QAEH,kBAAG,CAAC,aAAa,CAAC,gBAAgB,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IAEO,UAAU,CAAC,OAAe;QAC9B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,iCAAiC,GAAG,OAAO,GAAG,8EAA8E,CAAC,CAAC;QAC1I,OAAO,CAAC,GAAG,CAAC,iFAAiF,CAAC,CAAC;QAC/F,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;IACvF,CAAC;IAEO,eAAe,CAAC,KAAa;QACjC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAEO,cAAc,CAAC,OAAe;QAClC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,cAAc,CAAC;IACxJ,CAAC;CACJ;AA7MD,4CA6MC","file":"main.js","sourcesContent":["import fse from 'fs-extra';\r\nimport { Guid } from 'guid-typescript';\r\nimport pathExists from 'path-exists';\r\nimport { Common } from '../common';\r\nimport { cleanFile, updateShellReferences } from '../angular15/utils/update-shell-references';\r\n\r\nexport class ExtensionCreator {\r\n /**\r\n * Arguments:\r\n *\t--company - name of the company or person making the extension.\r\n *\t--tool - name of the tool / extension that is being built.\r\n * --solution - name of the solution / extension that is being built.\r\n *\t--version - tag of the version to use.\r\n * --internal - instead of referring to SDK, references point to internal shell library\r\n * @param {any} argv Object containing command arguments\r\n */\r\n constructor(private argv: any) { }\r\n\r\n public create(): void {\r\n const normalizedCompany = this.normalizeString(this.argv.company ? this.argv.company : '');\r\n const normalizedTool = this.normalizeString(this.argv.tool ? this.argv.tool : '');\r\n\r\n const version = this.argv.version ? this.argv.version.toLowerCase() : '';\r\n const extensionType = this.argv.solution ? 'solution' : 'tool';\r\n const normalizedSolution = this.argv.solution ? this.normalizeString(this.argv.solution) : '';\r\n const internal = this.argv.internal;\r\n\r\n if (this.argv.length === 0 || !this.isValidVersion(version) || !normalizedCompany || !normalizedTool) {\r\n console.error('Usage: wac create --company <company-name> --name <tool-name> --version <version-tag> [--verbose]');\r\n console.log('or');\r\n console.log('wac create --company <company-name> --solution <solution-name> --tool <tool-name> --type <tool-type> --version <version-tag> [--verbose]');\r\n console.log('Valid version tags: \\'latest\\', \\'insider\\', \\'next\\', \\'experimental\\'');\r\n console.log('More information can be found here:');\r\n process.exit(1);\r\n }\r\n\r\n if (normalizedSolution === '') {\r\n this.createHelper(extensionType, normalizedCompany, normalizedTool, '', version, internal);\r\n } else {\r\n this.createHelper(extensionType, normalizedCompany, normalizedSolution, normalizedTool, version, internal);\r\n }\r\n }\r\n\r\n private createHelper(\r\n type: string,\r\n company: string,\r\n primaryDisplayName: string,\r\n secondaryDisplayName: string,\r\n version: string,\r\n internal: boolean\r\n ): void {\r\n const ignoresPath = Common.cliRootPath + 'templates\\\\ignores';\r\n const internalPath = Common.cliRootPath + 'templates\\\\internal';\r\n const solutionPath = Common.cliRootPath + 'templates\\\\solution';\r\n const templatePath = Common.cliRootPath + 'templates\\\\wac-template';\r\n const gulpPath = Common.moduleTemplatePath;\r\n\r\n if (pathExists.sync(primaryDisplayName)) {\r\n console.error('This tool definition already exists. No changes have been made.');\r\n } else {\r\n const productPath = './' + primaryDisplayName;\r\n fse.mkdirSync(primaryDisplayName);\r\n console.log('Created ' + productPath);\r\n\r\n fse.copySync(templatePath, productPath);\r\n fse.copySync(gulpPath + '\\\\gulpfile.ts', productPath + '\\\\gulpfile.ts');\r\n fse.copySync(gulpPath + '\\\\build', productPath + '\\\\build');\r\n fse.copyFileSync(gulpPath + '\\\\.eslintrc.json', productPath + '\\\\.eslintrc.json');\r\n fse.copyFileSync(templatePath + '\\\\gulpfile.ts\\\\config-data.ts', productPath + '\\\\gulpfile.ts\\\\config-data.ts');\r\n fse.copyFileSync(ignoresPath + '\\\\git.txt', productPath + '\\\\.gitignore');\r\n fse.copyFileSync(ignoresPath + '\\\\npm.txt', productPath + '\\\\.npmignore');\r\n fse.copyFileSync(ignoresPath + '\\\\browserslistrc.txt', productPath + '\\\\.browserslistrc');\r\n\r\n // For solution extensions, overwrite manifest and strings file\r\n if (type === 'solution') {\r\n fse.copyFileSync(solutionPath + '\\\\manifest.json', productPath + '\\\\src\\\\manifest.json');\r\n fse.copyFileSync(solutionPath + '\\\\strings.resjson', productPath + '\\\\src\\\\resources\\\\strings\\\\strings.resjson');\r\n }\r\n\r\n // For internal developers, overwrite package.json and add .npmrc\r\n if (internal) {\r\n fse.copyFileSync(internalPath + '\\\\package.json', productPath + '\\\\package.json');\r\n fse.copyFileSync(internalPath + '\\\\npmrc.txt', productPath + '\\\\.npmrc');\r\n }\r\n\r\n this.updateShellReferences(primaryDisplayName, internal);\r\n this.updateFiles(company, primaryDisplayName, secondaryDisplayName, version, internal);\r\n this.printOutro(primaryDisplayName);\r\n }\r\n }\r\n\r\n private updateShellReferences(primaryDisplayName: string, internal: boolean): void {\r\n updateShellReferences(primaryDisplayName, internal);\r\n }\r\n\r\n private updateFiles(\r\n company: string,\r\n primaryDisplayName: string,\r\n secondaryDisplayName: string,\r\n version: string,\r\n internal: boolean\r\n ): void {\r\n /*\r\n / files that need updating:\r\n /\troot package.json\r\n /\tsrc/manifest.json\r\n /\tsrc/resources/strings/strings.resjson\r\n /\tsrc/main.ts\r\n /\tin Experimental: gulpfile.js\r\n */\r\n const cleanDirectory = {};\r\n const rootPackagePath = './' + primaryDisplayName + '/package.json';\r\n const manifestFilePath = './' + primaryDisplayName + '/src/manifest.json';\r\n const mainFilePath = './' + primaryDisplayName + '/src/main.ts';\r\n const stringsFilePath = './' + primaryDisplayName + '/src/resources/strings/strings.resjson';\r\n const gulpFilePath = './' + primaryDisplayName + '/gulpfile.ts/config-data.ts';\r\n\r\n const packageName = '@' + company.toLowerCase() + '/' + primaryDisplayName.toLowerCase();\r\n const manifestName = company.toLowerCase() + '.' + primaryDisplayName.toLowerCase();\r\n const stringsProduct = primaryDisplayName.split('-').join(''); // Strings file cannot handle dashes.\r\n const stringsCompany = company.split('-').join('');\r\n const companyPackageIdentifier = company.split('-').join('') + primaryDisplayName.split('-').join('');\r\n\r\n /*\r\n / Default version is 'latest' in wac-template/package.json\r\n */\r\n if (version === 'next' || version === 'insider' || version === 'experimental') {\r\n const existingVersion = '\"@microsoft/windows-admin-center-sdk\": \"latest\",';\r\n cleanDirectory[rootPackagePath] = {\r\n '@{!company-name}/{!product-name}': packageName,\r\n '\"@microsoft/windows-admin-center-sdk\": \"latest\",': existingVersion.replace('latest', version)\r\n };\r\n } else {\r\n cleanDirectory[rootPackagePath] = { '@{!company-name}/{!product-name}': packageName };\r\n }\r\n\r\n if (!internal) {\r\n this.cleanInternalPackages(rootPackagePath);\r\n }\r\n\r\n cleanDirectory[gulpFilePath] = {\r\n '{!company-name}.{!module-name}': manifestName,\r\n '{!CompanyName}{!ProductName}': stringsCompany + stringsProduct,\r\n '{!guid}': Guid.create(),\r\n '{!company-package-id}': companyPackageIdentifier\r\n };\r\n\r\n cleanDirectory[manifestFilePath] = {\r\n '{!company-name}.{!module-name}': manifestName,\r\n '{!company-name}.{!product-name}': manifestName,\r\n '{!primary-display-name}': primaryDisplayName,\r\n '{!primary-url-name}': primaryDisplayName.toLowerCase(),\r\n '{!secondary-display-name}': secondaryDisplayName,\r\n '{!secondary-url-name}': secondaryDisplayName.toLowerCase()\r\n };\r\n\r\n cleanDirectory[stringsFilePath] = {\r\n '{!product-display-name}': stringsProduct,\r\n '{!product-title}': stringsProduct,\r\n '{!primary-display-name}': primaryDisplayName,\r\n '{!secondary-display-name}': secondaryDisplayName,\r\n '{!ProductName}': stringsProduct,\r\n '{!CompanyName}': stringsCompany\r\n };\r\n\r\n cleanDirectory[mainFilePath] = { '{!company-name}.{!product-name}': manifestName };\r\n\r\n for (const key in cleanDirectory) {\r\n if (Object.prototype.hasOwnProperty.call(cleanDirectory, key)) {\r\n this.cleanFile(key, cleanDirectory[key]);\r\n }\r\n }\r\n }\r\n\r\n private cleanFile(key: string, values: any): void {\r\n cleanFile(key, values);\r\n }\r\n\r\n private cleanInternalPackages(packagesFilePath: string): void {\r\n const packages = Common.readFileJSON(packagesFilePath);\r\n const dependencies = [packages.peerDependencies, packages.devDependencies];\r\n\r\n const shellPackageFile = Common.cliRootPath + 'src\\\\config\\\\shell-package-list.json';\r\n const shellPackages = Common.readFileJSON(shellPackageFile).packages;\r\n\r\n dependencies.forEach((target) => {\r\n for (const pack of shellPackages) {\r\n delete target[pack];\r\n }\r\n });\r\n\r\n fse.writeJSONSync(packagesFilePath, packages, { spaces: 2 });\r\n }\r\n\r\n private printOutro(product: string): void {\r\n console.log('');\r\n console.log('Thank you for using the Windows Admin Center CLI.');\r\n console.log('');\r\n console.log('Next steps:');\r\n console.log('cd into your new directory (cd ' + product + ') and then run \\'npm install\\' -> \\'gulp build\\' to build your new extension');\r\n console.log('After that, \\'gulp serve --port 4200\\' to serve your new extension on port 4200');\r\n console.log('Additional information can be found here: https://aka.ms/wacsdkdocs');\r\n }\r\n\r\n private normalizeString(input: string): string {\r\n return input.split(' ').join('-');\r\n }\r\n\r\n private isValidVersion(version: string): boolean {\r\n return version === 'latest' || version === 'next' || version === 'insider' || version === 'release' || version === '' || version === 'experimental';\r\n }\r\n}\r\n"]}