@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
@@ -1,85 +1,85 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- * @format
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.parseMsBuildProps = exports.getAppProjectFile = exports.getAppSolutionFile = exports.buildSolution = void 0;
12
- const path_1 = __importDefault(require("path"));
13
- const msbuildtools_1 = __importDefault(require("./msbuildtools"));
14
- const version_1 = __importDefault(require("./version"));
15
- const commandWithProgress_1 = require("./commandWithProgress");
16
- const telemetry_1 = require("@react-native-windows/telemetry");
17
- async function buildSolution(buildTools, slnFile, buildType, buildArch, msBuildProps, verbose, target, buildLogDirectory, singleproc) {
18
- const minVersion = new version_1.default(10, 0, 19041, 0);
19
- const allVersions = msbuildtools_1.default.getAllAvailableUAPVersions();
20
- if (!allVersions.some(v => v.gte(minVersion))) {
21
- throw new telemetry_1.CodedError('MinSDKVersionNotMet', 'Must have a minimum Windows SDK version 10.0.19041.0 installed');
22
- }
23
- await buildTools.buildProject(slnFile, buildType, buildArch, msBuildProps, verbose, target, buildLogDirectory, singleproc);
24
- }
25
- exports.buildSolution = buildSolution;
26
- const configErrorString = 'Error: ';
27
- function getAppSolutionFile(options, config) {
28
- // Use the solution file if specified
29
- if (options.sln) {
30
- return path_1.default.join(options.root, options.sln);
31
- }
32
- // Check the answer from react-native config
33
- const windowsAppConfig = config.project.windows;
34
- if (!windowsAppConfig) {
35
- throw new telemetry_1.CodedError('NoWindowsConfig', "Couldn't determine Windows app config");
36
- }
37
- const configSolutionFile = windowsAppConfig.solutionFile;
38
- if (configSolutionFile.startsWith(configErrorString)) {
39
- (0, commandWithProgress_1.newError)(configSolutionFile.substr(configErrorString.length) +
40
- ' Optionally, use --sln {slnFile}.');
41
- return null;
42
- }
43
- else {
44
- return path_1.default.join(windowsAppConfig.folder, windowsAppConfig.sourceDir, configSolutionFile);
45
- }
46
- }
47
- exports.getAppSolutionFile = getAppSolutionFile;
48
- function getAppProjectFile(options, config) {
49
- // Use the project file if specified
50
- if (options.proj) {
51
- return path_1.default.join(options.root, options.proj);
52
- }
53
- // Check the answer from react-native config
54
- const windowsAppConfig = config.project.windows;
55
- const configProject = windowsAppConfig.project;
56
- if (typeof configProject === 'string' &&
57
- configProject.startsWith(configErrorString)) {
58
- (0, commandWithProgress_1.newError)(configProject.substr(configErrorString.length) +
59
- ' Optionally, use --proj {projFile}.');
60
- return null;
61
- }
62
- else {
63
- const configProjectFile = configProject.projectFile;
64
- if (configProjectFile.startsWith(configErrorString)) {
65
- (0, commandWithProgress_1.newError)(configProjectFile.substr(configErrorString.length) +
66
- ' Optionally, use --proj {projFile}.');
67
- return null;
68
- }
69
- return path_1.default.join(windowsAppConfig.folder, windowsAppConfig.sourceDir, configProjectFile);
70
- }
71
- }
72
- exports.getAppProjectFile = getAppProjectFile;
73
- function parseMsBuildProps(options) {
74
- const result = {};
75
- if (options.msbuildprops) {
76
- const props = options.msbuildprops.split(',');
77
- for (const prop of props) {
78
- const propAssignment = prop.split('=');
79
- result[propAssignment[0]] = propAssignment[1];
80
- }
81
- }
82
- return result;
83
- }
84
- exports.parseMsBuildProps = parseMsBuildProps;
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ * @format
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.parseMsBuildProps = exports.getAppProjectFile = exports.getAppSolutionFile = exports.buildSolution = void 0;
12
+ const path_1 = __importDefault(require("path"));
13
+ const msbuildtools_1 = __importDefault(require("./msbuildtools"));
14
+ const version_1 = __importDefault(require("./version"));
15
+ const commandWithProgress_1 = require("./commandWithProgress");
16
+ const telemetry_1 = require("@react-native-windows/telemetry");
17
+ async function buildSolution(buildTools, slnFile, buildType, buildArch, msBuildProps, verbose, target, buildLogDirectory, singleproc) {
18
+ const minVersion = new version_1.default(10, 0, 19041, 0);
19
+ const allVersions = msbuildtools_1.default.getAllAvailableUAPVersions();
20
+ if (!allVersions.some(v => v.gte(minVersion))) {
21
+ throw new telemetry_1.CodedError('MinSDKVersionNotMet', 'Must have a minimum Windows SDK version 10.0.19041.0 installed');
22
+ }
23
+ await buildTools.buildProject(slnFile, buildType, buildArch, msBuildProps, verbose, target, buildLogDirectory, singleproc);
24
+ }
25
+ exports.buildSolution = buildSolution;
26
+ const configErrorString = 'Error: ';
27
+ function getAppSolutionFile(options, config) {
28
+ // Use the solution file if specified
29
+ if (options.sln) {
30
+ return path_1.default.join(options.root, options.sln);
31
+ }
32
+ // Check the answer from react-native config
33
+ const windowsAppConfig = config.project.windows;
34
+ if (!windowsAppConfig) {
35
+ throw new telemetry_1.CodedError('NoWindowsConfig', "Couldn't determine Windows app config");
36
+ }
37
+ const configSolutionFile = windowsAppConfig.solutionFile;
38
+ if (configSolutionFile.startsWith(configErrorString)) {
39
+ (0, commandWithProgress_1.newError)(configSolutionFile.substr(configErrorString.length) +
40
+ ' Optionally, use --sln {slnFile}.');
41
+ return null;
42
+ }
43
+ else {
44
+ return path_1.default.join(windowsAppConfig.folder, windowsAppConfig.sourceDir, configSolutionFile);
45
+ }
46
+ }
47
+ exports.getAppSolutionFile = getAppSolutionFile;
48
+ function getAppProjectFile(options, config) {
49
+ // Use the project file if specified
50
+ if (options.proj) {
51
+ return path_1.default.join(options.root, options.proj);
52
+ }
53
+ // Check the answer from react-native config
54
+ const windowsAppConfig = config.project.windows;
55
+ const configProject = windowsAppConfig.project;
56
+ if (typeof configProject === 'string' &&
57
+ configProject.startsWith(configErrorString)) {
58
+ (0, commandWithProgress_1.newError)(configProject.substr(configErrorString.length) +
59
+ ' Optionally, use --proj {projFile}.');
60
+ return null;
61
+ }
62
+ else {
63
+ const configProjectFile = configProject.projectFile;
64
+ if (configProjectFile.startsWith(configErrorString)) {
65
+ (0, commandWithProgress_1.newError)(configProjectFile.substr(configErrorString.length) +
66
+ ' Optionally, use --proj {projFile}.');
67
+ return null;
68
+ }
69
+ return path_1.default.join(windowsAppConfig.folder, windowsAppConfig.sourceDir, configProjectFile);
70
+ }
71
+ }
72
+ exports.getAppProjectFile = getAppProjectFile;
73
+ function parseMsBuildProps(options) {
74
+ const result = {};
75
+ if (options.msbuildprops) {
76
+ const props = options.msbuildprops.split(',');
77
+ for (const prop of props) {
78
+ const propAssignment = prop.split('=');
79
+ result[propAssignment[0]] = propAssignment[1];
80
+ }
81
+ }
82
+ return result;
83
+ }
84
+ exports.parseMsBuildProps = parseMsBuildProps;
85
85
  //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/utils/build.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,gDAAwB;AAExB,kEAA0C;AAC1C,wDAAgC;AAChC,+DAA+C;AAO/C,+DAA2D;AAEpD,KAAK,UAAU,aAAa,CACjC,UAAwB,EACxB,OAAe,EACf,SAAsB,EACtB,SAAoB,EACpB,YAAoC,EACpC,OAAgB,EAChB,MAA0B,EAC1B,iBAA0B,EAC1B,UAAoB;IAEpB,MAAM,UAAU,GAAG,IAAI,iBAAO,CAAC,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAChD,MAAM,WAAW,GAAG,sBAAY,CAAC,0BAA0B,EAAE,CAAC;IAC9D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE;QAC7C,MAAM,IAAI,sBAAU,CAClB,qBAAqB,EACrB,gEAAgE,CACjE,CAAC;KACH;IAED,MAAM,UAAU,CAAC,YAAY,CAC3B,OAAO,EACP,SAAS,EACT,SAAS,EACT,YAAY,EACZ,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,UAAU,CACX,CAAC;AACJ,CAAC;AA9BD,sCA8BC;AAED,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAEpC,SAAgB,kBAAkB,CAAC,OAA0B,EAAE,MAAc;IAC3E,qCAAqC;IACrC,IAAI,OAAO,CAAC,GAAG,EAAE;QACf,OAAO,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;KAC7C;IAED,4CAA4C;IAC5C,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;IAChD,IAAI,CAAC,gBAAgB,EAAE;QACrB,MA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AAC;SACb;QACD,OAAO,cAAI,CAAC,IAAI,CACd,gBAAgB,CAAC,MAAM,EACvB,gBAAgB,CAAC,SAAS,EAC1B,iBAAiB,CAClB,CAAC;KACH;AACH,CAAC;AAlCD,8CAkCC;AAED,SAAgB,iBAAiB,CAC/B,OAA0B;IAE1B,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,OAAO,CAAC,YAAY,EAAE;QACxB,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;SAC/C;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAZD,8CAYC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport path from 'path';\n\nimport MSBuildTools from './msbuildtools';\nimport Version from './version';\nimport {newError} from './commandWithProgress';\nimport {\n RunWindowsOptions,\n BuildConfig,\n BuildArch,\n} from '../commands/runWindows/runWindowsOptions';\nimport {Config} from '@react-native-community/cli-types';\nimport {CodedError} from '@react-native-windows/telemetry';\n\nexport async function buildSolution(\n buildTools: MSBuildTools,\n slnFile: string,\n buildType: BuildConfig,\n buildArch: BuildArch,\n msBuildProps: Record<string, string>,\n verbose: boolean,\n target: 'build' | 'deploy',\n buildLogDirectory?: string,\n singleproc?: boolean,\n) {\n const minVersion = new Version(10, 0, 19041, 0);\n const allVersions = MSBuildTools.getAllAvailableUAPVersions();\n if (!allVersions.some(v => v.gte(minVersion))) {\n throw new CodedError(\n 'MinSDKVersionNotMet',\n 'Must have a minimum Windows SDK version 10.0.19041.0 installed',\n );\n }\n\n await buildTools.buildProject(\n slnFile,\n buildType,\n buildArch,\n msBuildProps,\n verbose,\n target,\n buildLogDirectory,\n singleproc,\n );\n}\n\nconst configErrorString = 'Error: ';\n\nexport function getAppSolutionFile(options: RunWindowsOptions, config: Config) {\n // Use the solution file if specified\n if (options.sln) {\n return path.join(options.root, options.sln);\n }\n\n // Check the answer from react-native config\n const windowsAppConfig = config.project.windows;\n if (!windowsAppConfig) {\n throw new CodedError(\n 'NoWindowsConfig',\n \"Couldn't determine Windows app config\",\n );\n }\n const configSolutionFile = windowsAppConfig.solutionFile;\n\n if (configSolutionFile.startsWith(configErrorString)) {\n newError(\n configSolutionFile.substr(configErrorString.length) +\n ' Optionally, use --sln {slnFile}.',\n );\n return null;\n } else {\n return path.join(\n windowsAppConfig.folder,\n windowsAppConfig.sourceDir,\n configSolutionFile,\n );\n }\n}\n\nexport function getAppProjectFile(options: RunWindowsOptions, config: Config) {\n // Use the project file if specified\n if (options.proj) {\n return path.join(options.root, options.proj);\n }\n\n // Check the answer from react-native config\n const windowsAppConfig = config.project.windows;\n const configProject = windowsAppConfig.project;\n\n if (\n typeof configProject === 'string' &&\n configProject.startsWith(configErrorString)\n ) {\n newError(\n configProject.substr(configErrorString.length) +\n ' Optionally, use --proj {projFile}.',\n );\n return null;\n } else {\n const configProjectFile = configProject.projectFile;\n if (configProjectFile.startsWith(configErrorString)) {\n newError(\n configProjectFile.substr(configErrorString.length) +\n ' Optionally, use --proj {projFile}.',\n );\n return null;\n }\n return path.join(\n windowsAppConfig.folder,\n windowsAppConfig.sourceDir,\n configProjectFile,\n );\n }\n}\n\nexport function parseMsBuildProps(\n options: RunWindowsOptions,\n): Record<string, string> {\n const result: Record<string, string> = {};\n if (options.msbuildprops) {\n const props = options.msbuildprops.split(',');\n for (const prop of props) {\n const propAssignment = prop.split('=');\n result[propAssignment[0]] = propAssignment[1];\n }\n }\n return result;\n}\n"]}
@@ -1,6 +1,6 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
- export declare function isWinSdkPresent(target: string): string;
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ * @format
5
+ */
6
+ export declare function isWinSdkPresent(target: string): string;
@@ -1,70 +1,70 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- * @format
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.isWinSdkPresent = void 0;
12
- const telemetry_1 = require("@react-native-windows/telemetry");
13
- const child_process_1 = require("child_process");
14
- const path_1 = __importDefault(require("path"));
15
- const shelljs_1 = __importDefault(require("shelljs"));
16
- const version_1 = __importDefault(require("./version"));
17
- const REQUIRED_VERSIONS = {
18
- '10.0': {
19
- os: new version_1.default(6, 3),
20
- msbuild: new version_1.default(14, 0),
21
- visualstudio: new version_1.default(14, 0),
22
- windowssdk: new version_1.default(10, 0),
23
- phonesdk: new version_1.default(10, 0),
24
- },
25
- };
26
- function shortenVersion(version) {
27
- return /^(\d+(?:\.\d+)?)/.exec(version.toString())[1];
28
- }
29
- function getMinimalRequiredVersionFor(requirement, windowsTargetVersion) {
30
- return REQUIRED_VERSIONS[windowsTargetVersion][requirement];
31
- }
32
- function getInstalledWindowsSdks() {
33
- const installedSdks = [];
34
- const execString = 'reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows" /s /v InstallationFolder /reg:32';
35
- let output;
36
- try {
37
- output = (0, child_process_1.execSync)(execString).toString();
38
- }
39
- catch (e) {
40
- return installedSdks;
41
- }
42
- const re = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim;
43
- let match;
44
- while ((match = re.exec(output))) {
45
- const sdkPath = match[2];
46
- if (shelljs_1.default.test('-e', path_1.default.join(sdkPath, 'SDKManifest.xml'))) {
47
- const sdkVersion = version_1.default.tryParse(match[1]);
48
- if (!sdkVersion) {
49
- throw new telemetry_1.CodedError('BadSDKVersionFormat', `Unexpected SDK version format for '${match[1]}'`);
50
- }
51
- installedSdks.push(sdkVersion);
52
- }
53
- }
54
- return installedSdks;
55
- }
56
- function checkWinSdk(windowsTargetVersion) {
57
- const installedSdks = getInstalledWindowsSdks();
58
- const requiredVersion = getMinimalRequiredVersionFor('windowssdk', windowsTargetVersion);
59
- const hasSdkInstalled = installedSdks.some(installedSdk => installedSdk.eq(requiredVersion));
60
- if (hasSdkInstalled) {
61
- return shortenVersion(requiredVersion);
62
- }
63
- const shortenedVersion = shortenVersion(requiredVersion);
64
- throw new telemetry_1.CodedError('NoSDK', `Windows SDK not found. Ensure that you have installed Windows ${shortenedVersion} SDK along with Visual Studio or install Windows ${shortenedVersion} SDK separately from https://dev.windows.com/en-us/downloads`);
65
- }
66
- function isWinSdkPresent(target) {
67
- return checkWinSdk(target);
68
- }
69
- exports.isWinSdkPresent = isWinSdkPresent;
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ * @format
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.isWinSdkPresent = void 0;
12
+ const telemetry_1 = require("@react-native-windows/telemetry");
13
+ const child_process_1 = require("child_process");
14
+ const path_1 = __importDefault(require("path"));
15
+ const shelljs_1 = __importDefault(require("shelljs"));
16
+ const version_1 = __importDefault(require("./version"));
17
+ const REQUIRED_VERSIONS = {
18
+ '10.0': {
19
+ os: new version_1.default(6, 3),
20
+ msbuild: new version_1.default(14, 0),
21
+ visualstudio: new version_1.default(14, 0),
22
+ windowssdk: new version_1.default(10, 0),
23
+ phonesdk: new version_1.default(10, 0),
24
+ },
25
+ };
26
+ function shortenVersion(version) {
27
+ return /^(\d+(?:\.\d+)?)/.exec(version.toString())[1];
28
+ }
29
+ function getMinimalRequiredVersionFor(requirement, windowsTargetVersion) {
30
+ return REQUIRED_VERSIONS[windowsTargetVersion][requirement];
31
+ }
32
+ function getInstalledWindowsSdks() {
33
+ const installedSdks = [];
34
+ const execString = 'reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows" /s /v InstallationFolder /reg:32';
35
+ let output;
36
+ try {
37
+ output = (0, child_process_1.execSync)(execString).toString();
38
+ }
39
+ catch (e) {
40
+ return installedSdks;
41
+ }
42
+ const re = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim;
43
+ let match;
44
+ while ((match = re.exec(output))) {
45
+ const sdkPath = match[2];
46
+ if (shelljs_1.default.test('-e', path_1.default.join(sdkPath, 'SDKManifest.xml'))) {
47
+ const sdkVersion = version_1.default.tryParse(match[1]);
48
+ if (!sdkVersion) {
49
+ throw new telemetry_1.CodedError('BadSDKVersionFormat', `Unexpected SDK version format for '${match[1]}'`);
50
+ }
51
+ installedSdks.push(sdkVersion);
52
+ }
53
+ }
54
+ return installedSdks;
55
+ }
56
+ function checkWinSdk(windowsTargetVersion) {
57
+ const installedSdks = getInstalledWindowsSdks();
58
+ const requiredVersion = getMinimalRequiredVersionFor('windowssdk', windowsTargetVersion);
59
+ const hasSdkInstalled = installedSdks.some(installedSdk => installedSdk.eq(requiredVersion));
60
+ if (hasSdkInstalled) {
61
+ return shortenVersion(requiredVersion);
62
+ }
63
+ const shortenedVersion = shortenVersion(requiredVersion);
64
+ throw new telemetry_1.CodedError('NoSDK', `Windows SDK not found. Ensure that you have installed Windows ${shortenedVersion} SDK along with Visual Studio or install Windows ${shortenedVersion} SDK separately from https://dev.windows.com/en-us/downloads`);
65
+ }
66
+ function isWinSdkPresent(target) {
67
+ return checkWinSdk(target);
68
+ }
69
+ exports.isWinSdkPresent = isWinSdkPresent;
70
70
  //# sourceMappingURL=checkRequirements.js.map
@@ -0,0 +1 @@
1
+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AG,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,iBAAK,CAAC,IAAI,CAAC,IAAI,EAAE,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,EAAE;YAC3D,MAAM,UAAU,GAAG,iBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,UAAU,EAAE;gBACf,MAAM,IAAI,sBAAU,CAClB,qBAAqB,EACrB,sCAAsC,KAAK,CAAC,CAAC,CAAC,GAAG,CAClD,CAAC;aACH;YACD,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAChC;KACF;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAS,WAAW,CAAC,oBAA4B;IAC/C,MAAM,aAAa,GAAG,uBAAuB,EAAE,CAAC;IAChD,MAAM,eAAe,GAAG,4BAA4B,CAClD,YAAY,EACZ,oBAAoB,CACrB,CAAC;IACF,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CACxD,YAAY,CAAC,EAAE,CAAC,eAAe,CAAC,CACjC,CAAC;IAEF,IAAI,eAAe,EAAE;QACnB,OAAO,cAAc,CAAC,eAAe,CAAC,CAAC;KACxC;IAED,MAAM,gBAAgB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;IACzD,MAAM,IAAI,sBAAU,CAClB,OAAO,EACP,iEAAiE,gBAAgB,oDAAoD,gBAAgB,8DAA8D,CACpN,CAAC;AACJ,CAAC;AAED,SAAgB,eAAe,CAAC,MAAc;IAC5C,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AAFD,0CAEC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {CodedError} from '@react-native-windows/telemetry';\nimport {execSync} from 'child_process';\nimport path from 'path';\nimport shell from 'shelljs';\nimport Version from './version';\n\ntype Requirement =\n | 'os'\n | 'msbuild'\n | 'visualstudio'\n | 'windowssdk'\n | 'phonesdk';\n\nconst REQUIRED_VERSIONS: Record<string, Record<Requirement, Version>> = {\n '10.0': {\n os: new Version(6, 3),\n msbuild: new Version(14, 0),\n visualstudio: new Version(14, 0),\n windowssdk: new Version(10, 0),\n phonesdk: new Version(10, 0),\n },\n};\n\nfunction shortenVersion(version: Version): string {\n return /^(\\d+(?:\\.\\d+)?)/.exec(version.toString())![1];\n}\n\nfunction getMinimalRequiredVersionFor(\n requirement: Requirement,\n windowsTargetVersion: keyof typeof REQUIRED_VERSIONS,\n): Version {\n return REQUIRED_VERSIONS[windowsTargetVersion][requirement];\n}\n\nfunction getInstalledWindowsSdks(): Version[] {\n const installedSdks: Version[] = [];\n\n const execString =\n 'reg query \"HKLM\\\\SOFTWARE\\\\Microsoft\\\\Microsoft SDKs\\\\Windows\" /s /v InstallationFolder /reg:32';\n let output: string;\n try {\n output = execSync(execString).toString();\n } catch (e) {\n return installedSdks;\n }\n\n const re =\n /\\\\Microsoft SDKs\\\\Windows\\\\v(\\d+\\.\\d+)\\s*InstallationFolder\\s+REG_SZ\\s+(.*)/gim;\n let match: RegExpExecArray | null;\n while ((match = re.exec(output))) {\n const sdkPath = match[2];\n if (shell.test('-e', path.join(sdkPath, 'SDKManifest.xml'))) {\n const sdkVersion = Version.tryParse(match[1]);\n if (!sdkVersion) {\n throw new CodedError(\n 'BadSDKVersionFormat',\n `Unexpected SDK version format for '${match[1]}'`,\n );\n }\n installedSdks.push(sdkVersion);\n }\n }\n\n return installedSdks;\n}\n\nfunction checkWinSdk(windowsTargetVersion: string): string {\n const installedSdks = getInstalledWindowsSdks();\n const requiredVersion = getMinimalRequiredVersionFor(\n 'windowssdk',\n windowsTargetVersion,\n );\n const hasSdkInstalled = installedSdks.some(installedSdk =>\n installedSdk.eq(requiredVersion),\n );\n\n if (hasSdkInstalled) {\n return shortenVersion(requiredVersion);\n }\n\n const shortenedVersion = shortenVersion(requiredVersion);\n throw new CodedError(\n 'NoSDK',\n `Windows SDK not found. Ensure that you have installed Windows ${shortenedVersion} SDK along with Visual Studio or install Windows ${shortenedVersion} SDK separately from https://dev.windows.com/en-us/downloads`,\n );\n}\n\nexport function isWinSdkPresent(target: string): string {\n return checkWinSdk(target);\n}\n"]}
@@ -1,15 +1,21 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
- import ora from 'ora';
7
- import { CodedErrorType } from '@react-native-windows/telemetry';
8
- export declare function newSpinner(text: string): ora.Ora;
9
- export declare const powershell: string;
10
- export declare function runPowerShellScriptFunction(taskDescription: string, script: string | null, funcName: string, verbose: boolean, errorCategory: CodedErrorType): Promise<void>;
11
- export declare function commandWithProgress(spinner: ora.Ora, taskDoingName: string, command: string, args: string[], verbose: boolean, errorCategory: CodedErrorType): Promise<void>;
12
- export declare function newError(text: string): void;
13
- export declare function newWarn(text: string): void;
14
- export declare function newSuccess(text: string): void;
15
- export declare function newInfo(text: string): void;
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ * @format
5
+ */
6
+ import ora from 'ora';
7
+ import { CodedErrorType } from '@react-native-windows/telemetry';
8
+ export declare function newSpinner(text: string): ora.Ora;
9
+ export declare const powershell: string;
10
+ export declare function runPowerShellScriptFunction(taskDescription: string, script: string | null, funcName: string, verbose: boolean, errorCategory: CodedErrorType): Promise<void>;
11
+ export declare function commandWithProgress(spinner: ora.Ora, taskDoingName: string, command: string, args: string[], verbose: boolean, errorCategory: CodedErrorType): Promise<void>;
12
+ export declare function newError(text: string): void;
13
+ export declare function newWarn(text: string): void;
14
+ export declare function newSuccess(text: string): void;
15
+ export declare function newInfo(text: string): void;
16
+ /**
17
+ * Sets the process exit code and offers some information at the end of a CLI command.
18
+ * @param loggingIsEnabled Is verbose logging enabled.
19
+ * @param error The error caught during the process, if any.
20
+ */
21
+ export declare function setExitProcessWithError(loggingIsEnabled?: boolean, error?: Error): void;