From 90f6bd06c4ec04637dd5669fce39bc916c5919fb Mon Sep 17 00:00:00 2001 From: wanglixing Date: Wed, 26 Dec 2018 17:40:23 +0800 Subject: [PATCH] feat: update kit --- .babelrc | 18 - .browserslistrc | 3 + .env.library | 2 + .eslintignore | 3 +- .eslintrc.js | 29 +- .github/CONTRIBUTING.md | 2 +- .gitignore | 3 +- babel.config.js | 16 + build/bin/delete.js | 2 +- build/build.js | 5 +- build/utils.js | 100 - build/vue-loader.conf.js | 22 - build/webpack.base.conf.js | 170 - build/webpack.build.js | 32 - build/webpack.build.min.js | 93 - build/webpack.dev.conf.js | 39 - build/webpack.test.conf.js | 32 - config/dev.env.js | 7 - config/index.js | 76 - config/prod.env.js | 4 - config/test.env.js | 7 - examples/docs/intro.md | 2 +- examples/pages/button.vue | 2 +- examples/pages/cell.vue | 6 +- examples/pages/dialog.vue | 16 +- examples/pages/picker.vue | 16 +- examples/pages/scroller.vue | 2 +- examples/pages/search-list.vue | 32 +- examples/pages/search.vue | 78 +- examples/pages/select.vue | 34 +- examples/pages/skeleton.vue | 65 +- examples/pages/swiper.vue | 4 +- examples/pages/switch.vue | 2 +- examples/pages/toast.vue | 4 +- examples/src/MobileApp.vue | 34 +- examples/src/components/demo-list.vue | 10 +- examples/src/components/example-block.vue | 2 +- examples/src/components/footer-nav.vue | 50 +- examples/src/components/mobile-nav.vue | 11 +- examples/src/components/page-header.vue | 22 +- examples/src/components/side-nav.vue | 14 +- examples/src/index.js | 1 - package-lock.json | 19817 ++++++++++++++++++++ package.json | 161 +- packages/button/index.vue | 8 +- packages/cell-group/index.vue | 2 +- packages/cell/index.vue | 4 +- packages/dialog/index.vue | 6 +- packages/picker/custom.vue | 136 +- packages/picker/datetime.vue | 284 +- packages/picker/index.vue | 164 +- packages/radio-group/index.vue | 4 +- packages/radio/index.vue | 2 +- packages/scroller/arrow.vue | 12 +- packages/scroller/index.vue | 84 +- packages/search-list/index.vue | 34 +- packages/search/index.vue | 36 +- packages/select/index.vue | 40 +- packages/skeleton/index.vue | 4 +- packages/skeleton/row.vue | 12 +- packages/skeleton/sub-row.vue | 12 +- packages/swiper/index.vue | 8 +- packages/swiper/swipe-item.vue | 30 +- packages/swiper/swipe.vue | 406 +- packages/switch/index.vue | 4 +- packages/toast/index.vue | 8 +- packages/vui-css/package-lock.json | 5641 ++++++ .postcssrc.js => postcss.config.js | 14 +- public/favicon.ico | Bin 0 -> 1150 bytes public/index.html | 17 + salad.config.json | 26 +- test/setup.js | 20 + test/unit/karma.conf.js | 41 - test/unit/specs/button.spec.js | 1 + test/unit/specs/cell-group.spec.js | 1 + test/unit/specs/cell.spec.js | 1 + test/unit/specs/dialog.spec.js | 7 +- test/unit/specs/icon.spec.js | 1 + test/unit/specs/picker.spec.js | 1 + test/unit/specs/radio-group.spec.js | 1 + test/unit/specs/radio.spec.js | 1 + test/unit/specs/scroller.spec.js | 1 + test/unit/specs/search-list.spec.js | 1 + test/unit/specs/search.spec.js | 1 + test/unit/specs/select.spec.js | 1 + test/unit/specs/skeleton.spec.js | 1 + test/unit/specs/swipe-item.spec.js | 1 + test/unit/specs/swipe.spec.js | 1 + test/unit/specs/swiper.spec.js | 1 + test/unit/specs/switch.spec.js | 1 + test/unit/specs/toast.spec.js | 9 +- vue.config.js | 164 + yarn.lock | 7403 -------- 93 files changed, 26668 insertions(+), 9040 deletions(-) delete mode 100644 .babelrc create mode 100644 .browserslistrc create mode 100644 .env.library create mode 100644 babel.config.js delete mode 100644 build/utils.js delete mode 100644 build/vue-loader.conf.js delete mode 100644 build/webpack.base.conf.js delete mode 100644 build/webpack.build.js delete mode 100644 build/webpack.build.min.js delete mode 100755 build/webpack.dev.conf.js delete mode 100644 build/webpack.test.conf.js delete mode 100644 config/dev.env.js delete mode 100644 config/index.js delete mode 100644 config/prod.env.js delete mode 100644 config/test.env.js create mode 100644 package-lock.json create mode 100644 packages/vui-css/package-lock.json rename .postcssrc.js => postcss.config.js (57%) create mode 100644 public/favicon.ico create mode 100644 public/index.html create mode 100644 test/setup.js delete mode 100644 test/unit/karma.conf.js create mode 100644 vue.config.js delete mode 100644 yarn.lock diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 801edec..0000000 --- a/.babelrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "presets": [ - ["env", { - "modules": false, - "targets": { - "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] - } - }], - "stage-2" - ], - "plugins": ["transform-vue-jsx", "transform-runtime"], - "env": { - "test": { - "presets": ["env", "stage-2"], - "plugins": ["transform-vue-jsx", "istanbul"] - } - } -} diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..9dee646 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,3 @@ +> 1% +last 2 versions +not ie <= 8 diff --git a/.env.library b/.env.library new file mode 100644 index 0000000..40e906f --- /dev/null +++ b/.env.library @@ -0,0 +1,2 @@ +NODE_ENV = production +BUILD_LIB = lib \ No newline at end of file diff --git a/.eslintignore b/.eslintignore index 370aff6..2e49ae2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,4 @@ /build/ /config/ /examples/dist/ -/*.js -/test/unit/coverage/ +/test/coverage/ \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 899a5a0..68f4665 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,30 +1,23 @@ -// https://eslint.org/docs/user-guide/configuring - module.exports = { root: true, - parserOptions: { - parser: 'babel-eslint' - }, env: { - browser: true, + browser: true }, - extends: [ - // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention - // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. - 'plugin:vue/essential', - // https://github.com/standard/standard/blob/master/docs/RULES-en.md - 'standard' - ], - // required to lint *.vue files - plugins: [ - 'vue' + 'extends': [ + 'plugin:vue/essential', + '@vue/standard' ], - // add your custom rules here + parserOptions: { + parser: 'babel-eslint' + }, rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', // allow async-await 'generator-star-spacing': 'off', // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-unused-expressions': 0 + 'no-unused-expressions': 0, + 'no-tabs': 'off', + 'vue/no-side-effects-in-computed-properties': 'off' } } diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d3e5c4d..651038d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -40,7 +40,7 @@ $ npm run deploy - lib:打包后生成的文件 - packages:组件目录,每个组件是一个目录 - src:主文件`index.js`以及一些公用的`mixins`和`utils` -- test:测试用例 +- tests:测试用例 ### 开发 diff --git a/.gitignore b/.gitignore index 599b574..6923ed6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,8 @@ node_modules/ npm-debug.log* yarn-debug.log* yarn-error.log* -/test/unit/coverage/ +/test/coverage/ +.nyc_output # Editor directories and files .idea diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..7f18de1 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,16 @@ +module.exports = { + presets: [ + '@vue/app' + ], + plugins: ['transform-vue-jsx', '@babel/plugin-transform-runtime', + ['@babel/plugin-transform-modules-commonjs', { + 'allowTopLevelThis': true + }] // 用于设置commonjs与es6模块共存 + ], + env: { + 'test': { + 'presets': ['@vue/app'], + 'plugins': ['transform-vue-jsx', 'istanbul'] + } + } +} diff --git a/build/bin/delete.js b/build/bin/delete.js index 386c283..dc43560 100644 --- a/build/bin/delete.js +++ b/build/bin/delete.js @@ -19,7 +19,7 @@ const files = { page_file: `examples/pages/${componentname}.vue`, md_file: `examples/docs/${componentname}.md`, css_file: `packages/vui-css/src/${componentname}.css`, - test_file: `test/unit/specs/${componentname}.spec.js` + test_file: `tests/unit/specs/${componentname}.spec.js` } prompt([{ diff --git a/build/build.js b/build/build.js index 1b652a6..9dd64a6 100644 --- a/build/build.js +++ b/build/build.js @@ -8,13 +8,12 @@ const rm = require('rimraf') const path = require('path') const chalk = require('chalk') const webpack = require('webpack') -const config = require('../config') -const webpackConfig = require('./webpack.build.min') +const webpackConfig = require('../node_modules/@vue/cli-service/webpack.config.js') const spinner = ora('building for production...') spinner.start() -rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { +rm(path.join(path.resolve(__dirname, '../dist'), 'static'), err => { if (err) throw err webpack(webpackConfig, (err, stats) => { spinner.stop() diff --git a/build/utils.js b/build/utils.js deleted file mode 100644 index 9112b4c..0000000 --- a/build/utils.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict' -const path = require('path') -const config = require('../config') -const ExtractTextPlugin = require('extract-text-webpack-plugin') -const packageConfig = require('../package.json') - -exports.assetsPath = function (_path) { - const assetsSubDirectory = process.env.NODE_ENV === 'production' - ? config.build.assetsSubDirectory - : config.dev.assetsSubDirectory - - return path.posix.join(assetsSubDirectory, _path) -} - -exports.cssLoaders = function (options) { - options = options || {} - - const cssLoader = { - loader: 'css-loader', - options: { - sourceMap: options.sourceMap - } - } - - const postcssLoader = { - loader: 'postcss-loader', - options: { - sourceMap: options.sourceMap - } - } - - // generate loader string to be used with extract text plugin - function generateLoaders (loader, loaderOptions) { - const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [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 { - css: generateLoaders(), - postcss: generateLoaders(), - less: generateLoaders('less'), - sass: generateLoaders('sass', { indentedSyntax: true }), - scss: generateLoaders('sass'), - stylus: generateLoaders('stylus'), - styl: generateLoaders('stylus') - } -} - -// Generate loaders for standalone style files (outside of .vue) -exports.styleLoaders = function (options) { - const output = [] - const loaders = exports.cssLoaders(options) - - for (const extension in loaders) { - const loader = loaders[extension] - output.push({ - test: new RegExp('\\.' + extension + '$'), - use: loader - }) - } - - return output -} - -exports.createNotifierCallback = () => { - const notifier = require('node-notifier') - - return (severity, errors) => { - if (severity !== 'error') return - - const error = errors[0] - const filename = error.file && error.file.split('!').pop() - - notifier.notify({ - title: packageConfig.name, - message: severity + ': ' + error.name, - subtitle: filename || '', - icon: path.join(__dirname, 'logo.png') - }) - } -} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js deleted file mode 100644 index 33ed58b..0000000 --- a/build/vue-loader.conf.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' -const utils = require('./utils') -const config = require('../config') -const isProduction = process.env.NODE_ENV === 'production' -const sourceMapEnabled = isProduction - ? config.build.productionSourceMap - : config.dev.cssSourceMap - -module.exports = { - loaders: utils.cssLoaders({ - sourceMap: sourceMapEnabled, - extract: isProduction - }), - cssSourceMap: sourceMapEnabled, - cacheBusting: config.dev.cacheBusting, - transformToRequire: { - video: ['src', 'poster'], - source: 'src', - img: 'src', - image: 'xlink:href' - } -} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js deleted file mode 100644 index bd9d4f0..0000000 --- a/build/webpack.base.conf.js +++ /dev/null @@ -1,170 +0,0 @@ -'use strict' -const path = require('path') -const utils = require('./utils') -const config = require('../config') -const vueLoaderConfig = require('./vue-loader.conf') -const webpack = require('webpack') -const CopyWebpackPlugin = require('copy-webpack-plugin') -const HtmlWebpackPlugin = require('html-webpack-plugin') -const ExtractTextPlugin = require('extract-text-webpack-plugin') - -const HOST = process.env.HOST -const PORT = process.env.PORT && Number(process.env.PORT) - -function resolve (dir) { - return path.join(__dirname, '..', dir) -} - -function wrap (render) { - return function() { - return render.apply(this, arguments) - .replace('', '') - } -} - -const createLintingRule = () => ({ - test: /\.(js|vue)$/, - loader: 'eslint-loader', - enforce: 'pre', - include: [resolve('src'), resolve('test')], - options: { - formatter: require('eslint-friendly-formatter'), - emitWarning: !config.dev.showEslintErrorsInOverlay - } -}) -module.exports = { - context: path.resolve(__dirname, '../'), - entry: { - 'vendor': ['vue', 'vue-router'], - 'vui': './examples/src/index.js', - 'vui-mobile': './examples/src/mobile.js' - }, - output: { - path: path.join(__dirname, '../examples/dist'), - publicPath: '/', - filename: '[name].js' - }, - resolve: { - extensions: ['.js', '.vue', '.json'], - alias: { - 'vue$': 'vue/dist/vue.esm.js', - '@': resolve('src'), - 'src': resolve('src'), - 'packages': resolve('packages'), - 'lib': resolve('lib'), - 'components': resolve('examples/src/components') - } - }, - module: { - rules: [ - ...(config.dev.useEslint ? [createLintingRule()] : []), - { - test: /\.vue$/, - loader: 'vue-loader', - options: vueLoaderConfig - }, - { - test: /\.js$/, - loader: 'babel-loader', - include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] - }, - { - test: /\.md$/, - loader: 'vue-markdown-loader', - options: { - preventExtract: true, - preprocess: function(MarkdownIt, source) { - MarkdownIt.renderer.rules.table_open = function() { - return ''; - }; - MarkdownIt.renderer.rules.fence = wrap(MarkdownIt.renderer.rules.fence); - return source; - } - } - }, - { - test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, - loader: 'url-loader', - options: { - limit: 10000, - 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)(\?.*)?$/, - loader: 'url-loader', - options: { - limit: 10000, - name: utils.assetsPath('fonts/[name].[hash:7].[ext]') - } - }, - ...utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) - ] - }, - node: { - // prevent webpack from injecting useless setImmediate polyfill because Vue - // source contains it (although only uses it if it's native). - setImmediate: false, - // prevent webpack from injecting mocks to Node native modules - // that does not make sense for the client - dgram: 'empty', - fs: 'empty', - net: 'empty', - tls: 'empty', - child_process: 'empty' - }, - // cheap-module-eval-source-map is faster for development - devtool: config.dev.devtool, - - // these devServer options should be customized in /config/index.js - devServer: { - clientLogLevel: 'warning', - historyApiFallback: { - rewrites: [ - { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, - ], - }, - hot: true, - contentBase: false, // since we use CopyWebpackPlugin. - compress: true, - host: HOST || config.dev.host, - port: PORT || config.dev.port, - open: config.dev.autoOpenBrowser, - overlay: config.dev.errorOverlay - ? { warnings: false, errors: true } - : false, - publicPath: config.dev.assetsPublicPath, - proxy: config.dev.proxyTable, - quiet: true, // necessary for FriendlyErrorsPlugin - watchOptions: { - poll: config.dev.poll, - } - }, - plugins: [ - new webpack.HotModuleReplacementPlugin(), - new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. - new webpack.NoEmitOnErrorsPlugin(), - // https://github.com/ampedandwired/html-webpack-plugin - new HtmlWebpackPlugin({ - chunks: ['manifest', 'vendor', 'vui'], - template: 'examples/src/index.tpl', - filename: 'index.html', - inject: true - }), - new HtmlWebpackPlugin({ - chunks: ['manifest', 'vendor', 'vui-mobile'], - template: 'examples/src/index.tpl', - filename: 'mobile.html', - inject: true - }) - ] -} diff --git a/build/webpack.build.js b/build/webpack.build.js deleted file mode 100644 index 8c5c46a..0000000 --- a/build/webpack.build.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' -const webpack = require('webpack') -const config = require('./webpack.base.conf') - -config.entry = { - 'vui': './src/index.js' -} - -config.output = { - filename: './lib/[name].js', - library: 'vui', - libraryTarget: 'umd' -} - -config.externals = { - vue: { - root: 'Vue', - commonjs: 'vue', - commonjs2: 'vue', - amd: 'vue' - } -} - -config.plugins = [ - new webpack.DefinePlugin({ - 'process.env': require('../config/prod.env') - }) -] - -delete config.devtool - -module.exports = config diff --git a/build/webpack.build.min.js b/build/webpack.build.min.js deleted file mode 100644 index 7510de9..0000000 --- a/build/webpack.build.min.js +++ /dev/null @@ -1,93 +0,0 @@ -const path = require('path') -const webpack = require('webpack') -const merge = require('webpack-merge') -const baseWebpackConfig = require('./webpack.base.conf') -const config = require('../config') -const ExtractTextPlugin = require('extract-text-webpack-plugin') -const env = require('../config/prod.env') -const webpackConfig = merge(baseWebpackConfig, { - // devtool: config.build.productionSourceMap ? config.build.devtool : false, - output: { - publicPath: '/', - chunkFilename: '[id].[hash].js', - filename: '[name].min.[hash].js' - }, - plugins: [ - // http://vuejs.github.io/vue-loader/en/workflow/production.html - new webpack.DefinePlugin({ - 'process.env': env - }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false - }, - output: { - comments: false - }, - sourceMap: false - }), - // extract css into its own file - new ExtractTextPlugin({ - filename: '[name].[contenthash].css', - allChunks: true, - }), - // keep module.id stable when vendor modules does not change - new webpack.HashedModuleIdsPlugin(), - // enable scope hoisting - new webpack.optimize.ModuleConcatenationPlugin(), - // split vendor js into its own file - new webpack.optimize.CommonsChunkPlugin({ - name: 'vendor', - minChunks (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', - minChunks: Infinity - }), - // This instance extracts shared chunks from code splitted chunks and bundles them - // in a separate chunk, similar to the vendor chunk - // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk - new webpack.optimize.CommonsChunkPlugin({ - name: 'app', - async: 'vendor-async', - children: true, - minChunks: 3 - }), - ] -}) - -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 - }) - ) -} - -if (config.build.bundleAnalyzerReport) { - const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin - webpackConfig.plugins.push(new BundleAnalyzerPlugin()) -} - -module.exports = webpackConfig diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js deleted file mode 100755 index fdb041d..0000000 --- a/build/webpack.dev.conf.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict' -const utils = require('./utils') -const config = require('../config') -const webpack = require('webpack') -const baseWebpackConfig = require('./webpack.base.conf') -const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') -const portfinder = require('portfinder') - -baseWebpackConfig.plugins.push( - new webpack.DefinePlugin({ - 'process.env': require('../config/dev.env') - }) -) - -module.exports = new Promise((resolve, reject) => { - portfinder.basePort = process.env.PORT || config.dev.port - portfinder.getPort((err, port) => { - if (err) { - reject(err) - } else { - // publish the new Port, necessary for e2e tests - process.env.PORT = port - // add port to devServer config - baseWebpackConfig.devServer.port = port - - // Add FriendlyErrorsPlugin - baseWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ - compilationSuccessInfo: { - messages: [`Your application is running here: http://${baseWebpackConfig.devServer.host}:${port}`], - }, - onErrors: config.dev.notifyOnErrors - ? utils.createNotifierCallback() - : undefined - })) - - resolve(baseWebpackConfig) - } - }) -}) diff --git a/build/webpack.test.conf.js b/build/webpack.test.conf.js deleted file mode 100644 index 0d658d9..0000000 --- a/build/webpack.test.conf.js +++ /dev/null @@ -1,32 +0,0 @@ -'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 diff --git a/config/dev.env.js b/config/dev.env.js deleted file mode 100644 index 1e22973..0000000 --- a/config/dev.env.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' -const merge = require('webpack-merge') -const prodEnv = require('./prod.env') - -module.exports = merge(prodEnv, { - NODE_ENV: '"development"' -}) diff --git a/config/index.js b/config/index.js deleted file mode 100644 index 563d4c9..0000000 --- a/config/index.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict' -// Template version: 1.3.1 -// see http://vuejs-templates.github.io/webpack for documentation. - -const path = require('path') - -module.exports = { - dev: { - - // Paths - assetsSubDirectory: 'static', - assetsPublicPath: '/', - proxyTable: {}, - - // Various Dev Server settings - host: '0.0.0.0', // can be overwritten by process.env.HOST - port: 8085, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined - autoOpenBrowser: false, - errorOverlay: true, - notifyOnErrors: true, - poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- - - // Use Eslint Loader? - // If true, your code will be linted during bundling and - // linting errors and warnings will be shown in the console. - useEslint: true, - // If true, eslint errors and warnings will also be shown in the error overlay - // in the browser. - showEslintErrorsInOverlay: false, - - /** - * Source Maps - */ - - // https://webpack.js.org/configuration/devtool/#development - devtool: 'cheap-module-eval-source-map', - - // If you have problems debugging vue-files in devtools, - // set this to false - it *may* help - // https://vue-loader.vuejs.org/en/options.html#cachebusting - cacheBusting: true, - - cssSourceMap: true - }, - - build: { - // Template for index.html - index: path.resolve(__dirname, '../dist/index.html'), - - // Paths - assetsRoot: path.resolve(__dirname, '../dist'), - assetsSubDirectory: 'static', - assetsPublicPath: '/', - - /** - * Source Maps - */ - - productionSourceMap: true, - // https://webpack.js.org/configuration/devtool/#production - devtool: '#source-map', - - // 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: true, - 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 - } -} diff --git a/config/prod.env.js b/config/prod.env.js deleted file mode 100644 index a6f9976..0000000 --- a/config/prod.env.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict' -module.exports = { - NODE_ENV: '"production"' -} diff --git a/config/test.env.js b/config/test.env.js deleted file mode 100644 index c2824a3..0000000 --- a/config/test.env.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' -const merge = require('webpack-merge') -const devEnv = require('./dev.env') - -module.exports = merge(devEnv, { - NODE_ENV: '"testing"' -}) diff --git a/examples/docs/intro.md b/examples/docs/intro.md index 620ce8d..3367528 100644 --- a/examples/docs/intro.md +++ b/examples/docs/intro.md @@ -9,7 +9,7 @@ ### 项目性质 * 个人 Vue UI 组件库 -* 组件不断完善,增加中 +* 组件不断完善,增加中dui * 不断完善的文档和示例 ### 快速上手 diff --git a/examples/pages/button.vue b/examples/pages/button.vue index 6f66936..f0f9360 100644 --- a/examples/pages/button.vue +++ b/examples/pages/button.vue @@ -48,7 +48,7 @@ h2 { export default { methods: { clickFn (a) { - console.log(123, a); + console.log(123, a) } } } diff --git a/examples/pages/cell.vue b/examples/pages/cell.vue index 3125b45..e74bd0a 100644 --- a/examples/pages/cell.vue +++ b/examples/pages/cell.vue @@ -63,9 +63,9 @@ export default { gender: { default: -1, value: [ - { name: "保密", value: 0 }, - { name: "男", value: 1 }, - { name: "女", value: 2 } + { name: '保密', value: 0 }, + { name: '男', value: 1 }, + { name: '女', value: 2 } ] } } diff --git a/examples/pages/dialog.vue b/examples/pages/dialog.vue index 529a650..34b7143 100644 --- a/examples/pages/dialog.vue +++ b/examples/pages/dialog.vue @@ -43,11 +43,11 @@ export default { cancelText: '取消', okText: '确定', content: '测试 Dialog,测试 Dialog,测试 Dialog~~~', - onOk() { - console.log('click ok btn to do someting'); + onOk () { + console.log('click ok btn to do someting') }, - onCancel() { - console.log('click cancel btn to do someting'); + onCancel () { + console.log('click cancel btn to do someting') } }) }, @@ -57,11 +57,11 @@ export default { cancelText: '取消', okText: '确定', content: '测试 Dialog,测试 Dialog,测试 Dialog~~~', - onOk() { - console.log('click ok btn to do someting'); + onOk () { + console.log('click ok btn to do someting') }, - onCancel() { - console.log('click cancel btn to do someting'); + onCancel () { + console.log('click cancel btn to do someting') } }) }, diff --git a/examples/pages/picker.vue b/examples/pages/picker.vue index 709686b..7bcb562 100644 --- a/examples/pages/picker.vue +++ b/examples/pages/picker.vue @@ -41,7 +41,7 @@ - + @@ -52,24 +52,24 @@ - + diff --git a/examples/pages/scroller.vue b/examples/pages/scroller.vue index 7189393..6e8ce69 100644 --- a/examples/pages/scroller.vue +++ b/examples/pages/scroller.vue @@ -29,7 +29,7 @@ li { export default { data () { return { - len: 6, + len: 6 } }, computed: { diff --git a/examples/pages/search-list.vue b/examples/pages/search-list.vue index dfa44ac..ba7ef3a 100644 --- a/examples/pages/search-list.vue +++ b/examples/pages/search-list.vue @@ -33,22 +33,22 @@ export default { data () { return { defaultResult: [ - {name: 'Apple', price: 5, amount: 20}, - {name: 'Banana', price: 5, amount: 30}, - {name: 'Orange', price: 3, amount: 10}, - {name: 'Durian', price: 10, amount: 25}, - {name: 'Lemon', price: 4, amount: 30}, - {name: 'Peach', price: 5, amount: 40}, - {name: 'Cherry', price: 20, amount: 50}, - {name: 'Berry', price: 15, amount: 60}, - {name: 'Core', price: 10, amount: 21}, - {name: 'Fig', price: 10, amount: 22}, - {name: 'Haw', price: 10, amount: 23}, - {name: 'Melon', price: 10, amount: 24}, - {name: 'Plum', price: 10, amount: 25}, - {name: 'Pear', price: 10, amount: 26}, - {name: 'Peanut', price: 10, amount: 27}, - {name: 'Other'} + { name: 'Apple', price: 5, amount: 20 }, + { name: 'Banana', price: 5, amount: 30 }, + { name: 'Orange', price: 3, amount: 10 }, + { name: 'Durian', price: 10, amount: 25 }, + { name: 'Lemon', price: 4, amount: 30 }, + { name: 'Peach', price: 5, amount: 40 }, + { name: 'Cherry', price: 20, amount: 50 }, + { name: 'Berry', price: 15, amount: 60 }, + { name: 'Core', price: 10, amount: 21 }, + { name: 'Fig', price: 10, amount: 22 }, + { name: 'Haw', price: 10, amount: 23 }, + { name: 'Melon', price: 10, amount: 24 }, + { name: 'Plum', price: 10, amount: 25 }, + { name: 'Pear', price: 10, amount: 26 }, + { name: 'Peanut', price: 10, amount: 27 }, + { name: 'Other' } ] } } diff --git a/examples/pages/search.vue b/examples/pages/search.vue index 8cbeb00..e04ae27 100644 --- a/examples/pages/search.vue +++ b/examples/pages/search.vue @@ -1,4 +1,4 @@ - \ No newline at end of file + diff --git a/examples/src/components/page-header.vue b/examples/src/components/page-header.vue index 85af2e7..52a9916 100644 --- a/examples/src/components/page-header.vue +++ b/examples/src/components/page-header.vue @@ -21,25 +21,25 @@