Open kzimny opened 5 years ago
@kzimny thanks for reporting this. I wrote this package quite a while ago; since then I've learnt a fair bit more about how to properly setup typescript :)
I'll have a look over this repo tonight, and see about cleaning it up a bit; in particular:
eslint
tsconfig
correctly (in particular, enabling strict
)I'll make sure it compiles correctly this time 😉
You should still be able to run the application just fine, via npm start
.
Thank you, I'll check the changes. Inspired by your repo I tried to get work electron-forge + typescript + typeorm + sqlite3 libraries. May I kindly ask you to take a look at my problem? My project works correct in development mode, as soon as electron-forge compile to package for production the native modules libraries typeorm and sqlite are not copied to node_modules folder and the start fails. I described my problem in electron-forge repository at https://github.com/electron-userland/electron-forge/issues/935 but did not get any answer (yet). Do you have an idea how to get the solution work with electron-package command? You can clone the branch electron-forge-6 https://github.com/kzimny/electron-typescript-sqlite3-typeorm/tree/electron-forge-6 and it should work with any issues. Any hint is very appreciated. Thank you very much.
I can have a quick look, but no promises.
I've not worked w/ electron for a long time, and never actually compiled a project for publishing.
I've tried to update this repo, but everything seems to have already changed a lot - My advice is to wait for v6
to be released to use webpack (which is sad).
As an example: I tried switching the configs to .ts
, which Webpack natively supports (via ts-node
), but completely failed here, which indicates to me electron-forge
is for some reason modifying something w/ how native webpack
works.
In saying that, personally I'd recommend looking into using lokijs
instead of sqlite3. It's a lot faster, can persist to disk, and is pure JS. I've been doing my best to avoid sqlite3 for years b/c of the fact that it uses native modules, for this very reason; they're very easy to break :(
Thank you for the link, yes I'll have a look at lokijs database. I'm not sure if lokijs meets my project requirements. My customer should save thousands of images in the database... Yes no joke.
I mean, I'd question why they have to do that - a far better way would be to just save the images to disk next to the database, and then store the filename where you'd store the image.
There's no advantage to storing images in the database, vs using a key to map to the image on disk; i.e theres no compression, no advance image querying you can do if they're in there, etc.
Eitherway, LokiJS will be able to handle that; in fact it'd do it better than sqlite3, b/c it's pure Javascript.
Thank you for your excellent example! I can start the application running
npm start
, but for some reason when I runnpm run check:main
the following errors are thrown:What I'm missing?