Skip to content

Commit

Permalink
feat: upgrade electron
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Jul 14, 2023
1 parent 9a6c770 commit 9a46530
Show file tree
Hide file tree
Showing 10 changed files with 1,086 additions and 524 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
# platform: 'linux'
runs-on: ${{ matrix.os }}
env:
npm_config_disturl: https://electronjs.org/headers
npm_config_target: 15.4.1
npm_config_runtime: "electron"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
Expand All @@ -42,6 +39,7 @@ jobs:
- name: Install
run: |
yarn install
yarn electron-rebuild
node scripts/download-pandoc.js
- name: Set env
Expand Down Expand Up @@ -69,7 +67,7 @@ jobs:
yarn run electron-builder --${{ matrix.platform }} --x64 -p never | sed 's/identityName=.*$//'
find ./out -regex '.*app.asar.unpacked/node_modules/node-pty/build/Release/pty.node$' | grep pty.node
mv out/latest-mac.yml out/latest-mac-x64.yml
cp ./files/m1*pty.node ./node_modules/node-pty/build/Release/pty.node
yarn electron-rebuild --arch=arm64
sed -i '' 's/out\/mac\/Yank Note.app/out\/mac-arm64\/Yank Note.app/' electron-builder.json
yarn run electron-builder --${{ matrix.platform }} --arm64 -p never | sed 's/identityName=.*$//'
mv out/latest-mac.yml out/latest-mac-arm64.yml
Expand All @@ -87,7 +85,7 @@ jobs:
export npm_config_arch=arm64
node "./node_modules/@vscode/ripgrep/lib/postinstall.js" --force
node scripts/download-pandoc.js --force-arm64
cp ./files/linux-arm64*pty.node ./node_modules/node-pty/build/Release/pty.node
yarn electron-rebuild --arch=arm64
yarn run electron-builder --${{ matrix.platform }} --arm64 -p never | sed 's/identityName=.*$//'
- name: Rename Artifact for Ubuntu-18.04
Expand Down
Binary file removed files/linux-arm64-15.4.1-pty.node
Binary file not shown.
Binary file removed files/m1-15.4.1-pty.node
Binary file not shown.
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yank.note",
"version": "3.55.1",
"version": "3.56.0",
"description": "Yank Note: A highly extensible Markdown editor, designed for productivity.",
"main": "dist/main/app.js",
"license": "AGPL-3.0",
Expand All @@ -14,7 +14,7 @@
"build:fe": "vue-tsc --noEmit --esModuleInterop true && vite build",
"build:fe-demo": "node scripts/install-demo-extensions.js && yarn run build:fe --mode=demo && node scripts/copy-assets.js && cp help/* dist/renderer/ && cp src/main/resources/github.css dist/renderer/",
"serve:fe": "vite preview",
"build:main": "tsc --esModuleInterop true --target ES2018 --moduleResolution node --module commonjs src/main/app.ts --outDir ./dist && node ./scripts/copy-assets.js",
"build:main": "tsc --esModuleInterop true --target es2021 --moduleResolution node --module commonjs src/main/app.ts --outDir ./dist && node ./scripts/copy-assets.js",
"build": "npm run build:fe && npm run build:main",
"lint": "vue-tsc --noEmit --esModuleInterop true && eslint src/ --ext .tsx,.ts,.vue",
"test": "yarn run jest --coverage --coverage-reporters=text --silent",
Expand All @@ -23,19 +23,19 @@
"rebuild-pty": "electron-rebuild -f -w node-pty"
},
"dependencies": {
"@electron/remote": "^2.0.1",
"@electron/remote": "^2.0.10",
"@vscode/ripgrep": "^1.14.2",
"adm-zip": "^0.5.9",
"app-license": "^0.2.4",
"async-lock": "^1.4.0",
"chokidar": "^3.5.3",
"command-exists": "^1.2.9",
"dayjs": "^1.10.5",
"electron-context-menu": "^3.1.1",
"electron-log": "^4.4.3",
"electron-progressbar": "^2.0.1",
"electron-store": "^5.2.0",
"electron-updater": "^4.6.1",
"electron-context-menu": "^3.6.1",
"electron-log": "^4.4.8",
"electron-progressbar": "^2.1.0",
"electron-store": "^8.1.0",
"electron-updater": "^6.1.1",
"fs-extra": "^10.0.0",
"glob": "^8.0.3",
"http-proxy-agent": "^5.0.0",
Expand All @@ -47,7 +47,7 @@
"lodash": "^4.17.21",
"mime": "^2.5.2",
"mitt": "^2.1.0",
"node-pty": "^0.10.1",
"node-pty": "^1.0.0",
"pako": "^2.0.4",
"plantuml-pipe": "^1.4.0",
"request": "^2.88.2",
Expand All @@ -64,6 +64,7 @@
"devDependencies": {
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@electron/rebuild": "^3.2.13",
"@json-editor/json-editor": "^2.5.4",
"@types/adm-zip": "^0.4.34",
"@types/async-lock": "^1.3.0",
Expand All @@ -72,6 +73,7 @@
"@types/crypto-js": "^4.0.1",
"@types/dom-to-image": "^2.6.4",
"@types/fs-extra": "^9.0.11",
"@types/glob": "^8.1.0",
"@types/ip": "^1.1.0",
"@types/jest": "^27.0.3",
"@types/jsonwebtoken": "^8.5.8",
Expand Down Expand Up @@ -100,8 +102,8 @@
"canvas-confetti": "^1.6.0",
"crypto-js": "^3.3.0",
"dom-to-image": "^2.6.0",
"electron": "15.4.1",
"electron-builder": "^23.6.0",
"electron": "22.3.17",
"electron-builder": "^24.4.0",
"electron-notarize": "^1.2.2",
"eslint": "^7.11.0",
"eslint-plugin-import": "^2.20.2",
Expand Down
5 changes: 0 additions & 5 deletions scripts/install.bat

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/install.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const hideWindow = () => {
}

const restoreWindowBounds = () => {
const state: WindowState = store.get('window.state', null)
const state: WindowState | null = store.get('window.state', null) as any
if (state) {
if (state.maximized) {
win!.maximize()
Expand Down
10 changes: 3 additions & 7 deletions src/main/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class UpdateProvider extends GitHubProvider {
}
}

const init = (call: () => void) => {
const init = (call?: () => void) => {
if (disabled) {
return
}
Expand Down Expand Up @@ -153,7 +153,7 @@ const init = (call: () => void) => {
if (result.response === 0) {
setTimeout(() => {
autoUpdater.quitAndInstall()
call()
call?.()
}, 500)
}
})
Expand Down Expand Up @@ -192,11 +192,7 @@ export function changeSource () {
}

app.whenReady().then(() => {
init(() => {
setTimeout(() => {
app.exit(0)
}, process.platform === 'darwin' ? 3500 : 0)
})
init()

setTimeout(() => {
autoCheckForUpdates()
Expand Down
1 change: 1 addition & 0 deletions src/renderer/shims-vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare module 'katex'
declare module 'xterm-theme'
declare module 'parse-author'
declare module 'js-untar'
declare module 'semver'
declare module 'path-browserify' {
import path from 'path'
export default path
Expand Down
Loading

1 comment on commit 9a46530

@vercel
Copy link

@vercel vercel bot commented on 9a46530 Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.