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

Add missing peerDependencies #77

Closed

Conversation

SergeAstapov
Copy link
Contributor

Running commands:

ember addon my-addon -b @embroider/addon-blueprint --pnpm --skip-npm --release-it --typescript
cd my-addon
ppm install

got following errors:

 WARN  Issues with peer dependencies found
my-addon
├─┬ @glint/environment-ember-loose 0.9.7
│ ├── ✕ missing peer @glimmer/component@^1.1.2
│ ├── ✕ missing peer ember-cli-htmlbars@^6.0.1
│ └─┬ @glint/template 0.9.7
│   └── ✕ missing peer @glimmer/component@^1.1.2
└─┬ ember-template-lint 4.18.1
  └─┬ ember-template-imports 3.4.0
    └── ✕ missing peer ember-cli-htmlbars@^6.0.0
Peer dependencies that should be installed:
  @glimmer/component@">=1.1.2 <2.0.0"  ember-cli-htmlbars@">=6.0.1 <7.0.0"  

test-app
├─┬ @ember/test-helpers 2.8.1
│ └─┬ ember-destroyable-polyfill 2.0.3
│   └─┬ ember-compatibility-helpers 1.2.6
│     └─┬ babel-plugin-debug-macros 0.2.0
│       └── ✕ missing peer @babel/core@^7.0.0-beta.42
├─┬ @glimmer/component 1.1.2
│ └─┬ ember-cli-typescript 3.0.0
│   └─┬ @babel/plugin-transform-typescript 7.5.5
│     ├── ✕ missing peer @babel/core@^7.0.0-0
│     ├─┬ @babel/helper-create-class-features-plugin 7.20.2
│     │ └── ✕ missing peer @babel/core@^7.0.0
│     └─┬ @babel/plugin-syntax-typescript 7.20.0
│       └── ✕ missing peer @babel/core@^7.0.0-0
├─┬ ember-data 4.3.0
│ └─┬ @ember-data/adapter 4.3.0
│   └─┬ @ember-data/private-build-infra 4.3.0
│     ├─┬ @babel/plugin-transform-block-scoping 7.20.2
│     │ └── ✕ missing peer @babel/core@^7.0.0-0
│     └─┬ babel-plugin-debug-macros 0.3.4
│       └── ✕ missing peer @babel/core@^7.0.0
└─┬ ember-load-initializers 2.1.2
  └─┬ ember-cli-typescript 2.0.2
    ├─┬ @babel/plugin-proposal-class-properties 7.18.6
    │ └── ✕ missing peer @babel/core@^7.0.0-0
    └─┬ @babel/plugin-transform-typescript 7.4.5
      └── ✕ missing peer @babel/core@^7.0.0-0
Peer dependencies that should be installed:
  @babel/core@">=7.0.0 <8.0.0"

this PR adds those missing peer dependencies to both addon and test-app

@ef4
Copy link
Contributor

ef4 commented Nov 16, 2022

  1. regarding @babel/core:

    It's not really correct to add @babel/core to the test app like this, because it won't actually get used -- it will just be there misleading people. The proper fix will be in ember-cli-babel 8, see [QUEST] v8 Release emberjs/ember-cli-babel#453

  2. regarding ember-template-imports need for ember-cli-htmlbars:

    This seemed weird so I went investigating and it appears to be a bug that ember-template-imports even has a peerDep on ember-cli-htmlbars. As of Do not require parent addon to include ember-cli-htmlbars ember-cli/ember-template-imports#73 it doesn't depend on it at all, and it should remove the peerDep.

  3. regarding glint-environment-ember-loose

    It does seem like these are unfortunately needed, because the types in glint-environment-ember-loose depend on the types in these peers. We should work with the glint team to not need the ember-cli-htmlbars dependency, because it's not a great namespace to be using for this purpose. There is Ember first-class API instead (@ember/template-compilation).

@ef4
Copy link
Contributor

ef4 commented Nov 16, 2022

I would really prefer if newly-generated v2 addons didn't need all the glint-environment-loose stuff at all, but I don't actually know whether you can use glint-environemnt-ember-template-imports without it.

I think you could still be compatible with apps that are using loose mode glint by providing a type module for them to incorporate into their template registry, as described in typed-ember/glint#439

@SergeAstapov
Copy link
Contributor Author

SergeAstapov commented Nov 16, 2022

Thanks for looking into this @ef4!

For 1. I still seem confused, as emberjs/ember-cli-babel#453 talks about making @babel/core peerDependency of ember-cli-babel itself, which means the app need to have it in devDependencies or dependencies?
Seem I missing something.

For 2. created ember-cli/ember-template-imports#87

For 3. this is above my "paygrade" 🙈 may try to tackle if find some time and courage but doubt will be able to

@ef4
Copy link
Contributor

ef4 commented Nov 16, 2022

Correct, the app will add babel/core. But the difference is that ember-cli-babel 8 will actually use that copy. ember-cli-babel 7 will not (at least not reliably).

@ef4
Copy link
Contributor

ef4 commented Jan 31, 2023

I think this is stale now and some of this is already addressed, we can reopen as needed.

@ef4 ef4 closed this Jan 31, 2023
@SergeAstapov SergeAstapov deleted the add-peer-deps branch January 31, 2023 19:38
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

Successfully merging this pull request may close these issues.

2 participants