yarnpkg/berry

[Bug] VSCode pnpify is a no-op (workspaces)

Closed this issue · 6 comments

  • I'd be willing to implement a fix

Describe the bug

I run yarn pnpify --sdk and it outputs "Nothing to do.".

To Reproduce

milesj/build-tool-config#10

Screenshots

Screen Shot 2020-01-24 at 21 38 19

Environment if relevant (please complete the following information):

  • OS: OSX
  • Node version 10.18
  • Yarn version 2.0.0-rc1

Additional context

I have this in .vscode/settings.json.

{
  "files.exclude": {
    "node_modules/@milesj/build-tools/**/configs/": true,
    "node_modules/@milesj/build-tools/**/dotfiles/": true,
    "node_modules/@milesj/build-tools/**/scripts/": true,
    "packages/core/**/configs/": true,
    "packages/core/**/dotfiles/": true,
    "packages/core/**/scripts/": true,
    "**/.vscode/": true,
    "**/node_modules/": true,
    "**/.eslintrc.js": true,
    "**/.eslintignore": true,
    "**/.prettierignore": true,
    "**/prettier.config.js": true,
    "**/test.log": true,
    "**/tsconfig.eslint.json": true,
    "**/yarn-error.log": true,
    "**/babel.config.js": true,
    "**/jest.config.js": true,
    "**/*.tsbuildinfo": true,
    "packages/core/configs": true,
    "packages/core/scripts": true,
    "packages/core/templates": true,
    "**/*.d.ts": true,
    "**/*.d.ts.map": true
  }
}
deini commented

👋 It is expecting prettier, typescript, and eslint as dependencies at the root level.

@deini Perhaps it should also look through workspace packages, or even just check the lock file, because those aren't always going to be in the root.

Did that and installed all the SDKs, set the TS version in VSCode, yet the TS imports still won't resolve.

Screen Shot 2020-01-24 at 22 09 53

@milesj Yarn 2 is strict about dependencies. Your package @milesj/build-tool-config located in packages/config does not declare dependency on @beemo/core, but uses it. If you add @beemo/core to packages/config/package.json dependencies, run yarn and restart VS Code the problem will be gone. We need to add TypeScript watch support to v2 compat plugin, thats why the VS Code restart step is required for now

+1 on this

As stated Typescript is most probably installed globally, but not required by Typescript so yarn should not assume this, in my opinion. (e.g: you can have mixed codebase).
This is even more clear with stylelint, in monorepo UI/design can be (will be) in a separate workspace.

Closing issue, since @deini and I have answered the author on the original issue. @bodinsamuel Please open a new issue, since your issue is different