From 48ee4dee294eee2c32cd19bdbe5491f591e19693 Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Mon, 8 Apr 2019 14:57:29 +0200 Subject: [PATCH] Update page --- .gitignore | 4 -- Changelog.md | 2 + Readme.md | 22 +---------- Readme.tpl.md | 22 +---------- package.json | 26 +++++++++++++ tsconfig.json | 14 +++++++ updateReadme.ts | 64 ++++++++++++++++++++++++++++++++ yarn.lock | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 209 insertions(+), 44 deletions(-) create mode 100644 package.json create mode 100644 tsconfig.json create mode 100644 updateReadme.ts create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index c2282399..bb64915a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,3 @@ node_modules -coverage build -.nyc_output -test.dot -test.png diff --git a/Changelog.md b/Changelog.md index a8a45d3c..5726defd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,5 @@ +[back](./) + # Upcoming Release - Add a pause function diff --git a/Readme.md b/Readme.md index 71cd9402..748edc97 100644 --- a/Readme.md +++ b/Readme.md @@ -20,10 +20,11 @@ MQTT Explorer is a comprehensive MQTT client that provides a structured overview - Delete retained topics - Search/filter topics - Delete topics recursively +- Diff view of current and previous received messages - Publish topics - Plot numeric topics - Retain a history of each topic -- ... +- ... [See Changelog to see all features](./Changelog) The hierarchical view makes this tool so easy to use and differentiates the **MQTT Explorer** from other great MQTT clients like [MQTTLens](https://chrome.google.com/webstore/detail/mqttlens/hemojaaeigabkbcookmlgmdigohjobjm), [MQTTBox](http://workswithweb.com/mqttbox.html) and [MQTT.fx](https://mqttfx.jensd.de/). This MQTT Client strives to be a MQTT swiss-army-knife, the perfect tool to integrate new services and IoT devices on your network. @@ -63,25 +64,6 @@ List of useful IoT applications using MQTT to integrate devices / services - [zigbee2mqtt](https://github.com/Koenkk/zigbee2mqtt) - A ZigBee to MQTT bridge - [Tasmota](https://github.com/arendst/Sonoff-Tasmota) - ESP8266 firmware with MQTT support -## Develop - -PRs and issues are welcome. -Install with `npm run install`, build with `npm run build` - -Start with `npm run start` - -The `app` directory contains all the rendering logic, the `backend` directory currently contains the models, tests, connection management, `src` contains all the electron bindings. [mqttjs](https://github.com/mqttjs/MQTT.js) is used to facilitate communication to MQTT brokers. - -## Automated Tests - -To achieve a reliable product automated tests run regularly on travis. - -- Data model -- MQTT integration -- UI-Tests (The demo is a recorded ui test) - -A [mosquitto](https://mosquitto.org/) MQTT broker is required to run the ui-tests. - ## Telemetry No personal data is processed, sent or stored. diff --git a/Readme.tpl.md b/Readme.tpl.md index 34ac79ea..8b5066bf 100644 --- a/Readme.tpl.md +++ b/Readme.tpl.md @@ -20,10 +20,11 @@ MQTT Explorer is a comprehensive MQTT client that provides a structured overview - Delete retained topics - Search/filter topics - Delete topics recursively +- Diff view of current and previous received messages - Publish topics - Plot numeric topics - Retain a history of each topic -- ... +- ... [See Changelog to see all features](./Changelog) The hierarchical view makes this tool so easy to use and differentiates the **MQTT Explorer** from other great MQTT clients like [MQTTLens](https://chrome.google.com/webstore/detail/mqttlens/hemojaaeigabkbcookmlgmdigohjobjm), [MQTTBox](http://workswithweb.com/mqttbox.html) and [MQTT.fx](https://mqttfx.jensd.de/). This MQTT Client strives to be a MQTT swiss-army-knife, the perfect tool to integrate new services and IoT devices on your network. @@ -63,25 +64,6 @@ List of useful IoT applications using MQTT to integrate devices / services - [zigbee2mqtt](https://github.com/Koenkk/zigbee2mqtt) - A ZigBee to MQTT bridge - [Tasmota](https://github.com/arendst/Sonoff-Tasmota) - ESP8266 firmware with MQTT support -## Develop - -PRs and issues are welcome. -Install with `npm run install`, build with `npm run build` - -Start with `npm run start` - -The `app` directory contains all the rendering logic, the `backend` directory currently contains the models, tests, connection management, `src` contains all the electron bindings. [mqttjs](https://github.com/mqttjs/MQTT.js) is used to facilitate communication to MQTT brokers. - -## Automated Tests - -To achieve a reliable product automated tests run regularly on travis. - -- Data model -- MQTT integration -- UI-Tests (The demo is a recorded ui test) - -A [mosquitto](https://mosquitto.org/) MQTT broker is required to run the ui-tests. - ## Telemetry No personal data is processed, sent or stored. diff --git a/package.json b/package.json new file mode 100644 index 00000000..fe184d22 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "mqtt-explorer-gh-pages", + "version": "1.0.0", + "main": "index.js", + "description": "Github pages for MQTT Explorer", + "scripts": { + "readme": "ts-node updateReadme.ts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/thomasnordquist/MQTT-Explorer.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/thomasnordquist/MQTT-Explorer/issues" + }, + "homepage": "https://github.com/thomasnordquist/MQTT-Explorer#readme", + "devDependencies": { + "@types/mustache": "^0.8.32", + "axios": "^0.18.0", + "mustache": "^3.0.1", + "ts-node": "^8.0.3", + "typescript": "^3.4.2" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..5c6d7cfe --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "noImplicitAny": true, + "strictNullChecks": true, + "outDir": "./dist", + "strict": true, + "module": "commonjs", + "moduleResolution": "node", + "lib": ["es2017", "dom"], + "sourceMap": true + }, + "include": ["updateReadme.ts"] +} diff --git a/updateReadme.ts b/updateReadme.ts new file mode 100644 index 00000000..04e6de15 --- /dev/null +++ b/updateReadme.ts @@ -0,0 +1,64 @@ +import * as mustache from 'mustache' + +import { readFileSync, writeFileSync } from 'fs' + +import axios from 'axios' + +interface Release { + name: string + assets: Asset[] +} + +interface Asset { + name: string + browser_download_url: string +} + +function createUrl(title: string, path: string) { + return `[${title}](${path})` +} + +function fileExtension(file: string): string { + const match = file.match(/\.([a-zA-Z]+)$/) + + return (match && match[1]) || '' +} + +async function createReadme(): Promise { + const release: Release = (await axios.get('https://api.github.com/repos/thomasnordquist/mqtt-explorer/releases/latest')).data + + const linux64 = release.assets.filter(asset => /(x86_64|amd64)\.(AppImage|deb|rpm)$/.test(asset.name)) + const windowsInstaller = release.assets.find(asset => /Setup-.+\.exe$/.test(asset.name)) + const windowsPortable = release.assets.find(asset => /-(?!Setup).+\.exe$/.test(asset.name)) + const macDmg = release.assets.find(asset => /\.dmg$/.test(asset.name)) + + if (linux64.length === 0 || !windowsInstaller || !windowsPortable || !macDmg) { + console.error('failed retrieving') + process.exit(1) + return + } + + const linuxTargets = linux64 + .map(item => createUrl(fileExtension(item.browser_download_url), item.browser_download_url)) + .join(', ') + + const windowsTargets = [ + createUrl('portable', windowsPortable.browser_download_url), + createUrl('installer', windowsInstaller.browser_download_url), + ].join(', ') + + const macTargets = [ + createUrl('dmg', macDmg.browser_download_url), + ].join(', ') + + const template = readFileSync('./Readme.tpl.md').toString() + const rendered = mustache.render(template, { + linuxTargets, + windowsTargets, + macTargets, + version: release.name, + }) + writeFileSync('./Readme.md', rendered) +} + +createReadme() diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..ba71d693 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,99 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/mustache@^0.8.32": + version "0.8.32" + resolved "https://registry.yarnpkg.com/@types/mustache/-/mustache-0.8.32.tgz#7db3b81f2bf450bd38805f596d20eca97c4ed595" + integrity sha512-RTVWV485OOf4+nO2+feurk0chzHkSjkjALiejpHltyuMf/13fGymbbNNFrSKdSSUg1TIwzszXdWsVirxgqYiFA== + +arg@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0" + integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg== + +axios@^0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" + integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= + dependencies: + follow-redirects "^1.3.0" + is-buffer "^1.1.5" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +debug@^3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +diff@^3.1.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +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" + +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== + +make-error@^1.1.1: + version "1.3.5" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +mustache@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mustache/-/mustache-3.0.1.tgz#873855f23aa8a95b150fb96d9836edbc5a1d248a" + integrity sha512-jFI/4UVRsRYdUbuDTKT7KzfOp7FiD5WzYmmwNwXyUVypC0xjoTL78Fqc0jHUPIvvGD+6DQSPHIt1NE7D1ArsqA== + +source-map-support@^0.5.6: + version "0.5.11" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.11.tgz#efac2ce0800355d026326a0ca23e162aeac9a4e2" + integrity sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +ts-node@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.0.3.tgz#aa60b836a24dafd8bf21b54766841a232fdbc641" + integrity sha512-2qayBA4vdtVRuDo11DEFSsD/SFsBXQBRZZhbRGSIkmYmVkWjULn/GGMdG10KVqkaGndljfaTD8dKjWgcejO8YA== + dependencies: + arg "^4.1.0" + diff "^3.1.0" + make-error "^1.1.1" + source-map-support "^0.5.6" + yn "^3.0.0" + +typescript@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.2.tgz#9ed4e6475d906f589200193be056f5913caed481" + integrity sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A== + +yn@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.0.tgz#fcbe2db63610361afcc5eb9e0ac91e976d046114" + integrity sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==