Skip to content

Commit c89c42e

Browse files
committed
fix(attw): show full entrypoint
closes #656
1 parent 84b68bb commit c89c42e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/features/pkg/attw.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { dim } from 'ansis'
55
import { createDebug } from 'obug'
66
import { exec } from 'tinyexec'
77
import { fsRemove } from '../../utils/fs.ts'
8-
import { importWithError } from '../../utils/general.ts'
8+
import { importWithError, slash } from '../../utils/general.ts'
99
import type { ResolvedConfig } from '../../config/index.ts'
1010
import type {
1111
CheckPackageOptions,
@@ -105,7 +105,9 @@ export async function attw(options: ResolvedConfig): Promise<void> {
105105
})
106106

107107
if (problems.length) {
108-
const problemList = problems.map(formatProblem).join('\n')
108+
const problemList = problems
109+
.map((problem) => formatProblem(checkResult.packageName, problem))
110+
.join('\n')
109111
errorMessage = `problems found:\n${problemList}`
110112
}
111113
} else {
@@ -127,10 +129,13 @@ export async function attw(options: ResolvedConfig): Promise<void> {
127129
/**
128130
* Format an ATTW problem for display
129131
*/
130-
function formatProblem(problem: Problem): string {
132+
function formatProblem(packageName: string, problem: Problem): string {
131133
const resolutionKind =
132134
'resolutionKind' in problem ? ` (${problem.resolutionKind})` : ''
133-
const entrypoint = 'entrypoint' in problem ? ` at ${problem.entrypoint}` : ''
135+
const entrypoint =
136+
'entrypoint' in problem
137+
? ` at ${slash(path.join(packageName, problem.entrypoint))}`
138+
: ''
134139

135140
switch (problem.kind) {
136141
case 'NoResolution':

0 commit comments

Comments
 (0)