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

bug: ember-cli does not respect yarn/npm/pnpm overrides/resolutions for addons #10047

Open
runspired opened this issue Oct 11, 2022 · 0 comments

Comments

@runspired
Copy link
Contributor

Currently, ember-cli will error if "name" in package.json does not match the name in index.js, for instance:

ember-cli: Your names in package.json and index.js should match. The addon in /Users/cthoburn/github/ember-maybe-in-element currently have '@runspired-forks/ember-maybe-in-element' in package.json and 'ember-maybe-in-element' in index.js. Until ember-cli v3.9, this error can be disabled by setting env variable EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH to "true". For more information about this workaround, see: https://github.com/ember-cli/ember-cli/pull/7950.

This unfortunately prevents someone from properly using overrides to selectively replace a dependency with a different compatible dependency.

For instance, to publish a forked dependency on npm you must change the name in package.json. This unfortunately results in the package name also changing from ember-cli's perspective. If you manually override this in index.js you get the error above, if you do not manually override the name in index.js you end up with a runtime error because the component will be given an unexpected name in the registry.

I think we should special case overrides/resolutions to allow the name mismatch so long as the name matches the originally specified package name in the parent project.

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

1 participant