From f6752c6f8a45df7b1d888a8b759e6f2687371770 Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Tue, 12 Dec 2017 16:18:48 +0800 Subject: [PATCH] Updated: docs build process & travis-ci config --- .babelrc | 2 +- .electron-vue/webpack.docs.config.js | 22 +++++++++++++ .travis.yml | 15 +++++++-- README.md | 47 ++++++++++++++++++---------- package.json | 4 +-- 5 files changed, 67 insertions(+), 23 deletions(-) diff --git a/.babelrc b/.babelrc index 386f3224..e0d7f937 100644 --- a/.babelrc +++ b/.babelrc @@ -26,7 +26,7 @@ "stage-0" ] }, - "web": { + "production": { "presets": [ ["env", { "modules": false diff --git a/.electron-vue/webpack.docs.config.js b/.electron-vue/webpack.docs.config.js index 0c5fff4c..205bdcff 100644 --- a/.electron-vue/webpack.docs.config.js +++ b/.electron-vue/webpack.docs.config.js @@ -1,6 +1,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin') const path = require('path') +const webpack = require('webpack') module.exports = { context: path.resolve(__dirname, '../docs'), @@ -90,3 +91,24 @@ module.exports = { new ExtractTextPlugin("styles.css") ] } + +if (process.env.NODE_ENV === 'production') { + // module.exports.devtool = '#source-map' + // http://vue-loader.vuejs.org/en/workflow/production.html + module.exports.plugins = (module.exports.plugins || []).concat([ + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: '"production"' + } + }), + new webpack.optimize.UglifyJsPlugin({ + sourceMap: true, + compress: { + warnings: false + } + }), + new webpack.LoaderOptionsPlugin({ + minimize: true + }) + ]) +} diff --git a/.travis.yml b/.travis.yml index 11085506..9164cb6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ language: c matrix: include: - os: osx - - os: linux + # - os: linux env: CC=clang CXX=clang++ npm_config_clang=1 compiler: clang cache: @@ -25,11 +25,11 @@ before_install: - mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi +# - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi install: #- export DISPLAY=':99.0' #- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & -- nvm install 7 +- nvm install 8.9 - curl -o- -L https://yarnpkg.com/install.sh | bash - source ~/.bashrc - npm install -g xvfb-maybe @@ -38,6 +38,15 @@ script: #- xvfb-maybe node_modules/.bin/karma start test/unit/karma.conf.js #- yarn run pack && xvfb-maybe node_modules/.bin/mocha test/e2e - yarn run build +- yarn run build:docs branches: only: - master +after_script: + - cd docs/dist + - git init + - git config user.name "Molunerfinn" + - git config user.email "marksz@teamsz.xyz" + - git add . + - git commit -m "Travis build docs" + - git push --force --quiet "https://${GITHUB_TOKEN}@github.com/ecomfe/san-transition.git" master:gh-pages diff --git a/README.md b/README.md index 52bf24f1..1ba514c3 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,41 @@ -# picgo +# PicGo -> Easy to upload your pic & copy to write +> 图片上传+管理新体验 +

+ +

+

+ + + +

-#### Build Setup +## 精致设计 -``` bash -# install dependencies -npm install +![](https://ws1.sinaimg.cn/large/8700af19ly1fma907llb5j20m30ed46a) -# serve with hot reload at localhost:9080 -npm run dev +macOS系统下,支持拖拽至menubar图标实现上传。menubar app 窗口显示最新上传的5张图片以及剪贴板里的图片。点击图片自动将上传的链接复制到剪贴板。 -# build electron application for production -npm run build +## 便捷管理 -# run unit & end-to-end tests -npm test +![](https://ws1.sinaimg.cn/large/8700af19ly1fmd56zm2nej218g0p0teb) +查看你的上传记录,重复使用更方便。支持点击图片大图查看。支持删除图片(仅本地记录),让界面更加干净。 -# lint all JS/Vue component files in `src/` -npm run lint +## 可选图床 -``` +![](https://ws1.sinaimg.cn/large/8700af19ly1fmd5ck9m0wj20lr0cxmzs) ---- +目前支持微博图床和七牛图床。未来将支持更多。方便不同图床的上传需求。 -This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html). +## 多样链接 + +![](https://ws1.sinaimg.cn/large/8700af19gy1fmayjwttnbj218g0p0q4e) + +支持4种剪贴板链接格式,让你的文本编辑游刃有余。 + +## License + +[MIT](http://opensource.org/licenses/MIT) + +Copyright (c) 2017 Molunerfinn diff --git a/package.json b/package.json index 21a1e868..9d66b97b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "license": "MIT", "main": "./dist/electron/main.js", "scripts": { - "build": "node .electron-vue/build.js && electron-builder", + "build": "node .electron-vue/build.js && electron-builder --publish onTagOrDraft", "build:dir": "node .electron-vue/build.js && electron-builder --dir", "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", @@ -20,7 +20,7 @@ "test": "npm run unit && npm run e2e", "unit": "karma start test/unit/karma.conf.js", "postinstall": "npm run lint:fix", - "build:docs": "webpack -p --config .electron-vue/webpack.docs.config.js", + "build:docs": "cross-env NODE_ENV=production webpack -p --config .electron-vue/webpack.docs.config.js", "docs": "webpack-dev-server --content-base docs/dist --config .electron-vue/webpack.docs.config.js --hot --inline" }, "build": {