Open samuelstroschein opened 2 weeks ago
@martin.lysk1 can you take this over?
progress is in branch https://github.com/opral/monorepo/tree/mesdk-200-loadprojectfromdirectory
sure i am on it
Quick question about syncing from the inlang lix to the host:
Process is like this:
Regarding 3. some followup questions.
How shall we distinguish between files we want to sync to the host (like settings) and those we don't want to pass to the host, like the inlang.db
i guess.
Option 1 - hardcode a block list and just skip the inlang.db
Option 2 - keep track of files imported via copyFilesFromDiskRecursive and sync only those that we imported to the host again.
Lets go for Option 1 @samuel.stroschein?
How shall we notice a change in a file
Option 1 - should we add a callback to the lix api - on file change, create a trigger in lix?Option 2 - should we create a trigger using the lix db object in inlang
I prefere Option 1 but 2 is faster
Both will break with https://linear.app/opral/issue/LIXDK-102/re-visit-simplifying-the-change-queue-implementation#comment-65eb3485
How shall we distinguish between files we want to sync to the host (like settings) and those we don't want to pass to the host, like the
inlang.db
i guess.
Yes, hardcode ignored files.
How shall we notice a change in a file
You can use pollQuery
which only emits an event if the underlying query result changes.
(pollQuery
is simulating an observable for sqlite. Granted, not real time but good enough. Lix won't need callbacks and manually setting up triggers is also not needed)
@martin.lysk1 I completed MESDK-176. During the implementation the following observations emerged that you should consider for this issue:
absolutePath
and withAbsolutePaths
when you interact with fs stuff that plugins use. See https://github.com/opral/inlang-sdk/issues/174 saveProjectToDirectory
tests might get flaky if loadProjectFromDirectory
establishes watchers. To mitigate the problem I propose to add a watch: boolean
flag to loadProjectFromDirectory
that turns the sync on or off. EDIT: yeah auto watching in loadProjectFromDirectory
will likely lead to unexpected behavior see MESDK-196
After a sync with @martin.lysk1 we concluded:
cc @felix.haeberle the sync to the fs will be delayed until LIXDK-126 exists. i deem this to be OK given that sherlock doesn't need to change when this feature ships.
Context
@samuel.stroschein said in MESDK-176:
Task
toBeImportedFiles()