Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow CJS to import index.js files using directory path #5749

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arv
Copy link

@arv arv commented May 2, 2024

maybeGetTargetFilePath did not correctly deal with implicit import of index.js files.

If target is a directory, we need to check if it has an index (js, mjs, cjs) file and return that file path if present.

What this PR solves / how to test

Fixes #[insert GH or internal issue number(s)].

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Included
    • Not necessary because:
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Included
    • Not necessary because:
  • Public documentation

`maybeGetTargetFilePath` did not correctly deal with implicit import of
index.js files.

If target is a directory, we need to check if it has an index
(js, mjs, cjs) file and return that file path if present.
@arv arv requested a review from a team as a code owner May 2, 2024 21:55
Copy link

changeset-bot bot commented May 2, 2024

🦋 Changeset detected

Latest commit: e34b183

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

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

@arv
Copy link
Author

arv commented May 2, 2024

Reviewers: I do not see any related tests in this package. Any ideas how to test this?

arv added a commit to arv/pg-logical-replication that referenced this pull request May 3, 2024
This is mostly to unblock `@cloudflare/vitest-worker-pool` which has a
bug that prevents it from resolving `dir/a/b` to `dir/a/b/index.js`.

cloudflare/workers-sdk#5749 (comment)
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.

None yet

1 participant