swimlane / ngx-graph

Graph visualization library for angular
https://swimlane.github.io/ngx-graph
MIT License
939 stars 288 forks source link

Version published to NPM doesn't have the correct ngx-charts dependency ! #35

Closed Gimly closed 6 years ago

Gimly commented 7 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior The version currently published on NPM has @swimlane/ngx-charts version 6.1.0 listed as a dependency. This version of ngx-charts is itself dependent on angular 4.x. This creates a type mismatch between the version needed by ngx-charts-dag and ngx-charts and creates that kind of error:

npm WARN @swimlane/ngx-charts-dag@3.0.0 requires a peer of @angular/animations@^4.0.1 | ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @swimlane/ngx-charts-dag@3.0.0 requires a peer of @angular/common@^4.0.1 | ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @swimlane/ngx-charts-dag@3.0.0 requires a peer of @angular/core@^4.0.1 | ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @swimlane/ngx-charts-dag@3.0.0 requires a peer of d3@^4.7.4 but none is installed. You must install peer dependencies yourself.
npm WARN @swimlane/ngx-charts@6.1.0 requires a peer of @angular/common@^4.2.x but none is installed. You must install peer dependencies yourself.
npm WARN @swimlane/ngx-charts@6.1.0 requires a peer of @angular/core@^4.2.x but none is installed. You must install peer dependencies yourself.
npm WARN @swimlane/ngx-charts@6.1.0 requires a peer of d3@^4.9.x but none is installed. You must install peer dependencies yourself.

Here are the current info from NPM:

> npm view @swimlane/ngx-charts-dag dependencies
{ '@swimlane/ngx-charts': '^6.1.0', dagre: '^0.7.4' }

> npm view @swimlane/ngx-charts-dag peerDependencies
{ '@angular/animations': '^4.0.1 | ^5.0.0',
  '@angular/common': '^4.0.1 | ^5.0.0',
  '@angular/core': '^4.0.1 | ^5.0.0',
  d3: '^4.7.4',
  rxjs: '^5.0.3' }

> npm view @swimlane/ngx-charts@6.1.0 peerDependencies
{ '@angular/common': '^4.2.x',
  '@angular/core': '^4.2.x',
  d3: '^4.9.x',
  rxjs: '^5.0.x' }

You can see that version 3.0 of ngx-charts-dag and version 6.1.0 of ngx-charts don't use the same version of Angular.

Expected behavior ngx-charts-dag should depend on the latest version of ngx-charts which supports version 5.x of Angular. It should also remove Angular 4.x from its peer dependencies since 4.x won't be compatible with ngx-charts anyway. I can see that the version of package.json in the repository has been corrected, but the changes don't seem to have been pushed to NPM.

Reproduction of the problem Try to do an install with an Angular 5 project.

What is the motivation / use case for changing the behavior? The current deployed version on NPM is not working at all with Angular 5

Gimly commented 6 years ago

Sorry if I'm a bit pushy, but that issue is already solved in the repo, all there needs to be done is push a new version to NPM. And it's breaking the download of the current version.

kenisteward commented 6 years ago

@marjan-georgiev

I'm having this same issue. since ngx-charts-dag declares ^6.1.0 of ngx-charts as a full dependency it uses that version and currently has breaking problems because it does not use ngx-charts ^7.0.1

Do note: ^6.1.0 only means within the 6.0.0 family and not greater than 6. Same goes for the ^4.4.6 dev dependencies. those hsould also be updated to 5.0.0 for dev

davidames commented 6 years ago

I'm in the same boat - and a push to NPM would solve #20 for me, which would allow me to use this lib on a new project :)

marjan-georgiev commented 6 years ago

Published 3.0.1. Please let me know if this fixes the issue.

kenisteward commented 6 years ago

@marjan-georgiev just putting the component on the screen i'm getting

webpack-internal:///../../../core/esm5/core.js:1546 ERROR Error: Uncaught (in promise): Error: StaticInjectorError[InjectionService]: StaticInjectorError[InjectionService]: NullInjectorError: No provider for InjectionService!

gonna go back through and make sure i'm not missing a dependency or something.

isaacplmann commented 6 years ago

The InjectionService is being provided by ngx-charts. Can you check that it appears in node_modules/@swimlane/ngx-charts?

kenisteward commented 6 years ago

@isaacplmann it is showing up (.d.ts and .js files) but for some reason i'm still gettin gthat error gonna delete my node_modules and try a reinstall

kenisteward commented 6 years ago

@isaacplmann I'm still getting the error even though the files are there. any suggestions?

isaacplmann commented 6 years ago

Try creating a reproduction on stackblitz.com - that will help us debug it.

kenisteward commented 6 years ago

@isaacplmann I'm not getting errors when I do it on stack blitz even incorporating the other libraries i'm using. Further looking into this to see what the problem is

kenisteward commented 6 years ago

@isaacplmann @marjan-georgiev my problem had to do with MouseWheelDirective not having the up/down emitters defined which was fixed in 4.0.0 but is not released yet.

I have another issue incorporating with another library but i want to see if this fixes that first before I add that stuff here.

image

kenisteward commented 6 years ago

@isaacplmann @marjan-georgiev would it be possible to release 4.0.0 to npm today?

marjan-georgiev commented 6 years ago

@kenisteward it is already released, but the package was renamed to @swimlane/ngx-graph.

Please take a look at the breaking changes in this PR's description and what you need to do to upgrade: https://github.com/swimlane/ngx-graph/pull/38

kenisteward commented 6 years ago

@marjan-georgiev thanks will give it a try!

kenisteward commented 6 years ago

@marjan-georgiev I suggest marking the previous library as deprecated and adding it in the readme so people don't use the incorrect one.

Also i'm currently still getting the same error

isaacplmann commented 6 years ago

@kenisteward Please open a separate issue for the MouseWheelDirective error.