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

peerDeps issues #310

Open
RobbieTheWagner opened this issue Nov 19, 2024 · 1 comment
Open

peerDeps issues #310

RobbieTheWagner opened this issue Nov 19, 2024 · 1 comment

Comments

@RobbieTheWagner
Copy link

I hit a weird issue today when updating an addon:

Some V1 ember addons are resolving as incorrect peer dependencies. This makes it impossible for us to safely convert them to v2 format.

  👇 👇 👇
👉 See https://github.com/embroider-build/embroider/blob/main/docs/peer-dependency-resolution-issues.md for an explanation of the problem and suggestions for fixing it.
  👆 👆 👆

[email protected] -> [email protected]
    sees peerDep [email protected]
      at /home/runner/work/ember-shepherd/ember-shepherd/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-source
    but [email protected] is using [email protected]+8f23aaf8
      at /home/runner/work/ember-shepherd/ember-shepherd/node_modules/.pnpm/ember-source@https+++s3.amazonaws.com+builds.emberjs.com+beta+shas+8f23aaf87af8a0f8958e462b51_n5h4tv7lxozsvmzhezyyeihkoe/node_modules/ember-source

After talking with @NullVoxPopuli he recommended some specific .npmrc settings to fix it.

Should we add some of this to the blueprints to avoid these issues for others?

@NullVoxPopuli
Copy link
Collaborator

the settings I recommended:

####################
# super strict mode
####################
auto-install-peers=false
strict-peer-dependents=true
resolve-peers-from-workspace-root=false

################
# Optimizations
################
# Less strict, but required for tooling to not barf on duplicate peer trees.
# (many libraries declare the same peers, which resolve to the same
#  versions)
dedupe-peer-dependents=true
public-hoist-pattern[]=ember-source

################
# Compatibility
################
# highest is what everyone is used to, but
# not ensuring folks are actually compatible with declared ranges.
resolution-mode=highest

from: https://github.com/universal-ember/ember-primitives/blob/main/.npmrc

it won't work where a monorepo needs to have multiple ember-source versions, but it simplifies things where you only have one for the whole repo

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

No branches or pull requests

2 participants