The essential framework for Regl and React-Electron development.
- Example App based on Whitestorm boilerplate
- Redux hydration from SQLite3 to Apollo GraphQL
- ORM architecture with Sequelize
- React and Redux support libraries:
- CSS-in-JS using Styled Components
- Webpack + Babel-loader with presets:
- Env with stage-0 features
- Flow Type support
- Sass support
- Hot Module Reloading enabled with React Refresh
- Babel plugins:
- Module Resolver
- Regenerator Runtime support with Tranform Runtime
- Simple app persistence using electron-store
- Logfile support using electron-log
- Packaging support: electron-builder
- Test runner: Jest
- e2e runner: Spectron + EVA
- Mocking and testing utilities
- Code Coverage reporter: Codecov
- ES Linting: ESLint using AirBnb style guide
- Style Linting: stylelint
- Install extensions using electron-devtools-installer, including:
Follow instructions to setup based on system.
Note for Windows, you may run
npm install --global windows-build-tools
instead of manually installing Visual C++ Redistributable (requires 2015 or higher).
- Clone the repository
- Install the latest Node JS and Yarn and simply run
yarn
oryarn install
command in the project directory. git remote add base https://github.com/psychobolt/react-electron-boilerplate
During development, run watch task:
yarn start # compile new code changes and reloads the app
Alternatively, you can launch "Debug App" in Visual Studio Code in debugger.
Testing only with production code (watch and debug unnecessary):
yarn prod
yarn add [package-name] --dev
yarn add [package-name]
For any packages you wish to include in the app build, install as a non-development dependency in
src/package.json
and specify it asexternals
in webpack config. Any native code included insrc/package.json
will be compiled for platform target during npm's postinstall.
Modify the file devtools.json. For example:
{
"Redux DevTools": {
"id": "lmhkpmbekcpmknklioeibfkpmmfibljd",
"version": "2.17.0"
}
}
This project is a fork from psychobolt's react-electron-boilerplate. To fetch latest changes, git remote add base https://github.com/psychobolt/react-electron-boilerplate.git
. On a clean working branch, git pull base master
, and fix any conflicts before commit.
yarn flow
Some extensions such as in Visual Studio Code detect
.flowconfig
and run type checking in the editor.
yarn flow # performs type checking on files
See official documentation for a usage guide.
Yarn will usually run postinstall for updating flowtype definitions when new packages are added. To manually update typed definitions yourself:
yarn flow-typed-install:dev # installs development flowtypes
yarn flow-typed-install:app # installs app flowtypes
See additional documentation for adding type definitions.
The watch task will automatically lint on file changes. However, you can invoke the linter directly:
yarn lint # runs linter to detect any style issues (CSS & JSS)
yarn lint:css # lint only CSS
yarn lint:css --fix # tries to fix CSS lint issues
yarn lint:js # lint only JS
yarn lint:js --fix # tries to fix CSS lint issues
See official documentation for a usage guide.
yarn test # runs functional/unit tests using Jest
yarn test --coverage # with coverage
yarn test-e2e # run end-to-end tests. (build required)
yarn build
For configuration details, see electron-builder.