Skip to content

Conversation

matthargett
Copy link
Contributor

attempt to get some early visibility into pathing or other issues. should "just work" with this subset of tests.

Copy link

changeset-bot bot commented May 21, 2025

⚠️ No Changeset found

Latest commit: 24c930e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…he nodejs ecosystem. I'm trying to set the file/dir as offline to simulate it being otherwise inaccessible.
…rshell in some brittle way, and it just doesn't appear feasible for the unreadable directory case. The other unreadable file case is covered.
@matthargett matthargett requested a review from Copilot May 23, 2025 00:24
Copy link
Contributor

@Copilot 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 aims to improve file permission handling and path normalization in the node API modules to ensure unit tests run properly on Windows. Key changes include:

  • Refactoring the file readability check in isNodeApiModule with a new helper function (isReadableSync) and improved error messaging.
  • Adjustments to normalize module paths for cross-platform compatibility.
  • Updates to unit tests to simulate changes in file permission behavior on Windows using fswin, plus the addition of a dedicated Windows test workflow.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

File Description
packages/react-native-node-api-modules/src/node/path-utils.ts Enhanced file readability checking and path normalization for cross-platform support.
packages/react-native-node-api-modules/src/node/path-utils.test.ts Added helper functions to simulate removal and restoration of read permissions on Windows.
packages/react-native-node-api-modules/package.json Added fswin dependency for Windows file attribute management.
.github/workflows/check.yml Introduced a Windows test job to run the adjusted test suite.

Copy link
Collaborator

@kraenhansen kraenhansen left a comment

Choose a reason for hiding this comment

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

Added a few minor suggestions - pick what you feel like and merge at will 🙂

@matthargett matthargett merged commit ea69b53 into main May 27, 2025
4 checks passed
@matthargett matthargett deleted the windows-ci branch May 27, 2025 07:57
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