colapdev / ngx-britecharts

@colap-dev/ngx-britecharts is an Angular2 library for creating and displaying Britecharts charts (https://github.com/eventbrite/britecharts/) in your web application using D3.js v4. Checkout the demo: https://colapdev.github.io/ngx-britecharts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bad commit hash for britecharts dependency

ergwun opened this issue · comments

I have a project with a npm-shrinkwrap.json including the following:

   "@colap-dev/ngx-britecharts": {
      "version": "0.5.4",
      "resolved": "https://registry.npmjs.org/@colap-dev/ngx-britecharts/-/ngx-britecharts-0.5.4.tgz",
      "integrity": "sha1-MDPxaTtd1q7VDIBBP4/Yp8a1BDc=",
      "requires": {
        // ......
        "britecharts": "github:martinmanzo/britecharts#b3d501bab99390ef61e7879221f2ff10b22441ae",
        // ......
      },
      // .....
   }

But that commit (b3d501bab99390ef61e7879221f2ff10b22441ae) does not exist.
I can still build files on machines that have that version of britecharts in their npm cache, but on other machines npm install will fail:

npm install
EXEC : Unhandled rejection error : Command failed: C:\Program Files\Git\cmd\git.EXE checkout b3d501bab99390ef61e7879221f2ff10b22441ae 
fatal: reference is not a tree: b3d501bab99390ef61e7879221f2ff10b22441ae

I can only assume that some history re-writing has taken place in the martinmanzo/britecharts repository.

I can see that the currently published spec for ngx-britecharts version 0.5.4 uses "github:martinmanzo/britecharts#fork-master" as the version for the britecharts dependency, which does not seem like a correct way to ensure no breaking changes are accidentally included in new builds.

How can I ensure that my project continues to build using the same versions of britecharts that it has been previously, without relying on copying from my npm cache?

All I can think of is to try and work out which version of britecharts was actually used by comparing the contents of the zipped package in the npm cache with the history of the martinmanzo/britecharts repo, and then hand-code the commit in the npm-shrinkwrap.json file, but this does not seem a good way to go. Also if the martinmanzo/britecharts repo really has had history re-written, then I am not even guaranteed to find the correct version there.

Hi @ergwun, thanks for using ngx-britecharts.

We released a new major version of the library (v 1.0.1) some time ago. Up until that time we used a custom fork of Britecharts as we needed some pull requests on their side to be accepted and released.

This new version now depends directly from the package published and maintained by Britecharts.
See: https://github.com/colapdev/ngx-britecharts/blob/master/package.json#L41

There were changes made to the API of the components also.

If you wish you could update to this production ready version or I can try to find out which version of britecharts you need. You should be able to use the current version as they haven't released a major version in some time.

Sorry for the inconvinience.

Hi @martinmanzo ,

Thanks for your reply.

I'm planning on using the version of britecharts I retrieved from my npm cache until the project upgrades to the new version of ngx-britecharts.

I guess my real question was: have I understood this correctly and that commit from the britecharts fork is no longer in the public github repository, or am I missing something?

Cheers :)

Yep, you are right, it was my mistake.

Let me know if I can help you with something more and thanks for using nxg-britecharts!