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(hard-link-dir): prevent fatal error on ENOENT #6396

Merged
merged 3 commits into from Apr 14, 2023

Conversation

nVitius
Copy link
Contributor

@nVitius nVitius commented Apr 13, 2023

I was running into an issue where I have a workspace package (@my-org/my-app) that has a dependency on @my-org/my-lib. In turn, my-lib has a dist directory that is in the root of the monorepo (this is how nx sets things up). It uses publishConfig.directory and publishConfig.linkDirectory.

package.json (my-app)

{
  "dependencies": {
    "@my-org/my-lib": "workspace:^"
  },
  "dependenciesMeta": {
    "@my-org/my-lib": { "injected": true }
  }
}

package.json (my-lib)

{
  "publishConfig": {
    "directory": "../../dist/lib/my-lib",
    "linkDirectory": true
  }
}

There is an issue with pnpm where, given the above conditions, if you run pnpm install but dist/lib/my-lib does not exist, the process will fail with a ENOENT error.

This change request makes it so that the install process can continue while making an empty destination directory for the hardlinks.

@nVitius nVitius requested a review from zkochan as a code owner April 13, 2023 16:43
@welcome
Copy link

welcome bot commented Apr 13, 2023

💖 Thanks for opening this pull request! 💖
Please be patient and we will get back to you as soon as we can.

@zkochan zkochan requested a review from a team April 14, 2023 00:45
fs/hard-link-dir/src/index.ts Outdated Show resolved Hide resolved
@zkochan zkochan merged commit 64d0f47 into pnpm:main Apr 14, 2023
8 checks passed
@welcome
Copy link

welcome bot commented Apr 14, 2023

Congrats on merging your first pull request! 🎉🎉🎉

zkochan added a commit that referenced this pull request Apr 14, 2023
Co-authored-by: Zoltan Kochan <z@kochan.io>
@nVitius
Copy link
Contributor Author

nVitius commented Apr 16, 2023

@zkochan Thank you for helping me get this merged in. I appreciate how quick the whole process was.

Are you able to give an ETA on when this might be included in a patch version?

@zkochan
Copy link
Member

zkochan commented Apr 17, 2023

🚢 8.3.0-0

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

3 participants