Unverified Commit 98bbc654 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Explain bundle source inclusion

Co-authored-by: 's avatarWill Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
parent 943d76ba
...@@ -121,7 +121,7 @@ describe('next experimental-analyze', () => { ...@@ -121,7 +121,7 @@ describe('next experimental-analyze', () => {
const toolList = await callMcp(mcpUrl, 'tools/list', {}) const toolList = await callMcp(mcpUrl, 'tools/list', {})
expect(toolList.tools.map((tool: { name: string }) => tool.name)).toEqual( expect(toolList.tools.map((tool: { name: string }) => tool.name)).toEqual(
['get_bundle_overview', 'query_bundle_sources'] ['get_bundle_overview', 'query_bundle_sources', 'explain_bundle_source']
) )
const overview = await callMcpTool(mcpUrl, 'get_bundle_overview', { const overview = await callMcpTool(mcpUrl, 'get_bundle_overview', {
...@@ -175,6 +175,18 @@ describe('next experimental-analyze', () => { ...@@ -175,6 +175,18 @@ describe('next experimental-analyze', () => {
}) })
expect(packages.groupBy).toBe('package') expect(packages.groupBy).toBe('package')
expect(packages.sources).toHaveLength(1) expect(packages.sources).toHaveLength(1)
const explanation = await callMcpTool(mcpUrl, 'explain_bundle_source', {
route: '/',
sourcePath: sources.sources[0].sourcePath,
maxDepth: 2,
})
expect(explanation).toMatchObject({
route: '/',
sourcePath: sources.sources[0].sourcePath,
routeEntryDetection: { heuristic: true },
moduleCandidates: expect.any(Array),
})
} finally { } finally {
serveProcess?.kill() serveProcess?.kill()
await exit.catch(() => {}) await exit.catch(() => {})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment