@rnx-kit/cli 0.18.17 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
  import type { ChildProcessWithoutNullStreams } from "node:child_process";
2
2
  import type { Ora } from "ora";
3
3
  export type ExitCode = number | null;
4
- export declare function watch<T>(subproc: ChildProcessWithoutNullStreams, logger: Ora, onSuccess: () => T): Promise<ExitCode | T>;
4
+ export declare function watch<T>(subproc: ChildProcessWithoutNullStreams, logger: Ora, onSuccess: () => T): Promise<T | ExitCode>;
5
5
  //# sourceMappingURL=watcher.d.ts.map
package/lib/build.d.ts CHANGED
@@ -4,7 +4,7 @@ import { setCcacheDir } from "./build/ccache.ts";
4
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.ts").BuildResult> | Promise<import("./build/apple.ts").BuildResult> | Promise<import("./build/windows.ts").BuildResult>;
7
+ export declare function rnxBuild(argv: string[], config: Config, buildParams: InputParams): Promise<import("./build/android.ts").BuildResult> | Promise<import("./build/apple").BuildResult> | Promise<import("./build/windows.ts").BuildResult>;
8
8
  export declare const rnxBuildCommand: {
9
9
  [RNX_FAST_PATH]: boolean;
10
10
  name: string;
@@ -26,10 +26,10 @@ export declare const rnxBuildCommand: {
26
26
  default: string;
27
27
  parse: typeof asDestination;
28
28
  } | {
29
+ default?: undefined;
29
30
  name: string;
30
31
  description: string;
31
32
  parse: typeof setCcacheDir;
32
- default?: undefined;
33
33
  })[];
34
34
  };
35
35
  export {};
@@ -3,8 +3,8 @@ import { asBoolean, asNumber, asTransformProfile } from "../helpers/parsers.ts";
3
3
  export declare const commonBundleCommandOptions: ({
4
4
  name: string;
5
5
  description: string;
6
- parse?: undefined;
7
6
  default?: undefined;
7
+ parse?: undefined;
8
8
  } | {
9
9
  name: string;
10
10
  description: string;
@@ -26,14 +26,14 @@ export declare const commonBundleCommandOptions: ({
26
26
  default: string;
27
27
  parse?: undefined;
28
28
  } | {
29
+ default?: undefined;
29
30
  name: string;
30
31
  description: string;
31
32
  parse: typeof asNumber;
32
- default?: undefined;
33
33
  } | {
34
+ default?: undefined;
34
35
  name: string;
35
36
  description: string;
36
37
  parse: typeof asTransformProfile;
37
- default?: undefined;
38
38
  })[];
39
39
  //# sourceMappingURL=cliOptions.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { BundleParameters } from "@rnx-kit/config";
1
+ import type { BundleParameters } from "@rnx-kit/types-bundle-config";
2
2
  type DefaultPlugins = Pick<Required<BundleParameters>, "plugins" | "treeShake">;
3
3
  export declare function getDefaultBundlerPlugins(): DefaultPlugins;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
- import type { HermesOptions } from "@rnx-kit/config";
2
+ import type { HermesOptions } from "@rnx-kit/types-bundle-config";
3
3
  export declare function emitBytecode(cliConfig: CLIConfig, input: string, sourcemap: string | undefined, options: HermesOptions): void;
4
4
  //# sourceMappingURL=hermes.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
1
+ import type { AllPlatforms } from "@rnx-kit/types-bundle-config";
2
2
  import type { CliPlatformBundleConfig } from "./types.ts";
3
3
  /**
4
4
  * Get the list of target platforms for bundling.
@@ -19,5 +19,5 @@ export declare function getTargetPlatforms(overridePlatform?: AllPlatforms, targ
19
19
  * @param overridePlatform Override platform, typically from the command-line. When given, this overrides the list of target platforms.
20
20
  * @returns Array of platform-specific bundle configurations
21
21
  */
22
- export declare function getCliPlatformBundleConfigs(id?: string, overridePlatform?: AllPlatforms, kitConfig?: import("@rnx-kit/config").KitConfig | undefined): CliPlatformBundleConfig[];
22
+ export declare function getCliPlatformBundleConfigs(id?: string, overridePlatform?: AllPlatforms, kitConfig?: import("@rnx-kit/types-kit-config").KitConfig | undefined): CliPlatformBundleConfig[];
23
23
  //# sourceMappingURL=kit-config.d.ts.map
@@ -1,6 +1,5 @@
1
- import type { BundleParameters } from "@rnx-kit/config";
2
1
  import type { BundleArgs } from "@rnx-kit/metro-service";
3
- import type { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
2
+ import type { AllPlatforms, BundleParameters } from "@rnx-kit/types-bundle-config";
4
3
  import type { TransformProfile } from "metro-babel-transformer";
5
4
  export type CLICommonBundleOptions = {
6
5
  id?: string;
package/lib/bundle.d.ts CHANGED
@@ -12,8 +12,8 @@ export declare const rnxBundleCommand: {
12
12
  options: ({
13
13
  name: string;
14
14
  description: string;
15
- parse?: undefined;
16
15
  default?: undefined;
16
+ parse?: undefined;
17
17
  } | {
18
18
  name: string;
19
19
  description: string;
@@ -35,15 +35,15 @@ export declare const rnxBundleCommand: {
35
35
  default: string;
36
36
  parse?: undefined;
37
37
  } | {
38
+ default?: undefined;
38
39
  name: string;
39
40
  description: string;
40
41
  parse: typeof import("./helpers/parsers.ts").asNumber;
41
- default?: undefined;
42
42
  } | {
43
+ default?: undefined;
43
44
  name: string;
44
45
  description: string;
45
46
  parse: typeof import("./helpers/parsers.ts").asTransformProfile;
46
- default?: undefined;
47
47
  })[];
48
48
  };
49
49
  export {};
package/lib/clean.d.ts CHANGED
@@ -11,20 +11,20 @@ export declare const rnxCleanCommand: {
11
11
  func: typeof rnxClean;
12
12
  description: string;
13
13
  options: ({
14
+ parse?: undefined;
14
15
  name: string;
15
16
  description: string;
16
17
  default: string;
17
- parse?: undefined;
18
18
  } | {
19
19
  name: string;
20
20
  description: string;
21
21
  default: string;
22
22
  parse: typeof asResolvedPath;
23
23
  } | {
24
+ parse?: undefined;
24
25
  name: string;
25
26
  description: string;
26
27
  default: boolean;
27
- parse?: undefined;
28
28
  })[];
29
29
  };
30
30
  export {};
package/lib/clean.js CHANGED
@@ -51,12 +51,10 @@ async function rnxClean(_argv, { root = process.cwd() }, cliOptions) {
51
51
  }
52
52
  const isWindows = os.platform() === "win32";
53
53
  const execute = (command, args, cwd = root, onError) => {
54
+ const stdio = ["ignore", "pipe", "pipe"];
55
+ const shell = command.endsWith(".bat") || command.endsWith(".cmd");
54
56
  return new Promise((resolve, reject) => {
55
- const process = (0, node_child_process_1.spawn)(command, args, {
56
- cwd,
57
- stdio: ["ignore", "pipe", "pipe"],
58
- shell: command.endsWith(".bat") || command.endsWith(".cmd"),
59
- });
57
+ const process = (0, node_child_process_1.spawn)(command, args, { cwd, stdio, shell });
60
58
  process.on("error", (e) => {
61
59
  const code = "code" in e ? e.code : "errno" in e ? e.errno : "1";
62
60
  switch (code) {
@@ -197,11 +195,17 @@ async function rnxClean(_argv, { root = process.cwd() }, cliOptions) {
197
195
  }
198
196
  }
199
197
  }
200
- function cleanDir(path) {
201
- if (!(0, node_fs_1.existsSync)(path)) {
202
- return Promise.resolve();
198
+ async function cleanDir(path, options = { maxRetries: 3, recursive: true }) {
199
+ if ((0, node_fs_1.existsSync)(path)) {
200
+ await fs.rm(path, options);
201
+ }
202
+ else if (path.includes("*")) {
203
+ const promises = [];
204
+ for await (const file of fs.glob(path)) {
205
+ promises.push(fs.rm(file, options));
206
+ }
207
+ await Promise.allSettled(promises);
203
208
  }
204
- return fs.rm(path, { maxRetries: 3, recursive: true });
205
209
  }
206
210
  function findPath(startPath, files) {
207
211
  // TODO: Find project files via `@react-native-community/cli`
@@ -1,7 +1,7 @@
1
1
  import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
- import type { PackageManifest } from "@rnx-kit/tools-node/package";
3
- import type { AllPlatforms } from "@rnx-kit/tools-react-native";
4
2
  import { parsePlatform } from "@rnx-kit/tools-react-native";
3
+ import type { AllPlatforms } from "@rnx-kit/types-bundle-config";
4
+ import type { PackageManifest } from "@rnx-kit/types-node";
5
5
  import * as nodefs from "node:fs";
6
6
  export type AndroidArchive = {
7
7
  targetName?: string;
@@ -105,20 +105,20 @@ export declare const rnxCopyAssetsCommand: {
105
105
  description: string;
106
106
  func: (_argv: string[], config: CLIConfig, options: Options) => Promise<void>;
107
107
  options: ({
108
+ default?: undefined;
108
109
  name: string;
109
110
  description: string;
110
111
  parse: typeof parsePlatform;
111
- default?: undefined;
112
112
  } | {
113
+ default?: undefined;
114
+ parse?: undefined;
113
115
  name: string;
114
116
  description: string;
115
- parse?: undefined;
116
- default?: undefined;
117
117
  } | {
118
+ parse?: undefined;
118
119
  name: string;
119
120
  description: string;
120
121
  default: boolean;
121
- parse?: undefined;
122
122
  })[];
123
123
  };
124
124
  //# sourceMappingURL=copy-assets.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { BundleParameters } from "@rnx-kit/config";
1
+ import type { BundleParameters } from "@rnx-kit/types-bundle-config";
2
2
  import type { ConfigT } from "metro-config";
3
3
  type MetroExtraParams = Pick<BundleParameters, "detectCyclicDependencies" | "detectDuplicateDependencies" | "typescriptValidation" | "plugins" | "treeShake">;
4
4
  /**
@@ -11,8 +11,8 @@ export declare const rnxRamBundleCommand: {
11
11
  options: ({
12
12
  name: string;
13
13
  description: string;
14
- parse?: undefined;
15
14
  default?: undefined;
15
+ parse?: undefined;
16
16
  } | {
17
17
  name: string;
18
18
  description: string;
@@ -22,11 +22,11 @@ export declare const rnxRamBundleCommand: {
22
22
  name: string;
23
23
  description: string;
24
24
  default: boolean;
25
- parse: typeof import("./helpers/parsers.ts").asBoolean;
25
+ parse: typeof import("./helpers/parsers").asBoolean;
26
26
  } | {
27
27
  name: string;
28
28
  description: string;
29
- parse: typeof import("./helpers/parsers.ts").asBoolean;
29
+ parse: typeof import("./helpers/parsers").asBoolean;
30
30
  default?: undefined;
31
31
  } | {
32
32
  name: string;
@@ -34,15 +34,15 @@ export declare const rnxRamBundleCommand: {
34
34
  default: string;
35
35
  parse?: undefined;
36
36
  } | {
37
+ default?: undefined;
37
38
  name: string;
38
39
  description: string;
39
- parse: typeof import("./helpers/parsers.ts").asNumber;
40
- default?: undefined;
40
+ parse: typeof import("./helpers/parsers").asNumber;
41
41
  } | {
42
+ default?: undefined;
42
43
  name: string;
43
44
  description: string;
44
- parse: typeof import("./helpers/parsers.ts").asTransformProfile;
45
- default?: undefined;
45
+ parse: typeof import("./helpers/parsers").asTransformProfile;
46
46
  })[];
47
47
  };
48
48
  export {};
package/lib/run.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Config } from "@react-native-community/cli-types";
2
2
  import { RNX_FAST_PATH } from "./bin/constants.ts";
3
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>;
4
+ export declare function rnxRun(argv: string[], config: Config, buildParams: InputParams): Promise<void> | Promise<import("./build/windows").BuildResult>;
5
5
  export declare const rnxRunCommand: {
6
6
  [RNX_FAST_PATH]: boolean;
7
7
  name: string;
@@ -23,10 +23,10 @@ export declare const rnxRunCommand: {
23
23
  default: string;
24
24
  parse: (destination: string) => import("./build/types.ts").DeviceType;
25
25
  } | {
26
+ default?: undefined;
26
27
  name: string;
27
28
  description: string;
28
- parse: typeof import("./build/ccache.ts").setCcacheDir;
29
- default?: undefined;
29
+ parse: typeof import("./build/ccache").setCcacheDir;
30
30
  })[];
31
31
  };
32
32
  //# sourceMappingURL=run.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ServerConfig } from "@rnx-kit/config";
1
+ import type { ServerConfig } from "@rnx-kit/types-bundle-config";
2
2
  type ServerConfigOverrides = Pick<ServerConfig, "projectRoot" | "assetPlugins" | "sourceExts"> & {
3
3
  id?: string;
4
4
  };
package/lib/start.d.ts CHANGED
@@ -12,30 +12,30 @@ export declare const rnxStartCommand: {
12
12
  parse: typeof asNumber;
13
13
  default: number;
14
14
  } | {
15
+ parse?: undefined;
15
16
  name: string;
16
17
  description: string;
17
18
  default: string;
18
- parse?: undefined;
19
19
  } | {
20
+ default?: undefined;
20
21
  name: string;
21
22
  description: string;
22
23
  parse: typeof asResolvedPath;
23
- default?: undefined;
24
24
  } | {
25
+ default?: undefined;
25
26
  name: string;
26
27
  description: string;
27
28
  parse: (val: string) => string[];
28
- default?: undefined;
29
29
  } | {
30
+ default?: undefined;
30
31
  name: string;
31
32
  description: string;
32
33
  parse: typeof asNumber;
33
- default?: undefined;
34
34
  } | {
35
+ default?: undefined;
36
+ parse?: undefined;
35
37
  name: string;
36
38
  description: string;
37
- parse?: undefined;
38
- default?: undefined;
39
39
  })[];
40
40
  };
41
41
  //# sourceMappingURL=start.d.ts.map
package/lib/test.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
- import type { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
2
+ import type { AllPlatforms } from "@rnx-kit/types-bundle-config";
3
3
  type Args = {
4
4
  platform: AllPlatforms;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/cli",
3
- "version": "0.18.17",
3
+ "version": "1.0.1",
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,22 +40,25 @@
40
40
  "test": "rnx-kit-scripts test"
41
41
  },
42
42
  "dependencies": {
43
- "@rnx-kit/align-deps": "^3.3.3",
44
- "@rnx-kit/config": "^0.7.0",
43
+ "@rnx-kit/align-deps": "^3.4.2",
44
+ "@rnx-kit/config": "^0.7.5",
45
45
  "@rnx-kit/console": "^2.0.0",
46
- "@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^2.0.0",
47
- "@rnx-kit/metro-plugin-duplicates-checker": "^3.0.0",
48
- "@rnx-kit/metro-plugin-typescript": "^0.5.3",
46
+ "@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^2.0.3",
47
+ "@rnx-kit/metro-plugin-duplicates-checker": "^3.0.3",
48
+ "@rnx-kit/metro-plugin-typescript": "^0.5.4",
49
49
  "@rnx-kit/metro-serializer": "^2.0.0",
50
- "@rnx-kit/metro-serializer-esbuild": "^0.2.8",
50
+ "@rnx-kit/metro-serializer-esbuild": "^0.3.1",
51
51
  "@rnx-kit/metro-service": "^4.1.3",
52
52
  "@rnx-kit/third-party-notices": "^2.0.0",
53
53
  "@rnx-kit/tools-android": "^0.2.2",
54
54
  "@rnx-kit/tools-apple": "^0.2.2",
55
55
  "@rnx-kit/tools-filesystem": "^0.1.0",
56
56
  "@rnx-kit/tools-language": "^3.0.1",
57
- "@rnx-kit/tools-node": "^3.0.3",
58
- "@rnx-kit/tools-react-native": "^2.3.2",
57
+ "@rnx-kit/tools-node": "^3.0.4",
58
+ "@rnx-kit/tools-react-native": "^2.3.3",
59
+ "@rnx-kit/types-bundle-config": "^1.0.0",
60
+ "@rnx-kit/types-kit-config": "^1.0.0",
61
+ "@rnx-kit/types-node": "^1.0.0",
59
62
  "commander": "^11.1.0",
60
63
  "ora": "^5.4.1",
61
64
  "qrcode": "^1.5.0"
@@ -85,15 +88,15 @@
85
88
  "@types/node": "^24.0.0",
86
89
  "@types/qrcode": "^1.4.2",
87
90
  "markdown-table": "^3.0.0",
88
- "metro": "^0.83.1",
91
+ "metro": "^0.83.3",
89
92
  "metro-babel-transformer": "^0.83.1",
90
- "metro-config": "^0.83.1",
91
- "react": "19.1.0",
92
- "react-native": "^0.81.0",
93
+ "metro-config": "^0.83.3",
94
+ "react": "19.2.0",
95
+ "react-native": "^0.83.0",
93
96
  "type-fest": "^4.0.0"
94
97
  },
95
98
  "engines": {
96
- "node": ">=16.17"
99
+ "node": ">=22.11"
97
100
  },
98
101
  "jest": {
99
102
  "preset": "@rnx-kit/jest-preset/private"