@react-native-windows/cli 0.73.1 → 0.74.0-preview.1

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 (76) 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/healthCheckList.js.map +1 -1
  18. package/lib-commonjs/commands/healthCheck/healthChecks.d.ts +7 -7
  19. package/lib-commonjs/commands/healthCheck/healthChecks.js +123 -123
  20. package/lib-commonjs/commands/initWindows/initWindows.d.ts +46 -46
  21. package/lib-commonjs/commands/initWindows/initWindows.js +243 -243
  22. package/lib-commonjs/commands/initWindows/initWindowsOptions.d.ts +15 -15
  23. package/lib-commonjs/commands/initWindows/initWindowsOptions.js +37 -37
  24. package/lib-commonjs/commands/runWindows/runWindows.d.ts +10 -10
  25. package/lib-commonjs/commands/runWindows/runWindows.js +321 -321
  26. package/lib-commonjs/commands/runWindows/runWindowsOptions.d.ts +56 -56
  27. package/lib-commonjs/commands/runWindows/runWindowsOptions.js +132 -132
  28. package/lib-commonjs/e2etest/autolink.test.d.ts +6 -6
  29. package/lib-commonjs/e2etest/autolink.test.js +366 -366
  30. package/lib-commonjs/e2etest/dependencyConfig.test.d.ts +6 -6
  31. package/lib-commonjs/e2etest/dependencyConfig.test.js +129 -129
  32. package/lib-commonjs/e2etest/healthChecks.test.d.ts +6 -6
  33. package/lib-commonjs/e2etest/healthChecks.test.js +30 -30
  34. package/lib-commonjs/e2etest/initWindows.test.d.ts +6 -6
  35. package/lib-commonjs/e2etest/initWindows.test.js +42 -42
  36. package/lib-commonjs/e2etest/projectConfig.test.d.ts +6 -6
  37. package/lib-commonjs/e2etest/projectConfig.test.js +110 -110
  38. package/lib-commonjs/e2etest/projectConfig.utils.d.ts +8 -8
  39. package/lib-commonjs/e2etest/projectConfig.utils.js +76 -76
  40. package/lib-commonjs/e2etest/runWindows.test.d.ts +6 -6
  41. package/lib-commonjs/e2etest/runWindows.test.js +60 -60
  42. package/lib-commonjs/e2etest/typesUpToDate.test.d.ts +6 -0
  43. package/lib-commonjs/e2etest/typesUpToDate.test.js +21 -0
  44. package/lib-commonjs/e2etest/typesUpToDate.test.js.map +1 -0
  45. package/lib-commonjs/generator-common/index.d.ts +39 -39
  46. package/lib-commonjs/generator-common/index.js +242 -242
  47. package/lib-commonjs/generator-windows/index.d.ts +10 -10
  48. package/lib-commonjs/generator-windows/index.js +316 -316
  49. package/lib-commonjs/index.d.ts +50 -50
  50. package/lib-commonjs/index.js +77 -77
  51. package/lib-commonjs/utils/build.d.ts +12 -12
  52. package/lib-commonjs/utils/build.js +84 -84
  53. package/lib-commonjs/utils/checkRequirements.d.ts +6 -6
  54. package/lib-commonjs/utils/checkRequirements.js +69 -69
  55. package/lib-commonjs/utils/commandWithProgress.d.ts +21 -21
  56. package/lib-commonjs/utils/commandWithProgress.js +149 -149
  57. package/lib-commonjs/utils/deploy.d.ts +12 -12
  58. package/lib-commonjs/utils/deploy.js +353 -353
  59. package/lib-commonjs/utils/info.d.ts +6 -6
  60. package/lib-commonjs/utils/info.js +28 -28
  61. package/lib-commonjs/utils/msbuildtools.d.ts +28 -28
  62. package/lib-commonjs/utils/msbuildtools.js +273 -273
  63. package/lib-commonjs/utils/msbuildtools.js.map +1 -1
  64. package/lib-commonjs/utils/pathHelpers.d.ts +9 -9
  65. package/lib-commonjs/utils/pathHelpers.js +36 -36
  66. package/lib-commonjs/utils/telemetryHelpers.d.ts +29 -29
  67. package/lib-commonjs/utils/telemetryHelpers.js +120 -120
  68. package/lib-commonjs/utils/version.d.ts +19 -19
  69. package/lib-commonjs/utils/version.js +109 -109
  70. package/lib-commonjs/utils/vsInstalls.d.ts +34 -34
  71. package/lib-commonjs/utils/vsInstalls.js +99 -99
  72. package/lib-commonjs/utils/vstools.d.ts +16 -16
  73. package/lib-commonjs/utils/vstools.js +189 -189
  74. package/lib-commonjs/utils/winappdeploytool.d.ts +24 -24
  75. package/lib-commonjs/utils/winappdeploytool.js +108 -108
  76. package/package.json +16 -16
@@ -1,124 +1,124 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- * @format
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
- };
33
- Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.getHealthChecks = void 0;
35
- const path_1 = __importDefault(require("path"));
36
- const pathHelpers = __importStar(require("../../utils/pathHelpers"));
37
- const rnDir = pathHelpers.resolveRnRoot(process.cwd());
38
- const cliDir = pathHelpers.resolveRnCliRoot(rnDir);
39
- const execaPath = require.resolve('execa', { paths: [cliDir] });
40
- const execa = require(execaPath);
41
- const commandWithProgress_1 = require("../../utils/commandWithProgress");
42
- const healthCheckList_1 = require("./healthCheckList");
43
- function getHealthChecks() {
44
- // #8471: There are known cases where the dependencies script will error out.
45
- // Fail gracefully if that happens in the meantime.
46
- try {
47
- return getHealthChecksUnsafe();
48
- }
49
- catch (_a) {
50
- return [
51
- {
52
- label: 'Windows',
53
- healthchecks: [
54
- {
55
- label: 'Failed to enumerate health checks',
56
- description: 'Failed to enumerate health checks',
57
- getDiagnostics: async () => ({ needsToBeFixed: true }),
58
- runAutomaticFix: async ({ loader }) => {
59
- loader.fail();
60
- },
61
- },
62
- ],
63
- },
64
- ];
65
- }
66
- }
67
- exports.getHealthChecks = getHealthChecks;
68
- function getHealthChecksUnsafe() {
69
- // All our health checks are windows only...
70
- if (process.platform !== 'win32') {
71
- return undefined;
72
- }
73
- const rnwDepScriptPath = path_1.default.join(pathHelpers.resolveRnwRoot(process.cwd()), 'Scripts/rnw-dependencies.ps1');
74
- return [
75
- {
76
- label: 'Windows',
77
- healthchecks: healthCheckList_1.HealthCheckList.map((dep) => {
78
- const [optional, id, name] = dep;
79
- return {
80
- label: name,
81
- description: name,
82
- // The schema check of react-native doctor requires this to be a string, although it should be a boolean
83
- // Enable this once we pick up a new version of the CLI that includes https://github.com/react-native-community/cli/pull/1367
84
- isRequired: optional,
85
- getDiagnostics: async () => {
86
- let needsToBeFixed = true;
87
- try {
88
- await execa(`"${commandWithProgress_1.powershell}" -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -Check ${id}`);
89
- needsToBeFixed = false;
90
- }
91
- catch (_a) { }
92
- return {
93
- needsToBeFixed,
94
- };
95
- },
96
- runAutomaticFix: async ({ loader, logManualInstallation }) => {
97
- const command = `${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -Check ${id}`;
98
- try {
99
- const { exitCode } = await execa(command, { stdio: 'inherit' });
100
- if (exitCode) {
101
- logManualInstallation({
102
- command,
103
- healthcheck: `react-native-windows dependency "${id}"`,
104
- });
105
- loader.fail();
106
- }
107
- else {
108
- loader.succeed();
109
- }
110
- }
111
- catch (_a) {
112
- logManualInstallation({
113
- command,
114
- healthcheck: `react-native-windows dependency "${id}"`,
115
- });
116
- loader.fail();
117
- }
118
- },
119
- };
120
- }),
121
- },
122
- ];
123
- }
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ * @format
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
+ };
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.getHealthChecks = void 0;
35
+ const path_1 = __importDefault(require("path"));
36
+ const pathHelpers = __importStar(require("../../utils/pathHelpers"));
37
+ const rnDir = pathHelpers.resolveRnRoot(process.cwd());
38
+ const cliDir = pathHelpers.resolveRnCliRoot(rnDir);
39
+ const execaPath = require.resolve('execa', { paths: [cliDir] });
40
+ const execa = require(execaPath);
41
+ const commandWithProgress_1 = require("../../utils/commandWithProgress");
42
+ const healthCheckList_1 = require("./healthCheckList");
43
+ function getHealthChecks() {
44
+ // #8471: There are known cases where the dependencies script will error out.
45
+ // Fail gracefully if that happens in the meantime.
46
+ try {
47
+ return getHealthChecksUnsafe();
48
+ }
49
+ catch (_a) {
50
+ return [
51
+ {
52
+ label: 'Windows',
53
+ healthchecks: [
54
+ {
55
+ label: 'Failed to enumerate health checks',
56
+ description: 'Failed to enumerate health checks',
57
+ getDiagnostics: async () => ({ needsToBeFixed: true }),
58
+ runAutomaticFix: async ({ loader }) => {
59
+ loader.fail();
60
+ },
61
+ },
62
+ ],
63
+ },
64
+ ];
65
+ }
66
+ }
67
+ exports.getHealthChecks = getHealthChecks;
68
+ function getHealthChecksUnsafe() {
69
+ // All our health checks are windows only...
70
+ if (process.platform !== 'win32') {
71
+ return undefined;
72
+ }
73
+ const rnwDepScriptPath = path_1.default.join(pathHelpers.resolveRnwRoot(process.cwd()), 'Scripts/rnw-dependencies.ps1');
74
+ return [
75
+ {
76
+ label: 'Windows',
77
+ healthchecks: healthCheckList_1.HealthCheckList.map((dep) => {
78
+ const [optional, id, name] = dep;
79
+ return {
80
+ label: name,
81
+ description: name,
82
+ // The schema check of react-native doctor requires this to be a string, although it should be a boolean
83
+ // Enable this once we pick up a new version of the CLI that includes https://github.com/react-native-community/cli/pull/1367
84
+ isRequired: optional,
85
+ getDiagnostics: async () => {
86
+ let needsToBeFixed = true;
87
+ try {
88
+ await execa(`"${commandWithProgress_1.powershell}" -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -Check ${id}`);
89
+ needsToBeFixed = false;
90
+ }
91
+ catch (_a) { }
92
+ return {
93
+ needsToBeFixed,
94
+ };
95
+ },
96
+ runAutomaticFix: async ({ loader, logManualInstallation }) => {
97
+ const command = `${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -Check ${id}`;
98
+ try {
99
+ const { exitCode } = await execa(command, { stdio: 'inherit' });
100
+ if (exitCode) {
101
+ logManualInstallation({
102
+ command,
103
+ healthcheck: `react-native-windows dependency "${id}"`,
104
+ });
105
+ loader.fail();
106
+ }
107
+ else {
108
+ loader.succeed();
109
+ }
110
+ }
111
+ catch (_a) {
112
+ logManualInstallation({
113
+ command,
114
+ healthcheck: `react-native-windows dependency "${id}"`,
115
+ });
116
+ loader.fail();
117
+ }
118
+ },
119
+ };
120
+ }),
121
+ },
122
+ ];
123
+ }
124
124
  //# sourceMappingURL=healthChecks.js.map
@@ -1,46 +1,46 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
- import { Ora } from 'ora';
7
- import { Command, Config } from '@react-native-community/cli-types';
8
- import { InitOptions } from './initWindowsOptions';
9
- export interface TemplateFileMapping {
10
- from: string;
11
- to: string;
12
- replacements?: Record<string, any>;
13
- }
14
- export interface InitWindowsTemplateConfig {
15
- name: string;
16
- description: string;
17
- isDefault?: boolean;
18
- preInstall?: (config: Config, options: InitOptions) => Promise<void>;
19
- getFileMappings?: (config: Config, options: InitOptions) => Promise<TemplateFileMapping[]>;
20
- postInstall?: (config: Config, options: InitOptions) => Promise<void>;
21
- }
22
- export declare class InitWindows {
23
- readonly config: Config;
24
- readonly options: InitOptions;
25
- protected readonly rnwPath: string;
26
- protected readonly templates: Map<string, InitWindowsTemplateConfig>;
27
- constructor(config: Config, options: InitOptions);
28
- protected verboseMessage(message: any): void;
29
- protected loadTemplates(): Promise<void>;
30
- protected getDefaultTemplateName(): string;
31
- protected pascalCase(str: string): string;
32
- protected isValidProjectName(name: string): boolean;
33
- protected getReactNativeProjectName(projectDir: string): string;
34
- run(spinner: Ora): Promise<void>;
35
- }
36
- /**
37
- * Initializes a new RNW project from a given template.
38
- * @param args Unprocessed args passed from react-native CLI.
39
- * @param config Config passed from react-native CLI.
40
- * @param options Options passed from react-native CLI.
41
- */
42
- export declare function initWindowsInternal(args: string[], config: Config, options: InitOptions): Promise<void>;
43
- /**
44
- * Initializes a new RNW project from a given template.
45
- */
46
- export declare const initCommand: Command;
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ * @format
5
+ */
6
+ import { Ora } from 'ora';
7
+ import { Command, Config } from '@react-native-community/cli-types';
8
+ import { InitOptions } from './initWindowsOptions';
9
+ export interface TemplateFileMapping {
10
+ from: string;
11
+ to: string;
12
+ replacements?: Record<string, any>;
13
+ }
14
+ export interface InitWindowsTemplateConfig {
15
+ name: string;
16
+ description: string;
17
+ isDefault?: boolean;
18
+ preInstall?: (config: Config, options: InitOptions) => Promise<void>;
19
+ getFileMappings?: (config: Config, options: InitOptions) => Promise<TemplateFileMapping[]>;
20
+ postInstall?: (config: Config, options: InitOptions) => Promise<void>;
21
+ }
22
+ export declare class InitWindows {
23
+ readonly config: Config;
24
+ readonly options: InitOptions;
25
+ protected readonly rnwPath: string;
26
+ protected readonly templates: Map<string, InitWindowsTemplateConfig>;
27
+ constructor(config: Config, options: InitOptions);
28
+ protected verboseMessage(message: any): void;
29
+ protected loadTemplates(): Promise<void>;
30
+ protected getDefaultTemplateName(): string;
31
+ protected pascalCase(str: string): string;
32
+ protected isValidProjectName(name: string): boolean;
33
+ protected getReactNativeProjectName(projectDir: string): string;
34
+ run(spinner: Ora): Promise<void>;
35
+ }
36
+ /**
37
+ * Initializes a new RNW project from a given template.
38
+ * @param args Unprocessed args passed from react-native CLI.
39
+ * @param config Config passed from react-native CLI.
40
+ * @param options Options passed from react-native CLI.
41
+ */
42
+ export declare function initWindowsInternal(args: string[], config: Config, options: InitOptions): Promise<void>;
43
+ /**
44
+ * Initializes a new RNW project from a given template.
45
+ */
46
+ export declare const initCommand: Command;