fix: updated packages

This commit is contained in:
2026-02-11 21:54:23 +01:00
parent bb2ed3dbd7
commit adadb7db54
5 changed files with 2589 additions and 3454 deletions

5970
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -31,29 +31,30 @@
"@testing-library/react": "^16.3.2", "@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1", "@testing-library/user-event": "^14.6.1",
"@types/chokidar": "^1.7.5", "@types/chokidar": "^1.7.5",
"@types/node": "^20.10.0", "@types/node": "^25.2.3",
"@types/react": "^18.2.0", "@types/react": "^19.2.14",
"@types/react-dom": "^18.2.0", "@types/react-dom": "^19.2.3",
"@types/uuid": "^9.0.7", "@vitejs/plugin-react": "^5.1.4",
"@vitejs/plugin-react": "^4.2.0", "@vitest/coverage-v8": "^4.0.18",
"@vitest/coverage-v8": "^1.0.0", "@vitest/ui": "^4.0.18",
"@vitest/ui": "^1.0.0", "concurrently": "^9.2.1",
"concurrently": "^8.2.2",
"cross-env": "^10.1.0", "cross-env": "^10.1.0",
"drizzle-kit": "^0.20.0", "drizzle-kit": "^1.0.0-beta.9-e89174b",
"electron": "^39.5.2", "electron": "^40.4.0",
"electron-builder": "^24.9.1", "electron-builder": "^26.7.0",
"electron-store": "^11.0.2",
"jsdom": "^28.0.0", "jsdom": "^28.0.0",
"memfs": "^4.6.0", "memfs": "^4.6.0",
"tsx": "^4.6.0", "tsx": "^4.6.0",
"typescript": "^5.3.0", "typescript": "^5.3.0",
"vite": "^5.0.0", "uuid": "^13.0.0",
"vitest": "^1.0.0", "vite": "^7.3.1",
"vitest": "^4.0.18",
"wait-on": "^9.0.3" "wait-on": "^9.0.3"
}, },
"dependencies": { "dependencies": {
"@floating-ui/dom": "^1.7.5", "@floating-ui/dom": "^1.7.5",
"@libsql/client": "^0.4.0", "@libsql/client": "^0.17.0",
"@milkdown/kit": "^7.18.0", "@milkdown/kit": "^7.18.0",
"@milkdown/plugin-block": "^7.18.0", "@milkdown/plugin-block": "^7.18.0",
"@milkdown/plugin-clipboard": "^7.18.0", "@milkdown/plugin-clipboard": "^7.18.0",
@@ -67,20 +68,18 @@
"@monaco-editor/react": "^4.7.0", "@monaco-editor/react": "^4.7.0",
"chokidar": "^5.0.0", "chokidar": "^5.0.0",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"drizzle-orm": "^0.29.0", "drizzle-orm": "^0.45.1",
"dropbox": "^10.34.0", "dropbox": "^10.34.0",
"electron-store": "^8.1.0",
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
"marked-react": "^3.0.2", "marked-react": "^3.0.2",
"monaco-editor": "^0.55.1", "monaco-editor": "^0.55.1",
"react": "^18.2.0", "react": "^19.2.4",
"react-dom": "^18.2.0", "react-dom": "^19.2.4",
"react-hot-toast": "^2.6.0", "react-hot-toast": "^2.6.0",
"sharp": "^0.34.5", "sharp": "^0.34.5",
"snowball-stemmers": "^0.6.0", "snowball-stemmers": "^0.6.0",
"uuid": "^9.0.1", "zod": "^4.3.6",
"zod": "^3.25.76", "zustand": "^5.0.11"
"zustand": "^4.4.7"
}, },
"build": { "build": {
"appId": "com.bds.blogging-desktop-server", "appId": "com.bds.blogging-desktop-server",

View File

@@ -43,15 +43,6 @@ const { mockFs, mockWatcher, mockChokidarWatch } = vi.hoisted(() => {
vi.mock('fs/promises', () => mockFs); vi.mock('fs/promises', () => mockFs);
// Mock path (use posix-style for consistent tests)
vi.mock('path', async () => {
const actual = await vi.importActual<typeof import('path')>('path');
return {
...actual,
default: actual,
};
});
// Mock electron // Mock electron
vi.mock('electron', () => ({ vi.mock('electron', () => ({
app: { app: {

View File

@@ -561,10 +561,23 @@ describe('SyncEngine', () => {
}); });
it('should log sync completion with results', async () => { it('should log sync completion with results', async () => {
// Use real timers for this test as TaskManager may use timers
vi.useRealTimers();
const consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); const consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
const { getDatabase } = await import('../../src/main/database'); const { getDatabase } = await import('../../src/main/database');
// Reset the Dropbox sync mock to return success (might have been modified by previous test)
mockDropboxSyncEngine.syncAll.mockResolvedValue({
success: true,
uploaded: 0,
downloaded: 0,
deleted: 0,
conflicts: 0,
errors: [],
});
// Mock a complete sync with no pending items (so it completes quickly) // Mock a complete sync with no pending items (so it completes quickly)
vi.mocked(getDatabase).mockReturnValue({ vi.mocked(getDatabase).mockReturnValue({
getLocal: vi.fn(() => ({ getLocal: vi.fn(() => ({
@@ -595,10 +608,15 @@ describe('SyncEngine', () => {
}; };
await syncEngine.configure(config); await syncEngine.configure(config);
await syncEngine.sync('push'); const result = await syncEngine.sync('push');
// Debug: check what was logged
const calls = consoleSpy.mock.calls;
// Check that sync completed successfully
expect(result.success).toBe(true);
// Check that at least one log call contains "[SyncEngine]" and "complete" // Check that at least one log call contains "[SyncEngine]" and "complete"
const calls = consoleSpy.mock.calls;
const hasCompleteLog = calls.some((call: any[]) => const hasCompleteLog = calls.some((call: any[]) =>
call.some((arg: any) => typeof arg === 'string' && arg.includes('[SyncEngine]') && arg.includes('complete')) call.some((arg: any) => typeof arg === 'string' && arg.includes('[SyncEngine]') && arg.includes('complete'))
); );

View File

@@ -35,6 +35,7 @@ Object.defineProperty(globalThis, 'localStorage', {
// Mock window.electronAPI for renderer tests // Mock window.electronAPI for renderer tests
Object.defineProperty(globalThis, 'window', { Object.defineProperty(globalThis, 'window', {
value: { value: {
localStorage: localStorageMock,
electronAPI: { electronAPI: {
posts: { posts: {
create: vi.fn(), create: vi.fn(),