diff --git a/.eslintrc-platform.json b/.eslintrc-platform.json index 5fdb105b..47d0c042 100644 --- a/.eslintrc-platform.json +++ b/.eslintrc-platform.json @@ -1,13 +1,14 @@ { - "comment": "mattermost/platform@3.5.0/webapp/.eslintrc.json", + "comment": "mattermost/platform@3.6.2/webapp/.eslintrc.json", "extends": "eslint:recommended", "parserOptions": { - "ecmaVersion": 6, + "ecmaVersion": 8, "sourceType": "module", "ecmaFeatures": { "jsx": true, "impliedStrict": true, - "modules": true + "modules": true, + "experimentalObjectRestSpread": true } }, "parser": "babel-eslint", @@ -51,6 +52,7 @@ "dot-notation": 2, "eqeqeq": [2, "smart"], "func-call-spacing": [2, "never"], + "func-name-matching": 0, "func-names": 2, "func-style": [2, "declaration"], "generator-star-spacing": [2, {"before": false, "after": true}], @@ -137,6 +139,7 @@ "no-proto": 2, "no-redeclare": 2, "no-return-assign": [2, "always"], + "no-return-await": 2, "no-script-url": 2, "no-self-assign": [2, {"props": true}], "no-self-compare": 2, @@ -167,12 +170,13 @@ "no-useless-constructor": 2, "no-useless-escape": 2, "no-useless-rename": 2, + "no-useless-return": 2, "no-var": 0, "no-void": 2, "no-warning-comments": 1, "no-whitespace-before-property": 2, "no-with": 2, - "object-curly-newline": 0, + "object-curly-newline": 0, "object-curly-spacing": [2, "never"], "object-property-newline": [2, {"allowMultiplePropertiesPerLine": true}], "object-shorthand": [2, "always"], @@ -183,7 +187,6 @@ "prefer-arrow-callback": 2, "prefer-const": 2, "prefer-numeric-literals": 2, - "prefer-reflect": 2, "prefer-rest-params": 2, "prefer-spread": 2, "prefer-template": 0, @@ -191,6 +194,7 @@ "quotes": [2, "single", "avoid-escape"], "radix": 2, "react/display-name": [2, { "ignoreTranspilerName": false }], + "react/forbid-component-props": 0, "react/jsx-boolean-value": [2, "always"], "react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }], "react/jsx-curly-spacing": [2, "never"], @@ -203,26 +207,33 @@ "react/jsx-key": 2, "react/jsx-max-props-per-line": [2, { "maximum": 1 }], "react/jsx-no-bind": 0, + "react/jsx-no-comment-textnodes": 2, "react/jsx-no-duplicate-props": [2, { "ignoreCase": false }], "react/jsx-no-literals": 2, "react/jsx-no-target-blank": 2, "react/jsx-no-undef": 2, "react/jsx-pascal-case": 2, "react/jsx-space-before-closing": [2, "never"], + "react/jsx-tag-spacing": [2, { "closingSlash": "never", "beforeSelfClosing": "never", "afterOpening": "never" }], "react/jsx-uses-react": 2, "react/jsx-uses-vars": 2, - "react/jsx-no-comment-textnodes": 2, + "react/jsx-wrap-multilines": 2, + "react/no-children-prop": 2, "react/no-danger": 0, + "react/no-danger-with-children": 2, "react/no-deprecated": 2, "react/no-did-mount-set-state": 2, "react/no-did-update-set-state": 2, "react/no-direct-mutation-state": 2, + "react/no-find-dom-node": 1, "react/no-is-mounted": 2, "react/no-multi-comp": [2, { "ignoreStateless": true }], "react/no-render-return-value": 2, "react/no-set-state": 0, "react/no-string-refs": 0, + "react/no-unescaped-entities": 2, "react/no-unknown-property": 2, + "react/no-unused-prop-types": [1, {"skipShapeProps": true}], "react/prefer-es6-class": 2, "react/prefer-stateless-function": 0, "react/prop-types": 2, @@ -230,14 +241,7 @@ "react/require-render-return": 2, "react/self-closing-comp": 2, "react/sort-comp": 0, - "react/jsx-wrap-multilines": 2, - "react/no-find-dom-node": 1, - "react/forbid-component-props": 0, - "react/no-danger-with-children": 2, - "react/no-unused-prop-types": [1, {"skipShapeProps": true}], "react/style-prop-object": 2, - "react/no-children-prop": 2, - "react/no-unescaped-entities": 2, "require-yield": 2, "rest-spread-spacing": [2, "never"], "semi": [2, "always"], diff --git a/electron-builder.json b/electron-builder.json new file mode 100644 index 00000000..114428c9 --- /dev/null +++ b/electron-builder.json @@ -0,0 +1,46 @@ +{ + "appId": "com.mattermost.desktop", + "directories": { + "buildResources": "resources", + "app": "dist", + "output": "release" + }, + "deb": { + "synopsis": "Mattermost" + }, + "linux": { + "category": "InstantMessaging", + "target": [ + "deb", + "tar.gz" + ], + "extraFiles": [ + { + "from": "resources", + "filter": "icon.png" + }, + { + "from": "resources/linux", + "filter": [ + "create_desktop_file.sh", + "README.md" + ] + } + ] + }, + "mac": { + "category": "public.app-category.productivity", + "target": [ + "tar.gz" + ] + }, + "squirrelWindows": { + "iconUrl": "https://raw.githubusercontent.com/mattermost/desktop/master/resources/icon.ico" + }, + "win": { + "target": [ + "squirrel", + "zip" + ] + } +} diff --git a/package.json b/package.json index 90022e92..59b9848b 100644 --- a/package.json +++ b/package.json @@ -29,80 +29,37 @@ "test": "npm-run-all build test:* lint:*", "test:app": "mocha --reporter mocha-circleci-reporter --recursive test/specs", "package:all": "npm-run-all package:windows package:mac package:linux", - "package:windows": "build --win --x64 --ia32 --em.name=mattermost && npm run manipulate-windows-zip", - "package:mac": "build --mac", - "package:linux": "build --linux --x64 --ia32 --em.name=mattermost-desktop", + "package:windows": "build --win --x64 --ia32 --em.name=mattermost --publish=never && npm run manipulate-windows-zip", + "package:mac": "build --mac --publish=never", + "package:linux": "build --linux --x64 --ia32 --em.name=mattermost-desktop --publish=never", "manipulate-windows-zip": "node scripts/manipulate_windows_zip.js", "lint:js": "eslint --ext .js --ext .jsx ." }, "devDependencies": { "7zip-bin": "^2.0.4", - "babel-core": "^6.21.0", + "babel-core": "^6.23.1", "babel-eslint": "^7.1.1", - "babel-loader": "^6.2.10", - "babel-plugin-transform-object-rest-spread": "^6.22.0", - "babel-preset-react": "^6.16.0", + "babel-loader": "^6.3.2", + "babel-plugin-transform-object-rest-spread": "^6.23.0", + "babel-preset-react": "^6.23.0", "chai": "^3.5.0", "chai-as-promised": "^6.0.0", - "cross-env": "^3.1.3", + "cross-env": "^3.1.4", "devtron": "^1.4.0", - "electron": "1.4.13", - "electron-builder": "^10.9.2", + "electron": "1.6.1", + "electron-builder": "^14.5.3", + "electron-builder-squirrel-windows": "^15.0.0", "electron-connect": "^0.6.1", - "eslint": "^3.12.2", - "eslint-plugin-react": "^6.8.0", + "eslint": "^3.16.1", + "eslint-plugin-react": "^6.10.0", "gulp": "^3.9.1", "gulp-diff": "^1.0.0", - "gulp-jsbeautifier": "^2.0.3", - "json-loader": "^0.5.4", + "gulp-jsbeautifier": "^2.0.4", "mocha": "^3.2.0", "mocha-circleci-reporter": "0.0.2", - "npm-run-all": "^3.1.2", - "spectron": "~3.4.1", - "webpack": "^1.14.0", - "webpack-merge": "^1.1.2" - }, - "build": { - "appId": "com.mattermost.desktop", - "linux": { - "category": "InstantMessaging", - "target": [ - "deb", - "tar.gz" - ], - "synopsis": "Mattermost", - "extraFiles": [ - { - "from": "resources", - "filter": "icon.png" - }, - { - "from": "resources/linux", - "filter": [ - "create_desktop_file.sh", - "README.md" - ] - } - ] - }, - "mac": { - "category": "public.app-category.productivity", - "target": [ - "tar.gz" - ] - }, - "win": { - "description": "Mattermost", - "target": [ - "squirrel", - "zip" - ], - "iconUrl": "https://raw.githubusercontent.com/mattermost/desktop/master/resources/icon.ico" - } - }, - "directories": { - "buildResources": "resources", - "app": "dist", - "output": "release" + "npm-run-all": "^4.0.2", + "spectron": "~3.6.0", + "webpack": "^2.2.1", + "webpack-merge": "^3.0.0" } } diff --git a/src/main.js b/src/main.js index d52aa23f..bd336363 100644 --- a/src/main.js +++ b/src/main.js @@ -68,12 +68,6 @@ const assetsDir = path.resolve(app.getAppPath(), 'assets'); // be closed automatically when the JavaScript object is garbage collected. var mainWindow = null; -// Fix confused cursor in HiDPI -// https://github.com/electron/electron/issues/7655#issuecomment-259688853 -if (process.platform === 'win32') { - app.commandLine.appendSwitch('enable-use-zoom-for-dsf', 'false'); -} - var argv = require('yargs').parse(process.argv.slice(1)); const electronConnect = argv.livereload ? require('electron-connect') : null; diff --git a/src/package.json b/src/package.json index 2bc2a992..57aea406 100644 --- a/src/package.json +++ b/src/package.json @@ -20,10 +20,10 @@ "electron-context-menu": "^0.8.0", "electron-squirrel-startup": "^1.0.0", "os-locale": "^2.0.0", - "react": "^15.4.1", - "react-addons-css-transition-group": "^15.4.1", + "react": "^15.4.2", + "react-addons-css-transition-group": "^15.4.2", "react-bootstrap": "~0.30.7", - "react-dom": "^15.4.1", + "react-dom": "^15.4.2", "underscore": "^1.8.3", "yargs": "^3.32.0" } diff --git a/test/specs/browser/index_test.js b/test/specs/browser/index_test.js index 5796bcaf..c5905d68 100644 --- a/test/specs/browser/index_test.js +++ b/test/specs/browser/index_test.js @@ -106,7 +106,7 @@ describe('browser/index.html', function desc() { }] })); return this.app.restart().then(() => { - return this.app.client.waitUntilWindowLoaded().pause(1000); + return this.app.client.waitUntilWindowLoaded().pause(1500); }).then(() => { return this.app.browserWindow.getTitle().should.eventually.equal('Mattermost Desktop testing html'); }); @@ -176,6 +176,7 @@ describe('browser/index.html', function desc() { // See settings_test for specs that cover the actual prompt return this.app.client.waitUntilWindowLoaded(). click('#tabBarAddNewTeam'). + pause(500). isExisting('#newServerModal').should.eventually.be.true; }); }); diff --git a/test/specs/browser/settings_test.js b/test/specs/browser/settings_test.js index 282789ff..7bf2f55f 100644 --- a/test/specs/browser/settings_test.js +++ b/test/specs/browser/settings_test.js @@ -299,12 +299,14 @@ describe('browser/settings.html', function desc() { it('should not be valid if no team name has been set', () => { return this.app.client. click('#saveNewServerModal'). + pause(500). isExisting('.has-error #teamNameInput').should.eventually.equal(true); }); it('should not be valid if no server address has been set', () => { return this.app.client. click('#saveNewServerModal'). + pause(500). isExisting('.has-error #teamUrlInput').should.eventually.equal(true); }); @@ -348,6 +350,7 @@ describe('browser/settings.html', function desc() { return this.app.client. setValue('#teamUrlInput', 'superInvalid url'). click('#saveNewServerModal'). + pause(500). isExisting('.has-error #teamUrlInput').should.eventually.equal(true); }); diff --git a/webpack.config.main.js b/webpack.config.main.js index 01d98fd5..0e7c2b43 100644 --- a/webpack.config.main.js +++ b/webpack.config.main.js @@ -8,12 +8,6 @@ module.exports = merge(base, { output: { filename: './dist/main.js' }, - module: { - loaders: [{ - test: /\.json$/, - loader: 'json' - }] - }, node: { __filename: false, __dirname: false diff --git a/webpack.config.renderer.js b/webpack.config.renderer.js index 1b6827f6..1033d086 100644 --- a/webpack.config.renderer.js +++ b/webpack.config.renderer.js @@ -14,15 +14,14 @@ module.exports = merge(base, { filename: '[name].js' }, module: { - loaders: [{ - test: /\.json$/, - loader: 'json' - }, { + rules: [{ test: /\.jsx$/, - loader: 'babel', - query: { - presets: ['react'], - plugins: ['transform-object-rest-spread'] + use: { + loader: 'babel-loader', + options: { + presets: ['react'], + plugins: ['transform-object-rest-spread'] + } } }] },