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

Add support for Yarn PNP #563

Open
0az opened this issue Sep 25, 2020 · 7 comments
Open

Add support for Yarn PNP #563

0az opened this issue Sep 25, 2020 · 7 comments

Comments

@0az
Copy link

0az commented Sep 25, 2020

There's a couple spots that need patches:

  • Generated configs (extends: ./node_modules/gts, etc)
  • execa calls to node ./node_modules/*

Implementation thoughts:

  • Check for .yarn? Hacky.
  • ESLint API? Probably a better idea. More work.
@hqnna
Copy link

hqnna commented Jan 15, 2021

This would be really nice, probably the only thing preventing me from using yarn pnp.

@hqnna
Copy link

hqnna commented Jan 18, 2021

made a very hacky bash script to setup a new project using gts and yarn pnp
https://gist.github.com/xpyxel/69adecbf2661eca104cdd49fd8ba1af1

you can setup a new project with curl -sL https://git.io/JtIw7 | bash -s <editor sdk here>

most things seem to be working except for eslint-plugin-node from what it looks like

@hqnna
Copy link

hqnna commented Jan 19, 2021

After doing some more research on the matter I'm going to attempt to get eslint-plugin-node working with the script, no promises that it will work, but if it does, gts will be "fully working" in a sense.

@hqnna
Copy link

hqnna commented Jan 19, 2021

So the issue with the eslint plugins and other things is that due to how yarn's pnp works, they have to be under dependencies of the root project, i.e the project you're making that depends on gts, otherwise since your extending their configuration(s), it won't be able to access them currently.

@hqnna
Copy link

hqnna commented Jan 19, 2021

Decided to go all out and made a template repo that sets up mostly everything for you, just need to run a few commands and you have a fully setup yarn + gts env. https://github.com/xpyxel/gts-pnp

@jaismith
Copy link

was this issue ever resolved? trying to set up gts in my pnp project and getting the following error:

1 $ yarn lint
version: 16
/Users/jaismith/Developer/doc/trailhead/.pnp.cjs:33932
    throw firstError;
    ^

Error: Qualified path resolution failed - none of those files can be found on the disk.

Source path: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint
Not found: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint
Not found: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint.js
Not found: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint.json
Not found: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint.node

    at Function.external_module_.Module._resolveFilename (/Users/jaismith/Developer/doc/trailhead/.pnp.cjs:33931:55)
    at Function.external_module_.Module._load (/Users/jaismith/Developer/doc/trailhead/.pnp.cjs:33730:48)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47

@hqnna
Copy link

hqnna commented Oct 27, 2021

@jaismith i ended up just making my own thing similar: https://github.com/stacknine/ts-pnp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants