@react-native-windows/cli 0.0.0-canary.13 → 0.0.0-canary.130
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 +47 -0
- package/lib-commonjs/config/configUtils.d.ts +25 -2
- package/lib-commonjs/config/configUtils.js +138 -30
- package/lib-commonjs/config/configUtils.js.map +1 -1
- package/lib-commonjs/config/dependencyConfig.js +104 -43
- package/lib-commonjs/config/dependencyConfig.js.map +1 -1
- package/lib-commonjs/config/projectConfig.d.ts +4 -1
- package/lib-commonjs/config/projectConfig.js +72 -12
- package/lib-commonjs/config/projectConfig.js.map +1 -1
- package/lib-commonjs/e2etest/autolink.test.d.ts +6 -0
- package/lib-commonjs/e2etest/autolink.test.js +386 -0
- package/lib-commonjs/e2etest/autolink.test.js.map +1 -0
- package/lib-commonjs/e2etest/dependencyConfig.test.d.ts +6 -0
- package/lib-commonjs/e2etest/dependencyConfig.test.js +130 -0
- package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -0
- package/lib-commonjs/e2etest/projectConfig.test.d.ts +6 -0
- package/lib-commonjs/e2etest/projectConfig.test.js +111 -0
- package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -0
- package/lib-commonjs/e2etest/projectConfig.utils.d.ts +8 -0
- package/lib-commonjs/e2etest/projectConfig.utils.js +77 -0
- package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -0
- package/lib-commonjs/e2etest/runWindows.test.d.ts +6 -0
- package/lib-commonjs/e2etest/runWindows.test.js +61 -0
- package/lib-commonjs/e2etest/runWindows.test.js.map +1 -0
- package/lib-commonjs/generator-common/index.d.ts +16 -0
- package/lib-commonjs/generator-common/index.js +60 -39
- package/lib-commonjs/generator-common/index.js.map +1 -1
- package/lib-commonjs/generator-windows/index.d.ts +2 -2
- package/lib-commonjs/generator-windows/index.js +265 -182
- package/lib-commonjs/generator-windows/index.js.map +1 -1
- package/lib-commonjs/healthChecks.d.ts +2 -0
- package/lib-commonjs/healthChecks.js +88 -0
- package/lib-commonjs/healthChecks.js.map +1 -0
- package/lib-commonjs/index.d.ts +5 -0
- package/lib-commonjs/index.js +28 -8
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/runWindows/runWindows.js +239 -52
- package/lib-commonjs/runWindows/runWindows.js.map +1 -1
- package/lib-commonjs/runWindows/runWindowsOptions.d.ts +14 -10
- package/lib-commonjs/runWindows/runWindowsOptions.js +15 -11
- package/lib-commonjs/runWindows/runWindowsOptions.js.map +1 -1
- package/lib-commonjs/runWindows/utils/autolink.d.ts +88 -1
- package/lib-commonjs/runWindows/utils/autolink.js +594 -260
- package/lib-commonjs/runWindows/utils/autolink.js.map +1 -1
- package/lib-commonjs/runWindows/utils/build.d.ts +1 -2
- package/lib-commonjs/runWindows/utils/build.js +24 -31
- package/lib-commonjs/runWindows/utils/build.js.map +1 -1
- package/lib-commonjs/runWindows/utils/checkRequirements.js +11 -7
- package/lib-commonjs/runWindows/utils/checkRequirements.js.map +1 -1
- package/lib-commonjs/runWindows/utils/commandWithProgress.d.ts +11 -3
- package/lib-commonjs/runWindows/utils/commandWithProgress.js +58 -22
- package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +1 -1
- package/lib-commonjs/runWindows/utils/deploy.d.ts +1 -1
- package/lib-commonjs/runWindows/utils/deploy.js +168 -82
- 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.d.ts +11 -5
- package/lib-commonjs/runWindows/utils/msbuildtools.js +148 -64
- package/lib-commonjs/runWindows/utils/msbuildtools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/telemetryHelpers.d.ts +29 -0
- package/lib-commonjs/runWindows/utils/telemetryHelpers.js +113 -0
- package/lib-commonjs/runWindows/utils/telemetryHelpers.js.map +1 -0
- package/lib-commonjs/runWindows/utils/version.d.ts +4 -4
- package/lib-commonjs/runWindows/utils/version.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.d.ts +4 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.js +22 -7
- package/lib-commonjs/runWindows/utils/vsInstalls.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vstools.d.ts +1 -0
- package/lib-commonjs/runWindows/utils/vstools.js +40 -27
- package/lib-commonjs/runWindows/utils/vstools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/winappdeploytool.d.ts +3 -3
- package/lib-commonjs/runWindows/utils/winappdeploytool.js +17 -14
- package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +1 -1
- package/package.json +40 -22
- package/powershell/Add-AppDevPackage.ps1 +2 -2
- package/powershell/Eval-MsBuildProperties.ps1 +156 -0
- package/powershell/WindowsStoreAppUtils.ps1 +10 -0
- package/CHANGELOG.json +0 -185
- package/CHANGELOG.md +0 -93
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* @format
|
|
5
5
|
*/
|
|
6
6
|
import { CommandOption } from '@react-native-community/cli-types';
|
|
7
|
-
export declare type BuildArch = 'x86' | 'x64' | '
|
|
7
|
+
export declare type BuildArch = 'x86' | 'x64' | 'ARM64';
|
|
8
8
|
export declare type BuildConfig = 'Debug' | 'DebugBundle' | 'Release' | 'ReleaseBundle';
|
|
9
9
|
/**
|
|
10
10
|
* * Options are the following:
|
|
11
11
|
* release: Boolean - Specifies release build
|
|
12
12
|
* root: String - The root of the application
|
|
13
|
-
* arch: String - The build architecture (x86, x64
|
|
13
|
+
* arch: String - The build architecture (ARM64, x86, x64)
|
|
14
14
|
* singleproc: Boolean - opt out of multi-proc builds
|
|
15
15
|
* emulator: Boolean - Deploy to the emulator
|
|
16
16
|
* device: Boolean - Deploy to a device
|
|
@@ -22,9 +22,11 @@ export declare type BuildConfig = 'Debug' | 'DebugBundle' | 'Release' | 'Release
|
|
|
22
22
|
* no-launch: Boolean - Do not launch the app after deployment
|
|
23
23
|
* no-build: Boolean - Do not build the solution
|
|
24
24
|
* no-deploy: Boolean - Do not deploy the app
|
|
25
|
+
* deploy-from-layout: Force deploy from layout, even in release builds
|
|
25
26
|
* sln: String - Solution file to build
|
|
26
27
|
* msbuildprops: String - Comma separated props to pass to msbuild, eg: prop1=value1,prop2=value2
|
|
27
28
|
* direct-debugging: Number - Enable direct debugging on specified port
|
|
29
|
+
* no-telemetry: Boolean - Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI
|
|
28
30
|
*/
|
|
29
31
|
export interface RunWindowsOptions {
|
|
30
32
|
release?: boolean;
|
|
@@ -35,18 +37,20 @@ export interface RunWindowsOptions {
|
|
|
35
37
|
device?: boolean;
|
|
36
38
|
target?: string;
|
|
37
39
|
remoteDebugging?: string;
|
|
38
|
-
logging
|
|
39
|
-
packager
|
|
40
|
-
bundle
|
|
41
|
-
launch
|
|
42
|
-
autolink
|
|
43
|
-
build
|
|
44
|
-
deploy
|
|
40
|
+
logging?: boolean;
|
|
41
|
+
packager?: boolean;
|
|
42
|
+
bundle?: boolean;
|
|
43
|
+
launch?: boolean;
|
|
44
|
+
autolink?: boolean;
|
|
45
|
+
build?: boolean;
|
|
46
|
+
deploy?: boolean;
|
|
47
|
+
deployFromLayout?: boolean;
|
|
45
48
|
sln?: string;
|
|
46
49
|
proj?: string;
|
|
47
50
|
msbuildprops?: string;
|
|
48
51
|
buildLogDirectory?: string;
|
|
49
|
-
info
|
|
52
|
+
info?: boolean;
|
|
50
53
|
directDebugging?: number;
|
|
54
|
+
telemetry?: boolean;
|
|
51
55
|
}
|
|
52
56
|
export declare const runWindowsOptions: CommandOption[];
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
* @format
|
|
6
6
|
*/
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
7
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
11
|
exports.runWindowsOptions = void 0;
|
|
12
|
+
const os_1 = __importDefault(require("os"));
|
|
9
13
|
exports.runWindowsOptions = [
|
|
10
14
|
{
|
|
11
15
|
name: '--release',
|
|
@@ -18,8 +22,8 @@ exports.runWindowsOptions = [
|
|
|
18
22
|
},
|
|
19
23
|
{
|
|
20
24
|
name: '--arch [string]',
|
|
21
|
-
description: 'The build architecture (
|
|
22
|
-
default:
|
|
25
|
+
description: 'The build architecture (ARM64, x86, x64)',
|
|
26
|
+
default: os_1.default.arch(),
|
|
23
27
|
parse: parseBuildArch,
|
|
24
28
|
},
|
|
25
29
|
{
|
|
@@ -45,37 +49,34 @@ exports.runWindowsOptions = [
|
|
|
45
49
|
{
|
|
46
50
|
name: '--logging',
|
|
47
51
|
description: 'Enables logging',
|
|
48
|
-
default: false,
|
|
49
52
|
},
|
|
50
53
|
{
|
|
51
54
|
name: '--no-packager',
|
|
52
55
|
description: 'Do not launch packager while building',
|
|
53
|
-
default: false,
|
|
54
56
|
},
|
|
55
57
|
{
|
|
56
58
|
name: '--bundle',
|
|
57
59
|
description: 'Enable Bundle configuration and it would be ReleaseBundle/DebugBundle other than Release/Debug',
|
|
58
|
-
default: false,
|
|
59
60
|
},
|
|
60
61
|
{
|
|
61
62
|
name: '--no-launch',
|
|
62
63
|
description: 'Do not launch the app after deployment',
|
|
63
|
-
default: false,
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
name: '--no-autolink',
|
|
67
67
|
description: 'Do not run autolinking',
|
|
68
|
-
default: false,
|
|
69
68
|
},
|
|
70
69
|
{
|
|
71
70
|
name: '--no-build',
|
|
72
71
|
description: 'Do not build the solution',
|
|
73
|
-
default: false,
|
|
74
72
|
},
|
|
75
73
|
{
|
|
76
74
|
name: '--no-deploy',
|
|
77
75
|
description: 'Do not deploy the app',
|
|
78
|
-
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: '--deploy-from-layout',
|
|
79
|
+
description: 'Force deploy from layout',
|
|
79
80
|
},
|
|
80
81
|
{
|
|
81
82
|
name: '--sln [string]',
|
|
@@ -98,16 +99,19 @@ exports.runWindowsOptions = [
|
|
|
98
99
|
{
|
|
99
100
|
name: '--info',
|
|
100
101
|
description: 'Dump environment information',
|
|
101
|
-
default: false,
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
name: '--direct-debugging [number]',
|
|
105
105
|
description: 'Enable direct debugging on specified port',
|
|
106
106
|
parse: parseDirectDebuggingPort,
|
|
107
107
|
},
|
|
108
|
+
{
|
|
109
|
+
name: '--no-telemetry',
|
|
110
|
+
description: 'Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI',
|
|
111
|
+
},
|
|
108
112
|
];
|
|
109
113
|
function parseBuildArch(arg) {
|
|
110
|
-
const supportedArches = ['x86', 'x64', 'ARM64'
|
|
114
|
+
const supportedArches = ['x86', 'x64', 'ARM64'];
|
|
111
115
|
for (const supported of supportedArches) {
|
|
112
116
|
if (arg.toLowerCase() === supported.toLowerCase()) {
|
|
113
117
|
return supported;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runWindowsOptions.js","sourceRoot":"","sources":["../../src/runWindows/runWindowsOptions.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"runWindowsOptions.js","sourceRoot":"","sources":["../../src/runWindows/runWindowsOptions.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport os from 'os';\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: os.arch(),\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 },\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 },\n {\n name: '--no-launch',\n description: 'Do not launch the app after deployment',\n },\n {\n name: '--no-autolink',\n description: 'Do not run autolinking',\n },\n {\n name: '--no-build',\n description: 'Do not build the solution',\n },\n {\n name: '--no-deploy',\n description: 'Do not deploy the app',\n },\n {\n name: '--deploy-from-layout',\n description: 'Force deploy from layout',\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 },\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 },\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"]}
|
|
@@ -3,5 +3,92 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
* @format
|
|
5
5
|
*/
|
|
6
|
-
import { Command } from '@react-native-community/cli-types';
|
|
6
|
+
import { Command, CommandOption, Config, Dependency, ProjectConfig } from '@react-native-community/cli-types';
|
|
7
|
+
import { WindowsProjectConfig } from '../../config/projectConfig';
|
|
8
|
+
import { Ora } from 'ora';
|
|
9
|
+
export declare class AutolinkWindows {
|
|
10
|
+
readonly projectConfig: ProjectConfig;
|
|
11
|
+
readonly dependenciesConfig: {
|
|
12
|
+
[key: string]: Dependency;
|
|
13
|
+
};
|
|
14
|
+
readonly options: AutoLinkOptions;
|
|
15
|
+
private changesNecessary;
|
|
16
|
+
protected windowsAppConfig: WindowsProjectConfig;
|
|
17
|
+
areChangesNeeded(): boolean;
|
|
18
|
+
private getWindowsConfig;
|
|
19
|
+
private getSolutionFile;
|
|
20
|
+
constructor(projectConfig: ProjectConfig, dependenciesConfig: {
|
|
21
|
+
[key: string]: Dependency;
|
|
22
|
+
}, options: AutoLinkOptions);
|
|
23
|
+
run(spinner: Ora): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Handles the --proj command-line option by consuming its value into the windowsAppConfig
|
|
26
|
+
*/
|
|
27
|
+
fixUpForProjOption(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Handles the --sln command-line option by consuming its value into the windowsAppConfig
|
|
30
|
+
*/
|
|
31
|
+
fixUpForSlnOption(): void;
|
|
32
|
+
/** Validates the all of the required app (solution) properties are present and valid */
|
|
33
|
+
validateRequiredAppProperties(): void;
|
|
34
|
+
/** @return the full path to the project file (.vcxproj or .csproj) */
|
|
35
|
+
private getProjectFile;
|
|
36
|
+
/** Validates that all of the required app _project_ properties are present and valid */
|
|
37
|
+
validateRequiredProjectProperties(): void;
|
|
38
|
+
private generateCppAutolinking;
|
|
39
|
+
getCppReplacements(): {
|
|
40
|
+
cppPackageProviders: string;
|
|
41
|
+
cppIncludes: string;
|
|
42
|
+
};
|
|
43
|
+
private generateCSAutolinking;
|
|
44
|
+
getCsReplacements(): {
|
|
45
|
+
csUsingNamespaces: string;
|
|
46
|
+
csReactPackageProviders: string;
|
|
47
|
+
};
|
|
48
|
+
/** Cache of dependencies */
|
|
49
|
+
private windowsDependencies;
|
|
50
|
+
private getWindowsDependencies;
|
|
51
|
+
/**
|
|
52
|
+
* Updates the target file with the expected contents if it's different.
|
|
53
|
+
* @param filePath Path to the target file to update.
|
|
54
|
+
* @param expectedContents The expected contents of the file.
|
|
55
|
+
* @return Whether any changes were necessary.
|
|
56
|
+
*/
|
|
57
|
+
protected updateFile(filePath: string, expectedContents: string): Promise<boolean>;
|
|
58
|
+
private generateAutolinkTargets;
|
|
59
|
+
private generateAutolinkProps;
|
|
60
|
+
private getCSModules;
|
|
61
|
+
private updateSolution;
|
|
62
|
+
protected getExperimentalFeaturesPropsXml(): {
|
|
63
|
+
path: string;
|
|
64
|
+
content: Document;
|
|
65
|
+
} | undefined;
|
|
66
|
+
ensureXAMLDialect(): Promise<boolean>;
|
|
67
|
+
protected getPackagesConfigXml(): {
|
|
68
|
+
path: string;
|
|
69
|
+
content: Document;
|
|
70
|
+
} | undefined;
|
|
71
|
+
private updatePackagesConfigXAMLDialect;
|
|
72
|
+
private updatePackagesConfig;
|
|
73
|
+
/** @return The CLI command to invoke autolink-windows independently */
|
|
74
|
+
getAutolinkWindowsCommand(): string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Performs auto-linking for RNW native modules and apps.
|
|
78
|
+
* @param args Unprocessed args passed from react-native CLI.
|
|
79
|
+
* @param config Config passed from react-native CLI.
|
|
80
|
+
* @param options Options passed from react-native CLI.
|
|
81
|
+
*/
|
|
82
|
+
export declare function autolinkWindowsInternal(args: string[], config: Config, options: AutoLinkOptions): Promise<void>;
|
|
83
|
+
export interface AutoLinkOptions {
|
|
84
|
+
logging?: boolean;
|
|
85
|
+
check?: boolean;
|
|
86
|
+
sln?: string;
|
|
87
|
+
proj?: string;
|
|
88
|
+
telemetry?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export declare const autolinkOptions: CommandOption[];
|
|
91
|
+
/**
|
|
92
|
+
* Performs auto-linking for RNW native modules and apps.
|
|
93
|
+
*/
|
|
7
94
|
export declare const autoLinkCommand: Command;
|