Skip to content

Commit cff3063

Browse files
authored
Merge pull request #16 from TeaCoder52/develop
perf(electron): chromium flags and window config
2 parents 5766ce4 + 0f54bae commit cff3063

7 files changed

Lines changed: 25 additions & 58 deletions

File tree

.github/scripts/telegram-notify.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import fetch from 'node-fetch'
21
import fs from 'fs'
32

43
const {
@@ -25,7 +24,7 @@ if (GITHUB_EVENT_PATH && fs.existsSync(GITHUB_EVENT_PATH)) {
2524
const payload = JSON.parse(fs.readFileSync(GITHUB_EVENT_PATH, 'utf8'))
2625

2726
if (GITHUB_EVENT_NAME === 'push') {
28-
message += `\n*Push*\n`
27+
message += `\n*Push*\n\n`
2928
message += `Branch: ${GITHUB_REF?.replace('refs/heads/', '')}\n`
3029

3130
payload.commits?.slice(0, 3).forEach((c, i) => {
@@ -35,15 +34,15 @@ if (GITHUB_EVENT_PATH && fs.existsSync(GITHUB_EVENT_PATH)) {
3534

3635
if (GITHUB_EVENT_NAME === 'pull_request' || GITHUB_EVENT_NAME === 'pull_request_target') {
3736
const pr = payload.pull_request
38-
message += `\n*Pull Request*\n`
37+
message += `\n*Pull Request*\n\n`
3938
message += `Title: ${pr.title}\n`
4039
message += `Action: ${payload.action}\n`
4140
message += `URL: ${pr.html_url}\n`
4241
}
4342

4443
if (GITHUB_EVENT_NAME === 'issues') {
4544
const issue = payload.issue
46-
message += `\n*Issue*\n`
45+
message += `\n*Issue*\n\n`
4746
message += `Title: ${issue.title}\n`
4847
message += `Action: ${payload.action}\n`
4948
message += `URL: ${issue.html_url}\n`

.github/workflows/ci.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/notify.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ env:
2424
GITHUB_EVENT_PATH: ${{ github.event_path }}
2525

2626
jobs:
27-
telegram-notify:
27+
telegram:
2828
name: Telegram Notification
2929
runs-on: ubuntu-latest
3030

@@ -37,8 +37,5 @@ jobs:
3737
with:
3838
node-version: ${{ env.NODE_VERSION }}
3939

40-
- name: Install dependencies
41-
run: npm install node-fetch
42-
4340
- name: Send Telegram notification
4441
run: node .github/scripts/telegram-notify.js

apps/desktop/assets/entitlements.mac.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
33
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
44
<plist version="1.0">
55
<dict>

apps/desktop/main/app/window.manager.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { BrowserWindow, ipcMain, Menu } from 'electron'
2-
import path from 'path'
32

43
import { DEV_SERVER_URL, isDev } from '../config/env'
54
import { getPreloadPath, getRendererIndex } from '../config/paths'
@@ -10,25 +9,26 @@ export function createMainWindow() {
109
const preloadPath = getPreloadPath(__dirname)
1110

1211
const win = new BrowserWindow({
12+
title: 'Datary',
1313
width: 1200,
1414
height: 800,
1515
show: false,
16-
title: 'Datary',
1716
webPreferences: {
1817
preload: preloadPath,
1918
contextIsolation: true,
2019
nodeIntegration: false,
21-
sandbox: false
20+
sandbox: false,
21+
devTools: isDev,
22+
enableBlinkFeatures: 'LayoutNG',
23+
spellcheck: false,
24+
backgroundThrottling: false
2225
}
2326
})
2427

2528
Menu.setApplicationMenu(null)
2629
mainWindow.set(win)
2730

2831
if (isDev && DEV_SERVER_URL) {
29-
win.webContents.closeDevTools()
30-
win.webContents.setVisualZoomLevelLimits(1, 1)
31-
3232
win.loadURL(DEV_SERVER_URL)
3333
} else {
3434
win.loadFile(getRendererIndex(__dirname))

apps/desktop/main/bootstrap.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@ import { registerAppLifecycle } from './app/app.lifecycle'
44
import { createMainWindow } from './app/window.manager'
55
import { registerIpc } from './ipc/register.ipc'
66

7-
app.whenReady().then(async () => {
8-
await registerIpc()
7+
app.commandLine.appendSwitch('disable-background-timer-throttling')
8+
app.commandLine.appendSwitch('disable-renderer-backgrounding')
9+
app.commandLine.appendSwitch('disable-extensions')
10+
app.commandLine.appendSwitch('disable-breakpad')
11+
app.commandLine.appendSwitch(
12+
'disable-features',
13+
'OutOfBlinkCors,BackForwardCache,TranslateUI,BlinkGenPropertyTrees'
14+
)
15+
app.commandLine.appendSwitch('force-color-profile', 'srgb')
16+
17+
registerAppLifecycle()
918

19+
app.whenReady().then(async () => {
1020
createMainWindow()
11-
registerAppLifecycle()
21+
22+
await registerIpc()
1223
})

packages/core/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export * from './domain/query/query.entity'
88
export * from './domain/query/query.types'
99

1010
export * from './application/ports/db.adapter.port'
11-
export * from './application/ports/credential.port'
1211

1312
export * from './application/use-cases/connect-db.usecase'
1413
export * from './application/use-cases/execute-query.usecase'

0 commit comments

Comments
 (0)