From d33ec32644732bc4cbeb22044b863d3b19dd7513 Mon Sep 17 00:00:00 2001 From: nlf Date: Tue, 20 Sep 2022 13:13:10 -0700 Subject: [PATCH] feat(query): display `queryContext` in results --- lib/commands/query.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/commands/query.js b/lib/commands/query.js index 231329b19b5c8..5f05ab3164d7c 100644 --- a/lib/commands/query.js +++ b/lib/commands/query.js @@ -21,6 +21,7 @@ class QuerySelectorItem { this.inBundle = node.target.inBundle this.deduped = this.from.length > 1 this.overridden = node.overridden + this.queryContext = node.queryContext for (const edge of node.target.edgesIn) { this.from.push(edge.from.location) } @@ -63,7 +64,7 @@ class Query extends BaseCommand { } const arb = new Arborist(opts) const tree = await arb.loadActual(opts) - const items = await tree.querySelectorAll(args[0]) + const items = await tree.querySelectorAll(args[0], this.npm.flatOptions) this.buildResponse(items) this.npm.output(this.parsedResponse) @@ -84,7 +85,7 @@ class Query extends BaseCommand { items = await tree.querySelectorAll(args[0]) } else { const [workspace] = await tree.querySelectorAll(`.workspace:path(${workspacePath})`) - items = await workspace.target.querySelectorAll(args[0]) + items = await workspace.target.querySelectorAll(args[0], this.npm.flatOptions) } this.buildResponse(items) }