From eec2ee950cc749ab5643dc685583fe2d0229d92a Mon Sep 17 00:00:00 2001 From: TeaCoder52 Date: Thu, 5 Feb 2026 07:35:09 +0300 Subject: [PATCH 1/2] perf(electron): chromium flags and window config --- .github/scripts/telegram-notify.js | 10 +++--- .github/workflows/ci.yml | 39 ---------------------- apps/desktop/assets/entitlements.mac.plist | 2 +- apps/desktop/main/app/window.manager.ts | 12 +++---- apps/desktop/main/bootstrap.ts | 17 ++++++++-- packages/core/src/index.ts | 1 - 6 files changed, 26 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/scripts/telegram-notify.js b/.github/scripts/telegram-notify.js index ec6a928..c938c92 100644 --- a/.github/scripts/telegram-notify.js +++ b/.github/scripts/telegram-notify.js @@ -1,5 +1,5 @@ -import fetch from 'node-fetch' -import fs from 'fs' +const fetch = require('node-fetch') +const fs = require('fs') const { TELEGRAM_BOT_TOKEN, @@ -25,7 +25,7 @@ if (GITHUB_EVENT_PATH && fs.existsSync(GITHUB_EVENT_PATH)) { const payload = JSON.parse(fs.readFileSync(GITHUB_EVENT_PATH, 'utf8')) if (GITHUB_EVENT_NAME === 'push') { - message += `\n*Push*\n` + message += `\n*Push*\n\n` message += `Branch: ${GITHUB_REF?.replace('refs/heads/', '')}\n` payload.commits?.slice(0, 3).forEach((c, i) => { @@ -35,7 +35,7 @@ if (GITHUB_EVENT_PATH && fs.existsSync(GITHUB_EVENT_PATH)) { if (GITHUB_EVENT_NAME === 'pull_request' || GITHUB_EVENT_NAME === 'pull_request_target') { const pr = payload.pull_request - message += `\n*Pull Request*\n` + message += `\n*Pull Request*\n\n` message += `Title: ${pr.title}\n` message += `Action: ${payload.action}\n` message += `URL: ${pr.html_url}\n` @@ -43,7 +43,7 @@ if (GITHUB_EVENT_PATH && fs.existsSync(GITHUB_EVENT_PATH)) { if (GITHUB_EVENT_NAME === 'issues') { const issue = payload.issue - message += `\n*Issue*\n` + message += `\n*Issue*\n\n` message += `Title: ${issue.title}\n` message += `Action: ${payload.action}\n` message += `URL: ${issue.html_url}\n` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 70b0a2c..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: CI - -on: - push: - branches: - - main - - develop - pull_request: - branches: - - main - - develop - -env: - NODE_VERSION: 20 - PNPM_VERSION: 10.0.0 - CI: true - -jobs: - ci: - name: CI - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Prettier check - run: pnpm run prettier:check diff --git a/apps/desktop/assets/entitlements.mac.plist b/apps/desktop/assets/entitlements.mac.plist index 83d768c..436f97b 100644 --- a/apps/desktop/assets/entitlements.mac.plist +++ b/apps/desktop/assets/entitlements.mac.plist @@ -1,5 +1,5 @@ - diff --git a/apps/desktop/main/app/window.manager.ts b/apps/desktop/main/app/window.manager.ts index 91c80d2..722a165 100644 --- a/apps/desktop/main/app/window.manager.ts +++ b/apps/desktop/main/app/window.manager.ts @@ -1,5 +1,4 @@ import { BrowserWindow, ipcMain, Menu } from 'electron' -import path from 'path' import { DEV_SERVER_URL, isDev } from '../config/env' import { getPreloadPath, getRendererIndex } from '../config/paths' @@ -10,15 +9,19 @@ export function createMainWindow() { const preloadPath = getPreloadPath(__dirname) const win = new BrowserWindow({ + title: 'Datary', width: 1200, height: 800, show: false, - title: 'Datary', webPreferences: { preload: preloadPath, contextIsolation: true, nodeIntegration: false, - sandbox: false + sandbox: false, + devTools: isDev, + enableBlinkFeatures: 'LayoutNG', + spellcheck: false, + backgroundThrottling: false } }) @@ -26,9 +29,6 @@ export function createMainWindow() { mainWindow.set(win) if (isDev && DEV_SERVER_URL) { - win.webContents.closeDevTools() - win.webContents.setVisualZoomLevelLimits(1, 1) - win.loadURL(DEV_SERVER_URL) } else { win.loadFile(getRendererIndex(__dirname)) diff --git a/apps/desktop/main/bootstrap.ts b/apps/desktop/main/bootstrap.ts index 40e50c1..c1d7728 100644 --- a/apps/desktop/main/bootstrap.ts +++ b/apps/desktop/main/bootstrap.ts @@ -4,9 +4,20 @@ import { registerAppLifecycle } from './app/app.lifecycle' import { createMainWindow } from './app/window.manager' import { registerIpc } from './ipc/register.ipc' -app.whenReady().then(async () => { - await registerIpc() +app.commandLine.appendSwitch('disable-background-timer-throttling') +app.commandLine.appendSwitch('disable-renderer-backgrounding') +app.commandLine.appendSwitch('disable-extensions') +app.commandLine.appendSwitch('disable-breakpad') +app.commandLine.appendSwitch( + 'disable-features', + 'OutOfBlinkCors,BackForwardCache,TranslateUI,BlinkGenPropertyTrees' +) +app.commandLine.appendSwitch('force-color-profile', 'srgb') + +registerAppLifecycle() +app.whenReady().then(async () => { createMainWindow() - registerAppLifecycle() + + await registerIpc() }) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index f6d2a85..b054fb3 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -8,7 +8,6 @@ export * from './domain/query/query.entity' export * from './domain/query/query.types' export * from './application/ports/db.adapter.port' -export * from './application/ports/credential.port' export * from './application/use-cases/connect-db.usecase' export * from './application/use-cases/execute-query.usecase' From 0f54baee17c94f21049851de6e500b5ced0eea5b Mon Sep 17 00:00:00 2001 From: TeaCoder52 Date: Thu, 5 Feb 2026 07:38:55 +0300 Subject: [PATCH 2/2] ci: fix telegram notify script --- .github/scripts/telegram-notify.js | 3 +-- .github/workflows/notify.yml | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/scripts/telegram-notify.js b/.github/scripts/telegram-notify.js index c938c92..6b52de8 100644 --- a/.github/scripts/telegram-notify.js +++ b/.github/scripts/telegram-notify.js @@ -1,5 +1,4 @@ -const fetch = require('node-fetch') -const fs = require('fs') +import fs from 'fs' const { TELEGRAM_BOT_TOKEN, diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index a6d2512..3a46357 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -24,7 +24,7 @@ env: GITHUB_EVENT_PATH: ${{ github.event_path }} jobs: - telegram-notify: + telegram: name: Telegram Notification runs-on: ubuntu-latest @@ -37,8 +37,5 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - - name: Install dependencies - run: npm install node-fetch - - name: Send Telegram notification run: node .github/scripts/telegram-notify.js