chore(LINT-0001) fix lint errors

This commit is contained in:
Giancarmine Salucci
2026-03-27 03:01:37 +01:00
parent 7f7d806172
commit da661efc91
24 changed files with 114 additions and 69 deletions

View File

@@ -13,7 +13,7 @@
* - With embeddings : crawl+parse = 80 %, embeddings = 20 %
*/
import { createHash } from 'node:crypto';
import { createHash, randomUUID } from 'node:crypto';
import type Database from 'better-sqlite3';
import type { Document, NewDocument, NewSnippet } from '$lib/types';
import type { crawl as GithubCrawlFn } from '$lib/server/crawler/github.crawler.js';
@@ -92,7 +92,7 @@ export class IndexingPipeline {
this.updateRepo(repo.id, { state: 'indexing' });
// ---- Stage 1: Crawl -------------------------------------------------
const crawlResult = await this.crawl(repo, normJob);
const crawlResult = await this.crawl(repo);
const totalFiles = crawlResult.totalFiles;
this.updateJob(job.id, { totalFiles });
@@ -140,7 +140,7 @@ export class IndexingPipeline {
const checksum = file.sha || sha256(file.content);
// Create new document record.
const documentId = crypto.randomUUID();
const documentId = randomUUID();
const now = new Date();
const newDoc: NewDocument = {
id: documentId,
@@ -247,10 +247,7 @@ export class IndexingPipeline {
// Private — crawl
// -------------------------------------------------------------------------
private async crawl(
repo: Repository,
job: IndexingJob
): Promise<{
private async crawl(repo: Repository): Promise<{
files: Array<{ path: string; content: string; sha: string; size: number; language: string }>;
totalFiles: number;
}> {