-
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 grunt, 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 and grunt.
OK! Now, clone the code:
git clone git@github.com: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.
(Old note that you can hopefully ignore): If a module ever gets re-installed and then not properly compiled, you might need to run a command like this to get it to work with Electron:
./node_modules/.bin/electron-rebuild -w node-system-idle-time
A few parts of the application use React, and the CSS for the application uses Sass, so they need to be compiled. There is a gruntfile which will handle this for you:
grunt
Or you can run grunt watch
and it should recompile things every time you make a change.
At this point you are ready to run the app!
yarn start
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 app/
directory, and here's some highlights:
-
main.js
is the main application code. It handles booting the app, launching things when needed, and detects when it is time to launch a screensaver. -
bootstrap.js
handles initializing some global variables -
app/html
holds the HTML for the preferences window, editor, etc. -
app/js
holds the Javascript needed to run those windows -
app/js/components
holds a couple React components used in the UI -
app/lib
holds 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
-
--debug
will 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=prefs
will start the app and open the preferences window automatically. -
--screen=about
will open the about window automatically. -
--screen=saver
will open the screensaver automatically.