feat(cli): add create-version command

This commit is contained in:
yiling
2026-06-21 20:14:26 +08:00
parent 87fc10b62f
commit 86c1d964a3
4 changed files with 301 additions and 8 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ interface CliFileNode {
mediaType?: string
}
function getMediaType(filename: string): string {
export function getMediaType(filename: string): string {
const ext = path.extname(filename).toLowerCase()
const mimeMap: Record<string, string> = {
'.png': 'image/png',
@@ -79,7 +79,7 @@ async function buildFileTree(
}
}
class ProgressTracker {
export class ProgressTracker {
private uploads = new Map<string, { name: string; size: number; uploadedBytes: number }>()
private isTty = process.stdout.isTTY
private linesPrinted = 0
@@ -124,7 +124,7 @@ class ProgressTracker {
}
}
async function uploadFileWithProgress(
export async function uploadFileWithProgress(
url: string,
filePath: string,
contentType: string,