@rnx-kit/cli 0.18.14 → 0.18.17

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.
Files changed (51) hide show
  1. package/README.md +26 -20
  2. package/lib/bin/context.d.ts +1 -1
  3. package/lib/bin/context.js +10 -10
  4. package/lib/bin/externalCommands.js +2 -2
  5. package/lib/bin/rnx-cli.js +4 -4
  6. package/lib/build/android.d.ts +1 -1
  7. package/lib/build/android.js +2 -2
  8. package/lib/build/apple.d.ts +1 -1
  9. package/lib/build/apple.js +2 -2
  10. package/lib/build/ios.d.ts +2 -2
  11. package/lib/build/ios.js +6 -2
  12. package/lib/build/macos.d.ts +2 -2
  13. package/lib/build/macos.js +19 -14
  14. package/lib/build/types.d.ts +11 -1
  15. package/lib/build/windows.d.ts +11 -0
  16. package/lib/build/windows.js +116 -0
  17. package/lib/build.d.ts +4 -4
  18. package/lib/build.js +20 -12
  19. package/lib/bundle/cliOptions.d.ts +1 -1
  20. package/lib/bundle/cliOptions.js +5 -5
  21. package/lib/bundle/kit-config.d.ts +1 -1
  22. package/lib/bundle/kit-config.js +2 -2
  23. package/lib/bundle/metro.d.ts +1 -1
  24. package/lib/bundle/metro.js +2 -2
  25. package/lib/bundle/overrides.d.ts +1 -1
  26. package/lib/bundle.d.ts +4 -4
  27. package/lib/bundle.js +13 -13
  28. package/lib/clean.d.ts +1 -1
  29. package/lib/clean.js +2 -2
  30. package/lib/helpers/externals.d.ts +1 -1
  31. package/lib/helpers/metro-config.js +2 -2
  32. package/lib/index.d.ts +8 -8
  33. package/lib/index.js +32 -32
  34. package/lib/ram-bundle.d.ts +5 -5
  35. package/lib/ram-bundle.js +9 -9
  36. package/lib/run/android.d.ts +1 -1
  37. package/lib/run/android.js +2 -2
  38. package/lib/run/ios.d.ts +1 -1
  39. package/lib/run/ios.js +2 -2
  40. package/lib/run/macos.d.ts +1 -1
  41. package/lib/run/macos.js +2 -2
  42. package/lib/run/windows.d.ts +6 -0
  43. package/lib/run/windows.js +13 -0
  44. package/lib/run.d.ts +6 -6
  45. package/lib/run.js +13 -10
  46. package/lib/serve/keyboard.d.ts +1 -1
  47. package/lib/serve/keyboard.js +1 -1
  48. package/lib/serve/kit-config.js +2 -2
  49. package/lib/start.d.ts +2 -2
  50. package/lib/start.js +28 -21
  51. package/package.json +12 -12
@@ -1,7 +1,7 @@
1
1
  import { bundle } from "@rnx-kit/metro-service";
2
2
  import type { ConfigT } from "metro-config";
3
3
  import * as nodefs from "node:fs";
4
- import type { CliPlatformBundleConfig } from "./types";
4
+ import type { CliPlatformBundleConfig } from "./types.ts";
5
5
  /**
6
6
  * Run the Metro bundler.
7
7
  *
@@ -39,7 +39,7 @@ const metro_service_1 = require("@rnx-kit/metro-service");
39
39
  const tools_filesystem_1 = require("@rnx-kit/tools-filesystem");
40
40
  const nodefs = __importStar(require("node:fs"));
41
41
  const path = __importStar(require("node:path"));
42
- const metro_config_1 = require("../helpers/metro-config");
42
+ const metro_config_ts_1 = require("../helpers/metro-config.js");
43
43
  /**
44
44
  * Run the Metro bundler.
45
45
  *
@@ -67,7 +67,7 @@ async function metroBundle(metroConfig, bundleConfig, dev, minify, output = metr
67
67
  else {
68
68
  bundleConfig.treeShake = false;
69
69
  }
70
- (0, metro_config_1.customizeMetroConfig)(metroConfig, bundleConfig);
70
+ (0, metro_config_ts_1.customizeMetroConfig)(metroConfig, bundleConfig);
71
71
  const metroBundleArgs = {
72
72
  ...bundleConfig,
73
73
  dev,
@@ -1,4 +1,4 @@
1
- import type { CliPlatformBundleConfig } from "./types";
1
+ import type { CliPlatformBundleConfig } from "./types.ts";
2
2
  type BundleConfigOverrides = Partial<Pick<CliPlatformBundleConfig, "entryFile" | "bundleOutput" | "bundleEncoding" | "sourcemapOutput" | "sourcemapSourcesRoot" | "sourcemapUseAbsolutePath" | "assetsDest" | "treeShake" | "unstableTransformProfile" | "indexedRamBundle" | "hermes">>;
3
3
  export declare const overridableCommonBundleOptions: readonly (keyof BundleConfigOverrides)[];
4
4
  /**
package/lib/bundle.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
- import type { CLICommonBundleOptions } from "./bundle/types";
3
- import { asBoolean } from "./helpers/parsers";
2
+ import type { CLICommonBundleOptions } from "./bundle/types.ts";
3
+ import { asBoolean } from "./helpers/parsers.ts";
4
4
  type CLIBundleOptions = CLICommonBundleOptions & {
5
5
  treeShake?: boolean;
6
6
  };
@@ -37,12 +37,12 @@ export declare const rnxBundleCommand: {
37
37
  } | {
38
38
  name: string;
39
39
  description: string;
40
- parse: typeof import("./helpers/parsers").asNumber;
40
+ parse: typeof import("./helpers/parsers.ts").asNumber;
41
41
  default?: undefined;
42
42
  } | {
43
43
  name: string;
44
44
  description: string;
45
- parse: typeof import("./helpers/parsers").asTransformProfile;
45
+ parse: typeof import("./helpers/parsers.ts").asTransformProfile;
46
46
  default?: undefined;
47
47
  })[];
48
48
  };
package/lib/bundle.js CHANGED
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rnxBundleCommand = void 0;
4
4
  exports.rnxBundle = rnxBundle;
5
5
  const metro_service_1 = require("@rnx-kit/metro-service");
6
- const cliOptions_1 = require("./bundle/cliOptions");
7
- const hermes_1 = require("./bundle/hermes");
8
- const kit_config_1 = require("./bundle/kit-config");
9
- const metro_1 = require("./bundle/metro");
10
- const overrides_1 = require("./bundle/overrides");
11
- const parsers_1 = require("./helpers/parsers");
6
+ const cliOptions_ts_1 = require("./bundle/cliOptions.js");
7
+ const hermes_ts_1 = require("./bundle/hermes.js");
8
+ const kit_config_ts_1 = require("./bundle/kit-config.js");
9
+ const metro_ts_1 = require("./bundle/metro.js");
10
+ const overrides_ts_1 = require("./bundle/overrides.js");
11
+ const parsers_ts_1 = require("./helpers/parsers.js");
12
12
  async function rnxBundle(_argv, cliConfig, cliOptions) {
13
13
  const metroConfig = await (0, metro_service_1.loadMetroConfig)(cliConfig, cliOptions);
14
- const bundleConfigs = (0, kit_config_1.getCliPlatformBundleConfigs)(cliOptions.id, cliOptions.platform);
15
- (0, overrides_1.applyBundleConfigOverrides)(cliOptions, bundleConfigs, [
16
- ...overrides_1.overridableCommonBundleOptions,
14
+ const bundleConfigs = (0, kit_config_ts_1.getCliPlatformBundleConfigs)(cliOptions.id, cliOptions.platform);
15
+ (0, overrides_ts_1.applyBundleConfigOverrides)(cliOptions, bundleConfigs, [
16
+ ...overrides_ts_1.overridableCommonBundleOptions,
17
17
  "hermes",
18
18
  "treeShake",
19
19
  ]);
20
20
  for (const bundleConfig of bundleConfigs) {
21
- await (0, metro_1.metroBundle)(metroConfig, bundleConfig, cliOptions.dev, cliOptions.minify);
21
+ await (0, metro_ts_1.metroBundle)(metroConfig, bundleConfig, cliOptions.dev, cliOptions.minify);
22
22
  const { bundleOutput, hermes, sourcemapOutput } = bundleConfig;
23
23
  if (hermes) {
24
- (0, hermes_1.emitBytecode)(cliConfig, bundleOutput, sourcemapOutput, hermes === true ? {} : hermes);
24
+ (0, hermes_ts_1.emitBytecode)(cliConfig, bundleOutput, sourcemapOutput, hermes === true ? {} : hermes);
25
25
  }
26
26
  }
27
27
  }
@@ -30,11 +30,11 @@ exports.rnxBundleCommand = {
30
30
  description: "Bundle your JavaScript for offline use",
31
31
  func: rnxBundle,
32
32
  options: [
33
- ...cliOptions_1.commonBundleCommandOptions,
33
+ ...cliOptions_ts_1.commonBundleCommandOptions,
34
34
  {
35
35
  name: "--tree-shake [boolean]",
36
36
  description: "Enable tree shaking to remove unused code and reduce the bundle size",
37
- parse: parsers_1.asBoolean,
37
+ parse: parsers_ts_1.asBoolean,
38
38
  },
39
39
  ],
40
40
  };
package/lib/clean.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
- import { asResolvedPath } from "./helpers/parsers";
2
+ import { asResolvedPath } from "./helpers/parsers.ts";
3
3
  type Args = {
4
4
  include?: string;
5
5
  projectRoot?: string;
package/lib/clean.js CHANGED
@@ -44,7 +44,7 @@ const fs = __importStar(require("node:fs/promises"));
44
44
  const os = __importStar(require("node:os"));
45
45
  const path = __importStar(require("node:path"));
46
46
  const ora_1 = __importDefault(require("ora"));
47
- const parsers_1 = require("./helpers/parsers");
47
+ const parsers_ts_1 = require("./helpers/parsers.js");
48
48
  async function rnxClean(_argv, { root = process.cwd() }, cliOptions) {
49
49
  if (!(0, node_fs_1.existsSync)(root)) {
50
50
  throw new Error(`Invalid project root: ${root}`);
@@ -227,7 +227,7 @@ exports.rnxCleanCommand = {
227
227
  name: "--project-root <path>",
228
228
  description: "Root path to your React Native project",
229
229
  default: process.cwd(),
230
- parse: parsers_1.asResolvedPath,
230
+ parse: parsers_ts_1.asResolvedPath,
231
231
  },
232
232
  {
233
233
  name: "--verify-cache",
@@ -1,4 +1,4 @@
1
- import type { CliServerApi, CoreDevMiddleware } from "../serve/types";
1
+ import type { CliServerApi, CoreDevMiddleware } from "../serve/types.ts";
2
2
  export declare function requireExternal(module: "@react-native-community/cli-server-api", projectRoot: string, reactNativePath: string): CliServerApi;
3
3
  export declare function requireExternal(module: "@react-native/dev-middleware", projectRoot: string, reactNativePath: string): CoreDevMiddleware;
4
4
  //# sourceMappingURL=externals.d.ts.map
@@ -7,7 +7,7 @@ const metro_plugin_duplicates_checker_1 = require("@rnx-kit/metro-plugin-duplica
7
7
  const metro_plugin_typescript_1 = require("@rnx-kit/metro-plugin-typescript");
8
8
  const metro_serializer_1 = require("@rnx-kit/metro-serializer");
9
9
  const metro_serializer_esbuild_1 = require("@rnx-kit/metro-serializer-esbuild");
10
- const defaultPlugins_1 = require("../bundle/defaultPlugins");
10
+ const defaultPlugins_ts_1 = require("../bundle/defaultPlugins.js");
11
11
  function resolvePlugin(name) {
12
12
  try {
13
13
  return require.resolve(name);
@@ -99,7 +99,7 @@ function customizeMetroConfig(metroConfigReadonly, extraParams, print) {
99
99
  }
100
100
  }
101
101
  else {
102
- const plugins = extraParams.plugins || (0, defaultPlugins_1.getDefaultBundlerPlugins)().plugins;
102
+ const plugins = extraParams.plugins || (0, defaultPlugins_ts_1.getDefaultBundlerPlugins)().plugins;
103
103
  for (const entry of plugins) {
104
104
  const [module, options] = Array.isArray(entry)
105
105
  ? entry
package/lib/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import type { Command } from "@react-native-community/cli-types";
2
2
  import { writeThirdPartyNoticesCommand } from "@rnx-kit/third-party-notices";
3
- import { rnxBuild, rnxBuildCommand } from "./build";
4
- import { rnxBundle, rnxBundleCommand } from "./bundle";
5
- import { rnxClean, rnxCleanCommand } from "./clean";
6
- import { copyProjectAssets, rnxCopyAssetsCommand } from "./copy-assets";
7
- import { rnxRamBundle, rnxRamBundleCommand } from "./ram-bundle";
8
- import { rnxRun, rnxRunCommand } from "./run";
9
- import { rnxStart, rnxStartCommand } from "./start";
10
- import { rnxTest, rnxTestCommand } from "./test";
3
+ import { rnxBuild, rnxBuildCommand } from "./build.ts";
4
+ import { rnxBundle, rnxBundleCommand } from "./bundle.ts";
5
+ import { rnxClean, rnxCleanCommand } from "./clean.ts";
6
+ import { copyProjectAssets, rnxCopyAssetsCommand } from "./copy-assets.ts";
7
+ import { rnxRamBundle, rnxRamBundleCommand } from "./ram-bundle.ts";
8
+ import { rnxRun, rnxRunCommand } from "./run.ts";
9
+ import { rnxStart, rnxStartCommand } from "./start.ts";
10
+ import { rnxTest, rnxTestCommand } from "./test.ts";
11
11
  export { copyProjectAssets, rnxBuild, rnxBuildCommand, rnxBundle, rnxBundleCommand, rnxClean, rnxCleanCommand, rnxCopyAssetsCommand, rnxRamBundle, rnxRamBundleCommand, rnxRun, rnxRunCommand, rnxStart, rnxStartCommand, rnxTest, rnxTestCommand, };
12
12
  export declare const reactNativeConfig: {
13
13
  commands: Command<false>[];
package/lib/index.js CHANGED
@@ -3,42 +3,42 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rnxWriteThirdPartyNoticesCommand = exports.rnxWriteThirdPartyNotices = exports.rnxAlignDepsCommand = exports.rnxAlignDeps = exports.reactNativeConfig = exports.rnxTestCommand = exports.rnxTest = exports.rnxStartCommand = exports.rnxStart = exports.rnxRunCommand = exports.rnxRun = exports.rnxRamBundleCommand = exports.rnxRamBundle = exports.rnxCopyAssetsCommand = exports.rnxCleanCommand = exports.rnxClean = exports.rnxBundleCommand = exports.rnxBundle = exports.rnxBuildCommand = exports.rnxBuild = exports.copyProjectAssets = void 0;
4
4
  const align_deps_1 = require("@rnx-kit/align-deps");
5
5
  const third_party_notices_1 = require("@rnx-kit/third-party-notices");
6
- const build_1 = require("./build");
7
- Object.defineProperty(exports, "rnxBuild", { enumerable: true, get: function () { return build_1.rnxBuild; } });
8
- Object.defineProperty(exports, "rnxBuildCommand", { enumerable: true, get: function () { return build_1.rnxBuildCommand; } });
9
- const bundle_1 = require("./bundle");
10
- Object.defineProperty(exports, "rnxBundle", { enumerable: true, get: function () { return bundle_1.rnxBundle; } });
11
- Object.defineProperty(exports, "rnxBundleCommand", { enumerable: true, get: function () { return bundle_1.rnxBundleCommand; } });
12
- const clean_1 = require("./clean");
13
- Object.defineProperty(exports, "rnxClean", { enumerable: true, get: function () { return clean_1.rnxClean; } });
14
- Object.defineProperty(exports, "rnxCleanCommand", { enumerable: true, get: function () { return clean_1.rnxCleanCommand; } });
15
- const copy_assets_1 = require("./copy-assets");
16
- Object.defineProperty(exports, "copyProjectAssets", { enumerable: true, get: function () { return copy_assets_1.copyProjectAssets; } });
17
- Object.defineProperty(exports, "rnxCopyAssetsCommand", { enumerable: true, get: function () { return copy_assets_1.rnxCopyAssetsCommand; } });
18
- const ram_bundle_1 = require("./ram-bundle");
19
- Object.defineProperty(exports, "rnxRamBundle", { enumerable: true, get: function () { return ram_bundle_1.rnxRamBundle; } });
20
- Object.defineProperty(exports, "rnxRamBundleCommand", { enumerable: true, get: function () { return ram_bundle_1.rnxRamBundleCommand; } });
21
- const run_1 = require("./run");
22
- Object.defineProperty(exports, "rnxRun", { enumerable: true, get: function () { return run_1.rnxRun; } });
23
- Object.defineProperty(exports, "rnxRunCommand", { enumerable: true, get: function () { return run_1.rnxRunCommand; } });
24
- const start_1 = require("./start");
25
- Object.defineProperty(exports, "rnxStart", { enumerable: true, get: function () { return start_1.rnxStart; } });
26
- Object.defineProperty(exports, "rnxStartCommand", { enumerable: true, get: function () { return start_1.rnxStartCommand; } });
27
- const test_1 = require("./test");
28
- Object.defineProperty(exports, "rnxTest", { enumerable: true, get: function () { return test_1.rnxTest; } });
29
- Object.defineProperty(exports, "rnxTestCommand", { enumerable: true, get: function () { return test_1.rnxTestCommand; } });
6
+ const build_ts_1 = require("./build.js");
7
+ Object.defineProperty(exports, "rnxBuild", { enumerable: true, get: function () { return build_ts_1.rnxBuild; } });
8
+ Object.defineProperty(exports, "rnxBuildCommand", { enumerable: true, get: function () { return build_ts_1.rnxBuildCommand; } });
9
+ const bundle_ts_1 = require("./bundle.js");
10
+ Object.defineProperty(exports, "rnxBundle", { enumerable: true, get: function () { return bundle_ts_1.rnxBundle; } });
11
+ Object.defineProperty(exports, "rnxBundleCommand", { enumerable: true, get: function () { return bundle_ts_1.rnxBundleCommand; } });
12
+ const clean_ts_1 = require("./clean.js");
13
+ Object.defineProperty(exports, "rnxClean", { enumerable: true, get: function () { return clean_ts_1.rnxClean; } });
14
+ Object.defineProperty(exports, "rnxCleanCommand", { enumerable: true, get: function () { return clean_ts_1.rnxCleanCommand; } });
15
+ const copy_assets_ts_1 = require("./copy-assets.js");
16
+ Object.defineProperty(exports, "copyProjectAssets", { enumerable: true, get: function () { return copy_assets_ts_1.copyProjectAssets; } });
17
+ Object.defineProperty(exports, "rnxCopyAssetsCommand", { enumerable: true, get: function () { return copy_assets_ts_1.rnxCopyAssetsCommand; } });
18
+ const ram_bundle_ts_1 = require("./ram-bundle.js");
19
+ Object.defineProperty(exports, "rnxRamBundle", { enumerable: true, get: function () { return ram_bundle_ts_1.rnxRamBundle; } });
20
+ Object.defineProperty(exports, "rnxRamBundleCommand", { enumerable: true, get: function () { return ram_bundle_ts_1.rnxRamBundleCommand; } });
21
+ const run_ts_1 = require("./run.js");
22
+ Object.defineProperty(exports, "rnxRun", { enumerable: true, get: function () { return run_ts_1.rnxRun; } });
23
+ Object.defineProperty(exports, "rnxRunCommand", { enumerable: true, get: function () { return run_ts_1.rnxRunCommand; } });
24
+ const start_ts_1 = require("./start.js");
25
+ Object.defineProperty(exports, "rnxStart", { enumerable: true, get: function () { return start_ts_1.rnxStart; } });
26
+ Object.defineProperty(exports, "rnxStartCommand", { enumerable: true, get: function () { return start_ts_1.rnxStartCommand; } });
27
+ const test_ts_1 = require("./test.js");
28
+ Object.defineProperty(exports, "rnxTest", { enumerable: true, get: function () { return test_ts_1.rnxTest; } });
29
+ Object.defineProperty(exports, "rnxTestCommand", { enumerable: true, get: function () { return test_ts_1.rnxTestCommand; } });
30
30
  exports.reactNativeConfig = {
31
31
  commands: [
32
- bundle_1.rnxBundleCommand,
33
- ram_bundle_1.rnxRamBundleCommand,
34
- start_1.rnxStartCommand,
35
- build_1.rnxBuildCommand,
36
- run_1.rnxRunCommand,
37
- copy_assets_1.rnxCopyAssetsCommand,
32
+ bundle_ts_1.rnxBundleCommand,
33
+ ram_bundle_ts_1.rnxRamBundleCommand,
34
+ start_ts_1.rnxStartCommand,
35
+ build_ts_1.rnxBuildCommand,
36
+ run_ts_1.rnxRunCommand,
37
+ copy_assets_ts_1.rnxCopyAssetsCommand,
38
38
  align_deps_1.alignDepsCommand,
39
- test_1.rnxTestCommand,
39
+ test_ts_1.rnxTestCommand,
40
40
  third_party_notices_1.writeThirdPartyNoticesCommand,
41
- clean_1.rnxCleanCommand,
41
+ clean_ts_1.rnxCleanCommand,
42
42
  ],
43
43
  };
44
44
  // @rnx-kit/align-deps
@@ -1,5 +1,5 @@
1
1
  import type { Config as CLIConfig } from "@react-native-community/cli-types";
2
- import type { CLICommonBundleOptions } from "./bundle/types";
2
+ import type { CLICommonBundleOptions } from "./bundle/types.ts";
3
3
  type CLIRamBundleOptions = CLICommonBundleOptions & {
4
4
  indexedRamBundle?: boolean;
5
5
  };
@@ -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").asBoolean;
25
+ parse: typeof import("./helpers/parsers.ts").asBoolean;
26
26
  } | {
27
27
  name: string;
28
28
  description: string;
29
- parse: typeof import("./helpers/parsers").asBoolean;
29
+ parse: typeof import("./helpers/parsers.ts").asBoolean;
30
30
  default?: undefined;
31
31
  } | {
32
32
  name: string;
@@ -36,12 +36,12 @@ export declare const rnxRamBundleCommand: {
36
36
  } | {
37
37
  name: string;
38
38
  description: string;
39
- parse: typeof import("./helpers/parsers").asNumber;
39
+ parse: typeof import("./helpers/parsers.ts").asNumber;
40
40
  default?: undefined;
41
41
  } | {
42
42
  name: string;
43
43
  description: string;
44
- parse: typeof import("./helpers/parsers").asTransformProfile;
44
+ parse: typeof import("./helpers/parsers.ts").asTransformProfile;
45
45
  default?: undefined;
46
46
  })[];
47
47
  };
package/lib/ram-bundle.js CHANGED
@@ -4,10 +4,10 @@ exports.rnxRamBundleCommand = void 0;
4
4
  exports.rnxRamBundle = rnxRamBundle;
5
5
  const console_1 = require("@rnx-kit/console");
6
6
  const metro_service_1 = require("@rnx-kit/metro-service");
7
- const cliOptions_1 = require("./bundle/cliOptions");
8
- const kit_config_1 = require("./bundle/kit-config");
9
- const metro_1 = require("./bundle/metro");
10
- const overrides_1 = require("./bundle/overrides");
7
+ const cliOptions_ts_1 = require("./bundle/cliOptions.js");
8
+ const kit_config_ts_1 = require("./bundle/kit-config.js");
9
+ const metro_ts_1 = require("./bundle/metro.js");
10
+ const overrides_ts_1 = require("./bundle/overrides.js");
11
11
  function disableTreeShaking(configs) {
12
12
  const wasEnabled = configs.reduce((modified, config) => {
13
13
  if (config.treeShake) {
@@ -22,14 +22,14 @@ function disableTreeShaking(configs) {
22
22
  }
23
23
  async function rnxRamBundle(_argv, cliConfig, cliOptions) {
24
24
  const metroConfig = await (0, metro_service_1.loadMetroConfig)(cliConfig, cliOptions);
25
- const bundleConfigs = (0, kit_config_1.getCliPlatformBundleConfigs)(cliOptions.id, cliOptions.platform);
26
- (0, overrides_1.applyBundleConfigOverrides)(cliOptions, bundleConfigs, [
27
- ...overrides_1.overridableCommonBundleOptions,
25
+ const bundleConfigs = (0, kit_config_ts_1.getCliPlatformBundleConfigs)(cliOptions.id, cliOptions.platform);
26
+ (0, overrides_ts_1.applyBundleConfigOverrides)(cliOptions, bundleConfigs, [
27
+ ...overrides_ts_1.overridableCommonBundleOptions,
28
28
  "indexedRamBundle",
29
29
  ]);
30
30
  disableTreeShaking(bundleConfigs);
31
31
  for (const bundleConfig of bundleConfigs) {
32
- await (0, metro_1.metroBundle)(metroConfig, bundleConfig, cliOptions.dev, cliOptions.minify, metro_service_1.ramBundle);
32
+ await (0, metro_ts_1.metroBundle)(metroConfig, bundleConfig, cliOptions.dev, cliOptions.minify, metro_service_1.ramBundle);
33
33
  }
34
34
  }
35
35
  exports.rnxRamBundleCommand = {
@@ -37,7 +37,7 @@ exports.rnxRamBundleCommand = {
37
37
  description: "[Deprecated] Bundle your JavaScript in the RAM bundle format for offline use",
38
38
  func: rnxRamBundle,
39
39
  options: [
40
- ...cliOptions_1.commonBundleCommandOptions,
40
+ ...cliOptions_ts_1.commonBundleCommandOptions,
41
41
  {
42
42
  name: "--indexed-ram-bundle",
43
43
  description: 'Force the "Indexed RAM" bundle file format, even when targeting Android',
@@ -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
@@ -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 android_1 = require("../build/android");
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, android_1.buildAndroid)(config, buildParams, additionalArgs, logger);
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 ios_1 = require("../build/ios");
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, ios_1.buildIOS)(config, buildParams, logger);
49
+ const result = await (0, ios_ts_1.buildIOS)(config, buildParams, logger);
50
50
  if (!result || typeof result !== "object") {
51
51
  return;
52
52
  }
@@ -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 macos_1 = require("../build/macos");
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, macos_1.buildMacOS)(config, buildParams, logger);
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 constants_1 = require("./bin/constants");
6
- const build_1 = require("./build");
7
- const android_1 = require("./run/android");
8
- const ios_1 = require("./run/ios");
9
- const macos_1 = require("./run/macos");
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, android_1.runAndroid)(config, buildParams, argv);
14
+ return (0, android_ts_1.runAndroid)(config, buildParams, argv);
14
15
  case "ios":
15
16
  case "visionos":
16
- return (0, ios_1.runIOS)(config, buildParams);
17
+ return (0, ios_ts_1.runIOS)(config, buildParams);
17
18
  case "macos":
18
- return (0, macos_1.runMacOS)(config, buildParams);
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
- [constants_1.RNX_FAST_PATH]: false,
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
- ...build_1.rnxBuildCommand.options,
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",
@@ -1,6 +1,6 @@
1
1
  import type { MetroTerminal } from "@rnx-kit/metro-service";
2
2
  import type { Server } from "node:http";
3
- import type { DevServerMiddleware } from "./types";
3
+ import type { DevServerMiddleware } from "./types.ts";
4
4
  type HttpServer = Server & {
5
5
  httpServer?: Server;
6
6
  };
@@ -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)("Exiting...");
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
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getKitServerConfig = getKitServerConfig;
4
4
  const config_1 = require("@rnx-kit/config");
5
5
  const properties_1 = require("@rnx-kit/tools-language/properties");
6
- const defaultPlugins_1 = require("../bundle/defaultPlugins");
6
+ const defaultPlugins_ts_1 = require("../bundle/defaultPlugins.js");
7
7
  /**
8
8
  * Get the server configuration from the rnx-kit configuration. Apply any overrides.
9
9
  *
@@ -25,7 +25,7 @@ function getKitServerConfig(overrides) {
25
25
  }
26
26
  }
27
27
  return {
28
- ...(0, defaultPlugins_1.getDefaultBundlerPlugins)(),
28
+ ...(0, defaultPlugins_ts_1.getDefaultBundlerPlugins)(),
29
29
  ...serverConfig,
30
30
  treeShake: false, // tree shaking does not work with the bundle server
31
31
  ...(0, properties_1.pickValues)(overrides, ["projectRoot", "assetPlugins", "sourceExts"]),
package/lib/start.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Config } from "@react-native-community/cli-types";
2
- import { asNumber, asResolvedPath } from "./helpers/parsers";
3
- import type { StartCommandArgs } from "./serve/types";
2
+ import { asNumber, asResolvedPath } from "./helpers/parsers.ts";
3
+ import type { StartCommandArgs } from "./serve/types.ts";
4
4
  export declare function rnxStart(_argv: string[], ctx: Config, args: StartCommandArgs): Promise<void>;
5
5
  export declare const rnxStartCommand: {
6
6
  name: string;