Update package.json dependencies (+ fixes and improvements)

This commit is contained in:
RainLoop Team 2017-03-12 20:43:59 +03:00
parent 59128f285b
commit f8b4aa8683
8 changed files with 463 additions and 495 deletions

View file

@ -14,12 +14,16 @@ module.exports = {
'commonjs': true,
'es6': true
},
'plugins': ['compat'],
'globals': {
'RL_COMMUNITY': true,
'RL_ES6': true
},
// http://eslint.org/docs/rules/
'rules': {
// plugins
'compat/compat': 2,
// errors
'no-cond-assign': [2, 'always'],

1
.gitignore vendored
View file

@ -4,6 +4,7 @@
/error.log
/nbproject
/npm-debug.log
/yarn-error.log
/rainloop.sublime-project
/rainloop.sublime-workspace
/rainloop/v/0.0.0/static/*

View file

@ -3,7 +3,6 @@ import window from 'window';
import _ from '_';
import $ from '$';
import progressJs from 'progressJs';
import Tinycon from 'Tinycon';
import {
noop, trim, log, has, isArray, inArray, isUnd, isNormal, isPosNumeric, isNonEmptyArray,
@ -1437,16 +1436,6 @@ class AppUser extends AbstractApp
if (!bMobileDevice)
{
_.defer(() => this.initVerticalLayoutResizer(ClientSideKeyName.FolderListSize));
if (Tinycon && Settings.appSettingsGet('faviconStatus') && !Settings.appSettingsGet('listPermanentFiltered'))
{
Tinycon.setOptions({
fallback: false
});
Events.sub('mailbox.inbox-unread-count',
(iCount) => Tinycon.setBubble(0 < iCount ? (99 < iCount ? 99 : iCount) : 0));
}
}
}
else

View file

@ -1,6 +1,4 @@
/* global RL_ES6 */
import window from 'window';
import progressJs from 'progressJs';
import Promise from 'Promise';
@ -19,11 +17,6 @@ window.__rlah_data = () => RL_APP_DATA_STORAGE;
const useJsNextBundle = (function() {
if (!RL_ES6)
{
return false;
}
/* eslint-disable */
// try {
//

View file

@ -50,12 +50,11 @@ var
livereload = require('gulp-livereload'),
eslint = require('gulp-eslint'),
cache = require('gulp-cached'),
ignore = require('gulp-ignore'),
filter = require('gulp-filter'),
expect = require('gulp-expect-file'),
gutil = require('gulp-util');
cfg.community = !argv.pro;
cfg.next = !!argv.next;
// webpack
function webpackCallback(callback)
@ -240,7 +239,6 @@ cfg.paths.js = {
'vendors/bootstrap/js/bootstrap.min.js', // fixed
'node_modules/underscore/underscore-min.js',
'node_modules/moment/min/moment.min.js',
'node_modules/tinycon/tinycon.min.js',
'node_modules/knockout/build/output/knockout-latest.js',
'node_modules/knockout-projections/dist/knockout-projections.min.js',
'node_modules/knockout-sortable/build/knockout-sortable.min.js ',
@ -291,6 +289,7 @@ gulp.task('css:main', ['assets'], function() {
src = cfg.paths.css.main.src.concat([cfg.paths.less.main.src]);
return gulp.src(src)
.pipe(expect.real({errorOnFailure: true}, src))
.pipe(lessFilter)
.pipe(gulpif(cfg.watch, plumber({errorHandler: notify.onError("Error: <%= error.message %>")})))
.pipe(less({
@ -298,7 +297,7 @@ gulp.task('css:main', ['assets'], function() {
}))
.pipe(lessFilter.restore)
.pipe(concat(cfg.paths.css.main.name))
.pipe(autoprefixer('last 3 versions', '> 1%', 'ie 9', 'ie 10', 'ie 11', 'Firefox ESR'))
.pipe(autoprefixer('last 3 versions', 'ie >= 9', 'Firefox ESR'))
.pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/'))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticCSS))
@ -306,10 +305,12 @@ gulp.task('css:main', ['assets'], function() {
});
gulp.task('css:social', function() {
var autoprefixer = require('gulp-autoprefixer');
return gulp.src(cfg.paths.css.social.src)
var autoprefixer = require('gulp-autoprefixer'),
src = cfg.paths.css.social.src;
return gulp.src(src)
.pipe(expect.real({errorOnFailure: true}, src))
.pipe(concat(cfg.paths.css.social.name))
.pipe(autoprefixer('last 3 versions', '> 1%', 'ie 9', 'ie 10', 'ie 11', 'Firefox ESR'))
.pipe(autoprefixer('last 3 versions', 'ie >= 9', 'Firefox ESR'))
.pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/'))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticCSS));
@ -346,7 +347,9 @@ gulp.task('moment:locales', ['moment:locales-clear'], function() {
});
gulp.task('js:libs', function() {
return gulp.src(cfg.paths.js.libs.src)
var src = cfg.paths.js.libs.src;
return gulp.src(src)
.pipe(expect.real({errorOnFailure: true}, src))
.pipe(concat(cfg.paths.js.libs.name, {separator: '\n\n'}))
.pipe(eol('\n', true))
.pipe(replace(/sourceMappingURL=[a-z0-9\.\-_]{1,20}\.map/ig, ''))
@ -357,23 +360,10 @@ gulp.task('js:clean', function() {
return cleanDir(cfg.paths.staticJS + '/**/*.js');
});
gulp.task('js:webpack:main', function(callback) {
gulp.task('js:webpack', function(callback) {
webpack(webpackCfgBuilder(cfg.paths.staticJS, !cfg.community, false), webpackCallback(callback));
});
gulp.task('js:webpack:next', function(callback) {
if (cfg.next)
{
webpack(webpackCfgBuilder(cfg.paths.staticJS, !cfg.community, true), webpackCallback(callback));
}
else
{
callback();
}
});
gulp.task('js:webpack', ['js:webpack:main', 'js:webpack:next']);
gulp.task('js:app', ['js:webpack'], function() {
return gulp.src(cfg.paths.staticJS + cfg.paths.js.app.name)
.pipe(header(getHead() + '\n'))
@ -391,9 +381,8 @@ gulp.task('js:admin', ['js:webpack'], function() {
});
// - min
gulp.task('js:es5:min', ['js:app', 'js:admin'], function() {
gulp.task('js:min', ['js:app', 'js:admin'], function() {
return gulp.src(cfg.paths.staticJS + '*.js')
.pipe(ignore.exclude('*.next.js'))
.pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify({
@ -406,17 +395,6 @@ gulp.task('js:es5:min', ['js:app', 'js:admin'], function() {
.on('error', gutil.log);
});
gulp.task('js:es6:min', ['js:app', 'js:admin'], function() {
return cfg.next ? gulp.src(cfg.paths.staticJS + '*.next.js')
.pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"'))
.pipe(eol('\n', true))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(cfg.paths.staticMinJS))
.on('error', gutil.log) : true;
});
gulp.task('js:min', ['js:es5:min', 'js:es6:min']);
// lint
gulp.task('js:eslint', function() {
return gulp.src(cfg.paths.globjs)

View file

@ -47,44 +47,50 @@
"engines": {
"node": ">= 4"
},
"browserslist": [
"last 3 versions",
"ie >= 9",
"firefox esr"
],
"devDependencies": {
"Progress.js": "github:usablica/progress.js",
"autolinker": "1.4.1",
"babel-core": "^6.23.1",
"Progress.js": "github:usablica/progress.js#0.1.0",
"autolinker": "1.4.2",
"babel-core": "6.23.1",
"babel-eslint": "7.1.1",
"babel-loader": "^6.3.2",
"babel-loader": "6.4.0",
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-es2016": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"babel-runtime": "^6.23.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-env": "1.2.1",
"babel-preset-stage-0": "6.22.0",
"babel-runtime": "6.23.0",
"classnames": "2.2.5",
"copy-webpack-plugin": "4.0.1",
"es6-promise-polyfill": "1.2.0",
"eslint": "3.17.1",
"eslint-plugin-compat": "1.0.2",
"gulp": "3.9.1",
"gulp-autoprefixer": "3.1.1",
"gulp-cached": "1.1.1",
"gulp-clean-css": "^3.0.3",
"gulp-clean-css": "3.0.3",
"gulp-concat-util": "0.5.5",
"gulp-eol": "0.1.2",
"gulp-eslint": "3.0.1",
"gulp-expect-file": "0.0.7",
"gulp-filter": "5.0.0",
"gulp-header": "1.8.8",
"gulp-if": "2.0.2",
"gulp-ignore": "2.0.2",
"gulp-less": "3.3.0",
"gulp-livereload": "3.8.1",
"gulp-notify": "^3.0.0",
"gulp-notify": "3.0.0",
"gulp-plumber": "1.1.0",
"gulp-rename": "1.2.2",
"gulp-replace": "0.5.4",
"gulp-rimraf": "0.2.1",
"gulp-stripbom": "1.0.4",
"gulp-through": "0.4.0",
"gulp-uglify": "^2.0.1",
"gulp-uglify": "2.1.0",
"gulp-util": "3.0.8",
"gulp-zip": "^4.0.0",
"gulp-zip": "4.0.0",
"ifvisible.js": "1.0.6",
"jquery": "2.2.4",
"jquery-lazyload": "1.9.7",
@ -94,27 +100,26 @@
"js-cookie": "2.1.3",
"json-loader": "0.5.4",
"json3": "3.3.2",
"knockout": "3.4.1",
"knockout-projections": "github:stevesanderson/knockout-projections",
"knockout": "3.4.2",
"knockout-projections": "github:stevesanderson/knockout-projections#1.1.0",
"knockout-sortable": "0.14.1",
"lightgallery": "1.2.21",
"matchmedia-polyfill": "0.3.0",
"moment": "2.17.1",
"node-fs": "0.1.7",
"node-notifier": "^5.0.2",
"node-notifier": "5.0.2",
"normalize.css": "5.0.0",
"openpgp": "^2.3.8",
"openpgp": "2.4.0",
"opentip": "2.4.3",
"pikaday": "1.5.1",
"raw-loader": "0.5.1",
"rifraf": "2.0.3",
"rimraf": "^2.6.1",
"rimraf": "2.6.1",
"run-sequence": "1.2.2",
"simplestatemanager": "3.4.0",
"style-loader": "^0.13.2",
"tinycon": "github:tommoor/tinycon",
"style-loader": "0.13.2",
"underscore": "1.8.3",
"webpack": "^2.2.1",
"webpack": "2.2.1",
"webpack-notifier": "1.5.0"
}
}

View file

@ -7,12 +7,9 @@ var
WebpackNotifierPlugin = require('webpack-notifier'),
loose = true;
module.exports = function(publicPath, pro, es6) {
module.exports = function(publicPath, pro) {
return {
entry: es6 ? {
'js/app.next': path.join(__dirname, 'dev', 'app.js'),
'js/admin.next': path.join(__dirname, 'dev', 'admin.js')
} : {
entry: {
'js/boot': path.join(__dirname, 'dev', 'boot.js'),
'js/app': path.join(__dirname, 'dev', 'app.js'),
'js/admin': path.join(__dirname, 'dev', 'admin.js')
@ -27,7 +24,6 @@ module.exports = function(publicPath, pro, es6) {
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.DefinePlugin({
'RL_COMMUNITY': !pro,
'RL_ES6': !!es6,
'process.env': {
NODE_ENV: '"production"'
}
@ -52,60 +48,16 @@ module.exports = function(publicPath, pro, es6) {
test: /\.js$/,
loader: 'babel-loader',
include: [devPath],
options: !es6 ? {
options: {
cacheDirectory: true,
presets: [['es2015', {loose: loose, modules: false}], 'es2016', 'stage-0'],
presets: [['env', {
loose: loose,
modules: false,
targets: {
browsers: ['last 3 versions', 'ie >= 9', 'firefox esr']
}
}], 'stage-0'],
plugins: ['transform-runtime', 'transform-decorators-legacy']
} : {
cacheDirectory: true,
plugins: [
// es2015
["transform-es2015-template-literals", {loose: loose}],
"transform-es2015-literals",
"transform-es2015-function-name",
// ["transform-es2015-arrow-functions")],
"transform-es2015-block-scoped-functions",
// ["transform-es2015-classes", {loose: loose}],
// "transform-es2015-object-super",
"transform-es2015-shorthand-properties",
"transform-es2015-duplicate-keys",
["transform-es2015-computed-properties", {loose: loose}],
["transform-es2015-for-of", {loose: loose}],
"transform-es2015-sticky-regex",
"transform-es2015-unicode-regex",
// "check-es2015-constants",
//["transform-es2015-spread", {loose: loose}],
// "transform-es2015-parameters",
//["transform-es2015-destructuring", {loose: loose}],
// "transform-es2015-block-scoping",
"transform-es2015-typeof-symbol",
// ["transform-regenerator", { async: false, asyncGenerators: false }],
// es2016
"transform-exponentiation-operator",
// stage-0
"transform-do-expressions",
"transform-function-bind",
// stage-1
"transform-class-constructor-call",
"transform-export-extensions",
// stage-2
"transform-class-properties",
"transform-object-rest-spread",
// "transform-decorators", // -> transform-decorators-legacy
// stage-3
"syntax-trailing-function-commas",
"transform-async-to-generator",
"transform-exponentiation-operator",
// other
'transform-runtime',
'transform-decorators-legacy' // -> transform-decorators // from stage-2
]
}
},
{
@ -129,7 +81,6 @@ module.exports = function(publicPath, pro, es6) {
'hasher': 'window.hasher',
'Jua': 'window.Jua',
'Autolinker': 'window.Autolinker',
'Tinycon': 'window.Tinycon',
'ssm': 'window.ssm',
'key': 'window.key',
'_': 'window._',

769
yarn.lock

File diff suppressed because it is too large Load diff