@react-native-windows/cli 0.0.0-canary.17 → 0.0.0-canary.170

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 (89) hide show
  1. package/README.md +47 -0
  2. package/lib-commonjs/codegen.d.ts +32 -0
  3. package/lib-commonjs/codegen.js +194 -0
  4. package/lib-commonjs/codegen.js.map +1 -0
  5. package/lib-commonjs/config/configUtils.d.ts +25 -2
  6. package/lib-commonjs/config/configUtils.js +138 -30
  7. package/lib-commonjs/config/configUtils.js.map +1 -1
  8. package/lib-commonjs/config/dependencyConfig.js +104 -43
  9. package/lib-commonjs/config/dependencyConfig.js.map +1 -1
  10. package/lib-commonjs/config/projectConfig.d.ts +4 -1
  11. package/lib-commonjs/config/projectConfig.js +72 -12
  12. package/lib-commonjs/config/projectConfig.js.map +1 -1
  13. package/lib-commonjs/e2etest/autolink.test.d.ts +6 -0
  14. package/lib-commonjs/e2etest/autolink.test.js +366 -0
  15. package/lib-commonjs/e2etest/autolink.test.js.map +1 -0
  16. package/lib-commonjs/e2etest/dependencyConfig.test.d.ts +6 -0
  17. package/lib-commonjs/e2etest/dependencyConfig.test.js +130 -0
  18. package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -0
  19. package/lib-commonjs/e2etest/healthChecks.test.d.ts +6 -0
  20. package/lib-commonjs/e2etest/healthChecks.test.js +31 -0
  21. package/lib-commonjs/e2etest/healthChecks.test.js.map +1 -0
  22. package/lib-commonjs/e2etest/projectConfig.test.d.ts +6 -0
  23. package/lib-commonjs/e2etest/projectConfig.test.js +111 -0
  24. package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -0
  25. package/lib-commonjs/e2etest/projectConfig.utils.d.ts +8 -0
  26. package/lib-commonjs/e2etest/projectConfig.utils.js +77 -0
  27. package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -0
  28. package/lib-commonjs/e2etest/runWindows.test.d.ts +6 -0
  29. package/lib-commonjs/e2etest/runWindows.test.js +61 -0
  30. package/lib-commonjs/e2etest/runWindows.test.js.map +1 -0
  31. package/lib-commonjs/generator-common/index.d.ts +17 -1
  32. package/lib-commonjs/generator-common/index.js +60 -39
  33. package/lib-commonjs/generator-common/index.js.map +1 -1
  34. package/lib-commonjs/generator-windows/index.d.ts +2 -2
  35. package/lib-commonjs/generator-windows/index.js +184 -202
  36. package/lib-commonjs/generator-windows/index.js.map +1 -1
  37. package/lib-commonjs/healthCheckList.d.ts +1 -0
  38. package/lib-commonjs/healthCheckList.js +16 -0
  39. package/lib-commonjs/healthCheckList.js.map +1 -0
  40. package/lib-commonjs/healthChecks.d.ts +2 -0
  41. package/lib-commonjs/healthChecks.js +84 -0
  42. package/lib-commonjs/healthChecks.js.map +1 -0
  43. package/lib-commonjs/index.d.ts +4 -0
  44. package/lib-commonjs/index.js +30 -9
  45. package/lib-commonjs/index.js.map +1 -1
  46. package/lib-commonjs/runWindows/runWindows.js +220 -55
  47. package/lib-commonjs/runWindows/runWindows.js.map +1 -1
  48. package/lib-commonjs/runWindows/runWindowsOptions.d.ts +15 -11
  49. package/lib-commonjs/runWindows/runWindowsOptions.js +15 -11
  50. package/lib-commonjs/runWindows/runWindowsOptions.js.map +1 -1
  51. package/lib-commonjs/runWindows/utils/autolink.d.ts +88 -1
  52. package/lib-commonjs/runWindows/utils/autolink.js +593 -260
  53. package/lib-commonjs/runWindows/utils/autolink.js.map +1 -1
  54. package/lib-commonjs/runWindows/utils/build.d.ts +1 -2
  55. package/lib-commonjs/runWindows/utils/build.js +24 -31
  56. package/lib-commonjs/runWindows/utils/build.js.map +1 -1
  57. package/lib-commonjs/runWindows/utils/checkRequirements.js +11 -7
  58. package/lib-commonjs/runWindows/utils/checkRequirements.js.map +1 -1
  59. package/lib-commonjs/runWindows/utils/commandWithProgress.d.ts +11 -3
  60. package/lib-commonjs/runWindows/utils/commandWithProgress.js +58 -22
  61. package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +1 -1
  62. package/lib-commonjs/runWindows/utils/deploy.d.ts +1 -1
  63. package/lib-commonjs/runWindows/utils/deploy.js +168 -82
  64. package/lib-commonjs/runWindows/utils/deploy.js.map +1 -1
  65. package/lib-commonjs/runWindows/utils/info.js +5 -2
  66. package/lib-commonjs/runWindows/utils/info.js.map +1 -1
  67. package/lib-commonjs/runWindows/utils/msbuildtools.d.ts +12 -6
  68. package/lib-commonjs/runWindows/utils/msbuildtools.js +145 -66
  69. package/lib-commonjs/runWindows/utils/msbuildtools.js.map +1 -1
  70. package/lib-commonjs/runWindows/utils/telemetryHelpers.d.ts +29 -0
  71. package/lib-commonjs/runWindows/utils/telemetryHelpers.js +113 -0
  72. package/lib-commonjs/runWindows/utils/telemetryHelpers.js.map +1 -0
  73. package/lib-commonjs/runWindows/utils/version.d.ts +4 -4
  74. package/lib-commonjs/runWindows/utils/version.js.map +1 -1
  75. package/lib-commonjs/runWindows/utils/vsInstalls.d.ts +2 -2
  76. package/lib-commonjs/runWindows/utils/vsInstalls.js +40 -10
  77. package/lib-commonjs/runWindows/utils/vsInstalls.js.map +1 -1
  78. package/lib-commonjs/runWindows/utils/vstools.d.ts +1 -0
  79. package/lib-commonjs/runWindows/utils/vstools.js +73 -33
  80. package/lib-commonjs/runWindows/utils/vstools.js.map +1 -1
  81. package/lib-commonjs/runWindows/utils/winappdeploytool.d.ts +3 -3
  82. package/lib-commonjs/runWindows/utils/winappdeploytool.js +17 -14
  83. package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +1 -1
  84. package/package.json +46 -23
  85. package/powershell/Add-AppDevPackage.ps1 +2 -2
  86. package/powershell/Eval-MsBuildProperties.ps1 +156 -0
  87. package/powershell/WindowsStoreAppUtils.ps1 +10 -0
  88. package/CHANGELOG.json +0 -251
  89. package/CHANGELOG.md +0 -126
@@ -4,33 +4,111 @@
4
4
  * Licensed under the MIT License.
5
5
  * @format
6
6
  */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || function (mod) {
24
+ if (mod && mod.__esModule) return mod;
25
+ var result = {};
26
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
27
+ __setModuleDefault(result, mod);
28
+ return result;
29
+ };
30
+ var __importDefault = (this && this.__importDefault) || function (mod) {
31
+ return (mod && mod.__esModule) ? mod : { "default": mod };
32
+ };
7
33
  Object.defineProperty(exports, "__esModule", { value: true });
8
34
  exports.runWindowsCommand = void 0;
9
- const build = require("./utils/build");
10
- const chalk = require("chalk");
11
- const deploy = require("./utils/deploy");
35
+ const fs_1 = __importDefault(require("@react-native-windows/fs"));
36
+ const path_1 = __importDefault(require("path"));
37
+ const telemetry_1 = require("@react-native-windows/telemetry");
38
+ const build = __importStar(require("./utils/build"));
39
+ const chalk_1 = __importDefault(require("chalk"));
40
+ const deploy = __importStar(require("./utils/deploy"));
12
41
  const commandWithProgress_1 = require("./utils/commandWithProgress");
13
- const info = require("./utils/info");
14
- const msbuildtools_1 = require("./utils/msbuildtools");
42
+ const telemetryHelpers_1 = require("./utils/telemetryHelpers");
43
+ const info = __importStar(require("./utils/info"));
44
+ const msbuildtools_1 = __importDefault(require("./utils/msbuildtools"));
15
45
  const runWindowsOptions_1 = require("./runWindowsOptions");
16
46
  const autolink_1 = require("./utils/autolink");
17
- function ExitProcessWithError(loggingWasEnabled) {
18
- if (!loggingWasEnabled) {
19
- console.log(`Re-run the command with ${chalk.bold('--logging')} for more information`);
47
+ /**
48
+ * Sanitizes the given option for telemetry.
49
+ * @param key The key of the option.
50
+ * @param value The unsanitized value of the option.
51
+ * @returns The sanitized value of the option.
52
+ */
53
+ // eslint-disable-next-line complexity
54
+ function optionSanitizer(key, value) {
55
+ // Do not add a default case here.
56
+ // Strings risking PII should just return true if present, false otherwise.
57
+ // All others should return the value (or false if undefined).
58
+ switch (key) {
59
+ case 'root':
60
+ case 'target':
61
+ case 'sln':
62
+ case 'proj':
63
+ case 'buildLogDirectory':
64
+ return value === undefined ? false : true; // Strip PII
65
+ case 'msbuildprops':
66
+ return value === undefined ? 0 : value.split(',').length; // Convert to count
67
+ case 'release':
68
+ case 'arch':
69
+ case 'singleproc':
70
+ case 'emulator':
71
+ case 'device':
72
+ case 'remoteDebugging':
73
+ case 'logging':
74
+ case 'packager':
75
+ case 'bundle':
76
+ case 'launch':
77
+ case 'autolink':
78
+ case 'build':
79
+ case 'deploy':
80
+ case 'deployFromLayout':
81
+ case 'info':
82
+ case 'directDebugging':
83
+ case 'telemetry':
84
+ return value === undefined ? false : value; // Return value
20
85
  }
21
- process.exit(1);
22
86
  }
23
87
  /**
24
- * Performs build deploy and launch of RNW apps.
88
+ * Get the extra props to add to the `run-windows` telemetry event.
89
+ * @returns The extra props.
90
+ */
91
+ async function getExtraProps() {
92
+ const extraProps = {
93
+ phase: runWindowsPhase,
94
+ hasRunRnwDependencies,
95
+ msBuildProps: evaluateMSBuildPropsCallback
96
+ ? evaluateMSBuildPropsCallback()
97
+ : {},
98
+ };
99
+ return extraProps;
100
+ }
101
+ let runWindowsPhase = 'None';
102
+ let hasRunRnwDependencies = false;
103
+ let evaluateMSBuildPropsCallback;
104
+ /**
105
+ * The function run when calling `react-native run-windows`.
25
106
  * @param args Unprocessed args passed from react-native CLI.
26
107
  * @param config Config passed from react-native CLI.
27
108
  * @param options Options passed from react-native CLI.
28
109
  */
29
110
  async function runWindows(args, config, options) {
30
- const verbose = options.logging;
31
- if (verbose) {
32
- commandWithProgress_1.newInfo('Verbose: ON');
33
- }
111
+ await (0, telemetryHelpers_1.startTelemetrySession)('run-windows', config, options, (0, telemetryHelpers_1.getDefaultOptions)(config, runWindowsOptions_1.runWindowsOptions), optionSanitizer);
34
112
  // https://github.com/yarnpkg/yarn/issues/8334 - Yarn on Windows breaks apps that read from the environment variables
35
113
  // Yarn will run node via CreateProcess and pass npm_config_* variables in lowercase without unifying their value
36
114
  // with their possibly existing uppercase counterparts. This breaks programs that read from the environment block
@@ -39,105 +117,192 @@ async function runWindows(args, config, options) {
39
117
  // uppercase variable values one if there are no overrides.
40
118
  delete process.env.NPM_CONFIG_CACHE;
41
119
  delete process.env.NPM_CONFIG_PREFIX;
120
+ if (process.env.LocalAppData) {
121
+ hasRunRnwDependencies = fs_1.default.existsSync(path_1.default.join(process.env.LocalAppData, 'rnw-dependencies.txt')); // CODESYNC \vnext\scripts\rnw-dependencies.ps1
122
+ }
123
+ let runWindowsError;
42
124
  if (options.info) {
125
+ runWindowsPhase = 'Info';
43
126
  try {
44
127
  const output = await info.getEnvironmentInfo();
45
128
  console.log(output.trimEnd());
46
129
  console.log(' Installed UWP SDKs:');
47
130
  const sdks = msbuildtools_1.default.getAllAvailableUAPVersions();
48
131
  sdks.forEach(version => console.log(' ' + version));
49
- return;
50
132
  }
51
- catch (e) {
52
- commandWithProgress_1.newError('Unable to print environment info.\n' + e.toString());
53
- ExitProcessWithError(options.logging);
133
+ catch (ex) {
134
+ runWindowsError =
135
+ ex instanceof Error ? ex : new Error(String(ex));
136
+ telemetry_1.Telemetry.trackException(runWindowsError);
137
+ (0, commandWithProgress_1.newError)('Unable to print environment info.\n' + runWindowsError.toString());
138
+ }
139
+ await (0, telemetryHelpers_1.endTelemetrySession)(runWindowsError, getExtraProps);
140
+ (0, commandWithProgress_1.setExitProcessWithError)(options.logging, runWindowsError);
141
+ return;
142
+ }
143
+ try {
144
+ await runWindowsInternal(args, config, options);
145
+ }
146
+ catch (ex) {
147
+ runWindowsError =
148
+ ex instanceof Error ? ex : new Error(String(ex));
149
+ telemetry_1.Telemetry.trackException(runWindowsError);
150
+ if (!hasRunRnwDependencies) {
151
+ const rnwPkgJsonPath = require.resolve('react-native-windows/package.json', {
152
+ paths: [process.cwd(), __dirname],
153
+ });
154
+ const rnwDependenciesPath = path_1.default.join(path_1.default.dirname(rnwPkgJsonPath), 'scripts/rnw-dependencies.ps1');
155
+ (0, commandWithProgress_1.newError)(`It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running ${rnwDependenciesPath} from an elevated PowerShell prompt.\nFor more information, go to http://aka.ms/rnw-deps`);
54
156
  }
55
157
  }
158
+ await (0, telemetryHelpers_1.endTelemetrySession)(runWindowsError, getExtraProps);
159
+ (0, commandWithProgress_1.setExitProcessWithError)(options.logging, runWindowsError);
160
+ }
161
+ /**
162
+ * Performs build deploy and launch of RNW apps.
163
+ * @param args Unprocessed args passed from react-native CLI.
164
+ * @param config Config passed from react-native CLI.
165
+ * @param options Options passed from react-native CLI.
166
+ */
167
+ async function runWindowsInternal(args, config, options) {
168
+ const verbose = options.logging === true;
169
+ if (verbose) {
170
+ (0, commandWithProgress_1.newInfo)('Verbose: ON');
171
+ }
56
172
  // Get the solution file
57
- const slnFile = build.getAppSolutionFile(options, config);
58
- if (options.autolink) {
59
- const autolinkArgs = [];
60
- const autolinkConfig = config;
61
- const autoLinkOptions = {
62
- logging: options.logging,
63
- proj: options.proj,
64
- sln: options.sln,
65
- };
66
- await autolink_1.autoLinkCommand.func(autolinkArgs, autolinkConfig, autoLinkOptions);
173
+ let slnFile;
174
+ runWindowsPhase = 'FindSolution';
175
+ try {
176
+ slnFile = build.getAppSolutionFile(options, config);
67
177
  }
68
- else {
69
- commandWithProgress_1.newInfo('Autolink step is skipped');
178
+ catch (e) {
179
+ (0, commandWithProgress_1.newError)(`Couldn't get app solution information. ${e.message}`);
180
+ throw e;
70
181
  }
71
182
  let buildTools;
183
+ runWindowsPhase = 'FindBuildTools';
72
184
  try {
73
185
  buildTools = msbuildtools_1.default.findAvailableVersion(options.arch, verbose);
74
186
  }
75
187
  catch (error) {
76
- commandWithProgress_1.newWarn('No public VS release found');
188
+ (0, commandWithProgress_1.newWarn)('No public VS release found');
77
189
  // Try prerelease
78
190
  try {
79
- commandWithProgress_1.newInfo('Trying pre-release VS');
191
+ (0, commandWithProgress_1.newInfo)('Trying pre-release VS');
80
192
  buildTools = msbuildtools_1.default.findAvailableVersion(options.arch, verbose, true);
81
193
  }
82
- catch (_a) {
194
+ catch (e) {
195
+ (0, commandWithProgress_1.newError)(e.message);
83
196
  throw error;
84
197
  }
85
198
  }
86
- if (options.build) {
87
- if (!slnFile) {
88
- commandWithProgress_1.newError('Visual Studio Solution file not found. Maybe run "react-native windows" first?');
89
- ExitProcessWithError(options.logging);
199
+ // Set up the callback to capture MSBuild properties after the command completes
200
+ evaluateMSBuildPropsCallback = () => {
201
+ const projectFile = build.getAppProjectFile(options, config);
202
+ if (projectFile) {
203
+ if (verbose) {
204
+ (0, commandWithProgress_1.newInfo)('Gathering MSBuild data for telemetry.');
205
+ }
206
+ const msBuildPropertiesJsonPath = path_1.default.resolve(path_1.default.dirname(projectFile), 'Generated Files', 'msbuildproperties.g.json');
207
+ if (fs_1.default.existsSync(msBuildPropertiesJsonPath)) {
208
+ if (verbose) {
209
+ (0, commandWithProgress_1.newInfo)('Loading properties from msbuildproperties.g.json');
210
+ }
211
+ return fs_1.default.readJsonFileSync(msBuildPropertiesJsonPath);
212
+ }
213
+ if (verbose) {
214
+ (0, commandWithProgress_1.newInfo)('Unable to find msbuildproperties.g.json');
215
+ }
90
216
  }
217
+ return {};
218
+ };
219
+ // Restore packages.config files for dependencies that don't support PackageReference.
220
+ runWindowsPhase = 'RestorePackagesConfig';
221
+ const buildType = deploy.getBuildConfiguration(options);
222
+ try {
223
+ await buildTools.restorePackageConfigs(slnFile, options.arch, buildType);
224
+ }
225
+ catch (e) {
226
+ (0, commandWithProgress_1.newError)(`Couldn't restore found packages.config instances. ${e.message}`);
227
+ throw e;
228
+ }
229
+ if (options.autolink) {
230
+ runWindowsPhase = 'Autolink';
91
231
  try {
92
- await build.restoreNuGetPackages(slnFile, buildTools, verbose);
232
+ const autolinkArgs = [];
233
+ const autolinkConfig = config;
234
+ const autoLinkOptions = {
235
+ logging: options.logging,
236
+ check: false,
237
+ proj: options.proj,
238
+ sln: options.sln,
239
+ telemetry: options.telemetry,
240
+ };
241
+ await (0, autolink_1.autolinkWindowsInternal)(autolinkArgs, autolinkConfig, autoLinkOptions);
93
242
  }
94
243
  catch (e) {
95
- commandWithProgress_1.newError('Failed to restore the NuGet packages: ' + e.toString());
96
- ExitProcessWithError(options.logging);
244
+ (0, commandWithProgress_1.newError)(`Autolinking failed. ${e.message}`);
245
+ throw e;
246
+ }
247
+ }
248
+ else {
249
+ (0, commandWithProgress_1.newInfo)('Autolink step is skipped');
250
+ }
251
+ if (options.build) {
252
+ runWindowsPhase = 'Build';
253
+ if (!slnFile) {
254
+ (0, commandWithProgress_1.newError)('Visual Studio Solution file not found. Maybe run "npx react-native-windows-init" first?');
255
+ throw new telemetry_1.CodedError('NoSolution', 'Cannot find solution file');
97
256
  }
98
257
  // Get build/deploy options
99
- const buildType = deploy.getBuildConfiguration(options);
100
- var msBuildProps = build.parseMsBuildProps(options);
258
+ const msBuildProps = build.parseMsBuildProps(options);
101
259
  // Disable the autolink check since we just ran it
102
260
  msBuildProps.RunAutolinkCheck = 'false';
103
261
  try {
104
- await build.buildSolution(buildTools, slnFile, buildType, options.arch, msBuildProps, verbose, undefined, // build the default target
105
- options.buildLogDirectory, options.singleproc);
262
+ await build.buildSolution(buildTools, slnFile, buildType, options.arch, msBuildProps, verbose, 'build', options.buildLogDirectory, options.singleproc);
106
263
  }
107
264
  catch (e) {
108
- commandWithProgress_1.newError(`Build failed with message ${e.message}. Check your build configuration.`);
265
+ (0, commandWithProgress_1.newError)(`Build failed with message ${e.message}. Check your build configuration.`);
109
266
  if (e.logfile) {
110
- console.log('See', chalk.bold(e.logfile));
267
+ console.log('See', chalk_1.default.bold(e.logfile));
111
268
  }
112
- ExitProcessWithError(options.logging);
269
+ throw e;
113
270
  }
114
271
  }
115
272
  else {
116
- commandWithProgress_1.newInfo('Build step is skipped');
273
+ (0, commandWithProgress_1.newInfo)('Build step is skipped');
274
+ }
275
+ if (shouldLaunchPackager(options)) {
276
+ await deploy.startServerInNewWindow(options, verbose);
117
277
  }
118
- await deploy.startServerInNewWindow(options, verbose);
119
278
  if (options.deploy) {
279
+ runWindowsPhase = 'Deploy';
120
280
  if (!slnFile) {
121
- commandWithProgress_1.newError('Visual Studio Solution file not found. Maybe run "react-native windows" first?');
122
- ExitProcessWithError(options.logging);
281
+ (0, commandWithProgress_1.newError)('Visual Studio Solution file not found. Maybe run "npx react-native-windows-init" first?');
282
+ throw new telemetry_1.CodedError('NoSolution', 'Cannot find solution file');
123
283
  }
124
284
  try {
125
285
  if (options.device || options.emulator || options.target) {
126
- await deploy.deployToDevice(options, verbose);
286
+ await deploy.deployToDevice(options, verbose, config);
127
287
  }
128
288
  else {
129
289
  await deploy.deployToDesktop(options, verbose, config, buildTools);
130
290
  }
131
291
  }
132
292
  catch (e) {
133
- commandWithProgress_1.newError(`Failed to deploy${e ? `: ${e.message}` : ''}`);
134
- ExitProcessWithError(options.logging);
293
+ (0, commandWithProgress_1.newError)(`Failed to deploy${e ? `: ${e.message}` : ''}`);
294
+ throw e;
135
295
  }
136
296
  }
137
297
  else {
138
- commandWithProgress_1.newInfo('Deploy step is skipped');
298
+ (0, commandWithProgress_1.newInfo)('Deploy step is skipped');
139
299
  }
140
300
  }
301
+ function shouldLaunchPackager(options) {
302
+ return (options.packager === true &&
303
+ options.launch === true &&
304
+ options.release !== true);
305
+ }
141
306
  /*
142
307
  // Example of running the Windows Command
143
308
  runWindows({
@@ -1 +1 @@
1
- {"version":3,"file":"runWindows.js","sourceRoot":"","sources":["../../src/runWindows/runWindows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AAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;aACvD;iBAAM;gBACL,MAAM,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;aACpE;SACF;QAAC,OAAO,CAAC,EAAE;YACV,IAAA,8BAAQ,EAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACpE,MAAM,CAAC,CAAC;SACT;KACF;SAAM;QACL,IAAA,6BAAO,EAAC,wBAAwB,CAAC,CAAC;KACnC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,OAA0B;IACtD,OAAO,CACL,OAAO,CAAC,QAAQ,KAAK,IAAI;QACzB,OAAO,CAAC,MAAM,KAAK,IAAI;QACvB,OAAO,CAAC,OAAO,KAAK,IAAI,CACzB,CAAC;AACJ,CAAC;AAED;;;;;;;;EAQE;AAEF;;GAEG;AACU,QAAA,iBAAiB,GAAY;IACxC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,kFAAkF;IACpF,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,qCAAiB;CAC3B,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport fs from '@react-native-windows/fs';\nimport path from 'path';\nimport {Telemetry, CodedError} from '@react-native-windows/telemetry';\n\nimport * as build from './utils/build';\nimport chalk from 'chalk';\nimport * as deploy from './utils/deploy';\nimport {\n newError,\n newInfo,\n newWarn,\n setExitProcessWithError,\n} from './utils/commandWithProgress';\nimport {\n getDefaultOptions,\n startTelemetrySession,\n endTelemetrySession,\n} from './utils/telemetryHelpers';\nimport * as info from './utils/info';\nimport MSBuildTools from './utils/msbuildtools';\n\nimport {Command, Config} from '@react-native-community/cli-types';\nimport {runWindowsOptions, RunWindowsOptions} from './runWindowsOptions';\n\nimport {autolinkWindowsInternal, AutoLinkOptions} from './utils/autolink';\n\n/**\n * Sanitizes the given option for telemetry.\n * @param key The key of the option.\n * @param value The unsanitized value of the option.\n * @returns The sanitized value of the option.\n */\n// eslint-disable-next-line complexity\nfunction optionSanitizer(key: keyof RunWindowsOptions, value: any): any {\n // Do not add a default case here.\n // Strings risking PII should just return true if present, false otherwise.\n // All others should return the value (or false if undefined).\n switch (key) {\n case 'root':\n case 'target':\n case 'sln':\n case 'proj':\n case 'buildLogDirectory':\n return value === undefined ? false : true; // Strip PII\n case 'msbuildprops':\n return value === undefined ? 0 : value.split(',').length; // Convert to count\n case 'release':\n case 'arch':\n case 'singleproc':\n case 'emulator':\n case 'device':\n case 'remoteDebugging':\n case 'logging':\n case 'packager':\n case 'bundle':\n case 'launch':\n case 'autolink':\n case 'build':\n case 'deploy':\n case 'deployFromLayout':\n case 'info':\n case 'directDebugging':\n case 'telemetry':\n return value === undefined ? false : value; // Return value\n }\n}\n\n/**\n * Get the extra props to add to the `run-windows` telemetry event.\n * @returns The extra props.\n */\nasync function getExtraProps(): Promise<Record<string, any>> {\n const extraProps: Record<string, any> = {\n phase: runWindowsPhase,\n hasRunRnwDependencies,\n msBuildProps: evaluateMSBuildPropsCallback\n ? evaluateMSBuildPropsCallback()\n : {},\n };\n return extraProps;\n}\n\n/**\n * Labels used by telemetry to represent current operation\n */\ntype RunWindowsPhase =\n | 'None'\n | 'Info'\n | 'FindSolution'\n | 'FindBuildTools'\n | 'Autolink'\n | 'RestorePackagesConfig'\n | 'Build'\n | 'Deploy';\n\nlet runWindowsPhase: RunWindowsPhase = 'None';\n\nlet hasRunRnwDependencies: boolean = false;\n\nlet evaluateMSBuildPropsCallback:\n | (() => Record<string, string> | null)\n | undefined;\n\n/**\n * The function run when calling `react-native run-windows`.\n * @param args Unprocessed args passed from react-native CLI.\n * @param config Config passed from react-native CLI.\n * @param options Options passed from react-native CLI.\n */\nasync function runWindows(\n args: string[],\n config: Config,\n options: RunWindowsOptions,\n) {\n await startTelemetrySession(\n 'run-windows',\n config,\n options,\n getDefaultOptions(config, runWindowsOptions),\n optionSanitizer,\n );\n\n // https://github.com/yarnpkg/yarn/issues/8334 - Yarn on Windows breaks apps that read from the environment variables\n // Yarn will run node via CreateProcess and pass npm_config_* variables in lowercase without unifying their value\n // with their possibly existing uppercase counterparts. This breaks programs that read from the environment block\n // and write to a case-insensitive dictionary since they expect to encounter each variable only once.\n // The values of the lowercase variables are the one npm actually wants to use, plus they are seeded from the\n // uppercase variable values one if there are no overrides.\n delete process.env.NPM_CONFIG_CACHE;\n delete process.env.NPM_CONFIG_PREFIX;\n\n if (process.env.LocalAppData) {\n hasRunRnwDependencies = fs.existsSync(\n path.join(process.env.LocalAppData, 'rnw-dependencies.txt'),\n ); // CODESYNC \\vnext\\scripts\\rnw-dependencies.ps1\n }\n\n let runWindowsError: Error | undefined;\n if (options.info) {\n runWindowsPhase = 'Info';\n try {\n const output = await info.getEnvironmentInfo();\n console.log(output.trimEnd());\n console.log(' Installed UWP SDKs:');\n const sdks = MSBuildTools.getAllAvailableUAPVersions();\n sdks.forEach(version => console.log(' ' + version));\n } catch (ex) {\n runWindowsError =\n ex instanceof Error ? (ex as Error) : new Error(String(ex));\n Telemetry.trackException(runWindowsError);\n\n newError(\n 'Unable to print environment info.\\n' + runWindowsError.toString(),\n );\n }\n await endTelemetrySession(runWindowsError, getExtraProps);\n setExitProcessWithError(options.logging, runWindowsError);\n return;\n }\n\n try {\n await runWindowsInternal(args, config, options);\n } catch (ex) {\n runWindowsError =\n ex instanceof Error ? (ex as Error) : new Error(String(ex));\n Telemetry.trackException(runWindowsError);\n\n if (!hasRunRnwDependencies) {\n const rnwPkgJsonPath = require.resolve(\n 'react-native-windows/package.json',\n {\n paths: [process.cwd(), __dirname],\n },\n );\n const rnwDependenciesPath = path.join(\n path.dirname(rnwPkgJsonPath),\n 'scripts/rnw-dependencies.ps1',\n );\n\n newError(\n `It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running ${rnwDependenciesPath} from an elevated PowerShell prompt.\\nFor more information, go to http://aka.ms/rnw-deps`,\n );\n }\n }\n await endTelemetrySession(runWindowsError, getExtraProps);\n setExitProcessWithError(options.logging, runWindowsError);\n}\n\n/**\n * Performs build deploy and launch of RNW apps.\n * @param args Unprocessed args passed from react-native CLI.\n * @param config Config passed from react-native CLI.\n * @param options Options passed from react-native CLI.\n */\nasync function runWindowsInternal(\n args: string[],\n config: Config,\n options: RunWindowsOptions,\n) {\n const verbose = options.logging === true;\n\n if (verbose) {\n newInfo('Verbose: ON');\n }\n\n // Get the solution file\n let slnFile: string | null;\n runWindowsPhase = 'FindSolution';\n try {\n slnFile = build.getAppSolutionFile(options, config);\n } catch (e) {\n newError(`Couldn't get app solution information. ${(e as Error).message}`);\n throw e;\n }\n\n let buildTools: MSBuildTools;\n runWindowsPhase = 'FindBuildTools';\n try {\n buildTools = MSBuildTools.findAvailableVersion(options.arch, verbose);\n } catch (error) {\n newWarn('No public VS release found');\n // Try prerelease\n try {\n newInfo('Trying pre-release VS');\n buildTools = MSBuildTools.findAvailableVersion(\n options.arch,\n verbose,\n true, // preRelease\n );\n } catch (e) {\n newError((e as Error).message);\n throw error;\n }\n }\n\n // Set up the callback to capture MSBuild properties after the command completes\n evaluateMSBuildPropsCallback = () => {\n const projectFile = build.getAppProjectFile(options, config);\n if (projectFile) {\n if (verbose) {\n newInfo('Gathering MSBuild data for telemetry.');\n }\n\n const msBuildPropertiesJsonPath = path.resolve(\n path.dirname(projectFile),\n 'Generated Files',\n 'msbuildproperties.g.json',\n );\n\n if (fs.existsSync(msBuildPropertiesJsonPath)) {\n if (verbose) {\n newInfo('Loading properties from msbuildproperties.g.json');\n }\n return fs.readJsonFileSync(msBuildPropertiesJsonPath);\n }\n\n if (verbose) {\n newInfo('Unable to find msbuildproperties.g.json');\n }\n }\n\n return {};\n };\n\n // Restore packages.config files for dependencies that don't support PackageReference.\n runWindowsPhase = 'RestorePackagesConfig';\n const buildType = deploy.getBuildConfiguration(options);\n try {\n await buildTools.restorePackageConfigs(slnFile, options.arch, buildType);\n } catch (e) {\n newError(\n `Couldn't restore found packages.config instances. ${\n (e as Error).message\n }`,\n );\n throw e;\n }\n\n if (options.autolink) {\n runWindowsPhase = 'Autolink';\n try {\n const autolinkArgs: string[] = [];\n const autolinkConfig = config;\n const autoLinkOptions: AutoLinkOptions = {\n logging: options.logging,\n check: false,\n proj: options.proj,\n sln: options.sln,\n telemetry: options.telemetry,\n };\n await autolinkWindowsInternal(\n autolinkArgs,\n autolinkConfig,\n autoLinkOptions,\n );\n } catch (e) {\n newError(`Autolinking failed. ${(e as Error).message}`);\n throw e;\n }\n } else {\n newInfo('Autolink step is skipped');\n }\n\n if (options.build) {\n runWindowsPhase = 'Build';\n if (!slnFile) {\n newError(\n 'Visual Studio Solution file not found. Maybe run \"npx react-native-windows-init\" first?',\n );\n throw new CodedError('NoSolution', 'Cannot find solution file');\n }\n\n // Get build/deploy options\n const msBuildProps = build.parseMsBuildProps(options);\n\n // Disable the autolink check since we just ran it\n msBuildProps.RunAutolinkCheck = 'false';\n\n try {\n await build.buildSolution(\n buildTools,\n slnFile!,\n buildType,\n options.arch,\n msBuildProps,\n verbose,\n 'build',\n options.buildLogDirectory,\n options.singleproc,\n );\n } catch (e) {\n newError(\n `Build failed with message ${\n (e as Error).message\n }. Check your build configuration.`,\n );\n if ((e as any).logfile) {\n console.log('See', chalk.bold((e as any).logfile));\n }\n throw e;\n }\n } else {\n newInfo('Build step is skipped');\n }\n\n if (shouldLaunchPackager(options)) {\n await deploy.startServerInNewWindow(options, verbose);\n }\n\n if (options.deploy) {\n runWindowsPhase = 'Deploy';\n if (!slnFile) {\n newError(\n 'Visual Studio Solution file not found. Maybe run \"npx react-native-windows-init\" first?',\n );\n throw new CodedError('NoSolution', 'Cannot find solution file');\n }\n\n try {\n if (options.device || options.emulator || options.target) {\n await deploy.deployToDevice(options, verbose, config);\n } else {\n await deploy.deployToDesktop(options, verbose, config, buildTools);\n }\n } catch (e) {\n newError(`Failed to deploy${e ? `: ${(e as Error).message}` : ''}`);\n throw e;\n }\n } else {\n newInfo('Deploy step is skipped');\n }\n}\n\nfunction shouldLaunchPackager(options: RunWindowsOptions): boolean {\n return (\n options.packager === true &&\n options.launch === true &&\n options.release !== true\n );\n}\n\n/*\n// Example of running the Windows Command\nrunWindows({\n root: 'C:\\\\github\\\\hack\\\\myapp',\n debug: true,\n arch: 'x86',\n nugetPath: 'C:\\\\github\\\\react\\\\react-native-windows\\\\local-cli\\\\runWindows\\\\.nuget\\\\nuget.exe'\n});\n*/\n\n/**\n * Starts the app on a connected Windows emulator or mobile device.\n */\nexport const runWindowsCommand: Command = {\n name: 'run-windows',\n description:\n 'builds your app and starts it on a connected Windows desktop, emulator or device',\n func: runWindows,\n options: runWindowsOptions,\n};\n"]}
@@ -4,13 +4,13 @@
4
4
  * @format
5
5
  */
6
6
  import { CommandOption } from '@react-native-community/cli-types';
7
- export declare type BuildArch = 'x86' | 'x64' | 'ARM' | 'ARM64';
8
- export declare type BuildConfig = 'Debug' | 'DebugBundle' | 'Release' | 'ReleaseBundle';
7
+ export type BuildArch = 'x86' | 'x64' | 'ARM64';
8
+ export type BuildConfig = 'Debug' | 'DebugBundle' | 'Release' | 'ReleaseBundle';
9
9
  /**
10
10
  * * Options are the following:
11
11
  * release: Boolean - Specifies release build
12
12
  * root: String - The root of the application
13
- * arch: String - The build architecture (x86, x64, ARM, Any CPU)
13
+ * arch: String - The build architecture (ARM64, x86, x64)
14
14
  * singleproc: Boolean - opt out of multi-proc builds
15
15
  * emulator: Boolean - Deploy to the emulator
16
16
  * device: Boolean - Deploy to a device
@@ -22,9 +22,11 @@ export declare type BuildConfig = 'Debug' | 'DebugBundle' | 'Release' | 'Release
22
22
  * no-launch: Boolean - Do not launch the app after deployment
23
23
  * no-build: Boolean - Do not build the solution
24
24
  * no-deploy: Boolean - Do not deploy the app
25
+ * deploy-from-layout: Force deploy from layout, even in release builds
25
26
  * sln: String - Solution file to build
26
27
  * msbuildprops: String - Comma separated props to pass to msbuild, eg: prop1=value1,prop2=value2
27
28
  * direct-debugging: Number - Enable direct debugging on specified port
29
+ * no-telemetry: Boolean - Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI
28
30
  */
29
31
  export interface RunWindowsOptions {
30
32
  release?: boolean;
@@ -35,18 +37,20 @@ export interface RunWindowsOptions {
35
37
  device?: boolean;
36
38
  target?: string;
37
39
  remoteDebugging?: string;
38
- logging: boolean;
39
- packager: boolean;
40
- bundle: boolean;
41
- launch: boolean;
42
- autolink: boolean;
43
- build: boolean;
44
- deploy: boolean;
40
+ logging?: boolean;
41
+ packager?: boolean;
42
+ bundle?: boolean;
43
+ launch?: boolean;
44
+ autolink?: boolean;
45
+ build?: boolean;
46
+ deploy?: boolean;
47
+ deployFromLayout?: boolean;
45
48
  sln?: string;
46
49
  proj?: string;
47
50
  msbuildprops?: string;
48
51
  buildLogDirectory?: string;
49
- info: boolean;
52
+ info?: boolean;
50
53
  directDebugging?: number;
54
+ telemetry?: boolean;
51
55
  }
52
56
  export declare const runWindowsOptions: CommandOption[];
@@ -4,8 +4,12 @@
4
4
  * Licensed under the MIT License.
5
5
  * @format
6
6
  */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
7
10
  Object.defineProperty(exports, "__esModule", { value: true });
8
11
  exports.runWindowsOptions = void 0;
12
+ const os_1 = __importDefault(require("os"));
9
13
  exports.runWindowsOptions = [
10
14
  {
11
15
  name: '--release',
@@ -18,8 +22,8 @@ exports.runWindowsOptions = [
18
22
  },
19
23
  {
20
24
  name: '--arch [string]',
21
- description: 'The build architecture (ARM, ARM64, x86, x64)',
22
- default: 'x86',
25
+ description: 'The build architecture (ARM64, x86, x64)',
26
+ default: os_1.default.arch(),
23
27
  parse: parseBuildArch,
24
28
  },
25
29
  {
@@ -45,37 +49,34 @@ exports.runWindowsOptions = [
45
49
  {
46
50
  name: '--logging',
47
51
  description: 'Enables logging',
48
- default: false,
49
52
  },
50
53
  {
51
54
  name: '--no-packager',
52
55
  description: 'Do not launch packager while building',
53
- default: false,
54
56
  },
55
57
  {
56
58
  name: '--bundle',
57
59
  description: 'Enable Bundle configuration and it would be ReleaseBundle/DebugBundle other than Release/Debug',
58
- default: false,
59
60
  },
60
61
  {
61
62
  name: '--no-launch',
62
63
  description: 'Do not launch the app after deployment',
63
- default: false,
64
64
  },
65
65
  {
66
66
  name: '--no-autolink',
67
67
  description: 'Do not run autolinking',
68
- default: false,
69
68
  },
70
69
  {
71
70
  name: '--no-build',
72
71
  description: 'Do not build the solution',
73
- default: false,
74
72
  },
75
73
  {
76
74
  name: '--no-deploy',
77
75
  description: 'Do not deploy the app',
78
- default: false,
76
+ },
77
+ {
78
+ name: '--deploy-from-layout',
79
+ description: 'Force deploy from layout',
79
80
  },
80
81
  {
81
82
  name: '--sln [string]',
@@ -98,16 +99,19 @@ exports.runWindowsOptions = [
98
99
  {
99
100
  name: '--info',
100
101
  description: 'Dump environment information',
101
- default: false,
102
102
  },
103
103
  {
104
104
  name: '--direct-debugging [number]',
105
105
  description: 'Enable direct debugging on specified port',
106
106
  parse: parseDirectDebuggingPort,
107
107
  },
108
+ {
109
+ name: '--no-telemetry',
110
+ description: 'Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI',
111
+ },
108
112
  ];
109
113
  function parseBuildArch(arg) {
110
- const supportedArches = ['x86', 'x64', 'ARM64', 'ARM'];
114
+ const supportedArches = ['x86', 'x64', 'ARM64'];
111
115
  for (const supported of supportedArches) {
112
116
  if (arg.toLowerCase() === supported.toLowerCase()) {
113
117
  return supported;
@@ -1 +1 @@
1
- {"version":3,"file":"runWindowsOptions.js","sourceRoot":"","sources":["../../src/runWindows/runWindowsOptions.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAmDU,QAAA,iBAAiB,GAAoB;IAChD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,E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ources":["../../src/runWindows/runWindowsOptions.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,4CAAoB;AAsDP,QAAA,iBAAiB,GAAoB;IAChD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,sFAAsF;QACxF,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI;KAC/B;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,0CAA0C;QACvD,OAAO,EAAE,YAAE,CAAC,IAAI,EAAE;QAClB,KAAK,EAAE,cAAc;KACtB;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,gCAAgC;KAC9C;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,uCAAuC;KACrD;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,qDAAqD;KACnE;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,2CAA2C;KACzD;IACD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,iBAAiB;KAC/B;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,uCAAuC;KACrD;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,gGAAgG;KACnG;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,wCAAwC;KACtD;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,wBAAwB;KACtC;IACD;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,uBAAuB;KACrC;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,0BAA0B;KACxC;IACD;QACE,IAAI,EA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C,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport os from 'os';\nimport {CommandOption} from '@react-native-community/cli-types';\n\nexport type BuildArch = 'x86' | 'x64' | 'ARM64';\nexport type BuildConfig = 'Debug' | 'DebugBundle' | 'Release' | 'ReleaseBundle';\n\n/**\n * * Options are the following:\n * release: Boolean - Specifies release build\n * root: String - The root of the application\n * arch: String - The build architecture (ARM64, x86, x64)\n * singleproc: Boolean - opt out of multi-proc builds\n * emulator: Boolean - Deploy to the emulator\n * device: Boolean - Deploy to a device\n * target: String - Device GUID to deploy to\n * remote-debugging: Boolean - Run using remote JS proxy\n * logging: Boolean - Enables logging\n * no-packager: Boolean - Do not launch packager while building\n * bundle: Boolean - Enable Bundle configuration.\n * no-launch: Boolean - Do not launch the app after deployment\n * no-build: Boolean - Do not build the solution\n * no-deploy: Boolean - Do not deploy the app\n * deploy-from-layout: Force deploy from layout, even in release builds\n * sln: String - Solution file to build\n * msbuildprops: String - Comma separated props to pass to msbuild, eg: prop1=value1,prop2=value2\n * direct-debugging: Number - Enable direct debugging on specified port\n * no-telemetry: Boolean - Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI\n */\nexport interface RunWindowsOptions {\n release?: boolean;\n root: string;\n arch: BuildArch;\n singleproc?: boolean;\n emulator?: boolean;\n device?: boolean;\n target?: string;\n remoteDebugging?: string;\n logging?: boolean;\n packager?: boolean;\n bundle?: boolean;\n launch?: boolean;\n autolink?: boolean;\n build?: boolean;\n deploy?: boolean;\n deployFromLayout?: boolean;\n sln?: string;\n proj?: string;\n msbuildprops?: string;\n buildLogDirectory?: string;\n info?: boolean;\n directDebugging?: number;\n telemetry?: boolean;\n}\n\nexport const runWindowsOptions: CommandOption[] = [\n {\n name: '--release',\n description: 'Specifies a release build',\n },\n {\n name: '--root [string]',\n description:\n 'Override the root directory for the windows build which contains the windows folder.',\n default: config => config.root,\n },\n {\n name: '--arch [string]',\n description: 'The build architecture (ARM64, x86, x64)',\n default: os.arch(),\n parse: parseBuildArch,\n },\n {\n name: '--singleproc',\n description: 'Disables multi-proc build',\n },\n {\n name: '--emulator',\n description: 'Deploys the app to an emulator',\n },\n {\n name: '--device',\n description: 'Deploys the app to a connected device',\n },\n {\n name: '--target [string]',\n description: 'Deploys the app to the specified GUID for a device.',\n },\n {\n name: '--remote-debugging',\n description: 'Deploys the app in remote debugging mode.',\n },\n {\n name: '--logging',\n description: 'Enables logging',\n },\n {\n name: '--no-packager',\n description: 'Do not launch packager while building',\n },\n {\n name: '--bundle',\n description:\n 'Enable Bundle configuration and it would be ReleaseBundle/DebugBundle other than Release/Debug',\n },\n {\n name: '--no-launch',\n description: 'Do not launch the app after deployment',\n },\n {\n name: '--no-autolink',\n description: 'Do not run autolinking',\n },\n {\n name: '--no-build',\n description: 'Do not build the solution',\n },\n {\n name: '--no-deploy',\n description: 'Do not deploy the app',\n },\n {\n name: '--deploy-from-layout',\n description: 'Force deploy from layout',\n },\n {\n name: '--sln [string]',\n description:\n \"Override the app solution file determined by 'react-native config', e.g. windows\\\\myApp.sln\",\n default: undefined,\n },\n {\n name: '--proj [string]',\n description:\n \"Override the app project file determined by 'react-native config', e.g. windows\\\\myApp\\\\myApp.vcxproj\",\n default: undefined,\n },\n {\n name: '--msbuildprops [string]',\n description:\n 'Comma separated props to pass to msbuild, eg: prop1=value1,prop2=value2',\n },\n {\n name: '--buildLogDirectory [string]',\n description: 'Optional directory where msbuild log files should be stored',\n },\n {\n name: '--info',\n description: 'Dump environment information',\n },\n {\n name: '--direct-debugging [number]',\n description: 'Enable direct debugging on specified port',\n parse: parseDirectDebuggingPort,\n },\n {\n name: '--no-telemetry',\n description:\n 'Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI',\n },\n];\n\nfunction parseBuildArch(arg: string): BuildArch {\n const supportedArches: BuildArch[] = ['x86', 'x64', 'ARM64'];\n for (const supported of supportedArches) {\n if (arg.toLowerCase() === supported.toLowerCase()) {\n return supported;\n }\n }\n\n errorOut(`Unrecognized --arch '${arg}'. Expected one of ${supportedArches}`);\n}\n\nfunction parseDirectDebuggingPort(arg: string): number {\n const num = parseInt(arg, 10);\n\n if (!Number.isInteger(num)) {\n errorOut(`Expected argument '--direct-debugging' to be a number`);\n }\n if (num < 1024 || num >= 65535) {\n errorOut('Direct debugging port it out of range');\n }\n\n return num;\n}\n\nfunction errorOut(arg: string): never {\n console.error(arg);\n process.exit(1);\n}\n"]}