Skip to content

Commit 73fbcc9

Browse files
committed
1.3.2
1 parent 8ffb83f commit 73fbcc9

File tree

6 files changed

+53
-66
lines changed

6 files changed

+53
-66
lines changed

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: node_js
2+
cache:
3+
directories:
4+
- node_modules # Speed up npm install
5+
node_js:
6+
- "5.10.0"
7+
env:
8+
- CXX=g++-4.8
9+
addons:
10+
apt:
11+
sources:
12+
- ubuntu-toolchain-r-test
13+
packages:
14+
- g++-4.8
15+
before_script:
16+
- npm install
17+
- npm run build:linux
18+
- zip -rq dist.zip dist
19+
script: node build/upload.js

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "WeFlow",
3-
"version": "1.4.0",
4-
"release": "1.4.0",
3+
"version": "1.3.2",
4+
"release": "1.3.1",
55
"description": "A minimal Electron application",
66
"main": "main.js",
77
"scripts": {
88
"start": "electron main.js",
9+
"build:linux": "rimraf dist && electron-packager ./ WeFlow --platform=linux --arch=x64 --icon=./assets/img/WeFlow.icns --overwrite --out ./dist/$npm_package_version --version=0.37.8 --ignore='(.github|.DS_Store)'",
910
"build:mac": "rimraf dist && electron-packager ./ WeFlow --platform=darwin --arch=x64 --icon=./assets/img/WeFlow.icns --overwrite --out ./dist/$npm_package_version --version=0.37.8 --ignore='(.github|.DS_Store)'",
1011
"build:win32": "rimraf dist && electron-packager ./ WeFlow --platform=win32 --arch=ia32 --icon=./assets/img/WeFlow.png --overwrite --out ./dist --version=0.37.8 --ignore=.github",
1112
"build:win64": "rimraf dist && electron-packager ./ WeFlow --platform=win32 --arch=x64 --icon=./assets/img/WeFlow.png --overwrite --out ./dist --version=0.37.8 --ignore=.github",
@@ -43,10 +44,6 @@
4344
"dependencies": {
4445
"async": "^2.0.0-rc.3",
4546
"autoprefixer": "^6.3.3",
46-
"babel-core": "^6.11.4",
47-
"babel-preset-electron": "^0.37.8",
48-
"babel-preset-es2015": "^6.9.0",
49-
"babel-preset-stage-2": "^6.11.0",
5047
"browser-sync": "^2.13.0",
5148
"crypto-md5": "^1.0.0",
5249
"del": "^2.2.0",

src/_tasks/dev.js

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ const ejs = require('gulp-ejs');
55
const ejshelper = require('tmt-ejs-helper');
66
const async = require('async');
77
const gulp = require('gulp');
8-
const gulpif = require('gulp-if');
98
const less = require('gulp-less');
109
const lazyImageCSS = require('gulp-lazyimagecss'); // 自动为图片样式添加 宽/高/background-size 属性
1110
const postcss = require('gulp-postcss'); // CSS 预处理
1211
const posthtml = require('gulp-posthtml'); // HTML 预处理
1312
const sass = require('gulp-sass');
14-
const babel = require('gulp-babel');
1513
const Common = require(path.join(__dirname, '../common.js'));
1614

1715

@@ -144,25 +142,7 @@ function dev(projectPath, log, callback) {
144142
})
145143
}
146144

147-
//编译 JS
148-
function compileJs(cb) {
149-
gulp.src(paths.src.js)
150-
.pipe(babel({
151-
presets: ['es2015', 'stage-2']
152-
}))
153-
.pipe(gulp.dest(paths.dev.js))
154-
.on('end', function () {
155-
if (cb) {
156-
console.log('compile JS success.');
157-
log('compile JS success.');
158-
cb();
159-
} else {
160-
reloadHandler();
161-
}
162-
})
163-
}
164-
165-
//监听文件
145+
//监听文件
166146
function watch(cb) {
167147
var watcher = gulp.watch([
168148
paths.src.img,
@@ -335,7 +315,7 @@ function dev(projectPath, log, callback) {
335315
copyHandler('slice', cb);
336316
},
337317
function (cb) {
338-
compileJs(cb);
318+
copyHandler('js', cb);
339319
},
340320
function (cb) {
341321
copyHandler('media', cb);

src/_tasks/dist.js

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const posthtmlPx2rem = require('posthtml-px2rem');
2626
const RevAll = require('weflow-rev-all'); // reversion
2727
const revDel = require('gulp-rev-delete-original');
2828
const sass = require('gulp-sass');
29-
const babel = require('gulp-babel');
3029
const Common = require(path.join(__dirname, '../common'));
3130

3231
let webp = require(path.join(__dirname, './common/webp'));
@@ -55,7 +54,7 @@ function dist(projectPath, log, callback) {
5554

5655
if (config.supportREM) {
5756
postcssOption = [
58-
postcssAutoprefixer({browsers: ['last 5 versions']}),
57+
postcssAutoprefixer({browsers: ['last 9 versions']}),
5958
postcssPxtorem({
6059
root_value: '20', // 基准值 html{ font-zise: 20px; }
6160
prop_white_list: [], // 对所有 px 值生效
@@ -64,7 +63,7 @@ function dist(projectPath, log, callback) {
6463
]
6564
} else {
6665
postcssOption = [
67-
postcssAutoprefixer({browsers: ['last 5 versions']})
66+
postcssAutoprefixer({browsers: ['last 9 versions']})
6867
]
6968
}
7069

@@ -220,23 +219,16 @@ function dist(projectPath, log, callback) {
220219
});
221220
}
222221

223-
//编译 JS
224-
function compileJs(cb) {
225-
gulp.src(paths.src.js)
226-
.pipe(babel({
227-
presets: ['es2015', 'stage-2']
228-
}))
222+
//JS 压缩
223+
function uglifyJs(cb) {
224+
gulp.src(paths.src.js, {base: paths.src.dir})
229225
.pipe(uglify())
230-
.pipe(gulp.dest(paths.tmp.js))
226+
.pipe(gulp.dest(paths.tmp.dir))
231227
.on('end', function () {
232-
if (cb) {
233-
console.log('compile JS success.');
234-
log('compile JS success.');
235-
cb();
236-
} else {
237-
reloadHandler();
238-
}
239-
})
228+
console.log('uglifyJs success.');
229+
log('uglifyJs success.');
230+
cb && cb();
231+
});
240232
}
241233

242234
//html 编译
@@ -395,7 +387,7 @@ function dist(projectPath, log, callback) {
395387
copyMedia(cb);
396388
},
397389
function (cb) {
398-
compileJs(cb);
390+
uglifyJs(cb);
399391
}
400392
], function (error) {
401393
if (error) {

src/app.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -460,16 +460,13 @@ function editName($project, $input) {
460460
hasText = true;
461461
keyboard = false;
462462
} else {
463-
dialog.showMessageBox({
464-
type: 'info',
465-
title: '提示',
466-
message: "请输入项目名",
467-
buttons: ['确定']
468-
});
463+
alert('请输入项目名')
469464

470465
setTimeout(function () {
471466
$this.html('');
472-
_this.focus();
467+
if(Common.PLATFORM !== 'win32'){
468+
_this.focus();
469+
}
473470
}, 10)
474471
}
475472
}
@@ -500,13 +497,10 @@ function editName($project, $input) {
500497

501498
hasText = true;
502499
} else {
503-
dialog.showMessageBox({
504-
type: 'info',
505-
title: '提示',
506-
message: "请输入项目名",
507-
buttons: ['确定']
508-
});
509-
_this.focus();
500+
alert('请输入项目名');
501+
if(Common.PLATFORM !== 'win32'){
502+
_this.focus();
503+
}
510504
}
511505
}, 100);
512506
}
@@ -704,13 +698,18 @@ function runTask(taskName, context) {
704698
}, function (data) {
705699
if (data) {
706700
alert('请在设置中配置 服务器上传 信息');
707-
}
708-
setTimeout(function () {
709701
$logStatus.text('Done');
710-
logReply('上传完成');
711-
console.log('上传完成');
702+
logReply('上传中断');
703+
console.log('上传中断');
712704
context.text('上传');
713-
}, 500);
705+
}else{
706+
setTimeout(function () {
707+
$logStatus.text('Done');
708+
logReply('上传完成');
709+
console.log('上传完成');
710+
context.text('上传');
711+
}, 500);
712+
}
714713
})
715714
})
716715
}

templates/example.zip

-90 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)