@react-native-windows/cli 0.0.0-canary.99 → 0.0.1-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 (131) hide show
  1. package/README.md +0 -2
  2. package/lib-commonjs/{runWindows/utils/autolink.d.ts → commands/autolinkWindows/autolinkWindows.d.ts} +87 -86
  3. package/lib-commonjs/{runWindows/utils/autolink.js → commands/autolinkWindows/autolinkWindows.js} +655 -625
  4. package/lib-commonjs/commands/autolinkWindows/autolinkWindows.js.map +1 -0
  5. package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.d.ts +14 -0
  6. package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.js +33 -0
  7. package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.js.map +1 -0
  8. package/lib-commonjs/commands/codegenWindows/codegenWindows.d.ts +27 -0
  9. package/lib-commonjs/commands/codegenWindows/codegenWindows.js +206 -0
  10. package/lib-commonjs/commands/codegenWindows/codegenWindows.js.map +1 -0
  11. package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.d.ts +12 -0
  12. package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.js +23 -0
  13. package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.js.map +1 -0
  14. package/lib-commonjs/{config → commands/config}/configUtils.d.ts +123 -116
  15. package/lib-commonjs/{config → commands/config}/configUtils.js +380 -341
  16. package/lib-commonjs/commands/config/configUtils.js.map +1 -0
  17. package/lib-commonjs/{config → commands/config}/dependencyConfig.d.ts +37 -37
  18. package/lib-commonjs/{config → commands/config}/dependencyConfig.js +227 -221
  19. package/lib-commonjs/commands/config/dependencyConfig.js.map +1 -0
  20. package/lib-commonjs/{config → commands/config}/projectConfig.d.ts +27 -27
  21. package/lib-commonjs/{config → commands/config}/projectConfig.js +180 -176
  22. package/lib-commonjs/commands/config/projectConfig.js.map +1 -0
  23. package/lib-commonjs/commands/healthCheck/healthCheckList.d.ts +6 -0
  24. package/lib-commonjs/commands/healthCheck/healthCheckList.js +21 -0
  25. package/lib-commonjs/commands/healthCheck/healthCheckList.js.map +1 -0
  26. package/lib-commonjs/{healthChecks.d.ts → commands/healthCheck/healthChecks.d.ts} +7 -2
  27. package/lib-commonjs/commands/healthCheck/healthChecks.js +124 -0
  28. package/lib-commonjs/commands/healthCheck/healthChecks.js.map +1 -0
  29. package/lib-commonjs/commands/initWindows/initWindows.d.ts +46 -0
  30. package/lib-commonjs/commands/initWindows/initWindows.js +244 -0
  31. package/lib-commonjs/commands/initWindows/initWindows.js.map +1 -0
  32. package/lib-commonjs/commands/initWindows/initWindowsOptions.d.ts +15 -0
  33. package/lib-commonjs/commands/initWindows/initWindowsOptions.js +38 -0
  34. package/lib-commonjs/commands/initWindows/initWindowsOptions.js.map +1 -0
  35. package/lib-commonjs/{runWindows → commands/runWindows}/runWindows.d.ts +10 -11
  36. package/lib-commonjs/{runWindows → commands/runWindows}/runWindows.js +321 -318
  37. package/lib-commonjs/commands/runWindows/runWindows.js.map +1 -0
  38. package/lib-commonjs/{runWindows → commands/runWindows}/runWindowsOptions.d.ts +56 -56
  39. package/lib-commonjs/{runWindows → commands/runWindows}/runWindowsOptions.js +132 -135
  40. package/lib-commonjs/commands/runWindows/runWindowsOptions.js.map +1 -0
  41. package/lib-commonjs/e2etest/autolink.test.d.ts +6 -6
  42. package/lib-commonjs/e2etest/autolink.test.js +366 -418
  43. package/lib-commonjs/e2etest/autolink.test.js.map +1 -1
  44. package/lib-commonjs/e2etest/dependencyConfig.test.d.ts +6 -6
  45. package/lib-commonjs/e2etest/dependencyConfig.test.js +129 -161
  46. package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -1
  47. package/lib-commonjs/e2etest/healthChecks.test.d.ts +6 -0
  48. package/lib-commonjs/e2etest/healthChecks.test.js +31 -0
  49. package/lib-commonjs/e2etest/healthChecks.test.js.map +1 -0
  50. package/lib-commonjs/e2etest/initWindows.test.d.ts +6 -0
  51. package/lib-commonjs/e2etest/initWindows.test.js +43 -0
  52. package/lib-commonjs/e2etest/initWindows.test.js.map +1 -0
  53. package/lib-commonjs/e2etest/projectConfig.test.d.ts +6 -6
  54. package/lib-commonjs/e2etest/projectConfig.test.js +110 -124
  55. package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -1
  56. package/lib-commonjs/e2etest/projectConfig.utils.d.ts +8 -4
  57. package/lib-commonjs/e2etest/projectConfig.utils.js +76 -62
  58. package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -1
  59. package/lib-commonjs/e2etest/runWindows.test.d.ts +6 -6
  60. package/lib-commonjs/e2etest/runWindows.test.js +60 -39
  61. package/lib-commonjs/e2etest/runWindows.test.js.map +1 -1
  62. package/lib-commonjs/e2etest/typesUpToDate.test.d.ts +6 -0
  63. package/lib-commonjs/e2etest/typesUpToDate.test.js +21 -0
  64. package/lib-commonjs/e2etest/typesUpToDate.test.js.map +1 -0
  65. package/lib-commonjs/generator-common/index.d.ts +39 -39
  66. package/lib-commonjs/generator-common/index.js +242 -242
  67. package/lib-commonjs/generator-common/index.js.map +1 -1
  68. package/lib-commonjs/generator-windows/index.d.ts +10 -10
  69. package/lib-commonjs/generator-windows/index.js +316 -369
  70. package/lib-commonjs/generator-windows/index.js.map +1 -1
  71. package/lib-commonjs/index.d.ts +50 -50
  72. package/lib-commonjs/index.js +77 -106
  73. package/lib-commonjs/index.js.map +1 -1
  74. package/lib-commonjs/{runWindows/utils → utils}/build.d.ts +12 -12
  75. package/lib-commonjs/{runWindows/utils → utils}/build.js +84 -84
  76. package/lib-commonjs/utils/build.js.map +1 -0
  77. package/lib-commonjs/{runWindows/utils → utils}/checkRequirements.d.ts +6 -6
  78. package/lib-commonjs/{runWindows/utils → utils}/checkRequirements.js +69 -69
  79. package/lib-commonjs/utils/checkRequirements.js.map +1 -0
  80. package/lib-commonjs/{runWindows/utils → utils}/commandWithProgress.d.ts +21 -15
  81. package/lib-commonjs/{runWindows/utils → utils}/commandWithProgress.js +149 -127
  82. package/lib-commonjs/utils/commandWithProgress.js.map +1 -0
  83. package/lib-commonjs/{runWindows/utils → utils}/deploy.d.ts +12 -12
  84. package/lib-commonjs/{runWindows/utils → utils}/deploy.js +353 -328
  85. package/lib-commonjs/utils/deploy.js.map +1 -0
  86. package/lib-commonjs/{runWindows/utils → utils}/info.d.ts +6 -6
  87. package/lib-commonjs/{runWindows/utils → utils}/info.js +28 -28
  88. package/lib-commonjs/utils/info.js.map +1 -0
  89. package/lib-commonjs/{runWindows/utils → utils}/msbuildtools.d.ts +28 -26
  90. package/lib-commonjs/{runWindows/utils → utils}/msbuildtools.js +273 -219
  91. package/lib-commonjs/utils/msbuildtools.js.map +1 -0
  92. package/lib-commonjs/utils/pathHelpers.d.ts +9 -0
  93. package/lib-commonjs/utils/pathHelpers.js +37 -0
  94. package/lib-commonjs/utils/pathHelpers.js.map +1 -0
  95. package/lib-commonjs/utils/telemetryHelpers.d.ts +29 -0
  96. package/lib-commonjs/utils/telemetryHelpers.js +121 -0
  97. package/lib-commonjs/utils/telemetryHelpers.js.map +1 -0
  98. package/lib-commonjs/{runWindows/utils → utils}/version.d.ts +19 -19
  99. package/lib-commonjs/{runWindows/utils → utils}/version.js +109 -109
  100. package/lib-commonjs/utils/version.js.map +1 -0
  101. package/lib-commonjs/{runWindows/utils → utils}/vsInstalls.d.ts +34 -34
  102. package/lib-commonjs/{runWindows/utils → utils}/vsInstalls.js +99 -73
  103. package/lib-commonjs/utils/vsInstalls.js.map +1 -0
  104. package/lib-commonjs/{runWindows/utils → utils}/vstools.d.ts +16 -16
  105. package/lib-commonjs/{runWindows/utils → utils}/vstools.js +189 -162
  106. package/lib-commonjs/utils/vstools.js.map +1 -0
  107. package/lib-commonjs/{runWindows/utils → utils}/winappdeploytool.d.ts +24 -24
  108. package/lib-commonjs/{runWindows/utils → utils}/winappdeploytool.js +108 -108
  109. package/lib-commonjs/utils/winappdeploytool.js.map +1 -0
  110. package/package.json +27 -20
  111. package/src/powershell/Eval-MsBuildProperties.ps1 +156 -0
  112. package/lib-commonjs/config/configUtils.js.map +0 -1
  113. package/lib-commonjs/config/dependencyConfig.js.map +0 -1
  114. package/lib-commonjs/config/projectConfig.js.map +0 -1
  115. package/lib-commonjs/healthChecks.js +0 -88
  116. package/lib-commonjs/healthChecks.js.map +0 -1
  117. package/lib-commonjs/runWindows/runWindows.js.map +0 -1
  118. package/lib-commonjs/runWindows/runWindowsOptions.js.map +0 -1
  119. package/lib-commonjs/runWindows/utils/autolink.js.map +0 -1
  120. package/lib-commonjs/runWindows/utils/build.js.map +0 -1
  121. package/lib-commonjs/runWindows/utils/checkRequirements.js.map +0 -1
  122. package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +0 -1
  123. package/lib-commonjs/runWindows/utils/deploy.js.map +0 -1
  124. package/lib-commonjs/runWindows/utils/info.js.map +0 -1
  125. package/lib-commonjs/runWindows/utils/msbuildtools.js.map +0 -1
  126. package/lib-commonjs/runWindows/utils/version.js.map +0 -1
  127. package/lib-commonjs/runWindows/utils/vsInstalls.js.map +0 -1
  128. package/lib-commonjs/runWindows/utils/vstools.js.map +0 -1
  129. package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +0 -1
  130. /package/{powershell → src/powershell}/Add-AppDevPackage.ps1 +0 -0
  131. /package/{powershell → src/powershell}/WindowsStoreAppUtils.ps1 +0 -0
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ * @format
5
+ */
6
+ import { Config, CommandOption } from '@react-native-community/cli-types';
7
+ import { CommanderOptionsType, OptionSanitizer } from '@react-native-windows/telemetry';
8
+ /**
9
+ * Calculates a the default values of a given react-native CLI command's options.
10
+ * @param config Config passed from react-native CLI.
11
+ * @param commandOptions The options definition for the command.
12
+ * @returns The default options for the command.
13
+ */
14
+ export declare function getDefaultOptions(config: Config, commandOptions: CommandOption[]): CommanderOptionsType;
15
+ /**
16
+ * Sets up and starts the telemetry gathering for the CLI command.
17
+ * @param commandName The name of the CLI command.
18
+ * @param config Config passed from react-native CLI.
19
+ * @param options Options passed from react-native CLI.
20
+ * @param defaultOptions Default options for the command.
21
+ * @param optionSanitizer Function to sanitize the option values for telemetry.
22
+ */
23
+ export declare function startTelemetrySession(commandName: string, config: Config, options: CommanderOptionsType, defaultOptions: CommanderOptionsType, optionSanitizer: OptionSanitizer): Promise<void>;
24
+ /**
25
+ * Ends the gathering of telemetry for the CLI command.
26
+ * @param error The error (if any) thrown during the command.
27
+ * @param getExtraProps Function to get any extra command-specific telemetry properties.
28
+ */
29
+ export declare function endTelemetrySession(error?: Error, getExtraProps?: () => Promise<Record<string, any>>): Promise<void>;
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ * @format
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.endTelemetrySession = exports.startTelemetrySession = exports.getDefaultOptions = void 0;
9
+ const lodash_1 = require("lodash");
10
+ const telemetry_1 = require("@react-native-windows/telemetry");
11
+ const commandWithProgress_1 = require("./commandWithProgress");
12
+ /**
13
+ * Calculates a the default values of a given react-native CLI command's options.
14
+ * @param config Config passed from react-native CLI.
15
+ * @param commandOptions The options definition for the command.
16
+ * @returns The default options for the command.
17
+ */
18
+ function getDefaultOptions(config, commandOptions) {
19
+ const result = {
20
+ logging: false,
21
+ };
22
+ for (const option of commandOptions) {
23
+ let key = option.name.startsWith('--')
24
+ ? option.name.slice('--'.length)
25
+ : option.name;
26
+ key = key.trim();
27
+ let value = option.default;
28
+ if (value !== undefined && value.name) {
29
+ value = value(config);
30
+ }
31
+ if (key.endsWith(' [string]')) {
32
+ // Option is a string
33
+ key = key.slice(0, -' [string]'.length);
34
+ // Option is a number
35
+ }
36
+ else if (key.endsWith(' [number]')) {
37
+ key = key.slice(0, -' [number]'.length);
38
+ }
39
+ else {
40
+ // Option is a boolean
41
+ // Note: Commander ignores the default property for booleans
42
+ if (key.startsWith('no-')) {
43
+ key = key.slice('no-'.length);
44
+ // Commander always defaults to true for flags that start with --no
45
+ value = true;
46
+ }
47
+ else {
48
+ // Commander always defaults to undefined for flags
49
+ value = undefined;
50
+ }
51
+ }
52
+ key = (0, lodash_1.camelCase)(key);
53
+ result[key] = value;
54
+ }
55
+ return result;
56
+ }
57
+ exports.getDefaultOptions = getDefaultOptions;
58
+ /**
59
+ * Sets up and starts the telemetry gathering for the CLI command.
60
+ * @param commandName The name of the CLI command.
61
+ * @param config Config passed from react-native CLI.
62
+ * @param options Options passed from react-native CLI.
63
+ * @param defaultOptions Default options for the command.
64
+ * @param optionSanitizer Function to sanitize the option values for telemetry.
65
+ */
66
+ async function startTelemetrySession(commandName, config, options, defaultOptions, optionSanitizer) {
67
+ const verbose = options.logging === true;
68
+ if (!options.telemetry) {
69
+ if (verbose) {
70
+ (0, commandWithProgress_1.newInfo)('Telemetry is disabled');
71
+ }
72
+ return;
73
+ }
74
+ if (verbose) {
75
+ (0, commandWithProgress_1.newInfo)(`Running ${(0, telemetry_1.nodeArchitecture)()} node on a ${(0, telemetry_1.deviceArchitecture)()} machine`);
76
+ }
77
+ if ((0, telemetry_1.deviceArchitecture)() !== (0, telemetry_1.nodeArchitecture)()) {
78
+ (0, commandWithProgress_1.newWarn)('This version of node was built for a different architecture than this machine and may cause unintended behavior');
79
+ }
80
+ await telemetry_1.Telemetry.setup();
81
+ const sanitizedOptions = (0, telemetry_1.commanderOptionsToOptions)(options, optionSanitizer);
82
+ const sanitizedDefaultOptions = (0, telemetry_1.commanderOptionsToOptions)(defaultOptions, optionSanitizer);
83
+ const sanitizedArgs = (0, telemetry_1.optionsToArgs)(sanitizedOptions, process.argv);
84
+ const startInfo = {
85
+ commandName,
86
+ args: sanitizedArgs,
87
+ options: sanitizedOptions,
88
+ defaultOptions: sanitizedDefaultOptions,
89
+ };
90
+ telemetry_1.Telemetry.startCommand(startInfo);
91
+ const projectInfo = await (0, telemetry_1.configToProjectInfo)(config);
92
+ if (projectInfo) {
93
+ telemetry_1.Telemetry.setProjectInfo(projectInfo);
94
+ }
95
+ const projectFile = (0, telemetry_1.getProjectFileFromConfig)(config);
96
+ if (projectFile) {
97
+ await telemetry_1.Telemetry.populateNuGetPackageVersions(projectFile);
98
+ }
99
+ }
100
+ exports.startTelemetrySession = startTelemetrySession;
101
+ /**
102
+ * Ends the gathering of telemetry for the CLI command.
103
+ * @param error The error (if any) thrown during the command.
104
+ * @param getExtraProps Function to get any extra command-specific telemetry properties.
105
+ */
106
+ async function endTelemetrySession(error, getExtraProps) {
107
+ if (!telemetry_1.Telemetry.isEnabled()) {
108
+ // Bail early so don't waste time here
109
+ return;
110
+ }
111
+ const endInfo = {
112
+ resultCode: 'Success',
113
+ };
114
+ if (error) {
115
+ endInfo.resultCode =
116
+ error instanceof telemetry_1.CodedError ? error.type : 'Unknown';
117
+ }
118
+ telemetry_1.Telemetry.endCommand(endInfo, getExtraProps ? await getExtraProps() : undefined);
119
+ }
120
+ exports.endTelemetrySession = endTelemetrySession;
121
+ //# sourceMappingURL=telemetryHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetryHelpers.js","sourceRoot":"","sources":["../../src/utils/telemetryHelpers.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAAiC;AAQjC,+DAayC;AAEzC,+DAAuD;AAEvD;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC/B,MAAc,EACd,cAA+B;IAE/B,MAAM,MAAM,GAAyB;QACnC,OAAO,EAAE,KAAK;KACf,CAAC;IACF,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE;QACnC,IAAI,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACpC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;YAChC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;QAChB,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;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;IAEF,IAAI,KAAK,EAAE;QACT,OAAO,CAAC,UAAU;YAChB,KAAK,YAAY,sBAAU,CAAC,CAAC,CAAE,KAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;KACxE;IAED,qBAAS,CAAC,UAAU,CAClB,OAAO,EACP,aAAa,CAAC,CAAC,CAAC,MAAM,aAAa,EAAE,CAAC,CAAC,CAAC,SAAS,CAClD,CAAC;AACJ,CAAC;AAtBD,kDAsBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {camelCase} from 'lodash';\n\nimport {\n Config,\n CommandOption,\n OptionValue,\n} from '@react-native-community/cli-types';\n\nimport {\n Telemetry,\n CodedError,\n CommandStartInfo,\n CommandEndInfo,\n CommanderOptionsType,\n commanderOptionsToOptions,\n optionsToArgs,\n OptionSanitizer,\n configToProjectInfo,\n getProjectFileFromConfig,\n deviceArchitecture,\n nodeArchitecture,\n} from '@react-native-windows/telemetry';\n\nimport {newInfo, newWarn} from './commandWithProgress';\n\n/**\n * Calculates a the default values of a given react-native CLI command's options.\n * @param config Config passed from react-native CLI.\n * @param commandOptions The options definition for the command.\n * @returns The default options for the command.\n */\nexport function getDefaultOptions(\n config: Config,\n commandOptions: CommandOption[],\n): CommanderOptionsType {\n const result: CommanderOptionsType = {\n logging: false,\n };\n for (const option of commandOptions) {\n let key = option.name.startsWith('--')\n ? option.name.slice('--'.length)\n : option.name;\n key = key.trim();\n\n let value = option.default;\n if (value !== undefined && (value as (ctx: Config) => OptionValue).name) {\n value = (value as (ctx: Config) => OptionValue)(config);\n }\n\n if (key.endsWith(' [string]')) {\n // Option is a string\n key = key.slice(0, -' [string]'.length);\n // Option is a number\n } else if (key.endsWith(' [number]')) {\n key = key.slice(0, -' [number]'.length);\n } else {\n // Option is a boolean\n // Note: Commander ignores the default property for booleans\n if (key.startsWith('no-')) {\n key = key.slice('no-'.length);\n // Commander always defaults to true for flags that start with --no\n value = true;\n } else {\n // Commander always defaults to undefined for flags\n value = undefined;\n }\n }\n\n key = camelCase(key);\n result[key] = value;\n }\n return result;\n}\n\n/**\n * Sets up and starts the telemetry gathering for the CLI command.\n * @param commandName The name of the CLI command.\n * @param config Config passed from react-native CLI.\n * @param options Options passed from react-native CLI.\n * @param defaultOptions Default options for the command.\n * @param optionSanitizer Function to sanitize the option values for telemetry.\n */\nexport async function startTelemetrySession(\n commandName: string,\n config: Config,\n options: CommanderOptionsType,\n defaultOptions: CommanderOptionsType,\n optionSanitizer: OptionSanitizer,\n) {\n const verbose = options.logging === true;\n\n if (!options.telemetry) {\n if (verbose) {\n newInfo('Telemetry is disabled');\n }\n return;\n }\n\n if (verbose) {\n newInfo(\n `Running ${nodeArchitecture()} node on a ${deviceArchitecture()} machine`,\n );\n }\n\n if (deviceArchitecture() !== nodeArchitecture()) {\n newWarn(\n 'This version of node was built for a different architecture than this machine and may cause unintended behavior',\n );\n }\n\n await Telemetry.setup();\n\n const sanitizedOptions = commanderOptionsToOptions(options, optionSanitizer);\n const sanitizedDefaultOptions = commanderOptionsToOptions(\n defaultOptions,\n optionSanitizer,\n );\n const sanitizedArgs = optionsToArgs(sanitizedOptions, process.argv);\n\n const startInfo: CommandStartInfo = {\n commandName,\n args: sanitizedArgs,\n options: sanitizedOptions,\n defaultOptions: sanitizedDefaultOptions,\n };\n\n Telemetry.startCommand(startInfo);\n\n const projectInfo = await configToProjectInfo(config);\n if (projectInfo) {\n Telemetry.setProjectInfo(projectInfo);\n }\n\n const projectFile = getProjectFileFromConfig(config);\n if (projectFile) {\n await Telemetry.populateNuGetPackageVersions(projectFile);\n }\n}\n\n/**\n * Ends the gathering of telemetry for the CLI command.\n * @param error The error (if any) thrown during the command.\n * @param getExtraProps Function to get any extra command-specific telemetry properties.\n */\nexport async function endTelemetrySession(\n error?: Error,\n getExtraProps?: () => Promise<Record<string, any>>,\n) {\n if (!Telemetry.isEnabled()) {\n // Bail early so don't waste time here\n return;\n }\n\n const endInfo: CommandEndInfo = {\n resultCode: 'Success',\n };\n\n if (error) {\n endInfo.resultCode =\n error instanceof CodedError ? (error as CodedError).type : 'Unknown';\n }\n\n Telemetry.endCommand(\n endInfo,\n getExtraProps ? await getExtraProps() : undefined,\n );\n}\n"]}
@@ -1,19 +1,19 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
- export default class Version {
7
- private readonly major;
8
- private readonly minor;
9
- private readonly build;
10
- private readonly qfe;
11
- constructor(major: number, minor?: number, build?: number, qfe?: number);
12
- eq(other: Version): boolean;
13
- gt(other: Version): boolean;
14
- gte(other: Version): boolean;
15
- toString(): string;
16
- static compare(x: Version, y: Version): number;
17
- static fromString(str: string): Version;
18
- static tryParse(str: string): Version | null;
19
- }
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ * @format
5
+ */
6
+ export default class Version {
7
+ private readonly major;
8
+ private readonly minor;
9
+ private readonly build;
10
+ private readonly qfe;
11
+ constructor(major: number, minor?: number, build?: number, qfe?: number);
12
+ eq(other: Version): boolean;
13
+ gt(other: Version): boolean;
14
+ gte(other: Version): boolean;
15
+ toString(): string;
16
+ static compare(x: Version, y: Version): number;
17
+ static fromString(str: string): Version;
18
+ static tryParse(str: string): Version | null;
19
+ }
@@ -1,110 +1,110 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- * @format
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const VERSION_EXPRESSION = /^\d{1,8}(\.\d{1,8}){0,3}$/;
9
- class Version {
10
- constructor(major, minor = 0, build = 0, qfe = 0) {
11
- this.major = major;
12
- this.minor = minor;
13
- this.build = build;
14
- this.qfe = qfe;
15
- }
16
- eq(other) {
17
- if (other.constructor !== Version) {
18
- throw new TypeError('other must be a Version instance');
19
- }
20
- return (this.major === other.major &&
21
- this.minor === other.minor &&
22
- this.build === other.build &&
23
- this.qfe === other.qfe);
24
- }
25
- gt(other) {
26
- if (other.constructor !== Version) {
27
- throw new TypeError('other must be a Version instance');
28
- }
29
- if (this.major > other.major) {
30
- return true;
31
- }
32
- if (this.major < other.major) {
33
- return false;
34
- }
35
- if (this.minor > other.minor) {
36
- return true;
37
- }
38
- if (this.minor < other.minor) {
39
- return false;
40
- }
41
- if (this.build > other.build) {
42
- return true;
43
- }
44
- if (this.build < other.build) {
45
- return false;
46
- }
47
- if (this.qfe > other.qfe) {
48
- return true;
49
- }
50
- if (this.qfe < other.qfe) {
51
- return false;
52
- }
53
- return false;
54
- }
55
- gte(other) {
56
- if (other.constructor !== Version) {
57
- throw new TypeError('other must be a Version instance');
58
- }
59
- if (this.major > other.major) {
60
- return true;
61
- }
62
- if (this.major < other.major) {
63
- return false;
64
- }
65
- if (this.minor > other.minor) {
66
- return true;
67
- }
68
- if (this.minor < other.minor) {
69
- return false;
70
- }
71
- if (this.build > other.build) {
72
- return true;
73
- }
74
- if (this.build < other.build) {
75
- return false;
76
- }
77
- if (this.qfe > other.qfe) {
78
- return true;
79
- }
80
- if (this.qfe < other.qfe) {
81
- return false;
82
- }
83
- return true;
84
- }
85
- toString() {
86
- return `${this.major}.${this.minor}.${this.build}.${this.qfe}`;
87
- }
88
- static compare(x, y) {
89
- if (x.constructor !== Version || y.constructor !== Version) {
90
- throw new TypeError('Only can compare Version objects');
91
- }
92
- return x.gt(y) ? 1 : x.eq(y) ? 0 : -1;
93
- }
94
- static fromString(str) {
95
- const version = Version.tryParse(str);
96
- if (!version) {
97
- throw new TypeError('Cannot construct a version from "' + str + '".');
98
- }
99
- return version;
100
- }
101
- static tryParse(str) {
102
- if (VERSION_EXPRESSION.test(str)) {
103
- const versionArray = str.split('.').map(x => parseInt(x, 10));
104
- return new Version(versionArray[0], versionArray[1], versionArray[2], versionArray[3]);
105
- }
106
- return null;
107
- }
108
- }
109
- exports.default = Version;
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ * @format
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const VERSION_EXPRESSION = /^\d{1,8}(\.\d{1,8}){0,3}$/;
9
+ class Version {
10
+ constructor(major, minor = 0, build = 0, qfe = 0) {
11
+ this.major = major;
12
+ this.minor = minor;
13
+ this.build = build;
14
+ this.qfe = qfe;
15
+ }
16
+ eq(other) {
17
+ if (other.constructor !== Version) {
18
+ throw new TypeError('other must be a Version instance');
19
+ }
20
+ return (this.major === other.major &&
21
+ this.minor === other.minor &&
22
+ this.build === other.build &&
23
+ this.qfe === other.qfe);
24
+ }
25
+ gt(other) {
26
+ if (other.constructor !== Version) {
27
+ throw new TypeError('other must be a Version instance');
28
+ }
29
+ if (this.major > other.major) {
30
+ return true;
31
+ }
32
+ if (this.major < other.major) {
33
+ return false;
34
+ }
35
+ if (this.minor > other.minor) {
36
+ return true;
37
+ }
38
+ if (this.minor < other.minor) {
39
+ return false;
40
+ }
41
+ if (this.build > other.build) {
42
+ return true;
43
+ }
44
+ if (this.build < other.build) {
45
+ return false;
46
+ }
47
+ if (this.qfe > other.qfe) {
48
+ return true;
49
+ }
50
+ if (this.qfe < other.qfe) {
51
+ return false;
52
+ }
53
+ return false;
54
+ }
55
+ gte(other) {
56
+ if (other.constructor !== Version) {
57
+ throw new TypeError('other must be a Version instance');
58
+ }
59
+ if (this.major > other.major) {
60
+ return true;
61
+ }
62
+ if (this.major < other.major) {
63
+ return false;
64
+ }
65
+ if (this.minor > other.minor) {
66
+ return true;
67
+ }
68
+ if (this.minor < other.minor) {
69
+ return false;
70
+ }
71
+ if (this.build > other.build) {
72
+ return true;
73
+ }
74
+ if (this.build < other.build) {
75
+ return false;
76
+ }
77
+ if (this.qfe > other.qfe) {
78
+ return true;
79
+ }
80
+ if (this.qfe < other.qfe) {
81
+ return false;
82
+ }
83
+ return true;
84
+ }
85
+ toString() {
86
+ return `${this.major}.${this.minor}.${this.build}.${this.qfe}`;
87
+ }
88
+ static compare(x, y) {
89
+ if (x.constructor !== Version || y.constructor !== Version) {
90
+ throw new TypeError('Only can compare Version objects');
91
+ }
92
+ return x.gt(y) ? 1 : x.eq(y) ? 0 : -1;
93
+ }
94
+ static fromString(str) {
95
+ const version = Version.tryParse(str);
96
+ if (!version) {
97
+ throw new TypeError('Cannot construct a version from "' + str + '".');
98
+ }
99
+ return version;
100
+ }
101
+ static tryParse(str) {
102
+ if (VERSION_EXPRESSION.test(str)) {
103
+ const versionArray = str.split('.').map(x => parseInt(x, 10));
104
+ return new Version(versionArray[0], versionArray[1], versionArray[2], versionArray[3]);
105
+ }
106
+ return null;
107
+ }
108
+ }
109
+ exports.default = Version;
110
110
  //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAEvD,MAAqB,OAAO;IAC1B,YACmB,KAAa,EACb,QAAgB,CAAC,EACjB,QAAgB,CAAC,EACjB,MAAc,CAAC;QAHf,UAAK,GAAL,KAAK,CAAQ;QACb,UAAK,GAAL,KAAK,CAAY;QACjB,UAAK,GAAL,KAAK,CAAY;QACjB,QAAG,GAAH,GAAG,CAAY;IAC/B,CAAC;IAEJ,EAAE,CAAC,KAAc;QACf,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO,EAAE;YACjC,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;SACzD;QAED,OAAO,CACL,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;YAC1B,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;YAC1B,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;YAC1B,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CACvB,CAAC;IACJ,CAAC;IAED,EAAE,CAAC,KAAc;QACf,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO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AM,CAAC,QAAQ,CAAC,GAAW;QACzB,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAChC,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YAC9D,OAAO,IAAI,OAAO,CAChB,YAAY,CAAC,CAAC,CAAC,EACf,YAAY,CAAC,CAAC,CAAC,EACf,YAAY,CAAC,CAAC,CAAC,EACf,YAAY,CAAC,CAAC,CAAC,CAChB,CAAC;SACH;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvHD,0BAuHC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nconst VERSION_EXPRESSION = /^\\d{1,8}(\\.\\d{1,8}){0,3}$/;\n\nexport default class Version {\n constructor(\n private readonly major: number,\n private readonly minor: number = 0,\n private readonly build: number = 0,\n private readonly qfe: number = 0,\n ) {}\n\n eq(other: Version): boolean {\n if (other.constructor !== Version) {\n throw new TypeError('other must be a Version instance');\n }\n\n return (\n this.major === other.major &&\n this.minor === other.minor &&\n this.build === other.build &&\n this.qfe === other.qfe\n );\n }\n\n gt(other: Version): boolean {\n if (other.constructor !== Version) {\n throw new TypeError('other must be a Version instance');\n }\n\n if (this.major > other.major) {\n return true;\n }\n if (this.major < other.major) {\n return false;\n }\n if (this.minor > other.minor) {\n return true;\n }\n if (this.minor < other.minor) {\n return false;\n }\n if (this.build > other.build) {\n return true;\n }\n if (this.build < other.build) {\n return false;\n }\n if (this.qfe > other.qfe) {\n return true;\n }\n if (this.qfe < other.qfe) {\n return false;\n }\n\n return false;\n }\n\n gte(other: Version): boolean {\n if (other.constructor !== Version) {\n throw new TypeError('other must be a Version instance');\n }\n\n if (this.major > other.major) {\n return true;\n }\n if (this.major < other.major) {\n return false;\n }\n if (this.minor > other.minor) {\n return true;\n }\n if (this.minor < other.minor) {\n return false;\n }\n if (this.build > other.build) {\n return true;\n }\n if (this.build < other.build) {\n return false;\n }\n if (this.qfe > other.qfe) {\n return true;\n }\n if (this.qfe < other.qfe) {\n return false;\n }\n\n return true;\n }\n\n toString(): string {\n return `${this.major}.${this.minor}.${this.build}.${this.qfe}`;\n }\n\n static compare(x: Version, y: Version): number {\n if (x.constructor !== Version || y.constructor !== Version) {\n throw new TypeError('Only can compare Version objects');\n }\n\n return x.gt(y) ? 1 : x.eq(y) ? 0 : -1;\n }\n\n static fromString(str: string): Version {\n const version = Version.tryParse(str);\n if (!version) {\n throw new TypeError('Cannot construct a version from \"' + str + '\".');\n }\n return version;\n }\n\n static tryParse(str: string): Version | null {\n if (VERSION_EXPRESSION.test(str)) {\n const versionArray = str.split('.').map(x => parseInt(x, 10));\n return new Version(\n versionArray[0],\n versionArray[1],\n versionArray[2],\n versionArray[3],\n );\n }\n return null;\n }\n}\n"]}
@@ -1,34 +1,34 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
- /**
7
- * A subset of the per-instance properties returned by vswhere
8
- */
9
- interface VisualStudioInstallation {
10
- instanceId: string;
11
- installationPath: string;
12
- installationVersion: string;
13
- prerelease: string;
14
- }
15
- /**
16
- * Enumerate the installed versions of Visual Studio
17
- */
18
- export declare function enumerateVsInstalls(opts: {
19
- requires?: string[];
20
- version?: string;
21
- verbose?: boolean;
22
- latest?: boolean;
23
- prerelease?: boolean;
24
- }): VisualStudioInstallation[];
25
- /**
26
- * Find the latest available VS installation that matches the given constraints
27
- */
28
- export declare function findLatestVsInstall(opts: {
29
- requires?: string[];
30
- minVersion?: string;
31
- verbose?: boolean;
32
- prerelease?: boolean;
33
- }): VisualStudioInstallation | null;
34
- export {};
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ * @format
5
+ */
6
+ /**
7
+ * A subset of the per-instance properties returned by vswhere
8
+ */
9
+ interface VisualStudioInstallation {
10
+ instanceId: string;
11
+ installationPath: string;
12
+ installationVersion: string;
13
+ prerelease: string;
14
+ }
15
+ /**
16
+ * Enumerate the installed versions of Visual Studio
17
+ */
18
+ export declare function enumerateVsInstalls(opts: {
19
+ requires?: string[];
20
+ minVersion?: string;
21
+ verbose?: boolean;
22
+ latest?: boolean;
23
+ prerelease?: boolean;
24
+ }): VisualStudioInstallation[];
25
+ /**
26
+ * Find the latest available VS installation that matches the given constraints
27
+ */
28
+ export declare function findLatestVsInstall(opts: {
29
+ requires?: string[];
30
+ minVersion?: string;
31
+ verbose?: boolean;
32
+ prerelease?: boolean;
33
+ }): VisualStudioInstallation | null;
34
+ export {};