From ff1146c82edc13352cc634d7a7cd784bc965bcaa Mon Sep 17 00:00:00 2001 From: Jeff Sagal Date: Sun, 12 Jun 2016 14:30:52 -0700 Subject: [PATCH] update build hooks, bump readme --- README.md | 4 ++-- build/build.js | 34 ++++++++++++++++++++++------------ config/index.js | 2 +- index.html | 13 +++++++------ 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7a3008c..e98c1fa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# vue-select [![Build Status](https://travis-ci.org/sagalbot/vue-select.svg?branch=master)](https://travis-ci.org/sagalbot/vue-select) [![Code Climate Rating](https://img.shields.io/codeclimate/github/sagalbot/vue-select.svg?style=flat-square)](https://codeclimate.com/github/sagalbot/vue-select) [![Code Coverage](https://img.shields.io/codeclimate/coverage/github/sagalbot/vue-select.svg?style=flat-square)](https://codeclimate.com/github/sagalbot/vue-select) [![No Dependencies](https://img.shields.io/gemnasium/sagalbot/vue-select.svg?style=flat-square)](https://gemnasium.com/github.com/sagalbot/vue-select) ![MIT License](https://img.shields.io/github/license/sagalbot/vue-select.svg?style=flat-square) ![Current Release](https://img.shields.io/github/release/sagalbot/vue-select.svg?style=flat-square) +# vue-select [![Build Status](https://travis-ci.org/sagalbot/vue-select.svg?branch=master)](https://travis-ci.org/sagalbot/vue-select) [![Code Coverage](https://img.shields.io/codeclimate/coverage/github/sagalbot/vue-select.svg?style=flat-square)](https://codeclimate.com/github/sagalbot/vue-select) [![No Dependencies](https://img.shields.io/gemnasium/sagalbot/vue-select.svg?style=flat-square)](https://gemnasium.com/github.com/sagalbot/vue-select) ![MIT License](https://img.shields.io/github/license/sagalbot/vue-select.svg?style=flat-square) ![Current Release](https://img.shields.io/github/release/sagalbot/vue-select.svg?style=flat-square) -> Rather than bringing in jQuery just to use Select2 or Chosen, this Vue.js component provides similar functionality without the extra overhead of jQuery, while providing the same awesome data-binding features you expect from Vue. Vue-select has no JavaScript dependencies other than Vue, and is designed to mimic [Select2](https://github.com/select2/select2). +> A native Vue.js component that provides similar functionality to Select2 without the overhead of jQuery. Vue-select has no JavaScript dependencies other than Vue, and is designed to mimic [Select2](https://github.com/select2/select2). #### Features diff --git a/build/build.js b/build/build.js index f666313..b8965b5 100644 --- a/build/build.js +++ b/build/build.js @@ -10,9 +10,9 @@ var ghpages = require('gh-pages') var webpackConfig = require('./webpack.prod.conf') console.log( - ' Tip:\n' + - ' Built files are meant to be served over an HTTP server.\n' + - ' Opening index.html over file:// won\'t work.\n' + ' Tip:\n' + + ' Built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' ) var spinner = ora('building for production...') @@ -24,13 +24,23 @@ mkdir('-p', assetsPath) cp('-R', 'static/', assetsPath) webpack(webpackConfig, function (err, stats) { - spinner.stop() - if (err) throw err - process.stdout.write(stats.toString({ - colors: true, - modules: false, - children: false, - chunks: false, - chunkModules: false - }) + '\n') + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, + chunks: false, + chunkModules: false + }) + '\n') + + // $ npm run build publish + // This will publish /dist/ to the gh-pages + if (( process.argv.indexOf('publish') > 1 )) { + spinner = ora('Publishing to GitHub Pages...').start() + ghpages.publish(path.join(__dirname, '../dist'), function (err) { + spinner.stop() + if (err) throw err + }); + } }) diff --git a/config/index.js b/config/index.js index 9903ccc..0736cd0 100644 --- a/config/index.js +++ b/config/index.js @@ -7,7 +7,7 @@ module.exports = { index: path.resolve(__dirname, '../dist/index.html'), assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: '', - assetsPublicPath: '/', + assetsPublicPath: ( process.argv.indexOf('publish') > 1 ) ? 'http://sagalbot.github.io/vue-select/' : '/', productionSourceMap: true }, dev: { diff --git a/index.html b/index.html index cfafd51..982074b 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - Vue Select | VueJS Select2/Chosen Component + Vue Select | VueJS Select2 Component @@ -12,16 +12,17 @@ + + + + + + - - - - -