@react-native-windows/cli 0.73.2 → 0.74.0-preview.2
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.
- package/lib-commonjs/commands/autolinkWindows/autolinkWindows.d.ts +87 -87
- package/lib-commonjs/commands/autolinkWindows/autolinkWindows.js +654 -654
- package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.d.ts +14 -14
- package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.js +32 -32
- package/lib-commonjs/commands/codegenWindows/codegenWindows.d.ts +27 -27
- package/lib-commonjs/commands/codegenWindows/codegenWindows.js +205 -205
- package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.d.ts +12 -12
- package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.js +22 -22
- package/lib-commonjs/commands/config/configUtils.d.ts +123 -123
- package/lib-commonjs/commands/config/configUtils.js +380 -380
- package/lib-commonjs/commands/config/dependencyConfig.d.ts +37 -37
- package/lib-commonjs/commands/config/dependencyConfig.js +227 -227
- package/lib-commonjs/commands/config/projectConfig.d.ts +27 -27
- package/lib-commonjs/commands/config/projectConfig.js +180 -180
- package/lib-commonjs/commands/healthCheck/healthCheckList.d.ts +6 -6
- package/lib-commonjs/commands/healthCheck/healthCheckList.js +20 -20
- package/lib-commonjs/commands/healthCheck/healthCheckList.js.map +1 -1
- package/lib-commonjs/commands/healthCheck/healthChecks.d.ts +7 -7
- package/lib-commonjs/commands/healthCheck/healthChecks.js +123 -123
- package/lib-commonjs/commands/initWindows/initWindows.d.ts +46 -46
- package/lib-commonjs/commands/initWindows/initWindows.js +243 -243
- package/lib-commonjs/commands/initWindows/initWindowsOptions.d.ts +15 -15
- package/lib-commonjs/commands/initWindows/initWindowsOptions.js +37 -37
- package/lib-commonjs/commands/runWindows/runWindows.d.ts +10 -10
- package/lib-commonjs/commands/runWindows/runWindows.js +321 -321
- package/lib-commonjs/commands/runWindows/runWindowsOptions.d.ts +56 -56
- package/lib-commonjs/commands/runWindows/runWindowsOptions.js +132 -132
- package/lib-commonjs/e2etest/autolink.test.d.ts +6 -6
- package/lib-commonjs/e2etest/autolink.test.js +366 -366
- package/lib-commonjs/e2etest/dependencyConfig.test.d.ts +6 -6
- package/lib-commonjs/e2etest/dependencyConfig.test.js +129 -129
- package/lib-commonjs/e2etest/healthChecks.test.d.ts +6 -6
- package/lib-commonjs/e2etest/healthChecks.test.js +30 -30
- package/lib-commonjs/e2etest/initWindows.test.d.ts +6 -6
- package/lib-commonjs/e2etest/initWindows.test.js +42 -42
- package/lib-commonjs/e2etest/projectConfig.test.d.ts +6 -6
- package/lib-commonjs/e2etest/projectConfig.test.js +110 -110
- package/lib-commonjs/e2etest/projectConfig.utils.d.ts +8 -8
- package/lib-commonjs/e2etest/projectConfig.utils.js +76 -76
- package/lib-commonjs/e2etest/runWindows.test.d.ts +6 -6
- package/lib-commonjs/e2etest/runWindows.test.js +60 -60
- package/lib-commonjs/e2etest/typesUpToDate.test.d.ts +6 -0
- package/lib-commonjs/e2etest/typesUpToDate.test.js +21 -0
- package/lib-commonjs/e2etest/typesUpToDate.test.js.map +1 -0
- package/lib-commonjs/generator-common/index.d.ts +39 -39
- package/lib-commonjs/generator-common/index.js +242 -242
- package/lib-commonjs/generator-windows/index.d.ts +10 -10
- package/lib-commonjs/generator-windows/index.js +316 -316
- package/lib-commonjs/index.d.ts +50 -50
- package/lib-commonjs/index.js +77 -77
- package/lib-commonjs/utils/build.d.ts +12 -12
- package/lib-commonjs/utils/build.js +84 -84
- package/lib-commonjs/utils/checkRequirements.d.ts +6 -6
- package/lib-commonjs/utils/checkRequirements.js +69 -69
- package/lib-commonjs/utils/commandWithProgress.d.ts +21 -21
- package/lib-commonjs/utils/commandWithProgress.js +149 -149
- package/lib-commonjs/utils/deploy.d.ts +12 -12
- package/lib-commonjs/utils/deploy.js +353 -353
- package/lib-commonjs/utils/info.d.ts +6 -6
- package/lib-commonjs/utils/info.js +28 -28
- package/lib-commonjs/utils/msbuildtools.d.ts +28 -28
- package/lib-commonjs/utils/msbuildtools.js +273 -273
- package/lib-commonjs/utils/msbuildtools.js.map +1 -1
- package/lib-commonjs/utils/pathHelpers.d.ts +9 -9
- package/lib-commonjs/utils/pathHelpers.js +36 -36
- package/lib-commonjs/utils/telemetryHelpers.d.ts +29 -29
- package/lib-commonjs/utils/telemetryHelpers.js +120 -120
- package/lib-commonjs/utils/version.d.ts +19 -19
- package/lib-commonjs/utils/version.js +109 -109
- package/lib-commonjs/utils/vsInstalls.d.ts +34 -34
- package/lib-commonjs/utils/vsInstalls.js +99 -99
- package/lib-commonjs/utils/vstools.d.ts +16 -16
- package/lib-commonjs/utils/vstools.js +189 -189
- package/lib-commonjs/utils/winappdeploytool.d.ts +24 -24
- package/lib-commonjs/utils/winappdeploytool.js +108 -108
- package/package.json +16 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
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 path_1 = __importDefault(require("path"));
|
|
12
|
-
const dependencyConfig_1 = require("../commands/config/dependencyConfig");
|
|
13
|
-
const projectConfig_utils_1 = require("./projectConfig.utils");
|
|
14
|
-
const generator_common_1 = require("../generator-common");
|
|
15
|
-
function project(name, setup) {
|
|
16
|
-
return [name, setup];
|
|
17
|
-
}
|
|
18
|
-
const projects = [
|
|
19
|
-
// Nothing but a react-native.config.js, with nulls
|
|
20
|
-
project('BlankLib'),
|
|
21
|
-
// Nothing but a windows folder
|
|
22
|
-
project('MissingProjectFilesLib', async (folder) => {
|
|
23
|
-
const windowsDir = path_1.default.join(folder, 'windows');
|
|
24
|
-
await (0, projectConfig_utils_1.tryMkdir)(windowsDir);
|
|
25
|
-
}),
|
|
26
|
-
// New C++ app project based on the template
|
|
27
|
-
project('SimpleCppApp', async (folder) => {
|
|
28
|
-
await (0, projectConfig_utils_1.ensureCppAppProject)(folder, 'SimpleCppApp');
|
|
29
|
-
}),
|
|
30
|
-
// New C++ project based on the template
|
|
31
|
-
project('SimpleCppLib', async (folder) => {
|
|
32
|
-
const windowsDir = path_1.default.join(folder, 'windows');
|
|
33
|
-
await (0, projectConfig_utils_1.tryMkdir)(windowsDir);
|
|
34
|
-
const replacements = {
|
|
35
|
-
name: 'SimpleCppLib',
|
|
36
|
-
namespace: 'SimpleCppLib',
|
|
37
|
-
useMustache: true,
|
|
38
|
-
projectGuidUpper: projectConfig_utils_1.testProjectGuid,
|
|
39
|
-
projectGuidLower: projectConfig_utils_1.testProjectGuid.toLowerCase(),
|
|
40
|
-
};
|
|
41
|
-
await (0, generator_common_1.copyAndReplace)(path_1.default.join(projectConfig_utils_1.templateRoot, 'cpp-lib/proj/MyLib.sln'), path_1.default.join(windowsDir, 'SimpleCppLib.sln'), replacements, null);
|
|
42
|
-
const projDir = path_1.default.join(windowsDir, 'SimpleCppLib');
|
|
43
|
-
await (0, projectConfig_utils_1.tryMkdir)(projDir);
|
|
44
|
-
await (0, generator_common_1.copyAndReplace)(path_1.default.join(projectConfig_utils_1.templateRoot, 'cpp-lib/proj/MyLib.vcxproj'), path_1.default.join(projDir, 'SimpleCppLib.vcxproj'), replacements, null);
|
|
45
|
-
}),
|
|
46
|
-
// New C# app project based on the template
|
|
47
|
-
project('SimpleCSharpApp', async (folder) => {
|
|
48
|
-
await (0, projectConfig_utils_1.ensureCSharpAppProject)(folder, 'SimpleCSharpApp');
|
|
49
|
-
}),
|
|
50
|
-
// New C# project based on the template
|
|
51
|
-
project('SimpleCSharpLib', async (folder) => {
|
|
52
|
-
const windowsDir = path_1.default.join(folder, 'windows');
|
|
53
|
-
await (0, projectConfig_utils_1.tryMkdir)(windowsDir);
|
|
54
|
-
const replacements = {
|
|
55
|
-
name: 'SimpleCSharpLib',
|
|
56
|
-
namespace: 'SimpleCSharpLib',
|
|
57
|
-
useMustache: true,
|
|
58
|
-
projectGuidUpper: projectConfig_utils_1.testProjectGuid,
|
|
59
|
-
projectGuidLower: projectConfig_utils_1.testProjectGuid.toLowerCase(),
|
|
60
|
-
};
|
|
61
|
-
await (0, generator_common_1.copyAndReplace)(path_1.default.join(projectConfig_utils_1.templateRoot, 'cs-lib/proj/MyLib.sln'), path_1.default.join(windowsDir, 'SimpleCSharpLib.sln'), replacements, null);
|
|
62
|
-
const projDir = path_1.default.join(windowsDir, 'SimpleCSharpLib');
|
|
63
|
-
await (0, projectConfig_utils_1.tryMkdir)(projDir);
|
|
64
|
-
await (0, generator_common_1.copyAndReplace)(path_1.default.join(projectConfig_utils_1.templateRoot, 'cs-lib/proj/MyLib.csproj'), path_1.default.join(projDir, 'SimpleCSharpLib.csproj'), replacements, null);
|
|
65
|
-
}),
|
|
66
|
-
project('WithIndirectDependency'),
|
|
67
|
-
];
|
|
68
|
-
// Tests that given userConfig is null, the result will always be null
|
|
69
|
-
test.each(projects)('dependencyConfig - %s (userConfig is null)', async (name, setup) => {
|
|
70
|
-
const folder = path_1.default.resolve('src/e2etest/projects/', name);
|
|
71
|
-
if (setup !== undefined) {
|
|
72
|
-
await setup(folder);
|
|
73
|
-
}
|
|
74
|
-
const userConfig = null;
|
|
75
|
-
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toBeNull();
|
|
76
|
-
});
|
|
77
|
-
// Tests the result given a windows project config in react-native.config.js
|
|
78
|
-
test.each(projects)('dependencyConfig - %s (Use react-native.config.js)', async (name, setup) => {
|
|
79
|
-
const folder = path_1.default.resolve('src/e2etest/projects/', name);
|
|
80
|
-
const rnc = require(path_1.default.join(folder, 'react-native.config.js'));
|
|
81
|
-
if (setup !== undefined) {
|
|
82
|
-
await setup(folder);
|
|
83
|
-
}
|
|
84
|
-
const userConfig = rnc.dependency.platforms.windows;
|
|
85
|
-
if (name === 'BlankLib') {
|
|
86
|
-
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot();
|
|
87
|
-
}
|
|
88
|
-
else if (name.endsWith('App')) {
|
|
89
|
-
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot({
|
|
90
|
-
folder: expect.stringContaining(name),
|
|
91
|
-
projects: expect.arrayContaining([
|
|
92
|
-
expect.objectContaining({
|
|
93
|
-
projectFile: expect.stringMatching(/Error: .*\.(?:cs|vcx)proj is type '\w+'/),
|
|
94
|
-
}),
|
|
95
|
-
]),
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot({
|
|
100
|
-
folder: expect.stringContaining(name),
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
// Tests the result of ignoring the windows project config in react-native.config.js
|
|
105
|
-
test.each(projects)('dependencyConfig - %s (Ignore react-native.config.js)', async (name, setup) => {
|
|
106
|
-
const folder = path_1.default.resolve('src/e2etest/projects/', name);
|
|
107
|
-
if (setup !== undefined) {
|
|
108
|
-
await setup(folder);
|
|
109
|
-
}
|
|
110
|
-
const userConfig = {};
|
|
111
|
-
if (name === 'BlankLib') {
|
|
112
|
-
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot();
|
|
113
|
-
}
|
|
114
|
-
else if (name.endsWith('App')) {
|
|
115
|
-
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot({
|
|
116
|
-
folder: expect.stringContaining(name),
|
|
117
|
-
projects: expect.arrayContaining([
|
|
118
|
-
expect.objectContaining({
|
|
119
|
-
projectFile: expect.stringMatching(/Error: .*\.(?:cs|vcx)proj is type '\w+'/),
|
|
120
|
-
}),
|
|
121
|
-
]),
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot({
|
|
126
|
-
folder: expect.stringContaining(name),
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
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 path_1 = __importDefault(require("path"));
|
|
12
|
+
const dependencyConfig_1 = require("../commands/config/dependencyConfig");
|
|
13
|
+
const projectConfig_utils_1 = require("./projectConfig.utils");
|
|
14
|
+
const generator_common_1 = require("../generator-common");
|
|
15
|
+
function project(name, setup) {
|
|
16
|
+
return [name, setup];
|
|
17
|
+
}
|
|
18
|
+
const projects = [
|
|
19
|
+
// Nothing but a react-native.config.js, with nulls
|
|
20
|
+
project('BlankLib'),
|
|
21
|
+
// Nothing but a windows folder
|
|
22
|
+
project('MissingProjectFilesLib', async (folder) => {
|
|
23
|
+
const windowsDir = path_1.default.join(folder, 'windows');
|
|
24
|
+
await (0, projectConfig_utils_1.tryMkdir)(windowsDir);
|
|
25
|
+
}),
|
|
26
|
+
// New C++ app project based on the template
|
|
27
|
+
project('SimpleCppApp', async (folder) => {
|
|
28
|
+
await (0, projectConfig_utils_1.ensureCppAppProject)(folder, 'SimpleCppApp');
|
|
29
|
+
}),
|
|
30
|
+
// New C++ project based on the template
|
|
31
|
+
project('SimpleCppLib', async (folder) => {
|
|
32
|
+
const windowsDir = path_1.default.join(folder, 'windows');
|
|
33
|
+
await (0, projectConfig_utils_1.tryMkdir)(windowsDir);
|
|
34
|
+
const replacements = {
|
|
35
|
+
name: 'SimpleCppLib',
|
|
36
|
+
namespace: 'SimpleCppLib',
|
|
37
|
+
useMustache: true,
|
|
38
|
+
projectGuidUpper: projectConfig_utils_1.testProjectGuid,
|
|
39
|
+
projectGuidLower: projectConfig_utils_1.testProjectGuid.toLowerCase(),
|
|
40
|
+
};
|
|
41
|
+
await (0, generator_common_1.copyAndReplace)(path_1.default.join(projectConfig_utils_1.templateRoot, 'cpp-lib/proj/MyLib.sln'), path_1.default.join(windowsDir, 'SimpleCppLib.sln'), replacements, null);
|
|
42
|
+
const projDir = path_1.default.join(windowsDir, 'SimpleCppLib');
|
|
43
|
+
await (0, projectConfig_utils_1.tryMkdir)(projDir);
|
|
44
|
+
await (0, generator_common_1.copyAndReplace)(path_1.default.join(projectConfig_utils_1.templateRoot, 'cpp-lib/proj/MyLib.vcxproj'), path_1.default.join(projDir, 'SimpleCppLib.vcxproj'), replacements, null);
|
|
45
|
+
}),
|
|
46
|
+
// New C# app project based on the template
|
|
47
|
+
project('SimpleCSharpApp', async (folder) => {
|
|
48
|
+
await (0, projectConfig_utils_1.ensureCSharpAppProject)(folder, 'SimpleCSharpApp');
|
|
49
|
+
}),
|
|
50
|
+
// New C# project based on the template
|
|
51
|
+
project('SimpleCSharpLib', async (folder) => {
|
|
52
|
+
const windowsDir = path_1.default.join(folder, 'windows');
|
|
53
|
+
await (0, projectConfig_utils_1.tryMkdir)(windowsDir);
|
|
54
|
+
const replacements = {
|
|
55
|
+
name: 'SimpleCSharpLib',
|
|
56
|
+
namespace: 'SimpleCSharpLib',
|
|
57
|
+
useMustache: true,
|
|
58
|
+
projectGuidUpper: projectConfig_utils_1.testProjectGuid,
|
|
59
|
+
projectGuidLower: projectConfig_utils_1.testProjectGuid.toLowerCase(),
|
|
60
|
+
};
|
|
61
|
+
await (0, generator_common_1.copyAndReplace)(path_1.default.join(projectConfig_utils_1.templateRoot, 'cs-lib/proj/MyLib.sln'), path_1.default.join(windowsDir, 'SimpleCSharpLib.sln'), replacements, null);
|
|
62
|
+
const projDir = path_1.default.join(windowsDir, 'SimpleCSharpLib');
|
|
63
|
+
await (0, projectConfig_utils_1.tryMkdir)(projDir);
|
|
64
|
+
await (0, generator_common_1.copyAndReplace)(path_1.default.join(projectConfig_utils_1.templateRoot, 'cs-lib/proj/MyLib.csproj'), path_1.default.join(projDir, 'SimpleCSharpLib.csproj'), replacements, null);
|
|
65
|
+
}),
|
|
66
|
+
project('WithIndirectDependency'),
|
|
67
|
+
];
|
|
68
|
+
// Tests that given userConfig is null, the result will always be null
|
|
69
|
+
test.each(projects)('dependencyConfig - %s (userConfig is null)', async (name, setup) => {
|
|
70
|
+
const folder = path_1.default.resolve('src/e2etest/projects/', name);
|
|
71
|
+
if (setup !== undefined) {
|
|
72
|
+
await setup(folder);
|
|
73
|
+
}
|
|
74
|
+
const userConfig = null;
|
|
75
|
+
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toBeNull();
|
|
76
|
+
});
|
|
77
|
+
// Tests the result given a windows project config in react-native.config.js
|
|
78
|
+
test.each(projects)('dependencyConfig - %s (Use react-native.config.js)', async (name, setup) => {
|
|
79
|
+
const folder = path_1.default.resolve('src/e2etest/projects/', name);
|
|
80
|
+
const rnc = require(path_1.default.join(folder, 'react-native.config.js'));
|
|
81
|
+
if (setup !== undefined) {
|
|
82
|
+
await setup(folder);
|
|
83
|
+
}
|
|
84
|
+
const userConfig = rnc.dependency.platforms.windows;
|
|
85
|
+
if (name === 'BlankLib') {
|
|
86
|
+
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot();
|
|
87
|
+
}
|
|
88
|
+
else if (name.endsWith('App')) {
|
|
89
|
+
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot({
|
|
90
|
+
folder: expect.stringContaining(name),
|
|
91
|
+
projects: expect.arrayContaining([
|
|
92
|
+
expect.objectContaining({
|
|
93
|
+
projectFile: expect.stringMatching(/Error: .*\.(?:cs|vcx)proj is type '\w+'/),
|
|
94
|
+
}),
|
|
95
|
+
]),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot({
|
|
100
|
+
folder: expect.stringContaining(name),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
// Tests the result of ignoring the windows project config in react-native.config.js
|
|
105
|
+
test.each(projects)('dependencyConfig - %s (Ignore react-native.config.js)', async (name, setup) => {
|
|
106
|
+
const folder = path_1.default.resolve('src/e2etest/projects/', name);
|
|
107
|
+
if (setup !== undefined) {
|
|
108
|
+
await setup(folder);
|
|
109
|
+
}
|
|
110
|
+
const userConfig = {};
|
|
111
|
+
if (name === 'BlankLib') {
|
|
112
|
+
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot();
|
|
113
|
+
}
|
|
114
|
+
else if (name.endsWith('App')) {
|
|
115
|
+
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot({
|
|
116
|
+
folder: expect.stringContaining(name),
|
|
117
|
+
projects: expect.arrayContaining([
|
|
118
|
+
expect.objectContaining({
|
|
119
|
+
projectFile: expect.stringMatching(/Error: .*\.(?:cs|vcx)proj is type '\w+'/),
|
|
120
|
+
}),
|
|
121
|
+
]),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
expect((0, dependencyConfig_1.dependencyConfigWindows)(folder, userConfig)).toMatchSnapshot({
|
|
126
|
+
folder: expect.stringContaining(name),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
130
|
//# sourceMappingURL=dependencyConfig.test.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
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 child_process_1 = require("child_process");
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
|
-
const commandWithProgress_1 = require("../utils/commandWithProgress");
|
|
14
|
-
const healthCheckList_1 = require("../commands/healthCheck/healthCheckList");
|
|
15
|
-
test('Verify list of health checks aligns with rnw-dependencies', async () => {
|
|
16
|
-
const rnwDepScriptPath = path_1.default.join(path_1.default.dirname(require.resolve('react-native-windows/package.json', {
|
|
17
|
-
paths: [process.cwd()],
|
|
18
|
-
})), 'Scripts/rnw-dependencies.ps1');
|
|
19
|
-
const rnwDeps = (0, child_process_1.execSync)(`${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -ListChecks`, { stdio: 'pipe' });
|
|
20
|
-
const deps = rnwDeps.toString().trim().split('\n');
|
|
21
|
-
const rnwHealthChecks = deps.map(dep => {
|
|
22
|
-
const match = /([^:]+): ([^:]+): (.*)/.exec(dep);
|
|
23
|
-
if (!match) {
|
|
24
|
-
throw new Error(`Unexpected output from ${rnwDepScriptPath}`);
|
|
25
|
-
}
|
|
26
|
-
const [, optional, id, name] = match;
|
|
27
|
-
return [optional.trim() === 'Required', id, name];
|
|
28
|
-
});
|
|
29
|
-
expect(healthCheckList_1.HealthCheckList).toEqual(rnwHealthChecks);
|
|
30
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
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 child_process_1 = require("child_process");
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
|
+
const commandWithProgress_1 = require("../utils/commandWithProgress");
|
|
14
|
+
const healthCheckList_1 = require("../commands/healthCheck/healthCheckList");
|
|
15
|
+
test('Verify list of health checks aligns with rnw-dependencies', async () => {
|
|
16
|
+
const rnwDepScriptPath = path_1.default.join(path_1.default.dirname(require.resolve('react-native-windows/package.json', {
|
|
17
|
+
paths: [process.cwd()],
|
|
18
|
+
})), 'Scripts/rnw-dependencies.ps1');
|
|
19
|
+
const rnwDeps = (0, child_process_1.execSync)(`${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -ListChecks`, { stdio: 'pipe' });
|
|
20
|
+
const deps = rnwDeps.toString().trim().split('\n');
|
|
21
|
+
const rnwHealthChecks = deps.map(dep => {
|
|
22
|
+
const match = /([^:]+): ([^:]+): (.*)/.exec(dep);
|
|
23
|
+
if (!match) {
|
|
24
|
+
throw new Error(`Unexpected output from ${rnwDepScriptPath}`);
|
|
25
|
+
}
|
|
26
|
+
const [, optional, id, name] = match;
|
|
27
|
+
return [optional.trim() === 'Required', id, name];
|
|
28
|
+
});
|
|
29
|
+
expect(healthCheckList_1.HealthCheckList).toEqual(rnwHealthChecks);
|
|
30
|
+
});
|
|
31
31
|
//# sourceMappingURL=healthChecks.test.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
9
|
-
const initWindowsOptions_1 = require("../commands/initWindows/initWindowsOptions");
|
|
10
|
-
function validateOptionName(name, optionName) {
|
|
11
|
-
// Do not add a default case here. Every item must explicitly return true
|
|
12
|
-
switch (optionName) {
|
|
13
|
-
case 'logging':
|
|
14
|
-
case 'template':
|
|
15
|
-
case 'name':
|
|
16
|
-
case 'namespace':
|
|
17
|
-
case 'overwrite':
|
|
18
|
-
case 'telemetry':
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
throw new Error(`Unable to find ${optionName} to match '${name}' in InitOptions.`);
|
|
22
|
-
}
|
|
23
|
-
test('initOptions - validate options', () => {
|
|
24
|
-
for (const commandOption of initWindowsOptions_1.initOptions) {
|
|
25
|
-
// Validate names
|
|
26
|
-
expect(commandOption.name).not.toBeNull();
|
|
27
|
-
expect(commandOption.name.startsWith('--')).toBe(true);
|
|
28
|
-
expect(commandOption.name).toBe(commandOption.name.trim());
|
|
29
|
-
// Validate defaults
|
|
30
|
-
if (!commandOption.name.endsWith(' [string]') &&
|
|
31
|
-
!commandOption.name.endsWith(' [number]')) {
|
|
32
|
-
// Commander ignores defaults for flags, so leave undefined to prevent confusion
|
|
33
|
-
expect(commandOption.default).toBeUndefined();
|
|
34
|
-
}
|
|
35
|
-
// Validate description
|
|
36
|
-
expect(commandOption.description).not.toBeNull();
|
|
37
|
-
expect(commandOption.description).toBe(commandOption.description.trim());
|
|
38
|
-
// Validate all command options are present in InitOptions
|
|
39
|
-
const optionName = (0, telemetry_1.commanderNameToOptionName)(commandOption.name);
|
|
40
|
-
expect(validateOptionName(commandOption.name, optionName)).toBe(true);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
9
|
+
const initWindowsOptions_1 = require("../commands/initWindows/initWindowsOptions");
|
|
10
|
+
function validateOptionName(name, optionName) {
|
|
11
|
+
// Do not add a default case here. Every item must explicitly return true
|
|
12
|
+
switch (optionName) {
|
|
13
|
+
case 'logging':
|
|
14
|
+
case 'template':
|
|
15
|
+
case 'name':
|
|
16
|
+
case 'namespace':
|
|
17
|
+
case 'overwrite':
|
|
18
|
+
case 'telemetry':
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
throw new Error(`Unable to find ${optionName} to match '${name}' in InitOptions.`);
|
|
22
|
+
}
|
|
23
|
+
test('initOptions - validate options', () => {
|
|
24
|
+
for (const commandOption of initWindowsOptions_1.initOptions) {
|
|
25
|
+
// Validate names
|
|
26
|
+
expect(commandOption.name).not.toBeNull();
|
|
27
|
+
expect(commandOption.name.startsWith('--')).toBe(true);
|
|
28
|
+
expect(commandOption.name).toBe(commandOption.name.trim());
|
|
29
|
+
// Validate defaults
|
|
30
|
+
if (!commandOption.name.endsWith(' [string]') &&
|
|
31
|
+
!commandOption.name.endsWith(' [number]')) {
|
|
32
|
+
// Commander ignores defaults for flags, so leave undefined to prevent confusion
|
|
33
|
+
expect(commandOption.default).toBeUndefined();
|
|
34
|
+
}
|
|
35
|
+
// Validate description
|
|
36
|
+
expect(commandOption.description).not.toBeNull();
|
|
37
|
+
expect(commandOption.description).toBe(commandOption.description.trim());
|
|
38
|
+
// Validate all command options are present in InitOptions
|
|
39
|
+
const optionName = (0, telemetry_1.commanderNameToOptionName)(commandOption.name);
|
|
40
|
+
expect(validateOptionName(commandOption.name, optionName)).toBe(true);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
43
|
//# sourceMappingURL=initWindows.test.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
export {};
|