#!/usr/bin/env tsx /** * Retry publish script * * This script retries publishing an existing version to npm and GitHub Releases. * Used when the initial publish failed but the Git tag was already created. * * Safety features: * - Checks out the exact commit of the latest tag * - Doesn't modify any Git history * - Restores the original branch after publishing * - Verifies the tag exists before proceeding * * Usage: * tsx retry-publish.ts * # Then run: release-it --config retry-publish.js */ import type { ExecSyncOptions } from 'node:child_process'; import { readFileSync } from 'node:fs'; export interface RetryPublishDeps { execSync: (command: string, options?: ExecSyncOptions) => Buffer | string; log: (message: string) => void; warn: (message: string) => void; readFileSync: typeof readFileSync; } export interface RetryPublishResult { currentBranch: string; latestTag: string; tagCommit: string; hasUncommittedChanges: boolean; packageVersion?: string; } export declare function retryPublish(deps: RetryPublishDeps): RetryPublishResult;