chore: format and bump version
476cbd72
5 file(s) · +25 −29
| 1 | 1 | { |
|
| 2 | 2 | "name": "sequoia-cli", |
|
| 3 | - | "version": "0.5.1", |
|
| 3 | + | "version": "0.5.2", |
|
| 4 | 4 | "type": "module", |
|
| 5 | 5 | "bin": { |
|
| 6 | 6 | "sequoia": "dist/index.js" |
| 159 | 159 | ) { |
|
| 160 | 160 | // Create agent early for sync (will be reused for publishing) |
|
| 161 | 161 | const connectingTo = |
|
| 162 | - | credentials.type === "oauth" |
|
| 163 | - | ? credentials.handle |
|
| 164 | - | : credentials.pdsUrl; |
|
| 162 | + | credentials.type === "oauth" ? credentials.handle : credentials.pdsUrl; |
|
| 165 | 163 | s.start(`Connecting as ${connectingTo}...`); |
|
| 166 | 164 | try { |
|
| 167 | 165 | agent = await createAgent(credentials); |
|
| 174 | 172 | ||
| 175 | 173 | try { |
|
| 176 | 174 | s.start("Auto-syncing state from PDS..."); |
|
| 177 | - | const syncResult = await syncStateFromPDS( |
|
| 178 | - | agent, |
|
| 179 | - | config, |
|
| 180 | - | configDir, |
|
| 181 | - | { |
|
| 182 | - | updateFrontmatter: true, |
|
| 183 | - | quiet: true, |
|
| 184 | - | }, |
|
| 185 | - | ); |
|
| 186 | - | s.stop( |
|
| 187 | - | `Auto-synced ${syncResult.matchedCount} posts from PDS`, |
|
| 188 | - | ); |
|
| 175 | + | const syncResult = await syncStateFromPDS(agent, config, configDir, { |
|
| 176 | + | updateFrontmatter: true, |
|
| 177 | + | quiet: true, |
|
| 178 | + | }); |
|
| 179 | + | s.stop(`Auto-synced ${syncResult.matchedCount} posts from PDS`); |
|
| 189 | 180 | state = syncResult.state; |
|
| 190 | 181 | } catch (error) { |
|
| 191 | 182 | s.stop("Auto-sync failed"); |
|
| 192 | 183 | log.warn( |
|
| 193 | 184 | `Auto-sync failed: ${error instanceof Error ? error.message : String(error)}`, |
|
| 194 | 185 | ); |
|
| 195 | - | log.warn("Continuing with empty state. Run 'sequoia sync' manually to fix."); |
|
| 186 | + | log.warn( |
|
| 187 | + | "Continuing with empty state. Run 'sequoia sync' manually to fix.", |
|
| 188 | + | ); |
|
| 196 | 189 | } |
|
| 197 | 190 | } |
|
| 198 | 191 | ||
| 312 | 305 | // Create agent (skip if already created during auto-sync) |
|
| 313 | 306 | if (!agent) { |
|
| 314 | 307 | const connectingTo = |
|
| 315 | - | credentials.type === "oauth" |
|
| 316 | - | ? credentials.handle |
|
| 317 | - | : credentials.pdsUrl; |
|
| 308 | + | credentials.type === "oauth" ? credentials.handle : credentials.pdsUrl; |
|
| 318 | 309 | s.start(`Connecting as ${connectingTo}...`); |
|
| 319 | 310 | try { |
|
| 320 | 311 | agent = await createAgent(credentials); |
|
| 126 | 126 | ||
| 127 | 127 | if (!dryRun) { |
|
| 128 | 128 | const stateCount = Object.keys(result.state.posts).length; |
|
| 129 | - | log.success( |
|
| 130 | - | `\nSaved .sequoia-state.json (${stateCount} entries)`, |
|
| 131 | - | ); |
|
| 129 | + | log.success(`\nSaved .sequoia-state.json (${stateCount} entries)`); |
|
| 132 | 130 | ||
| 133 | 131 | if (result.frontmatterUpdatesApplied > 0) { |
|
| 134 | 132 | log.success( |
| 36 | 36 | ||
| 37 | 37 | > https://tangled.org/stevedylan.dev/sequoia |
|
| 38 | 38 | `, |
|
| 39 | - | version: "0.5.1", |
|
| 39 | + | version: "0.5.2", |
|
| 40 | 40 | cmds: { |
|
| 41 | 41 | add: addCommand, |
|
| 42 | 42 | auth: authCommand, |
| 85 | 85 | let matchedCount = 0; |
|
| 86 | 86 | let unmatchedCount = 0; |
|
| 87 | 87 | let frontmatterUpdatesApplied = 0; |
|
| 88 | - | const frontmatterUpdates: Array<{ filePath: string; atUri: string; relativeFilePath: string }> = []; |
|
| 88 | + | const frontmatterUpdates: Array<{ |
|
| 89 | + | filePath: string; |
|
| 90 | + | atUri: string; |
|
| 91 | + | relativeFilePath: string; |
|
| 92 | + | }> = []; |
|
| 89 | 93 | ||
| 90 | 94 | if (!quiet) { |
|
| 91 | 95 | log.message("\nMatching documents to local files:\n"); |
|
| 143 | 147 | } else { |
|
| 144 | 148 | unmatchedCount++; |
|
| 145 | 149 | if (!quiet) { |
|
| 146 | - | log.message( |
|
| 147 | - | ` ✗ ${doc.value.title} (no matching local file)`, |
|
| 148 | - | ); |
|
| 150 | + | log.message(` ✗ ${doc.value.title} (no matching local file)`); |
|
| 149 | 151 | log.message(` Path: ${docPath}`); |
|
| 150 | 152 | log.message(` URI: ${doc.uri}`); |
|
| 151 | 153 | } |
|
| 170 | 172 | if (!quiet) { |
|
| 171 | 173 | log.info("\nDry run complete. No changes made."); |
|
| 172 | 174 | } |
|
| 173 | - | return { state, matchedCount, unmatchedCount, frontmatterUpdatesApplied: 0 }; |
|
| 175 | + | return { |
|
| 176 | + | state, |
|
| 177 | + | matchedCount, |
|
| 178 | + | unmatchedCount, |
|
| 179 | + | frontmatterUpdatesApplied: 0, |
|
| 180 | + | }; |
|
| 174 | 181 | } |
|
| 175 | 182 | ||
| 176 | 183 | // Save updated state |
|