Resolving `package.json` should rely on the vfile cwd, not process
remcohaszing opened this issue · comments
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
11.2.3
Link to runnable example
No response
Steps to reproduce
It is kind of annoying to reproduce, but this is what causes remarkjs/vscode-remark#65 builds to fail on Windows. When VSCode is opened in Windows, it doesn’t send the desired cwd
to the language server process, meaning process.cwd()
doesn’t match file.cwd
. The language server makes sure file.cwd
is correct, and plugins are typically supposed to use that.
Expected behavior
remark-github
uses file.cwd
to lookup package.json
, so an implementation can set a custom cwd
when runningt the unified pipeline.
Actual behavior
remark-github
uses process.cwd()
, which is often the same as file.cwd
but not always. This leads to unexpected behaviour.
Runtime
Node v16
Package manager
npm 8
OS
Linux
Build and bundle tools
Other (please specify in steps to reproduce)
I can create a PR including a test for this tomorrow.
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.