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

Framework support #3333

Open
vjpr opened this issue Apr 9, 2021 · 2 comments
Open

Framework support #3333

vjpr opened this issue Apr 9, 2021 · 2 comments

Comments

@vjpr
Copy link
Contributor

vjpr commented Apr 9, 2021

Tracking popular framework's and their pnpm support.

There are two main issues:

  • a. Bootstrapping support for the package manager e.g. create-react-app --pnpm
  • b. Ensure framework works without errors

a. Bootstrapping

We can track PRs on the framework repos in this issue.

b. Functionality

Here are common approaches for fixing broken packages:

  • .npmrc > public-hoist-pattern[]=x
  • package.json > overrides
    • Patching package internals and publishing new version (e.g @vjpr/metro-0.59.vjpr.1)
    • Pegging a single version to avoid peer dep singleton problems.
  • pnpmfile.js
    • Adding missing deps (due to author's reliance on hoisting in npm/yarn)
  • --shamefully-flatten
    • Nuclear option instead of manually fixing things we other approaches.

The most common issues are:

  • expecting hoisting (flattened node_modules)
  • symlink issues (working with realpaths which reference files outside of the project root dir in the node_modules/.pnpm store)

public-hoist-pattern

There are some defaults built-in.

['*types*', '*eslint*', '@prettier/plugin-*', '*prettier-plugin-*']

Adding things here exposes them to allow packages in your monorepo, instead of having to modify a pnpmfile.js entry for each package, or use overrides.

pnpm.overrides

Useful for patching packages or enforcing a single version to be resolved (good for fixing singletons).

pnpmfile

@vjpr
Copy link
Contributor Author

vjpr commented Apr 9, 2021

LATER: Can probably make this a nice table, or publish on the website (use remark-github to linkify issues from Docusaurus).

Legend
cli-pr = a pr to allow bootstrapping the framework with pnpm (in addition to yarn and npm)
guide = an issue on pnpm repo to track getting the package to work and other PRs open to fix issues with other tools

  • create-react-app - cli-pr
  • expo - guide v40
  • react-native - guide v0.64
  • next.js - TODO
  • gatsby - TODO
  • storybook - TODO
  • docusaurus - TODO

@zkochan
Copy link
Member

zkochan commented Jan 4, 2022

For tools that don't work with symlinks, pnpm now has a new setting: node-linker=hoisted

Released in https://github.com/pnpm/pnpm/releases/tag/v6.25.0-2

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

2 participants