chartjs / Chart.js

Simple HTML5 Charts using the <canvas> tag
https://www.chartjs.org/
MIT License
64.6k stars 11.9k forks source link

Bower Support Dropped, no dist folder #3081

Closed stephenHartzell closed 8 years ago

stephenHartzell commented 8 years ago

I'm not sure why bower was dropped but the bower install is not sufficient as it does not include a dist folder minified chart.js files or the bundles. Furthermore, I get all a conflict when I also have angular-chart.js in my bower file. The two different chart entries in my bower file clobber eachother and end up removing the dist folder.

etimberg commented 8 years ago

Are you using the npm resolver as mentioned in the docs?

RedSyInc commented 8 years ago

In repository disappeared folder dist

stephenHartzell commented 8 years ago

Yes I am using the npm resolver as described in the docs.

simonbrunel commented 8 years ago

@stephenHartzell reasons explained in this comment. Can you post your bower.json configuration file, and also the content of the chart.js package. I just checked, and dist files should be there.

stephenHartzell commented 8 years ago

@simonbrunel here's my bower.json:

"dependencies": {
    "angular": "^1.5.8",
    "angular-route": "^1.5.8",
    "angular-animate": "^1.5.8",
    "jquery": "^3.1.0",
    "bootstrap": "^3.3.7",
    "angular-bootstrap": "^1.3.3",
    "angular-chart.js": "^1.0.0",
    "angular-scroll": "^1.0.0",
    "chart.js": "npm:chart.js#^2.2.1"
  },
  "resolutions": {
    "jquery": "^3.1.0"
  }

Here's my .bowerrc file:

{
  "resolvers": [
    "bower-npm-resolver"
  ]
}

Starting from scratch (i.e. no bower_components directory) and running bower install produces a syntax error when it gets to chart.js because it's .bower.json looks like this:

{
  "name": "Chart.js",
  "homepage": "https://github.com/nnnick/Chart.js",
  "version": "2.2.1",
  "_release": "2.2.1",
  "_resolution": {
    "type": "version",
    "tag": "v2.2.1",
    "commit": "ab66146013a6b7c687630b414ba8731a6f25337c"
  },
  "_source": "https://github.com/nnnick/Chart.js.git",
  "_target": "2.x"
}_source": "npm:chart.js",
  "_target": "2.2.1",
  "_release": "2.2.1",
  "version": "2.2.1"
}

Note the bad syntax at _source.

The work around, is to delete the chart.js folder and then run bower install npm:chart.js. Then I have all my dependencies. With regard to the dist folder, now it appears each time I run bower install. I swear it wasn't yesterday after starting from scratch several times. In anycase, some of the files are corrupted (such as the .bower.json file) clobbering.

simonbrunel commented 8 years ago

So do you mean it works if no previous version was installed? Looks like bower-npm-resolver messes up if there is already a version installed from a GH repository. If so, we should add that in the documentation.

stephenHartzell commented 8 years ago

That's not quite what I mean. It'd probably be easiest for you to see it or yourself. If you grab that bower.json and run bower install you'll get an error.

emileber commented 8 years ago

That's also kind of a breaking change, which breaks build since it does not respect the semver standard.

simonbrunel commented 8 years ago

@stephenHartzell: I think there is a conflict with the angular-chart.js lib which install the dependency via the GH repo, not npm. It works for me if I remove the angular-chart.js dependency or if I first bower install without the npm:chart.js, then bower install npm:chart.js --save. Anyway, there is a bug here, not sure how to fix it. Maybe @jtblin will have some inputs about it?

pelted commented 8 years ago

I have been usign Chart.js and angular-chart.js in a Rails project for some time. Went to deploy some updates to staging server and rake bower install is failing on this issue. No longer a Chart.js file at the project root or a dist dir.

jtblin commented 8 years ago

@simonbrunel this has been fixed in https://github.com/jtblin/angular-chart.js/pull/453 merged a few days ago.

@pelted you need to use bower-npm-resolver now that Chart.js doesn't include the dist/ folder anymore.

sina-mirhejazi commented 8 years ago

Hi I tried to install ChartJS using this npm-resolver and I got this remote: Repository not found. fatal: repository 'https://github.com/centralway/chart.js.git/' not found

Why we can't use the old way anymore?

MiszczProgramowania commented 8 years ago

same issue

simonbrunel commented 8 years ago

@sina-mirhejazi @MiszczProgramowania, bower should not try to access the git repository with this method. Also, the reported URL is weird, https://github.com/centralway/chart.js.git doesn't exist and I don't think that centralway has something to do with Chart.js (@etimberg, @tannerlinsley, @zachpanz88 ?). Did you guys followed exactly the doc instructions?

RedSyInc commented 8 years ago

Because of bower chart.js repository not found, i had problem with install other bower packages

emileber commented 8 years ago

This looks like a duplicate of #3033

simonbrunel commented 8 years ago

Fixed in version 2.3.0, no need to use bower-npm-resolver anymore, native Bower support is back. Also, the chart.js bower package now points on the correct repository.

simonbrunel commented 8 years ago

@jtblin looks like you will need to revert your bower-npm-resolver change :\