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

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

Closed
4 tasks done
remcohaszing opened this issue Jul 12, 2022 · 3 comments · Fixed by #41
Closed
4 tasks done

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

remcohaszing opened this issue Jul 12, 2022 · 3 comments · Fixed by #41
Labels
💪 phase/solved Post is done

Comments

@remcohaszing
Copy link
Member

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)

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jul 12, 2022
@remcohaszing
Copy link
Member Author

I can create a PR including a test for this tomorrow.

wooorm pushed a commit that referenced this issue Jul 13, 2022
Closes GH-39.
Closes GH-41.

Reviewed-by: Titus Wormer <[email protected]>
Reviewed-by: Christian Murphy <[email protected]>
@github-actions

This comment has been minimized.

@wooorm wooorm added the 💪 phase/solved Post is done label Jul 13, 2022
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Jul 13, 2022
@wooorm
Copy link
Member

wooorm commented Jul 13, 2022

Released in 11.2.4!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done
Development

Successfully merging a pull request may close this issue.

2 participants