From 9ec7eba3880abc910beade14ef09d021e94975aa Mon Sep 17 00:00:00 2001 From: Simon Brunel Date: Wed, 25 May 2016 20:53:02 +0200 Subject: [PATCH] Drop official support to Bower Remove the bower.json file and update the documentation with the alternative bower-npm-resolver solution. --- README.md | 6 +++--- bower.json | 14 -------------- docs/00-Getting-Started.md | 23 ++++++++++++++++++++--- gulpfile.js | 7 ++----- 4 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 bower.json diff --git a/README.md b/README.md index b5df9823354..43dced4fb3d 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ 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 ``` -CDN: https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.4/Chart.min.js + +To Install via bower, please follow [these instructions](http://www.chartjs.org/docs/#getting-started-installation). ## Documentation diff --git a/bower.json b/bower.json deleted file mode 100644 index 1802ae6e7be..00000000000 --- a/bower.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Chart.js", - "version": "2.1.4", - "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" - } -} \ No newline at end of file diff --git a/docs/00-Getting-Started.md b/docs/00-Getting-Started.md index 7810bb4265c..3f8ed184187 100644 --- a/docs/00-Getting-Started.md +++ b/docs/00-Getting-Started.md @@ -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.1.4 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: diff --git a/gulpfile.js b/gulpfile.js index de633f24704..29deacc1ca1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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'), @@ -115,7 +114,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)); @@ -132,13 +131,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';