Fetch the gitHead recorded for a published version (set by npm publish from a git checkout)
(name: string, version: string, registry?: string)
| 64 | |
| 65 | /** Fetch the gitHead recorded for a published version (set by npm publish from a git checkout) */ |
| 66 | async function fetchGitHead(name: string, version: string, registry?: string): Promise<string | null> { |
| 67 | const args = ['npm', 'info', `${name}@${version}`, 'gitHead']; |
| 68 | if (registry) args.push('--registry', registry); |
| 69 | try { |
| 70 | const result = await runArgsAsync(args); |
| 71 | const sha = result.trim(); |
| 72 | return /^[0-9a-f]{40}$/.test(sha) ? sha : null; |
| 73 | } catch { |
| 74 | return null; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /** Whether a package publishes through the npm registry (vs custom command / git-tag tracking) */ |
| 79 | export function usesNpmRegistry(pkg: WorkspacePackage): boolean { |
no test coverage detected
searching dependent graphs…