coc-jest
coc-jest copied to clipboard
Incorrectly resolves root in monorepo
I have a monorepo with many package.json
files throughout (managed with yarn workspaces). When I try to run :Jest
or :JestCurrent
it errors saying it can't find the Jest executable. In order to run it I have to first open my root level package.json.
It seems that the resolveRoot
function uses findUp
to find the nearest package.json
and assumes that will be the location of Jest. Since I have multiple packages, it's most likely stopping too soon. Is there a reason not to use workspace.root
from the coc.nvim
plugin? I'm still new to this plugin and its ecosystem, but seems to be if something already has the root plugins should prefer that, no?
I would also add myself to that question. It's a problem for yarn managed repositories. I would propose taking the workspace.root and adding a way to define our own independent files
It could be improved, consider send PR.
any further ? please ~
@chemzqm hi! Can you give me permission to create PR I have PR with some stuff, like: -did some refactoring -using workspace.root as root dir -split logic in to different files
@Geschoss you should
- fork this repo in yours, as your coc-jest
- clone it and do sth
- git push your forked one
- create pull request to origin coc-jest
@IndexXuan nice, thank you!
#9 need review=)
@IndexXuan can you check new version?
@Geschoss I will local build your code and check it in my project tomorrow. while I am just user of coc-jest.