remarkjs / remark-github

remark plugin to link references to commits, issues, pull-requests, and users, like on GitHub

Home Page:https://remark.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resolving `package.json` should rely on the vfile cwd, not process

remcohaszing opened this issue · comments

Initial checklist

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.

commented

Released in 11.2.4!