Chart.js: Remove .gitignore from bower package

Created on 17 Jan 2017  路  6Comments  路  Source: chartjs/Chart.js

Expected Behavior

It should not ignore the dist directory when chartjs is installed using bower.

Context

We check-in the dependencies into our source control, because we don't mirror bower packages locally on our servers. When we add Chart.js as bower dependency, the dist folder got ignored from the source control, because of the .gitignore in the bower package. Is it possible to remove the file in the bower package, or is it needed?

Environment

  • Chart.js version: 2.4.0
bug infrastructure

All 6 comments

I installed version 2.4.0 via bower and the dist/ folder wasn't generated at all. This broke our build process since we are using the minified versions of the library. I had to downgrade to 2.3.0, which works fine.

@BrunnerLivio if I'm not wrong, there is no "bower package" because contrary to npm packages, bower packages are simply references over the git repository, meaning that it would require to remove the .gitignore from our release tags, which is something we might not want to change.

Instead, why not simply force add these files: git add --force bower_components/chart.js/dist/*

@tsvetan-ganev that's weird, I just created a fresh bower project, installed chartjs and the dist folder is there. Maybe something related to #3371.

@simonbrunel

meaning that it would require to remove the .gitignore from our release tags, which is something we might not want to change.

I agree with this. Maybe ignore the .gitignore in the bower.json file (Have not tried this, don't know if it works)? Or other projects, like angular translate or AngularJS istelf created a new repository just for their bower packages. As far as I know you chart.js does not do this. (+ as you can see angular and angular-translate also don't have .gitignore in their bower repository, so I suppose Chart.js should do that too?)

I don't think we want to deal with a different repository and change our automated build process for this specific bower use case. Having .gitignore in bower.json looks like the way to go, so we can definitely try this for 2.5. @chartjs/maintainers do you see any (compatibility) issue with that approach?

Still, git add --force would solve your issue immediately.

@simonbrunel I don't have a problem with trying it. I don't think it will break anything, but a quick google couldn't confirm that.

@simonbrunel, you are right. After running bower cache clean, I installed 2.4.0 in an empty directory and the dist/ folder was generated correctly.

It's not the first time that bower behaves unexpectedly so I'm not surprised. Next time when something like this happens, I will clean the cache first. Thanks for pointing me at the solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benmccann picture benmccann  路  3Comments

lizbanach picture lizbanach  路  3Comments

srijitcoder picture srijitcoder  路  3Comments

akashrajkn picture akashrajkn  路  3Comments

gabrieldesouza picture gabrieldesouza  路  3Comments