mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 21:48:18 +01:00
Major changes: - AI streaming: Add unified client for OpenRouter SSE and local (Ollama) providers - Local AI detection: Auto-detect and configure local model providers - Rate limiting: Canonical adapters with X-RateLimit-* headers across APIs - SSE: Add lib/sse.ts for consistent event-stream parsing Cleanup: - Remove /demo, /donate, /fund-us, /funding, /fundraising pages - Simplify ModelSelector component (288 → 80 lines) - Consolidate timeline queries New features: - Voice input component and hook - Query provider for React Query - Model registry with status badges - HTTP headers config Tests & Docs: - E2E tests for project creation wizard - Unit tests for auth, streaming, components - CHANGELOG.md for version tracking - Deployment checklist and PR summary docs Bug fixes: - Timeline schema and functions migration fixes - Messaging RLS recursion fix - Auth callback improvements - Bitcoin formatting precision - Lint fixes for unused variables Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
#!/usr/bin/env node
|
|
/*
|
|
docs-frontmatter-check.js
|
|
Ensures active docs have frontmatter with required fields.
|
|
*/
|
|
|
|
const { glob } = require('glob');
|
|
const fs = require('fs');
|
|
|
|
function parseFrontmatter(text) {
|
|
if (!text.startsWith('---')) return null;
|
|
const end = text.indexOf('\n---', 3);
|
|
if (end === -1) return null;
|
|
const fm = text.slice(3, end).trim();
|
|
const body = text.slice(end + 4);
|
|
const obj = {};
|
|
fm.split(/\r?\n/).forEach(line => {
|
|
const m = line.match(/^([a-zA-Z0-9_\-]+):\s*(.*)$/);
|
|
if (m) obj[m[1]] = m[2];
|
|
});
|
|
return { data: obj, body };
|
|
}
|
|
|
|
async function main() {
|
|
const files = await glob('docs/**/*.md', { ignore: [
|
|
'docs/archives/**',
|
|
'**/node_modules/**',
|
|
] });
|
|
|
|
const required = ['created_date', 'last_modified_date', 'last_modified_summary'];
|
|
const failures = [];
|
|
|
|
for (const file of files) {
|
|
const text = fs.readFileSync(file, 'utf8');
|
|
const fm = parseFrontmatter(text);
|
|
if (!fm) {
|
|
failures.push({ file, reason: 'Missing frontmatter' });
|
|
continue;
|
|
}
|
|
for (const key of required) {
|
|
if (!fm.data[key]) {
|
|
failures.push({ file, reason: `Missing field: ${key}` });
|
|
}
|
|
}
|
|
}
|
|
|
|
if (failures.length) {
|
|
console.log('Frontmatter issues detected:');
|
|
failures.slice(0, 100).forEach(f => console.log(`- ${f.file}: ${f.reason}`));
|
|
process.exitCode = 1;
|
|
} else {
|
|
console.log('All active docs have required frontmatter.');
|
|
}
|
|
}
|
|
|
|
main().catch(err => {
|
|
console.error(err);
|
|
process.exitCode = 1;
|
|
});
|
|
|