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

Document client defaults for import graph queries

Co-authored-by: 's avatarWill Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
parent 2b644912
......@@ -32,6 +32,26 @@ describe('analyzer query discovery', () => {
}
}
})
it('documents the effective environment default for each query', () => {
const queries = createAnalyzeQueryRegistry({} as AnalyzeRepository).list()
for (const [name, defaultEnvironment] of [
['get_route_modules', 'total'],
['get_initial_import_graph', 'client'],
['analyze_import_edge', 'client'],
]) {
const query = queries.find((item) => item.name === name)
expect(query?.inputSchema).toMatchObject({
properties: {
environment: {
type: 'string',
enum: ['total', 'client', 'server'],
description: `Attribution environment. Default: \`${defaultEnvironment}\`.`,
},
},
})
}
})
})
describe('analyzer SCC evidence', () => {
......
......@@ -1898,7 +1898,9 @@ export function createAnalyzeQueryRegistry(repository: AnalyzeRepository) {
snapshot: snapshotSchema,
moduleIdent: z.string().max(4096).optional(),
routeEntryId: z.string().max(8192).optional(),
environment: environmentSchema,
environment: environmentSchema.describe(
'Attribution environment. Default: `client`.'
),
},
example: { route: '/', sourcePath: '[project]/src/app/page.tsx' },
caveats: [COMPRESSED_CAVEAT],
......@@ -2006,7 +2008,9 @@ export function createAnalyzeQueryRegistry(repository: AnalyzeRepository) {
snapshot: snapshotSchema,
moduleIdent: z.string().max(4096).optional(),
routeEntryId: z.string().max(8192).optional(),
environment: environmentSchema,
environment: environmentSchema.describe(
'Attribution environment. Default: `client`.'
),
granularity: z.enum(['module', 'source', 'package']).optional(),
...pagingSchema,
},
......
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