TagSpaces is an offline, open source, document manager with tagging support
integrating new boilerplace, adding build script for worker
Ilian Sapundshieve1026c7f4842
diff --git a/.eslintignore b/.eslintignoreindex fbb23f899..08512a0c4 100644--- a/.eslintignore+++ b/.eslintignore@@ -50,3 +50,11 @@ main.js.map.ideanpm-debug.log.*__snapshots__++extensions+cordova+web+app/utils/openlocationcode.js++# TODO just temporal+testsdiff --git a/.eslintrc b/.eslintrcindex 570d53723..b40a201b9 100644--- a/.eslintrc+++ b/.eslintrc@@ -4,7 +4,7 @@"sourceType": "module","allowImportExportEverywhere": true},- "extends": "airbnb",+ "extends": ["airbnb", "prettier"],"env": {"browser": true,"node": true@@ -17,9 +17,7 @@"compat/compat": "error","consistent-return": "off","comma-dangle": "off",- "flowtype-errors/show-errors": "error","generator-star-spacing": "off",- "import/no-unresolved": "error","import/no-extraneous-dependencies": "off","no-console": "off","no-use-before-define": "off",@@ -51,19 +49,5 @@"react/forbid-prop-types": "warn","react/jsx-boolean-value": "off"},- "plugins": [- "flowtype",- "flowtype-errors",- "import",- "promise",- "compat",- "react"- ],- "settings": {- "import/resolver": {- "webpack": {- "config": "../webpack.config.eslint.js"- }- }- }+ "plugins": ["import", "promise", "compat", "react"]}diff --git a/.prettierrc b/.prettierrcindex 1e5571371..7e5513e26 100644--- a/.prettierrc+++ b/.prettierrc@@ -1,4 +1,5 @@{"singleQuote": true,- "semi": true+ "semi": true,+ "useTabs": false}diff --git a/.vscode/settings.json b/.vscode/settings.jsonindex 26a7ced91..619775167 100644--- a/.vscode/settings.json+++ b/.vscode/settings.json@@ -3,7 +3,9 @@"git.autofetch": true,"git.confirmSync": false,"cSpell.userWords": ["customizability", "mapique", "tagspaces", "treeviz"],+ "cSpell.diagnosticLevel": "Hint","typescript.format.enable": true,+ "terminal.integrated.scrollback": 10000,"search.exclude": {".git": true,"cordova": true,@@ -20,12 +22,16 @@"cSpell.words": ["Affero","flowtype",+ "fsextra","haftungsbeschraenkt","lastindex","nbsp","taggroup","taglibrary",- "textcolor"+ "textcolor",+ "winattr"],- "flow.enabled": false+ "flow.enabled": false,+ "typescript.tsdk": "node_modules/typescript/lib",+ "eslint.enable": false}diff --git a/app/.eslintrc b/app/.eslintrcdeleted file mode 100644index 2111b8497..000000000--- a/app/.eslintrc+++ /dev/null@@ -1,22 +0,0 @@-{- "rules": {- "flowtype/boolean-style": [2, "boolean"],- "flowtype/define-flow-type": 1,- "flowtype/delimiter-dangle": [2, "never"],- "flowtype/generic-spacing": [2, "never"],- "flowtype/no-primitive-constructor-types": 2,- "flowtype/no-weak-types": 0,- "flowtype/object-type-delimiter": [2, "comma"],- "flowtype/require-parameter-type": 0,- "flowtype/require-return-type": 0,- "flowtype/require-valid-file-annotation": 0,- "flowtype/semi": [2, "always"],- "flowtype/space-after-type-colon": [2, "always"],- "flowtype/space-before-generic-bracket": [2, "never"],- "flowtype/space-before-type-colon": [2, "never"],- "flowtype/union-intersection-spacing": [2, "always"],- "flowtype/use-flow-type": 2,- "flowtype/valid-syntax": 2,- "flowtype-errors/show-errors": 2- }-}diff --git a/app/app.html b/app/app.htmlindex d0c5681c6..2169fc431 100644--- a/app/app.html+++ b/app/app.html@@ -2,34 +2,87 @@<html><head><title>TagSpaces Desktop</title>- <meta http-equiv="Content-Security-Policy" content="connect-src file: *; default-src 'self' ; script-src 'self' ; style-src 'self' 'unsafe-inline' data: blob: ; media-src *; img-src * data: content:;">- <meta charset="utf-8">- <meta name="format-detection" content="telephone=no">- <meta name="msapplication-tap-highlight" content="no">- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">- <link rel="stylesheet" type="text/css" href="./dist/style.css">+ <meta+ http-equiv="Content-Security-Policy"+ content="connect-src file: *; default-src 'self' ; script-src 'self' ; style-src 'self' 'unsafe-inline' data: blob: ; media-src *; img-src * data: content:;"+ />+ <meta charset="utf-8" />+ <meta name="format-detection" content="telephone=no" />+ <meta name="msapplication-tap-highlight" content="no" />+ <meta+ name="viewport"+ content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"+ />+ <link rel="stylesheet" type="text/css" href="./dist/style.css" /><script type="text/javascript" src="./extconfig.js"></script>- <script defer type="text/javascript" src="./dist/bundle.js"></script>+ <script defer type="text/javascript" src="./dist/renderer.prod.js"></script></head><body style="overflow: hidden; margin: 0; padding: 0;"><div id="root">- <div style="text-align: center; width: 100%; height: 100%; font-size: 1.4em; position:absolute; z-index: 999999; background-color: #F5F5F5; user-select: none; -webkit-user-select: none; -moz-user-select: none; -webkit-app-region: drag" class="appBackgroundTile">- <div style="top:45%; width: 100%; text-align: center; position:absolute;">- <svg style="vertical-align: middle" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100">- <g id="layer1" transform="matrix(0.33346217,0,0,0.33346217,-0.01300084,-250.91)">- <rect style="fill:none;fill-opacity:1;stroke:none" id="rect3052-8-1" width="299.42227" height="299.42227" x="-0.019505024" y="752.95935" />- <path style="fill:#ffffff;fill-opacity:1;stroke:none" d="m 181.90177,787.75394 70.88695,43.53834 C 180.29225,977.67059 187.41436,950.59754 124.58989,989.154 L 65.05006,905.90077 Z" id="rect3052-8-2-2" />- <ellipse style="fill:#616577;fill-opacity:1;stroke:none" id="path4875-4-7-5-6-2" cx="192.4187" cy="851.11481" rx="15.970615" ry="15.782593" />- <path style="fill:none;stroke:#a466aa;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"- d="M 159.73623,964.91671 134.54529,941.61879" id="path3108-5-39-8" />- <path style="fill:none;stroke:#ffffff;stroke-width:34.19813538;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"- d="m 162.16161,795.17204 90.03628,0.34544 0,86.1724 -115.50748,117.79375 -88.457192,-81.6665 z" id="path3923-1-1-4-9-8" />- <path style="fill:#f7901e;fill-opacity:1;stroke:#33b5be;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"- d="m 204.81469,910.87834 -50.38182,-45.3016" id="path3108-9-1-76-7" />- <path style="fill:#616577;fill-opacity:1;stroke:#f7901e;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"- d="M 182.93838,938.7066 144.48907,904.40668" id="path3108-0-7-9-8" />- <path style="fill:none;stroke:#616577;stroke-width:31.96374702;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"- d="m 164.34385,800.70161 83.03644,0 0,79.10209 -110.49206,113.42316 -82.031957,-75.83333 z" id="path3923-1-1-4-9" />+ <div+ style="text-align: center; width: 100%; height: 100%; font-size: 1.4em; position:absolute; z-index: 999999; background-color: #F5F5F5; user-select: none; -webkit-user-select: none; -moz-user-select: none; -webkit-app-region: drag"+ class="appBackgroundTile"+ >+ <div+ style="top:45%; width: 100%; text-align: center; position:absolute;"+ >+ <svg+ style="vertical-align: middle"+ xmlns="http://www.w3.org/2000/svg"+ version="1.1"+ width="100"+ height="100"+ >+ <g+ id="layer1"+ transform="matrix(0.33346217,0,0,0.33346217,-0.01300084,-250.91)"+ >+ <rect+ style="fill:none;fill-opacity:1;stroke:none"+ id="rect3052-8-1"+ width="299.42227"+ height="299.42227"+ x="-0.019505024"+ y="752.95935"+ />+ <path+ style="fill:#ffffff;fill-opacity:1;stroke:none"+ d="m 181.90177,787.75394 70.88695,43.53834 C 180.29225,977.67059 187.41436,950.59754 124.58989,989.154 L 65.05006,905.90077 Z"+ id="rect3052-8-2-2"+ />+ <ellipse+ style="fill:#616577;fill-opacity:1;stroke:none"+ id="path4875-4-7-5-6-2"+ cx="192.4187"+ cy="851.11481"+ rx="15.970615"+ ry="15.782593"+ />+ <path+ style="fill:none;stroke:#a466aa;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"+ d="M 159.73623,964.91671 134.54529,941.61879"+ id="path3108-5-39-8"+ />+ <path+ style="fill:none;stroke:#ffffff;stroke-width:34.19813538;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"+ d="m 162.16161,795.17204 90.03628,0.34544 0,86.1724 -115.50748,117.79375 -88.457192,-81.6665 z"+ id="path3923-1-1-4-9-8"+ />+ <path+ style="fill:#f7901e;fill-opacity:1;stroke:#33b5be;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"+ d="m 204.81469,910.87834 -50.38182,-45.3016"+ id="path3108-9-1-76-7"+ />+ <path+ style="fill:#616577;fill-opacity:1;stroke:#f7901e;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"+ d="M 182.93838,938.7066 144.48907,904.40668"+ id="path3108-0-7-9-8"+ />+ <path+ style="fill:none;stroke:#616577;stroke-width:31.96374702;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"+ d="m 164.34385,800.70161 83.03644,0 0,79.10209 -110.49206,113.42316 -82.031957,-75.83333 z"+ id="path3923-1-1-4-9"+ /></g></svg></div>diff --git a/app/appd.html b/app/appd.htmlindex 86a9ace9d..7b6fb991e 100644--- a/app/appd.html+++ b/app/appd.html@@ -35,8 +35,8 @@const port = process.env.PORT || 1212;const bundleScript = document.createElement('script');bundleScript.src = process.env.HOT- ? 'http://localhost:' + port + '/dist/bundle.js'- : './dist/bundle.js';+ ? 'http://localhost:' + port + '/dist/renderer.prod.js'+ : './dist/renderer.prod.js';bundleScript.type = 'text/javascript';bundleScript.defer = true;document.getElementsByTagName('head')[0].appendChild(bundleScript);diff --git a/app/main.dev.ts b/app/main.dev.tsindex 98fdc9647..fadc5da4f 100644--- a/app/main.dev.ts+++ b/app/main.dev.ts@@ -21,17 +21,14 @@ import windowStateKeeper from 'electron-window-state';import path from 'path';let mainWindow = null;-global.splashWorkerWindow = null;+(global as any).splashWorkerWindow = null;if (process.env.NODE_ENV === 'production') {// eslint-disable-next-lineconst sourceMapSupport = require('source-map-support');sourceMapSupport.install();- // $FlowFixMeconsole.log = () => {};- // $FlowFixMeconsole.time = () => {};- // $FlowFixMeconsole.timeEnd = () => {};}@@ -126,7 +123,7 @@ app.on('ready', async () => {function createSplashWorker() {// console.log('Dev ' + process.env.NODE_ENV + ' worker ' + showWorkerWindow);- global.splashWorkerWindow = new BrowserWindow({+ (global as any).splashWorkerWindow = new BrowserWindow({show: workerDevMode,x: 0,y: 0,@@ -138,7 +135,9 @@ app.on('ready', async () => {}});- global.splashWorkerWindow.loadURL(`file://${__dirname}/splash.html`);+ (global as any).splashWorkerWindow.loadURL(+ `file://${__dirname}/splash.html`+ );}createSplashWorker();@@ -175,7 +174,7 @@ app.on('ready', async () => {throw new Error('"mainWindow" is not defined');}// mainWindow.show();- global.splashWorkerWindow.hide(); // Comment for easy debugging of the worker+ (global as any).splashWorkerWindow.hide(); // Comment for easy debugging of the workermainWindow.focus();});@@ -186,8 +185,8 @@ app.on('ready', async () => {// when you should delete the corresponding element.mainWindow = null;try {- global.splashWorkerWindow.close();- global.splashWorkerWindow = null;+ (global as any).splashWorkerWindow.close();+ (global as any).splashWorkerWindow = null;} catch (err) {// console.warn('Error closing the splash window. ' + err);}@@ -215,10 +214,10 @@ app.on('ready', async () => {});});- global.splashWorkerWindow.webContents.on('crashed', () => {+ (global as any).splashWorkerWindow.webContents.on('crashed', () => {try {- global.splashWorkerWindow.close();- global.splashWorkerWindow = null;+ (global as any).splashWorkerWindow.close();+ (global as any).splashWorkerWindow = null;} catch (err) {console.warn('Error closing the splash window. ' + err);}@@ -235,8 +234,8 @@ app.on('ready', async () => {ipcMain.on('setSplashVisibility', (event, arg) => {// worker window needed to be visible for the PDF tmb generation// console.log('worker event in main: ' + arg.visibility);- if (global.splashWorkerWindow && arg.visibility) {- global.splashWorkerWindow.show();+ if ((global as any).splashWorkerWindow && arg.visibility) {+ (global as any).splashWorkerWindow.show();// arg.visibility ? global.splashWorkerWindow.show() : global.splashWorkerWindow.hide();}});diff --git a/app/main.worker.babel.js b/app/main.worker.babel.jsnew file mode 100644index 000000000..31dd89107--- /dev/null+++ b/app/main.worker.babel.js@@ -0,0 +1,7 @@+const register = require('@babel/register').default;++register({+ extensions: ['.ts', '.tsx', '.js', '.json']+});++require('./main.dev.ts');diff --git a/app/tagspaces.d.ts b/app/tagspaces.d.tsnew file mode 100644index 000000000..dbaf6ae60--- /dev/null+++ b/app/tagspaces.d.ts@@ -0,0 +1,56 @@+/**+ * TagSpaces - universal file and folder organizer+ * Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License (version 3) as+ * published by the Free Software Foundation.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ *+ */++declare module '*.json';+declare module '*.md';+declare module '*.txt';+declare module '*.png';+declare module '*.svg';+declare module '*.woff';+declare module '*.woff2';+declare module '*.xml';++declare interface Window {+ // interface TSCustomWindow extends Window {+ walkCanceled?: boolean;+ ExtLogoURL?: string;+ ExtDefaultVerticalPanel?: string;+ ExtDisplayMode?: string;+ ExtDefaultPerspective?: string;+ ExtLocationsReadOnly?: string;+ ExtTagLibrary?: Array<any>;+ ExtLocations?: Array<any>;+ ExtTheme?: string;+ ExtIsFirstRun?: boolean;+ ExtDefaultVerticalPanel?: string;+ __REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: any;+ plugins?: any; // needed for Cordova+ resolveLocalFileSystemURL?: any; // needed for Cordova+ device?: any; // needed for Cordova+}++declare interface NodeModule {+ /** https://webpack.js.org/api/hot-module-replacement */+ hot: {+ accept(file: string, update: () => void): void;+ };+}++declare interface Document {+ webkitExitFullscreen: any;+}diff --git a/configs/webpack.config.worker.prod.babel.js b/configs/webpack.config.worker.prod.babel.jsnew file mode 100644index 000000000..fe8088c63--- /dev/null+++ b/configs/webpack.config.worker.prod.babel.js@@ -0,0 +1,220 @@+/**+ * Build config for electron renderer process+ */++import path from 'path';+import webpack from 'webpack';+import MiniCssExtractPlugin from 'mini-css-extract-plugin';+import OptimizeCSSAssetsPlugin from 'optimize-css-assets-webpack-plugin';+import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';+import merge from 'webpack-merge';+import TerserPlugin from 'terser-webpack-plugin';+import baseConfig from './webpack.config.base';+import CheckNodeEnv from '../internals/scripts/CheckNodeEnv';++CheckNodeEnv('production');+export default merge.smart(baseConfig, {+ devtool: 'source-map',++ mode: 'production',++ target: 'electron-renderer',++ entry: path.join(__dirname, '..', 'app/splash-worker.ts'),++ output: {+ filename: 'electron-worker.js',+ path: path.join(__dirname, '/../app/dist'),+ publicPath: './dist/'+ },++ module: {+ rules: [+ // Extract all .global.css to style.css as is+ {+ test: /\.global\.css$/,+ use: [+ {+ loader: MiniCssExtractPlugin.loader,+ options: {+ publicPath: './'+ }+ },+ {+ loader: 'css-loader',+ options: {+ sourceMap: true+ }+ }+ ]+ },+ // Pipe other styles through css modules and append to style.css+ {+ test: /^((?!\.global).)*\.css$/,+ use: [+ {+ loader: MiniCssExtractPlugin.loader+ },+ {+ loader: 'css-loader',+ options: {+ modules: true,+ localIdentName: '[name]__[local]__[hash:base64:5]',+ sourceMap: true+ }+ }+ ]+ },+ // Add SASS support - compile all .global.scss files and pipe it to style.css+ {+ test: /\.global\.(scss|sass)$/,+ use: [+ {+ loader: MiniCssExtractPlugin.loader+ },+ {+ loader: 'css-loader',+ options: {+ sourceMap: true,+ importLoaders: 1+ }+ },+ {+ loader: 'sass-loader',+ options: {+ sourceMap: true+ }+ }+ ]+ },+ // Add SASS support - compile all other .scss files and pipe it to style.css+ {+ test: /^((?!\.global).)*\.(scss|sass)$/,+ use: [+ {+ loader: MiniCssExtractPlugin.loader+ },+ {+ loader: 'css-loader',+ options: {+ modules: true,+ importLoaders: 1,+ localIdentName: '[name]__[local]__[hash:base64:5]',+ sourceMap: true+ }+ },+ {+ loader: 'sass-loader',+ options: {+ sourceMap: true+ }+ }+ ]+ },+ // WOFF Font+ {+ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,+ use: {+ loader: 'url-loader',+ options: {+ limit: 10000,+ mimetype: 'application/font-woff'+ }+ }+ },+ // WOFF2 Font+ {+ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,+ use: {+ loader: 'url-loader',+ options: {+ limit: 10000,+ mimetype: 'application/font-woff'+ }+ }+ },+ // TTF Font+ {+ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,+ use: {+ loader: 'url-loader',+ options: {+ limit: 10000,+ mimetype: 'application/octet-stream'+ }+ }+ },+ // EOT Font+ {+ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,+ use: 'file-loader'+ },+ // SVG Font+ {+ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,+ use: {+ loader: 'url-loader',+ options: {+ limit: 10000,+ mimetype: 'image/svg+xml'+ }+ }+ },+ // Text files+ {+ test: /\.(txt)$/,+ use: 'raw-loader'+ },+ // Common Image Formats+ {+ test: /\.(?:ico|gif|png|jpg|jpeg|webp|svg)$/,+ use: 'url-loader'+ }+ ]+ },++ optimization: {+ minimizer: process.env.E2E_BUILD+ ? []+ : [+ new TerserPlugin({+ parallel: true,+ sourceMap: true,+ cache: true+ }),+ new OptimizeCSSAssetsPlugin({+ cssProcessorOptions: {+ map: {+ inline: false,+ annotation: true+ }+ }+ })+ ]+ },++ plugins: [+ /**+ * Create global constants which can be configured at compile time.+ *+ * Useful for allowing different behaviour between development builds and+ * release builds+ *+ * NODE_ENV should be production so that modules do not perform certain+ * development checks+ */+ new webpack.EnvironmentPlugin({+ NODE_ENV: 'production'+ }),++ new MiniCssExtractPlugin({+ filename: 'style.css'+ }),++ new BundleAnalyzerPlugin({+ analyzerMode:+ process.env.OPEN_ANALYZER === 'true' ? 'server' : 'disabled',+ openAnalyzer: process.env.OPEN_ANALYZER === 'true'+ })+ ]+});diff --git a/flow-typed/module_vx.x.x.js b/flow-typed/module_vx.x.x.jsdeleted file mode 100644index 734bb1c75..000000000--- a/flow-typed/module_vx.x.x.js+++ /dev/null@@ -1,3 +0,0 @@-declare module 'module' {- declare module.exports: any;-}diff --git a/package.json b/package.jsonindex 235ca802e..c2f7b9e58 100644--- a/package.json+++ b/package.json@@ -4,11 +4,13 @@"description": "TagSpaces core repository","homepage": "https://www.tagspaces.org","scripts": {- "build": "concurrently \"yarn build-main\" \"yarn build-renderer\"",+ "build": "concurrently 'yarn build-main' 'yarn build-renderer' 'yarn build-worker'","build-dll": "cross-env NODE_ENV=development webpack --config ./configs/webpack.config.renderer.dev.dll.babel.js --colors","build-e2e": "cross-env E2E_BUILD=true yarn build","build-main": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.main.prod.babel.js --colors","build-renderer": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.renderer.prod.babel.js --colors",+ "build-worker": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.worker.prod.babel.js --colors",+ "build-worker-dev": "cross-env NODE_ENV=production webpack --config webpack.config.worker.dev.js --colors","dev": "cross-env START_HOT=1 node -r @babel/register ./internals/scripts/CheckPortInUse.js && cross-env START_HOT=1 yarn start-renderer-dev","lint": "cross-env NODE_ENV=development eslint --cache --format=pretty .","lint-fix": "yarn --silent lint --fix; exit 0",@@ -27,6 +29,7 @@"start": "cross-env NODE_ENV=production electron ./app/main.prod.js","start-main-dev": "cross-env HOT=1 NODE_ENV=development electron ./app/main.dev.babel.js","start-renderer-dev": "cross-env NODE_ENV=development webpack-dev-server --config configs/webpack.config.renderer.dev.babel.js",+ "type-check": "tsc --noEmit","test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 jest","test-all": "yarn lint && yarn build && yarn test && yarn build-e2e && yarn test-e2e","test-e2e": "node -r @babel/register ./internals/scripts/CheckBuiltsExist.js && cross-env NODE_ENV=test testcafe electron:./ ./test/e2e/HomePage.e2e.ts",@@ -168,18 +171,19 @@"shelljs": "^0.8.3","sinon": "^2.3.1","spectron": "^7.0.0",+ "style-loader": "^1.1.2","stylelint": "^9.9.0","stylelint-config-prettier": "^4.0.0","stylelint-config-standard": "^18.2.0","terser-webpack-plugin": "^1.2.3",- "ts-loader": "^5.3.2",- "typescript": "^3.2.2",- "url-loader": "^1.1.2",- "webpack": "^4.28.3",- "webpack-bundle-analyzer": "^3.0.3",- "webpack-cli": "^3.2.0",- "webpack-dev-server": "^3.1.14",- "webpack-merge": "^4.2.1",+ "ts-loader": "^6.2.1",+ "typescript": "^3.7.4",+ "url-loader": "^3.0.0",+ "webpack": "^4.41.5",+ "webpack-bundle-analyzer": "^3.6.0",+ "webpack-cli": "^3.3.10",+ "webpack-dev-server": "^3.10.1",+ "webpack-merge": "^4.2.2","yarn": "^1.21.1"},"dependencies": {diff --git a/scripts/genswconf.js b/scripts/genswconf.jsindex e4b77c646..5a8504f67 100644--- a/scripts/genswconf.js+++ b/scripts/genswconf.js@@ -1,5 +1,5 @@const sh = require('shelljs');-const { version, productName } = require('../app/package.json');+const { version } = require('../app/package.json');const FILES_TO_CACHE = ['offline.html'];diff --git a/tsconfig.json b/tsconfig.jsonindex 087b7bda0..634cbf1b8 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -5,15 +5,26 @@"baseUrl": "./","rootDir": "./","jsx": "react",- "module": "ESNext",+ "module": "esnext","moduleResolution": "node","noUnusedLocals": true,- "noEmit": false,"allowSyntheticDefaultImports": true,"pretty": true,"sourceMap": false,+ "skipLibCheck": true,"resolveJsonModule": true,- "lib": ["es2015", "dom"]+ "lib": ["es2015", "dom"],+ "paths": {+ "-/*": ["app/*"]+ }},- "exclude": ["node_modules", "**/node_modules/*", "extensions"]+ "include": ["app/**/*.ts", "app/**/*.tsx"]+ // "exclude": [+ // "node_modules",+ // "**/node_modules/*",+ // "extensions",+ // "cordova",+ // "web",+ // "tests"+ //]}diff --git a/yarn.lock b/yarn.lockindex 6a91644a0..12f891f9d 100644--- a/yarn.lock+++ b/yarn.lock@@ -4145,7 +4145,7 @@ braces@^2.3.1, braces@^2.3.2:split-string "^3.0.2"to-regex "^3.0.1"-braces@~3.0.2:+braces@^3.0.1, braces@~3.0.2:version "3.0.2"resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==@@ -11131,6 +11131,14 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8:snapdragon "^0.8.1"to-regex "^3.0.2"+micromatch@^4.0.0:+ version "4.0.2"+ resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"+ integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==+ dependencies:+ braces "^3.0.1"+ picomatch "^2.0.5"+miller-rabin@^4.0.0:version "4.0.1"resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"@@ -11156,7 +11164,7 @@ [email protected], mime@^1.2.11:resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==-mime@^2.0.3, mime@^2.4.4:+mime@^2.4.4:version "2.4.4"resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5"integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==@@ -12805,6 +12813,11 @@ picomatch@^2.0.4:resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6"integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==+picomatch@^2.0.5:+ version "2.1.1"+ resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.1.1.tgz#ecdfbea7704adb5fe6fb47f9866c4c0e15e905c5"+ integrity sha512-OYMyqkKzK7blWO/+XZYP6w8hH0LDvkBvdvKukti+7kqYFCiEAk+gI3DWnryapc0Dau05ugGTy0foQ6mqn4AHYA==+pify@^2.0.0, pify@^2.3.0:version "2.3.0"resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"@@ -15025,6 +15038,14 @@ schema-utils@^2.0.1:ajv "^6.1.0"ajv-keywords "^3.1.0"+schema-utils@^2.5.0:+ version "2.6.1"+ resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.1.tgz#eb78f0b945c7bcfa2082b3565e8db3548011dc4f"+ integrity sha512-0WXHDs1VDJyo+Zqs9TKLKyD/h7yDpHUhEFsM2CzkICFdoX1av+GBq/J2xRTFfsQO5kBfhZzANf2VcIm84jqDbg==+ dependencies:+ ajv "^6.10.2"+ ajv-keywords "^3.4.1"+scroll-doc@^0.2.1:version "0.2.1"resolved "https://registry.yarnpkg.com/scroll-doc/-/scroll-doc-0.2.1.tgz#168f9e9ac598743dd682c992839b44a38ce4dd91"@@ -15077,7 +15098,7 @@ semver-diff@^2.0.0:dependencies:semver "^5.0.3"-"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "[email protected] || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.1, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0:+"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "[email protected] || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0:version "5.7.1"resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==@@ -15934,6 +15955,14 @@ strong-log-transformer@^2.0.0:minimist "^1.2.0"through "^2.3.4"+style-loader@^1.1.2:+ version "1.1.2"+ resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.1.2.tgz#1b519c19faf548df6182b93e72ea1a4156022c2f"+ integrity sha512-0Mpq1ZHFDCNq1F+6avNBgv+7q8V+mWRuzehxyJT+aKgzyN/yfKTwjYqaYwBgx+11UpQxL21zNQfzzlz+JcGURw==+ dependencies:+ loader-utils "^1.2.3"+ schema-utils "^2.0.1"+style-search@^0.1.0:version "0.1.0"resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902"@@ -16569,16 +16598,16 @@ tryer@^1.0.1:resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8"integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==-ts-loader@^5.3.2:- version "5.4.5"- resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-5.4.5.tgz#a0c1f034b017a9344cef0961bfd97cc192492b8b"- integrity sha512-XYsjfnRQCBum9AMRZpk2rTYSVpdZBpZK+kDh0TeT3kxmQNBDVIeUjdPjY5RZry4eIAb8XHc4gYSUiUWPYvzSRw==+ts-loader@^6.2.1:+ version "6.2.1"+ resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.2.1.tgz#67939d5772e8a8c6bdaf6277ca023a4812da02ef"+ integrity sha512-Dd9FekWuABGgjE1g0TlQJ+4dFUfYGbYcs52/HQObE0ZmUNjQlmLAS7xXsSzy23AMaMwipsx5sNHvoEpT2CZq1g==dependencies:chalk "^2.3.0"enhanced-resolve "^4.0.0"loader-utils "^1.0.2"- micromatch "^3.1.4"- semver "^5.0.1"+ micromatch "^4.0.0"+ semver "^6.0.0"tslib@^1.9.0:version "1.10.0"@@ -16647,6 +16676,11 @@ typescript@^3.2.2:resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==+typescript@^3.7.4:+ version "3.7.4"+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19"+ integrity sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==+ua-parser-js@^0.7.18:version "0.7.20"resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.20.tgz#7527178b82f6a62a0f243d1f94fd30e3e3c21098"@@ -16901,14 +16935,14 @@ urix@^0.1.0:resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=-url-loader@^1.1.2:- version "1.1.2"- resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-1.1.2.tgz#b971d191b83af693c5e3fea4064be9e1f2d7f8d8"- integrity sha512-dXHkKmw8FhPqu8asTc1puBfe3TehOCo2+RmOOev5suNCIYBcT626kxiWg1NBVkwc4rO8BGa7gP70W7VXuqHrjg==+url-loader@^3.0.0:+ version "3.0.0"+ resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-3.0.0.tgz#9f1f11b371acf6e51ed15a50db635e02eec18368"+ integrity sha512-a84JJbIA5xTFTWyjjcPdnsu+41o/SNE8SpXMdUvXs6Q+LuhCD9E2+0VCiuDWqgo3GGXVlFHzArDmBpj9PgWn4A==dependencies:- loader-utils "^1.1.0"- mime "^2.0.3"- schema-utils "^1.0.0"+ loader-utils "^1.2.3"+ mime "^2.4.4"+ schema-utils "^2.5.0"url-parse-lax@^1.0.0:version "1.0.0"@@ -17192,7 +17226,7 @@ webidl-conversions@^4.0.2:resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==-webpack-bundle-analyzer@^3.0.3:+webpack-bundle-analyzer@^3.6.0:version "3.6.0"resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.6.0.tgz#39b3a8f829ca044682bc6f9e011c95deb554aefd"integrity sha512-orUfvVYEfBMDXgEKAKVvab5iQ2wXneIEorGNsyuOyVYpjYrI7CUOhhXNDd3huMwQ3vNNWWlGP+hzflMFYNzi2g==@@ -17211,7 +17245,7 @@ webpack-bundle-analyzer@^3.0.3:opener "^1.5.1"ws "^6.0.0"-webpack-cli@^3.2.0:+webpack-cli@^3.3.10:version "3.3.10"resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.10.tgz#17b279267e9b4fb549023fae170da8e6e766da13"integrity sha512-u1dgND9+MXaEt74sJR4PR7qkPxXUSQ0RXYq8x1L6Jg1MYVEmGPrH6Ah6C4arD4r0J1P5HKjRqpab36k0eIzPqg==@@ -17239,7 +17273,7 @@ webpack-dev-middleware@^3.7.2:range-parser "^1.2.1"webpack-log "^2.0.0"-webpack-dev-server@^3.1.14:+webpack-dev-server@^3.10.1:version "3.10.1"resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.10.1.tgz#1ff3e5cccf8e0897aa3f5909c654e623f69b1c0e"integrity sha512-AGG4+XrrXn4rbZUueyNrQgO4KGnol+0wm3MPdqGLmmA+NofZl3blZQKxZ9BND6RDNuvAK9OMYClhjOSnxpWRoA==@@ -17286,7 +17320,7 @@ webpack-log@^2.0.0:ansi-colors "^3.0.0"uuid "^3.3.2"-webpack-merge@^4.2.1:+webpack-merge@^4.2.2:version "4.2.2"resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.2.2.tgz#a27c52ea783d1398afd2087f547d7b9d2f43634d"integrity sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==@@ -17301,7 +17335,7 @@ webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1:source-list-map "^2.0.0"source-map "~0.6.1"-webpack@^4.28.3:+webpack@^4.41.5:version "4.41.5"resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.5.tgz#3210f1886bce5310e62bb97204d18c263341b77c"integrity sha512-wp0Co4vpyumnp3KlkmpM5LWuzvZYayDwM2n17EHFr4qxBBbRokC7DJawPJC7TfSFZ9HZ6GsdH40EBj4UV0nmpw==