[Improvement] remove unused dependencies & scripts (#453)

This commit is contained in:
neverland 2017-12-19 19:03:42 +08:00 committed by GitHub
parent f83f75a83b
commit 05a724c0c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 1431 deletions

View File

@ -1,6 +1,6 @@
{ {
"presets": [["env", { "modules": false, "loose": true }]], "presets": [["env", { "modules": false, "loose": true }]],
"plugins": ["transform-vue-jsx", "transform-runtime", "transform-object-rest-spread"], "plugins": ["transform-runtime", "transform-object-rest-spread"],
"env": { "env": {
"commonjs": { "commonjs": {
"presets": [["env", { "modules": "commonjs", "loose": true }]] "presets": [["env", { "modules": "commonjs", "loose": true }]]

View File

@ -13,7 +13,7 @@ install:
yarn install yarn install
script: script:
- | - |
npm run lint && npm run test npm run test
after_success: after_success:
- | - |
cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/codecov cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/codecov

View File

@ -1,43 +1,37 @@
/** /**
* Build npm lib * Build npm lib
* Steps: * Steps:
* 1. 代码格式校验 * 1. 构建 JS 入口文件
* 2. 构建 JS 入口文件 * 2. 构建每个组件对应的 [component].js
* 4. 构建每个组件对应的 [component].js * 3. 构建 vant-css
* 4. 构建 vant-css * 4. 打包 JS 文件vant.js && vant.min.js
* 5. 打包 JS 文件vant.js && vant.min.js * 5. 生成每个组件目录下的 style 入口
* 6. 生成每个组件目录下的 style 入口
*/ */
const chalk = require('chalk'); const chalk = require('chalk');
require('shelljs/global'); require('shelljs/global');
// 1. lint // 1. build entry
log('Starting', 'lint');
exec('npm run lint --silent');
log('Finished', 'lint');
// 2. build entry
log('Starting', 'build:entry'); log('Starting', 'build:entry');
exec('npm run build:file --silent'); exec('npm run build:file --silent');
log('Finished', 'build:entry'); log('Finished', 'build:entry');
// 3. build [component].js // 2. build [component].js
log('Starting', 'build:component'); log('Starting', 'build:component');
exec('npm run build:components --silent'); exec('npm run build:components --silent');
log('Finished', 'build:component'); log('Finished', 'build:component');
// 4. build vant-css // 3. build vant-css
log('Starting', 'build:vant-css'); log('Starting', 'build:vant-css');
exec('npm run build:vant-css --silent'); exec('npm run build:vant-css --silent');
log('Finished', 'build:vant-css'); log('Finished', 'build:vant-css');
// 5. build vant.js // 4. build vant.js
log('Starting', 'build:vant'); log('Starting', 'build:vant');
exec('npm run build:vant --silent'); exec('npm run build:vant --silent');
log('Finished', 'build:vant'); log('Finished', 'build:vant');
// 6. build style entrys // 5. build style entrys
log('Starting', 'build:style-entries'); log('Starting', 'build:style-entries');
exec('npm run build:style-entry --silent'); exec('npm run build:style-entry --silent');
log('Finished', 'build:style-entries'); log('Finished', 'build:style-entries');

View File

@ -1,16 +1,12 @@
{ {
"name": "vant", "name": "vant",
"version": "0.11.13", "version": "0.11.13",
"description": "有赞vue wap组件库", "description": "A Vue.js 2.0 Mobile UI at YouZan",
"main": "lib/vant.js", "main": "lib/vant.js",
"style": "lib/vant-css/index.css", "style": "lib/vant-css/index.css",
"unpkg": "lib/index.js", "unpkg": "lib/index.js",
"typings": "types/index.d.ts", "typings": "types/index.d.ts",
"files": [ "files": ["lib", "packages"],
"lib",
"src",
"packages"
],
"scripts": { "scripts": {
"bootstrap": "yarn || npm i && cd ./packages/vant-css/ && yarn || npm i && cd ../../", "bootstrap": "yarn || npm i && cd ./packages/vant-css/ && yarn || npm i && cd ../../",
"dev": "npm run build:file && webpack-dev-server --inline --config build/webpack.config.dev.js --content-base ./", "dev": "npm run build:file && webpack-dev-server --inline --config build/webpack.config.dev.js --content-base ./",
@ -24,8 +20,6 @@
"deploy:cdn": "superman cdn /zanui/vant docs/dist/*.js docs/dist/*.css && superman cdn /zanui/vant/async_en-US docs/dist/async_en-US/*.js && superman cdn /zanui/vant/async_zh-CN docs/dist/async_zh-CN/*.js", "deploy:cdn": "superman cdn /zanui/vant docs/dist/*.js docs/dist/*.css && superman cdn /zanui/vant/async_en-US docs/dist/async_en-US/*.js && superman cdn /zanui/vant/async_zh-CN docs/dist/async_zh-CN/*.js",
"deploy:docs": "rimraf docs/dist && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.prod.js", "deploy:docs": "rimraf docs/dist && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.prod.js",
"dist": "node build/bin/build-lib.js", "dist": "node build/bin/build-lib.js",
"clean": "rimraf lib && rimraf packages/*/lib",
"lint": "felint lint src/**/*.js packages/**/*.{js,vue} build/**/*.js",
"test": "karma start test/unit/karma.conf.js --single-run", "test": "karma start test/unit/karma.conf.js --single-run",
"test:coverage": "open test/unit/coverage/lcov-report/index.html", "test:coverage": "open test/unit/coverage/lcov-report/index.html",
"test:watch": "karma start test/unit/karma.conf.js", "test:watch": "karma start test/unit/karma.conf.js",
@ -36,11 +30,7 @@
"type": "git", "type": "git",
"url": "git@github.com:youzan/vant.git" "url": "git@github.com:youzan/vant.git"
}, },
"keywords": [ "keywords": ["youzan", "vue", "component"],
"youzan",
"vue",
"component"
],
"author": "youzanfe", "author": "youzanfe",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@ -55,17 +45,13 @@
"avoriaz": "2.0.0", "avoriaz": "2.0.0",
"babel-cli": "^6.26.0", "babel-cli": "^6.26.0",
"babel-core": "^6.26.0", "babel-core": "^6.26.0",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.2", "babel-loader": "^7.1.2",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.15.0", "babel-plugin-transform-runtime": "^6.15.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1", "babel-preset-env": "^1.6.1",
"cache-loader": "^1.2.0", "cache-loader": "^1.2.0",
"chai": "^4.1.2", "chai": "^4.1.2",
"cheerio": "^0.22.0",
"codecov": "^3.0.0", "codecov": "^3.0.0",
"cross-env": "^5.1.1", "cross-env": "^5.1.1",
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
@ -73,14 +59,8 @@
"eslint-plugin-vue": "^2.1.0", "eslint-plugin-vue": "^2.1.0",
"extract-text-webpack-plugin": "3.0.2", "extract-text-webpack-plugin": "3.0.2",
"fast-vue-md-loader": "^1.0.3", "fast-vue-md-loader": "^1.0.3",
"felint": "^0.5.0-alpha.3",
"file-save": "^0.2.0",
"friendly-errors-webpack-plugin": "^1.6.1", "friendly-errors-webpack-plugin": "^1.6.1",
"gh-pages": "^1.0.0", "gh-pages": "^1.0.0",
"gulp": "^3.9.1",
"gulp-cssmin": "^0.2.0",
"gulp-postcss": "^7.0.0",
"gulp-util": "^3.0.8",
"html-webpack-plugin": "^2.29.0", "html-webpack-plugin": "^2.29.0",
"isparta-loader": "^2.0.0", "isparta-loader": "^2.0.0",
"karma": "^1.7.1", "karma": "^1.7.1",
@ -89,11 +69,8 @@
"karma-mocha": "^1.3.0", "karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.4", "karma-phantomjs-launcher": "^1.0.4",
"karma-sinon-chai": "^1.3.2", "karma-sinon-chai": "^1.3.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "^0.0.32", "karma-spec-reporter": "^0.0.32",
"karma-webpack": "^2.0.9", "karma-webpack": "^2.0.9",
"markdown-it": "^8.4.0",
"markdown-it-container": "^2.0.0",
"mocha": "^4.0.1", "mocha": "^4.0.1",
"postcss": "^6.0.14", "postcss": "^6.0.14",
"postcss-calc": "^6.0.0", "postcss-calc": "^6.0.0",
@ -102,7 +79,6 @@
"precss": "2.0.0", "precss": "2.0.0",
"progress-bar-webpack-plugin": "^1.10.0", "progress-bar-webpack-plugin": "^1.10.0",
"rimraf": "^2.5.4", "rimraf": "^2.5.4",
"run-sequence": "^2.1.0",
"sinon": "^2.4.1", "sinon": "^2.4.1",
"sinon-chai": "^2.12.0", "sinon-chai": "^2.12.0",
"style-loader": "^0.19.1", "style-loader": "^0.19.1",

View File

@ -18,7 +18,7 @@ function getWebpackConfig(testFileName) {
options: { options: {
babel: { babel: {
presets: ['env'], presets: ['env'],
plugins: ['transform-runtime', 'transform-vue-jsx'] plugins: ['transform-runtime']
}, },
vue: { vue: {
autoprefixer: false, autoprefixer: false,

View File

@ -14,7 +14,7 @@ module.exports = function(config) {
reporters: ['spec', 'coverage'], reporters: ['spec', 'coverage'],
files: ['./index.js'], files: ['./index.js'],
preprocessors: { preprocessors: {
'./index.js': ['webpack', 'sourcemap'], './index.js': ['webpack'],
'test/unit/!(components)/**/*.vue': ['coverage'] 'test/unit/!(components)/**/*.vue': ['coverage']
}, },
webpack: getWebpackConfig(getTestFileName()), webpack: getWebpackConfig(getTestFileName()),

1426
yarn.lock

File diff suppressed because it is too large Load Diff