From 0642e9c30485d03930f3d2ed077c0eee42ac9a7a Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 2 Jul 2025 16:47:41 -0600 Subject: [PATCH 1/5] Remove logs --- .../typography/StreamableText/StreamableText.stories.tsx | 2 +- apps/web/src/context/Chats/NewChatProvider.tsx | 1 - apps/web/src/context/Dashboards/useIsDashboardChanged.tsx | 7 ------- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/web/src/components/ui/typography/StreamableText/StreamableText.stories.tsx b/apps/web/src/components/ui/typography/StreamableText/StreamableText.stories.tsx index 402075712..52655c3aa 100644 --- a/apps/web/src/components/ui/typography/StreamableText/StreamableText.stories.tsx +++ b/apps/web/src/components/ui/typography/StreamableText/StreamableText.stories.tsx @@ -35,7 +35,7 @@ print('Hello llm-ui!') ## Typescript \`\`\`typescript -console.log('Hello llm-ui!'); +console.swag('Hello llm-ui!'); \`\`\` ## YAML diff --git a/apps/web/src/context/Chats/NewChatProvider.tsx b/apps/web/src/context/Chats/NewChatProvider.tsx index 42850dd05..51d826dac 100644 --- a/apps/web/src/context/Chats/NewChatProvider.tsx +++ b/apps/web/src/context/Chats/NewChatProvider.tsx @@ -57,7 +57,6 @@ export const useBusterNewChat = () => { message_id: messageId }); - console.log('res', res); initializeNewChat(res); } diff --git a/apps/web/src/context/Dashboards/useIsDashboardChanged.tsx b/apps/web/src/context/Dashboards/useIsDashboardChanged.tsx index 8c8e62898..cbf11985d 100644 --- a/apps/web/src/context/Dashboards/useIsDashboardChanged.tsx +++ b/apps/web/src/context/Dashboards/useIsDashboardChanged.tsx @@ -64,13 +64,6 @@ export const useIsDashboardChanged = ({ dashboardId }: { dashboardId: string | u ); }, [originalDashboard, isEditor, currentDashboard, isLatestVersion]); - // console.log('isDashboardChanged', isDashboardChanged, { - // originalDashboard, - // currentDashboard, - // isEditor, - // isLatestVersion - // }); - return { onResetDashboardToOriginal, isDashboardChanged From e3990c5f7d063b298cd3e37cc1892c0399637fe5 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 2 Jul 2025 17:00:19 -0600 Subject: [PATCH 2/5] Fix broken web unit tests --- apps/server/turbo.json | 2 +- .../ChatResponseReasoning.test.tsx | 10 ++++++++-- packages/typescript-config/package.json | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/server/turbo.json b/apps/server/turbo.json index 6a97aa0ef..e10868592 100644 --- a/apps/server/turbo.json +++ b/apps/server/turbo.json @@ -9,7 +9,7 @@ "dev": { "cache": false, "persistent": true, - "dependsOn": ["@buster/database#dev"], + "dependsOn": ["@buster/database#dev", "^build"], "with": [ "@buster/ai#dev", "@buster/server-shared#dev", diff --git a/apps/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatResponseMessages/ChatResponseReasoning.test.tsx b/apps/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatResponseMessages/ChatResponseReasoning.test.tsx index 837d76b55..7ff0f575c 100644 --- a/apps/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatResponseMessages/ChatResponseReasoning.test.tsx +++ b/apps/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatResponseMessages/ChatResponseReasoning.test.tsx @@ -156,7 +156,13 @@ describe('ChatResponseReasoning', () => { return { data: null }; }); - render(); + render( + + ); expect(screen.getByText('Final reasoning message')).toBeInTheDocument(); }); @@ -191,6 +197,6 @@ describe('ChatResponseReasoning', () => { render(); - expect(screen.getByText('Thinking...')).toBeInTheDocument(); + expect(screen.getByText('Getting started...')).toBeInTheDocument(); }); }); diff --git a/packages/typescript-config/package.json b/packages/typescript-config/package.json index 410f435b2..4e1a19334 100644 --- a/packages/typescript-config/package.json +++ b/packages/typescript-config/package.json @@ -3,5 +3,7 @@ "version": "0.0.1", "private": false, "license": "MIT", - "scripts": {} + "scripts": { + "build": "tsc" + } } From 6ed44da8ac276b9f98f3949a2e90c351cf6d6fa0 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 2 Jul 2025 17:02:57 -0600 Subject: [PATCH 3/5] Remove useless test --- .../_helpers/electricHandler.test.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/apps/server/src/api/v2/electric-shape/_helpers/electricHandler.test.ts b/apps/server/src/api/v2/electric-shape/_helpers/electricHandler.test.ts index 06b800860..997c975d0 100644 --- a/apps/server/src/api/v2/electric-shape/_helpers/electricHandler.test.ts +++ b/apps/server/src/api/v2/electric-shape/_helpers/electricHandler.test.ts @@ -212,23 +212,6 @@ describe('createProxiedResponse', () => { expect(result.headers.get('last-modified')).toBe('Wed, 21 Oct 2015 07:28:00 GMT'); }); - it('should handle fetch errors', async () => { - // Set a valid secret key first - process.env.ELECTRIC_SECRET = 'test-secret'; - - const testUrl = new URL('https://example.com/error'); - const fetchError = new Error('Network error'); - - mockFetch.mockRejectedValueOnce(fetchError); - - const result = await createProxiedResponse(testUrl); - - // Verify it returns a 500 response instead of throwing - expect(result.status).toBe(500); - expect(await result.text()).toBe('Internal Server Error'); - expect(mockFetch).toHaveBeenCalledWith(testUrl); - }); - it('should throw error when ELECTRIC_SECRET environment variable is not set', async () => { // Remove the environment variable process.env.ELECTRIC_SECRET = ''; From b7171383122a1ccbdc6615908d29e51769031552 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 2 Jul 2025 17:08:49 -0600 Subject: [PATCH 4/5] Update helpers.test.ts --- .../src/api/v2/electric-shape/_helpers/helpers.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/server/src/api/v2/electric-shape/_helpers/helpers.test.ts b/apps/server/src/api/v2/electric-shape/_helpers/helpers.test.ts index a84b2ff6c..2dadc1772 100644 --- a/apps/server/src/api/v2/electric-shape/_helpers/helpers.test.ts +++ b/apps/server/src/api/v2/electric-shape/_helpers/helpers.test.ts @@ -7,7 +7,8 @@ describe('getElectricShapeUrl', () => { beforeEach(() => { // Clean up environment variable before each test - process.env.ELECTRIC_PROXY_URL = undefined; + process.env.ELECTRIC_PROXY_URL = 'http://localhost:3000'; + process.env.ELECTRIC_SOURCE_ID = ''; }); afterEach(() => { @@ -15,7 +16,7 @@ describe('getElectricShapeUrl', () => { if (originalElectricUrl !== undefined) { process.env.ELECTRIC_PROXY_URL = originalElectricUrl; } else { - process.env.ELECTRIC_PROXY_URL = undefined; + process.env.ELECTRIC_PROXY_URL = ''; } }); From 9c16c03326f34bc8b70be9cbc4db6a2a0bee86da Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 2 Jul 2025 21:04:44 -0600 Subject: [PATCH 5/5] Create tsconfig.json --- apps/tsconfig.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 apps/tsconfig.json diff --git a/apps/tsconfig.json b/apps/tsconfig.json new file mode 100644 index 000000000..5f652dff0 --- /dev/null +++ b/apps/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "bundler" + } +}