-
Notifications
You must be signed in to change notification settings - Fork 23
Development
If you want to run the code, there's a few steps involved. Once you clone the repository, you'll need to install any dependencies, compile a few things with webpack, and compile a couple modules. It will look a little like this:
Step Zero: Install node. If you're using Windows, you also need to install windows-build-tools. Finally, you'll need to install yarn.
OK! Now, clone the code:
git clone [email protected]:muffinista/before-dawn.git
cd ./before-dawn
Then, install all the required modules. Right now, Before Dawn uses yarn to handle dependencies. I'd prefer to use npm (and keep the number of extra packages required to a minimum), but right now, yarn does a better job of handling cross-platform issues. Anyway, install yarn and then run:
yarn install
This should install all the modules required to run and develop the application. It should also compile a few modules to work properly with Electron.
Before Dawn uses webpack to compile code and assets. You can run
compilation and boot the app by running yarn run dev
At this point you are ready to run the app!
The root directory of the repo contains a bunch of scripts for
building the application, some tool scripts, tests, etc. The code
lives in the src/ directory, and here's some highlights:
- Code for the main process is in
src/main. In particular,index.jsis the main application code. It handles booting the app, launching things when needed, and detects when it is time to launch a screensaver. -
src/main/bootstrap.jshandles initializing some global variables -
src/index.ejsis used to generate HTML templates for the windows in the app. -
src/rendererholds the Javascript needed to run those windows -
src/renderer/componentsholds a bunch of Vue components used in the UI -
src/libholds a bunch of non-UI framework code.
There's also a test suite in test/
There's a few command-line options to make things easier. You can use them like this:
npm start -- --debug --screen=prefs
-
--debugwill start the application with the JS console open. Also, if/when a screensaver activates, it will be in a window with the developer tools available, rather than in full screen mode, and the saver won't close when you move the mouse or touch a key -- this can be handy for testing. -
--screen=prefswill start the app and open the preferences window automatically. -
--screen=aboutwill open the about window automatically. -
--screen=saverwill open the screensaver automatically.