A CLI for publishing standard.site documents to ATProto

fix: preserve rkey when republishing with missing state

When a post's state entry is missing but its frontmatter already
contains an atUri, use "update" instead of "create" to preserve
the existing rkey and avoid duplicate records.

+2 -3
+2 -3
packages/cli/src/commands/publish.ts
··· 180 reason: "forced", 181 }); 182 } else if (!postState) { 183 - // New post 184 postsToPublish.push({ 185 post, 186 - action: "create", 187 - reason: "new post", 188 }); 189 } else if (postState.contentHash !== contentHash) { 190 // Changed post
··· 180 reason: "forced", 181 }); 182 } else if (!postState) { 183 postsToPublish.push({ 184 post, 185 + action: post.frontmatter.atUri ? "update" : "create", 186 + reason: post.frontmatter.atUri ? "missing state" : "new post", 187 }); 188 } else if (postState.contentHash !== contentHash) { 189 // Changed post