@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,24 +1,24 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
- declare class DeviceInfo {
7
- readonly name: string;
8
- readonly guid: string;
9
- readonly ip: string;
10
- private readonly index;
11
- private readonly type;
12
- constructor(name: string, guid: string, ip: string, index: number, type: string);
13
- toString(): string;
14
- }
15
- export default class WinAppDeployTool {
16
- private readonly path;
17
- constructor();
18
- get isAvailable(): boolean;
19
- findDevice(target: string): DeviceInfo;
20
- enumerateDevices(): DeviceInfo[];
21
- installAppPackage(pathToAppxPackage: string, targetDevice: DeviceInfo, shouldLaunch: boolean, shouldUpdate: boolean, pin: boolean, verbose?: boolean): Promise<void>;
22
- uninstallAppPackage(appName: string, targetDevice: DeviceInfo, verbose: boolean): Promise<void>;
23
- }
24
- export {};
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ * @format
5
+ */
6
+ declare class DeviceInfo {
7
+ readonly name: string;
8
+ readonly guid: string;
9
+ readonly ip: string;
10
+ private readonly index;
11
+ private readonly type;
12
+ constructor(name: string, guid: string, ip: string, index: number, type: string);
13
+ toString(): string;
14
+ }
15
+ export default class WinAppDeployTool {
16
+ private readonly path;
17
+ constructor();
18
+ get isAvailable(): boolean;
19
+ findDevice(target: string): DeviceInfo;
20
+ enumerateDevices(): DeviceInfo[];
21
+ installAppPackage(pathToAppxPackage: string, targetDevice: DeviceInfo, shouldLaunch: boolean, shouldUpdate: boolean, pin: boolean, verbose?: boolean): Promise<void>;
22
+ uninstallAppPackage(appName: string, targetDevice: DeviceInfo, verbose: boolean): Promise<void>;
23
+ }
24
+ export {};
@@ -1,109 +1,109 @@
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
- const fs_1 = __importDefault(require("fs"));
12
- const path_1 = __importDefault(require("path"));
13
- const child_process_1 = require("child_process");
14
- const commandWithProgress_1 = require("./commandWithProgress");
15
- const telemetry_1 = require("@react-native-windows/telemetry");
16
- function sortDevices(l, r) {
17
- return l.toString().length - r.toString().length;
18
- }
19
- class DeviceInfo {
20
- constructor(name, guid, ip, index, type) {
21
- this.name = name;
22
- this.guid = guid;
23
- this.ip = ip;
24
- this.index = index;
25
- this.type = type;
26
- }
27
- toString() {
28
- return `${this.index}. ${this.name} (${this.type})`;
29
- }
30
- }
31
- class WinAppDeployTool {
32
- constructor() {
33
- const programFilesPath = process.env['ProgramFiles(x86)'] || process.env.ProgramFiles;
34
- this.path = path_1.default.join(programFilesPath, 'Windows Kits', '10', 'bin', 'x86', 'WinAppDeployCmd.exe');
35
- }
36
- get isAvailable() {
37
- return fs_1.default.existsSync(this.path);
38
- }
39
- findDevice(target) {
40
- const devices = this.enumerateDevices();
41
- if (devices.length === 0) {
42
- throw new telemetry_1.CodedError('NoDevice', 'No devices found');
43
- }
44
- if (target === 'emulator') {
45
- const sortedList = devices.sort(sortDevices);
46
- for (const sortedItem of sortedList) {
47
- if (sortedItem.toString().includes(target)) {
48
- return sortedItem;
49
- }
50
- }
51
- }
52
- if (target === 'device') {
53
- return devices[0];
54
- }
55
- const candidateList = devices.filter(device => device.guid === target);
56
- if (candidateList.length > 0) {
57
- return candidateList[0];
58
- }
59
- else {
60
- throw new telemetry_1.CodedError('NoDevice', 'No devices found');
61
- }
62
- }
63
- enumerateDevices() {
64
- // 127.0.0.1 00000015-b21e-0da9-0000-000000000000 Lumia 1520 (RM-940)\r
65
- // maps to
66
- // [(line), '127.0.0.1', '00000015-b21e-0da9-0000-000000000000', 'Lumia 1520 (RM-940)']
67
- // The expansion is: IP address, spaces, GUID, spaces, text name
68
- const LINE_TEST = /^([\d\.]+?)\s+([\da-fA-F\-]+?)\s+(.+)$/m; // eslint-disable-line no-useless-escape
69
- const result = (0, child_process_1.execSync)(`"${this.path}" devices`).toString();
70
- const lines = result.split('\r\n');
71
- const matchedLines = lines.filter(line => LINE_TEST.test(line));
72
- const devices = matchedLines.map((line, arrayIndex) => {
73
- const match = line.match(LINE_TEST);
74
- if (!match) {
75
- throw new telemetry_1.CodedError('InvalidDevicesOutput', 'Unexpected format of "devices" output');
76
- }
77
- const ip = match[1];
78
- const guid = match[2];
79
- const name = match[3];
80
- const type = 'device';
81
- const deviceInfo = new DeviceInfo(name, guid, ip, arrayIndex, type);
82
- return deviceInfo;
83
- });
84
- return devices;
85
- }
86
- async installAppPackage(pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin, verbose = false) {
87
- const text = `Installing app to ${targetDevice.name}`;
88
- if (shouldLaunch) {
89
- (0, commandWithProgress_1.newWarn)('Cannot launch app with current version of Windows 10 SDK tools. You will have to launch the app after installation is completed.');
90
- }
91
- const args = [
92
- shouldUpdate ? 'update' : 'install',
93
- '-file',
94
- pathToAppxPackage,
95
- '-ip',
96
- targetDevice.ip,
97
- ];
98
- if (pin) {
99
- args.push('-pin', pin.toString());
100
- }
101
- await (0, commandWithProgress_1.commandWithProgress)((0, commandWithProgress_1.newSpinner)(text), text, this.path, args, verbose, 'InstallAppToDeviceFailure');
102
- }
103
- async uninstallAppPackage(appName, targetDevice, verbose) {
104
- const text = `Uninstalling app from ${targetDevice.name}`;
105
- await (0, commandWithProgress_1.commandWithProgress)((0, commandWithProgress_1.newSpinner)(text), text, this.path, `uninstall -package ${appName} -ip {$targetDevice.ip}`.split(' '), verbose, 'UninstallAppOnDeviceFailure');
106
- }
107
- }
108
- exports.default = WinAppDeployTool;
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
+ const fs_1 = __importDefault(require("@react-native-windows/fs"));
12
+ const path_1 = __importDefault(require("path"));
13
+ const child_process_1 = require("child_process");
14
+ const commandWithProgress_1 = require("./commandWithProgress");
15
+ const telemetry_1 = require("@react-native-windows/telemetry");
16
+ function sortDevices(l, r) {
17
+ return l.toString().length - r.toString().length;
18
+ }
19
+ class DeviceInfo {
20
+ constructor(name, guid, ip, index, type) {
21
+ this.name = name;
22
+ this.guid = guid;
23
+ this.ip = ip;
24
+ this.index = index;
25
+ this.type = type;
26
+ }
27
+ toString() {
28
+ return `${this.index}. ${this.name} (${this.type})`;
29
+ }
30
+ }
31
+ class WinAppDeployTool {
32
+ constructor() {
33
+ const programFilesPath = process.env['ProgramFiles(x86)'] || process.env.ProgramFiles;
34
+ this.path = path_1.default.join(programFilesPath, 'Windows Kits', '10', 'bin', 'x86', 'WinAppDeployCmd.exe');
35
+ }
36
+ get isAvailable() {
37
+ return fs_1.default.existsSync(this.path);
38
+ }
39
+ findDevice(target) {
40
+ const devices = this.enumerateDevices();
41
+ if (devices.length === 0) {
42
+ throw new telemetry_1.CodedError('NoDevice', 'No devices found');
43
+ }
44
+ if (target === 'emulator') {
45
+ const sortedList = devices.sort(sortDevices);
46
+ for (const sortedItem of sortedList) {
47
+ if (sortedItem.toString().includes(target)) {
48
+ return sortedItem;
49
+ }
50
+ }
51
+ }
52
+ if (target === 'device') {
53
+ return devices[0];
54
+ }
55
+ const candidateList = devices.filter(device => device.guid === target);
56
+ if (candidateList.length > 0) {
57
+ return candidateList[0];
58
+ }
59
+ else {
60
+ throw new telemetry_1.CodedError('NoDevice', 'No devices found');
61
+ }
62
+ }
63
+ enumerateDevices() {
64
+ // 127.0.0.1 00000015-b21e-0da9-0000-000000000000 Lumia 1520 (RM-940)\r
65
+ // maps to
66
+ // [(line), '127.0.0.1', '00000015-b21e-0da9-0000-000000000000', 'Lumia 1520 (RM-940)']
67
+ // The expansion is: IP address, spaces, GUID, spaces, text name
68
+ const LINE_TEST = /^([\d\.]+?)\s+([\da-fA-F\-]+?)\s+(.+)$/m; // eslint-disable-line no-useless-escape
69
+ const result = (0, child_process_1.execSync)(`"${this.path}" devices`).toString();
70
+ const lines = result.split('\r\n');
71
+ const matchedLines = lines.filter(line => LINE_TEST.test(line));
72
+ const devices = matchedLines.map((line, arrayIndex) => {
73
+ const match = line.match(LINE_TEST);
74
+ if (!match) {
75
+ throw new telemetry_1.CodedError('InvalidDevicesOutput', 'Unexpected format of "devices" output');
76
+ }
77
+ const ip = match[1];
78
+ const guid = match[2];
79
+ const name = match[3];
80
+ const type = 'device';
81
+ const deviceInfo = new DeviceInfo(name, guid, ip, arrayIndex, type);
82
+ return deviceInfo;
83
+ });
84
+ return devices;
85
+ }
86
+ async installAppPackage(pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin, verbose = false) {
87
+ const text = `Installing app to ${targetDevice.name}`;
88
+ if (shouldLaunch) {
89
+ (0, commandWithProgress_1.newWarn)('Cannot launch app with current version of Windows 10 SDK tools. You will have to launch the app after installation is completed.');
90
+ }
91
+ const args = [
92
+ shouldUpdate ? 'update' : 'install',
93
+ '-file',
94
+ pathToAppxPackage,
95
+ '-ip',
96
+ targetDevice.ip,
97
+ ];
98
+ if (pin) {
99
+ args.push('-pin', pin.toString());
100
+ }
101
+ await (0, commandWithProgress_1.commandWithProgress)((0, commandWithProgress_1.newSpinner)(text), text, this.path, args, verbose, 'InstallAppToDeviceFailure');
102
+ }
103
+ async uninstallAppPackage(appName, targetDevice, verbose) {
104
+ const text = `Uninstalling app from ${targetDevice.name}`;
105
+ await (0, commandWithProgress_1.commandWithProgress)((0, commandWithProgress_1.newSpinner)(text), text, this.path, `uninstall -package ${appName} -ip {$targetDevice.ip}`.split(' '), verbose, 'UninstallAppOnDeviceFailure');
106
+ }
107
+ }
108
+ exports.default = WinAppDeployTool;
109
109
  //# sourceMappingURL=winappdeploytool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"winappdeploytool.js","sourceRoot":"","sources":["../../src/utils/winappdeploytool.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAEH,kEAA0C;AAC1C,gDAAwB;AACxB,iDAAuC;AACvC,+DAA+E;AAC/E,+DAA2D;AAE3D,SAAS,WAAW,CAAC,CAAa,EAAE,CAAa;IAC/C,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC;AACnD,CAAC;AAED,MAAM,UAAU;IACd,YACkB,IAAY,EACZ,IAAY,EACZ,EAAU,EAET,KAAa,EACb,IAAY;QALb,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,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C,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,iBAAyB,EACzB,YAAwB,EACxB,YAAqB,EACrB,YAAqB,EACrB,GAAY,EACZ,UAAmB,KAAK;QAExB,MAAM,IAAI,GAAG,qBAAqB,YAAY,CAAC,IAAI,EAAE,CAAC;QAEtD,IAAI,YAAY,EAAE;YAChB,IAAA,6BAAO,EACL,mIAAmI,CACpI,CAAC;SACH;QAED,MAAM,IAAI,GAAG;YACX,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACnC,OAAO;YACP,iBAAiB;YACjB,KAAK;YACL,YAAY,CAAC,EAAE;SAChB,CAAC;QAEF,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;SACnC;QACD,MAAM,IAAA,yCAAmB,EACvB,IAAA,gCAAU,EAAC,IAAI,CAAC,EAChB,IAAI,EACJ,IAAI,CAAC,IAAI,EACT,IAAI,EACJ,OAAO,EACP,2BAA2B,CAC5B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,OAAe,EACf,YAAwB,EACxB,OAAgB;QAEhB,MAAM,IAAI,GAAG,yBAAyB,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1D,MAAM,IAAA,yCAAmB,EACvB,IAAA,gCAAU,EAAC,IAAI,CAAC,EAChB,IAAI,EACJ,IAAI,CAAC,IAAI,EACT,sBAAsB,OAAO,yBAAyB,CAAC,KAAK,CAAC,GAAG,CAAC,EACjE,OAAO,EACP,6BAA6B,CAC9B,CAAC;IACJ,CAAC;CACF;AArID,mCAqIC","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 {execSync} from 'child_process';\nimport {newSpinner, commandWithProgress, newWarn} from './commandWithProgress';\nimport {CodedError} from '@react-native-windows/telemetry';\n\nfunction sortDevices(l: DeviceInfo, r: DeviceInfo): number {\n return l.toString().length - r.toString().length;\n}\n\nclass DeviceInfo {\n constructor(\n public readonly name: string,\n public readonly guid: string,\n public readonly ip: string,\n\n private readonly index: number,\n private readonly type: string,\n ) {}\n\n toString() {\n return `${this.index}. ${this.name} (${this.type})`;\n }\n}\n\nexport default class WinAppDeployTool {\n private readonly path: string;\n\n constructor() {\n const programFilesPath =\n process.env['ProgramFiles(x86)'] || process.env.ProgramFiles;\n this.path = path.join(\n programFilesPath!,\n 'Windows Kits',\n '10',\n 'bin',\n 'x86',\n 'WinAppDeployCmd.exe',\n );\n }\n\n get isAvailable() {\n return fs.existsSync(this.path);\n }\n\n findDevice(target: string): DeviceInfo {\n const devices = this.enumerateDevices();\n\n if (devices.length === 0) {\n throw new CodedError('NoDevice', 'No devices found');\n }\n\n if (target === 'emulator') {\n const sortedList = devices.sort(sortDevices);\n for (const sortedItem of sortedList) {\n if (sortedItem.toString().includes(target)) {\n return sortedItem;\n }\n }\n }\n\n if (target === 'device') {\n return devices[0];\n }\n\n const candidateList = devices.filter(device => device.guid === target);\n\n if (candidateList.length > 0) {\n return candidateList[0];\n } else {\n throw new CodedError('NoDevice', 'No devices found');\n }\n }\n\n enumerateDevices(): DeviceInfo[] {\n // 127.0.0.1 00000015-b21e-0da9-0000-000000000000 Lumia 1520 (RM-940)\\r\n // maps to\n // [(line), '127.0.0.1', '00000015-b21e-0da9-0000-000000000000', 'Lumia 1520 (RM-940)']\n // The expansion is: IP address, spaces, GUID, spaces, text name\n const LINE_TEST = /^([\\d\\.]+?)\\s+([\\da-fA-F\\-]+?)\\s+(.+)$/m; // eslint-disable-line no-useless-escape\n\n const result = execSync(`\"${this.path}\" devices`).toString();\n const lines = result.split('\\r\\n');\n const matchedLines = lines.filter(line => LINE_TEST.test(line));\n\n const devices = matchedLines.map((line, arrayIndex) => {\n const match = line.match(LINE_TEST);\n if (!match) {\n throw new CodedError(\n 'InvalidDevicesOutput',\n 'Unexpected format of \"devices\" output',\n );\n }\n\n const ip = match[1];\n const guid = match[2];\n const name = match[3];\n const type = 'device';\n\n const deviceInfo = new DeviceInfo(name, guid, ip, arrayIndex, type);\n return deviceInfo;\n });\n\n return devices;\n }\n\n async installAppPackage(\n pathToAppxPackage: string,\n targetDevice: DeviceInfo,\n shouldLaunch: boolean,\n shouldUpdate: boolean,\n pin: boolean,\n verbose: boolean = false,\n ) {\n const text = `Installing app to ${targetDevice.name}`;\n\n if (shouldLaunch) {\n newWarn(\n 'Cannot launch app with current version of Windows 10 SDK tools. You will have to launch the app after installation is completed.',\n );\n }\n\n const args = [\n shouldUpdate ? 'update' : 'install',\n '-file',\n pathToAppxPackage,\n '-ip',\n targetDevice.ip,\n ];\n\n if (pin) {\n args.push('-pin', pin.toString());\n }\n await commandWithProgress(\n newSpinner(text),\n text,\n this.path,\n args,\n verbose,\n 'InstallAppToDeviceFailure',\n );\n }\n\n async uninstallAppPackage(\n appName: string,\n targetDevice: DeviceInfo,\n verbose: boolean,\n ) {\n const text = `Uninstalling app from ${targetDevice.name}`;\n await commandWithProgress(\n newSpinner(text),\n text,\n this.path,\n `uninstall -package ${appName} -ip {$targetDevice.ip}`.split(' '),\n verbose,\n 'UninstallAppOnDeviceFailure',\n );\n }\n}\n"]}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@react-native-windows/cli",
3
- "version": "0.0.0-canary.99",
3
+ "version": "0.0.1-0",
4
4
  "license": "MIT",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git@github.com:microsoft/react-native-windows.git",
8
+ "url": "https://github.com/microsoft/react-native-windows",
9
9
  "directory": "packages/@react-native-windows/cli"
10
10
  },
11
11
  "scripts": {
@@ -17,9 +17,11 @@
17
17
  "watch": "rnw-scripts watch"
18
18
  },
19
19
  "dependencies": {
20
- "@react-native-windows/package-utils": "^0.0.0-canary.22",
21
- "@react-native-windows/telemetry": "^0.0.0-canary.24",
22
- "@xmldom/xmldom": "^0.7.5",
20
+ "@react-native-windows/codegen": "0.0.1-0",
21
+ "@react-native-windows/fs": "^0.0.1-0",
22
+ "@react-native-windows/package-utils": "^0.0.1-0",
23
+ "@react-native-windows/telemetry": "^0.0.1-0",
24
+ "@xmldom/xmldom": "^0.7.7",
23
25
  "chalk": "^4.1.0",
24
26
  "cli-spinners": "^2.2.0",
25
27
  "envinfo": "^7.5.0",
@@ -38,16 +40,17 @@
38
40
  "xpath": "^0.0.27"
39
41
  },
40
42
  "devDependencies": {
41
- "@react-native-community/cli-types": "^5.0.1-alpha.0",
42
- "@rnw-scripts/eslint-config": "1.1.8",
43
- "@rnw-scripts/jest-unittest-config": "1.2.4",
44
- "@rnw-scripts/just-task": "2.2.1",
45
- "@rnw-scripts/ts-config": "2.0.1",
43
+ "@react-native-community/cli-doctor": "13.6.1",
44
+ "@react-native-community/cli-types": "13.6.1",
45
+ "@rnw-scripts/eslint-config": "1.2.12",
46
+ "@rnw-scripts/jest-unittest-config": "1.5.8",
47
+ "@rnw-scripts/just-task": "2.3.28",
48
+ "@rnw-scripts/ts-config": "2.0.5",
46
49
  "@types/chalk": "^2.2.0",
47
- "@types/jest": "^26.0.20",
50
+ "@types/jest": "^29.2.2",
48
51
  "@types/lodash": "^4.14.168",
49
52
  "@types/mustache": "^4.1.1",
50
- "@types/node": "^14.14.22",
53
+ "@types/node": "^18.0.0",
51
54
  "@types/ora": "^3.2.0",
52
55
  "@types/prompts": "2.0.10",
53
56
  "@types/semver": "^7.3.3",
@@ -55,16 +58,20 @@
55
58
  "@types/uuid": "^8.3.0",
56
59
  "@types/xml-parser": "^1.2.29",
57
60
  "@types/xmldom": "^0.1.30",
58
- "babel-jest": "^26.3.0",
59
- "eslint": "7.12.0",
60
- "jest": "^26.6.3",
61
- "just-scripts": "^1.3.3",
62
- "prettier": "1.19.1",
63
- "typescript": "^4.4.4"
61
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
62
+ "@typescript-eslint/parser": "^5.57.1",
63
+ "babel-jest": "^29.6.3",
64
+ "eslint": "^8.19.0",
65
+ "jest": "^29.6.3",
66
+ "prettier": "2.8.8",
67
+ "typescript": "5.0.4"
68
+ },
69
+ "peerDependencies": {
70
+ "react-native": "*"
64
71
  },
65
72
  "files": [
66
73
  "lib-commonjs",
67
- "powershell"
74
+ "src/powershell"
68
75
  ],
69
76
  "beachball": {
70
77
  "defaultNpmTag": "canary",
@@ -77,6 +84,6 @@
77
84
  "promoteRelease": true,
78
85
  "windowsOnly": true,
79
86
  "engines": {
80
- "node": ">= 12.0.0"
87
+ "node": ">= 18"
81
88
  }
82
89
  }
@@ -0,0 +1,156 @@
1
+ # Copyright (c) Microsoft Corporation.
2
+ # Licensed under the MIT License.
3
+ #
4
+ # Eval-MsBuildProperties.ps1
5
+ #
6
+ # This script lets you determine the final values of MSBUILD properties for a
7
+ # given solution and project file. Simply pass in a comma delimited list of
8
+ # property names and you'll get a JSON blob of evaluated values.
9
+ #
10
+ # For example, from the root of the repo:
11
+ #
12
+ # .\packages\@react-native-windows\cli\powershell\Eval-MsBuildProperties.ps1 -SolutionFile 'vnext\Microsoft.ReactNative.sln' -ProjectFile 'vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj' -PropertyNames 'ProjectGUID,ProjectName'
13
+ #
14
+ # will output:
15
+ #
16
+ # {
17
+ # "ProjectGuid": "{f7d32bd0-2749-483e-9a0d-1635ef7e3136}",
18
+ # "ProjectName": "Microsoft.ReactNative"
19
+ # }
20
+ #
21
+
22
+ param(
23
+ [Parameter(Mandatory = $true)]
24
+ [String]$SolutionFile,
25
+ [Parameter(Mandatory = $true)]
26
+ [String]$ProjectFile,
27
+ [Parameter()]
28
+ [String]$PropertyNames = "",
29
+ [Parameter()]
30
+ [String]$MSBuildPath,
31
+ [Parameter()]
32
+ [String]$ExtraMSBuildProps
33
+ )
34
+
35
+ function Get-MSBuildPath {
36
+ $vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
37
+ if (!(Test-Path $vsWhere)) {
38
+ throw "Unable to find vswhere.exe."
39
+ }
40
+ $vsPath = & $vsWhere -version 16.5 -property installationPath;
41
+ return "$vsPath\MSBuild\Current\Bin";
42
+ }
43
+
44
+ function Get-MSBuildProperties {
45
+ param (
46
+ [Parameter(Mandatory = $true)]
47
+ [String]$MSBuildPath,
48
+ [Parameter(Mandatory = $true)]
49
+ [String]$SolutionPath,
50
+ [Parameter(Mandatory = $true)]
51
+ [String]$ProjectPath,
52
+ [Parameter()]
53
+ [String[]]$PropertyNames = @(),
54
+ [Parameter()]
55
+ [String]$ExtraMSBuildProps
56
+ )
57
+
58
+ if (!(Test-Path (Join-Path $MSBuildPath "MSBuild.exe"))) {
59
+ throw "Unable to find MSBuild.exe in $MSBuildPath"
60
+ }
61
+
62
+ if (!(Test-Path (Join-Path $MSBuildPath "MSBuild.exe"))) {
63
+ throw "Unable to find Microsoft.Build.dll in $MSBuildPath"
64
+ }
65
+
66
+ # Method to intercept resolution of assemblies to add MSBuild's path
67
+ $onAssemblyResolveEventHandler = [System.ResolveEventHandler] {
68
+ param($s, $e)
69
+
70
+ # Figure out which assembly to look for
71
+ $assemblyName = $e.Name.Substring(0, $e.Name.IndexOf(", "));
72
+ $assemblyPath = "$MSBuildPath\$assemblyName.dll"
73
+
74
+ # Search for the assembly in the MSBuild directory
75
+ if (Test-Path $assemblyPath) {
76
+ # Found the assembly!
77
+ return [System.Reflection.Assembly]::LoadFrom("$MSBuildPath\$assemblyName.dll");
78
+ }
79
+
80
+ # Unable to find the assembly
81
+ return $null
82
+ }
83
+
84
+ # Wire-up assembly resolution event handler
85
+ [System.AppDomain]::CurrentDomain.add_AssemblyResolve($onAssemblyResolveEventHandler)
86
+
87
+ # Load Microsoft.Build.dll into script
88
+ Add-Type -Path "$MSBuildPath\Microsoft.Build.dll" | Out-Null
89
+
90
+ # Build a local project collection
91
+ $projectCollection = [Microsoft.Build.Evaluation.ProjectCollection]::new()
92
+
93
+ try {
94
+ # Build a temporary "metaproj" of the solution file so it can be processed
95
+ ${env:MSBUILDEMITSOLUTION} = 1
96
+ & $MSBuildPath\MSBuild.exe $SolutionPath | Out-Null
97
+
98
+ # Process solution
99
+ $solution = [Microsoft.Build.Evaluation.Project]::new("$SolutionPath.metaproj", $null, "Current", $projectCollection)
100
+ }
101
+ finally {
102
+ # Clean up "metaproj" files
103
+ ${env:MSBUILDEMITSOLUTION} = 0
104
+ Remove-Item -Path @("$SolutionPath.metaproj", "$SolutionPath.metaproj.tmp") | Out-Null
105
+ Get-ChildItem * -Include *.metaproj -Recurse | Remove-Item | Out-Null
106
+ }
107
+
108
+ # Evaluate all of the Solution* properties and save into a collection
109
+ $globalProps = New-Object 'System.Collections.Generic.Dictionary[String,String]'
110
+ $solution.Properties | ForEach-Object -Process {
111
+ if ($_.Name.StartsWith("Solution")) {
112
+ $globalProps.Add($_.Name, $_.EvaluatedValue)
113
+ }
114
+ }
115
+
116
+ # Evaluate all extra build props and save into the collection
117
+ $extraPropsTable = ConvertFrom-StringData -StringData $ExtraMSBuildProps.Replace(',', "`n")
118
+ $extraPropsTable.Keys | ForEach-Object -Process {
119
+ $globalProps[$_] = $extraPropsTable[$_]
120
+ }
121
+
122
+ # Process the project file (with the Solution* properties we calculated before)
123
+ $project = [Microsoft.Build.Evaluation.Project]::new("$ProjectPath", $globalProps, "Current", $projectCollection)
124
+
125
+ # Create object to hold evaluated property key value pairs
126
+ $evaluatedProps = @{}
127
+
128
+ # Look for the specified PropertyNames and evaluate them
129
+ $project.Properties | ForEach-Object -Process {
130
+ if (($PropertyNames.Length -eq 0) -or ($PropertyNames -contains $_.Name)) {
131
+ $evaluatedProps[$_.Name] = $_.EvaluatedValue;
132
+ }
133
+ }
134
+
135
+ # Output as JSON
136
+ Write-Output (ConvertTo-Json $evaluatedProps)
137
+ }
138
+
139
+ # Main
140
+
141
+ if ($MSBuildPath -and (Test-Path $MSBuildPath)) {
142
+ if (Test-Path $MSBuildPath -PathType Leaf) {
143
+ # It's a file (probably msbuild.exe), just get the folder path
144
+ $MSBuildPath = [System.IO.Path]::GetDirectoryName($MSBuildPath)
145
+ }
146
+ }
147
+ else {
148
+ # Use simple fallback logic in this script to find MSBuild path
149
+ $MSBuildPath = Get-MSBuildPath
150
+ }
151
+
152
+ # Get the full absolute paths to the solution and projects
153
+ $SolutionPath = Convert-Path $SolutionFile
154
+ $ProjectPath = Convert-Path $ProjectFile
155
+
156
+ Get-MSBuildProperties -MSBuildPath $MSBuildPath -SolutionPath $SolutionPath -ProjectPath $ProjectPath -PropertyNames $PropertyNames.Split(',', [System.StringSplitOptions]::RemoveEmptyEntries) -ExtraMSBuildProps $ExtraMSBuildProps
@@ -1 +0,0 @@
1
- {"version":3,"file":"configUtils.js","sourceRoot":"","sources":["../../src/config/configUtils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAExB,2CAAyC;AACzC,kDAA0B;AAC1B,+DAA2D;AAE3D,MAAM,aAAa,GAAG,eAAK,CAAC,aAAa,CAAC;IACxC,OAAO,EAAE,qDAAqD;CAC/D,CAAC,CAAC;AAEH;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,MAAc,EAAE,eAAuB;IAC/D,MAAM,KAAK,GAAG,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE;QACxD,GAAG,EAAE,MAAM;QACX,MAAM,EAAE;YACN,iBAAiB;YACjB,aAAa;YACb,eAAe;YACf,uBAAuB;YACvB,gBAAgB;SACjB;KACF,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC;AAbD,8BAaC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,MAAM,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,E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AAO,oBAAoB,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AAC9D,CAAC;AAFD,wCAEC;AAED,SAAgB,uBAAuB,CACrC,WAAmB;IAEnB,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,4BAA4B,CAAC,CAAC;IAEvE,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC7B,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,aAAa,CACzB,mCAAmC,EACnC,aAAa,CACd,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,YAAY,GAAG,IAAY,CAAC;QAClC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,WAAW,CAAC;KAC1D;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AApBD,0DAoBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport glob from 'glob';\n\nimport {DOMParser} from '@xmldom/xmldom';\nimport xpath from 'xpath';\nimport {CodedError} from '@react-native-windows/telemetry';\n\nconst msbuildSelect = xpath.useNamespaces({\n msbuild: 'http://schemas.microsoft.com/developer/msbuild/2003',\n});\n\n/**\n * Search for files matching the pattern under the target folder.\n * @param folder The absolute path to target folder.\n * @param filenamePattern The pattern to search for.\n * @return Return the array of relative file paths.\n */\nexport function findFiles(folder: string, filenamePattern: string): string[] {\n const files = glob.sync(path.join('**', filenamePattern), {\n cwd: folder,\n ignore: [\n 'node_modules/**',\n '**/Debug/**',\n '**/Release/**',\n '**/Generated Files/**',\n '**/packages/**',\n ],\n });\n\n return files;\n}\n\n/**\n * Search for the windows sub-folder under the target folder.\n * @param folder The absolute path to the target folder.\n * @return The absolute path to the windows folder, if it exists.\n */\nexport function findWindowsFolder(folder: string): string | null {\n const winDir = 'windows';\n const joinedDir = path.join(folder, winDir);\n if (fs.existsSync(joinedDir)) {\n return joinedDir;\n }\n\n return null;\n}\n\n/**\n * Checks if the target file path is a RNW solution file by checking if it contains the string \"ReactNative\".\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW solution file.\n */\nexport function isRnwSolution(filePath: string): boolean {\n return (\n fs\n .readFileSync(filePath)\n .toString()\n .search(/ReactNative/) > 0\n );\n}\n\n/**\n * Search for the RNW solution files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findSolutionFiles(winFolder: string): string[] {\n // First search for all potential solution files\n const allSolutions = findFiles(winFolder, '*.sln');\n\n if (allSolutions.length === 0) {\n // If there're no solution files, return 0\n return [];\n } else if (allSolutions.length === 1) {\n // If there is exactly one solution file, assume it's it\n return [allSolutions[0]];\n }\n\n const solutionFiles = [];\n\n // Try to find any solution file that appears to be a React Native solution\n for (const solutionFile of allSolutions) {\n if (isRnwSolution(path.join(winFolder, solutionFile))) {\n solutionFiles.push(path.normalize(solutionFile));\n }\n }\n\n return solutionFiles;\n}\n\n/**\n * Checks if the target file path is a RNW lib project file.\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW lib project file.\n */\nexport function isRnwDependencyProject(filePath: string): boolean {\n const projectContents = readProjectFile(filePath);\n\n const projectLang = getProjectLanguage(filePath);\n if (projectLang === 'cs') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CSharpLib.targets',\n );\n } else if (projectLang === 'cpp') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CppLib.targets',\n );\n }\n\n return false;\n}\n\n/**\n * Search for the RNW lib project files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findDependencyProjectFiles(winFolder: string): string[] {\n // First, search for all potential project files\n const allCppProj = findFiles(winFolder, '*.vcxproj');\n const allCsProj = findFiles(winFolder, '*.csproj');\n\n const allProjects = allCppProj.concat(allCsProj);\n\n if (allProjects.length === 0) {\n // If there're no project files, return 0\n return [];\n }\n\n const dependencyProjectFiles = [];\n\n // Try to find any project file that appears to be a dependency project\n for (const projectFile of allProjects) {\n // A project is marked as a RNW dependency iff either:\n // - If the project has the standard native module imports, or\n // - If we only have a single project (and it doesn't have the standard native module imports),\n // pick it and hope for the best. This enables autolinking for modules that were written\n // before the standard native module template existed.\n if (\n allProjects.length === 1 ||\n isRnwDependencyProject(path.join(winFolder, projectFile))\n ) {\n dependencyProjectFiles.push(path.normalize(projectFile));\n }\n }\n\n return dependencyProjectFiles;\n}\n\n/**\n * Checks if the target file path is a RNW app project file.\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW app project file.\n */\nfunction isRnwAppProject(filePath: string): boolean {\n const projectContents = readProjectFile(filePath);\n\n const projectLang = getProjectLanguage(filePath);\n if (projectLang === 'cs') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CSharpApp.targets',\n );\n } else if (projectLang === 'cpp') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CppApp.targets',\n );\n }\n\n return false;\n}\n\n/**\n * Search for the RNW app project files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findAppProjectFiles(winFolder: string): string[] {\n // First, search for all potential project files\n const allCppProj = findFiles(winFolder, '*.vcxproj');\n const allCsProj = findFiles(winFolder, '*.csproj');\n\n const allProjects = allCppProj.concat(allCsProj);\n\n if (allProjects.length === 0) {\n // If there're no project files, return 0\n return [];\n }\n\n const appProjectFiles = [];\n\n // Try to find any project file that appears to be an app project\n for (const projectFile of allProjects) {\n if (isRnwAppProject(path.join(winFolder, projectFile))) {\n appProjectFiles.push(path.normalize(projectFile));\n }\n }\n\n return appProjectFiles;\n}\n\n/**\n * Returns the programming language of the project file.\n * @param projectPath The project file path to check.\n * @return The language string: cpp, cs, or null if unknown.\n */\nexport function getProjectLanguage(projectPath: string): 'cpp' | 'cs' | null {\n if (projectPath.endsWith('.vcxproj')) {\n return 'cpp';\n } else if (projectPath.endsWith('.csproj')) {\n return 'cs';\n }\n\n return null;\n}\n\n/**\n * Reads in the contents of the target project file.\n * @param projectPath The target project file path.\n * @return The project file contents.\n */\nexport function readProjectFile(projectPath: string) {\n const projectContents = fs.readFileSync(projectPath, 'utf8').toString();\n return new DOMParser().parseFromString(projectContents, 'application/xml');\n}\n\n/**\n * Search for the given property in the project contents and return its value.\n * @param projectContents The XML project contents.\n * @param propertyName The property to look for.\n * @return The value of the tag if it exists.\n */\nexport function tryFindPropertyValue(\n projectContents: Node,\n propertyName: string,\n): string | null {\n const nodes = msbuildSelect(\n `//msbuild:PropertyGroup/msbuild:${propertyName}`,\n projectContents,\n );\n\n if (nodes.length > 0) {\n // Take the last one\n return (nodes[nodes.length - 1] as Node).textContent;\n }\n\n return null;\n}\n\nexport function findPropertyValue(\n projectContents: Node,\n propertyName: string,\n filePath: string,\n): string {\n const res = tryFindPropertyValue(projectContents, propertyName);\n if (!res) {\n throw new CodedError(\n 'NoPropertyInProject',\n `Couldn't find property ${propertyName} from ${filePath}`,\n {propertyName: propertyName},\n );\n }\n return res;\n}\n\n/**\n * Search for the given import project in the project contents and return if it exists.\n * @param projectContents The XML project contents.\n * @param projectName The project to look for.\n * @return If the target exists.\n */\nexport function importProjectExists(\n projectContents: Node,\n projectName: string,\n): boolean {\n const nodes = msbuildSelect(\n `//msbuild:Import[contains(@Project,'${projectName}')]`,\n projectContents,\n );\n\n return nodes.length > 0;\n}\n\nexport type ConfigurationType =\n | 'application'\n | 'dynamiclibrary'\n | 'generic'\n | 'staticlibrary'\n | 'unknown';\n\n/**\n * Gets the configuration type of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project configuration type.\n */\nexport function getConfigurationType(projectContents: Node): ConfigurationType {\n const configurationType = tryFindPropertyValue(\n projectContents,\n 'ConfigurationType',\n )?.toLowerCase();\n\n switch (configurationType) {\n case 'application':\n case 'dynamiclibrary':\n case 'generic':\n case 'staticlibrary':\n return configurationType;\n\n default:\n return 'unknown';\n }\n}\n\nexport type OutputType =\n | 'appcontainerexe'\n | 'exe'\n | 'library'\n | 'module'\n | 'unknown'\n | 'winexe'\n | 'winmdobj';\n\n/**\n * Gets the output type of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project output type.\n */\nexport function getOutputType(projectContents: Node): OutputType {\n const outputType = tryFindPropertyValue(\n projectContents,\n 'OutputType',\n )?.toLowerCase();\n\n switch (outputType) {\n case 'appcontainerexe':\n case 'exe':\n case 'library':\n case 'module':\n case 'winexe':\n case 'winmdobj':\n return outputType;\n\n default:\n return 'unknown';\n }\n}\n\n/**\n * Gets the type of the project from the project contents.\n * @param projectPath The project file path to check.\n * @param projectContents The XML project contents.\n * @return The project type.\n */\nexport function getProjectType(\n projectPath: string,\n projectContents: Node,\n): ConfigurationType | OutputType {\n switch (getProjectLanguage(projectPath)) {\n case 'cpp':\n return getConfigurationType(projectContents);\n\n case 'cs':\n return getOutputType(projectContents);\n\n default:\n return 'unknown';\n }\n}\n\n/**\n * Gets the name of the project from the project contents.\n * @param projectPath The project file path to check.\n * @param projectContents The XML project contents.\n * @return The project name.\n */\nexport function getProjectName(\n projectPath: string,\n projectContents: Node,\n): string {\n const name =\n tryFindPropertyValue(projectContents, 'ProjectName') ||\n path.parse(projectPath).name ||\n '';\n\n return name;\n}\n\n/**\n * Gets the namespace of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project namespace.\n */\nexport function getProjectNamespace(projectContents: Node): string | null {\n return tryFindPropertyValue(projectContents, 'RootNamespace');\n}\n\n/**\n * Gets the guid of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project guid.\n */\nexport function getProjectGuid(projectContents: Node): string | null {\n return tryFindPropertyValue(projectContents, 'ProjectGuid');\n}\n\nexport function getExperimentalFeatures(\n solutionDir: string,\n): Record<string, string> | undefined {\n const propsFile = path.join(solutionDir, 'ExperimentalFeatures.props');\n\n if (!fs.existsSync(propsFile)) {\n return undefined;\n }\n\n const result: Record<string, any> = {};\n const propsContents = readProjectFile(propsFile);\n const nodes = msbuildSelect(\n `//msbuild:PropertyGroup/msbuild:*`,\n propsContents,\n );\n for (const node of nodes) {\n const propertyNode = node as Node;\n result[propertyNode.nodeName] = propertyNode.textContent;\n }\n return result;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencyConfig.js","sourceRoot":"","sources":["../../src/config/dependencyConfig.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6EAA6E;AAC7E,6EAA6E;AAC7E,0BAA0B;AAC1B,gEAAgE;AAEhE,2BAA4B;AAC5B,gDAAwB;AAExB,2DAA6C;AA+F7C;;;;GAIG;AACH,sDAAsD;AACtD,sCAAsC;AACtC,SAAgB,uBAAuB,CACrC,MAAc,EACd,aAAsD,EAAE;IAExD,IAAI,IAAA,aAAQ,GAAE,KAAK,OAAO,EAAE;QAC1B,OAAO,IAAI,CAAC;KACb;IAED,IAAI,UAAU,KAAK,IAAI,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,2BAA2B,GAC/B,UAAU,IAAI,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEjE,MAAM,gCAAgC,GACpC,eAAe,IAAI,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAE3E,MAAM,MAAM,GAA4B;QACtC,MAAM;QACN,QAAQ,EAAE,2BAA2B,CAAC,CAAC,CAAC,UAAU,CAAC,QAAS,CAAC,CAAC,CAAC,EAAE;QACjE,YAAY,EAAE,IAAI;QAClB,aAAa,EAAE,gCAAgC;YAC7C,CAAC,CAAC,UAAU,CAAC,aAAc;YAC3B,CAAC,CAAC,EAAE;KACP,CAAC;IAEF,IAAI,SAAS,GAAkB,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CAAC;oBAClE,YAAY,CAAC,IAAI,CAAC,GAAG,WAAW,EAAE,CAAC,CAAC;oBACpC,kBAAkB,CAAC,IAAI,CAAC,GAAG,WAAW,uBAAuB,CAAC,CAAC;iBAChE;gBAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;oBACnB,WAAW,EAAE,cAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;oBAClD,WAAW;oBACX,WAAW;oBACX,WAAW;oBACX,gBAAgB;oBAChB,UAAU;oBACV,mBAAmB;oBACnB,YAAY;oBACZ,kBAAkB;iBACnB,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,WAAW,GAAG,cAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;gBAC1D,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;oBACnB,WAAW,EAAE,UAAU,WAAW,aAAa,WAAW,GAAG;oBAC7D,gBAAgB,EAAE,KAAK;oBACvB,WAAW,EAAE,EAAE;oBACf,WAAW,EAAE,IAAI;oBACjB,WAAW,EAAE,IAAI;oBACjB,UAAU,EAAE,EAAE;oBACd,mBAAmB,EAAE,EAAE;oBACvB,YAAY,EAAE,EAAE;oBAChB,kBAAkB,EAAE,EAAE;iBACvB,CAAC,CAAC;aACJ;SACF;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAhOD,0DAgOC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\n// Types in this file are inaccurate compared to usage in terms of falsiness.\n// We should try to rewrite some of this to do automated schema validation to\n// guarantee correct types\n/* eslint-disable @typescript-eslint/no-unnecessary-condition */\n\nimport {platform} from 'os';\nimport path from 'path';\n\nimport * as configUtils from './configUtils';\n\n/*\n\nreact-native config will generate the following JSON for each native module dependency\nunder node_modules that has a Windows implementation, in order to support auto-linking.\nThis is done heuristically, so if the result isn't quite correct, native module developers\ncan provide a manual override file: react-native.config.js.\n\nSchema for dependencies:\n\nTags:\nauto - Item is always calculated by config. An override file should NEVER provide it.\nreq - Item is required. If an override file exists, it MUST provide it. If no override file exists, config will try to calculate it.\nopt - Item is optional. If an override file exists, it MAY provide it. If no override file exists, config may try to calculate it.\n\n{\n folder: string, // (auto) Absolute path to the module root folder, determined by react-native config, ex: 'c:\\path\\to\\app-name\\node_modules\\my-module'\n sourceDir: string, // (opt, req if projects defined) Relative path to the Windows implementation under folder, ex: 'windows'\n solutionFile: string, // (opt) Relative path to the module's VS solution file under sourceDir, ex: 'MyModule.sln'\n projects: [ // (opt) Array of VS projects that must be added to the consuming app's solution file, so they are built\n {\n projectFile: string, // (req) Relative path to the VS project file under sourceDir, ex: 'MyModule\\MyModule.vcxproj' for 'c:\\path\\to\\app-name\\node_modules\\my-module\\windows\\MyModule\\MyModule.vcxproj'\n directDependency: bool, // (req) Whether to add the project file as a dependency to the consuming app's project file. true for projects that provide native modules\n projectName: string, // (auto) Name of the project, determined from projectFile, ex: 'MyModule'\n projectLang: string, // (auto) Language of the project, cpp or cs, determined from projectFile\n projectGuid: string, // (auto) Project identifier, determined from projectFile\n cppHeaders: [], // (opt) Array of cpp header include lines, ie: 'winrt/MyModule.h', to be transformed into '#include <winrt/MyModule.h>'\n cppPackageProviders: [], // (opt) Array of fully qualified cpp IReactPackageProviders, ie: 'MyModule::ReactPackageProvider'\n csNamespaces: [], // (opt) Array of cs namespaces, ie: 'MyModule', to be transformed into 'using MyModule;'\n csPackageProviders: [], // (opt) Array of fully qualified cs IReactPackageProviders, ie: 'MyModule.ReactPackageProvider'\n },\n ],\n nugetPackages: [ // (opt) Array of nuget packages including native modules that must be added as a dependency to the consuming app. It can be empty, but by its nature it can't be calculated\n {\n packageName: string, // (req) Name of the nuget package to install\n packageVersion: string, // (req) Version of the nuget package to install\n cppHeaders: [], // (req) Array of cpp header include lines, ie: 'winrt/NugetModule.h', to be transformed into '#include <winrt/NugetModule.h>'\n cppPackageProviders: [], // (req) Array of fully qualified cpp IReactPackageProviders, ie: 'NugetModule::ReactPackageProvider'\n csNamespaces: [], // (req) Array of cs namespaces, ie: 'NugetModule', to be transformed into 'using NugetModule;'\n csPackageProviders: [], // (req) Array of fully qualified cs IReactPackageProviders, ie: 'NugetModule.ReactPackageProvider'\n },\n ],\n}\n\nExample react-native.config.js for a 'MyModule':\n\nmodule.exports = {\n dependency: {\n platforms: {\n windows: {\n sourceDir: 'windows',\n solutionFile: 'MyModule.sln',\n projects: [\n {\n projectFile: 'MyModule\\\\MyModule.vcxproj',\n directDependency: true,\n }\n ],\n },\n },\n },\n};\n\n*/\n\nexport interface ProjectDependency {\n projectFile: string;\n directDependency: boolean;\n projectName: string;\n projectLang: 'cpp' | 'cs' | null;\n projectGuid: string | null;\n cppHeaders: string[];\n cppPackageProviders: string[];\n csNamespaces: string[];\n csPackageProviders: string[];\n}\n\nexport interface NuGetPackageDependency {\n packageName: string;\n packageVersion: string;\n cppHeaders: string[];\n cppPackageProviders: string[];\n csNamespaces: string[];\n csPackageProviders: string[];\n}\n\nexport interface WindowsDependencyConfig {\n folder: string;\n sourceDir?: string;\n solutionFile?: string | null;\n projects: ProjectDependency[];\n nugetPackages: NuGetPackageDependency[];\n}\n\n/**\n * Gets the config of any RNW native modules under the target folder.\n * @param userConfig A manually specified override config.\n * @return The config if any RNW native modules exist.\n */\n// Disabled due to existing high cyclomatic complexity\n// eslint-disable-next-line complexity\nexport function dependencyConfigWindows(\n folder: string,\n userConfig: Partial<WindowsDependencyConfig> | null = {},\n): WindowsDependencyConfig | null {\n if (platform() !== 'win32') {\n return null;\n }\n\n if (userConfig === null) {\n return null;\n }\n\n const usingManualProjectsOverride =\n 'projects' in userConfig && Array.isArray(userConfig.projects);\n\n const usingManualNugetPackagesOverride =\n 'nugetPackages' in userConfig && Array.isArray(userConfig.nugetPackages);\n\n const result: WindowsDependencyConfig = {\n folder,\n projects: usingManualProjectsOverride ? userConfig.projects! : [],\n solutionFile: null,\n nugetPackages: usingManualNugetPackagesOverride\n ? userConfig.nugetPackages!\n : [],\n };\n\n let sourceDir: string | null = null;\n if (usingManualProjectsOverride && result.projects.length > 0) {\n // Manually provided projects, so extract the sourceDir\n if (!('sourceDir' in userConfig)) {\n sourceDir =\n 'Error: Source dir is required if projects are specified, but it is not specified in react-native.config.';\n } else if (userConfig.sourceDir === null) {\n sourceDir =\n 'Error: Source dir is required if projects are specified, but it is null in react-native.config.';\n } else {\n sourceDir = path.join(folder, userConfig.sourceDir!);\n }\n } else if (!usingManualProjectsOverride) {\n // No manually provided projects, try to find sourceDir\n if ('sourceDir' in userConfig && userConfig.sourceDir !== null) {\n sourceDir = path.join(folder, userConfig.sourceDir!);\n } else {\n sourceDir = configUtils.findWindowsFolder(folder);\n }\n }\n\n if (sourceDir === null) {\n // Try to salvage the missing sourceDir\n if (result.projects.length === 0 && result.nugetPackages.length > 0) {\n // Only nuget packages, no sourceDir required\n return result;\n } else if (result.projects.length > 0) {\n // Projects overridden but no sourceDir, assume the sourceDir === folder\n sourceDir = folder;\n }\n } else if (sourceDir.startsWith('Error: ')) {\n // Source dir error, bail with error\n result.sourceDir = sourceDir;\n return result;\n }\n\n if (sourceDir === null) {\n // After everything above, if sourceDir is still null,\n // there's nothing more to look for here, bail\n return null;\n }\n\n result.sourceDir = path.relative(folder, sourceDir);\n\n const usingManualSolutionFile = 'solutionFile' in userConfig;\n\n let solutionFile = null;\n if (usingManualSolutionFile && userConfig.solutionFile !== null) {\n // Manually provided solutionFile, so extract it\n solutionFile = path.join(sourceDir, userConfig.solutionFile!);\n } else if (!usingManualSolutionFile) {\n // No manually provided solutionFile, try to find it\n const foundSolutions = configUtils.findSolutionFiles(sourceDir);\n if (foundSolutions.length === 1) {\n solutionFile = path.join(sourceDir, foundSolutions[0]);\n }\n }\n\n result.solutionFile =\n solutionFile !== null ? path.relative(sourceDir, solutionFile) : null;\n\n if (usingManualProjectsOverride) {\n // react-native.config used, fill out (auto) items for each provided project, verify (req) items are present\n\n const alwaysRequired: Array<keyof ProjectDependency> = [\n 'projectFile',\n 'directDependency',\n ];\n\n for (const project of result.projects) {\n // Verifying (req) items\n let errorFound = false;\n\n alwaysRequired.forEach(item => {\n if (!(item in project)) {\n (project[\n item\n ] as string) = `Error: ${item} is required for each project in react-native.config`;\n errorFound = true;\n }\n });\n\n if (errorFound) {\n break;\n }\n\n const projectFile = path.join(sourceDir, project.projectFile);\n\n const projectContents = configUtils.readProjectFile(projectFile);\n\n project.projectFile = path.relative(sourceDir, projectFile);\n\n // Calculating (auto) items\n project.projectName = configUtils.getProjectName(\n projectFile,\n projectContents,\n );\n project.projectLang = configUtils.getProjectLanguage(projectFile);\n project.projectGuid = configUtils.getProjectGuid(projectContents);\n\n if (project.directDependency) {\n // Calculating more (auto) items\n\n const projectNamespace = configUtils.getProjectNamespace(\n projectContents,\n );\n\n if (projectNamespace !== null) {\n const cppNamespace = projectNamespace!.replace(/\\./g, '::');\n const csNamespace = projectNamespace!.replace(/::/g, '.');\n\n project.cppHeaders = project.cppHeaders || [`winrt/${csNamespace}.h`];\n project.cppPackageProviders = project.cppPackageProviders || [\n `${cppNamespace}::ReactPackageProvider`,\n ];\n project.csNamespaces = project.csNamespaces || [`${csNamespace}`];\n project.csPackageProviders = project.csPackageProviders || [\n `${csNamespace}.ReactPackageProvider`,\n ];\n }\n }\n }\n } else {\n // No react-native.config, try to heuristically find any projects\n\n const foundProjects = configUtils.findDependencyProjectFiles(sourceDir);\n\n for (const foundProject of foundProjects) {\n const projectFile = path.join(sourceDir, foundProject);\n\n const projectContents = configUtils.readProjectFile(projectFile);\n\n const projectType = configUtils.getProjectType(\n projectFile,\n projectContents,\n );\n\n if (projectType === 'dynamiclibrary' || projectType === 'winmdobj') {\n const projectLang = configUtils.getProjectLanguage(projectFile);\n\n const projectName = configUtils.getProjectName(\n projectFile,\n projectContents,\n );\n\n const projectGuid = configUtils.getProjectGuid(projectContents);\n\n const projectNamespace = configUtils.getProjectNamespace(\n projectContents,\n );\n\n const directDependency = true;\n\n const cppHeaders: string[] = [];\n const cppPackageProviders: string[] = [];\n const csNamespaces: string[] = [];\n const csPackageProviders: string[] = [];\n\n if (projectNamespace !== null) {\n const cppNamespace = projectNamespace.replace(/\\./g, '::');\n const csNamespace = projectNamespace.replace(/::/g, '.');\n\n cppHeaders.push(`winrt/${csNamespace}.h`);\n cppPackageProviders.push(`${cppNamespace}::ReactPackageProvider`);\n csNamespaces.push(`${csNamespace}`);\n csPackageProviders.push(`${csNamespace}.ReactPackageProvider`);\n }\n\n result.projects.push({\n projectFile: path.relative(sourceDir, projectFile),\n projectName,\n projectLang,\n projectGuid,\n directDependency,\n cppHeaders,\n cppPackageProviders,\n csNamespaces,\n csPackageProviders,\n });\n } else {\n const projectPath = path.relative(sourceDir, projectFile);\n result.projects.push({\n projectFile: `Error: ${projectPath} is type '${projectType}'`,\n directDependency: false,\n projectName: '',\n projectLang: null,\n projectGuid: null,\n cppHeaders: [],\n cppPackageProviders: [],\n csNamespaces: [],\n csPackageProviders: [],\n });\n }\n }\n }\n\n return result;\n}\n"]}