mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 02:30:42 +01:00
server-esm: Remove dynamic imports due to past circular issues
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import becca from "../becca/becca.js";
|
||||
import BOption from "../becca/entities/boption.js";
|
||||
import { OptionRow } from '../becca/entities/rows';
|
||||
import sql from "./sql.js";
|
||||
|
||||
@@ -68,10 +69,7 @@ function setOption(name: string, value: string | number | boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
function createOption(name: string, value: string | number, isSynced: boolean) {
|
||||
// to avoid circular dependency, need to find a better solution
|
||||
const BOption = require('../becca/entities/boption');
|
||||
|
||||
function createOption(name: string, value: string, isSynced: boolean) {
|
||||
new BOption({
|
||||
name: name,
|
||||
value: value,
|
||||
|
||||
@@ -16,6 +16,7 @@ import BAttribute from "../../../becca/entities/battribute.js";
|
||||
import { SearchParams, TokenStructure } from "./types";
|
||||
import Expression from "../expressions/expression.js";
|
||||
import sql from "../../sql.js";
|
||||
import scriptService from "../../script.js";
|
||||
|
||||
function searchFromNote(note: BNote) {
|
||||
let searchResultNoteIds;
|
||||
@@ -78,7 +79,6 @@ function searchFromRelation(note: BNote, relationName: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const scriptService = require('../../script'); // TODO: to avoid circular dependency
|
||||
const result = scriptService.executeNote(scriptNote, {originEntity: note});
|
||||
|
||||
if (!Array.isArray(result)) {
|
||||
|
||||
@@ -19,6 +19,7 @@ import entityConstructor from "../becca/entity_constructor.js";
|
||||
import becca from "../becca/becca.js";
|
||||
import { EntityChange, EntityChangeRecord, EntityRow } from './entity_changes_interface';
|
||||
import { CookieJar, ExecOpts } from './request_interface';
|
||||
import setupService from "./setup.js";
|
||||
|
||||
let proxyToggle = true;
|
||||
|
||||
@@ -107,8 +108,6 @@ async function sync() {
|
||||
}
|
||||
|
||||
async function login() {
|
||||
const setupService = require('./setup'); // circular dependency issue
|
||||
|
||||
if (!await setupService.hasSyncServerSchemaAndSeed()) {
|
||||
await setupService.sendSeedToSyncServer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user