Skip to content

Build your personal knowledge base with Trilium Notes

refactor(core): import route dependencies directly instead of via the barrel

Elian Doran6d413eb7dbc7
diff --git a/packages/trilium-core/src/routes/api/others.ts b/packages/trilium-core/src/routes/api/others.ts
index 087391ffa0..bbe6855c40 100644
--- a/packages/trilium-core/src/routes/api/others.ts
+++ b/packages/trilium-core/src/routes/api/others.ts
@@ -3,8 +3,9 @@ import becca from "../../becca/becca";
import { RenderMarkdownResponse, ToMarkdownResponse } from "@triliumnext/commons";
import type { Request } from "express";
+import { ValidationError } from "../../errors.js";
import markdown from "../../services/export/markdown.js";
-import { markdownImportService, ValidationError } from "../..";
+import markdownImportService from "../../services/import/markdown.js";
function renderMarkdown(req: Request) {
const { markdownContent } = req.body;
diff --git a/packages/trilium-core/src/routes/api/revisions.ts b/packages/trilium-core/src/routes/api/revisions.ts
index dc488ef916..3a77f642f6 100644
--- a/packages/trilium-core/src/routes/api/revisions.ts
+++ b/packages/trilium-core/src/routes/api/revisions.ts
@@ -13,7 +13,10 @@ import type BRevision from "../../becca/entities/brevision.js";
import blobService from "../../services/blob.js";
import eraseService from "../../services/erase.js";
import { NotePojo } from "../../becca/becca-interface.js";
-import { becca_service, binary_utils, cls, getSql } from "../../index.js";
+import becca_service from "../../becca/becca_service.js";
+import * as cls from "../../services/context.js";
+import { getSql } from "../../services/sql/index.js";
+import * as binary_utils from "../../services/utils/binary.js";
import { formatDownloadTitle, getContentDisposition } from "../../services/utils/index.js";
import { extname } from "../../services/utils/path.js";