@react-native-windows/cli 0.0.0-canary.201 → 0.0.0-canary.202

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 (74) hide show
  1. package/lib-commonjs/commands/autolinkWindows/autolinkWindows.d.ts +87 -87
  2. package/lib-commonjs/commands/autolinkWindows/autolinkWindows.js +654 -654
  3. package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.d.ts +14 -14
  4. package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.js +32 -32
  5. package/lib-commonjs/commands/codegenWindows/codegenWindows.d.ts +27 -27
  6. package/lib-commonjs/commands/codegenWindows/codegenWindows.js +205 -205
  7. package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.d.ts +12 -12
  8. package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.js +22 -22
  9. package/lib-commonjs/commands/config/configUtils.d.ts +123 -123
  10. package/lib-commonjs/commands/config/configUtils.js +380 -380
  11. package/lib-commonjs/commands/config/dependencyConfig.d.ts +37 -37
  12. package/lib-commonjs/commands/config/dependencyConfig.js +227 -227
  13. package/lib-commonjs/commands/config/projectConfig.d.ts +27 -27
  14. package/lib-commonjs/commands/config/projectConfig.js +180 -180
  15. package/lib-commonjs/commands/healthCheck/healthCheckList.d.ts +6 -6
  16. package/lib-commonjs/commands/healthCheck/healthCheckList.js +20 -20
  17. package/lib-commonjs/commands/healthCheck/healthChecks.d.ts +7 -7
  18. package/lib-commonjs/commands/healthCheck/healthChecks.js +123 -123
  19. package/lib-commonjs/commands/initWindows/initWindows.d.ts +46 -46
  20. package/lib-commonjs/commands/initWindows/initWindows.js +243 -243
  21. package/lib-commonjs/commands/initWindows/initWindowsOptions.d.ts +15 -15
  22. package/lib-commonjs/commands/initWindows/initWindowsOptions.js +37 -37
  23. package/lib-commonjs/commands/runWindows/runWindows.d.ts +10 -10
  24. package/lib-commonjs/commands/runWindows/runWindows.js +321 -321
  25. package/lib-commonjs/commands/runWindows/runWindowsOptions.d.ts +56 -56
  26. package/lib-commonjs/commands/runWindows/runWindowsOptions.js +132 -132
  27. package/lib-commonjs/e2etest/autolink.test.d.ts +6 -6
  28. package/lib-commonjs/e2etest/autolink.test.js +366 -366
  29. package/lib-commonjs/e2etest/dependencyConfig.test.d.ts +6 -6
  30. package/lib-commonjs/e2etest/dependencyConfig.test.js +129 -129
  31. package/lib-commonjs/e2etest/healthChecks.test.d.ts +6 -6
  32. package/lib-commonjs/e2etest/healthChecks.test.js +30 -30
  33. package/lib-commonjs/e2etest/initWindows.test.d.ts +6 -6
  34. package/lib-commonjs/e2etest/initWindows.test.js +42 -42
  35. package/lib-commonjs/e2etest/projectConfig.test.d.ts +6 -6
  36. package/lib-commonjs/e2etest/projectConfig.test.js +110 -110
  37. package/lib-commonjs/e2etest/projectConfig.utils.d.ts +8 -8
  38. package/lib-commonjs/e2etest/projectConfig.utils.js +76 -76
  39. package/lib-commonjs/e2etest/runWindows.test.d.ts +6 -6
  40. package/lib-commonjs/e2etest/runWindows.test.js +60 -60
  41. package/lib-commonjs/e2etest/typesUpToDate.test.d.ts +6 -0
  42. package/lib-commonjs/e2etest/typesUpToDate.test.js +21 -0
  43. package/lib-commonjs/e2etest/typesUpToDate.test.js.map +1 -0
  44. package/lib-commonjs/generator-common/index.d.ts +39 -39
  45. package/lib-commonjs/generator-common/index.js +242 -242
  46. package/lib-commonjs/generator-windows/index.d.ts +10 -10
  47. package/lib-commonjs/generator-windows/index.js +316 -316
  48. package/lib-commonjs/index.d.ts +50 -50
  49. package/lib-commonjs/index.js +77 -77
  50. package/lib-commonjs/utils/build.d.ts +12 -12
  51. package/lib-commonjs/utils/build.js +84 -84
  52. package/lib-commonjs/utils/checkRequirements.d.ts +6 -6
  53. package/lib-commonjs/utils/checkRequirements.js +69 -69
  54. package/lib-commonjs/utils/commandWithProgress.d.ts +21 -21
  55. package/lib-commonjs/utils/commandWithProgress.js +149 -149
  56. package/lib-commonjs/utils/deploy.d.ts +12 -12
  57. package/lib-commonjs/utils/deploy.js +353 -353
  58. package/lib-commonjs/utils/info.d.ts +6 -6
  59. package/lib-commonjs/utils/info.js +28 -28
  60. package/lib-commonjs/utils/msbuildtools.d.ts +28 -28
  61. package/lib-commonjs/utils/msbuildtools.js +273 -273
  62. package/lib-commonjs/utils/pathHelpers.d.ts +9 -9
  63. package/lib-commonjs/utils/pathHelpers.js +36 -36
  64. package/lib-commonjs/utils/telemetryHelpers.d.ts +29 -29
  65. package/lib-commonjs/utils/telemetryHelpers.js +120 -120
  66. package/lib-commonjs/utils/version.d.ts +19 -19
  67. package/lib-commonjs/utils/version.js +109 -109
  68. package/lib-commonjs/utils/vsInstalls.d.ts +34 -34
  69. package/lib-commonjs/utils/vsInstalls.js +99 -99
  70. package/lib-commonjs/utils/vstools.d.ts +16 -16
  71. package/lib-commonjs/utils/vstools.js +189 -189
  72. package/lib-commonjs/utils/winappdeploytool.d.ts +24 -24
  73. package/lib-commonjs/utils/winappdeploytool.js +108 -108
  74. package/package.json +14 -14
@@ -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("@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;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-windows/cli",
3
- "version": "0.0.0-canary.201",
3
+ "version": "0.0.0-canary.202",
4
4
  "license": "MIT",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "repository": {
@@ -17,10 +17,10 @@
17
17
  "watch": "rnw-scripts watch"
18
18
  },
19
19
  "dependencies": {
20
- "@react-native-windows/codegen": "0.0.0-canary.77",
21
- "@react-native-windows/fs": "^0.0.0-canary.34",
22
- "@react-native-windows/package-utils": "^0.0.0-canary.60",
23
- "@react-native-windows/telemetry": "^0.0.0-canary.85",
20
+ "@react-native-windows/codegen": "0.0.0-canary.78",
21
+ "@react-native-windows/fs": "^0.0.0-canary.35",
22
+ "@react-native-windows/package-utils": "^0.0.0-canary.61",
23
+ "@react-native-windows/telemetry": "^0.0.0-canary.86",
24
24
  "@xmldom/xmldom": "^0.7.7",
25
25
  "chalk": "^4.1.0",
26
26
  "cli-spinners": "^2.2.0",
@@ -40,11 +40,11 @@
40
40
  "xpath": "^0.0.27"
41
41
  },
42
42
  "devDependencies": {
43
- "@react-native-community/cli-doctor": "12.0.0-alpha.12",
44
- "@react-native-community/cli-types": "12.0.0-alpha.12",
45
- "@rnw-scripts/eslint-config": "1.2.5",
46
- "@rnw-scripts/jest-unittest-config": "1.5.7",
47
- "@rnw-scripts/just-task": "2.3.21",
43
+ "@react-native-community/cli-doctor": "13.0.0",
44
+ "@react-native-community/cli-types": "13.0.0",
45
+ "@rnw-scripts/eslint-config": "1.2.6",
46
+ "@rnw-scripts/jest-unittest-config": "1.5.8",
47
+ "@rnw-scripts/just-task": "2.3.22",
48
48
  "@rnw-scripts/ts-config": "2.0.5",
49
49
  "@types/chalk": "^2.2.0",
50
50
  "@types/jest": "^29.2.2",
@@ -60,11 +60,11 @@
60
60
  "@types/xmldom": "^0.1.30",
61
61
  "@typescript-eslint/eslint-plugin": "^5.30.5",
62
62
  "@typescript-eslint/parser": "^5.57.1",
63
- "babel-jest": "^29.3.0",
63
+ "babel-jest": "^29.6.3",
64
64
  "eslint": "^8.19.0",
65
- "jest": "^29.2.1",
66
- "prettier": "^2.4.1",
67
- "typescript": "^4.9.5"
65
+ "jest": "^29.6.3",
66
+ "prettier": "2.8.8",
67
+ "typescript": "5.0.4"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react-native": "*"