Open manuelsrleon opened 2 months ago
All input and output files shall be done through the Main process, as it is the only one who has access to NodeJS's file due to the module loader only being NodeJS when on the main renderer process.
A preload script can be used to import NodeJS modules, but the renderer process will never have access to node's built-in modules, in this case being node:fs our desired one.
The renderer process must send the signal to the main process to load the files. The main process uses the fileRepository to load all the scenarios in memory at once (we aren't planning to have an overwhelming amount of them, so it should be fine).
Due to the fact that we're using vite, we are able to use npm packages on the renderer process, but this is out of scope for this.
New feature
Branch:
#2-list-local-directory
To test Electron's Inter-Process Communication (IPC) within the main and renderer process, a first approach is to list a folder's contents, notably the /scenarios folder, which contains data to of all the possible user tasks be loaded in memory. This will ensure that NodeJS fs APIs are correctly used.