Compare commits

..

14 Commits

Author SHA1 Message Date
Jakub Juszczak
d9e5d5a5f0 💎 Release new version 3.0.2
Fixed unpkg target
2017-11-07 11:03:36 +01:00
Jakub Juszczak
a5f112e952 📝 Update CHANGELOG 2017-11-06 16:28:13 +01:00
Jakub Juszczak
6e24da3c90 💎 Release new version 3.0.1 2017-11-06 16:25:57 +01:00
Jakub
2f0ab67b79 Merge pull request #246 from apertureless/feature/dependency_and_build_fix
Feature/dependency and build fix
2017-11-06 16:14:58 +01:00
Jakub Juszczak
474b58196e 📝 Update README 2017-11-06 16:06:19 +01:00
Jakub Juszczak
d104e628e2 🐛 Fix webpack externals 2017-11-06 15:41:33 +01:00
Jakub Juszczak
b17602d041 🔥 Remove full build with bundled chart.js 2017-11-06 15:40:43 +01:00
Jakub
0b50728b28 Merge pull request #238 from chakan/en-docs-typo-fix
Typo fix in EN docs
2017-10-29 16:45:32 +01:00
Jakub
9abdaa9f66 Merge pull request #227 from kingkong64/develop
update webpack to version 3
2017-10-29 16:37:13 +01:00
Imre Csige
f19c6a4cfa Typo fix in EN docs
Sorry, it was very annoying to me.
2017-10-29 16:35:25 +01:00
Jakub
d2f2374d7d Merge pull request #232 from music-mind/patch-2
Made some small edits to French README.MD
2017-10-29 16:21:21 +01:00
Arri
d11eb27bc1 Made some small edits to French README.MD
Some edits and typo fixes
2017-10-24 02:58:45 -04:00
Chanwit Piromplad
50130a7a4d update webpack to version 3 2017-10-15 20:34:19 +07:00
Jakub
05d69520af Fix table in readme 2017-10-14 16:47:42 +02:00
41 changed files with 15799 additions and 39113 deletions

View File

@@ -1,5 +1,14 @@
{ {
"presets": ["es2015", "stage-2"], "presets": [
"plugins": ["transform-runtime"], ["@babel/preset-env", {
"modules": false,
"targets": {
"browsers": [
"last 2 versions"
]
}
}],
"@babel/stage-2"
],
"comments": false "comments": false
} }

View File

@@ -1,11 +1,92 @@
# Change Log # Change Log
## [v3.0.1](https://github.com/apertureless/vue-chartjs/tree/v3.0.1) (2017-11-06)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v3.0.0...v3.0.1)
**Closed issues:**
- \[Suggestion\]Loose package dependencies [\#245](https://github.com/apertureless/vue-chartjs/issues/245)
- reactiveData mixin [\#244](https://github.com/apertureless/vue-chartjs/issues/244)
- Customise individual Axis Labels [\#243](https://github.com/apertureless/vue-chartjs/issues/243)
- presets es2015 [\#242](https://github.com/apertureless/vue-chartjs/issues/242)
- Uncaught TypeError: Cannot read property 'transition' of null [\#241](https://github.com/apertureless/vue-chartjs/issues/241)
- Is it possible to create an callback on the onAnimationComplete option [\#240](https://github.com/apertureless/vue-chartjs/issues/240)
- When resizing window, chart returns to first loaded state [\#239](https://github.com/apertureless/vue-chartjs/issues/239)
- Reactively change chart properties [\#237](https://github.com/apertureless/vue-chartjs/issues/237)
- how to enforce the max value on y axis [\#236](https://github.com/apertureless/vue-chartjs/issues/236)
- Chart is not rendered when maintainAspectRatio is set to false and chart container is hidden [\#235](https://github.com/apertureless/vue-chartjs/issues/235)
- How to access Chart.defaults.global [\#234](https://github.com/apertureless/vue-chartjs/issues/234)
- Blank Chart - no data [\#233](https://github.com/apertureless/vue-chartjs/issues/233)
- Maxin with multiple chartData [\#231](https://github.com/apertureless/vue-chartjs/issues/231)
- How to destroy chart before re-rendering? [\#230](https://github.com/apertureless/vue-chartjs/issues/230)
- chnage gridlines color [\#228](https://github.com/apertureless/vue-chartjs/issues/228)
- Stacked bar chart? [\#226](https://github.com/apertureless/vue-chartjs/issues/226)
- Chart crashes when reentering page [\#223](https://github.com/apertureless/vue-chartjs/issues/223)
- 在图表上左右滑动会出现数据错乱的问题 [\#222](https://github.com/apertureless/vue-chartjs/issues/222)
- How do I set the scale of the Y axis? [\#220](https://github.com/apertureless/vue-chartjs/issues/220)
- Upgrading from 2.8.2 to 2.8.3 breaks charts [\#209](https://github.com/apertureless/vue-chartjs/issues/209)
- How to scale the radius property of each bubble in a vue-chartjs bubble chart [\#205](https://github.com/apertureless/vue-chartjs/issues/205)
- Last release is causing problems with Firefox [\#203](https://github.com/apertureless/vue-chartjs/issues/203)
- 🔥 Remove Vue.extend\(\) [\#201](https://github.com/apertureless/vue-chartjs/issues/201)
- Update to webpack@3 [\#134](https://github.com/apertureless/vue-chartjs/issues/134)
**Merged pull requests:**
- Feature/dependency and build fix [\#246](https://github.com/apertureless/vue-chartjs/pull/246) ([apertureless](https://github.com/apertureless))
- Typo fix in EN docs [\#238](https://github.com/apertureless/vue-chartjs/pull/238) ([chakan](https://github.com/chakan))
- Made some small edits to French README.MD [\#232](https://github.com/apertureless/vue-chartjs/pull/232) ([music-mind](https://github.com/music-mind))
- update webpack to version 3 [\#227](https://github.com/apertureless/vue-chartjs/pull/227) ([kingkong64](https://github.com/kingkong64))
## [v3.0.0](https://github.com/apertureless/vue-chartjs/tree/v3.0.0) (2017-10-14)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.8.7...v3.0.0)
**Closed issues:**
- Create an image of the chart to download [\#219](https://github.com/apertureless/vue-chartjs/issues/219)
- How to achieve this effect? [\#218](https://github.com/apertureless/vue-chartjs/issues/218)
- Some Error [\#217](https://github.com/apertureless/vue-chartjs/issues/217)
- Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "chartData" [\#216](https://github.com/apertureless/vue-chartjs/issues/216)
- can't get legendCallback to fire at all [\#212](https://github.com/apertureless/vue-chartjs/issues/212)
- this demo is not support, is it because version older? [\#210](https://github.com/apertureless/vue-chartjs/issues/210)
- how to change value without reload?? [\#208](https://github.com/apertureless/vue-chartjs/issues/208)
- typescript definition? [\#207](https://github.com/apertureless/vue-chartjs/issues/207)
- 使用动态数据时报错 [\#204](https://github.com/apertureless/vue-chartjs/issues/204)
- Commit the final dist js files to github [\#202](https://github.com/apertureless/vue-chartjs/issues/202)
- \[Best Practices❓\] Usage of Private Data [\#182](https://github.com/apertureless/vue-chartjs/issues/182)
- 📝 Update docs & examples - SSR with nuxt [\#172](https://github.com/apertureless/vue-chartjs/issues/172)
- 📝 Update Docs - Section about extending [\#171](https://github.com/apertureless/vue-chartjs/issues/171)
- Register vue-chartjs as vue-plugin? [\#168](https://github.com/apertureless/vue-chartjs/issues/168)
- Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders [\#151](https://github.com/apertureless/vue-chartjs/issues/151)
**Merged pull requests:**
- Feature/v3 [\#225](https://github.com/apertureless/vue-chartjs/pull/225) ([apertureless](https://github.com/apertureless))
- ✏️ Spelling in docs [\#215](https://github.com/apertureless/vue-chartjs/pull/215) ([cugu](https://github.com/cugu))
- Fix inaccuracies in Russian translation [\#214](https://github.com/apertureless/vue-chartjs/pull/214) ([pushkyn](https://github.com/pushkyn))
- Add id docs readme support [\#213](https://github.com/apertureless/vue-chartjs/pull/213) ([tesarwijaya](https://github.com/tesarwijaya))
- French translation for README.md [\#211](https://github.com/apertureless/vue-chartjs/pull/211) ([julienc91](https://github.com/julienc91))
## [v2.8.7](https://github.com/apertureless/vue-chartjs/tree/v2.8.7) (2017-09-16)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.8.6...v2.8.7)
**Closed issues:**
- 真机和浏览器呈现的效果不一样的问题 [\#199](https://github.com/apertureless/vue-chartjs/issues/199)
- can not use npm install? [\#198](https://github.com/apertureless/vue-chartjs/issues/198)
- Reactive Props - Max Call Stack Exceeded Error [\#197](https://github.com/apertureless/vue-chartjs/issues/197)
- Unmet Peer Dependency [\#196](https://github.com/apertureless/vue-chartjs/issues/196)
- Is there a way to update options? [\#195](https://github.com/apertureless/vue-chartjs/issues/195)
- deepmerge [\#194](https://github.com/apertureless/vue-chartjs/issues/194)
- TypeError: Cannot convert undefined or null to object [\#193](https://github.com/apertureless/vue-chartjs/issues/193)
## [v2.8.6](https://github.com/apertureless/vue-chartjs/tree/v2.8.6) (2017-09-12)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.8.5...v2.8.6)
## [v2.8.5](https://github.com/apertureless/vue-chartjs/tree/v2.8.5) (2017-09-12) ## [v2.8.5](https://github.com/apertureless/vue-chartjs/tree/v2.8.5) (2017-09-12)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.8.4...v2.8.5) [Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.8.4...v2.8.5)
**Closed issues:** **Closed issues:**
- TypeError: Cannot convert undefined or null to object [\#193](https://github.com/apertureless/vue-chartjs/issues/193)
- Chart error since the addition of deepmerge in build 2.8.4 [\#192](https://github.com/apertureless/vue-chartjs/issues/192) - Chart error since the addition of deepmerge in build 2.8.4 [\#192](https://github.com/apertureless/vue-chartjs/issues/192)
## [v2.8.4](https://github.com/apertureless/vue-chartjs/tree/v2.8.4) (2017-09-08) ## [v2.8.4](https://github.com/apertureless/vue-chartjs/tree/v2.8.4) (2017-09-08)

View File

@@ -38,27 +38,14 @@ Simply run `yarn add vue-chartjs chart.js`
Or if you want to use it directly in the browser add Or if you want to use it directly in the browser add
```html ```html
<script src="https://unpkg.com/vue-chartjs/dist/vue-chartjs.full.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
<script src="https://unpkg.com/vue-chartjs/dist/vue-chartjs.min.js"></script>
``` ```
to your scripts. See [Codepen](https://codepen.io/apertureless/pen/zEvvWM) to your scripts. See [Codepen](https://codepen.io/apertureless/pen/zEvvWM)
## Explanation of Different Builds
There are three different entry points. It depends on which build setup do you have. The dependencies are bundled or required as a peerDependency.
- Browser
- Browserify / Webpack 1
- Webpack 2
| Build | Chart.js |
|---|---|---|
| vue-chartjs.full.js | Bundled |
| vue-chartjs.full.min.js | Bundled |
| vue-chartjs.js | peerDependency |
| vue-chartjs.min.js | peerDependency |
| es/index* | peerDependency |
### Browser ### Browser
You can use `vue-chartjs` directly in the browser without any build setup. Like in this [codepen](https://codepen.io/apertureless/pen/zEvvWM). For this case, please use the `vue-chartjs.full.min.js` which is the minified version. It has Chart.js bundled into it. And bundled to a UMD Module. So you only need that one file. You can use `vue-chartjs` directly in the browser without any build setup. Like in this [codepen](https://codepen.io/apertureless/pen/zEvvWM). For this case, please use the `vue-chartjs.min.js` which is the minified version. You also need to add the Chart.js CDN script.
You can then simply register your component: You can then simply register your component:

View File

@@ -1,35 +1,41 @@
// https://github.com/shelljs/shelljs 'use strict'
require('shelljs/global') require('./check-versions')()
env.NODE_ENV = 'production'
var path = require('path') process.env.NODE_ENV = 'production'
var config = require('../config')
var ora = require('ora')
var webpack = require('webpack')
var webpackConfig = require('./webpack.prod.conf')
console.log( const ora = require('ora')
' Tip:\n' + const rm = require('rimraf')
' Built files are meant to be served over an HTTP server.\n' + const path = require('path')
' Opening index.html over file:// won\'t work.\n' const chalk = require('chalk')
) const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
var spinner = ora('building UMD module...') const spinner = ora('building for production...')
spinner.start() spinner.start()
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
rm('-rf', assetsPath)
mkdir('-p', assetsPath)
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err if (err) throw err
process.stdout.write(stats.toString({ webpack(webpackConfig, function (err, stats) {
colors: true, spinner.stop()
modules: false, if (err) throw err
children: false, process.stdout.write(stats.toString({
chunks: false, colors: true,
chunkModules: false modules: false,
}) + '\n') children: false,
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
}) })

49
build/check-versions.js Normal file
View File

@@ -0,0 +1,49 @@
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}

View File

@@ -1,4 +1,5 @@
/* eslint-disable */ /* eslint-disable */
'use strict'
require('eventsource-polyfill') require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')

View File

@@ -1,45 +1,61 @@
var path = require('path') 'use strict'
var express = require('express') require('./check-versions')()
var webpack = require('webpack')
var config = require('../config') const config = require('../config')
var proxyMiddleware = require('http-proxy-middleware') if (!process.env.NODE_ENV) {
var webpackConfig = process.env.NODE_ENV === 'testing' process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
}
const opn = require('opn')
const path = require('path')
const express = require('express')
const webpack = require('webpack')
const proxyMiddleware = require('http-proxy-middleware')
const webpackConfig = (process.env.NODE_ENV === 'testing' || process.env.NODE_ENV === 'production')
? require('./webpack.prod.conf') ? require('./webpack.prod.conf')
: require('./webpack.dev.conf') : require('./webpack.dev.conf')
// default port where dev server listens for incoming traffic // default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port const port = process.env.PORT || config.dev.port
// automatically open browser, if not set will be false
const autoOpenBrowser = !!config.dev.autoOpenBrowser
// Define HTTP proxies to your custom API backend // Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware // https://github.com/chimurai/http-proxy-middleware
var proxyTable = config.dev.proxyTable const proxyTable = config.dev.proxyTable
var app = express() const app = express()
var compiler = webpack(webpackConfig) const compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, { const devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath, publicPath: webpackConfig.output.publicPath,
stats: { quiet: true
colors: true,
chunks: false
}
}) })
var hotMiddleware = require('webpack-hot-middleware')(compiler) const hotMiddleware = require('webpack-hot-middleware')(compiler, {
// force page reload when html-webpack-plugin template changes log: false,
compiler.plugin('compilation', function (compilation) { heartbeat: 2000
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
}) })
// force page reload when html-webpack-plugin template changes
// currently disabled until this is resolved:
// https://github.com/jantimon/html-webpack-plugin/issues/680
// compiler.plugin('compilation', function (compilation) {
// compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
// hotMiddleware.publish({ action: 'reload' })
// cb()
// })
// })
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// proxy api requests // proxy api requests
Object.keys(proxyTable).forEach(function (context) { Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context] const options = proxyTable[context]
if (typeof options === 'string') { if (typeof options === 'string') {
options = { target: options } options = { target: options }
} }
app.use(proxyMiddleware(context, options)) app.use(proxyMiddleware(options.filter || context, options))
}) })
// handle fallback for HTML5 history API // handle fallback for HTML5 history API
@@ -48,18 +64,44 @@ app.use(require('connect-history-api-fallback')())
// serve webpack bundle output // serve webpack bundle output
app.use(devMiddleware) app.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// serve pure static assets // serve pure static assets
var staticPath = path.posix.join(config.build.assetsPublicPath, config.build.assetsSubDirectory) const staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static')) app.use(staticPath, express.static('./static'))
module.exports = app.listen(port, function (err) { const uri = 'http://localhost:' + port
if (err) {
console.log(err) var _resolve
return var _reject
} var readyPromise = new Promise((resolve, reject) => {
console.log('Listening at http://localhost:' + port + '\n') _resolve = resolve
_reject = reject
}) })
var server
var portfinder = require('portfinder')
portfinder.basePort = port
console.log('> Starting dev server...')
devMiddleware.waitUntilValid(() => {
portfinder.getPort((err, port) => {
if (err) {
_reject(err)
}
process.env.PORT = port
var uri = 'http://localhost:' + port
console.log('> Listening at ' + uri + '\n')
// when env is testing, don't need open it
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
opn(uri)
}
server = app.listen(port)
_resolve()
})
})
module.exports = {
ready: readyPromise,
close: () => {
server.close()
}
}

View File

@@ -1,55 +1,71 @@
var path = require('path') 'use strict'
var config = require('../config') const path = require('path')
var ExtractTextPlugin = require('extract-text-webpack-plugin') const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function (_path) { exports.assetsPath = function (_path) {
return path.posix.join(config.build.assetsSubDirectory, _path) const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
} }
exports.cssLoaders = function (options) { exports.cssLoaders = function (options) {
options = options || {} options = options || {}
// generate loader string to be used with extract text plugin
function generateLoaders (loaders) {
var sourceLoader = loaders.map(function (loader) {
var extraParamChar
if (/\?/.test(loader)) {
loader = loader.replace(/\?/, '-loader?')
extraParamChar = '&'
} else {
loader = loader + '-loader'
extraParamChar = '?'
}
return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
}).join('!')
if (options.extract) { const cssLoader = {
return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) loader: 'css-loader',
} else { options: {
return ['vue-style-loader', sourceLoader].join('!') minimize: process.env.NODE_ENV === 'production',
sourceMap: options.sourceMap
} }
} }
// http://vuejs.github.io/vue-loader/configurations/extract-css.html // generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return { return {
css: generateLoaders(['css']), css: generateLoaders(),
postcss: generateLoaders(['css']), postcss: generateLoaders(),
less: generateLoaders(['css', 'less']), less: generateLoaders('less'),
sass: generateLoaders(['css', 'sass?indentedSyntax']), sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders(['css', 'sass']), scss: generateLoaders('sass'),
stylus: generateLoaders(['css', 'stylus']), stylus: generateLoaders('stylus'),
styl: generateLoaders(['css', 'stylus']) styl: generateLoaders('stylus')
} }
} }
// Generate loaders for standalone style files (outside of .vue) // Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) { exports.styleLoaders = function (options) {
var output = [] const output = []
var loaders = exports.cssLoaders(options) const loaders = exports.cssLoaders(options)
for (var extension in loaders) { for (const extension in loaders) {
var loader = loaders[extension] const loader = loaders[extension]
output.push({ output.push({
test: new RegExp('\\.' + extension + '$'), test: new RegExp('\\.' + extension + '$'),
loader: loader use: loader
}) })
} }
return output return output

19
build/vue-loader.conf.js Normal file
View File

@@ -0,0 +1,19 @@
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
module.exports = {
loaders: utils.cssLoaders({
sourceMap: isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
}),
transformToRequire: {
video: 'src',
source: 'src',
img: 'src',
image: 'xlink:href'
}
}

View File

@@ -1,7 +1,12 @@
var path = require('path') 'use strict'
var config = require('../config') const path = require('path')
var utils = require('./utils') const utils = require('./utils')
var projectRoot = path.resolve(__dirname, '../') const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = { module.exports = {
entry: { entry: {
@@ -9,77 +14,63 @@ module.exports = {
}, },
output: { output: {
path: config.build.assetsRoot, path: config.build.assetsRoot,
publicPath: config.build.assetsPublicPath, filename: '[name].js',
filename: '[name].js' publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
}, },
resolve: { resolve: {
extensions: ['', '.js', '.vue'], extensions: ['.js', '.vue', '.json'],
fallback: [path.join(__dirname, '../node_modules')],
alias: { alias: {
'src': path.resolve(__dirname, '../src'), 'vue$': 'vue/dist/vue.esm.js',
'mixins': path.resolve(__dirname, '../src/mixins'), '@': resolve('src')
'BaseCharts': path.resolve(__dirname, '../src/BaseCharts')
} }
}, },
resolveLoader: {
fallback: [path.join(__dirname, '../node_modules')]
},
module: { module: {
preLoaders: [ rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter')
}
},
{ {
test: /\.vue$/, test: /\.vue$/,
loader: 'eslint', loader: 'vue-loader',
include: projectRoot, options: vueLoaderConfig
exclude: /node_modules/
}, },
{ {
test: /\.js$/, test: /\.js$/,
loader: 'eslint', loader: 'babel-loader',
include: projectRoot, include: [resolve('src'), resolve('test')]
exclude: /node_modules/
}
],
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.js$/,
loader: 'babel',
include: projectRoot,
exclude: /node_modules/
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.html$/,
loader: 'vue-html'
}, },
{ {
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url', loader: 'url-loader',
query: { options: {
limit: 10000, limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]') name: utils.assetsPath('img/[name].[hash:7].[ext]')
} }
}, },
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{ {
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url', loader: 'url-loader',
query: { options: {
limit: 10000, limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]') name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
} }
} }
] ]
},
eslint: {
formatter: require('eslint-friendly-formatter')
},
vue: {
loaders: utils.cssLoaders()
} }
} }

View File

@@ -1,9 +1,11 @@
var config = require('../config') 'use strict'
var webpack = require('webpack') const utils = require('./utils')
var merge = require('webpack-merge') const webpack = require('webpack')
var utils = require('./utils') const config = require('../config')
var baseWebpackConfig = require('./webpack.base.conf') const merge = require('webpack-merge')
var HtmlWebpackPlugin = require('html-webpack-plugin') const baseWebpackConfig = require('./webpack.base.conf')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
// add hot-reload related code to entry chunks // add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) { Object.keys(baseWebpackConfig.entry).forEach(function (name) {
@@ -12,23 +14,23 @@ Object.keys(baseWebpackConfig.entry).forEach(function (name) {
module.exports = merge(baseWebpackConfig, { module.exports = merge(baseWebpackConfig, {
module: { module: {
loaders: utils.styleLoaders() rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
}, },
// eval-source-map is faster for development // cheap-module-eval-source-map is faster for development
devtool: '#eval-source-map', devtool: '#cheap-module-eval-source-map',
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': config.dev.env 'process.env': config.dev.env
}), }),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(), new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin // https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: 'index.html', filename: 'index.html',
template: 'index.html', template: 'index.html',
inject: true inject: true
}) }),
new FriendlyErrorsPlugin()
] ]
}) })

View File

@@ -1,33 +1,128 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack') const webpack = require('webpack')
const base = require('./webpack.base.conf')
const config = require('../config') const config = require('../config')
var env = process.env.NODE_ENV === 'testing' const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const env = process.env.NODE_ENV === 'testing'
? require('../config/test.env') ? require('../config/test.env')
: config.build.env : config.build.env
base.entry = { const webpackConfig = merge(baseWebpackConfig, {
lib: './src/index.js' module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
// UglifyJs do not support ES6+, you can also use babel-minify for better treeshaking: https://github.com/babel/minify
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vender modules does not change
new webpack.HashedModuleIdsPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
} }
base.output = { if (config.build.bundleAnalyzerReport) {
path: config.build.assetsRoot, const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
publicPath: config.build.assetsPublicPath, webpackConfig.plugins.push(new BundleAnalyzerPlugin())
filename: 'vue-chartjs.js',
library: 'VueChartJs',
libraryTarget: 'umd'
} }
var webpackConfig = Object.assign({}, base)
webpackConfig.devtool = '#source-map'
webpackConfig.plugins = (webpackConfig.plugins || []).concat([
new webpack.DefinePlugin({
'process.env.NODE_ENV': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
}),
new webpack.optimize.OccurenceOrderPlugin(),
])
module.exports = webpackConfig module.exports = webpackConfig

View File

@@ -1,92 +0,0 @@
var vue = require('vue-loader')
var path = require('path')
var webpack = require("webpack")
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var projectRoot = path.resolve(__dirname, '../')
var cssLoader = ExtractTextPlugin.extract('style-loader', 'css-loader')
const npmCfg = require('../package.json');
var banner = [
npmCfg.name + ' v' + npmCfg.version,
'(c) ' + (new Date().getFullYear()) + ' ' + npmCfg.author,
npmCfg.homepage
].join('\n')
module.exports = {
entry: {
'vue-chartjs': './src/index.js'
},
output: {
filename: './dist/[name].full.js',
library: 'VueChartJs',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
preLoaders: [
{
test: /\.vue$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
},
{
test: /\.js$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
}
],
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
},
{
test: /\.css$/,
loader: cssLoader
},
{
test: /\.s[a|c]ss$/,
loader: ExtractTextPlugin.extract('style-loader','css-loader!sass-loader')
},
{
test: /\.json$/, loader: 'json'
}
]
},
eslint: {
formatter: require('eslint-friendly-formatter')
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime']
},
plugins: [
new webpack.BannerPlugin(banner)
]
}
if (process.env.NODE_ENV === 'production') {
delete module.exports.devtool
module.exports.plugins = [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
// new ExtractTextPlugin('build.css')
]
}

View File

@@ -1,18 +0,0 @@
var config = require('./webpack.release.full.js')
var webpack = require('webpack')
config.output.filename = config.output.filename.replace(/\.js$/, '.min.js')
delete config.devtool
config.plugins = [
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
]
module.exports = config

View File

@@ -1,17 +1,20 @@
var vue = require('vue-loader')
var path = require('path') var path = require('path')
var webpack = require("webpack") var webpack = require('webpack')
var ExtractTextPlugin = require("extract-text-webpack-plugin") var ExtractTextPlugin = require('extract-text-webpack-plugin')
var projectRoot = path.resolve(__dirname, '../')
var cssLoader = ExtractTextPlugin.extract('style-loader', 'css-loader') var cssLoader = ExtractTextPlugin.extract('style-loader', 'css-loader')
const npmCfg = require('../package.json'); const npmCfg = require('../package.json')
const vueLoaderConfig = require('./vue-loader.conf')
var banner = [ var banner = [
npmCfg.name + ' v' + npmCfg.version, npmCfg.name + ' v' + npmCfg.version,
'(c) ' + (new Date().getFullYear()) + ' ' + npmCfg.author, '(c) ' + (new Date().getFullYear()) + ' ' + npmCfg.author,
npmCfg.homepage npmCfg.homepage
].join('\n') ].join('\n')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = { module.exports = {
entry: { entry: {
'vue-chartjs': './src/index.js' 'vue-chartjs': './src/index.js'
@@ -23,32 +26,40 @@ module.exports = {
umdNamedDefine: true umdNamedDefine: true
}, },
externals: { externals: {
'chart.js': 'chart.js' 'chart.js': {
root: 'Chart',
commonjs: 'chart.js',
commonjs2: 'chart.js',
amd: 'chart.js'
}
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src')
}
}, },
module: { module: {
preLoaders: [ rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter')
}
},
{ {
test: /\.vue$/, test: /\.vue$/,
loader: 'eslint', loader: 'vue-loader',
include: projectRoot, options: vueLoaderConfig
exclude: /node_modules/
}, },
{ {
test: /\.js$/, test: /\.js$/,
loader: 'eslint', loader: 'babel-loader',
include: projectRoot, include: [resolve('src'), resolve('test')]
exclude: /node_modules/
}
],
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}, },
{ {
test: /\.css$/, test: /\.css$/,
@@ -56,27 +67,21 @@ module.exports = {
}, },
{ {
test: /\.s[a|c]ss$/, test: /\.s[a|c]ss$/,
loader: ExtractTextPlugin.extract('style-loader','css-loader!sass-loader') loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader')
}, },
{ {
test: /\.json$/, loader: 'json' test: /\.json$/,
loader: 'json-loader'
} }
] ]
}, },
eslint: {
formatter: require('eslint-friendly-formatter')
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime']
},
plugins: [ plugins: [
new webpack.BannerPlugin(banner) new webpack.BannerPlugin(banner),
new webpack.optimize.ModuleConcatenationPlugin()
] ]
} }
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
delete module.exports.devtool delete module.exports.devtool
module.exports.plugins = [ module.exports.plugins = [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
@@ -88,8 +93,6 @@ if (process.env.NODE_ENV === 'production') {
compress: { compress: {
warnings: false warnings: false
} }
}), })
new webpack.optimize.OccurenceOrderPlugin()
// new ExtractTextPlugin('build.css')
] ]
} }

View File

@@ -6,13 +6,13 @@ config.output.filename = config.output.filename.replace(/\.js$/, '.min.js')
delete config.devtool delete config.devtool
config.plugins = [ config.plugins = [
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
sourceMap: false, sourceMap: false,
compress: { compress: {
warnings: false warnings: false
} }
}), })
new webpack.optimize.OccurenceOrderPlugin()
] ]
module.exports = config module.exports = config

View File

@@ -0,0 +1,32 @@
'use strict'
// This is the webpack config used for unit tests.
const utils = require('./utils')
const webpack = require('webpack')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const webpackConfig = merge(baseWebpackConfig, {
// use inline sourcemap for karma-sourcemap-loader
module: {
rules: utils.styleLoaders()
},
devtool: '#inline-source-map',
resolveLoader: {
alias: {
// necessary to to make lang="scss" work in test when using vue-loader's ?inject option
// see discussion at https://github.com/vuejs/vue-loader/issues/724
'scss-loader': 'sass-loader'
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/test.env')
})
]
})
// no need for app entry during tests
delete webpackConfig.entry
module.exports = webpackConfig

View File

@@ -1,5 +1,6 @@
var merge = require('webpack-merge') 'use strict'
var prodEnv = require('./prod.env') const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, { module.exports = merge(prodEnv, {
NODE_ENV: '"development"' NODE_ENV: '"development"'

View File

@@ -1,21 +1,42 @@
'use strict'
// Template version: 1.1.1
// see http://vuejs-templates.github.io/webpack for documentation. // see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
const path = require('path')
module.exports = { module.exports = {
build: { build: {
env: require('./prod.env'), env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'), assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: '', assetsSubDirectory: 'static',
assetsPublicPath: '/', assetsPublicPath: '/',
productionSourceMap: true, productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}, },
dev: { dev: {
env: require('./dev.env'), env: require('./dev.env'),
port: 8080, port: process.env.PORT || 8080,
proxyTable: {} autoOpenBrowser: true,
}, assetsSubDirectory: 'static',
umd: { assetsPublicPath: '/',
assetsRoot: path.resolve(__dirname, '../umd'), proxyTable: {},
assetsPublicPath: '/' // CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
} }
} }

View File

@@ -1,3 +1,4 @@
'use strict'
module.exports = { module.exports = {
NODE_ENV: '"production"' NODE_ENV: '"production"'
} }

View File

@@ -1,5 +1,6 @@
var merge = require('webpack-merge') 'use strict'
var devEnv = require('./dev.env') const merge = require('webpack-merge')
const devEnv = require('./dev.env')
module.exports = merge(devEnv, { module.exports = merge(devEnv, {
NODE_ENV: '"testing"' NODE_ENV: '"testing"'

34010
dist/vue-chartjs.full.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

7032
dist/vue-chartjs.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -77,7 +77,7 @@ There are some basic props defined in the BaseCharts. Because you `extend()` the
## Examples ## Examples
Here are some exmaples Here are some examples
### Chart with props ### Chart with props

View File

@@ -147,7 +147,7 @@ export default {
### Composants réutilisables ### Composants réutilisables
Si vous souhaitez faire en sorte que vos composants restent réutilisables, le mieux est de leur appliquer un wrapper. De cette manière, le composant graphique est seulement responsable de la représentation de la donnée, alors que le wrapper se charge de la logique derrière elle. Il y a de nombreux cas d'utilisations, et la manière de faire sera différente si vous êtes sur une Application Monopage (SPA) ou si vous intégrez sur du Laravel par exemple. Si vous souhaitez faire en sorte que vos composants restent réutilisables, appliquez un wrapper. De cette manière, le composant graphique est seulement responsable de la représentation de la donnée, alors que le wrapper se charge de la logique derrière elle. Il y a de nombreux cas d'utilisations, et la manière de faire sera différente si vous êtes sur une Application Monopage (SPA) ou si vous intégrez sur du Laravel par exemple.
## Données en direct ## Données en direct
@@ -264,7 +264,7 @@ Il peut arriver d'avoir besoin de plus de contrôle sur l'objet chart.js. Vous p
## Plugins inline ## Plugins inline
Avec Chart.js, vous pouvez définir des pugins globaux ou inline. Les plugins globaux fonctionnent sans souci avec `vue-chartjs`, comme décrit dans la [documentation chart.js](http://www.chartjs.org/docs/latest/developers/plugins.html) described. Avec Chart.js, vous pouvez définir des pugins globaux ou inline. Les plugins globaux fonctionnent sans souci avec `vue-chartjs`, comme décrit dans la [documentation chart.js](http://www.chartjs.org/docs/latest/developers/plugins.html).
Si vous désirez ajouter des plugins inline, `vue-chartjs` expose une méthode `addPlugin()`. L'appel à cette méthode doit se faire avant celui de `renderChart()`. Si vous désirez ajouter des plugins inline, `vue-chartjs` expose une méthode `addPlugin()`. L'appel à cette méthode doit se faire avant celui de `renderChart()`.

10646
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "vue-chartjs", "name": "vue-chartjs",
"version": "3.0.0", "version": "3.0.2",
"description": "Vue.js wrapper for chart.js for creating beautiful charts.", "description": "Vue.js wrapper for chart.js for creating beautiful charts.",
"author": "Jakub Juszczak <jakub@posteo.de>", "author": "Jakub Juszczak <jakub@posteo.de>",
"homepage": "http://vue-chartjs.org", "homepage": "http://vue-chartjs.org",
@@ -37,7 +37,7 @@
"Charts" "Charts"
], ],
"main": "dist/vue-chartjs.js", "main": "dist/vue-chartjs.js",
"unpkg": "dist/vue-chartjs.full.min.js", "unpkg": "dist/vue-chartjs.min.js",
"module": "es/index.js", "module": "es/index.js",
"jsnext:main": "es/index.js", "jsnext:main": "es/index.js",
"files": [ "files": [
@@ -53,25 +53,21 @@
"e2e": "node test/e2e/runner.js", "e2e": "node test/e2e/runner.js",
"test": "npm run unit", "test": "npm run unit",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs", "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
"release": "webpack --progress --hide-modules --config ./build/webpack.release.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js && webpack --progress --hide-modules --config ./build/webpack.release.full.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.full.min.js", "release": "webpack --progress --hide-modules --config ./build/webpack.release.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js",
"prepublish": "yarn run lint && yarn run test && yarn run build" "prepublishOnly": "yarn run lint && yarn run test && yarn run build"
}, },
"dependencies": { "dependencies": {
"lodash.merge": "^4.6.0" "lodash.merge": "^4.6.0"
}, },
"peerDependencies": { "peerDependencies": {
"chart.js": "2.7.0", "chart.js": "2.7.x"
"vue": "2.5.2"
}, },
"devDependencies": { "devDependencies": {
"babel-cli": "^6.24.1", "@babel/cli": "^7.0.0-beta.31",
"babel-core": "^6.25.0", "@babel/core": "^7.0.0-beta.31",
"babel-loader": "6.4.1", "@babel/preset-env": "^7.0.0-beta.31",
"babel-plugin-transform-object-assign": "^6.22.0", "@babel/preset-stage-2": "^7.0.0-beta.31",
"babel-plugin-transform-runtime": "^6.23.0", "babel-loader": "8.0.0-beta.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babel-runtime": "^6.23.0",
"chai": "^3.5.0", "chai": "^3.5.0",
"chart.js": "2.7.0", "chart.js": "2.7.0",
"chromedriver": "^2.28.0", "chromedriver": "^2.28.0",
@@ -90,13 +86,14 @@
"eslint-plugin-standard": "^3.0.1", "eslint-plugin-standard": "^3.0.1",
"eventsource-polyfill": "^0.9.6", "eventsource-polyfill": "^0.9.6",
"express": "^4.15.2", "express": "^4.15.2",
"extract-text-webpack-plugin": "^1.0.1", "extract-text-webpack-plugin": "^3.0.1",
"file-loader": "^0.10.1", "file-loader": "^0.10.1",
"friendly-errors-webpack-plugin": "^1.6.1",
"function-bind": "^1.0.2", "function-bind": "^1.0.2",
"html-webpack-plugin": "^2.28.0", "html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.4", "http-proxy-middleware": "^0.17.4",
"inject-loader": "^3.0.0", "inject-loader": "^3.0.0",
"isparta-loader": "^2.0.0", "isparta": "^4.0.0",
"jasmine-core": "^2.5.2", "jasmine-core": "^2.5.2",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"karma": "^1.5.0", "karma": "^1.5.0",
@@ -104,15 +101,18 @@
"karma-jasmine": "^1.0.2", "karma-jasmine": "^1.0.2",
"karma-mocha": "^1.2.0", "karma-mocha": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.4", "karma-phantomjs-launcher": "^1.0.4",
"karma-phantomjs-shim": "^1.4.0",
"karma-sinon-chai": "^1.2.0", "karma-sinon-chai": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7", "karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.30", "karma-spec-reporter": "0.0.30",
"karma-webpack": "1.8.1", "karma-webpack": "2",
"lolex": "^1.6.0", "lolex": "^1.6.0",
"mocha": "^3.1.0", "mocha": "^3.1.0",
"nightwatch": "^0.9.14", "nightwatch": "^0.9.14",
"opn": "^5.1.0",
"ora": "^1.2.0", "ora": "^1.2.0",
"phantomjs-prebuilt": "^2.1.13", "phantomjs-prebuilt": "^2.1.13",
"portfinder": "^1.0.13",
"selenium-server": "^3.3.1", "selenium-server": "^3.3.1",
"shelljs": "^0.7.7", "shelljs": "^0.7.7",
"sinon": "^2.1.0", "sinon": "^2.1.0",
@@ -121,21 +121,17 @@
"vue": "2.5.2", "vue": "2.5.2",
"vue-hot-reload-api": "2.1.0", "vue-hot-reload-api": "2.1.0",
"vue-html-loader": "^1.2.4", "vue-html-loader": "^1.2.4",
"vue-loader": "12.2.2", "vue-loader": "^13.3.0",
"vue-style-loader": "3.0.1", "vue-style-loader": "3.0.1",
"vue-template-compiler": "2.5.2", "vue-template-compiler": "2.5.2",
"webpack": "^1.13.2", "webpack": "^3.7.1",
"webpack-dev-middleware": "^1.10.1", "webpack-dev-middleware": "^1.10.1",
"webpack-hot-middleware": "^2.17.1", "webpack-hot-middleware": "^2.17.1",
"webpack-merge": "1.1.1" "webpack-merge": "^4.1.0"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0",
}, "npm": ">= 3.0.0"
"babel": {
"presets": [
"es2015"
]
}, },
"browserify": { "browserify": {
"transform": [ "transform": [

View File

@@ -16,11 +16,6 @@ var webpackConfig = merge(baseConfig, {
loaders: utils.styleLoaders() loaders: utils.styleLoaders()
}, },
devtool: '#inline-source-map', devtool: '#inline-source-map',
vue: {
loaders: {
js: 'isparta'
}
},
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': require('../../config/test.env') 'process.env': require('../../config/test.env')
@@ -31,15 +26,18 @@ var webpackConfig = merge(baseConfig, {
// no need for app entry during tests // no need for app entry during tests
delete webpackConfig.entry delete webpackConfig.entry
// function resolve (dir) {
// return path.join(__dirname, '..', dir)
// }
// make sure isparta loader is applied before eslint // make sure isparta loader is applied before eslint
webpackConfig.module.preLoaders = webpackConfig.module.preLoaders || [] // webpackConfig.module.rules = webpackConfig.module.rules || []
webpackConfig.module.preLoaders.unshift({ // webpackConfig.module.rules.unshift({
test: /\.js$/, // test: /\.js$/,
loader: 'isparta', // loader: 'babel-loader',
include: path.resolve(projectRoot, 'src') // include: [resolve('src'), resolve('test')]
}) // })
// only apply babel for test files when using isparta // // only apply babel for test files when using isparta
webpackConfig.module.loaders.some(function (loader, i) { webpackConfig.module.loaders.some(function (loader, i) {
if (loader.loader === 'babel') { if (loader.loader === 'babel') {
loader.include = path.resolve(projectRoot, 'test/unit') loader.include = path.resolve(projectRoot, 'test/unit')

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import BarChart from 'src/examples/BarExample' import BarChart from '@/examples/BarExample'
describe('BarChart', () => { describe('BarChart', () => {
let el let el

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import BubbleChart from 'src/examples/BubbleExample' import BubbleChart from '@/examples/BubbleExample'
describe('BubbleChart', () => { describe('BubbleChart', () => {
let el let el

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import DoughnutChart from 'src/examples/DoughnutExample' import DoughnutChart from '@/examples/DoughnutExample'
describe('DoughnutChart', () => { describe('DoughnutChart', () => {
let el let el

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import HorizontalBarChart from 'src/examples/HorizontalBarExample' import HorizontalBarChart from '@/examples/HorizontalBarExample'
describe('HorizontalBarChart', () => { describe('HorizontalBarChart', () => {
let el let el

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import LineChart from 'src/examples/LineExample' import LineChart from '@/examples/LineExample'
describe('LineChart', () => { describe('LineChart', () => {
let el let el

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import PieChart from 'src/examples/PieExample' import PieChart from '@/examples/PieExample'
describe('PieChart', () => { describe('PieChart', () => {
let el let el

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import PolarChart from 'src/examples/PolarAreaExample' import PolarChart from '@/examples/PolarAreaExample'
describe('PolarChart', () => { describe('PolarChart', () => {
let el let el

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import RadarChart from 'src/examples/RadarExample' import RadarChart from '@/examples/RadarExample'
describe('RadarChart', () => { describe('RadarChart', () => {
let el let el

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import ScatterChart from 'src/examples/ScatterExample' import ScatterChart from '@/examples/ScatterExample'
describe('ScatterChart', () => { describe('ScatterChart', () => {
let el let el

View File

@@ -1,4 +1,4 @@
import { mergeOptions } from 'src/helpers/options' import { mergeOptions } from '@/helpers/options'
describe('mergeOptions.js', () => { describe('mergeOptions.js', () => {
const a = { const a = {

2131
yarn.lock

File diff suppressed because it is too large Load Diff