Compare commits

...
14 changed files with 124 additions and 93 deletions
+44 -6
View File
@@ -1,8 +1,46 @@
{
"language": "en",
"words": [
"subheader",
"basepath",
"webdriverio"
]
"language": "en",
"words": [
"subheader",
"basepath",
"webdriverio",
"repo",
"hexagonalize",
"pixelize",
"Transistions",
"squashfs",
"squashfs",
"provisionprofile",
"Nsis",
"Appx",
"Hashable",
"clickaway",
"Resizer",
"Subnodes",
"Unmount",
"Monokai",
"plottable",
"snackbar",
"webdriverio",
"prismjs",
"Nordquist",
"debounced",
"mosquitto",
"snapcraft",
"unsquashfs",
"armv",
"livingroom",
"selectall",
"toggledevtools",
"Octo",
"zigbee",
"memoization",
"submenu",
"AGPL",
"Oooooops",
"DEVTOOLS",
"mixins",
"Explorerdmg",
"heapsnapshot"
]
}
+1 -1
View File
@@ -104,7 +104,7 @@ export const togglePause = (tree?: q.Tree<TopicViewModel>) => (dispatch: Dispatc
setTimeout(() => {
tree && tree.applyUnmergedChanges()
if (paused && changes > 0) {
dispatch(globalActions.showNotification(`Sucessfully applied ${changes} changes.`))
dispatch(globalActions.showNotification(`Successfully applied ${changes} changes.`))
}
}, 50)
+2 -2
View File
@@ -2,7 +2,7 @@ import * as React from 'react'
import PersistentStorage from '../utils/PersistentStorage'
import SentimentDissatisfied from '@material-ui/icons/SentimentDissatisfied'
import Warning from '@material-ui/icons/Warning'
import { electronRendererTelementry } from 'electron-telemetry'
import { electronRendererTelemetry } from 'electron-telemetry'
import { Theme, withStyles } from '@material-ui/core/styles'
import { Button, Modal, Paper, Toolbar, Typography } from '@material-ui/core'
@@ -33,7 +33,7 @@ class ErrorBoundary extends React.Component<Props, State> {
}
public componentDidCatch(error: Error, errorInfo: any) {
electronRendererTelementry.trackError(error)
electronRendererTelemetry.trackError(error)
console.log('did catch', error)
}
+3 -3
View File
@@ -1,4 +1,4 @@
import { electronRendererTelementry } from 'electron-telemetry'
import { electronRendererTelemetry } from 'electron-telemetry'
const telemetry = electronRendererTelementry
electronRendererTelementry.registerErrorHandler()
const telemetry = electronRendererTelemetry
electronRendererTelemetry.registerErrorHandler()
+5 -5
View File
@@ -1,18 +1,18 @@
import { electronRendererTelementry } from 'electron-telemetry'
import { electronRendererTelemetry } from 'electron-telemetry'
// Used to determine long-time-stability and memory leaks
function trackProcessStatistics() {
setInterval(() => {
try {
electronRendererTelementry.trackCustomEvent({
electronRendererTelemetry.trackCustomEvent({
name: 'heapStatistics',
payload: process.getHeapStatistics(),
})
electronRendererTelementry.trackCustomEvent({
electronRendererTelemetry.trackCustomEvent({
name: 'cpuUsage',
payload: process.getCPUUsage(),
})
electronRendererTelementry.trackCustomEvent({
electronRendererTelemetry.trackCustomEvent({
name: 'runningSince',
payload: performance.now(),
})
@@ -30,6 +30,6 @@ export function trackEvent(name: string) {
}
const blacklist = ['CONNECTION_SET_HEALTH']
if (blacklist.indexOf(name) === -1) {
electronRendererTelementry.trackEvent(name)
electronRendererTelemetry.trackEvent(name)
}
}
+1 -1
View File
@@ -2130,7 +2130,7 @@ ejs@^2.6.1:
"electron-telemetry@git+https://github.com/thomasnordquist/electron-telemetry.git#dist":
version "1.0.0"
resolved "git+https://github.com/thomasnordquist/electron-telemetry.git#3d6c0c5e3fd9d8101dcb7a0435256572ed58b2b6"
resolved "git+https://github.com/thomasnordquist/electron-telemetry.git#78b140426a31fe6fec75c7fe36daa130445af191"
dependencies:
axios "^0.18.0"
pako "^1.0.8"
+2 -1
View File
@@ -44,8 +44,9 @@ export class MqttSource implements DataSource<MqttOptions> {
username: options.username,
password: options.password,
clientId: options.clientId,
servername: options.tls ? url.host : undefined,
ca: options.certificateAuthority ? Buffer.from(options.certificateAuthority, 'base64') : undefined,
})
} as any)
this.client = client
+1 -1
View File
@@ -10,7 +10,7 @@ describe('Edge', () => {
expect(e.name).to.equal('foo')
})
it('firstEdge should retireve the first edge', () => {
it('firstEdge should retrieve the first edge', () => {
const topics = 'foo/bar/baz'.split('/')
const leaf = TreeNodeFactory.fromEdgesAndValue(topics, undefined)
const bazEdge = leaf.sourceEdge
@@ -20,9 +20,9 @@ describe('EventDispatcher', async () => {
it('should unsubscribe', async function() {
const dispatcher = new EventDispatcher<string, string>()
this.timeout(300)
let incrementee = 0
let callbackCounter = 0
const callback = (msg: any) => {
incrementee += 1
callbackCounter += 1
}
dispatcher.subscribe(callback)
@@ -36,6 +36,6 @@ describe('EventDispatcher', async () => {
// should not cause any increment
dispatcher.dispatch('hello')
expect(incrementee).to.eq(1)
expect(callbackCounter).to.eq(1)
})
})
+5 -5
View File
@@ -62,17 +62,17 @@ export class ConnectionManager {
})
}
public removeConnection(conenctionId: string) {
const connection = this.connections[conenctionId]
public removeConnection(connectionId: string) {
const connection = this.connections[connectionId]
if (connection) {
backendEvents.unsubscribeAll(makePublishEvent(conenctionId))
backendEvents.unsubscribeAll(makePublishEvent(connectionId))
connection.disconnect()
delete this.connections[conenctionId]
delete this.connections[connectionId]
connection.stateMachine.onUpdate.removeAllListeners()
}
}
public closeAllConnections() {
Object.keys(this.connections).forEach(conenctionId => this.removeConnection(conenctionId))
Object.keys(this.connections).forEach(connectionId => this.removeConnection(connectionId))
}
}
+5 -4
View File
@@ -10,9 +10,10 @@
"dev": "npm-run-all --parallel dev:*",
"dev:app": "cd app && npm run dev",
"dev:electron": "tsc && electron . --development",
"lint": "yarn run lint:prettier && yarn run lint:tslint",
"lint": "npm-run-all --parallel lint:prettier lint:tslint lint:spellcheck",
"lint:prettier": "prettier --check \"**/*.ts{x,}\"",
"lint:tslint": "node_modules/.bin/tslint -p ./",
"lint:tslint": "tslint -p ./",
"lint:spellcheck": "cspell -e ./build -e \"node_modules\" \"**/*.ts{x,}\"",
"build": "tsc && cd app && yarn run build && cd ..",
"test-backend": "cd backend && yarn run test && cd ..",
"prepare-release": "ts-node scripts/prepare-release.ts",
@@ -54,7 +55,6 @@
"buildResources": "res",
"output": "build"
},
"afterAllArtifactBuild": "./dist/scripts/afterAllArtifactBuild.js",
"afterPack": "./dist/scripts/afterPack.js"
},
"author": "Thomas Nordquist",
@@ -80,11 +80,12 @@
"mime": "^2.4.0",
"mocha": "^6.1.4",
"mustache": "^3.0.1",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
"prettier": "1.18.2",
"redux-thunk": "^2.3.0",
"source-map-support": "^0.5.9",
"spectron": "^5.0.0",
"spectron": "^6.0.0",
"ts-node": "^8.2.0",
"tslint": "^5.15.0",
"tslint-config-airbnb": "^5.11.1",
-24
View File
@@ -1,24 +0,0 @@
import * as fs from 'fs-extra'
import * as path from 'path'
import { chdir } from 'process'
import { exec } from './util'
export default async function(info: any) {
for (const snapFile of info.artifactPaths) {
if (/\.snap$/.test(snapFile)) {
const originalDir = __dirname
const dirname = path.dirname(snapFile)
chdir(dirname)
await exec('sudo', ['unsquashfs', snapFile])
await exec('sudo', ['rm', snapFile])
await exec('sudo', ['chmod', '-R', 'g-s', 'squashfs-root'])
// Add command line argument to disable the sandbox
await exec('sudo', ['snap', 'run', 'snapcraft', 'pack', 'squashfs-root', '--output', snapFile])
await exec('sudo', ['rm', '-rf', 'squashfs-root'])
chdir(originalDir)
}
}
}
+9 -7
View File
@@ -12,8 +12,8 @@ function startServer(): Promise<mqtt.MqttClient> {
function connectMqtt(): Promise<mqtt.MqttClient> {
return new Promise(resolve => {
const client = mqtt.connect('mqtt://127.0.0.1:1883', {
username: 'thomas',
password: 'bierbier',
username: '',
password: '',
})
client.once('connect', () => {
resolve(client)
@@ -72,14 +72,16 @@ function generateData(client: mqtt.MqttClient) {
client.subscribe('kitchen/lamp/set')
client.on('message', (topic, payload) => {
if (topic === 'kitchen/lamp/set') {
setTimeout(
() =>
setTimeout(() => {
try {
client.publish('kitchen/lamp/state', JSON.parse(payload.toString()).state, {
retain: true,
qos: 0,
}),
500
)
})
} catch (error) {
console.error(error)
}
}, 500)
}
})
+43 -30
View File
@@ -447,12 +447,12 @@ aws4@^1.8.0:
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
axios@^0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102"
integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=
version "0.18.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.1.tgz#ff3f0de2e7b5d180e757ad98000f1081b87bcea3"
integrity sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==
dependencies:
follow-redirects "^1.3.0"
is-buffer "^1.1.5"
follow-redirects "1.5.10"
is-buffer "^2.0.2"
axios@^0.19.0:
version "0.19.0"
@@ -705,7 +705,7 @@ chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.2:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@@ -942,7 +942,7 @@ cross-spawn@^5.0.1:
shebang-command "^1.2.0"
which "^1.2.9"
cross-spawn@^6.0.0:
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
@@ -1208,7 +1208,7 @@ debug@2.6.9, debug@^2.1.3, debug@^2.2.0, debug@^2.6.8:
dependencies:
ms "2.0.0"
debug@3.2.6, debug@^3.0.0, debug@^3.2.6:
debug@3.2.6, debug@^3.0.0:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
@@ -1410,10 +1410,10 @@ electron-builder@20.44.1:
update-notifier "^3.0.0"
yargs "^13.2.4"
electron-chromedriver@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/electron-chromedriver/-/electron-chromedriver-3.0.0.tgz#ec0a17badb6c3529813c660bf91a43fb91407674"
integrity sha512-xWivZRiPTtDFJt+qXv7Ax/Dmhxj0iqESOxoLZ2szu3fv6k1vYDUDJUMHfdfVAke9D2gBRIgChuGb5j3YEt6hxQ==
electron-chromedriver@~4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/electron-chromedriver/-/electron-chromedriver-4.0.0.tgz#064fa2f0d5a97998eeff3258575b90bac8d436da"
integrity sha512-CeeAr4QVtsxkEpDWvFLzhdtgDVLQt32RBWjEJ4WxkIPNj0MX5D8gzli2djEPnnLUOX19vcBgs/CW7WBB/O3JIg==
dependencies:
electron-download "^4.1.0"
extract-zip "^1.6.5"
@@ -1465,7 +1465,7 @@ electron-publish@20.44.0:
"electron-telemetry@git+https://github.com/thomasnordquist/electron-telemetry.git#dist":
version "1.0.0"
resolved "git+https://github.com/thomasnordquist/electron-telemetry.git#3d6c0c5e3fd9d8101dcb7a0435256572ed58b2b6"
resolved "git+https://github.com/thomasnordquist/electron-telemetry.git#78b140426a31fe6fec75c7fe36daa130445af191"
dependencies:
axios "^0.18.0"
pako "^1.0.8"
@@ -1769,13 +1769,6 @@ follow-redirects@1.5.10:
dependencies:
debug "=3.1.0"
follow-redirects@^1.3.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76"
integrity sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==
dependencies:
debug "^3.2.6"
foreground-child@^1.5.6:
version "1.5.6"
resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9"
@@ -2214,11 +2207,6 @@ is-arrayish@^0.2.1:
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
is-buffer@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
is-buffer@^2.0.2, is-buffer@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725"
@@ -2753,6 +2741,11 @@ mem@^4.0.0:
mimic-fn "^2.0.0"
p-is-promise "^2.0.0"
memorystream@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2"
integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI=
meow@^3.1.0:
version "3.7.0"
resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb"
@@ -2990,6 +2983,21 @@ npm-install-package@~2.1.0:
resolved "https://registry.yarnpkg.com/npm-install-package/-/npm-install-package-2.1.0.tgz#d7efe3cfcd7ab00614b896ea53119dc9ab259125"
integrity sha1-1+/jz816sAYUuJbqUxGdyaslkSU=
npm-run-all@^4.1.5:
version "4.1.5"
resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba"
integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==
dependencies:
ansi-styles "^3.2.1"
chalk "^2.4.1"
cross-spawn "^6.0.5"
memorystream "^0.3.1"
minimatch "^3.0.4"
pidtree "^0.3.0"
read-pkg "^3.0.0"
shell-quote "^1.6.1"
string.prototype.padend "^3.0.0"
npm-run-path@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
@@ -3298,6 +3306,11 @@ picomatch@^2.0.5:
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6"
integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==
pidtree@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.0.tgz#f6fada10fccc9f99bf50e90d0b23d72c9ebc2e6b"
integrity sha512-9CT4NFlDcosssyg8KVFltgokyKZIFjoBxw8CTGy+5F38Y1eQWrt8tRayiUOXE+zVKQnYu5BR8JjCtvK3BcnBhg==
pify@^2.0.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -3869,13 +3882,13 @@ spdx-license-ids@^3.0.0:
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1"
integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==
spectron@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/spectron/-/spectron-5.0.0.tgz#602440da0c892f8d73471652ae68000b98d7769c"
integrity sha512-wJrFe8EZ7xvarYawBPd1pDegmSz81U1jG0rSCx+yXqD1TISUH9ASB21KysLXkPylAnc2vhbpGiWQxrqVFtsiJg==
spectron@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/spectron/-/spectron-6.0.0.tgz#b6ead4735837f36b4be05afa29094460666e61d8"
integrity sha512-YQnQgdlpdPU572YhyX1hcDT40Q+5D0hkH4hM3jYy8HLHU1+6z4WTRQkjYdCBcYHE/3fHIQdPeaI+9DUzupQZtw==
dependencies:
dev-null "^0.1.1"
electron-chromedriver "~3.0.0"
electron-chromedriver "~4.0.0"
request "^2.87.0"
split "^1.0.0"
webdriverio "^4.13.0"