Skip to content

Commit fe2a2da

Browse files
ascorbicclaude
andcommitted
refactor: remove step numbers and redundant comments
Clean up migrate.ts by removing: - Step number prefixes (Step 1, Step 2, etc.) - Redundant section divider comments (====== lines) The code flow is self-documenting through spinner messages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fe3b7b3 commit fe2a2da

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

packages/pds/src/cli/commands/migrate.ts

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ export const migrateCommand = defineCommand({
7979

8080
p.intro("🦋 PDS Migration");
8181

82-
// ============================================
83-
// Step 1: Healthcheck
84-
// ============================================
8582
const spinner = p.spinner();
8683
spinner.start(`Checking PDS at ${targetDomain}...`);
8784

@@ -103,9 +100,6 @@ export const migrateCommand = defineCommand({
103100
}
104101
spinner.stop(`Connected to ${targetDomain}`);
105102

106-
// ============================================
107-
// Step 2: Load config
108-
// ============================================
109103
const wranglerVars = getVars();
110104
const devVars = readDevVars();
111105
const config = { ...devVars, ...wranglerVars };
@@ -126,12 +120,8 @@ export const migrateCommand = defineCommand({
126120
process.exit(1);
127121
}
128122

129-
// Set auth token for target PDS
130123
targetClient.setAuthToken(authToken);
131124

132-
// ============================================
133-
// Step 3: Resolve source PDS from DID
134-
// ============================================
135125
spinner.start(`Looking up @${handle}...`);
136126

137127
const didResolver = new DidResolver();
@@ -155,9 +145,6 @@ export const migrateCommand = defineCommand({
155145
const sourceDomain = getDomain(sourcePdsUrl);
156146
spinner.stop(`Found your account at ${sourceDomain}`);
157147

158-
// ============================================
159-
// Step 4: Check target state
160-
// ============================================
161148
spinner.start("Checking account status...");
162149

163150
let status;
@@ -174,9 +161,6 @@ export const migrateCommand = defineCommand({
174161

175162
spinner.stop("Account status retrieved");
176163

177-
// ============================================
178-
// Handle --clean flag
179-
// ============================================
180164
if (args.clean) {
181165
if (status.active) {
182166
p.log.error("Cannot reset: account is active");
@@ -235,19 +219,13 @@ export const migrateCommand = defineCommand({
235219
status = await targetClient.getAccountStatus();
236220
}
237221

238-
// ============================================
239-
// Check if already active
240-
// ============================================
241222
if (status.active) {
242223
p.log.warn("Your account is already active in the Atmosphere!");
243224
p.log.info("No migration needed - your PDS is live.");
244225
p.outro("All good! 🦋");
245226
return;
246227
}
247228

248-
// ============================================
249-
// Step 5: Fetch source stats
250-
// ============================================
251229
spinner.start(`Fetching your account details from ${sourceDomain}...`);
252230

253231
const sourceClient = new PDSClient(sourcePdsUrl);
@@ -276,9 +254,6 @@ export const migrateCommand = defineCommand({
276254
const needsBlobSync = missingBlobs > 0 || needsRepoImport;
277255
const isResuming = !needsRepoImport && needsBlobSync;
278256

279-
// ============================================
280-
// Show migration preview
281-
// ============================================
282257
if (isResuming) {
283258
// Resume flow
284259
p.log.info("Welcome back!");
@@ -354,9 +329,6 @@ export const migrateCommand = defineCommand({
354329
return;
355330
}
356331

357-
// ============================================
358-
// Step 6: Authenticate to source PDS
359-
// ============================================
360332
const isBlueskyPds = sourceDomain.endsWith(".bsky.network");
361333
const passwordPrompt = isBlueskyPds
362334
? "Your current Bluesky password:"
@@ -390,9 +362,6 @@ export const migrateCommand = defineCommand({
390362
process.exit(1);
391363
}
392364

393-
// ============================================
394-
// Step 7: Export and import repo
395-
// ============================================
396365
if (needsRepoImport) {
397366
spinner.start("Packing your repository...");
398367
let carBytes: Uint8Array;
@@ -427,9 +396,6 @@ export const migrateCommand = defineCommand({
427396
status = await targetClient.getAccountStatus();
428397
}
429398

430-
// ============================================
431-
// Step 8: Migrate preferences
432-
// ============================================
433399
spinner.start("Migrating your preferences...");
434400
try {
435401
const preferences = await sourceClient.getPreferences();
@@ -444,9 +410,6 @@ export const migrateCommand = defineCommand({
444410
spinner.stop("Skipped preferences (not available)");
445411
}
446412

447-
// ============================================
448-
// Step 9: Sync blobs
449-
// ============================================
450413
const expectedBlobs = status.expectedBlobs;
451414
const alreadyImported = status.importedBlobs;
452415
const blobsToSync = expectedBlobs - alreadyImported;
@@ -511,9 +474,6 @@ export const migrateCommand = defineCommand({
511474
}
512475
}
513476

514-
// ============================================
515-
// Step 10: Verify and show next steps
516-
// ============================================
517477
spinner.start("Verifying migration...");
518478
const finalStatus = await targetClient.getAccountStatus();
519479
spinner.stop("Verification complete");

0 commit comments

Comments
 (0)