Skip to content

Commit 1f82d7c

Browse files
committed
really need to tell Amp to run prettier every time it saves...
1 parent 5f83cc5 commit 1f82d7c

File tree

7 files changed

+130
-127
lines changed

7 files changed

+130
-127
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,39 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
12+
1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
16-
16+
1717
- name: Setup pnpm
1818
uses: pnpm/action-setup@v4
19-
19+
2020
- name: Setup Node.js
2121
uses: actions/setup-node@v4
2222
with:
2323
node-version: '22'
2424
cache: 'pnpm'
25-
25+
2626
- name: Install dependencies - root
2727
run: pnpm install
28-
28+
2929
- name: Install dependencies - inspector example
3030
run: pnpm install
3131
working-directory: examples/inspector
32-
32+
3333
- name: Install dependencies - cf-agents example
3434
run: pnpm install
3535
working-directory: examples/servers/cf-agents
36-
36+
3737
- name: Install dependencies - hono-mcp example
3838
run: pnpm install
3939
working-directory: examples/servers/hono-mcp
40-
40+
4141
- name: Install dependencies - test
4242
run: pnpm install
4343
working-directory: test
44-
44+
4545
- name: Run tests
4646
run: pnpm test
4747
working-directory: test

examples/inspector/src/components/McpServers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function McpConnection({ serverUrl, onConnectionUpdate }: { serverUrl: string; o
1010
debug: true,
1111
autoRetry: false,
1212
popupFeatures: 'width=500,height=600,resizable=yes,scrollbars=yes',
13-
transportType: 'auto'
13+
transportType: 'auto',
1414
})
1515

1616
// Update parent component with connection data

src/react/useMcp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export function useMcp(options: UseMcpOptions): UseMcpResult {
378378
// --- Orchestrate Connection Attempts ---
379379
let finalStatus: 'success' | 'auth_redirect' | 'failed' | 'fallback' = 'failed' // Default to failed
380380

381-
console.log({transportType})
381+
console.log({ transportType })
382382

383383
if (transportType === 'sse') {
384384
// SSE only - skip HTTP entirely

test/integration/mcp-connection.test.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ function getMCPServers() {
1313
try {
1414
const stateData = readFileSync(testStateFile, 'utf-8')
1515
const state = JSON.parse(stateData)
16-
16+
1717
if (!state.honoPort) {
1818
throw new Error('hono-mcp port not found in test state')
1919
}
20-
20+
2121
return [
2222
{
2323
name: 'hono-mcp',
@@ -40,48 +40,48 @@ async function connectToMCPServer(page: Page, serverUrl: string): Promise<{ succ
4040
// Navigate to the inspector
4141
const stateData = readFileSync(testStateFile, 'utf-8')
4242
const state = JSON.parse(stateData)
43-
43+
4444
if (!state.staticPort) {
4545
throw new Error('Static server port not available - state: ' + JSON.stringify(state))
4646
}
4747
const staticPort = state.staticPort
48-
48+
4949
await page.goto(`http://localhost:${staticPort}`)
50-
50+
5151
// Wait for the page to load
5252
await page.waitForSelector('input[placeholder="Enter MCP server URL"]', { timeout: 10000 })
53-
53+
5454
// Enter the server URL
5555
const urlInput = page.locator('input[placeholder="Enter MCP server URL"]')
5656
await urlInput.fill(serverUrl)
57-
57+
5858
// Click connect button
5959
const connectButton = page.locator('button:has-text("Connect")')
6060
await connectButton.click()
61-
61+
6262
// Wait for connection attempt to complete (max 10 seconds)
6363
await page.waitForTimeout(1000) // Initial wait
64-
64+
6565
// Check for connection status
6666
let attempts = 0
6767
const maxAttempts = 20 // 10 seconds total (500ms * 20)
6868
let isConnected = false
69-
69+
7070
while (attempts < maxAttempts && !isConnected) {
7171
try {
7272
// Check if status badge shows "Connected"
7373
const statusBadge = page.locator('.px-2.py-1.rounded-full')
74-
if (await statusBadge.count() > 0) {
74+
if ((await statusBadge.count()) > 0) {
7575
const statusText = await statusBadge.textContent({ timeout: 500 })
7676
if (statusText?.toLowerCase().includes('connected')) {
7777
isConnected = true
7878
break
7979
}
8080
}
81-
81+
8282
// Also check if tools count is > 0
8383
const toolsHeader = page.locator('h3:has-text("Available Tools")')
84-
if (await toolsHeader.count() > 0) {
84+
if ((await toolsHeader.count()) > 0) {
8585
const toolsText = await toolsHeader.textContent()
8686
if (toolsText && /\d+/.test(toolsText)) {
8787
const toolsCount = parseInt(toolsText.match(/\d+/)?.[0] || '0')
@@ -94,18 +94,18 @@ async function connectToMCPServer(page: Page, serverUrl: string): Promise<{ succ
9494
} catch (e) {
9595
// Continue waiting
9696
}
97-
97+
9898
await page.waitForTimeout(500)
9999
attempts++
100100
}
101-
101+
102102
// Extract available tools
103103
const tools: string[] = []
104104
try {
105105
// Look for tool cards in the tools container
106106
const toolCards = page.locator('.bg-white.rounded.border')
107107
const toolCount = await toolCards.count()
108-
108+
109109
for (let i = 0; i < toolCount; i++) {
110110
const toolNameElement = toolCards.nth(i).locator('h4.font-bold.text-base.text-black')
111111
const toolName = await toolNameElement.textContent()
@@ -116,18 +116,18 @@ async function connectToMCPServer(page: Page, serverUrl: string): Promise<{ succ
116116
} catch (e) {
117117
console.warn('Could not extract tools list:', e)
118118
}
119-
119+
120120
// Extract debug log
121121
let debugLog = ''
122122
try {
123123
const debugContainer = page.locator('.h-32.overflow-y-auto.font-mono.text-xs')
124-
if (await debugContainer.count() > 0) {
125-
debugLog = await debugContainer.first().textContent() || ''
124+
if ((await debugContainer.count()) > 0) {
125+
debugLog = (await debugContainer.first().textContent()) || ''
126126
}
127127
} catch (e) {
128128
console.warn('Could not extract debug log:', e)
129129
}
130-
130+
131131
return {
132132
success: isConnected,
133133
tools,
@@ -149,7 +149,7 @@ describe('MCP Connection Integration Tests', () => {
149149
if (browser) {
150150
await browser.close()
151151
}
152-
152+
153153
// Force cleanup before Vitest exits - don't throw errors
154154
const state = globalThis.__INTEGRATION_TEST_STATE__
155155
try {
@@ -160,7 +160,7 @@ describe('MCP Connection Integration Tests', () => {
160160
} catch (e) {
161161
// Ignore errors - process might already be dead
162162
}
163-
163+
164164
try {
165165
if (state?.staticServer) {
166166
state.staticServer.close()
@@ -174,7 +174,7 @@ describe('MCP Connection Integration Tests', () => {
174174
beforeEach(async () => {
175175
const context = await browser.newContext()
176176
page = await context.newPage()
177-
177+
178178
// Enable console logging for debugging
179179
page.on('console', (msg) => {
180180
if (msg.type() === 'error') {
@@ -192,19 +192,19 @@ describe('MCP Connection Integration Tests', () => {
192192

193193
test('should connect to all MCP servers and retrieve tools', async () => {
194194
const servers = getMCPServers()
195-
195+
196196
for (const server of servers) {
197197
console.log(`\n🔗 Testing connection to ${server.name} at ${server.url}`)
198-
198+
199199
const result = await connectToMCPServer(page, server.url)
200-
200+
201201
if (result.success) {
202202
console.log(`✅ Successfully connected to ${server.name}`)
203203
console.log(`📋 Available tools (${result.tools.length}):`)
204204
result.tools.forEach((tool, index) => {
205205
console.log(` ${index + 1}. ${tool}`)
206206
})
207-
207+
208208
// Verify connection success
209209
expect(result.success).toBe(true)
210210
expect(result.tools.length).toBeGreaterThanOrEqual(server.expectedTools)
@@ -214,7 +214,7 @@ describe('MCP Connection Integration Tests', () => {
214214
console.log(`🐛 Debug log:`)
215215
console.log(result.debugLog)
216216
}
217-
217+
218218
// Fail the test with detailed information
219219
throw new Error(`Failed to connect to ${server.name}. Debug log: ${result.debugLog}`)
220220
}

0 commit comments

Comments
 (0)