From 81c70d34923e1de8b1fc9dee6593cdbf4ba00a6e Mon Sep 17 00:00:00 2001 From: ransome1 Date: Tue, 31 Oct 2023 14:40:26 +0100 Subject: [PATCH] Added missing icon for AUR build, added missing build script for AUR build process, added config migration, added anonymous user id, --- assets/icons/64x64.png | Bin 0 -> 6052 bytes flatpak/com.github.ransome1.sleek.appdata.xml | 2 +- flatpak/com.github.ransome1.sleek.desktop | 2 +- package.json | 15 ++++++----- release/app/package.json | 2 +- snap/snapcraft.yaml | 2 +- src/main/config.tsx | 16 +++++++++++- src/renderer/App.tsx | 9 +++++-- yarn.lock | 24 +++++++++--------- 9 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 assets/icons/64x64.png diff --git a/assets/icons/64x64.png b/assets/icons/64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..9da91a93208ed133eda00816e9fed4ba7f706fbb GIT binary patch literal 6052 zcmV;V7hC9wP)6zbOigGw$tC^5ZW0nGi?DO*K_uI=Z}3o zNlw72v-9LR`?B_0@B4l4@7jn6;s1vgUN_?-3qC8!drCwAIBUr=$$A+oY?^W}P1a`k z?kgLW5)m4gE|v2;8}XD!o&p7J$t#b^J)?2zn-({hOPY*zDJYFmhJy7lszBO0IIcKb z&p+9~*$wryJb4qzW6fn7QRggN)=)v&p^u(8gM#uXD384IC@4#PZ!P*)yT09#wk~DC zf5y6GY>G0QB5j?Ri%);*cB$|(WNn(PmnLh|JkYjAk>q)L?#7OpSATBz02~^YE|siJ zQxWi=_54}B^Xh}j8Q-)>vXbVk?$P9xkXHq|bRWYDSpZbylBII-iL)puOCFDc_9##w zuPo>b5@?O#;-r@Q`kVcNRVnJxgTymB(0vjT{L z3XjQ4o5U4|lyz{$kP-*i`oAf0aIBMi@s&-x!|~As^-YV#AM7x>XA~B}B6vy=WwFYl z(A4HD{E4k|eCuoLs+EW^v1y5pD4T@nIA@_mmwt%x?$;3 zNn3|AyX&aU4r9TBSzLep6=WpE?Q5i}GN*-YO2$6u2Ua8e?|1-TXC z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ata.xml b/flatpak/com.github.ransome1.sleek.appdata.xml index eabc493b..34dfebd9 100755 --- a/flatpak/com.github.ransome1.sleek.appdata.xml +++ b/flatpak/com.github.ransome1.sleek.appdata.xml @@ -9,7 +9,7 @@ Robin Ahle - + https://github.com/ransome1/sleek https://github.com/ransome1/sleek/issues diff --git a/flatpak/com.github.ransome1.sleek.desktop b/flatpak/com.github.ransome1.sleek.desktop index 8323b059..8781a19c 100755 --- a/flatpak/com.github.ransome1.sleek.desktop +++ b/flatpak/com.github.ransome1.sleek.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Version=2.0.0 +Version=2.0.1 Name=sleek Exec=sleek Type=Application diff --git a/package.json b/package.json index 72e4f376..85c6a4e0 100644 --- a/package.json +++ b/package.json @@ -3,16 +3,17 @@ "main": "./src/main/main.ts", "scripts": { "build": "concurrently \"yarn run peggy\" \"yarn run build:main\" \"yarn run build:renderer\"", + "build:dll": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts", "build:main": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.prod.ts", "build:renderer": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.prod.ts", - "postinstall": "ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts", + "postinstall": "ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && npm run build:dll", "lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx", - "package": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build --publish never", - "dir": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder --dir", - "mac": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build -m --arm64 --publish never", - "mas": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build -m mas --universal --publish never", - "masDev": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build -m 'mas-dev' --arm64 --publish never", - "appimage": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build -l appimage --universal --publish never", + "package": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build --publish never && yarn run build:dll", + "dir": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder --dir --publish never && yarn run build:dll", + "mac": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build -m --arm64 --publish never && yarn run build:dll", + "mas": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build -m mas --universal --publish never && yarn run build:dll", + "masDev": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build -m 'mas-dev' --arm64 --publish never && yarn run build:dll", + "appimage": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build -l appimage --universal --publish never && yarn run build:dll", "peggy": "peggy --format es --output ./src/main/modules/FilterLang/FilterLang.js ./src/main/modules/FilterLang/FilterLang.pegjs", "rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir release/app", "start": "ts-node ./.erb/scripts/check-port-in-use.js && yarn run start:renderer", diff --git a/release/app/package.json b/release/app/package.json index 6749a8b3..832c4f86 100644 --- a/release/app/package.json +++ b/release/app/package.json @@ -1,6 +1,6 @@ { "name": "sleek", - "version": "2.0.0", + "version": "2.0.1", "description": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)", "synopsis": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)", "keywords": [ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index e0c90839..32412e1f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: sleek base: core20 -version: "2.0.0" +version: "2.0.1" summary: todo.txt manager for Linux, free and open-source (FOSS) description: | sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. Stripped down to only the most necessary features, and with a clean and simple interface, sleek aims to help you focus on getting things done. diff --git a/src/main/config.tsx b/src/main/config.tsx index 0ace73b0..2ccba7a1 100644 --- a/src/main/config.tsx +++ b/src/main/config.tsx @@ -8,6 +8,9 @@ import createTray from './modules/Tray'; import { File, ConfigData } from './util'; import processDataRequest from './modules/ProcessDataRequest'; import handleTheme from './modules/Theme'; +import crypto from 'crypto'; + +const anonymousUserId = crypto.randomUUID() || null; const userDataDirectory = path.join(app.getPath('userData'), 'userData'); if (!fs.existsSync(userDataDirectory)) fs.mkdirSync(userDataDirectory) @@ -62,7 +65,18 @@ const defaultConfigData = { }; const configPath = path.join(userDataDirectory, 'config.json'); -const configStorage = new Store({ cwd: userDataDirectory, name: 'config' }); +const configStorage = new Store({ + cwd: userDataDirectory, + name: 'config', + beforeEachMigration: (store, context) => { + console.log(`[config.json] migrating from ${context.fromVersion} → ${context.toVersion}`); + }, + migrations: { + '2.0.1': store => { + store.set('anonymousUserId', anonymousUserId); + }, + } +}); const filtersPath = path.join(userDataDirectory, 'filters.json'); const filterStorage = new Store<{}>({ cwd: userDataDirectory, name: 'filters' }); diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index d5eb3829..58ebdb30 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -196,10 +196,15 @@ const App = () => { }, [zoom]); useEffect(() => { - if (matomo) { + const anonymousUserId = store.get('anonymousUserId'); + if(anonymousUserId && matomo) { var _mtm = window._mtm = window._mtm || []; _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); - var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; + if(anonymousUserId) _mtm.push({'anonymousUserId': anonymousUserId }); + var + d = document, + g = d.createElement('script'), + s = d.getElementsByTagName('script')[0]; g.async = true; g.src = 'https://www.datenkrake.eu/matomo/js/container_WVsEueTV.js'; s.parentNode.insertBefore(g, s); diff --git a/yarn.lock b/yarn.lock index dae05dc1..81ce020f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2134,9 +2134,9 @@ "@types/json-schema" "*" "@types/estree@*", "@types/estree@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.3.tgz#2be19e759a3dd18c79f9f436bd7363556c1a73dd" - integrity sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ== + version "1.0.4" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.4.tgz#d9748f5742171b26218516cf1828b8eafaf8a9fa" + integrity sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw== "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.33": version "4.17.39" @@ -2222,9 +2222,9 @@ "@types/istanbul-lib-report" "*" "@types/jest@*", "@types/jest@^29.5.2": - version "29.5.6" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.6.tgz#f4cf7ef1b5b0bfc1aa744e41b24d9cc52533130b" - integrity sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w== + version "29.5.7" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.7.tgz#2c0dafe2715dd958a455bc10e2ec3e1ec47b5036" + integrity sha512-HLyetab6KVPSiF+7pFcUyMeLsx25LDNDemw9mGsJBkai/oouwrjTycocSDYopMEwFhN2Y4s9oPyOCZNofgSt2g== dependencies: expect "^29.0.0" pretty-format "^29.0.0" @@ -3589,9 +3589,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001524, caniuse-lite@^1.0.30001541: - version "1.0.30001558" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001558.tgz#d2c6e21fdbfe83817f70feab902421a19b7983ee" - integrity sha512-/Et7DwLqpjS47JPEcz6VnxU9PwcIdVi0ciLXRWBQdj1XFye68pSQYpV0QtPTfUKWuOaEig+/Vez2l74eDc1tPQ== + version "1.0.30001559" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001559.tgz#95a982440d3d314c471db68d02664fb7536c5a30" + integrity sha512-cPiMKZgqgkg5LY3/ntGeLFUpi6tzddBNS58A4tnTgQw1zON7u2sZMU7SzOeVH4tj20++9ggL+V6FDOFMTaFFYA== chalk@^2.4.2: version "2.4.2" @@ -4699,9 +4699,9 @@ electron-store@^8.1.0: type-fest "^2.17.0" electron-to-chromium@^1.4.535: - version "1.4.570" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.570.tgz#5fb79061ead248a411bc8532da34d1dbf6ae23c1" - integrity sha512-5GxH0PLSIfXKOUMMHMCT4M0olwj1WwAxsQHzVW5Vh3kbsvGw8b4k7LHQmTLC2aRhsgFzrF57XJomca4XLc/WHA== + version "1.4.571" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.571.tgz#8aa71539eb82db98740c3ec861256cc34e0356fd" + integrity sha512-Sc+VtKwKCDj3f/kLBjdyjMpNzoZsU6WuL/wFb6EH8USmHEcebxRXcRrVpOpayxd52tuey4RUDpUsw5OS5LhJqg== electron@^25.8.1: version "25.9.3"