From a67f0fd4088683d1cc5cb243a346f54b52ac2c70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 08:03:27 +0000 Subject: [PATCH 1/4] Bump megalodon from 4.1.1 to 5.0.1 Bumps [megalodon](https://github.com/h3poteto/megalodon) from 4.1.1 to 5.0.1. - [Release notes](https://github.com/h3poteto/megalodon/releases) - [Commits](https://github.com/h3poteto/megalodon/compare/v4.1.1...v5.0.1) --- updated-dependencies: - dependency-name: megalodon dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 49 ++++++++++++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index e9f36223..ee86ff6a 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "i18next": "^21.9.1", "lodash": "^4.17.21", "lokijs": "^1.5.12", - "megalodon": "4.1.1", + "megalodon": "5.0.1", "minimist": "^1.2.7", "mitt": "^3.0.0", "moment": "^2.29.4", diff --git a/yarn.lock b/yarn.lock index 0e951835..557eabe2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3095,6 +3095,15 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +axios@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.3.tgz#8274250dada2edf53814ed7db644b9c2866c1e35" + integrity sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@^0.27.2: version "0.27.2" resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" @@ -4627,10 +4636,10 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -dayjs@^1.11.3, dayjs@^1.11.6: - version "1.11.6" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.6.tgz#2e79a226314ec3ec904e3ee1dd5a4f5e5b1c7afb" - integrity sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ== +dayjs@^1.11.3, dayjs@^1.11.7: + version "1.11.7" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" + integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" @@ -6111,6 +6120,11 @@ follow-redirects@^1.0.0, follow-redirects@^1.14.9: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -8754,21 +8768,22 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= -megalodon@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/megalodon/-/megalodon-4.1.1.tgz#f0fd93fbff8d0eec3504fc3e7f5f9d0c13bb4d1f" - integrity sha512-xMGB1HPJZuNyLF6nTISDa2Oi4RXpK30qXrCTwXDBCPXMTNJEjGkdBMp+XKtYJLB0Pq5Tx/GTqWXaI9WEtEALiA== +megalodon@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/megalodon/-/megalodon-5.0.1.tgz#57c2dc4723cc3c167f8babd265cc62cd8172126f" + integrity sha512-gCzK/JGYoLj/3vflVMSnyi7VwA8sIcqfs/HjypKXQPNS8F5o3jeVprwalNBqxEoGkgzDw7Ic/1UwcjuA02nJSw== dependencies: "@types/oauth" "^0.9.0" "@types/ws" "^8.2.3" - axios "^0.27.2" - dayjs "^1.11.6" + axios "1.1.3" + dayjs "^1.11.7" form-data "^4.0.0" https-proxy-agent "^5.0.1" oauth "^0.10.0" object-assign-deep "^0.4.0" + parse-link-header "^2.0.0" socks-proxy-agent "^7.0.0" - typescript "4.8.4" + typescript "4.9.4" uuid "^9.0.0" ws "8.5.0" @@ -10115,6 +10130,11 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + psl@^1.1.33: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" @@ -12005,12 +12025,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@4.8.4: - version "4.8.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" - integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== - -typescript@^4.9.4: +typescript@4.9.4, typescript@^4.9.4: version "4.9.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== From 3e4cd3f6556aba5a659fa682e06a8086f23cb571 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Mon, 19 Dec 2022 22:54:05 +0900 Subject: [PATCH 2/4] Fix marker for undefined --- src/main/index.ts | 65 +++++++++++-------- .../store/TimelineSpace/Contents/Home.ts | 5 +- .../TimelineSpace/Contents/Notifications.ts | 5 +- 3 files changed, 45 insertions(+), 30 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index b2ba097d..d14802a6 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -598,12 +598,15 @@ ipcMain.on('reset-badge', () => { } }) -ipcMain.handle('confirm-timelines', async (_event: IpcMainInvokeEvent, account: LocalAccount): Promise => { - const proxy = await proxyConfiguration.forMastodon() - const timelines = await confirm(account, proxy) +ipcMain.handle( + 'confirm-timelines', + async (_event: IpcMainInvokeEvent, account: LocalAccount): Promise => { + const proxy = await proxyConfiguration.forMastodon() + const timelines = await confirm(account, proxy) - return timelines -}) + return timelines + } +) // user streaming const userStreamings: { [key: string]: UserStreaming | null } = {} @@ -1167,16 +1170,19 @@ ipcMain.handle('get-mentions-marker', async (_: IpcMainInvokeEvent, ownerID: str return marker }) -ipcMain.on('save-marker', async (_: IpcMainEvent, marker: LocalMarker): Promise => { - if (marker.owner_id === null || marker.owner_id === undefined || marker.owner_id === '') { - return null +ipcMain.on( + 'save-marker', + async (_: IpcMainEvent, marker: LocalMarker): Promise => { + if (marker.owner_id === null || marker.owner_id === undefined || marker.owner_id === '') { + return null + } + if (markerRepo === null) { + return null + } + const res = await markerRepo.save(marker) + return res } - if (markerRepo === null) { - return null - } - const res = await markerRepo.save(marker) - return res -}) +) // hashtag ipcMain.handle('save-hashtag', async (_: IpcMainInvokeEvent, tag: string) => { @@ -1202,17 +1208,23 @@ ipcMain.handle('list-fonts', async (_: IpcMainInvokeEvent) => { }) // Settings -ipcMain.handle('get-account-setting', async (_: IpcMainInvokeEvent, accountID: string): Promise => { - const settings = new Settings(settingsDBPath) - const setting = await settings.get(accountID) - return setting -}) +ipcMain.handle( + 'get-account-setting', + async (_: IpcMainInvokeEvent, accountID: string): Promise => { + const settings = new Settings(settingsDBPath) + const setting = await settings.get(accountID) + return setting + } +) -ipcMain.handle('update-account-setting', async (_: IpcMainInvokeEvent, setting: Setting): Promise => { - const settings = new Settings(settingsDBPath) - const res = await settings.update(setting) - return res -}) +ipcMain.handle( + 'update-account-setting', + async (_: IpcMainInvokeEvent, setting: Setting): Promise => { + const settings = new Settings(settingsDBPath) + const res = await settings.update(setting) + return res + } +) // Cache ipcMain.handle('get-cache-hashtags', async (_: IpcMainInvokeEvent) => { @@ -1670,10 +1682,11 @@ const getMarker = async (client: MegalodonInterface, accountID: string): Promise } catch (err) { console.warn(err) } - if ((serverMarker as Entity.Marker).notifications !== undefined) { + const s = serverMarker as Entity.Marker + if (s.notifications !== undefined) { return { timeline: 'notifications', - last_read_id: (serverMarker as Entity.Marker).notifications.last_read_id + last_read_id: s.notifications.last_read_id } as LocalMarker } if (markerRepo === null) { diff --git a/src/renderer/store/TimelineSpace/Contents/Home.ts b/src/renderer/store/TimelineSpace/Contents/Home.ts index 838a3f91..daa0f0f8 100644 --- a/src/renderer/store/TimelineSpace/Contents/Home.ts +++ b/src/renderer/store/TimelineSpace/Contents/Home.ts @@ -263,10 +263,11 @@ const actions: ActionTree = { } catch (err) { console.warn(err) } - if ((serverMarker as Entity.Marker).home !== undefined) { + const s = serverMarker as Entity.Marker + if (s.home !== undefined) { return { timeline: 'home', - last_read_id: (serverMarker as Entity.Marker).home.last_read_id + last_read_id: s.home.last_read_id } as LocalMarker } const localMarker: LocalMarker | null = await win.ipcRenderer.invoke('get-home-marker', rootState.TimelineSpace.account._id) diff --git a/src/renderer/store/TimelineSpace/Contents/Notifications.ts b/src/renderer/store/TimelineSpace/Contents/Notifications.ts index 395bf9ff..52b82c6a 100644 --- a/src/renderer/store/TimelineSpace/Contents/Notifications.ts +++ b/src/renderer/store/TimelineSpace/Contents/Notifications.ts @@ -241,10 +241,11 @@ const actions: ActionTree = { } catch (err) { console.warn(err) } - if ((serverMarker as Entity.Marker).notifications !== undefined) { + const s = serverMarker as Entity.Marker + if (s.notifications !== undefined) { return { timeline: 'notifications', - last_read_id: (serverMarker as Entity.Marker).notifications.last_read_id + last_read_id: s.notifications.last_read_id } as LocalMarker } const localMarker: LocalMarker | null = await win.ipcRenderer.invoke('get-notifications-marker', rootState.TimelineSpace.account._id) From d5dd2e664a4bc3b4d89a0985c6f0cb39aa8b1d41 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Mon, 19 Dec 2022 23:06:27 +0900 Subject: [PATCH 3/4] Fix just config for new axios --- package.json | 6 ++++-- yarn.lock | 10 +--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index ee86ff6a..fa5db228 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,8 @@ "moduleNameMapper": { "@/router": "/spec/mock/router.ts", "^@/(.+)": "/src/renderer/$1", - "^~/(.+)": "/$1" + "^~/(.+)": "/$1", + "axios": "axios/dist/node/axios.cjs" }, "testMatch": [ "**/spec/**/*.spec.ts" @@ -59,6 +60,7 @@ "^.+\\.(js|jsx)$": "babel-jest", "^.+\\.(ts|tsx)$": "ts-jest" }, + "transformIgnorePatterns": ["/node_modules/(?!axios)"], "setupFiles": [ "core-js", "/spec/setupJest.ts" @@ -79,7 +81,7 @@ "about-window": "^1.15.2", "animate.css": "^4.1.0", "auto-launch": "^5.0.5", - "axios": "^0.27.2", + "axios": "1.1.3", "blueimp-load-image": "^5.16.0", "deep-extend": "^0.6.0", "electron-context-menu": "^3.6.1", diff --git a/yarn.lock b/yarn.lock index 557eabe2..ac153555 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3104,14 +3104,6 @@ axios@1.1.3: form-data "^4.0.0" proxy-from-env "^1.1.0" -axios@^0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -6115,7 +6107,7 @@ flora-colossus@^1.0.0: debug "^4.1.1" fs-extra "^7.0.0" -follow-redirects@^1.0.0, follow-redirects@^1.14.9: +follow-redirects@^1.0.0: version "1.14.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== From 03b8927b1b58f67c6192544d381a78d3a952b80f Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Tue, 20 Dec 2022 00:47:21 +0900 Subject: [PATCH 4/4] Fix webpack config for axios mjs --- .electron-vue/webpack.renderer.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.electron-vue/webpack.renderer.config.js b/.electron-vue/webpack.renderer.config.js index b15859dc..5d5ce288 100644 --- a/.electron-vue/webpack.renderer.config.js +++ b/.electron-vue/webpack.renderer.config.js @@ -17,6 +17,12 @@ let rendererConfig = { }, module: { rules: [ + { + test: /\.m?js$/, + resolve: { + fullySpecified: false + } + }, { test: /\.vue$/, use: {