Open thombruce opened 2 months ago
Note that the most basic functional setup for a new project essentially looks like this: 040fd08dabff331c80e8a60d5d672077dd45ebfc
You've got the optional .gitignore
additions there, and you've got these necessary parts:
nuxt
and @thombruce/tnt-electron
installed"main": "dist-electron/main.js"
added to package.json
(along with convenience scripts)extends: ['@thombruce/tnt-electron']
added to nuxt.config
(which is the only required configuration at this time)From there, we can start building and running it as though it were a regular Nuxt/TNT app (because it is one).
As of now, things like the darkMode setting are not persisting but... I'm pretty sure this is simply because the Electron application has a different dev URL every time it is launched. If I can configure that, I think we immediately achieve basic localStorage
-based persistence.
Though do note that it seems not to respect system
colour mode setting either.
Feature request
From terminal:
In
nuxt.config
:In
package.json
:Optionally (recommended) in
.gitignore
:That's all there is to it. So long as the ELECTRON environment variable is passed along with the build script (which we added to
package.json
above) our app now launches in Electron.This all just needs to be added to the docs.
Note that this isn't yet a totally functional Electron setup... We don't persist any data or configuration (the app will always launch in light mode, for instance), we don't build for different platforms or describe how to do so, and we only provide a basic
electron/main.ts
(though the idea is that the user would overwrite ours with their own for more sophisticated needs).It's all just a start, but it's a good start, and from here we will attempt to provide as much by default as we can... starting, I think, with persisting the light/dark state or appropriately reading it from system (because shouldn't it be appearing dark on my system anyway?).
Code of Conduct