@react-native-windows/cli 0.65.3 → 0.66.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.
- package/CHANGELOG.json +264 -38
- package/CHANGELOG.md +116 -23
- package/lib-commonjs/config/configUtils.d.ts +22 -0
- package/lib-commonjs/config/configUtils.js +99 -18
- package/lib-commonjs/config/configUtils.js.map +1 -1
- package/lib-commonjs/config/dependencyConfig.js +81 -37
- package/lib-commonjs/config/dependencyConfig.js.map +1 -1
- package/lib-commonjs/config/projectConfig.d.ts +1 -0
- package/lib-commonjs/config/projectConfig.js +58 -9
- package/lib-commonjs/config/projectConfig.js.map +1 -1
- package/lib-commonjs/e2etest/autolink.test.js +13 -10
- package/lib-commonjs/e2etest/autolink.test.js.map +1 -1
- package/lib-commonjs/e2etest/dependencyConfig.test.js +73 -19
- package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -1
- package/lib-commonjs/e2etest/projectConfig.test.js +25 -19
- package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -1
- package/lib-commonjs/e2etest/projectConfig.utils.js +16 -12
- package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -1
- package/lib-commonjs/e2etest/runWindows.test.js.map +1 -1
- package/lib-commonjs/generator-common/index.js +35 -32
- package/lib-commonjs/generator-common/index.js.map +1 -1
- package/lib-commonjs/generator-windows/index.js +101 -83
- package/lib-commonjs/generator-windows/index.js.map +1 -1
- package/lib-commonjs/healthChecks.js +7 -3
- package/lib-commonjs/healthChecks.js.map +1 -1
- package/lib-commonjs/index.js +16 -8
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/runWindows/runWindows.js +45 -18
- package/lib-commonjs/runWindows/runWindows.js.map +1 -1
- package/lib-commonjs/runWindows/runWindowsOptions.js +0 -1
- package/lib-commonjs/runWindows/runWindowsOptions.js.map +1 -1
- package/lib-commonjs/runWindows/utils/autolink.js +77 -50
- package/lib-commonjs/runWindows/utils/autolink.js.map +1 -1
- package/lib-commonjs/runWindows/utils/build.js +12 -9
- package/lib-commonjs/runWindows/utils/build.js.map +1 -1
- package/lib-commonjs/runWindows/utils/checkRequirements.js +7 -4
- package/lib-commonjs/runWindows/utils/checkRequirements.js.map +1 -1
- package/lib-commonjs/runWindows/utils/commandWithProgress.d.ts +1 -1
- package/lib-commonjs/runWindows/utils/commandWithProgress.js +16 -7
- package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +1 -1
- package/lib-commonjs/runWindows/utils/deploy.js +54 -37
- package/lib-commonjs/runWindows/utils/deploy.js.map +1 -1
- package/lib-commonjs/runWindows/utils/info.js +5 -2
- package/lib-commonjs/runWindows/utils/info.js.map +1 -1
- package/lib-commonjs/runWindows/utils/msbuildtools.js +49 -27
- package/lib-commonjs/runWindows/utils/msbuildtools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/version.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.js +8 -5
- package/lib-commonjs/runWindows/utils/vsInstalls.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vstools.js +16 -13
- package/lib-commonjs/runWindows/utils/vstools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/winappdeploytool.js +7 -4
- package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +1 -1
- package/package.json +13 -10
|
@@ -4,24 +4,46 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
* @format
|
|
6
6
|
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
7
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
30
|
exports.runWindowsCommand = exports.getAnonymizedProjectName = void 0;
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
31
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
32
|
+
const fs_1 = __importDefault(require("fs"));
|
|
33
|
+
const path_1 = __importDefault(require("path"));
|
|
12
34
|
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
13
|
-
const build = require("./utils/build");
|
|
14
|
-
const
|
|
15
|
-
const deploy = require("./utils/deploy");
|
|
35
|
+
const build = __importStar(require("./utils/build"));
|
|
36
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
37
|
+
const deploy = __importStar(require("./utils/deploy"));
|
|
16
38
|
const commandWithProgress_1 = require("./utils/commandWithProgress");
|
|
17
|
-
const info = require("./utils/info");
|
|
18
|
-
const msbuildtools_1 = require("./utils/msbuildtools");
|
|
39
|
+
const info = __importStar(require("./utils/info"));
|
|
40
|
+
const msbuildtools_1 = __importDefault(require("./utils/msbuildtools"));
|
|
19
41
|
const runWindowsOptions_1 = require("./runWindowsOptions");
|
|
20
42
|
const autolink_1 = require("./utils/autolink");
|
|
21
43
|
const os_1 = require("os");
|
|
22
44
|
function setExitProcessWithError(error, loggingWasEnabled) {
|
|
23
45
|
if (!loggingWasEnabled) {
|
|
24
|
-
console.log(`Re-run the command with ${
|
|
46
|
+
console.log(`Re-run the command with ${chalk_1.default.bold('--logging')} for more information`);
|
|
25
47
|
if (telemetry_1.Telemetry.client) {
|
|
26
48
|
console.log(`Your session id was ${telemetry_1.Telemetry.client.commonProperties.sessionId}`);
|
|
27
49
|
}
|
|
@@ -38,7 +60,7 @@ function getPkgVersion(pkgName) {
|
|
|
38
60
|
const pkgJsonPath = require.resolve(`${pkgName}/package.json`, {
|
|
39
61
|
paths: [process.cwd(), __dirname],
|
|
40
62
|
});
|
|
41
|
-
const pkgJson = JSON.parse(
|
|
63
|
+
const pkgJson = JSON.parse(fs_1.default.readFileSync(pkgJsonPath).toString());
|
|
42
64
|
if (pkgJson.name === pkgName && pkgJson.version !== undefined) {
|
|
43
65
|
return pkgJson.version;
|
|
44
66
|
}
|
|
@@ -74,7 +96,7 @@ async function runWindows(args, config, options) {
|
|
|
74
96
|
delete process.env.NPM_CONFIG_CACHE;
|
|
75
97
|
delete process.env.NPM_CONFIG_PREFIX;
|
|
76
98
|
const hasRunRnwDependencies = process.env.LocalAppData &&
|
|
77
|
-
|
|
99
|
+
fs_1.default.existsSync(path_1.default.join(process.env.LocalAppData, 'rnw-dependencies.txt')); // CODESYNC \vnext\scripts\rnw-dependencies.ps1
|
|
78
100
|
if (options.info) {
|
|
79
101
|
try {
|
|
80
102
|
const output = await info.getEnvironmentInfo();
|
|
@@ -101,7 +123,7 @@ async function runWindows(args, config, options) {
|
|
|
101
123
|
const rnwPkgJsonPath = require.resolve('react-native-windows/package.json', {
|
|
102
124
|
paths: [process.cwd(), __dirname],
|
|
103
125
|
});
|
|
104
|
-
const rnwDependenciesPath =
|
|
126
|
+
const rnwDependenciesPath = path_1.default.join(path_1.default.dirname(rnwPkgJsonPath), 'scripts/rnw-dependencies.ps1');
|
|
105
127
|
commandWithProgress_1.newError(`It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running ${rnwDependenciesPath} from an elevated PowerShell prompt.\nFor more information, go to http://aka.ms/rnw-deps`);
|
|
106
128
|
}
|
|
107
129
|
return setExitProcessWithError(e, options.logging);
|
|
@@ -149,17 +171,17 @@ async function runWindows(args, config, options) {
|
|
|
149
171
|
}
|
|
150
172
|
}
|
|
151
173
|
async function getAnonymizedProjectName(projectRoot) {
|
|
152
|
-
const projectJsonPath =
|
|
153
|
-
if (!
|
|
174
|
+
const projectJsonPath = path_1.default.join(projectRoot, 'package.json');
|
|
175
|
+
if (!fs_1.default.existsSync(projectJsonPath)) {
|
|
154
176
|
return null;
|
|
155
177
|
}
|
|
156
|
-
const projectJson = JSON.parse((await
|
|
178
|
+
const projectJson = JSON.parse((await fs_1.default.promises.readFile(projectJsonPath)).toString());
|
|
157
179
|
const projectName = projectJson.name;
|
|
158
180
|
if (typeof projectName !== 'string') {
|
|
159
181
|
return null;
|
|
160
182
|
}
|
|
161
183
|
// Ensure the project name cannot be reverse engineered to avoid leaking PII
|
|
162
|
-
return
|
|
184
|
+
return crypto_1.default
|
|
163
185
|
.createHash('sha256')
|
|
164
186
|
.update(projectName)
|
|
165
187
|
.digest('hex')
|
|
@@ -235,7 +257,7 @@ async function runWindowsInternal(args, config, options) {
|
|
|
235
257
|
catch (e) {
|
|
236
258
|
commandWithProgress_1.newError(`Build failed with message ${e.message}. Check your build configuration.`);
|
|
237
259
|
if (e.logfile) {
|
|
238
|
-
console.log('See',
|
|
260
|
+
console.log('See', chalk_1.default.bold(e.logfile));
|
|
239
261
|
}
|
|
240
262
|
throw e;
|
|
241
263
|
}
|
|
@@ -243,7 +265,9 @@ async function runWindowsInternal(args, config, options) {
|
|
|
243
265
|
else {
|
|
244
266
|
commandWithProgress_1.newInfo('Build step is skipped');
|
|
245
267
|
}
|
|
246
|
-
|
|
268
|
+
if (shouldLaunchPackager(options)) {
|
|
269
|
+
await deploy.startServerInNewWindow(options, verbose);
|
|
270
|
+
}
|
|
247
271
|
if (options.deploy) {
|
|
248
272
|
runWindowsPhase = 'FindSolution';
|
|
249
273
|
if (!slnFile) {
|
|
@@ -268,6 +292,9 @@ async function runWindowsInternal(args, config, options) {
|
|
|
268
292
|
commandWithProgress_1.newInfo('Deploy step is skipped');
|
|
269
293
|
}
|
|
270
294
|
}
|
|
295
|
+
function shouldLaunchPackager(options) {
|
|
296
|
+
return options.packager && options.launch && options.release !== true;
|
|
297
|
+
}
|
|
271
298
|
/*
|
|
272
299
|
// Example of running the Windows Command
|
|
273
300
|
runWindows({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runWindows.js","sourceRoot":"","sources":["../../src/runWindows/runWindows.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAAiC;AACjC,yBAAyB;AACzB,6BAA6B;AAC7B,+DAOyC;AAEzC,uCAAuC;AACvC,+BAA+B;AAC/B,yCAAyC;AACzC,qEAAuE;AACvE,qCAAqC;AACrC,uDAAgD;AAGhD,2DAAyE;AAEzE,+CAAiD;AACjD,2BAAkC;AAElC,SAAS,uBAAuB,CAC9B,KAAY,EACZ,iBAA0B;IAE1B,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,CAAC,GAAG,CACT,2BAA2B,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAC1E,CAAC;QACF,IAAI,qBAAS,CAAC,MAAM,EAAE;YACpB,OAAO,CAAC,GAAG,CACT,uBAAuB,qBAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CACrE,CAAC;SACH;KACF;IACD,IAAI,KAAK,YAAY,sBAAU,EAAE;QAC/B,OAAO,CAAC,QAAQ,GAAG,uBAAW,CAAC,KAAK,CAAC,IAAsB,CAAC,CAAC;KAC9D;SAAM;QACL,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;KACtB;AACH,CAAC;AAED,SAAS,aAAa,CAAC,OAAe;IACpC,IAAI;QACF,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,eAAe,EAAE;YAC7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B,OAAO,EAAE,qCAAiB;CAC3B,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport crypto from 'crypto';\nimport fs from 'fs';\nimport path from 'path';\nimport {\n Telemetry,\n isMSFTInternal,\n getDiskFreeSpace,\n CodedError,\n CodedErrorType,\n CodedErrors,\n} from '@react-native-windows/telemetry';\n\nimport * as build from './utils/build';\nimport chalk from 'chalk';\nimport * as deploy from './utils/deploy';\nimport {newError, newInfo, newWarn} from './utils/commandWithProgress';\nimport * as info from './utils/info';\nimport MSBuildTools from './utils/msbuildtools';\n\nimport {Command, Config} from '@react-native-community/cli-types';\nimport {runWindowsOptions, RunWindowsOptions} from './runWindowsOptions';\n\nimport {autoLinkCommand} from './utils/autolink';\nimport {totalmem, cpus} from 'os';\n\nfunction setExitProcessWithError(\n error: Error,\n loggingWasEnabled: boolean,\n): void {\n if (!loggingWasEnabled) {\n console.log(\n `Re-run the command with ${chalk.bold('--logging')} for more information`,\n );\n if (Telemetry.client) {\n console.log(\n `Your session id was ${Telemetry.client.commonProperties.sessionId}`,\n );\n }\n }\n if (error instanceof CodedError) {\n process.exitCode = CodedErrors[error.name as CodedErrorType];\n } else {\n process.exitCode = 1;\n }\n}\n\nfunction getPkgVersion(pkgName: string): string {\n try {\n const pkgJsonPath = require.resolve(`${pkgName}/package.json`, {\n paths: [process.cwd(), __dirname],\n });\n const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath).toString());\n if (pkgJson.name === pkgName && pkgJson.version !== undefined) {\n return pkgJson.version;\n }\n } catch {}\n newWarn(`Could not determine ${pkgName} version`);\n return '';\n}\n\n/**\n * Labels used by telemtry to represent current operation\n */\ntype RunWindowsPhase =\n | 'None'\n | 'AutoLink'\n | 'FindBuildTools'\n | 'FindSolution'\n | 'Deploy';\n\nlet runWindowsPhase: RunWindowsPhase = 'None';\n/**\n * Performs build deploy and launch of RNW apps.\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 runWindows(\n args: string[],\n config: Config,\n options: RunWindowsOptions,\n) {\n if (!options.telemetry) {\n if (options.logging) {\n console.log('Disabling telemetry');\n }\n Telemetry.disable();\n } else {\n Telemetry.setup();\n }\n\n // https://github.com/yarnpkg/yarn/issues/8334 - Yarn on Windows breaks apps that read from the environment variables\n // Yarn will run node via CreateProcess and pass npm_config_* variables in lowercase without unifying their value\n // with their possibly existing uppercase counterparts. This breaks programs that read from the environment block\n // and write to a case-insensitive dictionary since they expect to encounter each variable only once.\n // The values of the lowercase variables are the one npm actually wants to use, plus they are seeded from the\n // uppercase variable values one if there are no overrides.\n delete process.env.NPM_CONFIG_CACHE;\n delete process.env.NPM_CONFIG_PREFIX;\n\n const hasRunRnwDependencies =\n process.env.LocalAppData &&\n fs.existsSync(path.join(process.env.LocalAppData, 'rnw-dependencies.txt')); // CODESYNC \\vnext\\scripts\\rnw-dependencies.ps1\n\n if (options.info) {\n try {\n const output = await info.getEnvironmentInfo();\n console.log(output.trimEnd());\n console.log(' Installed UWP SDKs:');\n const sdks = MSBuildTools.getAllAvailableUAPVersions();\n sdks.forEach(version => console.log(' ' + version));\n return;\n } catch (e) {\n Telemetry.trackException(e);\n newError('Unable to print environment info.\\n' + e.toString());\n return setExitProcessWithError(e, options.logging);\n }\n }\n\n let runWindowsError;\n try {\n await runWindowsInternal(args, config, options);\n } catch (e) {\n Telemetry.trackException(e);\n runWindowsError = e;\n if (!hasRunRnwDependencies) {\n const rnwPkgJsonPath = require.resolve(\n 'react-native-windows/package.json',\n {\n paths: [process.cwd(), __dirname],\n },\n );\n const rnwDependenciesPath = path.join(\n path.dirname(rnwPkgJsonPath),\n 'scripts/rnw-dependencies.ps1',\n );\n\n newError(\n `It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running ${rnwDependenciesPath} from an elevated PowerShell prompt.\\nFor more information, go to http://aka.ms/rnw-deps`,\n );\n }\n return setExitProcessWithError(e, options.logging);\n } finally {\n Telemetry.client?.trackEvent({\n name: 'run-windows',\n properties: {\n release: options.release,\n arch: options.arch,\n singleproc: options.singleproc,\n emulator: options.emulator,\n device: options.device,\n target: options.target,\n remoteDebugging: options.remoteDebugging,\n logging: options.logging,\n packager: options.packager,\n bundle: options.bundle,\n launch: options.launch,\n autolink: options.autolink,\n build: options.bundle,\n deploy: options.deploy,\n sln: options.sln !== undefined,\n proj: options.proj !== undefined,\n msBuildProps:\n options.msbuildprops !== undefined\n ? options.msbuildprops!.split(',').length\n : 0,\n info: options.info,\n directDebugging: options.directDebugging,\n 'react-native-windows': getPkgVersion('react-native-windows'),\n 'react-native': getPkgVersion('react-native'),\n 'cli-version': getPkgVersion('@react-native-windows/cli'),\n msftInternal: isMSFTInternal(),\n durationInSecs: process.uptime(),\n success: runWindowsError === undefined,\n phase: runWindowsPhase,\n totalMem: totalmem(),\n diskFree: getDiskFreeSpace(__dirname),\n cpus: cpus().length,\n project: await getAnonymizedProjectName(config.root),\n hasRunRnwDependencies: hasRunRnwDependencies,\n },\n });\n Telemetry.client?.flush();\n }\n}\n\nexport async function getAnonymizedProjectName(\n projectRoot: string,\n): Promise<string | null> {\n const projectJsonPath = path.join(projectRoot, 'package.json');\n if (!fs.existsSync(projectJsonPath)) {\n return null;\n }\n\n const projectJson = JSON.parse(\n (await fs.promises.readFile(projectJsonPath)).toString(),\n );\n\n const projectName = projectJson.name;\n if (typeof projectName !== 'string') {\n return null;\n }\n\n // Ensure the project name cannot be reverse engineered to avoid leaking PII\n return crypto\n .createHash('sha256')\n .update(projectName)\n .digest('hex')\n .toString();\n}\n\nasync function runWindowsInternal(\n args: string[],\n config: Config,\n options: RunWindowsOptions,\n) {\n const verbose = options.logging;\n\n if (verbose) {\n newInfo('Verbose: ON');\n }\n\n // Get the solution file\n let slnFile;\n try {\n slnFile = build.getAppSolutionFile(options, config);\n } catch (e) {\n newError(`Couldn't get app solution information. ${e.message}`);\n throw e;\n }\n\n try {\n if (options.autolink) {\n const autolinkArgs: string[] = [];\n const autolinkConfig = config;\n const autoLinkOptions = {\n logging: options.logging,\n proj: options.proj,\n sln: options.sln,\n };\n runWindowsPhase = 'AutoLink';\n await autoLinkCommand.func(autolinkArgs, autolinkConfig, autoLinkOptions);\n } else {\n newInfo('Autolink step is skipped');\n }\n } catch (e) {\n newError(`Autolinking failed. ${e.message}`);\n throw e;\n }\n\n let buildTools: MSBuildTools;\n runWindowsPhase = 'FindBuildTools';\n try {\n buildTools = MSBuildTools.findAvailableVersion(options.arch, verbose);\n } catch (error) {\n newWarn('No public VS release found');\n // Try prerelease\n try {\n newInfo('Trying pre-release VS');\n buildTools = MSBuildTools.findAvailableVersion(\n options.arch,\n verbose,\n true, // preRelease\n );\n } catch (e) {\n newError(e.message);\n throw error;\n }\n }\n\n if (options.build) {\n runWindowsPhase = 'FindSolution';\n if (!slnFile) {\n newError(\n 'Visual Studio Solution file not found. Maybe run \"npx react-native-windows-init\" first?',\n );\n throw new CodedError('NoSolution', 'Cannot find solution file');\n }\n\n // Get build/deploy options\n const buildType = deploy.getBuildConfiguration(options);\n const msBuildProps = build.parseMsBuildProps(options);\n\n // Disable the autolink check since we just ran it\n msBuildProps.RunAutolinkCheck = 'false';\n\n try {\n runWindowsPhase = 'FindSolution';\n await build.buildSolution(\n buildTools,\n slnFile!,\n buildType,\n options.arch,\n msBuildProps,\n verbose,\n 'build',\n options.buildLogDirectory,\n options.singleproc,\n );\n } catch (e) {\n newError(\n `Build failed with message ${e.message}. Check your build configuration.`,\n );\n if (e.logfile) {\n console.log('See', chalk.bold(e.logfile));\n }\n throw e;\n }\n } else {\n newInfo('Build step is skipped');\n }\n\n if (shouldLaunchPackager(options)) {\n await deploy.startServerInNewWindow(options, verbose);\n }\n\n if (options.deploy) {\n runWindowsPhase = 'FindSolution';\n if (!slnFile) {\n newError(\n 'Visual Studio Solution file not found. Maybe run \"npx react-native-windows-init\" first?',\n );\n throw new CodedError('NoSolution', 'Cannot find solution file');\n }\n\n try {\n runWindowsPhase = 'Deploy';\n if (options.device || options.emulator || options.target) {\n await deploy.deployToDevice(options, verbose);\n } else {\n await deploy.deployToDesktop(options, verbose, config, buildTools);\n }\n } catch (e) {\n newError(`Failed to deploy${e ? `: ${e.message}` : ''}`);\n throw e;\n }\n } else {\n newInfo('Deploy step is skipped');\n }\n}\n\nfunction shouldLaunchPackager(options: RunWindowsOptions): boolean {\n return options.packager && options.launch && options.release !== true;\n}\n\n/*\n// Example of running the Windows Command\nrunWindows({\n root: 'C:\\\\github\\\\hack\\\\myapp',\n debug: true,\n arch: 'x86',\n nugetPath: 'C:\\\\github\\\\react\\\\react-native-windows\\\\local-cli\\\\runWindows\\\\.nuget\\\\nuget.exe'\n});\n*/\n\n/**\n * Starts the app on a connected Windows emulator or mobile device.\n */\nexport const runWindowsCommand: Command = {\n name: 'run-windows',\n description:\n 'builds your app and starts it on a connected Windows desktop, emulator or device',\n func: runWindows,\n options: runWindowsOptions,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runWindowsOptions.js","sourceRoot":"","sources":["../../src/runWindows/runWindowsOptions.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAuDU,QAAA,iBAAiB,GAAoB;IAChD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,sFAAsF;QACxF,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI;KAC/B;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,0CAA0C;QACvD,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,cAAc;KACtB;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,gCAAgC;KAC9C;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,uCAAuC;KACrD;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,qDAAqD;KACnE;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,2CAA2C;KACzD;IACD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,iBAAiB;QAC9B,OAAO,EAAE,KAAK;KACf;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,uCAAuC;
|
|
1
|
+
{"version":3,"file":"runWindowsOptions.js","sourceRoot":"","sources":["../../src/runWindows/runWindowsOptions.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAuDU,QAAA,iBAAiB,GAAoB;IAChD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,sFAAsF;QACxF,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI;KAC/B;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,0CAA0C;QACvD,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,cAAc;KACtB;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,gCAAgC;KAC9C;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,uCAAuC;KACrD;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,qDAAqD;KACnE;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,2CAA2C;KACzD;IACD;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,iBAAiB;QAC9B,OAAO,EAAE,KAAK;KACf;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,uCAAuC;KACrD;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,gGAAgG;QAClG,OAAO,EAAE,KAAK;KACf;IACD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;KACF;IAED,QAAQ,CAAC,wBAAwB,GAAG,sBAAsB,eAAe,EAAE,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,wBAAwB,CAAC,GAAW;IAC3C,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAE9B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;QAC1B,QAAQ,CAAC,uDAAuD,CAAC,CAAC;KACnE;IACD,IAAI,GAAG,GAAG,IAAI,IAAI,GAAG,IAAI,KAAK,EAAE;QAC9B,QAAQ,CAAC,uCAAuC,CAAC,CAAC;KACnD;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,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 type BuildArch = 'x86' | 'x64' | 'ARM64';\nexport type BuildConfig = 'Debug' | 'DebugBundle' | 'Release' | 'ReleaseBundle';\n\n/**\n * * Options are the following:\n * release: Boolean - Specifies release build\n * root: String - The root of the application\n * arch: String - The build architecture (ARM64, x86, x64)\n * singleproc: Boolean - opt out of multi-proc builds\n * emulator: Boolean - Deploy to the emulator\n * device: Boolean - Deploy to a device\n * target: String - Device GUID to deploy to\n * remote-debugging: Boolean - Run using remote JS proxy\n * logging: Boolean - Enables logging\n * no-packager: Boolean - Do not launch packager while building\n * bundle: Boolean - Enable Bundle configuration.\n * no-launch: Boolean - Do not launch the app after deployment\n * no-build: Boolean - Do not build the solution\n * no-deploy: Boolean - Do not deploy the app\n * deploy-from-layout: Force deploy from layout, even in release builds\n * sln: String - Solution file to build\n * msbuildprops: String - Comma separated props to pass to msbuild, eg: prop1=value1,prop2=value2\n * direct-debugging: Number - Enable direct debugging on specified port\n * no-telemetry: Boolean - Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI\n */\nexport interface RunWindowsOptions {\n release?: boolean;\n root: string;\n arch: BuildArch;\n singleproc?: boolean;\n emulator?: boolean;\n device?: boolean;\n target?: string;\n remoteDebugging?: string;\n logging: boolean;\n packager: boolean;\n bundle: boolean;\n launch: boolean;\n autolink: boolean;\n build: boolean;\n deploy: boolean;\n deployFromLayout?: boolean;\n sln?: string;\n proj?: string;\n msbuildprops?: string;\n buildLogDirectory?: string;\n info: boolean;\n directDebugging?: number;\n telemetry?: boolean;\n}\n\nexport const runWindowsOptions: CommandOption[] = [\n {\n name: '--release',\n description: 'Specifies a release build',\n },\n {\n name: '--root [string]',\n description:\n 'Override the root directory for the windows build which contains the windows folder.',\n default: config => config.root,\n },\n {\n name: '--arch [string]',\n description: 'The build architecture (ARM64, x86, x64)',\n default: 'x86',\n parse: parseBuildArch,\n },\n {\n name: '--singleproc',\n description: 'Disables multi-proc build',\n },\n {\n name: '--emulator',\n description: 'Deploys the app to an emulator',\n },\n {\n name: '--device',\n description: 'Deploys the app to a connected device',\n },\n {\n name: '--target [string]',\n description: 'Deploys the app to the specified GUID for a device.',\n },\n {\n name: '--remote-debugging',\n description: 'Deploys the app in remote debugging mode.',\n },\n {\n name: '--logging',\n description: 'Enables logging',\n default: false,\n },\n {\n name: '--no-packager',\n description: 'Do not launch packager while building',\n },\n {\n name: '--bundle',\n description:\n 'Enable Bundle configuration and it would be ReleaseBundle/DebugBundle other than Release/Debug',\n default: false,\n },\n {\n name: '--no-launch',\n description: 'Do not launch the app after deployment',\n default: false,\n },\n {\n name: '--no-autolink',\n description: 'Do not run autolinking',\n default: false,\n },\n {\n name: '--no-build',\n description: 'Do not build the solution',\n default: false,\n },\n {\n name: '--no-deploy',\n description: 'Do not deploy the app',\n default: false,\n },\n {\n name: '--deploy-from-layout',\n description: 'Force deploy from layout, even in release builds',\n default: false,\n },\n {\n name: '--sln [string]',\n description:\n \"Override the app solution file determined by 'react-native config', e.g. windows\\\\myApp.sln\",\n default: undefined,\n },\n {\n name: '--proj [string]',\n description:\n \"Override the app project file determined by 'react-native config', e.g. windows\\\\myApp\\\\myApp.vcxproj\",\n default: undefined,\n },\n {\n name: '--msbuildprops [string]',\n description:\n 'Comma separated props to pass to msbuild, eg: prop1=value1,prop2=value2',\n },\n {\n name: '--buildLogDirectory [string]',\n description: 'Optional directory where msbuild log files should be stored',\n },\n {\n name: '--info',\n description: 'Dump environment information',\n default: false,\n },\n {\n name: '--direct-debugging [number]',\n description: 'Enable direct debugging on specified port',\n parse: parseDirectDebuggingPort,\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 default: true,\n },\n];\n\nfunction parseBuildArch(arg: string): BuildArch {\n const supportedArches: BuildArch[] = ['x86', 'x64', 'ARM64'];\n for (const supported of supportedArches) {\n if (arg.toLowerCase() === supported.toLowerCase()) {\n return supported;\n }\n }\n\n errorOut(`Unrecognized --arch '${arg}'. Expected one of ${supportedArches}`);\n}\n\nfunction parseDirectDebuggingPort(arg: string): number {\n const num = parseInt(arg, 10);\n\n if (!Number.isInteger(num)) {\n errorOut(`Expected argument '--direct-debugging' to be a number`);\n }\n if (num < 1024 || num >= 65535) {\n errorOut('Direct debugging port it out of range');\n }\n\n return num;\n}\n\nfunction errorOut(arg: string): never {\n console.error(arg);\n process.exit(1);\n}\n"]}
|
|
@@ -4,20 +4,42 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
* @format
|
|
6
6
|
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
7
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
30
|
exports.autoLinkCommand = exports.AutolinkWindows = void 0;
|
|
9
31
|
// Types in this file are inaccurate compared to usage in terms of falsiness.
|
|
10
32
|
// We should try to rewrite some of this to do automated schema validation to
|
|
11
33
|
// guarantee correct types
|
|
12
34
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
35
|
+
const fs_1 = __importDefault(require("fs"));
|
|
36
|
+
const path_1 = __importDefault(require("path"));
|
|
37
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
16
38
|
const perf_hooks_1 = require("perf_hooks");
|
|
17
39
|
const commandWithProgress_1 = require("./commandWithProgress");
|
|
18
|
-
const vstools = require("./vstools");
|
|
19
|
-
const generatorCommon = require("../../generator-common");
|
|
20
|
-
const configUtils = require("../../config/configUtils");
|
|
40
|
+
const vstools = __importStar(require("./vstools"));
|
|
41
|
+
const generatorCommon = __importStar(require("../../generator-common"));
|
|
42
|
+
const configUtils = __importStar(require("../../config/configUtils"));
|
|
21
43
|
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
22
44
|
const xmldom_1 = require("@xmldom/xmldom");
|
|
23
45
|
const formatter = require('xml-formatter');
|
|
@@ -42,7 +64,7 @@ class AutolinkWindows {
|
|
|
42
64
|
return this.windowsAppConfig;
|
|
43
65
|
}
|
|
44
66
|
getSolutionFile() {
|
|
45
|
-
return
|
|
67
|
+
return path_1.default.join(this.getWindowsConfig().folder, this.getWindowsConfig().sourceDir, this.getWindowsConfig().solutionFile);
|
|
46
68
|
}
|
|
47
69
|
async run(spinner) {
|
|
48
70
|
const verbose = this.options.logging;
|
|
@@ -59,7 +81,7 @@ class AutolinkWindows {
|
|
|
59
81
|
const windowsAppProjectConfig = this.windowsAppConfig.project;
|
|
60
82
|
this.validateRequiredProjectProperties();
|
|
61
83
|
const projectFile = this.getProjectFile();
|
|
62
|
-
const projectDir =
|
|
84
|
+
const projectDir = path_1.default.dirname(projectFile);
|
|
63
85
|
const projectLang = windowsAppProjectConfig.projectLang;
|
|
64
86
|
verboseMessage('Parsing dependencies...', verbose);
|
|
65
87
|
this.changesNecessary =
|
|
@@ -100,10 +122,10 @@ class AutolinkWindows {
|
|
|
100
122
|
*/
|
|
101
123
|
fixUpForProjOption() {
|
|
102
124
|
if (this.options.proj) {
|
|
103
|
-
const projFile =
|
|
125
|
+
const projFile = path_1.default.join(this.windowsAppConfig.folder, this.options.proj);
|
|
104
126
|
const projectContents = configUtils.readProjectFile(projFile);
|
|
105
127
|
this.windowsAppConfig.project = {
|
|
106
|
-
projectFile:
|
|
128
|
+
projectFile: path_1.default.relative(path_1.default.join(this.windowsAppConfig.folder, this.windowsAppConfig.sourceDir), projFile),
|
|
107
129
|
projectName: configUtils.getProjectName(projFile, projectContents),
|
|
108
130
|
projectLang: configUtils.getProjectLanguage(projFile),
|
|
109
131
|
projectGuid: configUtils.getProjectGuid(projectContents),
|
|
@@ -115,8 +137,8 @@ class AutolinkWindows {
|
|
|
115
137
|
*/
|
|
116
138
|
fixUpForSlnOption() {
|
|
117
139
|
if (this.options.sln) {
|
|
118
|
-
const slnFile =
|
|
119
|
-
this.windowsAppConfig.solutionFile =
|
|
140
|
+
const slnFile = path_1.default.join(this.windowsAppConfig.folder, this.options.sln);
|
|
141
|
+
this.windowsAppConfig.solutionFile = path_1.default.relative(path_1.default.join(this.windowsAppConfig.folder, this.windowsAppConfig.sourceDir), slnFile);
|
|
120
142
|
}
|
|
121
143
|
}
|
|
122
144
|
/** Validates the all of the required app (solution) properties are present and valid */
|
|
@@ -141,7 +163,7 @@ class AutolinkWindows {
|
|
|
141
163
|
/** @return the full path to the project file (.vcxproj or .csproj) */
|
|
142
164
|
getProjectFile() {
|
|
143
165
|
const windowsAppConfig = this.getWindowsConfig();
|
|
144
|
-
return
|
|
166
|
+
return path_1.default.join(windowsAppConfig.folder, windowsAppConfig.sourceDir, windowsAppConfig.project.projectFile);
|
|
145
167
|
}
|
|
146
168
|
/** Validates that all of the required app _project_ properties are present and valid */
|
|
147
169
|
validateRequiredProjectProperties() {
|
|
@@ -166,9 +188,9 @@ class AutolinkWindows {
|
|
|
166
188
|
async generateCppAutolinking(templateRoot, projectLang, projectDir) {
|
|
167
189
|
const { cppPackageProviders, cppIncludes } = this.getCppReplacements();
|
|
168
190
|
const cppFileName = 'AutolinkedNativeModules.g.cpp';
|
|
169
|
-
const srcCppFile =
|
|
170
|
-
const destCppFile =
|
|
171
|
-
verboseMessage(`Calculating ${
|
|
191
|
+
const srcCppFile = path_1.default.join(templateRoot, `${projectLang}-app`, 'src', cppFileName);
|
|
192
|
+
const destCppFile = path_1.default.join(projectDir, cppFileName);
|
|
193
|
+
verboseMessage(`Calculating ${chalk_1.default.bold(path_1.default.basename(destCppFile))}...`, this.options.logging);
|
|
172
194
|
const cppContents = generatorCommon.resolveContents(srcCppFile, {
|
|
173
195
|
useMustache: true,
|
|
174
196
|
autolinkCppIncludes: cppIncludes,
|
|
@@ -204,9 +226,9 @@ class AutolinkWindows {
|
|
|
204
226
|
generateCSAutolinking(templateRoot, projectLang, projectDir) {
|
|
205
227
|
const { csUsingNamespaces, csReactPackageProviders, } = this.getCsReplacements();
|
|
206
228
|
const csFileName = 'AutolinkedNativeModules.g.cs';
|
|
207
|
-
const srcCsFile =
|
|
208
|
-
const destCsFile =
|
|
209
|
-
verboseMessage(`Calculating ${
|
|
229
|
+
const srcCsFile = path_1.default.join(templateRoot, `${projectLang}-app`, 'src', csFileName);
|
|
230
|
+
const destCsFile = path_1.default.join(projectDir, csFileName);
|
|
231
|
+
verboseMessage(`Calculating ${chalk_1.default.bold(path_1.default.basename(destCsFile))}...`, this.options.logging);
|
|
210
232
|
const csContents = generatorCommon.resolveContents(srcCsFile, {
|
|
211
233
|
useMustache: true,
|
|
212
234
|
autolinkCsUsingNamespaces: csUsingNamespaces,
|
|
@@ -240,7 +262,7 @@ class AutolinkWindows {
|
|
|
240
262
|
const windowsDependency = this
|
|
241
263
|
.dependenciesConfig[dependencyName].platforms.windows;
|
|
242
264
|
if (windowsDependency) {
|
|
243
|
-
verboseMessage(`${
|
|
265
|
+
verboseMessage(`${chalk_1.default.bold(dependencyName)} has Windows implementation, config:`, this.options.logging);
|
|
244
266
|
verboseMessage(windowsDependency, this.options.logging);
|
|
245
267
|
let dependencyIsValid = true;
|
|
246
268
|
dependencyIsValid = !!(dependencyIsValid &&
|
|
@@ -249,6 +271,11 @@ class AutolinkWindows {
|
|
|
249
271
|
!windowsDependency.sourceDir.startsWith('Error: '));
|
|
250
272
|
if ('projects' in windowsDependency &&
|
|
251
273
|
Array.isArray(windowsDependency.projects)) {
|
|
274
|
+
if (windowsDependency.projects.length === 0 &&
|
|
275
|
+
dependencyName.includes('react-native')) {
|
|
276
|
+
// the dependency is probably a react native module, but we didn't find a module project
|
|
277
|
+
throw new telemetry_1.CodedError('Autolinking', `Found a Windows solution for ${dependencyName} but no React Native for Windows native module projects`);
|
|
278
|
+
}
|
|
252
279
|
windowsDependency.projects.forEach(project => {
|
|
253
280
|
const itemsToCheck = [
|
|
254
281
|
'projectFile',
|
|
@@ -263,7 +290,7 @@ class AutolinkWindows {
|
|
|
263
290
|
});
|
|
264
291
|
}
|
|
265
292
|
if (dependencyIsValid) {
|
|
266
|
-
verboseMessage(`Adding ${
|
|
293
|
+
verboseMessage(`Adding ${chalk_1.default.bold(dependencyName)}.`, this.options.logging);
|
|
267
294
|
this.windowsDependencies[dependencyName] = windowsDependency;
|
|
268
295
|
}
|
|
269
296
|
else {
|
|
@@ -281,17 +308,17 @@ class AutolinkWindows {
|
|
|
281
308
|
* @return Whether any changes were necessary.
|
|
282
309
|
*/
|
|
283
310
|
async updateFile(filePath, expectedContents) {
|
|
284
|
-
const fileName =
|
|
311
|
+
const fileName = chalk_1.default.bold(path_1.default.basename(filePath));
|
|
285
312
|
verboseMessage(`Reading ${fileName}...`, this.options.logging);
|
|
286
|
-
const actualContents =
|
|
287
|
-
? (await
|
|
313
|
+
const actualContents = fs_1.default.existsSync(filePath)
|
|
314
|
+
? (await fs_1.default.promises.readFile(filePath)).toString()
|
|
288
315
|
: '';
|
|
289
316
|
const contentsChanged = expectedContents !== actualContents;
|
|
290
317
|
if (contentsChanged) {
|
|
291
|
-
verboseMessage(
|
|
318
|
+
verboseMessage(chalk_1.default.yellow(`${fileName} needs to be updated.`), this.options.logging);
|
|
292
319
|
if (!this.options.check) {
|
|
293
320
|
verboseMessage(`Writing ${fileName}...`, this.options.logging);
|
|
294
|
-
await
|
|
321
|
+
await fs_1.default.promises.writeFile(filePath, expectedContents, {
|
|
295
322
|
encoding: 'utf8',
|
|
296
323
|
flag: 'w',
|
|
297
324
|
});
|
|
@@ -308,8 +335,8 @@ class AutolinkWindows {
|
|
|
308
335
|
for (const dependencyName of Object.keys(windowsDependencies)) {
|
|
309
336
|
windowsDependencies[dependencyName].projects.forEach(project => {
|
|
310
337
|
if (project.directDependency) {
|
|
311
|
-
const dependencyProjectFile =
|
|
312
|
-
const relDependencyProjectFile =
|
|
338
|
+
const dependencyProjectFile = path_1.default.join(windowsDependencies[dependencyName].folder, windowsDependencies[dependencyName].sourceDir, project.projectFile);
|
|
339
|
+
const relDependencyProjectFile = path_1.default.relative(projectDir, dependencyProjectFile);
|
|
313
340
|
projectReferencesForTargets += `
|
|
314
341
|
<!-- Projects from ${dependencyName} -->
|
|
315
342
|
<ProjectReference Include="$(ProjectDir)${relDependencyProjectFile}">
|
|
@@ -319,9 +346,9 @@ class AutolinkWindows {
|
|
|
319
346
|
});
|
|
320
347
|
}
|
|
321
348
|
const targetFileName = 'AutolinkedNativeModules.g.targets';
|
|
322
|
-
const srcTargetFile =
|
|
323
|
-
const destTargetFile =
|
|
324
|
-
verboseMessage(`Calculating ${
|
|
349
|
+
const srcTargetFile = path_1.default.join(templateRoot, `shared-app`, 'src', targetFileName);
|
|
350
|
+
const destTargetFile = path_1.default.join(projectDir, targetFileName);
|
|
351
|
+
verboseMessage(`Calculating ${chalk_1.default.bold(path_1.default.basename(destTargetFile))}...`, this.options.logging);
|
|
325
352
|
const targetContents = generatorCommon.resolveContents(srcTargetFile, {
|
|
326
353
|
useMustache: true,
|
|
327
354
|
autolinkProjectReferencesForTargets: projectReferencesForTargets,
|
|
@@ -330,9 +357,9 @@ class AutolinkWindows {
|
|
|
330
357
|
}
|
|
331
358
|
generateAutolinkProps(templateRoot, projectDir, propertiesForProps) {
|
|
332
359
|
const propsFileName = 'AutolinkedNativeModules.g.props';
|
|
333
|
-
const srcPropsFile =
|
|
334
|
-
const destPropsFile =
|
|
335
|
-
verboseMessage(`Calculating ${
|
|
360
|
+
const srcPropsFile = path_1.default.join(templateRoot, `shared-app`, 'src', propsFileName);
|
|
361
|
+
const destPropsFile = path_1.default.join(projectDir, propsFileName);
|
|
362
|
+
verboseMessage(`Calculating ${chalk_1.default.bold(path_1.default.basename(destPropsFile))}...`, this.options.logging);
|
|
336
363
|
const propsContents = generatorCommon.resolveContents(srcPropsFile, {
|
|
337
364
|
useMustache: true,
|
|
338
365
|
autolinkPropertiesForProps: propertiesForProps,
|
|
@@ -357,7 +384,7 @@ class AutolinkWindows {
|
|
|
357
384
|
for (const dependencyName of Object.keys(windowsDependencies)) {
|
|
358
385
|
// Process dependency projects
|
|
359
386
|
windowsDependencies[dependencyName].projects.forEach(project => {
|
|
360
|
-
const dependencyProjectFile =
|
|
387
|
+
const dependencyProjectFile = path_1.default.join(windowsDependencies[dependencyName].folder, windowsDependencies[dependencyName].sourceDir, project.projectFile);
|
|
361
388
|
projectsForSolution.push({
|
|
362
389
|
projectFile: dependencyProjectFile,
|
|
363
390
|
projectName: project.projectName,
|
|
@@ -370,20 +397,20 @@ class AutolinkWindows {
|
|
|
370
397
|
if (csModuleNames.length > 0) {
|
|
371
398
|
// Add managed projects
|
|
372
399
|
projectsForSolution.push({
|
|
373
|
-
projectFile:
|
|
400
|
+
projectFile: path_1.default.join(rnwRoot, 'Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj'),
|
|
374
401
|
projectName: 'Microsoft.ReactNative.Managed',
|
|
375
402
|
projectLang: 'cs',
|
|
376
403
|
projectGuid: '{F2824844-CE15-4242-9420-308923CD76C3}',
|
|
377
404
|
});
|
|
378
405
|
projectsForSolution.push({
|
|
379
|
-
projectFile:
|
|
406
|
+
projectFile: path_1.default.join(rnwRoot, 'Microsoft.ReactNative.Managed.CodeGen//Microsoft.ReactNative.Managed.CodeGen.csproj'),
|
|
380
407
|
projectName: 'Microsoft.ReactNative.Managed.CodeGen',
|
|
381
408
|
projectLang: 'cs',
|
|
382
409
|
projectGuid: '{ADED4FBE-887D-4271-AF24-F0823BCE7961}',
|
|
383
410
|
projectTypeGuid: vstools.dotNetCoreProjectTypeGuid,
|
|
384
411
|
});
|
|
385
412
|
}
|
|
386
|
-
verboseMessage(`Calculating ${
|
|
413
|
+
verboseMessage(`Calculating ${chalk_1.default.bold(path_1.default.basename(solutionFile))} changes...`, this.options.logging);
|
|
387
414
|
let changesNecessary = false;
|
|
388
415
|
projectsForSolution.forEach(project => {
|
|
389
416
|
const contentsChanged = vstools.addProjectToSolution(solutionFile, project, this.options.logging, this.options.check);
|
|
@@ -392,8 +419,8 @@ class AutolinkWindows {
|
|
|
392
419
|
return changesNecessary;
|
|
393
420
|
}
|
|
394
421
|
getExperimentalFeaturesPropsXml() {
|
|
395
|
-
const experimentalFeaturesProps =
|
|
396
|
-
if (
|
|
422
|
+
const experimentalFeaturesProps = path_1.default.join(path_1.default.dirname(this.getSolutionFile()), 'ExperimentalFeatures.props');
|
|
423
|
+
if (fs_1.default.existsSync(experimentalFeaturesProps)) {
|
|
397
424
|
const experimentalFeaturesContents = configUtils.readProjectFile(experimentalFeaturesProps);
|
|
398
425
|
return {
|
|
399
426
|
path: experimentalFeaturesProps,
|
|
@@ -430,8 +457,8 @@ class AutolinkWindows {
|
|
|
430
457
|
}
|
|
431
458
|
getPackagesConfigXml() {
|
|
432
459
|
const projectFile = this.getProjectFile();
|
|
433
|
-
const packagesConfig =
|
|
434
|
-
if (
|
|
460
|
+
const packagesConfig = path_1.default.join(path_1.default.dirname(projectFile), 'packages.config');
|
|
461
|
+
if (fs_1.default.existsSync(packagesConfig)) {
|
|
435
462
|
return {
|
|
436
463
|
path: packagesConfig,
|
|
437
464
|
content: configUtils.readProjectFile(packagesConfig),
|
|
@@ -445,7 +472,7 @@ class AutolinkWindows {
|
|
|
445
472
|
if (packagesConfig) {
|
|
446
473
|
// if we don't have a packages.config, then this is a C# project, in which case we use <PackageReference> and dynamically pick the right XAML package.
|
|
447
474
|
const project = this.getWindowsConfig();
|
|
448
|
-
const winUIPropsPath =
|
|
475
|
+
const winUIPropsPath = path_1.default.join(resolveRnwRoot(project), 'PropertySheets/WinUI.props');
|
|
449
476
|
const winuiPropsContents = configUtils.readProjectFile(winUIPropsPath);
|
|
450
477
|
const winui2xVersion = configUtils.tryFindPropertyValue(winuiPropsContents, 'WinUI2xVersion');
|
|
451
478
|
const winui3Version = configUtils.tryFindPropertyValue(winuiPropsContents, 'WinUI3Version');
|
|
@@ -501,7 +528,7 @@ class AutolinkWindows {
|
|
|
501
528
|
getAutolinkWindowsCommand() {
|
|
502
529
|
const folder = this.windowsAppConfig.folder;
|
|
503
530
|
const autolinkCommand = 'npx react-native autolink-windows';
|
|
504
|
-
const autolinkArgs = `--sln "${
|
|
531
|
+
const autolinkArgs = `--sln "${path_1.default.relative(folder, this.getSolutionFile())}" --proj "${path_1.default.relative(folder, this.getProjectFile())}"`;
|
|
505
532
|
return `${autolinkCommand} ${autolinkArgs}`;
|
|
506
533
|
}
|
|
507
534
|
}
|
|
@@ -511,7 +538,7 @@ exports.AutolinkWindows = AutolinkWindows;
|
|
|
511
538
|
* @param config project configuration
|
|
512
539
|
*/
|
|
513
540
|
function resolveRnwRoot(projectConfig) {
|
|
514
|
-
const rnwPackage =
|
|
541
|
+
const rnwPackage = path_1.default.dirname(require.resolve('react-native-windows/package.json', {
|
|
515
542
|
paths: [projectConfig.folder],
|
|
516
543
|
}));
|
|
517
544
|
return rnwPackage;
|
|
@@ -522,7 +549,7 @@ function resolveRnwRoot(projectConfig) {
|
|
|
522
549
|
*/
|
|
523
550
|
function resolveTemplateRoot(projectConfig) {
|
|
524
551
|
const rnwPackage = resolveRnwRoot(projectConfig);
|
|
525
|
-
return
|
|
552
|
+
return path_1.default.join(rnwPackage, 'template');
|
|
526
553
|
}
|
|
527
554
|
/**
|
|
528
555
|
* Logs the given message if verbose is True.
|
|
@@ -548,21 +575,21 @@ async function updateAutoLink(args, config, options) {
|
|
|
548
575
|
await autolink.run(spinner);
|
|
549
576
|
const endTime = perf_hooks_1.performance.now();
|
|
550
577
|
if (!autolink.areChangesNeeded()) {
|
|
551
|
-
console.log(`${
|
|
578
|
+
console.log(`${chalk_1.default.green('Success:')} No auto-linking changes necessary. (${Math.round(endTime - startTime)}ms)`);
|
|
552
579
|
}
|
|
553
580
|
else if (options.check) {
|
|
554
581
|
const autolinkCommand = autolink.getAutolinkWindowsCommand();
|
|
555
|
-
console.log(`${
|
|
582
|
+
console.log(`${chalk_1.default.yellow('Warning:')} Auto-linking changes were necessary but ${chalk_1.default.bold('--check')} specified. Run '${chalk_1.default.bold(`${autolinkCommand}`)}' to apply the changes. (${Math.round(endTime - startTime)}ms)`);
|
|
556
583
|
throw new telemetry_1.CodedError('NeedAutolinking', `Auto-linking changes were necessary but --check was specified. Run '${autolinkCommand}' to apply the changes`);
|
|
557
584
|
}
|
|
558
585
|
else {
|
|
559
|
-
console.log(`${
|
|
586
|
+
console.log(`${chalk_1.default.green('Success:')} Auto-linking changes completed. (${Math.round(endTime - startTime)}ms)`);
|
|
560
587
|
}
|
|
561
588
|
}
|
|
562
589
|
catch (e) {
|
|
563
590
|
spinner.fail();
|
|
564
591
|
const endTime = perf_hooks_1.performance.now();
|
|
565
|
-
console.log(`${
|
|
592
|
+
console.log(`${chalk_1.default.red('Error:')} ${e.toString()}. (${Math.round(endTime - startTime)}ms)`);
|
|
566
593
|
throw e;
|
|
567
594
|
}
|
|
568
595
|
}
|