/** * Diagnose failures of npm commands run by npmglobalize. * * Pulls out common error shapes — especially ones whose root cause lives in * a referenced (file:) module, not the current package — and turns them into * a short summary + actionable hint instead of a raw arborist stack trace. * * Leaf module: no dependencies on lib.ts or other internal modules. Keeps * the main publish flow in lib.ts readable. */ export interface DiagnosedError { /** Short one-liner suitable for the Issues Summary. */ summary: string; /** Multi-line block to print to console.error (without color). */ details: string[]; /** If the root cause is a file: sibling, its package name. */ referencedModule?: string; /** One concrete next step the user can take. */ hint?: string; } /** Diagnose an `npm pack` failure. */ export declare function diagnoseNpmPackFailure(cwd: string, output: string, stderr: string, pkg: any): DiagnosedError; /** Given a nested-node_modules path like * `node_modules/@scope/sibling/node_modules/transitive` * or `../sibling/node_modules/transitive`, * find the outermost dep name and resolve it to a file: sibling declared * in pkg.dependencies / pkg['.dependencies'] / etc. */ declare function resolveSiblingFromNestedPath(nestedPath: string, cwd: string, pkg: any): { name: string; filePath: string; } | undefined; /** Scan pkg deps for a file: entry whose resolved absolute path equals absTarget. */ declare function findFileDepByPath(pkg: any, cwd: string, absTarget: string): { name: string; filePath: string; } | undefined; /** Exposed for ad-hoc testing — not used by the main flow. */ export declare const _test: { resolveSiblingFromNestedPath: typeof resolveSiblingFromNestedPath; findFileDepByPath: typeof findFileDepByPath; }; export {}; //# sourceMappingURL=diagnose.d.ts.map