@clickminded/coauthor-cli 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/commands.js +9 -2
  2. package/package.json +1 -1
package/dist/commands.js CHANGED
@@ -1519,6 +1519,7 @@ async function downloadRepurposed(projectId, format, outOption, client) {
1519
1519
  }
1520
1520
  const formats = format === 'all' ? REPURPOSE_FORMATS : format === 'article' ? [] : [format];
1521
1521
  const manifest = {};
1522
+ const missingLink = [];
1522
1523
  for (const entry of formats) {
1523
1524
  const shown = await client.request({ path: `projects/${encodeURIComponent(projectId)}/repurpose/${encodeURIComponent(entry)}` });
1524
1525
  const artifact = getResponseValue(shown, 'artifact');
@@ -1527,14 +1528,17 @@ async function downloadRepurposed(projectId, format, outOption, client) {
1527
1528
  skipped.push(entry);
1528
1529
  continue;
1529
1530
  }
1530
- await write(`${entry}.md`, renderRepurposeMarkdown(entry, copy));
1531
+ const markdown = renderRepurposeMarkdown(entry, copy);
1532
+ if (markdown.includes('{{POST_URL}}'))
1533
+ missingLink.push(entry);
1534
+ await write(`${entry}.md`, markdown);
1531
1535
  await write(`${entry}.json`, JSON.stringify(artifact, null, 2));
1532
1536
  manifest[entry] = {
1533
1537
  stale: Boolean(getResponseValue(artifact, 'stale_at')),
1534
1538
  updated_at: getResponseValue(artifact, 'updated_at') ?? null,
1535
1539
  };
1536
1540
  }
1537
- await write('manifest.json', JSON.stringify({ project_id: projectId, downloaded_at: new Date().toISOString(), formats: manifest, skipped }, null, 2));
1541
+ await write('manifest.json', JSON.stringify({ project_id: projectId, downloaded_at: new Date().toISOString(), formats: manifest, skipped, missing_article_link: missingLink }, null, 2));
1538
1542
  const staleNote = Object.entries(manifest).filter(([, value]) => value.stale).map(([key]) => key);
1539
1543
  return {
1540
1544
  ok: true,
@@ -1542,6 +1546,9 @@ async function downloadRepurposed(projectId, format, outOption, client) {
1542
1546
  `Wrote ${written.length} files to ${outDir}`,
1543
1547
  skipped.length > 0 ? `Not generated yet: ${skipped.join(', ')} (coauthor repurpose generate ${projectId} --format <format>; slideshow and video are made in the web app).` : '',
1544
1548
  staleNote.length > 0 ? `Stale (the draft changed since they were made): ${staleNote.join(', ')}. Regenerate them before posting.` : '',
1549
+ missingLink.length > 0
1550
+ ? `No article link yet: ${missingLink.join(', ')} still contain {{POST_URL}}. Set it with coauthor repurpose save ${projectId} --format <format> --data '{"destination_url":"https://..."}' and download again, or replace it when posting.`
1551
+ : '',
1545
1552
  ].filter(Boolean).join('\n'),
1546
1553
  data: { out_dir: outDir, files: written, skipped },
1547
1554
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickminded/coauthor-cli",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "coauthor": "dist/index.js",