@rnx-kit/cli 0.18.13 → 0.18.14

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.
@@ -117,9 +117,6 @@ function emitBytecode(cliConfig, input, sourcemap, options) {
117
117
  const options = { encoding: "utf-8" };
118
118
  const packagerSourcemap = JSON.parse(fs.readFileSync(sourcemap, options));
119
119
  const compilerSourcemap = JSON.parse(fs.readFileSync(outputMap, options));
120
- // `composeSourceMaps` was introduced in 0.56 — see
121
- // https://github.com/facebook/metro/commit/6017085bdad96ca5cec39d50038eb5622ce1097b
122
- // @ts-expect-error Property 'composeSourceMaps' does not exist
123
120
  const { composeSourceMaps } = (0, metro_1.requireModuleFromMetro)("metro-source-map");
124
121
  const composed = composeSourceMaps([packagerSourcemap, compilerSourcemap]);
125
122
  (0, tools_filesystem_1.writeJSONFile)(outputMap, composed, 0);
@@ -37,15 +37,12 @@ exports.requireExternal = requireExternal;
37
37
  const package_1 = require("@rnx-kit/tools-node/package");
38
38
  const context_1 = require("@rnx-kit/tools-react-native/context");
39
39
  const fs = __importStar(require("node:fs"));
40
- const path = __importStar(require("node:path"));
41
40
  function friendlyRequire(modules, startDir) {
42
41
  const target = modules.pop();
43
42
  if (!target) {
44
43
  throw new Error("At least one target module is required");
45
44
  }
46
- const resolvedStartDir = fs.lstatSync(startDir).isSymbolicLink()
47
- ? path.resolve(path.dirname(startDir), fs.readlinkSync(startDir))
48
- : startDir;
45
+ const resolvedStartDir = fs.realpathSync(startDir);
49
46
  try {
50
47
  const finalPackageDir = (0, package_1.resolveDependencyChain)(modules, resolvedStartDir);
51
48
  const targetModule = require.resolve(target, { paths: [finalPackageDir] });
@@ -140,7 +140,7 @@ function customizeMetroConfig(metroConfigReadonly, extraParams, print) {
140
140
  metroConfig.serializer.customSerializer = (0, metro_serializer_1.MetroSerializer)(metroPlugins);
141
141
  }
142
142
  else {
143
- // @ts-expect-error We don't want this set if unused
143
+ // We don't want this set if unused
144
144
  delete metroConfig.serializer.customSerializer;
145
145
  }
146
146
  const hooks = Object.values(serializerHooks);
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Command } from "@react-native-community/cli-types";
2
+ import { writeThirdPartyNoticesCommand } from "@rnx-kit/third-party-notices";
2
3
  import { rnxBuild, rnxBuildCommand } from "./build";
3
4
  import { rnxBundle, rnxBundleCommand } from "./bundle";
4
5
  import { rnxClean, rnxCleanCommand } from "./clean";
@@ -25,25 +26,6 @@ export declare const rnxAlignDepsCommand: {
25
26
  description: string;
26
27
  }[];
27
28
  };
28
- export declare const rnxWriteThirdPartyNotices: (_argv: string[], _config: import("@react-native-community/cli-types").Config, { additionalText, fullLicenseText, ignoreModules, ignoreScopes, json, outputFile, preambleText, rootPath, sourceMapFile, }: import("@rnx-kit/third-party-notices/lib/types").WriteThirdPartyNoticesOptions & {
29
- ignoreScopes?: string;
30
- ignoreModules?: string;
31
- preambleText?: string;
32
- additionalText?: string;
33
- }) => void;
34
- export declare const rnxWriteThirdPartyNoticesCommand: {
35
- name: string;
36
- description: string;
37
- func: (_argv: string[], _config: import("@react-native-community/cli-types").Config, { additionalText, fullLicenseText, ignoreModules, ignoreScopes, json, outputFile, preambleText, rootPath, sourceMapFile, }: import("@rnx-kit/third-party-notices/lib/types").WriteThirdPartyNoticesOptions & {
38
- ignoreScopes?: string;
39
- ignoreModules?: string;
40
- preambleText?: string;
41
- additionalText?: string;
42
- }) => void;
43
- readonly options: {
44
- name: string;
45
- description: "The root of the repo to start resolving modules from" | "The source map file to generate license contents for" | "Output license information as a JSON" | "The output file to write the license file to" | "npm scopes to ignore and not emit license information for" | "Modules (JS packages) to not emit license information for" | "A list of lines to prepend at the start of the generated license file" | "A list of lines to append at the end of the generated license file" | "Include full license text in the JSON output";
46
- default: string | false | undefined;
47
- }[];
48
- };
29
+ export declare const rnxWriteThirdPartyNotices: typeof writeThirdPartyNoticesCommand.func;
30
+ export declare const rnxWriteThirdPartyNoticesCommand: typeof writeThirdPartyNoticesCommand;
49
31
  //# sourceMappingURL=index.d.ts.map
@@ -43,9 +43,7 @@ const path = __importStar(require("node:path"));
43
43
  const node_readline_1 = __importDefault(require("node:readline"));
44
44
  const qrcode_1 = __importDefault(require("qrcode"));
45
45
  function createOpenDebuggerKeyboardHandler({ devServerUrl, metroTerminal: { reporter }, reactNativePath, }) {
46
- const resolvedPath = fs.lstatSync(reactNativePath).isSymbolicLink()
47
- ? path.resolve(path.dirname(reactNativePath), fs.readlinkSync(reactNativePath))
48
- : reactNativePath;
46
+ const resolvedPath = fs.realpathSync(reactNativePath);
49
47
  try {
50
48
  // Available starting with 0.76
51
49
  const cliPlugin = require.resolve("@react-native/community-cli-plugin/package.json", { paths: [resolvedPath] });
package/lib/start.js CHANGED
@@ -58,6 +58,11 @@ async function rnxStart(_argv, ctx, args) {
58
58
  logger.warn("Interactive mode is not supported in this environment");
59
59
  }
60
60
  }
61
+ // CVE-2025-11953: Ensure `host` is set to `localhost` by default, otherwise
62
+ // it will listen to external connections.
63
+ if (!args.host) {
64
+ args.host = "127.0.0.1";
65
+ }
61
66
  // load Metro configuration, applying overrides from the command line
62
67
  const metroConfig = await (0, metro_service_1.loadMetroConfig)(ctx, {
63
68
  ...args,
@@ -93,7 +98,7 @@ async function rnxStart(_argv, ctx, args) {
93
98
  }
94
99
  // create middleware -- a collection of plugins which handle incoming
95
100
  // http(s) requests, routing them to static pages or JS functions.
96
- const host = args.host?.length ? args.host : "localhost";
101
+ const host = args.host;
97
102
  const devServerUrl = `${scheme}://${host}:${port}`;
98
103
  const devServer = createDevServerMiddleware({ host, port, watchFolders });
99
104
  const coreDevMiddleware = (() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/cli",
3
- "version": "0.18.13",
3
+ "version": "0.18.14",
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",
@@ -47,7 +47,7 @@
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.1",
50
+ "@rnx-kit/metro-serializer-esbuild": "^0.2.6",
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",