@rnx-kit/cli 0.18.14 → 0.18.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/build/android.d.ts +1 -1
- package/lib/build/android.js +2 -2
- package/lib/build/apple.d.ts +1 -1
- package/lib/build/apple.js +2 -2
- package/lib/build/ios.d.ts +2 -2
- package/lib/build/ios.js +6 -2
- package/lib/build/macos.d.ts +2 -2
- package/lib/build/macos.js +19 -14
- package/lib/build/types.d.ts +11 -1
- package/lib/build/windows.d.ts +11 -0
- package/lib/build/windows.js +116 -0
- package/lib/build.d.ts +4 -4
- package/lib/build.js +20 -12
- package/lib/run/android.d.ts +1 -1
- package/lib/run/android.js +2 -2
- package/lib/run/ios.d.ts +1 -1
- package/lib/run/ios.js +2 -2
- package/lib/run/macos.d.ts +1 -1
- package/lib/run/macos.js +2 -2
- package/lib/run/windows.d.ts +6 -0
- package/lib/run/windows.js +13 -0
- package/lib/run.d.ts +6 -6
- package/lib/run.js +13 -10
- package/lib/serve/keyboard.js +1 -1
- package/lib/start.js +9 -2
- package/package.json +4 -3
package/lib/build/android.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from "@react-native-community/cli-types";
|
|
2
2
|
import ora from "ora";
|
|
3
|
-
import type { AndroidBuildParams } from "./types";
|
|
3
|
+
import type { AndroidBuildParams } from "./types.ts";
|
|
4
4
|
export type BuildResult = string | number | null;
|
|
5
5
|
export declare function buildAndroid(config: Config, buildParams: AndroidBuildParams, additionalArgs: string[], logger?: ora.Ora): Promise<BuildResult>;
|
|
6
6
|
//# sourceMappingURL=android.d.ts.map
|
package/lib/build/android.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.buildAndroid = buildAndroid;
|
|
7
7
|
const cache_1 = require("@rnx-kit/tools-react-native/cache");
|
|
8
8
|
const ora_1 = __importDefault(require("ora"));
|
|
9
|
-
const
|
|
9
|
+
const watcher_ts_1 = require("./watcher.js");
|
|
10
10
|
function buildAndroid(config, buildParams, additionalArgs, logger = (0, ora_1.default)()) {
|
|
11
11
|
const { sourceDir } = config.project.android ?? {};
|
|
12
12
|
if (!sourceDir) {
|
|
@@ -17,7 +17,7 @@ function buildAndroid(config, buildParams, additionalArgs, logger = (0, ora_1.de
|
|
|
17
17
|
}
|
|
18
18
|
return import("@rnx-kit/tools-android").then(({ assemble }) => {
|
|
19
19
|
const gradle = assemble(sourceDir, buildParams, additionalArgs);
|
|
20
|
-
return (0,
|
|
20
|
+
return (0, watcher_ts_1.watch)(gradle, logger, () => sourceDir);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=android.js.map
|
package/lib/build/apple.d.ts
CHANGED
package/lib/build/apple.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runBuild = runBuild;
|
|
4
|
-
const
|
|
4
|
+
const watcher_ts_1 = require("./watcher.js");
|
|
5
5
|
function runBuild(xcworkspace, buildParams, logger) {
|
|
6
6
|
return import("@rnx-kit/tools-apple").then(({ checkPodsManifestLock, xcodebuild }) => {
|
|
7
7
|
if (!checkPodsManifestLock(xcworkspace)) {
|
|
@@ -10,7 +10,7 @@ function runBuild(xcworkspace, buildParams, logger) {
|
|
|
10
10
|
}
|
|
11
11
|
const log = (message) => logger.info(message);
|
|
12
12
|
const build = xcodebuild(xcworkspace, buildParams, log);
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, watcher_ts_1.watch)(build, logger, () => ({
|
|
14
14
|
xcworkspace,
|
|
15
15
|
args: build.spawnargs,
|
|
16
16
|
}));
|
package/lib/build/ios.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from "@react-native-community/cli-types";
|
|
2
2
|
import ora from "ora";
|
|
3
|
-
import type { BuildResult } from "./apple";
|
|
4
|
-
import type { AppleInputParams } from "./types";
|
|
3
|
+
import type { BuildResult } from "./apple.ts";
|
|
4
|
+
import type { AppleInputParams } from "./types.ts";
|
|
5
5
|
export declare function buildIOS(config: Config, buildParams: AppleInputParams, logger?: ora.Ora): Promise<BuildResult>;
|
|
6
6
|
//# sourceMappingURL=ios.d.ts.map
|
package/lib/build/ios.js
CHANGED
|
@@ -40,9 +40,13 @@ exports.buildIOS = buildIOS;
|
|
|
40
40
|
const cache_1 = require("@rnx-kit/tools-react-native/cache");
|
|
41
41
|
const path = __importStar(require("node:path"));
|
|
42
42
|
const ora_1 = __importDefault(require("ora"));
|
|
43
|
-
const
|
|
43
|
+
const apple_ts_1 = require("./apple.js");
|
|
44
44
|
function buildIOS(config, buildParams, logger = (0, ora_1.default)()) {
|
|
45
45
|
const { platform } = buildParams;
|
|
46
|
+
if (process.platform !== "darwin") {
|
|
47
|
+
logger.fail(`${platform} builds can only be performed on macOS hosts`);
|
|
48
|
+
return Promise.resolve(1);
|
|
49
|
+
}
|
|
46
50
|
const { sourceDir, xcodeProject } = config.project[platform] ?? {};
|
|
47
51
|
if (!sourceDir || !xcodeProject) {
|
|
48
52
|
(0, cache_1.invalidateState)();
|
|
@@ -61,6 +65,6 @@ function buildIOS(config, buildParams, logger = (0, ora_1.default)()) {
|
|
|
61
65
|
const xcworkspace = projectDir
|
|
62
66
|
? path.resolve(sourceDir, projectDir, name)
|
|
63
67
|
: path.resolve(sourceDir, name);
|
|
64
|
-
return (0,
|
|
68
|
+
return (0, apple_ts_1.runBuild)(xcworkspace, buildParams, logger);
|
|
65
69
|
}
|
|
66
70
|
//# sourceMappingURL=ios.js.map
|
package/lib/build/macos.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from "@react-native-community/cli-types";
|
|
2
2
|
import ora from "ora";
|
|
3
|
-
import type { BuildResult } from "./apple";
|
|
4
|
-
import type { AppleInputParams } from "./types";
|
|
3
|
+
import type { BuildResult } from "./apple.ts";
|
|
4
|
+
import type { AppleInputParams } from "./types.ts";
|
|
5
5
|
export declare function buildMacOS(_config: Config, { workspace, ...buildParams }: AppleInputParams, logger?: ora.Ora): Promise<BuildResult>;
|
|
6
6
|
//# sourceMappingURL=macos.d.ts.map
|
package/lib/build/macos.js
CHANGED
|
@@ -41,28 +41,33 @@ const cache_1 = require("@rnx-kit/tools-react-native/cache");
|
|
|
41
41
|
const fs = __importStar(require("node:fs"));
|
|
42
42
|
const path = __importStar(require("node:path"));
|
|
43
43
|
const ora_1 = __importDefault(require("ora"));
|
|
44
|
-
const
|
|
45
|
-
function findXcodeWorkspaces(searchDir) {
|
|
46
|
-
|
|
44
|
+
const apple_ts_1 = require("./apple.js");
|
|
45
|
+
function findXcodeWorkspaces(searchDir, logger) {
|
|
46
|
+
const workspaces = fs.existsSync(searchDir)
|
|
47
47
|
? fs.readdirSync(searchDir).filter((file) => file.endsWith(".xcworkspace"))
|
|
48
48
|
: [];
|
|
49
|
-
}
|
|
50
|
-
function buildMacOS(_config, { workspace, ...buildParams }, logger = (0, ora_1.default)()) {
|
|
51
|
-
if (workspace) {
|
|
52
|
-
return (0, apple_1.runBuild)(workspace, buildParams, logger);
|
|
53
|
-
}
|
|
54
|
-
const sourceDir = "macos";
|
|
55
|
-
const workspaces = findXcodeWorkspaces(sourceDir);
|
|
56
49
|
if (workspaces.length === 0) {
|
|
57
50
|
(0, cache_1.invalidateState)();
|
|
58
51
|
process.exitCode = 1;
|
|
59
52
|
logger.fail("No Xcode workspaces were found; specify an Xcode workspace with `--workspace`");
|
|
60
|
-
return
|
|
53
|
+
return undefined;
|
|
61
54
|
}
|
|
62
55
|
if (workspaces.length > 1) {
|
|
63
|
-
logger.
|
|
64
|
-
logger.
|
|
56
|
+
logger.info(`Multiple Xcode workspaces were found; picking the first one: ${workspaces.join(", ")}`);
|
|
57
|
+
logger.info("If this is wrong, specify another workspace with `--workspace`");
|
|
58
|
+
}
|
|
59
|
+
return path.join(searchDir, workspaces[0]);
|
|
60
|
+
}
|
|
61
|
+
function buildMacOS(_config, { workspace, ...buildParams }, logger = (0, ora_1.default)()) {
|
|
62
|
+
if (process.platform !== "darwin") {
|
|
63
|
+
logger.fail("macOS builds can only be performed on macOS hosts");
|
|
64
|
+
return Promise.resolve(1);
|
|
65
|
+
}
|
|
66
|
+
const sourceDir = "macos";
|
|
67
|
+
const xcworkspace = workspace || findXcodeWorkspaces(sourceDir, logger);
|
|
68
|
+
if (!xcworkspace) {
|
|
69
|
+
return Promise.resolve(1);
|
|
65
70
|
}
|
|
66
|
-
return (0,
|
|
71
|
+
return (0, apple_ts_1.runBuild)(xcworkspace, buildParams, logger);
|
|
67
72
|
}
|
|
68
73
|
//# sourceMappingURL=macos.js.map
|
package/lib/build/types.d.ts
CHANGED
|
@@ -38,5 +38,15 @@ export type AppleInputParams = AppleBuildParams & {
|
|
|
38
38
|
device?: string;
|
|
39
39
|
workspace?: string;
|
|
40
40
|
};
|
|
41
|
-
export type
|
|
41
|
+
export type WindowsBuildParams = {
|
|
42
|
+
platform: "windows";
|
|
43
|
+
configuration?: BuildConfiguration;
|
|
44
|
+
architecture?: "arm64" | "x64";
|
|
45
|
+
launch?: boolean;
|
|
46
|
+
deploy?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type WindowsInputParams = WindowsBuildParams & {
|
|
49
|
+
solution?: string;
|
|
50
|
+
};
|
|
51
|
+
export type InputParams = AndroidInputParams | AppleInputParams | WindowsInputParams;
|
|
42
52
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Command, Config } from "@react-native-community/cli-types";
|
|
2
|
+
import ora from "ora";
|
|
3
|
+
import type { WindowsInputParams } from "./types.ts";
|
|
4
|
+
export type BuildArgs = {
|
|
5
|
+
solution: string;
|
|
6
|
+
args: string[];
|
|
7
|
+
};
|
|
8
|
+
export type BuildResult = BuildArgs | number | null;
|
|
9
|
+
export declare function runWindowsCommand(config: Config, params: WindowsInputParams, logger: ora.Ora, callback: (solution: string, run: Command["func"], options: Record<string, unknown>) => Promise<BuildResult>): Promise<BuildResult>;
|
|
10
|
+
export declare function buildWindows(config: Config, params: WindowsInputParams, additionalArgs: string[], logger?: ora.Ora): Promise<BuildResult>;
|
|
11
|
+
//# sourceMappingURL=windows.d.ts.map
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.runWindowsCommand = runWindowsCommand;
|
|
40
|
+
exports.buildWindows = buildWindows;
|
|
41
|
+
const cache_1 = require("@rnx-kit/tools-react-native/cache");
|
|
42
|
+
const fs = __importStar(require("node:fs"));
|
|
43
|
+
const os = __importStar(require("node:os"));
|
|
44
|
+
const path = __importStar(require("node:path"));
|
|
45
|
+
const ora_1 = __importDefault(require("ora"));
|
|
46
|
+
function findRunCommand(startDir) {
|
|
47
|
+
try {
|
|
48
|
+
const fromProjectRoot = { paths: [startDir] };
|
|
49
|
+
const rnwPath = require.resolve("react-native-windows/package.json", fromProjectRoot);
|
|
50
|
+
const fromRnwDir = { paths: [path.dirname(rnwPath)] };
|
|
51
|
+
const cliPath = require.resolve("@react-native-windows/cli", fromRnwDir);
|
|
52
|
+
const cli = require(cliPath);
|
|
53
|
+
return cli.commands.find((cmd) => cmd.name === "run-windows");
|
|
54
|
+
}
|
|
55
|
+
catch (_) {
|
|
56
|
+
// Handled by caller
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
function findSolution(searchDir, logger) {
|
|
61
|
+
const solutions = fs.existsSync(searchDir)
|
|
62
|
+
? fs.readdirSync(searchDir).filter((file) => file.endsWith(".sln"))
|
|
63
|
+
: [];
|
|
64
|
+
if (solutions.length === 0) {
|
|
65
|
+
(0, cache_1.invalidateState)();
|
|
66
|
+
process.exitCode = 1;
|
|
67
|
+
logger.fail("No Visual Studio solutions were found; specify a Visual Studio solution with `--solution`");
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
if (solutions.length > 1) {
|
|
71
|
+
logger.info(`Multiple Visual Studio solutions were found; picking the first one: ${solutions.join(", ")}`);
|
|
72
|
+
logger.info("If this is wrong, specify another solution with `--solution`");
|
|
73
|
+
}
|
|
74
|
+
return path.join(searchDir, solutions[0]);
|
|
75
|
+
}
|
|
76
|
+
function toRunWindowsOptions(sln, { root }, { configuration, architecture, launch, deploy }) {
|
|
77
|
+
return {
|
|
78
|
+
release: configuration === "Release",
|
|
79
|
+
root,
|
|
80
|
+
arch: architecture ?? os.arch(),
|
|
81
|
+
packager: false,
|
|
82
|
+
bundle: false,
|
|
83
|
+
launch: Boolean(launch),
|
|
84
|
+
autolink: true,
|
|
85
|
+
build: true,
|
|
86
|
+
deploy: Boolean(deploy),
|
|
87
|
+
sln,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function runWindowsCommand(config, params, logger, callback) {
|
|
91
|
+
if (process.platform !== "win32") {
|
|
92
|
+
logger.fail("Windows builds can only be performed on Windows hosts");
|
|
93
|
+
return Promise.resolve(1);
|
|
94
|
+
}
|
|
95
|
+
const sourceDir = "windows";
|
|
96
|
+
const solution = params.solution || findSolution(sourceDir, logger);
|
|
97
|
+
if (!solution) {
|
|
98
|
+
return Promise.resolve(1);
|
|
99
|
+
}
|
|
100
|
+
const runCommand = findRunCommand(config.root);
|
|
101
|
+
if (!runCommand) {
|
|
102
|
+
logger.fail("Failed to find `@react-native-windows/cli`, make sure `react-native-windows` is installed.");
|
|
103
|
+
return Promise.resolve(1);
|
|
104
|
+
}
|
|
105
|
+
const options = toRunWindowsOptions(solution, config, params);
|
|
106
|
+
return callback(solution, runCommand.func, options);
|
|
107
|
+
}
|
|
108
|
+
function buildWindows(config, params, additionalArgs, logger = (0, ora_1.default)()) {
|
|
109
|
+
return runWindowsCommand(config, params, logger, (solution, run, options) => {
|
|
110
|
+
const build = run(additionalArgs, config, options);
|
|
111
|
+
return build
|
|
112
|
+
? build.then(() => ({ solution, args: additionalArgs }))
|
|
113
|
+
: Promise.resolve(1);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=windows.js.map
|
package/lib/build.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Config } from "@react-native-community/cli-types";
|
|
2
|
-
import { RNX_FAST_PATH } from "./bin/constants";
|
|
3
|
-
import { setCcacheDir } from "./build/ccache";
|
|
4
|
-
import type { BuildConfiguration, DeviceType, InputParams } from "./build/types";
|
|
2
|
+
import { RNX_FAST_PATH } from "./bin/constants.ts";
|
|
3
|
+
import { setCcacheDir } from "./build/ccache.ts";
|
|
4
|
+
import type { BuildConfiguration, DeviceType, InputParams } from "./build/types.ts";
|
|
5
5
|
declare function asConfiguration(configuration: string): BuildConfiguration;
|
|
6
6
|
declare function asDestination(destination: string): DeviceType;
|
|
7
|
-
export declare function rnxBuild(argv: string[], config: Config, buildParams: InputParams): Promise<import("./build/android").BuildResult> | Promise<import("./build/apple").BuildResult>;
|
|
7
|
+
export declare function rnxBuild(argv: string[], config: Config, buildParams: InputParams): Promise<import("./build/android.ts").BuildResult> | Promise<import("./build/apple.ts").BuildResult> | Promise<import("./build/windows.ts").BuildResult>;
|
|
8
8
|
export declare const rnxBuildCommand: {
|
|
9
9
|
[RNX_FAST_PATH]: boolean;
|
|
10
10
|
name: string;
|
package/lib/build.js
CHANGED
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.rnxBuildCommand = void 0;
|
|
4
4
|
exports.rnxBuild = rnxBuild;
|
|
5
5
|
const commander_1 = require("commander");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
6
|
+
const constants_ts_1 = require("./bin/constants.js");
|
|
7
|
+
const android_ts_1 = require("./build/android.js");
|
|
8
|
+
const ccache_ts_1 = require("./build/ccache.js");
|
|
9
|
+
const ios_ts_1 = require("./build/ios.js");
|
|
10
|
+
const macos_ts_1 = require("./build/macos.js");
|
|
11
|
+
const windows_ts_1 = require("./build/windows.js");
|
|
11
12
|
function asConfiguration(configuration) {
|
|
12
13
|
switch (configuration) {
|
|
13
14
|
case "Debug":
|
|
@@ -33,26 +34,29 @@ function asSupportedPlatform(platform) {
|
|
|
33
34
|
case "ios":
|
|
34
35
|
case "macos":
|
|
35
36
|
case "visionos":
|
|
37
|
+
case "windows":
|
|
36
38
|
return platform;
|
|
37
39
|
default:
|
|
38
|
-
throw new commander_1.InvalidArgumentError("Supported platforms: 'android', 'ios', 'macos', 'visionos'.");
|
|
40
|
+
throw new commander_1.InvalidArgumentError("Supported platforms: 'android', 'ios', 'macos', 'visionos', 'windows'.");
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
function rnxBuild(argv, config, buildParams) {
|
|
42
44
|
switch (buildParams.platform) {
|
|
43
45
|
case "android":
|
|
44
|
-
return (0,
|
|
46
|
+
return (0, android_ts_1.buildAndroid)(config, buildParams, argv);
|
|
45
47
|
case "ios":
|
|
46
48
|
case "visionos":
|
|
47
|
-
return (0,
|
|
49
|
+
return (0, ios_ts_1.buildIOS)(config, buildParams);
|
|
48
50
|
case "macos":
|
|
49
|
-
return (0,
|
|
51
|
+
return (0, macos_ts_1.buildMacOS)(config, buildParams);
|
|
52
|
+
case "windows":
|
|
53
|
+
return (0, windows_ts_1.buildWindows)(config, buildParams, argv);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
exports.rnxBuildCommand = {
|
|
53
57
|
// The build command requires the `project` field, which currently requires
|
|
54
58
|
// loading the full config.
|
|
55
|
-
[
|
|
59
|
+
[constants_ts_1.RNX_FAST_PATH]: false,
|
|
56
60
|
name: "rnx-build",
|
|
57
61
|
description: "Build your native app for testing in emulator/simulator or on device",
|
|
58
62
|
func: rnxBuild,
|
|
@@ -62,6 +66,10 @@ exports.rnxBuildCommand = {
|
|
|
62
66
|
description: "Target platform",
|
|
63
67
|
parse: asSupportedPlatform,
|
|
64
68
|
},
|
|
69
|
+
{
|
|
70
|
+
name: "--solution <string>",
|
|
71
|
+
description: "Path, relative to project root, of the Visual Studio solution to build (Windows only)",
|
|
72
|
+
},
|
|
65
73
|
{
|
|
66
74
|
name: "--workspace <string>",
|
|
67
75
|
description: "Path, relative to project root, of the Xcode workspace to build (macOS only)",
|
|
@@ -85,12 +93,12 @@ exports.rnxBuildCommand = {
|
|
|
85
93
|
{
|
|
86
94
|
name: "--ccache-dir <string>",
|
|
87
95
|
description: "Path to Ccache config",
|
|
88
|
-
parse:
|
|
96
|
+
parse: ccache_ts_1.setCcacheDir,
|
|
89
97
|
},
|
|
90
98
|
{
|
|
91
99
|
name: "--ccache-home <string>",
|
|
92
100
|
description: "Path to Ccache installation",
|
|
93
|
-
parse:
|
|
101
|
+
parse: ccache_ts_1.setCcacheHome,
|
|
94
102
|
},
|
|
95
103
|
],
|
|
96
104
|
};
|
package/lib/run/android.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Config } from "@react-native-community/cli-types";
|
|
2
|
-
import type { AndroidInputParams } from "../build/types";
|
|
2
|
+
import type { AndroidInputParams } from "../build/types.ts";
|
|
3
3
|
export declare function runAndroid(config: Config, buildParams: AndroidInputParams, additionalArgs: string[]): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=android.d.ts.map
|
package/lib/run/android.js
CHANGED
|
@@ -39,10 +39,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.runAndroid = runAndroid;
|
|
40
40
|
const path = __importStar(require("node:path"));
|
|
41
41
|
const ora_1 = __importDefault(require("ora"));
|
|
42
|
-
const
|
|
42
|
+
const android_ts_1 = require("../build/android.js");
|
|
43
43
|
async function runAndroid(config, buildParams, additionalArgs) {
|
|
44
44
|
const logger = (0, ora_1.default)();
|
|
45
|
-
const projectDir = await (0,
|
|
45
|
+
const projectDir = await (0, android_ts_1.buildAndroid)(config, buildParams, additionalArgs, logger);
|
|
46
46
|
if (typeof projectDir !== "string") {
|
|
47
47
|
return;
|
|
48
48
|
}
|
package/lib/run/ios.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Config } from "@react-native-community/cli-types";
|
|
2
|
-
import type { InputParams } from "../build/types";
|
|
2
|
+
import type { InputParams } from "../build/types.ts";
|
|
3
3
|
export declare function runIOS(config: Config, buildParams: InputParams): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=ios.d.ts.map
|
package/lib/run/ios.js
CHANGED
|
@@ -39,14 +39,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.runIOS = runIOS;
|
|
40
40
|
const path = __importStar(require("node:path"));
|
|
41
41
|
const ora_1 = __importDefault(require("ora"));
|
|
42
|
-
const
|
|
42
|
+
const ios_ts_1 = require("../build/ios.js");
|
|
43
43
|
async function runIOS(config, buildParams) {
|
|
44
44
|
const { platform } = buildParams;
|
|
45
45
|
if (platform !== "ios" && platform !== "visionos") {
|
|
46
46
|
throw new Error("Expected iOS/visionOS build configuration");
|
|
47
47
|
}
|
|
48
48
|
const logger = (0, ora_1.default)();
|
|
49
|
-
const result = await (0,
|
|
49
|
+
const result = await (0, ios_ts_1.buildIOS)(config, buildParams, logger);
|
|
50
50
|
if (!result || typeof result !== "object") {
|
|
51
51
|
return;
|
|
52
52
|
}
|
package/lib/run/macos.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Config } from "@react-native-community/cli-types";
|
|
2
|
-
import type { AppleInputParams } from "../build/types";
|
|
2
|
+
import type { AppleInputParams } from "../build/types.ts";
|
|
3
3
|
export declare function runMacOS(config: Config, buildParams: AppleInputParams): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=macos.d.ts.map
|
package/lib/run/macos.js
CHANGED
|
@@ -39,10 +39,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.runMacOS = runMacOS;
|
|
40
40
|
const path = __importStar(require("node:path"));
|
|
41
41
|
const ora_1 = __importDefault(require("ora"));
|
|
42
|
-
const
|
|
42
|
+
const macos_ts_1 = require("../build/macos.js");
|
|
43
43
|
async function runMacOS(config, buildParams) {
|
|
44
44
|
const logger = (0, ora_1.default)();
|
|
45
|
-
const result = await (0,
|
|
45
|
+
const result = await (0, macos_ts_1.buildMacOS)(config, buildParams, logger);
|
|
46
46
|
if (!result || typeof result !== "object") {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Config } from "@react-native-community/cli-types";
|
|
2
|
+
import ora from "ora";
|
|
3
|
+
import type { WindowsInputParams } from "../build/types.ts";
|
|
4
|
+
import type { BuildResult } from "../build/windows.ts";
|
|
5
|
+
export declare function runWindows(config: Config, params: WindowsInputParams, additionalArgs: string[], logger?: ora.Ora): Promise<BuildResult>;
|
|
6
|
+
//# sourceMappingURL=windows.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runWindows = runWindows;
|
|
7
|
+
const ora_1 = __importDefault(require("ora"));
|
|
8
|
+
const windows_ts_1 = require("../build/windows.js");
|
|
9
|
+
function runWindows(config, params, additionalArgs, logger = (0, ora_1.default)()) {
|
|
10
|
+
const runParams = { ...params, launch: true, deploy: true };
|
|
11
|
+
return (0, windows_ts_1.buildWindows)(config, runParams, additionalArgs, logger);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=windows.js.map
|
package/lib/run.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Config } from "@react-native-community/cli-types";
|
|
2
|
-
import { RNX_FAST_PATH } from "./bin/constants";
|
|
3
|
-
import type { InputParams } from "./build/types";
|
|
4
|
-
export declare function rnxRun(argv: string[], config: Config, buildParams: InputParams): Promise<void>;
|
|
2
|
+
import { RNX_FAST_PATH } from "./bin/constants.ts";
|
|
3
|
+
import type { InputParams } from "./build/types.ts";
|
|
4
|
+
export declare function rnxRun(argv: string[], config: Config, buildParams: InputParams): Promise<import("./build/windows.ts").BuildResult> | Promise<void>;
|
|
5
5
|
export declare const rnxRunCommand: {
|
|
6
6
|
[RNX_FAST_PATH]: boolean;
|
|
7
7
|
name: string;
|
|
@@ -16,16 +16,16 @@ export declare const rnxRunCommand: {
|
|
|
16
16
|
name: string;
|
|
17
17
|
description: string;
|
|
18
18
|
default: string;
|
|
19
|
-
parse: (configuration: string) => import("./build/types").BuildConfiguration;
|
|
19
|
+
parse: (configuration: string) => import("./build/types.ts").BuildConfiguration;
|
|
20
20
|
} | {
|
|
21
21
|
name: string;
|
|
22
22
|
description: string;
|
|
23
23
|
default: string;
|
|
24
|
-
parse: (destination: string) => import("./build/types").DeviceType;
|
|
24
|
+
parse: (destination: string) => import("./build/types.ts").DeviceType;
|
|
25
25
|
} | {
|
|
26
26
|
name: string;
|
|
27
27
|
description: string;
|
|
28
|
-
parse: typeof import("./build/ccache").setCcacheDir;
|
|
28
|
+
parse: typeof import("./build/ccache.ts").setCcacheDir;
|
|
29
29
|
default?: undefined;
|
|
30
30
|
})[];
|
|
31
31
|
};
|
package/lib/run.js
CHANGED
|
@@ -2,31 +2,34 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rnxRunCommand = void 0;
|
|
4
4
|
exports.rnxRun = rnxRun;
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
const constants_ts_1 = require("./bin/constants.js");
|
|
6
|
+
const build_ts_1 = require("./build.js");
|
|
7
|
+
const android_ts_1 = require("./run/android.js");
|
|
8
|
+
const ios_ts_1 = require("./run/ios.js");
|
|
9
|
+
const macos_ts_1 = require("./run/macos.js");
|
|
10
|
+
const windows_ts_1 = require("./run/windows.js");
|
|
10
11
|
function rnxRun(argv, config, buildParams) {
|
|
11
12
|
switch (buildParams.platform) {
|
|
12
13
|
case "android":
|
|
13
|
-
return (0,
|
|
14
|
+
return (0, android_ts_1.runAndroid)(config, buildParams, argv);
|
|
14
15
|
case "ios":
|
|
15
16
|
case "visionos":
|
|
16
|
-
return (0,
|
|
17
|
+
return (0, ios_ts_1.runIOS)(config, buildParams);
|
|
17
18
|
case "macos":
|
|
18
|
-
return (0,
|
|
19
|
+
return (0, macos_ts_1.runMacOS)(config, buildParams);
|
|
20
|
+
case "windows":
|
|
21
|
+
return (0, windows_ts_1.runWindows)(config, buildParams, argv);
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
exports.rnxRunCommand = {
|
|
22
25
|
// The run command may invoke the build command which currently requires
|
|
23
26
|
// loading the full config.
|
|
24
|
-
[
|
|
27
|
+
[constants_ts_1.RNX_FAST_PATH]: false,
|
|
25
28
|
name: "rnx-run",
|
|
26
29
|
description: "Build and run your native app for testing in emulator/simulator or on device",
|
|
27
30
|
func: rnxRun,
|
|
28
31
|
options: [
|
|
29
|
-
...
|
|
32
|
+
...build_ts_1.rnxBuildCommand.options,
|
|
30
33
|
{
|
|
31
34
|
name: "-d, --device <string>",
|
|
32
35
|
description: "The name of the device to launch the app in",
|
package/lib/serve/keyboard.js
CHANGED
|
@@ -69,7 +69,7 @@ function attachKeyHandlers(server, params) {
|
|
|
69
69
|
openDebuggerKeyboardHandler.dismiss();
|
|
70
70
|
process.stdin.pause();
|
|
71
71
|
process.stdin.setRawMode(false);
|
|
72
|
-
(0, console_1.info)("
|
|
72
|
+
(0, console_1.info)("Closing all connections...");
|
|
73
73
|
const httpServer = server.httpServer ?? server;
|
|
74
74
|
httpServer.close();
|
|
75
75
|
httpServer.closeAllConnections?.(); // This method was added in Node v18.2.0
|
package/lib/start.js
CHANGED
|
@@ -148,8 +148,15 @@ async function rnxStart(_argv, ctx, args) {
|
|
|
148
148
|
update(event) {
|
|
149
149
|
terminalReporter.update(event);
|
|
150
150
|
reportEventDelegate?.(event);
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
switch (event.type) {
|
|
152
|
+
case "dep_graph_loading":
|
|
153
|
+
if (interactive) {
|
|
154
|
+
help();
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
case "server_listening":
|
|
158
|
+
logger.info(`Dev server is listening on ${scheme}://${event.address}:${event.port}`);
|
|
159
|
+
break;
|
|
153
160
|
}
|
|
154
161
|
},
|
|
155
162
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnx-kit/cli",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.16",
|
|
4
4
|
"description": "Command-line interface for working with kit packages in your repo",
|
|
5
5
|
"homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/cli#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"test": "rnx-kit-scripts test"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@rnx-kit/align-deps": "^3.
|
|
43
|
+
"@rnx-kit/align-deps": "^3.3.3",
|
|
44
44
|
"@rnx-kit/config": "^0.7.0",
|
|
45
45
|
"@rnx-kit/console": "^2.0.0",
|
|
46
46
|
"@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^2.0.0",
|
|
47
47
|
"@rnx-kit/metro-plugin-duplicates-checker": "^3.0.0",
|
|
48
48
|
"@rnx-kit/metro-plugin-typescript": "^0.5.0",
|
|
49
49
|
"@rnx-kit/metro-serializer": "^2.0.0",
|
|
50
|
-
"@rnx-kit/metro-serializer-esbuild": "^0.2.
|
|
50
|
+
"@rnx-kit/metro-serializer-esbuild": "^0.2.7",
|
|
51
51
|
"@rnx-kit/metro-service": "^4.0.2",
|
|
52
52
|
"@rnx-kit/third-party-notices": "^2.0.0",
|
|
53
53
|
"@rnx-kit/tools-android": "^0.2.1",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"@babel/core": "^7.20.0",
|
|
77
77
|
"@babel/preset-env": "^7.20.0",
|
|
78
78
|
"@react-native-community/cli-types": "^20.0.0",
|
|
79
|
+
"@react-native-windows/cli": "^0.79.0",
|
|
79
80
|
"@rnx-kit/eslint-config": "*",
|
|
80
81
|
"@rnx-kit/jest-preset": "*",
|
|
81
82
|
"@rnx-kit/scripts": "*",
|