-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
NPM/PNPM: Add support for peer dependencies #95
Comments
@mnonnenmacher Harp.gl has multiple peer dependency on three.js see https://github.com/heremaps/harp.gl/blob/e3110f1dc35a889059ba23faefc76e3a4c1cfe73/%40here/harp-debug-datasource/package.json#L42 Now ORT does not pick up the core library that powers harp.gl |
Good write-up about what peer dependencies actually are: https://nodejs.org/en/blog/npm/peer-dependencies/. Basically, peer dependencies define against what API of a "host" package a (plugin) package has been written. A problem is that different NPM versions behave differently WRT to peer dependencies, quoting the article:
|
ORT does not support `peerDependencies` yet [1]. That is mostly because handling of peer dependencies varies with NPM versions: Some versions do install them by default, some do not [2]. This results in ORT's functional tests to fail depending on the NPM version, and as it turn out, they would fail with the NPM version 7 currently used in ORT's `Dockerfile`. Avoid that by simply not using peer dependencies for testing for now. [1]: #95 [2]: https://nodejs.org/en/blog/npm/peer-dependencies#using-peer-dependencies Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
ORT does not support `peerDependencies` yet [1]. That is mostly because handling of peer dependencies varies with NPM versions: Some versions do install them by default, some do not [2]. This results in ORT's functional tests to fail depending on the NPM version, and as it turn out, they would fail with the NPM version 7 currently used in ORT's `Dockerfile`. Howver, tests succeed on Azure CI which uses NPM 6. Avoid that issue by simply not using peer dependencies for testing for now. [1]: #95 [2]: https://nodejs.org/en/blog/npm/peer-dependencies#using-peer-dependencies Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
ORT does not support `peerDependencies` yet [1]. That is mostly because handling of peer dependencies varies with NPM versions: Some versions do install them by default, some do not [2]. This results in ORT's functional tests to fail depending on the NPM version, and as it turn out, they would fail with the NPM version 7 currently used in ORT's `Dockerfile`. However, tests succeed on Azure CI which uses NPM 6. Avoid that inconsistency by simply not using peer dependencies at all for testing for now. [1]: #95 [2]: https://nodejs.org/en/blog/npm/peer-dependencies#using-peer-dependencies Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
ORT does not support `peerDependencies` yet [1]. That is mostly because handling of peer dependencies varies with NPM versions: Some versions do install them by default, some do not [2]. This results in ORT's functional tests to fail depending on the NPM version, and as it turns out, they would fail with the NPM version 7 currently used in ORT's `Dockerfile`. However, tests succeed on Azure CI which uses NPM 6. Avoid that inconsistency by simply not using peer dependencies at all for testing for now. [1]: #95 [2]: https://nodejs.org/en/blog/npm/peer-dependencies#using-peer-dependencies Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
ORT does not support `peerDependencies` yet [1]. That is mostly because handling of peer dependencies varies with NPM versions: Some versions do install them by default, some do not [2]. This results in ORT's functional tests to fail depending on the NPM version, and as it turns out, they would fail with the NPM version 7 currently used in ORT's `Dockerfile`. However, tests succeed on Azure CI which uses NPM 6. Avoid that inconsistency by simply not using peer dependencies at all for testing for now. [1]: #95 [2]: https://nodejs.org/en/blog/npm/peer-dependencies#using-peer-dependencies Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
…ncies NPM's peer dependencies are not regular dependencies in a "peer" scope, but 'Some way of saying, "I only work when plugged in to version 1.2.x of my host package, so if you install me, be sure that it's alongside a compatible host."' [1]. So they are more like what Gradle would call a "dependency constraint" [2]. As any recent version of NPM "will automatically install peerDependencies if they are not explicitly depended upon higher in the dependency tree" [3], ORT's NPM implementation will pick them up when parsing the installed modules, so no further handling is needed. Resolves #95. [1]: https://nodejs.org/en/blog/npm/peer-dependencies#the-solution-peer-dependencies [2]: https://docs.gradle.org/current/userguide/dependency_management_terminology.html#sub:terminology_dependency_constraint [3]: https://nodejs.org/en/blog/npm/peer-dependencies#using-peer-dependencies Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
…ncies NPM's peer dependencies are not regular dependencies in a "peer" scope, but 'Some way of saying, "I only work when plugged in to version 1.2.x of my host package, so if you install me, be sure that it's alongside a compatible host."' [1]. So they are more like what Gradle would call a "dependency constraint" [2]. As any recent version of NPM "will automatically install peerDependencies if they are not explicitly depended upon higher in the dependency tree" [3], ORT's NPM implementation will pick them up when parsing the installed modules, so no further handling is needed. Resolves #95. [1]: https://nodejs.org/en/blog/npm/peer-dependencies#the-solution-peer-dependencies [2]: https://docs.gradle.org/current/userguide/dependency_management_terminology.html#sub:terminology_dependency_constraint [3]: https://nodejs.org/en/blog/npm/peer-dependencies#using-peer-dependencies Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Add support for the peerDependencies scope to NPM. Be aware that the specific version of the peer dependency will only be resolved in the context of a project using the library.
npm-install-peers can be used to install peer dependencies, see this relevant ticket:
spatie/npm-install-peers#13
The text was updated successfully, but these errors were encountered: