From a3fa65859f62b565a2f3cbe4b3a0fcc6e11d8c88 Mon Sep 17 00:00:00 2001 From: iliya Date: Tue, 24 Feb 2026 14:23:09 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20resolve=20CI=20failures=20=E2=80=94=20ad?= =?UTF-8?q?d=20highlight.js=20dep,=20remove=20electron=20import=20from=20p?= =?UTF-8?q?rovisioning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add highlight.js as direct dependency (was transitive via rehype-highlight, missing type declarations in CI) - Replace `app.getLocale()` with `Intl.DateTimeFormat().resolvedOptions().locale` to avoid importing electron in TeamProvisioningService (broke tests that don't mock electron) --- package.json | 1 + pnpm-lock.yaml | 3 +++ src/main/services/team/TeamProvisioningService.ts | 11 +++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 74585c95..e97f0957 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "date-fns": "^3.6.0", "electron-updater": "^6.7.3", "fastify": "^5.7.4", + "highlight.js": "^11.11.1", "idb-keyval": "^6.2.2", "lucide-react": "^0.562.0", "mdast-util-to-hast": "^13.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49553aef..8e7e7612 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,6 +71,9 @@ importers: fastify: specifier: ^5.7.4 version: 5.7.4 + highlight.js: + specifier: ^11.11.1 + version: 11.11.1 idb-keyval: specifier: ^6.2.2 version: 6.2.2 diff --git a/src/main/services/team/TeamProvisioningService.ts b/src/main/services/team/TeamProvisioningService.ts index ccc1e135..0f81e093 100644 --- a/src/main/services/team/TeamProvisioningService.ts +++ b/src/main/services/team/TeamProvisioningService.ts @@ -13,7 +13,6 @@ import { resolveLanguageName } from '@shared/utils/agentLanguage'; import { createLogger } from '@shared/utils/logger'; import { execFile, spawn } from 'child_process'; import { randomUUID } from 'crypto'; -import { app } from 'electron'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; @@ -288,10 +287,18 @@ function buildTaskStatusProtocol(teamName: string): string { Failure to follow this protocol means the task board will show incorrect status.`; } +function getSystemLocale(): string { + try { + return Intl.DateTimeFormat().resolvedOptions().locale; + } catch { + return process.env.LANG?.split('.')[0]?.replace('_', '-') ?? 'en'; + } +} + function getAgentLanguageInstruction(): string { const config = ConfigManager.getInstance().getConfig(); const langCode = config.general.agentLanguage || 'system'; - const systemLocale = app.getLocale(); + const systemLocale = getSystemLocale(); const languageName = resolveLanguageName(langCode, systemLocale); return `IMPORTANT: Communicate in ${languageName}. All messages, summaries, and task descriptions MUST be in ${languageName}.`; }