diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 00000000..123ac74a --- /dev/null +++ b/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/package.json b/package.json index 82879293..957b3e66 100644 --- a/package.json +++ b/package.json @@ -22,22 +22,23 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@electron/remote": "^2.1.2", "@iktakahiro/markdown-it-katex": "^3.1.0", "@sentry/electron": "^1.2.0", "ant-design-vue": "^1.3.5", - "axios": "^0.18.1", - "bluebird": "^3.5.3", - "ejs": "^2.6.1", + "axios": "^1.13.5", + "bluebird": "^3.7.2", + "ejs": "^3.1.10", "electron-google-analytics": "^0.1.0", - "electron-updater": "^4.2.0", - "feed": "^2.0.4", + "electron-updater": "^6.8.3", + "feed": "^4.2.2", "fs-extra": "^7.0.1", - "gray-matter": "^4.0.1", + "gray-matter": "^4.0.3", "junk": "^3.1.0", "less": "^3.9.0", "lowdb": "^1.0.0", "macaddress": "^0.2.9", - "markdown-it": "^13.0.1", + "markdown-it": "^14.1.0", "markdown-it-abbr": "^1.0.4", "markdown-it-emoji": "^2.0.2", "markdown-it-footnote": "^3.0.3", @@ -48,16 +49,16 @@ "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", "markdown-it-toc-and-anchor": "^4.2.0", - "moment": "^2.24.0", + "moment": "^2.30.1", "monaco-markdown": "^0.0.6", - "node-ssh": "^6.0.0", + "node-ssh": "^13.2.1", "normalize-path": "^3.0.0", - "prismjs": "^1.16.0", - "simple-git": "^1.107.0", + "prismjs": "^1.30.0", "shortid": "^2.2.14", + "simple-git": "^3.27.0", "slug": "^0.9.3", "ssh2-sftp-client": "^4.2.4", - "striptags": "^3.1.1", + "striptags": "^3.2.0", "transliteration": "^1.6.6", "url-join": "^4.0.1", "uuid": "^3.3.3", @@ -81,7 +82,7 @@ "@types/fs-extra": "^5.0.5", "@types/less": "^3.0.0", "@types/lowdb": "^1.0.7", - "@types/markdown-it": "0.0.7", + "@types/markdown-it": "14.1.2", "@types/marked": "^0.6.5", "@types/normalize-path": "^3.0.0", "@types/prismjs": "^1.16.0", @@ -98,7 +99,7 @@ "@vue/eslint-config-typescript": "^4.0.0", "babel-eslint": "^10.0.1", "babel-plugin-prismjs": "^1.0.2", - "electron": "^7.2.4", + "electron": "^22.3.27", "eslint": "^5.16.0", "eslint-plugin-vue": "^5.2.2", "husky": "^1.3.1", @@ -108,7 +109,7 @@ "postcss-import": "^12.0.1", "tailwindcss": "^1.1.4", "typescript": "^3.0.0", - "vue-cli-plugin-electron-builder": "2.0.0-beta.2", + "vue-cli-plugin-electron-builder": "2.1.1", "vue-template-compiler": "^2.6.10" }, "main": "background.js", diff --git a/src/background.ts b/src/background.ts index afd1823a..ef90208f 100644 --- a/src/background.ts +++ b/src/background.ts @@ -6,12 +6,15 @@ import { } from 'vue-cli-plugin-electron-builder/lib' import { autoUpdater } from 'electron-updater' import { init } from '@sentry/electron/dist/main' +import { initialize as initRemote, enable as enableRemote } from '@electron/remote/main' import App from './server/app' import messages from './assets/locales-menu' import initServer from './server' init({ dsn: 'https://6a6dacc57a6a4e27a88eb31596c152f8@sentry.io/1887150' }) +initRemote() + const isDevelopment = process.env.NODE_ENV !== 'production' // Keep a global reference of the window object, if you don't, the window will @@ -32,7 +35,7 @@ function createWindow() { webPreferences: { webSecurity: false, // FIXED: Not allowed to load local resource nodeIntegration: true, - enableRemoteModule: true, // FIXED: 兼容 electron@11.0.1 + contextIsolation: false, // Required for @electron/remote and nodeIntegration; was default in Electron <12 }, // frame: false, // 去除默认窗口栏 titleBarStyle: 'hiddenInset' as ('hidden' | 'default' | 'hiddenInset' | 'customButtonsOnHover' | undefined), @@ -43,6 +46,7 @@ function createWindow() { } win = new BrowserWindow(winOption) + enableRemote(win.webContents) win.setTitle('Gridea') if (process.env.WEBPACK_DEV_SERVER_URL) { diff --git a/src/components/AppSystem/includes/SourceFolderSetting.vue b/src/components/AppSystem/includes/SourceFolderSetting.vue index 7fd0a6b4..27ff6db7 100644 --- a/src/components/AppSystem/includes/SourceFolderSetting.vue +++ b/src/components/AppSystem/includes/SourceFolderSetting.vue @@ -16,8 +16,9 @@