Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.3
bun-version: 1.3.6

- name: Cache dependencies
uses: actions/cache@v4
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.3
bun-version: 1.3.6

- name: Cache dependencies
uses: actions/cache@v4
Expand All @@ -65,7 +65,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.3
bun-version: 1.3.6

- name: Cache dependencies
uses: actions/cache@v4
Expand All @@ -89,7 +89,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.3
bun-version: 1.3.6

- name: Cache dependencies
uses: actions/cache@v4
Expand All @@ -113,7 +113,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.3
bun-version: 1.3.6

- name: Cache dependencies
uses: actions/cache@v4
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/trpc/routers/external/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { spawn } from "node:child_process";
import nodePath from "node:path";
import { EXTERNAL_APPS, type ExternalApp } from "@superset/local-db";
import type { ExternalApp } from "@superset/local-db";

/** Map of app IDs to their macOS application names */
const APP_NAMES: Record<ExternalApp, string | null> = {
Expand Down Expand Up @@ -277,4 +277,4 @@ export function spawnAsync(command: string, args: string[]): Promise<void> {
});
}

export { EXTERNAL_APPS, type ExternalApp };
export type { ExternalApp };
3 changes: 1 addition & 2 deletions apps/desktop/src/lib/trpc/routers/external/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { settings } from "@superset/local-db";
import { EXTERNAL_APPS, settings } from "@superset/local-db";
import { TRPCError } from "@trpc/server";
import { clipboard, shell } from "electron";
import { localDb } from "main/lib/local-db";
import { z } from "zod";
import { publicProcedure, router } from "../..";
import {
EXTERNAL_APPS,
type ExternalApp,
getAppCommand,
resolvePath,
Expand Down
10 changes: 10 additions & 0 deletions apps/desktop/src/lib/trpc/routers/terminal/terminal.stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ mock.module("main/lib/workspace-runtime", () => ({
}),
}));

// Mock @superset/local-db to avoid drizzle-orm resolution failures in CI.
mock.module("@superset/local-db", () => ({
projects: { id: "id" },
workspaces: { id: "id" },
worktrees: { id: "id" },
settings: { id: "id" },
EXTERNAL_APPS: [],
EXECUTION_MODES: ["sequential", "parallel"],
}));

// Avoid importing Electron/local-db during test bootstrap.
mock.module("main/lib/local-db", () => ({
localDb: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,16 @@ export function HistoryDropdown() {
[collections],
);

if (recentEntries.length === 0) {
const filteredEntries = recentEntries.filter((entry) => {
if (entry.type === "workspace") {
return workspaceData.some((w) => w.id === entry.entityId);
}
return (taskData ?? []).some(
(t) => t.id === entry.entityId || t.slug === entry.entityId,
);
});

if (filteredEntries.length === 0) {
return (
<Tooltip delayDuration={300}>
<TooltipTrigger asChild>
Expand Down Expand Up @@ -202,7 +211,7 @@ export function HistoryDropdown() {
<DropdownMenuContent align="start" className="w-80">
<DropdownMenuLabel>Recently Viewed</DropdownMenuLabel>
<DropdownMenuSeparator />
{recentEntries.map((entry) =>
{filteredEntries.map((entry) =>
entry.type === "task" ? (
<TaskRow
key={entry.path}
Expand Down
27 changes: 27 additions & 0 deletions apps/desktop/test-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,33 @@ mock.module("main/lib/analytics", () => ({
shutdown: mock(() => Promise.resolve()),
}));

// =============================================================================
// @superset/local-db Schema Mock (drizzle-orm/sqlite-core not available in Bun tests)
// =============================================================================

const mockTable = (name: string) => ({ id: `${name}_id` });

const localDbMock = () => ({
projects: mockTable("projects"),
workspaces: mockTable("workspaces"),
worktrees: mockTable("worktrees"),
settings: mockTable("settings"),
users: mockTable("users"),
organizations: mockTable("organizations"),
organizationMembers: mockTable("organization_members"),
tasks: mockTable("tasks"),
EXTERNAL_APPS: [],
EXECUTION_MODES: ["sequential", "parallel"],
BRANCH_PREFIX_MODES: ["none", "github", "author", "custom"],
TERMINAL_LINK_BEHAVIORS: ["external-editor", "file-viewer"],
FILE_OPEN_MODES: ["split-pane", "new-tab"],
});

// Mock both the package name and the resolved source path to handle
// bun's workspace package resolution in different versions.
mock.module("@superset/local-db", localDbMock);
mock.module("@superset/local-db/schema", localDbMock);

// =============================================================================
// Local DB Mock (better-sqlite3 not supported in Bun tests)
// =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading