/
githubmirror
/
tldraw
Обзор
Документация
Войти
/
githubmirror
/
tldraw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
apps/docs/scripts/lib/refreshContent.ts
31 строка
1 KB
Mime Čuvalo
docs: cull the old content (#6793)
30 сен 2025, 13:31
Не верифицирован
30 сен 2025, 13:31
ecc8033
Код
Авторство
О чём код?
import { addContentToDb } from '@/utils/addContent' import { autoLinkDocs } from '@/utils/autoLinkDocs' import { nicelog } from '@/utils/nicelog' import { connect } from './connect' import { generateApiContent } from './generateApiContent' import { generateContent } from './generateContent' import { generateExamplesContent } from './generateExamplesContent' import { generateLlmsTxt } from './generateLllmsTxt' export async function refreshContent(opts = {} as { silent: boolean }) { if (!opts.silent) nicelog('◦ Resetting database...') const db = await connect({ reset: true, mode: 'readwrite' }) if (!opts.silent) nicelog('◦ Generating / adding regular content to db...') await addContentToDb(db, await generateContent()) if (!opts.silent) nicelog('◦ Generating / adding Examples content to db...') await addContentToDb(db, await generateExamplesContent()) if (!opts.silent) nicelog('◦ Generating / adding API content to db...') await addContentToDb(db, await generateApiContent()) if (!opts.silent) nicelog('◦ Fixing links to API docs...') await autoLinkDocs(db) if (!opts.silent) nicelog('◦ Creating llms.txt...') await generateLlmsTxt(db) if (!opts.silent) nicelog('✔ Complete') }