chore: seperate into packages

This commit is contained in:
Morten Olsen
2025-12-10 10:26:14 +01:00
parent f9494c88e2
commit d02102977a
40 changed files with 753 additions and 1175 deletions

View File

@@ -14,16 +14,30 @@
".": "./dist/exports.js"
},
"devDependencies": {
"@morten-olsen/stash-configs": "workspace:*",
"@morten-olsen/stash-tests": "workspace:*",
"@types/deep-equal": "^1.0.4",
"@types/node": "24.10.2",
"@vitest/coverage-v8": "4.0.15",
"typescript": "5.9.3",
"vitest": "4.0.15",
"@morten-olsen/stash-configs": "workspace:*",
"@morten-olsen/stash-tests": "workspace:*"
"vitest": "4.0.15"
},
"name": "@morten-olsen/stash-runtime",
"version": "1.0.0",
"imports": {
"#root/*": "./src/*"
},
"dependencies": {
"@electric-sql/pglite": "^0.3.14",
"@huggingface/transformers": "^3.8.1",
"@langchain/textsplitters": "^1.0.1",
"@morten-olsen/stash-query-dsl": "workspace:*",
"better-sqlite3": "^12.5.0",
"deep-equal": "^2.2.3",
"knex": "^3.1.0",
"knex-pglite": "^0.13.0",
"pg": "^8.16.3",
"pgvector": "^0.2.1",
"zod": "4.1.13"
}
}

View File

@@ -1 +1,4 @@
export * from './api.js';
export { Services } from './utils/utils.services.js';
export { StashRuntime } from './runtime.js';
export * from './services/documents/documents.js';
export * from './services/document-chunks/document-chunks.js';

View File

@@ -1,14 +1,32 @@
import { DocumentChunksService } from './exports.js';
import { DatabaseService } from './services/database/database.js';
import { DocumentsService } from './services/documents/documents.js';
import { WarmupService } from './services/warmup/warmup.js';
import { Services } from './utils/utils.services.js';
class StashRuntime {
#services: Services;
constructor(services: Services) { }
constructor(services = new Services()) {
this.#services = services;
services.set(StashRuntime, this);
}
public get database() {
return this.#services.get(DatabaseService);
}
public get documents() {
return this.#services.get(DocumentsService);
}
public get documentChunks() {
return this.#services.get(DocumentChunksService);
}
public get warmup() {
return this.#services.get(WarmupService);
}
}
export { StashRuntime };

View File

@@ -1,6 +1,7 @@
{
"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"src/**/*.ts"