Fixed gulp bugs

This commit is contained in:
Igor Zhukov 2014-03-12 22:55:12 +01:00
parent 96525d4933
commit e362ff26da
16 changed files with 88 additions and 55 deletions

10
.gitignore vendored
View File

@ -1,11 +1,11 @@
.DS_Store
.idea
*.sublime-workspace
# Node.js package manager
/node_modules
/npm-debug.log
node_modules
npm-debug.log
dist
package_dist
releases
webogram*.zip
app/js/partials.js
*.sublime-workspace
app/js/templates.js

View File

@ -484,7 +484,7 @@ input[type="number"]::-webkit-inner-spin-button {
margin-right: -7px;
}
.im_dialogs_col .nano > .pane {
background : rgba(0,0,0,.0);
background : rgba(0,0,0,0.0);
width : 12px;
right: 0px;
-webkit-transition : .2s;

View File

@ -44,16 +44,20 @@
<script type="text/javascript" src="js/lib/config.js"></script>
<script type="text/javascript" src="js/lib/mtproto.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/partials.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/services.js"></script>
<script type="text/javascript" src="js/controllers.js"></script>
<script type="text/javascript" src="js/filters.js"></script>
<!--PRODUCTION_ONLY_BEGIN
<script type="text/javascript" src="js/templates.js"></script>
PRODUCTION_ONLY_END-->
<script type="text/javascript" src="js/directives.js"></script>
<!-- endbuild -->
</body>
</html>
</html>

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
@ -30,10 +30,12 @@ angular.module('myApp', [
'ngAnimate',
'ngSanitize',
'ui.bootstrap',
'partials',
'mtproto.services',
'myApp.filters',
'myApp.services',
'mtproto.services',
/*PRODUCTION_ONLY_BEGIN
'myApp.templates',
PRODUCTION_ONLY_END*/
'myApp.directives',
'myApp.controllers'
]).

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
@ -1122,7 +1122,7 @@ factory('MtpAuthorizer', function (MtpDcConfigurator, MtpRsaKeysManager, MtpSecu
console.log('PQ factorization start');
if (!!window.Worker) {
var worker = new Worker('js/lib/pq_worker.js?1');
var worker = new Worker('js/lib/pq_worker.js');
worker.onmessage = function (e) {
auth.p = e.data[0];
@ -1416,7 +1416,7 @@ factory('MtpAesService', function ($q) {
};
}
var worker = new Worker('js/lib/aes_worker.js?2'),
var worker = new Worker('js/lib/aes_worker.js'),
taskID = 0,
awaiting = {};
@ -1468,7 +1468,7 @@ factory('MtpSha1Service', function ($q) {
};
}
var worker = new Worker('js/lib/sha1_worker.js?2'),
var worker = new Worker('js/lib/sha1_worker.js'),
taskID = 0,
awaiting = {};

View File

@ -1,12 +1,12 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/
importScripts(
'../../vendor/console-polyfill/console-polyfill.js?1',
'../../vendor/console-polyfill/console-polyfill.js',
'mtproto.js',
'../../vendor/jsbn/jsbn_combined.js'
);

View File

@ -1,14 +1,14 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/
importScripts(
'../../vendor/console-polyfill/console-polyfill.js?1',
'../../vendor/console-polyfill/console-polyfill.js',
'mtproto.js',
'../../vendor/cryptoJS/crypto.js?1'
'../../vendor/cryptoJS/crypto.js'
);
onmessage = function (e) {

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

View File

@ -1,5 +1,5 @@
/*!
* Webogram v0.0.1 - messaging web application for MTProto
* Webogram v0.0.19 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

View File

@ -4,7 +4,20 @@ var pj = require('./package.json');
var $ = require('gulp-load-plugins')();
var concat = require('gulp-concat');
gulp.task('usemin', ['templates'], function() {
// The generated file is being created at src
// so it can be fetched by usemin.
gulp.task('templates', function() {
return gulp.src('app/partials/*.html')
.pipe($.angularTemplatecache('templates.js', {
root: 'partials',
module: 'myApp.templates',
standalone: true
}))
.pipe(gulp.dest('app/js'));
});
gulp.task('usemin', ['templates', 'enable-production'], function() {
return gulp.src('app/index.html')
.pipe($.usemin({
html: [$.minifyHtml({empty: true})],
@ -14,18 +27,6 @@ gulp.task('usemin', ['templates'], function() {
.pipe(gulp.dest('dist'));
});
// The generated file is being created at src
// so it can be fetched by usemin.
gulp.task('templates', function() {
return gulp.src('app/partials/*.html')
.pipe($.angularTemplatecache('partials.js', {
root: 'partials',
module: 'partials',
standalone: true
}))
.pipe(gulp.dest('app/js'));
});
gulp.task('copy', function() {
return es.concat(
gulp.src(['app/favicon.ico', 'app/favicon_unread.ico', 'app/manifest.webapp', 'app/manifest.json', 'app/**/*worker.js'])
@ -46,13 +47,13 @@ gulp.task('copy', function() {
});
gulp.task('compress-dist', ['add-csp'], function() {
return es.concat(
gulp.src('dist/*')
.pipe($.zip('webogram_v' + pj.version + '.zip'))
.pipe(gulp.dest('package')),
gulp.src('package/*.zip')
.pipe(gulp.dest('.'))
);
return gulp.src('dist/**/*')
.pipe($.zip('webogram_v' + pj.version + '.zip'))
.pipe(gulp.dest('releases'));
});
gulp.task('cleanup-dist', ['compress-dist'], function() {
return gulp.src(['releases/**/*', '!releases/*.zip']).pipe($.clean());
});
gulp.task('add-csp', ['build'], function() {
@ -74,22 +75,48 @@ gulp.task('update-version-settings', function() {
});
gulp.task('update-version-comments', function() {
return gulp.src('app/**/*')
.pipe($.grepStream('Webogram v'))
return gulp.src('app/**/*.js')
.pipe($.replace(/Webogram v[0-9.]*/, 'Webogram v' + pj.version))
.pipe(gulp.dest('app'));
});
gulp.task('enable-production', function() {
return es.concat(
gulp.src('app/**/*.html')
.pipe($.replace(/PRODUCTION_ONLY_BEGIN/g, 'PRODUCTION_ONLY_BEGIN-->'))
.pipe($.replace(/PRODUCTION_ONLY_END/, '<!--PRODUCTION_ONLY_END'))
.pipe(gulp.dest('app')),
gulp.src('app/**/*.js')
.pipe($.replace(/PRODUCTION_ONLY_BEGIN(\*\/)?/g, 'PRODUCTION_ONLY_BEGIN*/'))
.pipe($.replace(/(\/\*)?PRODUCTION_ONLY_END/g, '/*PRODUCTION_ONLY_END'))
.pipe(gulp.dest('app'))
);
});
gulp.task('disable-production', function() {
return es.concat(
gulp.src('app/index.html')
.pipe($.replace(/PRODUCTION_ONLY_BEGIN-->/g, 'PRODUCTION_ONLY_BEGIN'))
.pipe($.replace(/<!--PRODUCTION_ONLY_END/g, 'PRODUCTION_ONLY_END'))
.pipe(gulp.dest('app')),
gulp.src('app/**/*.js')
.pipe($.replace(/PRODUCTION_ONLY_BEGIN(\*\/)?/g, 'PRODUCTION_ONLY_BEGIN'))
.pipe($.replace(/(\/\*)?PRODUCTION_ONLY_END/g, 'PRODUCTION_ONLY_END'))
.pipe(gulp.dest('app'))
);
});
gulp.task('clean', function() {
return gulp.src('dist').pipe($.clean());
return gulp.src(['dist/*', '!dist/.git']).pipe($.clean());
});
gulp.task('bump', ['update-version-manifests', 'update-version-settings', 'update-version-comments']);
gulp.task('build', ['templates', 'usemin', 'copy']);
gulp.task('package', ['compress-dist'], function() {
gulp.src('package').pipe($.clean());
gulp.task('build', ['templates', 'usemin', 'copy'], function () {
gulp.start('disable-production');
});
gulp.task('package', ['cleanup-dist']);
gulp.task('default', ['clean'], function() {
gulp.start('build');

View File

@ -1,6 +1,6 @@
{
"name": "webogram",
"version": "0.0.1",
"version": "0.0.19",
"description": "UNOFFICIAL Telegram Web App.",
"main": "server.js",
"scripts": {