Closed maxmumford closed 3 years ago
The flow you described applies to "regular" npm packages. The hello world is a component. It should not be marked as interdependencies, but as a dependency, and the Angular compiler should whitelist it automatically.
Hey @Tallyb thanks for your message. Is marking the component as a dependency as opposed to interdependency something I should do, or is that an issue with the angular compiler env? If the former, could you provide a bit more info?
@maxmumford I have released 9.0.12 of the angular compiler which bypasses the dependencies whitelisting. Can you try it?
@Tallyb after upgrading to 9.0.12 I could remove the explicit dependency / peerDependency overrides in my package.json and compile the component without angular complaining about dependencies being included in the package. However peer dependencies were still listed as dependencies in bit show
.
I am still having this issue. Is there a fix for it?
║ Id │ atoms/button ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Compiler │ bit.envs/compilers/angular@9.0.21 ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Language │ javascript ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Main File │ src/components/atoms/button/index.ts ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Dependencies │ pargo.black-and-yellow/styles@0.0.1 ║
║ │ @angular/material@^10.1.3 ║
║ │ @storybook/angular@^6.0.20 ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Dev Dependencies │ tslib@>=1.0.0 ║
║ │ webpack-env@>=0.8.0 ║
║ │ @angular/core@>= 8.0.0 ║
║ │ @angular/common@>= 8.0.0 ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Peer Dependencies │ @angular/common@^9.0.0 ║
║ │ @angular/core@^9.0.0 ║
║ │ @angular/platform-browser@^9.0.0 ║
║ │ @angular/router@^9.0.0 ║
╟───────────────────┼────────────────────────────────────────────────────╢
║ Files │ src/components/atoms/button/button.html ║
║ │ src/components/atoms/button/button.interface.ts ║
║ │ src/components/atoms/button/button.scss ║
║ │ src/components/atoms/button/button.ts ║
║ │ src/components/atoms/button/data/button.mockdata.t ║
║ │ s ║
║ │ src/components/atoms/button/index.ts ║
║ │ src/components/atoms/button/package.json ║
║ │ src/components/atoms/button/stories/button.stories ║
║ │ .ts ║
╚═══════════════════╧════════════════════════════════════════════════════╝
button.scss
@import "src/assets/scss/base/breakpoints.scss"; @import "src/assets/scss/base/variables.scss"; @import "src/assets/scss/base/colors.scss";
styles: pargo.black-and-yellow/styles@0.0.1
║ Id │ styles@0.0.1 ║
╟──────────────────┼────────────────────────────────────────────────────╢
║ Language │ javascript ║
╟──────────────────┼────────────────────────────────────────────────────╢
║ Main File │ src/assets/scss/index.scss ║
╟──────────────────┼────────────────────────────────────────────────────╢
║ Dependencies │ ║
╟──────────────────┼────────────────────────────────────────────────────╢
║ Dev Dependencies │ ║
╟──────────────────┼────────────────────────────────────────────────────╢
║ Files │ src/assets/scss/base/base.scss ║
║ │ src/assets/scss/base/breakpoints.scss ║
║ │ src/assets/scss/base/buttons.scss ║
║ │ src/assets/scss/base/colors.scss ║
║ │ src/assets/scss/base/document.scss ║
║ │ src/assets/scss/base/fonts.scss ║
║ │ src/assets/scss/base/forms.scss ║
║ │ src/assets/scss/base/heading.scss ║
║ │ src/assets/scss/base/icons.scss ║
║ │ src/assets/scss/base/links.scss ║
║ │ src/assets/scss/base/plugins.scss ║
║ │ src/assets/scss/base/typography.scss ║
║ │ src/assets/scss/base/variables.scss ║
║ │ src/assets/scss/index.scss ║
╚══════════════════╧════════════════════════════════════════════════════╝
I saw this issue on ng-packager: https://github.com/ng-packagr/ng-packagr/issues/716 and I want to know if it can be helpful to disable whitelistedNonPeerDependencies? and what can be the side effect of it?
Hi, this issue was fixed by @lifaon74 https://github.com/teambit/envs/pull/154 Please use this version: https://bit.dev/bit/envs/compilers/angular?version=9.0.22
Describe the bug
Peer dependencies are being added as regular dependencies. When the angular compiler runs ng-packager, it throws the following warning and error as a result:
Steps to Reproduce
Expected Behavior
As per the dependency graph resolution flow chart, due to the fact that the hello-world component is included in the peerDependencies section of the workspaces root package.json, I woud expect the hello-world component to be added as a peerDependency and show up as such when running bit show hello-world. ng-packager would no longer throw an error during compliation and the angular component would compile.
Screenshots, exceptions and logs
Bit build command:
bit show greeting:
package.json
Specifications
Additional Context
Potentially related issues:
teambit/bit#2220 teambit/bit#2217