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

feat(CLI): add a flag for Yarn Plug'n'Play #1

Closed
wants to merge 4 commits into from
Closed

Conversation

Haroenv
Copy link
Owner

@Haroenv Haroenv commented Nov 14, 2018

This pull request is separated in multiple steps

  1. add the new flag and propagate it
  2. add the pnp webpback plugin
  3. fix use of transitive dependencies (not allowed in pnp mode) (luckily these are all inside gatsby's monorepo)
  4. fix "main" in a dependency: fix: use correct file in "main" of relay-compiler facebook/relay#2573 & Fixes the resolution when a package has an invalid "main" but a valid… yarnpkg/yarn#6682 (after I talked to yarn maintainers)
  5. don't use transitive dependencies at "runtime" (i.e. in cache and public folder of a Gatsby app)

The remaining step (5) is not implemented in this PR (because they touch too many internals of Gatsby):

  • ./.cache
  • ./public
  • eslint

These three steps rely heavily on transitive dependencies. For the first two you can fix it likely by making @reach/router, lodash, prop-types, core-js either not used until someone installs it, or using something like require.resolve. For eslint I couldn't dig deeper which part of Gatsby is relevant, and where the modules eslint-plugin-import, eslint-plugin-flowtype should be listed as direct dependencies.

@Haroenv Haroenv changed the title feat(CLI): add a flag for pnp feat(CLI): add a flag for Yarn Plug'n'Play Nov 14, 2018
`You are using Yarn ${
yarnInfo.yarnVersion
} together with the --use-pnp flag, but Plug'n'Play is only supported starting from the 1.12 release.\n\n` +
`Please update to Yarn 1.12 or higher for a better, fully supported experience.\n`
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will need to update this with the version that comes out of yarnpkg/yarn#6682

yarnVersion = execSync(`yarnpkg --version`)
.toString()
.trim()
hasMinYarnPnp = semver.gte(yarnVersion, `1.12.0`)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will have to update this after yarnpkg/yarn#6682 comes out (since Gatsby has a dependency, relay-compiler which is affected by this bug)

@Haroenv Haroenv closed this Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant