-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support PnP strategy in Yarn Berry #259
Comments
Yarn introduced a new installation strategy known as Plug'n'Play (PnP) starting from Yarn 2. It aims to address problems with the node_modules strategy used by traditional package managers like npm and Yarn 1. The node_modules strategy works by creating a node_modules directory in your project root, where all your dependencies are installed. However, this can create problems because:
In our case, the TypeScript util parseJsonConfigFileContent tries to resolve the file @grafana/tsconfig/base.json using the traditional node_modules strategy, but it can't find it because Yarn PnP doesn't create a node_modules directory. To resolve this issue, we should use the PnP API provided by Yarn to resolve modules if PnP is enabled for the repo. |
Thanks @valerybugakov, that's some awesome investigative work. More breadcrumbs - unmerged PnP PR for typescript: https://github.com/microsoft/TypeScript/pull/35206/files Yarn claim that this PR is automerged by their plugin compat module: https://github.com/yarnpkg/berry/tree/master/packages/plugin-compat Enabled by default, but perhaps it doesn't patch the particular method we use |
context
In some cases if you have
"extends": "@package"
intsconfig.json
, auto-indexer doesn't work, failing with, for example, whereas building normally works:repro
Quickest is
cd packages/grafana-ui && docker run -it -v (pwd):/sources -w /sources sourcegraph/scip-typescript:latest scip-typescript index
considerations
extends
doesn't work at all - the database for scip-typescript itself is perfectly indexable and it uses a shared config as wellThe text was updated successfully, but these errors were encountered: