Minimize build size

This commit is contained in:
Thomas Nordquist
2019-01-26 22:11:03 +01:00
parent 3f50120a9f
commit 809dbcbd43
9 changed files with 9420 additions and 8472 deletions

8430
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,51 +9,49 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@material-ui/core": "^3.9.0",
"@material-ui/icons": "^3.0.1", "@material-ui/icons": "^3.0.1",
"@material-ui/styles": "^3.0.0-alpha.8",
"@types/node": "^10.12.18",
"@types/react": "^16.7.18", "@types/react": "^16.7.18",
"@types/react-dom": "^16.0.11", "@types/react-dom": "^16.0.11",
"@types/react-redux": "^6.0.12", "@types/react-redux": "^6.0.12",
"compare-versions": "^3.4.0",
"css-loader": "^2.1.0",
"electron-nucleus": "^1.11.0",
"electron-telemetry": "git+https://github.com/thomasnordquist/electron-telemetry.git",
"html-webpack-plugin": "^4.0.0-beta.5",
"lodash.debounce": "^4.0.8",
"number-abbreviate": "^2.0.0",
"react": "^16.8.0-alpha.1",
"react-dom": "^16.7.0",
"react-redux": "^6.0.0",
"react-vis": "^1.11.6",
"redux": "^4.0.1",
"style-loader": "^0.23.1",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-livereload-plugin": "^2.2.0"
},
"dependencies": {
"@material-ui/core": "^3.9.0",
"@material-ui/styles": "^3.0.0-alpha.8",
"@types/node": "^10.12.18",
"@types/react-resize-detector": "^3.1.0", "@types/react-resize-detector": "^3.1.0",
"@types/react-split-pane": "^0.1.67", "@types/react-split-pane": "^0.1.67",
"@types/sha1": "^1.1.1", "@types/sha1": "^1.1.1",
"@types/socket.io-client": "^1.4.32", "@types/socket.io-client": "^1.4.32",
"@types/vis": "^4.21.9", "@types/vis": "^4.21.9",
"awesome-typescript-loader": "^5.2.1", "awesome-typescript-loader": "^5.2.1",
"compare-versions": "^3.4.0",
"copy-text-to-clipboard": "^1.0.4", "copy-text-to-clipboard": "^1.0.4",
"css-loader": "^2.1.0",
"electron-nucleus": "^1.11.0",
"electron-telemetry": "git+https://github.com/thomasnordquist/electron-telemetry.git#dist",
"html-webpack-plugin": "^4.0.0-beta.5",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1", "lodash.throttle": "^4.1.1",
"moving-average": "^1.0.0", "moving-average": "^1.0.0",
"number-abbreviate": "^2.0.0",
"react": "^16.8.0-alpha.1",
"react-ace": "^6.3.2", "react-ace": "^6.3.2",
"react-dom": "^16.7.0",
"react-json-view": "^1.19.1", "react-json-view": "^1.19.1",
"react-redux": "^6.0.0",
"react-resize-detector": "^3.4.0", "react-resize-detector": "^3.4.0",
"react-split-pane": "^0.1.85", "react-split-pane": "^0.1.85",
"react-vis": "^1.11.6",
"redux": "^4.0.1",
"redux-batched-actions": "^0.4.1", "redux-batched-actions": "^0.4.1",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"socket.io-client": "^2.2.0", "socket.io-client": "^2.2.0",
"source-map-loader": "^0.2.4", "source-map-loader": "^0.2.4",
"style-loader": "^0.23.1",
"typescript": "^3.2.2", "typescript": "^3.2.2",
"webpack": "^4.28.2", "webpack": "^4.28.2",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-cli": "^3.1.2", "webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.14" "webpack-dev-server": "^3.1.14",
"webpack-livereload-plugin": "^2.2.0"
} }
} }

6022
app/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@
"test-inspect": "mocha --inspect-brk", "test-inspect": "mocha --inspect-brk",
"coverage": "nyc mocha", "coverage": "nyc mocha",
"debug": "ts-node --inspect ./src/index.ts", "debug": "ts-node --inspect ./src/index.ts",
"postinstall": "npm run build" "postinstall": "yarn build"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",

14
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "MQTT-Explorer", "name": "MQTT-Explorer",
"version": "0.1.2", "version": "0.1.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -1138,9 +1138,9 @@
"dev": true "dev": true
}, },
"electron": { "electron": {
"version": "4.0.1", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/electron/-/electron-4.0.1.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-4.0.2.tgz",
"integrity": "sha512-kBWDLn1Vq8Tm6+/HpQc8gkjX7wJyQI8v/lf2kAirfi0Q4cXh6vBjozFvV1U/9gGCbyKnIDM+m8/wpyJIjg4w7g==", "integrity": "sha512-H0pmSvOVuC+Mq/+cYNXbCDBmqq5d1xYUVdBOjqGJuwuwJeP7qDHF35JA3cq+ARzq/CbwlXq98zdW6i6+x3U24g==",
"requires": { "requires": {
"@types/node": "^10.12.18", "@types/node": "^10.12.18",
"electron-download": "^4.1.0", "electron-download": "^4.1.0",
@@ -4422,9 +4422,9 @@
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
}, },
"sshpk": { "sshpk": {
"version": "1.16.0", "version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.0.tgz", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
"integrity": "sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ==", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
"requires": { "requires": {
"asn1": "~0.2.3", "asn1": "~0.2.3",
"assert-plus": "^1.0.0", "assert-plus": "^1.0.0",

View File

@@ -5,7 +5,6 @@
"main": "dist/src/electron.js", "main": "dist/src/electron.js",
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",
"install": "cd app; npm install; cd ..",
"test": "npm run test-backend", "test": "npm run test-backend",
"build": "tsc && cd app && npm run build && cd ..", "build": "tsc && cd app && npm run build && cd ..",
"test-backend": "cd backend && npm run test && cd ..", "test-backend": "cd backend && npm run test && cd ..",
@@ -50,7 +49,7 @@
"@types/socket.io": "^2.1.2", "@types/socket.io": "^2.1.2",
"axios": "^0.18.0", "axios": "^0.18.0",
"chai": "^4.2.0", "chai": "^4.2.0",
"electron": "^4.0.1", "electron": "^4.0.2",
"electron-builder": "^20.38.4", "electron-builder": "^20.38.4",
"mocha": "^5.2.0", "mocha": "^5.2.0",
"mustache": "^3.0.1", "mustache": "^3.0.1",
@@ -66,10 +65,32 @@
}, },
"dependencies": { "dependencies": {
"electron-debug": "^2.0.0", "electron-debug": "^2.0.0",
"electron-is-dev": "^1.0.1",
"electron-log": "^2.2.17", "electron-log": "^2.2.17",
"electron-telemetry": "git+https://github.com/thomasnordquist/electron-telemetry.git", "electron-telemetry": "git+https://github.com/thomasnordquist/electron-telemetry.git#dist",
"electron-updater": "^4.0.6", "electron-updater": "^4.0.6",
"mqtt": "^2.18.8", "mqtt": "^2.18.8",
"sha1": "^1.1.1" "sha1": "^1.1.1"
},
"resolutions": {
"debug": "4.1.1",
"ms": "2.0.0",
"fs-extra": "7.0.1",
"minimist": "1.2.0",
"path-exists": "3.0.0",
"through2": "2.0.5",
"readable-stream": "2.3.6",
"xtend": "4.0.1",
"isarray": "0.0.1",
"string_decoder": "1.1.1",
"punycode": "2.1.1",
"extsprintf": "1.3.0",
"chalk": "2.4.2",
"tslib": "1.9.0",
"tsutils": "3.7.0",
"esutils": "2.0.2",
"ansi-styles": "3.2.1",
"supports-color": "5.5.0",
"pump": "3.0.0"
} }
} }

View File

@@ -10,19 +10,17 @@ mkdir -p "$DIR"
git clone .git "$DIR" git clone .git "$DIR"
cd $DIR cd $DIR
# App # App
cd app cd app
npm install yarn
cd ..
# Backend
cd backend
npm install;
#npm run test
cd .. cd ..
# Build # Build
npm run build yarn
yarn build
rm -rf node_modules
yarn install --production
rm -rf app/node_modules rm -rf app/node_modules
cd "$ORIGINAL_DIR" cd "$ORIGINAL_DIR"

View File

@@ -6,8 +6,12 @@ import { autoUpdater } from 'electron-updater'
import * as log from 'electron-log' import * as log from 'electron-log'
import { ConnectionManager, updateNotifier } from '../backend/src/index' import { ConnectionManager, updateNotifier } from '../backend/src/index'
import { electronTelemetryFactory } from 'electron-telemetry' import { electronTelemetryFactory } from 'electron-telemetry'
const isDev = require('electron-is-dev')
const electronTelemetry = electronTelemetryFactory('9b0c8ca04a361eb8160d98c5') let electronTelemetry: any
if (!isDev) {
electronTelemetry = electronTelemetryFactory('9b0c8ca04a361eb8160d98c5')
}
const isDebugEnabled = Boolean(process.argv.find(arg => arg === 'debug')) const isDebugEnabled = Boolean(process.argv.find(arg => arg === 'debug'))
require('electron-debug')({ enabled: isDebugEnabled }) require('electron-debug')({ enabled: isDebugEnabled })

3335
yarn.lock Normal file

File diff suppressed because it is too large Load Diff