Drop official support for Bower

Remove the bower.json file and update the documentation with the alternative bower-npm-resolver solution.
This commit is contained in:
Simon Brunel
2016-05-25 20:53:02 +02:00
parent 782b84ae94
commit c6318749da
4 changed files with 25 additions and 24 deletions

View File

@@ -10,13 +10,14 @@
You can download the latest version of [Chart.js on GitHub](https://github.com/chartjs/Chart.js/releases/latest) or just use these [Chart.js CDN](https://cdnjs.com/libraries/Chart.js) links.
To install via npm / bower:
To install via npm:
```bash
npm install chart.js --save
bower install Chart.js --save
```
To Install via bower, please follow [these instructions](http://www.chartjs.org/docs/#getting-started-installation).
## Documentation
You can find documentation at [www.chartjs.org/docs](http://www.chartjs.org/docs). The markdown files that build the site are available under `/docs`. Previous version documentation is available at [www.chartjs.org/docs/#notes-previous-versions](http://www.chartjs.org/docs/#notes-previous-versions).

View File

@@ -1,14 +0,0 @@
{
"name": "Chart.js",
"version": "2.1.6",
"description": "Simple HTML5 Charts using the canvas element",
"homepage": "https://github.com/chartjs/Chart.js",
"author": "nnnick",
"license": "MIT",
"main": [
"dist/Chart.js"
],
"devDependencies": {
"jquery": "~2.1.4"
}
}

View File

@@ -9,13 +9,30 @@ You can download the latest version of [Chart.js on GitHub](https://github.com/c
### Installation
To install via npm / bower:
#### npm
```bash
npm install chart.js --save
```
#### bower
Bower support has been dropped since version 2.2.0 but you can still use Chart.js with Bower thanks to [bower-npm-resolver](https://www.npmjs.com/package/bower-npm-resolver).
First, add the resolver in your .bowerrc file:
```json
{
"resolvers": [
"bower-npm-resolver"
]
}
```
Then:
```bash
bower install Chart.js --save
npm install -g bower-npm-resolver
bower install npm:chart.js --save
```
### Selecting the Correct Build
@@ -24,7 +41,7 @@ Chart.js provides two different builds that are available for your use. The `Cha
The `Chart.bundle.js` and `Chart.bundle.min.js` builds include Moment.js in a single file. This version should be used if you require time axes and want a single file to include, select this version. Do not use this build if your application already includes Moment.js. If you do, Moment.js will be included twice, increasing the page load time and potentially introducing version issues.
### Installation
### Usage
To import Chart.js using an old-school script tag:

View File

@@ -14,7 +14,6 @@ var gulp = require('gulp'),
exec = require('child_process').exec,
fs = require('fs'),
package = require('./package.json'),
bower = require('./bower.json'),
karma = require('gulp-karma'),
browserify = require('browserify'),
streamify = require('gulp-streamify'),
@@ -121,7 +120,7 @@ function packageTask() {
/*
* Usage : gulp bump
* Prompts: Version increment to bump
* Output: - New version number written into package.json & bower.json
* Output: - New version number written into package.json
*/
function bumpTask(complete) {
util.log('Current version:', util.colors.cyan(package.version));
@@ -138,13 +137,11 @@ function bumpTask(complete) {
newVersion = semver.inc(package.version, increment),
oldVersion = package.version;
// Set the new versions into the bower/package object
// Set the new versions into the package object
package.version = newVersion;
bower.version = newVersion;
// Write these to their own files, then build the output
fs.writeFileSync('package.json', JSON.stringify(package, null, 2));
fs.writeFileSync('bower.json', JSON.stringify(bower, null, 2));
var oldCDN = 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/'+oldVersion+'/Chart.min.js',
newCDN = 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/'+newVersion+'/Chart.min.js';