Skip to content

Conversation

@kraenhansen
Copy link
Collaborator

This was used across CLIs so it seems more appropriate to move it into the common CLI utils package.

@kraenhansen kraenhansen self-assigned this Oct 21, 2025
@kraenhansen kraenhansen requested a review from Copilot October 21, 2025 10:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the prettyPath utility function by moving it from the host package to the cli-utils package, making it available for reuse across all CLI tooling packages in the monorepo.

Key changes:

  • Moved prettyPath function from host/src/node/path-utils.ts to cli-utils/src/paths.ts
  • Updated all import statements across 8 files to use the centralized implementation
  • Replaced inline path formatting logic with prettyPath calls for consistency

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/cli-utils/src/paths.ts New file containing the prettyPath utility function moved from host package
packages/cli-utils/src/index.ts Exports the new paths module
packages/host/src/node/path-utils.ts Removed prettyPath function and added import from cli-utils
packages/host/src/node/index.ts Removed prettyPath from exports
packages/host/src/node/cli/program.ts Updated import to use cli-utils instead of path-utils
packages/host/src/node/cli/link-modules.ts Updated import to use cli-utils instead of path-utils
packages/host/src/node/cli/hermes.ts Updated import to use cli-utils instead of path-utils
packages/gyp-to-cmake/src/cli.ts Added prettyPath import and improved log message formatting
packages/ferric/src/build.ts Replaced inline path formatting with prettyPath call
packages/cmake-rn/src/platforms/apple.ts Replaced inline path formatting with prettyPath call
packages/cmake-rn/src/platforms/android.ts Replaced inline path formatting with prettyPath call

Comment on lines +37 to +41
console.log(
`Transforming ${prettyPath(gypPath)}${prettyPath(cmakeListsPath)}`,
);

const gyp = readBindingFile(gypPath, disallowUnknownProperties);
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cmakeListsPath is now computed before reading the gyp file, but it's only used after the transformation. If readBindingFile throws an error, the user will see the transformation message without any transformation actually being attempted. Consider moving the log statement after readBindingFile to ensure the file can be read before announcing the transformation.

Suggested change
console.log(
`Transforming ${prettyPath(gypPath)}${prettyPath(cmakeListsPath)}`,
);
const gyp = readBindingFile(gypPath, disallowUnknownProperties);
const gyp = readBindingFile(gypPath, disallowUnknownProperties);
console.log(
`Transforming ${prettyPath(gypPath)}${prettyPath(cmakeListsPath)}`,
);

Copilot uses AI. Check for mistakes.
@kraenhansen kraenhansen merged commit 6996e73 into main Oct 21, 2025
6 checks passed
@kraenhansen kraenhansen deleted the kh/move-pretty-path-to-utils branch October 21, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants