From ed4a2970a459777b7297295471038382186cbb0a Mon Sep 17 00:00:00 2001 From: henryjw <3443648+henryjw@users.noreply.github.com> Date: Sun, 17 Oct 2021 14:05:35 -0400 Subject: [PATCH] Add feature to save settings automatically #4 --- CHANGELOG.md | 5 +- app/pages/main/main.svelte | 51 +++++-- app/utils/settings-store.ts | 11 ++ electron/main.ts | 4 + electron/preload.ts | 22 ++- package-lock.json | 269 +++++++++++++++++++++++++++--------- package.json | 3 +- 7 files changed, 284 insertions(+), 81 deletions(-) create mode 100644 app/utils/settings-store.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index f92a499..cbcfa10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ +# v1.2.0 (Oct 17, 2021) +- The app now remembers your settings + # v1.1.0 (September 9, 2021) --Fixed ports that were non-numeric +- Improve logic for retrieving processes by port # v1.0.1 (August 17, 2021) - Fix handling of invalid port numbers for Unix-based systems diff --git a/app/pages/main/main.svelte b/app/pages/main/main.svelte index d50468b..208e536 100644 --- a/app/pages/main/main.svelte +++ b/app/pages/main/main.svelte @@ -4,17 +4,24 @@ import { MAX_PORT_NUMBER, MIN_PORT_NUMBER } from "@app/constants/numbers"; import { getProcesses } from "@app/services/processreader"; import type { Process } from "@app/services/processreader"; - import ProcessTable from "../../components/processtable/processtable.svelte"; + import ProcessTable from "@app/components/processtable/processtable.svelte"; import { isWindows } from "@app/utils/platform"; + import { set as setSetting, get as getSetting } from "@app/utils/settings-store"; const IS_WINDOWS = isWindows(); + const SETTING_KEYS = { + startPort: "startPort", + endPort: "endPort", + restrictedRangeEnabled: "restrictedRangeEnabled", + checkWslProcesses: "checkWslProcesses", + }; - let startPort = MIN_PORT_NUMBER; - let endPort = MAX_PORT_NUMBER; - let restrictedRangeEnabled = false; + let startPort = getSetting(SETTING_KEYS.startPort, MIN_PORT_NUMBER); + let endPort = getSetting(SETTING_KEYS.endPort, MAX_PORT_NUMBER); + let restrictedRangeEnabled = getSetting(SETTING_KEYS.restrictedRangeEnabled, false); let processes: Process[] = []; let isScanning = false; - let checkWslProcesses = true; + let checkWslProcesses = getSetting(SETTING_KEYS.checkWslProcesses, true); let scanError: string | null = null; const performScan = async () => { @@ -38,22 +45,48 @@ } }; + const updateSetting = (key: string, value: boolean | string | number): void => { + setSetting(key, value); + }; + onMount(performScan);
- + updateSetting(SETTING_KEYS.restrictedRangeEnabled, e.target.checked)} + /> Only test ports between - + updateSetting(SETTING_KEYS.startPort, e.target.value)} + /> and - + updateSetting(SETTING_KEYS.endPort, e.target.value)} + />
diff --git a/app/utils/settings-store.ts b/app/utils/settings-store.ts new file mode 100644 index 0000000..247c86a --- /dev/null +++ b/app/utils/settings-store.ts @@ -0,0 +1,11 @@ +export function set(key: string, value: T): void { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore See https://www.electronjs.org/docs/tutorial/process-model#preload-scripts + window.store.set(key, value); +} + +export function get(key: string, defaultValue: T): T | undefined { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore See https://www.electronjs.org/docs/tutorial/process-model#preload-scripts + return window.store.get(key, defaultValue) as T | undefined; +} diff --git a/electron/main.ts b/electron/main.ts index 75c7779..3df5b59 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -11,8 +11,12 @@ */ import { app, BrowserWindow } from "electron"; import * as path from "path"; + const config = require("../app/configs/config"); +require("electron-store").initRenderer(); + + function createWindow() { const mainWindow = new BrowserWindow({ height: 768, diff --git a/electron/preload.ts b/electron/preload.ts index 6f01774..06f433f 100644 --- a/electron/preload.ts +++ b/electron/preload.ts @@ -15,6 +15,7 @@ import { promisify } from "util"; import { Process } from "../app/services/processreader"; import { MAX_PORT_NUMBER, MIN_PORT_NUMBER } from "../app/constants/numbers"; import { wait } from "../app/utils/wait"; + const execAsync = promisify(exec); const WINDOWS_NEWLINE = "\r\n"; @@ -122,7 +123,7 @@ async function getProcessesWindows(): Promise { return processes; } -export async function getProcesses(fromPort = MIN_PORT_NUMBER, toPort = MAX_PORT_NUMBER, checkWslProcesses = false): Promise { +async function getProcesses(fromPort = MIN_PORT_NUMBER, toPort = MAX_PORT_NUMBER, checkWslProcesses = false): Promise { const isWindows = getPlatform() === "win32"; let processes: Process[] = []; @@ -133,11 +134,10 @@ export async function getProcesses(fromPort = MIN_PORT_NUMBER, toPort = MAX_PORT if (isWindows) { processes = processes.concat(await getProcessesWindows()); } - console.log(processes); return processes.filter((process) => process.portNumber >= fromPort && process.portNumber <= toPort); } -export function getPlatform() { +function getPlatform() { return process.platform; } @@ -156,7 +156,7 @@ function tryKill(pid: number, wsl: boolean): boolean { } } -export async function terminate(process: Process): Promise { +async function terminate(process: Process): Promise { const { id: pid, isWSL } = process; let signalSent = tryKill(process.id, process.isWSL); @@ -189,6 +189,20 @@ contextBridge.exposeInMainWorld("process", { getPlatform, }); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const ElectronStore = require("electron-store"); +const electronStore = new ElectronStore(); + + +contextBridge.exposeInMainWorld("store", { + set: function(key, value) { + electronStore.set(key, value); + }, + get: function(key, defaultValue) { + return electronStore.get(key, defaultValue); + } +}); + // All of the Node.js APIs are available in the preload process. // It has the same sandbox as a Chrome extension. window.addEventListener("DOMContentLoaded", () => { diff --git a/package-lock.json b/package-lock.json index 82131ed..17aafda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@henryjw/port-scanner", - "version": "1.0.0", + "version": "1.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1128,6 +1128,15 @@ } } }, + "@pm2/pm2-version-check": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.4.tgz", + "integrity": "sha512-SXsM27SGH3yTWKc2fKR4SYNxsmnvuBQ9dd6QHtEWmiZ/VqaOYPAIlS8+vMcn27YLtAEBGvNRSh3TPNvtjZgfqA==", + "dev": true, + "requires": { + "debug": "^4.3.1" + } + }, "@polka/url": { "version": "1.0.0-next.12", "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.12.tgz", @@ -1155,23 +1164,23 @@ "integrity": "sha512-xcmxnAot+9mWDmgRyTdzNI+aajR3n373XsljKQSEBxDX7KnpWJ3g5a9vbZEiluVpUDufcuTcj1+TUYspmOmAKQ==", "dev": true, "requires": { - "chalk": "^4.1.1", + "chalk": "^4.1.2", "fs-extra": "^10.0.0", - "lowdb": "^2.1.0", - "rotating-file-stream": "^2.1.5", - "strip-ansi": "^7.0.0" + "lowdb": "^3.0.0", + "rotating-file-stream": "^2.1.6", + "strip-ansi": "^7.0.1" }, "dependencies": { "ansi-regex": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.0.tgz", - "integrity": "sha512-tAaOSrWCHF+1Ear1Z4wnJCXA9GGox4K6Ic85a5qalES2aeEwQGr7UC93mwef49536PkCYjzkp0zIxfFvexJ6zQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -1189,34 +1198,13 @@ "universalify": "^2.0.0" } }, - "lowdb": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-2.1.0.tgz", - "integrity": "sha512-F4Go8/V37gAidTR3c5poyjprOpZSDNSLJVOmI0ny4D4q9rC37OkBhlzX0bqj7LZlT3UIj4FchmZrrSw7qY+eGQ==", - "dev": true, - "requires": { - "steno": "^1.0.0" - } - }, - "rotating-file-stream": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/rotating-file-stream/-/rotating-file-stream-2.1.5.tgz", - "integrity": "sha512-wnYazkT8oD5HXTj44WhB030aKo74OyICrPz/QKCUah59QD7Np4OhdoTC0WNZfhMx1ClsZp4lYMlAdof+DIkZ1Q==", - "dev": true - }, - "steno": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/steno/-/steno-1.0.0.tgz", - "integrity": "sha512-C/KgCvEa1yWnpHmaPjAXrz1yWxh6hs+HvhqqPa71euaQmNi1wr4+WFo57VQxjKKuFl2KqS7gtlrN0oxj2noQLw==", - "dev": true - }, "strip-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.0.tgz", - "integrity": "sha512-UhDTSnGF1dc0DRbUqr1aXwNoY3RgVkSWG8BrpnuFIxhP57IqbS7IRta2Gfiavds4yCxc5+fEAVVOgBZWnYkvzg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "requires": { - "ansi-regex": "^6.0.0" + "ansi-regex": "^6.0.1" } } } @@ -2623,6 +2611,32 @@ "uri-js": "^4.2.2" } }, + "ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "requires": { + "ajv": "^8.0.0" + }, + "dependencies": { + "ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + } + } + }, "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", @@ -3192,6 +3206,11 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, + "atomically": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/atomically/-/atomically-1.7.0.tgz", + "integrity": "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==" + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -4130,6 +4149,49 @@ "typedarray": "^0.0.6" } }, + "conf": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/conf/-/conf-10.0.3.tgz", + "integrity": "sha512-4gtQ/Q36qVxBzMe6B7gWOAfni1VdhuHkIzxydHkclnwGmgN+eW4bb6jj73vigCfr7d3WlmqawvhZrpCUCTPYxQ==", + "requires": { + "ajv": "^8.6.3", + "ajv-formats": "^2.1.1", + "atomically": "^1.7.0", + "debounce-fn": "^4.0.0", + "dot-prop": "^6.0.1", + "env-paths": "^2.2.1", + "json-schema-typed": "^7.0.3", + "onetime": "^5.1.2", + "pkg-up": "^3.1.0", + "semver": "^7.3.5" + }, + "dependencies": { + "ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "requires": { + "is-obj": "^2.0.0" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + } + } + }, "config-chain": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", @@ -4381,6 +4443,21 @@ "integrity": "sha512-3VmRXEtw7RZKAf+4Tv1Ym9AGeo8r8+CjDi26x+7SYQil1UqtqdaokhzoEJohqlzt0m5kacJSDhJQkG/LWhpRBw==", "dev": true }, + "debounce-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-4.0.0.tgz", + "integrity": "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==", + "requires": { + "mimic-fn": "^3.0.0" + }, + "dependencies": { + "mimic-fn": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", + "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==" + } + } + }, "debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -5102,6 +5179,22 @@ } } }, + "electron-store": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/electron-store/-/electron-store-8.0.1.tgz", + "integrity": "sha512-ZyLvNywiqSpbwC/pp89O/AycVWY/UJIkmtyzF2Bd0Nm/rLmcFc0NTGuLdg6+LE8mS8qsiK5JMoe4PnrecLHH5w==", + "requires": { + "conf": "^10.0.3", + "type-fest": "^1.0.2" + }, + "dependencies": { + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==" + } + } + }, "electron-to-chromium": { "version": "1.3.708", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.708.tgz", @@ -5183,8 +5276,7 @@ "env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" }, "errlop": { "version": "4.1.0", @@ -5751,8 +5843,7 @@ "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { "version": "3.2.5", @@ -7119,8 +7210,7 @@ "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" }, "is-online": { "version": "8.5.1", @@ -8124,6 +8214,11 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-schema-typed": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-7.0.3.tgz", + "integrity": "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==" + }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -9034,6 +9129,15 @@ "signal-exit": "^3.0.0" } }, + "lowdb": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-3.0.0.tgz", + "integrity": "sha512-9KZRulmIcU8fZuWiaM0d5e2/nPnrFyXkeXVpqT+MJS+vgbgOf1EbtvgQmba8HwUFgDl1oeZR6XqEJnkJmQdKmg==", + "dev": true, + "requires": { + "steno": "^2.1.0" + } + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -9044,7 +9148,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -9390,8 +9493,7 @@ "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, "mimic-response": { "version": "1.0.1", @@ -10338,7 +10440,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, "requires": { "mimic-fn": "^2.1.0" } @@ -10476,7 +10577,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "requires": { "p-try": "^2.0.0" } @@ -10529,8 +10629,7 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "pac-proxy-agent": { "version": "4.1.0", @@ -10815,6 +10914,46 @@ "find-up": "^4.0.0" } }, + "pkg-up": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", + "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", + "requires": { + "find-up": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + } + } + }, "plist": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", @@ -10878,15 +11017,6 @@ "yamljs": "0.3.0" }, "dependencies": { - "@pm2/pm2-version-check": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.4.tgz", - "integrity": "sha512-SXsM27SGH3yTWKc2fKR4SYNxsmnvuBQ9dd6QHtEWmiZ/VqaOYPAIlS8+vMcn27YLtAEBGvNRSh3TPNvtjZgfqA==", - "dev": true, - "requires": { - "debug": "^4.3.1" - } - }, "chalk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", @@ -11269,8 +11399,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "pupa": { "version": "2.1.1", @@ -11735,8 +11864,7 @@ "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" }, "require-in-the-middle": { "version": "5.1.0", @@ -12097,6 +12225,12 @@ } } }, + "rotating-file-stream": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/rotating-file-stream/-/rotating-file-stream-2.1.6.tgz", + "integrity": "sha512-qS0ndAlDu80MMXeRonqGMXslF0FErzcUSbcXhus3asRG4cvCS79hc5f7s0x4bPAsH6wAwyHVIeARg69VUe3JmQ==", + "dev": true + }, "rsvp": { "version": "4.8.5", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", @@ -12616,7 +12750,6 @@ "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -14566,6 +14699,12 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, + "steno": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/steno/-/steno-2.1.0.tgz", + "integrity": "sha512-mauOsiaqTNGFkWqIfwcm3y/fq+qKKaIWf1vf3ocOuTdco9XoHCO2AGF1gFYXuZFSWuP38Q8LBHBGJv2KnJSXyA==", + "dev": true + }, "stream-buffers": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-3.0.2.tgz", @@ -15599,7 +15738,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "requires": { "punycode": "^2.1.0" } @@ -16156,8 +16294,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yaml": { "version": "1.10.2", diff --git a/package.json b/package.json index 94f70a9..f127628 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@henryjw/port-scanner", "displayName": "Port Scanner", "description": "Desktop app to scan for open TCP ports on your computer", - "version": "1.1.0", + "version": "1.2.0", "main": "dist/electron/electron/main.js", "publishConfig": { "access": "public" @@ -57,6 +57,7 @@ "bootstrap": "^5.0.1", "bulma": "^0.9.2", "bulma-extensions": "^6.2.7", + "electron-store": "^8.0.1", "sirv-cli": "^1.0.11", "svelte-spa-router": "^3.1.0" },