Electron-React-PixiJS-Greenworks boilerplate build upon Electron React Boilerplate with the addition of React PixiJS and Greenworks (a node.js plugin to integrate nw.js/electron games with steamworks). The purpose of this boilerplate is to provide a starting point for anyone planning to create React-PixiJS games to be uploaded on Steamworks and available on Steam.
The electron-react-boilerplate which this boilerplate is based on utilizes Electron, React, Redux, React Router, Webpack and React Hot Loader for rapid application development (HMR).
I will attempt to improve this boilerplate going forward but I welcome any forks and pull requests with any improvements.
The following versions were used in the current boilerplate:
- electron-react-boilerplate v0.17.1
- electron v3.0.10
- inlet/react-pixi v0.4.3
- pixi.js v4.7.1
- react v16.6.3
- node.js v10.2.0
- greenworks.js v0.14.0
Prerequisites:
You signed up for Steamworks and paid the product submission fee to setup a new product for distribution via Steam. You are familiar with uploading game deliverables onto steam, see this reference for details.
First, perform the install steps as outlined below under the Install section.
Next, create the steam_appid.txt file and place it in your project root, you will add your steam ap id in there.
Now go into the steam folder of root and add the following 3 files from your steamworks sdk zip file obtained from Steamworks.
- steam_api64.dll
- sdkencryptedappticket64.dll
- greenworks-win64.node
Note: you will need different files for different platforms/architectures, the above is for Windows x64, see here for more details.
Then, package the app for the local platform:
$ yarn package
The above will create a release folder in your project root.
Copy the steam_appid.txt from your project root to the /release/win-unpacked folder.
Note: running \release\win-unpacked\ElectronReact.exe should work properly now and connect to steam (assuming you are logged into steam in your environment).
Now copy the entire contents of release\win-unpacked* onto your steamworks upload directory (), ie: steamworks_sdk\tools\ContentBuilder\content*
Now upload the contents onto your steam account, see here for more info.
Make the new uploaded build the default branch in steamworks.
Restart your steam and you will now see your boilerplate between your other games like so:
- If you have installation or compilation issues with this project, please see our debugging guide
First, clone the repo via git:
git clone --depth 1 --single-branch --branch master https://github.com/tskazinski/electron-react-pixijs-greenworks-boilerplate.git your-project-name
And then install the dependencies with yarn.
$ cd your-project-name
$ yarn
Start the app in the dev
environment. This starts the renderer process in hot-module-replacement mode and starts a webpack dev server that sends hot updates to the renderer process:
$ yarn dev
If you don't need autofocus when your files was changed, then run dev
with env START_MINIMIZED=true
:
$ START_MINIMIZED=true yarn dev
To package apps for the local platform:
$ yarn package
To package apps for all platforms:
First, refer to the Multi Platform Build docs for dependencies.
Then,
$ yarn package-all
To package apps with options:
$ yarn package --[option]
To run End-to-End Test
$ yarn build-e2e
$ yarn test-e2e
# Running e2e tests in a minimized window
$ START_MINIMIZED=true yarn build-e2e
$ yarn test-e2e
💡 You can debug your production build with devtools by simply setting the DEBUG_PROD
env variable:
DEBUG_PROD=true yarn package
This boilerplate is configured to use css-modules out of the box.
All .css
file extensions will use css-modules unless it has .global.css
.
If you need global styles, stylesheets with .global.css
will not go through the
css-modules loader. e.g. app.global.css
If you want to import global css libraries (like bootstrap
), you can just write the following code in .global.css
:
@import '~bootstrap/dist/css/bootstrap.css';
If you want to use Sass in your app, you only need to import .sass
files instead of .css
once:
import './app.global.scss';
This project comes with Flow support out of the box! You can annotate your code with types, get Flow errors as ESLint errors, and get type errors during runtime during development. Types are completely optional.