@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.
- package/README.md +0 -2
- package/lib-commonjs/{runWindows/utils/autolink.d.ts → commands/autolinkWindows/autolinkWindows.d.ts} +87 -86
- package/lib-commonjs/{runWindows/utils/autolink.js → commands/autolinkWindows/autolinkWindows.js} +655 -625
- package/lib-commonjs/commands/autolinkWindows/autolinkWindows.js.map +1 -0
- package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.d.ts +14 -0
- package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.js +33 -0
- package/lib-commonjs/commands/autolinkWindows/autolinkWindowsOptions.js.map +1 -0
- package/lib-commonjs/commands/codegenWindows/codegenWindows.d.ts +27 -0
- package/lib-commonjs/commands/codegenWindows/codegenWindows.js +206 -0
- package/lib-commonjs/commands/codegenWindows/codegenWindows.js.map +1 -0
- package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.d.ts +12 -0
- package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.js +23 -0
- package/lib-commonjs/commands/codegenWindows/codegenWindowsOptions.js.map +1 -0
- package/lib-commonjs/{config → commands/config}/configUtils.d.ts +123 -116
- package/lib-commonjs/{config → commands/config}/configUtils.js +380 -341
- package/lib-commonjs/commands/config/configUtils.js.map +1 -0
- package/lib-commonjs/{config → commands/config}/dependencyConfig.d.ts +37 -37
- package/lib-commonjs/{config → commands/config}/dependencyConfig.js +227 -221
- package/lib-commonjs/commands/config/dependencyConfig.js.map +1 -0
- package/lib-commonjs/{config → commands/config}/projectConfig.d.ts +27 -27
- package/lib-commonjs/{config → commands/config}/projectConfig.js +180 -176
- package/lib-commonjs/commands/config/projectConfig.js.map +1 -0
- package/lib-commonjs/commands/healthCheck/healthCheckList.d.ts +6 -0
- package/lib-commonjs/commands/healthCheck/healthCheckList.js +21 -0
- package/lib-commonjs/commands/healthCheck/healthCheckList.js.map +1 -0
- package/lib-commonjs/{healthChecks.d.ts → commands/healthCheck/healthChecks.d.ts} +7 -2
- package/lib-commonjs/commands/healthCheck/healthChecks.js +124 -0
- package/lib-commonjs/commands/healthCheck/healthChecks.js.map +1 -0
- package/lib-commonjs/commands/initWindows/initWindows.d.ts +46 -0
- package/lib-commonjs/commands/initWindows/initWindows.js +244 -0
- package/lib-commonjs/commands/initWindows/initWindows.js.map +1 -0
- package/lib-commonjs/commands/initWindows/initWindowsOptions.d.ts +15 -0
- package/lib-commonjs/commands/initWindows/initWindowsOptions.js +38 -0
- package/lib-commonjs/commands/initWindows/initWindowsOptions.js.map +1 -0
- package/lib-commonjs/{runWindows → commands/runWindows}/runWindows.d.ts +10 -11
- package/lib-commonjs/{runWindows → commands/runWindows}/runWindows.js +321 -318
- package/lib-commonjs/commands/runWindows/runWindows.js.map +1 -0
- package/lib-commonjs/{runWindows → commands/runWindows}/runWindowsOptions.d.ts +56 -56
- package/lib-commonjs/{runWindows → commands/runWindows}/runWindowsOptions.js +132 -135
- package/lib-commonjs/commands/runWindows/runWindowsOptions.js.map +1 -0
- package/lib-commonjs/e2etest/autolink.test.d.ts +6 -6
- package/lib-commonjs/e2etest/autolink.test.js +366 -418
- package/lib-commonjs/e2etest/autolink.test.js.map +1 -1
- package/lib-commonjs/e2etest/dependencyConfig.test.d.ts +6 -6
- package/lib-commonjs/e2etest/dependencyConfig.test.js +129 -161
- package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -1
- package/lib-commonjs/e2etest/healthChecks.test.d.ts +6 -0
- package/lib-commonjs/e2etest/healthChecks.test.js +31 -0
- package/lib-commonjs/e2etest/healthChecks.test.js.map +1 -0
- package/lib-commonjs/e2etest/initWindows.test.d.ts +6 -0
- package/lib-commonjs/e2etest/initWindows.test.js +43 -0
- package/lib-commonjs/e2etest/initWindows.test.js.map +1 -0
- package/lib-commonjs/e2etest/projectConfig.test.d.ts +6 -6
- package/lib-commonjs/e2etest/projectConfig.test.js +110 -124
- package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -1
- package/lib-commonjs/e2etest/projectConfig.utils.d.ts +8 -4
- package/lib-commonjs/e2etest/projectConfig.utils.js +76 -62
- package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -1
- package/lib-commonjs/e2etest/runWindows.test.d.ts +6 -6
- package/lib-commonjs/e2etest/runWindows.test.js +60 -39
- package/lib-commonjs/e2etest/runWindows.test.js.map +1 -1
- 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-common/index.js.map +1 -1
- package/lib-commonjs/generator-windows/index.d.ts +10 -10
- package/lib-commonjs/generator-windows/index.js +316 -369
- package/lib-commonjs/generator-windows/index.js.map +1 -1
- package/lib-commonjs/index.d.ts +50 -50
- package/lib-commonjs/index.js +77 -106
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/{runWindows/utils → utils}/build.d.ts +12 -12
- package/lib-commonjs/{runWindows/utils → utils}/build.js +84 -84
- package/lib-commonjs/utils/build.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/checkRequirements.d.ts +6 -6
- package/lib-commonjs/{runWindows/utils → utils}/checkRequirements.js +69 -69
- package/lib-commonjs/utils/checkRequirements.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/commandWithProgress.d.ts +21 -15
- package/lib-commonjs/{runWindows/utils → utils}/commandWithProgress.js +149 -127
- package/lib-commonjs/utils/commandWithProgress.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/deploy.d.ts +12 -12
- package/lib-commonjs/{runWindows/utils → utils}/deploy.js +353 -328
- package/lib-commonjs/utils/deploy.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/info.d.ts +6 -6
- package/lib-commonjs/{runWindows/utils → utils}/info.js +28 -28
- package/lib-commonjs/utils/info.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/msbuildtools.d.ts +28 -26
- package/lib-commonjs/{runWindows/utils → utils}/msbuildtools.js +273 -219
- package/lib-commonjs/utils/msbuildtools.js.map +1 -0
- package/lib-commonjs/utils/pathHelpers.d.ts +9 -0
- package/lib-commonjs/utils/pathHelpers.js +37 -0
- package/lib-commonjs/utils/pathHelpers.js.map +1 -0
- package/lib-commonjs/utils/telemetryHelpers.d.ts +29 -0
- package/lib-commonjs/utils/telemetryHelpers.js +121 -0
- package/lib-commonjs/utils/telemetryHelpers.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/version.d.ts +19 -19
- package/lib-commonjs/{runWindows/utils → utils}/version.js +109 -109
- package/lib-commonjs/utils/version.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/vsInstalls.d.ts +34 -34
- package/lib-commonjs/{runWindows/utils → utils}/vsInstalls.js +99 -73
- package/lib-commonjs/utils/vsInstalls.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/vstools.d.ts +16 -16
- package/lib-commonjs/{runWindows/utils → utils}/vstools.js +189 -162
- package/lib-commonjs/utils/vstools.js.map +1 -0
- package/lib-commonjs/{runWindows/utils → utils}/winappdeploytool.d.ts +24 -24
- package/lib-commonjs/{runWindows/utils → utils}/winappdeploytool.js +108 -108
- package/lib-commonjs/utils/winappdeploytool.js.map +1 -0
- package/package.json +27 -20
- package/src/powershell/Eval-MsBuildProperties.ps1 +156 -0
- package/lib-commonjs/config/configUtils.js.map +0 -1
- package/lib-commonjs/config/dependencyConfig.js.map +0 -1
- package/lib-commonjs/config/projectConfig.js.map +0 -1
- package/lib-commonjs/healthChecks.js +0 -88
- package/lib-commonjs/healthChecks.js.map +0 -1
- package/lib-commonjs/runWindows/runWindows.js.map +0 -1
- package/lib-commonjs/runWindows/runWindowsOptions.js.map +0 -1
- package/lib-commonjs/runWindows/utils/autolink.js.map +0 -1
- package/lib-commonjs/runWindows/utils/build.js.map +0 -1
- package/lib-commonjs/runWindows/utils/checkRequirements.js.map +0 -1
- package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +0 -1
- package/lib-commonjs/runWindows/utils/deploy.js.map +0 -1
- package/lib-commonjs/runWindows/utils/info.js.map +0 -1
- package/lib-commonjs/runWindows/utils/msbuildtools.js.map +0 -1
- package/lib-commonjs/runWindows/utils/version.js.map +0 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.js.map +0 -1
- package/lib-commonjs/runWindows/utils/vstools.js.map +0 -1
- package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +0 -1
- /package/{powershell → src/powershell}/Add-AppDevPackage.ps1 +0 -0
- /package/{powershell → src/powershell}/WindowsStoreAppUtils.ps1 +0 -0
|
@@ -0,0 +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
|
+
}
|
|
124
|
+
//# sourceMappingURL=healthChecks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healthChecks.js","sourceRoot":"","sources":["../../../src/commands/healthCheck/healthChecks.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAwB;AAExB,qEAAuD;AAEvD,MAAM,KAAK,GAAG,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AACvD,MAAM,MAAM,GAAG,WAAW,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAEnD,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAC,CAAC,CAAC;AAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAMjC,yEAA2D;AAC3D,uDAAkD;AAElD,SAAgB,eAAe;IAC7B,6EAA6E;IAC7E,mDAAmD;IACnD,IAAI;QACF,OAAO,qBAAqB,EAAE,CAAC;KAChC;IAAC,WAAM;QACN,OAAO;YACL;gBACE,KAAK,EAAE,SAAS;gBAChB,YAAY,EAAE;oBACZ;wBACE,KAAK,EAAE,mCAAmC;wBAC1C,WAAW,EAAE,mCAAmC;wBAChD,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC;wBACpD,e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C,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC;4BAC5D,IAAI,QAAQ,EAAE;gCACZ,qBAAqB,CAAC;oCACpB,OAAO;oCACP,WAAW,EAAE,oCAAoC,EAAE,GAAG;iCACvD,CAAC,CAAC;gCACH,MAAM,CAAC,IAAI,EAAE,CAAC;6BACf;iCAAM;gCACL,MAAM,CAAC,OAAO,EAAE,CAAC;6BAClB;yBACF;wBAAC,WAAM;4BACN,qBAAqB,CAAC;gCACpB,OAAO;gCACP,WAAW,EAAE,oCAAoC,EAAE,GAAG;6BACvD,CAAC,CAAC;4BACH,MAAM,CAAC,IAAI,EAAE,CAAC;yBACf;oBACH,CAAC;iBACsB,CAAC;YAC5B,CAAC,CAAC;SACH;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport path from 'path';\n\nimport * as pathHelpers from '../../utils/pathHelpers';\n\nconst rnDir = pathHelpers.resolveRnRoot(process.cwd());\nconst cliDir = pathHelpers.resolveRnCliRoot(rnDir);\n\nconst execaPath = require.resolve('execa', {paths: [cliDir]});\nconst execa = require(execaPath);\n\nimport type {\n HealthCheckCategory,\n HealthCheckInterface,\n} from '@react-native-community/cli-doctor/build/types';\nimport {powershell} from '../../utils/commandWithProgress';\nimport {HealthCheckList} from './healthCheckList';\n\nexport function getHealthChecks(): HealthCheckCategory[] | undefined {\n // #8471: There are known cases where the dependencies script will error out.\n // Fail gracefully if that happens in the meantime.\n try {\n return getHealthChecksUnsafe();\n } catch {\n return [\n {\n label: 'Windows',\n healthchecks: [\n {\n label: 'Failed to enumerate health checks',\n description: 'Failed to enumerate health checks',\n getDiagnostics: async () => ({needsToBeFixed: true}),\n runAutomaticFix: async ({loader}) => {\n loader.fail();\n },\n },\n ],\n },\n ];\n }\n}\n\nfunction getHealthChecksUnsafe(): HealthCheckCategory[] | undefined {\n // All our health checks are windows only...\n if (process.platform !== 'win32') {\n return undefined;\n }\n\n const rnwDepScriptPath = path.join(\n pathHelpers.resolveRnwRoot(process.cwd()),\n 'Scripts/rnw-dependencies.ps1',\n );\n\n return [\n {\n label: 'Windows',\n healthchecks: HealthCheckList.map((dep: [boolean, string, string]) => {\n const [optional, id, name] = dep;\n return {\n label: name,\n description: name,\n // The schema check of react-native doctor requires this to be a string, although it should be a boolean\n // Enable this once we pick up a new version of the CLI that includes https://github.com/react-native-community/cli/pull/1367\n isRequired: optional,\n getDiagnostics: async () => {\n let needsToBeFixed = true;\n try {\n await execa(\n `\"${powershell}\" -ExecutionPolicy Unrestricted -NoProfile \"${rnwDepScriptPath}\" -NoPrompt -Check ${id}`,\n );\n needsToBeFixed = false;\n } catch {}\n return {\n needsToBeFixed,\n };\n },\n runAutomaticFix: async ({loader, logManualInstallation}) => {\n const command = `${powershell} -ExecutionPolicy Unrestricted -NoProfile \"${rnwDepScriptPath}\" -Check ${id}`;\n try {\n const {exitCode} = await execa(command, {stdio: 'inherit'});\n if (exitCode) {\n logManualInstallation({\n command,\n healthcheck: `react-native-windows dependency \"${id}\"`,\n });\n loader.fail();\n } else {\n loader.succeed();\n }\n } catch {\n logManualInstallation({\n command,\n healthcheck: `react-native-windows dependency \"${id}\"`,\n });\n loader.fail();\n }\n },\n } as HealthCheckInterface;\n }),\n },\n ];\n}\n"]}
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,244 @@
|
|
|
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.initCommand = exports.initWindowsInternal = exports.InitWindows = void 0;
|
|
35
|
+
const fs_1 = __importDefault(require("@react-native-windows/fs"));
|
|
36
|
+
const path_1 = __importDefault(require("path"));
|
|
37
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
38
|
+
const glob_1 = require("glob");
|
|
39
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
40
|
+
const perf_hooks_1 = require("perf_hooks");
|
|
41
|
+
const util_1 = __importDefault(require("util"));
|
|
42
|
+
const glob = util_1.default.promisify(glob_1.glob);
|
|
43
|
+
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
44
|
+
const commandWithProgress_1 = require("../../utils/commandWithProgress");
|
|
45
|
+
const pathHelpers = __importStar(require("../../utils/pathHelpers"));
|
|
46
|
+
const telemetryHelpers_1 = require("../../utils/telemetryHelpers");
|
|
47
|
+
const generator_common_1 = require("../../generator-common");
|
|
48
|
+
const initWindowsOptions_1 = require("./initWindowsOptions");
|
|
49
|
+
class InitWindows {
|
|
50
|
+
constructor(config, options) {
|
|
51
|
+
this.config = config;
|
|
52
|
+
this.options = options;
|
|
53
|
+
this.templates = new Map();
|
|
54
|
+
this.rnwPath = pathHelpers.resolveRnwRoot(this.config.root);
|
|
55
|
+
}
|
|
56
|
+
verboseMessage(message) {
|
|
57
|
+
verboseMessage(message, !!this.options.logging);
|
|
58
|
+
}
|
|
59
|
+
async loadTemplates() {
|
|
60
|
+
const templatesRoot = path_1.default.join(this.rnwPath, 'templates');
|
|
61
|
+
for (const file of await glob('**/template.config.js', {
|
|
62
|
+
cwd: templatesRoot,
|
|
63
|
+
})) {
|
|
64
|
+
const templateName = path_1.default.dirname(file).replace('\\', '/');
|
|
65
|
+
const templateConfig = require(path_1.default.join(templatesRoot, file));
|
|
66
|
+
this.templates.set(templateName, templateConfig);
|
|
67
|
+
}
|
|
68
|
+
if (this.templates.size === 0) {
|
|
69
|
+
throw new telemetry_1.CodedError('NoTemplatesFound', `No templates were found in ${templatesRoot}.`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
getDefaultTemplateName() {
|
|
73
|
+
for (const [name, config] of this.templates) {
|
|
74
|
+
if (config.isDefault) {
|
|
75
|
+
return name;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
throw new telemetry_1.CodedError('NoDefaultTemplate', 'No template specified and no default template found.');
|
|
79
|
+
}
|
|
80
|
+
pascalCase(str) {
|
|
81
|
+
const camelCase = lodash_1.default.camelCase(str);
|
|
82
|
+
return camelCase[0].toUpperCase() + camelCase.substr(1);
|
|
83
|
+
}
|
|
84
|
+
isValidProjectName(name) {
|
|
85
|
+
if (name.match(/^[a-z][a-z0-9]*$/gi)) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
getReactNativeProjectName(projectDir) {
|
|
91
|
+
this.verboseMessage('Looking for project name in package.json...');
|
|
92
|
+
const pkgJsonPath = path_1.default.join(projectDir, 'package.json');
|
|
93
|
+
if (!fs_1.default.existsSync(pkgJsonPath)) {
|
|
94
|
+
throw new telemetry_1.CodedError('NoPackageJson', 'Unable to find package.json. This should be run from within an existing react-native project.');
|
|
95
|
+
}
|
|
96
|
+
let name = fs_1.default.readJsonFileSync(pkgJsonPath).name;
|
|
97
|
+
if (!name) {
|
|
98
|
+
const appJsonPath = path_1.default.join(projectDir, 'app.json');
|
|
99
|
+
if (fs_1.default.existsSync(appJsonPath)) {
|
|
100
|
+
this.verboseMessage('Looking for project name in app.json...');
|
|
101
|
+
name = fs_1.default.readJsonFileSync(pkgJsonPath).name;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (!name) {
|
|
105
|
+
throw new telemetry_1.CodedError('NoProjectName', 'Please specify name in package.json or app.json');
|
|
106
|
+
}
|
|
107
|
+
return name;
|
|
108
|
+
}
|
|
109
|
+
async run(spinner) {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
var _c, _d;
|
|
112
|
+
await this.loadTemplates();
|
|
113
|
+
spinner.info();
|
|
114
|
+
(_a = (_c = this.options).template) !== null && _a !== void 0 ? _a : (_c.template = this.getDefaultTemplateName());
|
|
115
|
+
spinner.info(`Using template '${this.options.template}'...`);
|
|
116
|
+
if (!this.templates.has(this.options.template.replace('\\', '/'))) {
|
|
117
|
+
throw new telemetry_1.CodedError('InvalidTemplateName', `Unable to find template '${this.options.template}'.`);
|
|
118
|
+
}
|
|
119
|
+
const templateConfig = this.templates.get(this.options.template);
|
|
120
|
+
if (this.options.name && !this.isValidProjectName(this.options.name)) {
|
|
121
|
+
throw new telemetry_1.CodedError('InvalidProjectName', `The specified name is not a valid identifier`);
|
|
122
|
+
}
|
|
123
|
+
if (!this.options.name) {
|
|
124
|
+
const projectName = this.getReactNativeProjectName(this.config.root);
|
|
125
|
+
this.options.name = this.isValidProjectName(projectName)
|
|
126
|
+
? projectName
|
|
127
|
+
: this.pascalCase(projectName);
|
|
128
|
+
}
|
|
129
|
+
(_b = (_d = this.options).namespace) !== null && _b !== void 0 ? _b : (_d.namespace = this.options.name);
|
|
130
|
+
if (templateConfig.preInstall) {
|
|
131
|
+
spinner.info(`Running ${this.options.template} preInstall()...`);
|
|
132
|
+
await templateConfig.preInstall(this.config, this.options);
|
|
133
|
+
}
|
|
134
|
+
// Get template files to copy and copy if available
|
|
135
|
+
if (templateConfig.getFileMappings) {
|
|
136
|
+
const fileMappings = await templateConfig.getFileMappings(this.config, this.options);
|
|
137
|
+
for (const fileMapping of fileMappings) {
|
|
138
|
+
const targetDir = path_1.default.join(this.config.root, path_1.default.dirname(fileMapping.to));
|
|
139
|
+
if (!(await fs_1.default.exists(targetDir))) {
|
|
140
|
+
await fs_1.default.mkdir(targetDir, { recursive: true });
|
|
141
|
+
}
|
|
142
|
+
await (0, generator_common_1.copyAndReplaceWithChangedCallback)(fileMapping.from, this.config.root, fileMapping.to, fileMapping.replacements, this.options.overwrite);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (templateConfig.postInstall) {
|
|
146
|
+
spinner.info(`Running ${this.options.template} postInstall()...`);
|
|
147
|
+
await templateConfig.postInstall(this.config, this.options);
|
|
148
|
+
}
|
|
149
|
+
spinner.succeed();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.InitWindows = InitWindows;
|
|
153
|
+
/**
|
|
154
|
+
* Logs the given message if verbose is True.
|
|
155
|
+
* @param message The message to log.
|
|
156
|
+
* @param verbose Whether or not verbose logging is enabled.
|
|
157
|
+
*/
|
|
158
|
+
function verboseMessage(message, verbose) {
|
|
159
|
+
if (verbose) {
|
|
160
|
+
console.log(message);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Sanitizes the given option for telemetry.
|
|
165
|
+
* @param key The key of the option.
|
|
166
|
+
* @param value The unsanitized value of the option.
|
|
167
|
+
* @returns The sanitized value of the option.
|
|
168
|
+
*/
|
|
169
|
+
function optionSanitizer(key, value) {
|
|
170
|
+
// Do not add a default case here.
|
|
171
|
+
// Strings risking PII should just return true if present, false otherwise.
|
|
172
|
+
// All others should return the value (or false if undefined).
|
|
173
|
+
switch (key) {
|
|
174
|
+
case 'name':
|
|
175
|
+
case 'namespace':
|
|
176
|
+
return value === undefined ? false : true; // Strip PII
|
|
177
|
+
case 'logging':
|
|
178
|
+
case 'template':
|
|
179
|
+
case 'overwrite':
|
|
180
|
+
case 'telemetry':
|
|
181
|
+
return value === undefined ? false : value; // Return value
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get the extra props to add to the `init-windows` telemetry event.
|
|
186
|
+
* @returns The extra props.
|
|
187
|
+
*/
|
|
188
|
+
async function getExtraProps() {
|
|
189
|
+
const extraProps = {};
|
|
190
|
+
return extraProps;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The function run when calling `react-native init-windows`.
|
|
194
|
+
* @param args Unprocessed args passed from react-native CLI.
|
|
195
|
+
* @param config Config passed from react-native CLI.
|
|
196
|
+
* @param options Options passed from react-native CLI.
|
|
197
|
+
*/
|
|
198
|
+
async function initWindows(args, config, options) {
|
|
199
|
+
await (0, telemetryHelpers_1.startTelemetrySession)('init-windows', config, options, (0, telemetryHelpers_1.getDefaultOptions)(config, initWindowsOptions_1.initOptions), optionSanitizer);
|
|
200
|
+
let initWindowsError;
|
|
201
|
+
try {
|
|
202
|
+
await initWindowsInternal(args, config, options);
|
|
203
|
+
}
|
|
204
|
+
catch (ex) {
|
|
205
|
+
initWindowsError =
|
|
206
|
+
ex instanceof Error ? ex : new Error(String(ex));
|
|
207
|
+
telemetry_1.Telemetry.trackException(initWindowsError);
|
|
208
|
+
}
|
|
209
|
+
await (0, telemetryHelpers_1.endTelemetrySession)(initWindowsError, getExtraProps);
|
|
210
|
+
(0, commandWithProgress_1.setExitProcessWithError)(options.logging, initWindowsError);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Initializes a new RNW project from a given template.
|
|
214
|
+
* @param args Unprocessed args passed from react-native CLI.
|
|
215
|
+
* @param config Config passed from react-native CLI.
|
|
216
|
+
* @param options Options passed from react-native CLI.
|
|
217
|
+
*/
|
|
218
|
+
async function initWindowsInternal(args, config, options) {
|
|
219
|
+
const startTime = perf_hooks_1.performance.now();
|
|
220
|
+
const spinner = (0, commandWithProgress_1.newSpinner)('Running init-windows...');
|
|
221
|
+
try {
|
|
222
|
+
const codegen = new InitWindows(config, options);
|
|
223
|
+
await codegen.run(spinner);
|
|
224
|
+
const endTime = perf_hooks_1.performance.now();
|
|
225
|
+
console.log(`${chalk_1.default.green('Success:')} init-windows completed. (${Math.round(endTime - startTime)}ms)`);
|
|
226
|
+
}
|
|
227
|
+
catch (e) {
|
|
228
|
+
spinner.fail();
|
|
229
|
+
const endTime = perf_hooks_1.performance.now();
|
|
230
|
+
console.log(`${chalk_1.default.red('Error:')} ${e.toString()}. (${Math.round(endTime - startTime)}ms)`);
|
|
231
|
+
throw e;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
exports.initWindowsInternal = initWindowsInternal;
|
|
235
|
+
/**
|
|
236
|
+
* Initializes a new RNW project from a given template.
|
|
237
|
+
*/
|
|
238
|
+
exports.initCommand = {
|
|
239
|
+
name: 'init-windows',
|
|
240
|
+
description: 'Initializes a new RNW project from a given template.',
|
|
241
|
+
func: initWindows,
|
|
242
|
+
options: initWindowsOptions_1.initOptions,
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=initWindows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initWindows.js","sourceRoot":"","sources":["../../../src/commands/initWindows/initWindows.ts"],"names":[],"mappings":";AAAA;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,EAAE,MAAM,IAAI,CAAC,KAAK,CAC7D,OAAO,GAAG,SAAS,CACpB,KAAK,CACP,CAAC;QACF,MAAM,CAAC,CAAC;KACT;AACH,CAAC;AA3BD,kDA2BC;AAED;;GAEG;AACU,QAAA,WAAW,GAAY;IAClC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,sDAAsD;IACnE,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,gCAAW;CACrB,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport fs from '@react-native-windows/fs';\nimport path from 'path';\nimport chalk from 'chalk';\nimport {glob as globFunc} from 'glob';\nimport _ from 'lodash';\nimport {performance} from 'perf_hooks';\nimport {Ora} from 'ora';\nimport util from 'util';\n\nconst glob = util.promisify(globFunc);\n\nimport {Command, Config} from '@react-native-community/cli-types';\nimport {CodedError, Telemetry} from '@react-native-windows/telemetry';\n\nimport {\n newSpinner,\n setExitProcessWithError,\n} from '../../utils/commandWithProgress';\nimport * as pathHelpers from '../../utils/pathHelpers';\nimport {\n getDefaultOptions,\n startTelemetrySession,\n endTelemetrySession,\n} from '../../utils/telemetryHelpers';\nimport {copyAndReplaceWithChangedCallback} from '../../generator-common';\nimport {InitOptions, initOptions} from './initWindowsOptions';\n\nexport interface TemplateFileMapping {\n from: string;\n to: string;\n replacements?: Record<string, any>;\n}\n\nexport interface InitWindowsTemplateConfig {\n name: string;\n description: string;\n isDefault?: boolean;\n preInstall?: (config: Config, options: InitOptions) => Promise<void>;\n getFileMappings?: (\n config: Config,\n options: InitOptions,\n ) => Promise<TemplateFileMapping[]>;\n postInstall?: (config: Config, options: InitOptions) => Promise<void>;\n}\n\nexport class InitWindows {\n protected readonly rnwPath: string;\n protected readonly templates: Map<string, InitWindowsTemplateConfig> =\n new Map();\n\n constructor(readonly config: Config, readonly options: InitOptions) {\n this.rnwPath = pathHelpers.resolveRnwRoot(this.config.root);\n }\n\n protected verboseMessage(message: any) {\n verboseMessage(message, !!this.options.logging);\n }\n\n protected async loadTemplates() {\n const templatesRoot = path.join(this.rnwPath, 'templates');\n for (const file of await glob('**/template.config.js', {\n cwd: templatesRoot,\n })) {\n const templateName = path.dirname(file).replace('\\\\', '/');\n const templateConfig: InitWindowsTemplateConfig = require(path.join(\n templatesRoot,\n file,\n ));\n this.templates.set(templateName, templateConfig);\n }\n if (this.templates.size === 0) {\n throw new CodedError(\n 'NoTemplatesFound',\n `No templates were found in ${templatesRoot}.`,\n );\n }\n }\n\n protected getDefaultTemplateName(): string {\n for (const [name, config] of this.templates) {\n if (config.isDefault) {\n return name;\n }\n }\n throw new CodedError(\n 'NoDefaultTemplate',\n 'No template specified and no default template found.',\n );\n }\n\n protected pascalCase(str: string): string {\n const camelCase = _.camelCase(str);\n return camelCase[0].toUpperCase() + camelCase.substr(1);\n }\n\n protected isValidProjectName(name: string): boolean {\n if (name.match(/^[a-z][a-z0-9]*$/gi)) {\n return true;\n }\n return false;\n }\n\n protected getReactNativeProjectName(projectDir: string): string {\n this.verboseMessage('Looking for project name in package.json...');\n const pkgJsonPath = path.join(projectDir, 'package.json');\n if (!fs.existsSync(pkgJsonPath)) {\n throw new CodedError(\n 'NoPackageJson',\n 'Unable to find package.json. This should be run from within an existing react-native project.',\n );\n }\n type PackageJson = {name: string};\n\n let name = fs.readJsonFileSync<PackageJson>(pkgJsonPath).name;\n if (!name) {\n const appJsonPath = path.join(projectDir, 'app.json');\n if (fs.existsSync(appJsonPath)) {\n this.verboseMessage('Looking for project name in app.json...');\n name = fs.readJsonFileSync<PackageJson>(pkgJsonPath).name;\n }\n }\n\n if (!name) {\n throw new CodedError(\n 'NoProjectName',\n 'Please specify name in package.json or app.json',\n );\n }\n\n return name;\n }\n\n public async run(spinner: Ora) {\n await this.loadTemplates();\n\n spinner.info();\n\n this.options.template ??= this.getDefaultTemplateName();\n\n spinner.info(`Using template '${this.options.template}'...`);\n if (!this.templates.has(this.options.template.replace('\\\\', '/'))) {\n throw new CodedError(\n 'InvalidTemplateName',\n `Unable to find template '${this.options.template}'.`,\n );\n }\n const templateConfig = this.templates.get(this.options.template)!;\n\n if (this.options.name && !this.isValidProjectName(this.options.name)) {\n throw new CodedError(\n 'InvalidProjectName',\n `The specified name is not a valid identifier`,\n );\n }\n\n if (!this.options.name) {\n const projectName = this.getReactNativeProjectName(this.config.root);\n this.options.name = this.isValidProjectName(projectName)\n ? projectName\n : this.pascalCase(projectName);\n }\n\n this.options.namespace ??= this.options.name;\n\n if (templateConfig.preInstall) {\n spinner.info(`Running ${this.options.template} preInstall()...`);\n await templateConfig.preInstall(this.config, this.options);\n }\n\n // Get template files to copy and copy if available\n if (templateConfig.getFileMappings) {\n const fileMappings = await templateConfig.getFileMappings(\n this.config,\n this.options,\n );\n\n for (const fileMapping of fileMappings) {\n const targetDir = path.join(\n this.config.root,\n path.dirname(fileMapping.to),\n );\n\n if (!(await fs.exists(targetDir))) {\n await fs.mkdir(targetDir, {recursive: true});\n }\n\n await copyAndReplaceWithChangedCallback(\n fileMapping.from,\n this.config.root,\n fileMapping.to,\n fileMapping.replacements,\n this.options.overwrite,\n );\n }\n }\n\n if (templateConfig.postInstall) {\n spinner.info(`Running ${this.options.template} postInstall()...`);\n await templateConfig.postInstall(this.config, this.options);\n }\n\n spinner.succeed();\n }\n}\n\n/**\n * Logs the given message if verbose is True.\n * @param message The message to log.\n * @param verbose Whether or not verbose logging is enabled.\n */\nfunction verboseMessage(message: any, verbose?: boolean) {\n if (verbose) {\n console.log(message);\n }\n}\n\n/**\n * Sanitizes the given option for telemetry.\n * @param key The key of the option.\n * @param value The unsanitized value of the option.\n * @returns The sanitized value of the option.\n */\nfunction optionSanitizer(key: keyof InitOptions, value: any): any {\n // Do not add a default case here.\n // Strings risking PII should just return true if present, false otherwise.\n // All others should return the value (or false if undefined).\n switch (key) {\n case 'name':\n case 'namespace':\n return value === undefined ? false : true; // Strip PII\n case 'logging':\n case 'template':\n case 'overwrite':\n case 'telemetry':\n return value === undefined ? false : value; // Return value\n }\n}\n\n/**\n * Get the extra props to add to the `init-windows` telemetry event.\n * @returns The extra props.\n */\nasync function getExtraProps(): Promise<Record<string, any>> {\n const extraProps: Record<string, any> = {};\n return extraProps;\n}\n\n/**\n * The function run when calling `react-native init-windows`.\n * @param args Unprocessed args passed from react-native CLI.\n * @param config Config passed from react-native CLI.\n * @param options Options passed from react-native CLI.\n */\nasync function initWindows(\n args: string[],\n config: Config,\n options: InitOptions,\n) {\n await startTelemetrySession(\n 'init-windows',\n config,\n options,\n getDefaultOptions(config, initOptions),\n optionSanitizer,\n );\n\n let initWindowsError: Error | undefined;\n try {\n await initWindowsInternal(args, config, options);\n } catch (ex) {\n initWindowsError =\n ex instanceof Error ? (ex as Error) : new Error(String(ex));\n Telemetry.trackException(initWindowsError);\n }\n\n await endTelemetrySession(initWindowsError, getExtraProps);\n setExitProcessWithError(options.logging, initWindowsError);\n}\n\n/**\n * Initializes a new RNW project from a given template.\n * @param args Unprocessed args passed from react-native CLI.\n * @param config Config passed from react-native CLI.\n * @param options Options passed from react-native CLI.\n */\nexport async function initWindowsInternal(\n args: string[],\n config: Config,\n options: InitOptions,\n) {\n const startTime = performance.now();\n const spinner = newSpinner('Running init-windows...');\n try {\n const codegen = new InitWindows(config, options);\n await codegen.run(spinner);\n const endTime = performance.now();\n\n console.log(\n `${chalk.green('Success:')} init-windows completed. (${Math.round(\n endTime - startTime,\n )}ms)`,\n );\n } catch (e) {\n spinner.fail();\n const endTime = performance.now();\n console.log(\n `${chalk.red('Error:')} ${(e as any).toString()}. (${Math.round(\n endTime - startTime,\n )}ms)`,\n );\n throw e;\n }\n}\n\n/**\n * Initializes a new RNW project from a given template.\n */\nexport const initCommand: Command = {\n name: 'init-windows',\n description: 'Initializes a new RNW project from a given template.',\n func: initWindows,\n options: initOptions,\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
import { CommandOption } from '@react-native-community/cli-types';
|
|
7
|
+
export interface InitOptions {
|
|
8
|
+
logging?: boolean;
|
|
9
|
+
template?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
namespace?: string;
|
|
12
|
+
overwrite?: boolean;
|
|
13
|
+
telemetry?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const initOptions: CommandOption[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.initOptions = void 0;
|
|
9
|
+
exports.initOptions = [
|
|
10
|
+
{
|
|
11
|
+
name: '--logging',
|
|
12
|
+
description: 'Verbose output logging',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: '--template [string]',
|
|
16
|
+
description: 'Specify the template to use',
|
|
17
|
+
default: undefined,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: '--name [string]',
|
|
21
|
+
description: 'The native project name. Defaults to the name property iin app.json or package.json',
|
|
22
|
+
default: undefined,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: '--namespace [string]',
|
|
26
|
+
description: "The native project namespace. This should be expressed using dots as separators. i.e. 'Level1.Level2.Level3'. The generator will apply the correct syntax for the target language.",
|
|
27
|
+
default: undefined,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: '--overwrite',
|
|
31
|
+
description: 'Overwrite any existing files without prompting',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: '--no-telemetry',
|
|
35
|
+
description: 'Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI',
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
//# sourceMappingURL=initWindowsOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initWindowsOptions.js","sourceRoot":"","sources":["../../../src/commands/initWindows/initWindowsOptions.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAaU,QAAA,WAAW,GAAoB;IAC1C;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,wBAAwB;KACtC;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,6BAA6B;QAC1C,OAAO,EAAE,SAAS;KACnB;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,qFAAqF;QACvF,OAAO,EAAE,SAAS;KACnB;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EACT,oLAAoL;QACtL,OAAO,EAAE,SAAS;KACnB;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,gDAAgD;KAC9D;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,uGAAuG;KAC1G;CACF,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {CommandOption} from '@react-native-community/cli-types';\n\nexport interface InitOptions {\n logging?: boolean;\n template?: string;\n name?: string;\n namespace?: string;\n overwrite?: boolean;\n telemetry?: boolean;\n}\n\nexport const initOptions: CommandOption[] = [\n {\n name: '--logging',\n description: 'Verbose output logging',\n },\n {\n name: '--template [string]',\n description: 'Specify the template to use',\n default: undefined,\n },\n {\n name: '--name [string]',\n description:\n 'The native project name. Defaults to the name property iin app.json or package.json',\n default: undefined,\n },\n {\n name: '--namespace [string]',\n description:\n \"The native project namespace. This should be expressed using dots as separators. i.e. 'Level1.Level2.Level3'. The generator will apply the correct syntax for the target language.\",\n default: undefined,\n },\n {\n name: '--overwrite',\n description: 'Overwrite any existing files without prompting',\n },\n {\n name: '--no-telemetry',\n description:\n 'Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI',\n },\n];\n"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
import { Command } from '@react-native-community/cli-types';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare const runWindowsCommand: Command;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from '@react-native-community/cli-types';
|
|
7
|
+
/**
|
|
8
|
+
* Starts the app on a connected Windows emulator or mobile device.
|
|
9
|
+
*/
|
|
10
|
+
export declare const runWindowsCommand: Command;
|