@@ -14,6 +14,7 @@ import { OptionRow } from '../becca/entities/rows';
14
14
import optionsInitService from "./options_init.js" ;
15
15
import BNote from "../becca/entities/bnote.js" ;
16
16
import BBranch from "../becca/entities/bbranch.js" ;
17
+ import zipImportService from "./import/zip.js" ;
17
18
18
19
const dbReady = utils . deferred < void > ( ) ;
19
20
@@ -57,7 +58,7 @@ async function createInitialDatabase() {
57
58
const schema = fs . readFileSync ( `${ resourceDir . DB_INIT_DIR } /schema.sql` , "utf-8" ) ;
58
59
const demoFile = fs . readFileSync ( `${ resourceDir . DB_INIT_DIR } /demo.zip` ) ;
59
60
60
- let rootNote ;
61
+ let rootNote ! : BNote ;
61
62
62
63
sql . transactional ( ( ) => {
63
64
log . info ( "Creating database schema ..." ) ;
@@ -94,7 +95,6 @@ async function createInitialDatabase() {
94
95
95
96
const dummyTaskContext = new TaskContext ( "no-progress-reporting" , 'import' , false ) ;
96
97
97
- const zipImportService = require ( './import/zip' ) ;
98
98
await zipImportService . importZip ( dummyTaskContext , demoFile , rootNote ) ;
99
99
100
100
sql . transactional ( ( ) => {
@@ -104,7 +104,6 @@ async function createInitialDatabase() {
104
104
105
105
const startNoteId = sql . getValue ( "SELECT noteId FROM branches WHERE parentNoteId = 'root' AND isDeleted = 0 ORDER BY notePosition" ) ;
106
106
107
- const optionService = require ( './options' ) ;
108
107
optionService . setOption ( 'openNoteContexts' , JSON . stringify ( [
109
108
{
110
109
notePath : startNoteId ,
0 commit comments