koguma 2.2.1 → 2.2.3

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.
package/cli/content.ts CHANGED
@@ -586,6 +586,11 @@ export function validateContent(
586
586
  'updated_at'
587
587
  ]);
588
588
 
589
+ // Build set of extra markdown field IDs (for sibling file detection)
590
+ const extraMdFieldIds = new Set<string>();
591
+ const mdFields = findMarkdownFields(ctInfo.fieldMeta);
592
+ for (const id of mdFields.slice(1)) extraMdFieldIds.add(id);
593
+
589
594
  const files = readdirSync(subdirPath);
590
595
  for (const file of files) {
591
596
  if (file.startsWith('_')) continue;
@@ -595,6 +600,17 @@ export function validateContent(
595
600
  const filePath = resolve(subdirPath, file);
596
601
  if (!statSync(filePath).isFile()) continue;
597
602
 
603
+ const name = basename(file, ext);
604
+
605
+ // Skip sibling markdown field files — they're not full entries
606
+ if (ext === '.md' && extraMdFieldIds.size > 0) {
607
+ // Singleton sibling: fieldId.md (not index.md)
608
+ if (name !== 'index' && extraMdFieldIds.has(name)) continue;
609
+ // Collection sibling: slug.fieldId.md
610
+ const dotIdx = name.lastIndexOf('.');
611
+ if (dotIdx > 0 && extraMdFieldIds.has(name.slice(dotIdx + 1))) continue;
612
+ }
613
+
598
614
  const entry = parseContentFile(filePath, subdir);
599
615
  const relPath = `${subdir}/${file}`;
600
616
 
package/cli/wrangler.ts CHANGED
@@ -320,12 +320,36 @@ export function wranglerDev(
320
320
  /^✘\s+/, // npm dep install error lines (let warn() handle these)
321
321
  /^▲\s+/, // npm dep install warning lines
322
322
  /^>\s+/, // npm progress lines
323
- /^\s*$/ // blank lines
323
+ /^\s*$/, // blank lines
324
+ /Reloading local server/, // wrangler dev reload spam
325
+ /Local server updated/, // wrangler dev reload (handled as status line)
326
+ /Unable to find and open the program executable/ // benign diagnostic
324
327
  ];
325
328
 
326
329
  const shouldSuppress = (line: string): boolean =>
327
330
  suppressPatterns.some(p => p.test(line));
328
331
 
332
+ // ── In-place status line for transient events ──
333
+ let reloadCount = 0;
334
+ let hasStatusLine = false;
335
+ const isTTY = process.stdout.isTTY;
336
+
337
+ /** Write a transient status that overwrites itself on the next call */
338
+ const writeStatus = (text: string) => {
339
+ if (isTTY) {
340
+ process.stdout.write(`\r\x1b[K ⟳ ${text}`);
341
+ hasStatusLine = true;
342
+ }
343
+ };
344
+
345
+ /** Clear the status line before printing a permanent line */
346
+ const clearStatus = () => {
347
+ if (hasStatusLine && isTTY) {
348
+ process.stdout.write('\r\x1b[K');
349
+ hasStatusLine = false;
350
+ }
351
+ };
352
+
329
353
  const handleOutput = (data: Buffer, isErr: boolean) => {
330
354
  const text = data.toString();
331
355
  for (const line of text.split('\n')) {
@@ -336,16 +360,29 @@ export function wranglerDev(
336
360
  if (trimmed.includes('Ready on http')) {
337
361
  const urlMatch = trimmed.match(/(https?:\/\/[^\s]+)/);
338
362
  const url = urlMatch?.[1] ?? 'http://localhost:8787';
363
+ clearStatus();
339
364
  ok(`Server ready → ${url}`);
340
365
  continue;
341
366
  }
342
367
 
368
+ // Reload events → transient status line (overwrites in place)
369
+ if (/Reloading local server/.test(trimmed)) {
370
+ reloadCount++;
371
+ writeStatus(`reload #${reloadCount}`);
372
+ continue;
373
+ }
374
+ if (/Local server updated/.test(trimmed)) {
375
+ writeStatus(`reload #${reloadCount} ✓`);
376
+ continue;
377
+ }
378
+
343
379
  if (shouldSuppress(line)) continue;
344
380
 
345
381
  if (trimmed.includes('Starting local server')) continue;
346
382
  if (trimmed.includes('Shutting down')) continue;
347
383
 
348
- // Forward everything else (request logs, errors, warnings)
384
+ // Permanent line clear status first
385
+ clearStatus();
349
386
  if (isErr) {
350
387
  warn(trimmed);
351
388
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koguma",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "🐻 A little CMS with big heart — schema-driven, runs on Cloudflare's free tier",
5
5
  "type": "module",
6
6
  "license": "MIT",