Skip to content

Commit

Permalink
running steam should be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciberusps committed May 19, 2022
1 parent bd3630e commit 1df525a
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 635 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
STEAMWORKS_SDK_ARCHIVE_PASSWORD=example-password-v$ePa6x4QHN%R8#

# link on steamworks_sdk.zip file uploaded on google drive, should be created via "npm run steamworks-sdk:zip" that will protect zip with password
STEAMWORKS_SDK_GOOGLE_DRIVE_LINK=https://drive.google.com/uc?id=[FILE_ID]&export=download
STEAMWORKS_SDK_ARCHIVE_PASSWORD=example-password-v$ePa6x4QHN%R8#
70 changes: 36 additions & 34 deletions .erb/configs/webpack.config.renderer.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import chalk from "chalk";
import { merge } from "webpack-merge";
import { spawn, execSync } from "child_process";
import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
import type { Configuration as DevServerConfiguration } from "webpack-dev-server";

import baseConfig from "./webpack.config.base";
import webpackPaths from "./webpack.paths";
Expand Down Expand Up @@ -38,6 +39,40 @@ if (
execSync("npm run postinstall");
}

const devServer: DevServerConfiguration = {
port,
compress: true,
hot: true,
headers: { "Access-Control-Allow-Origin": "*" },
static: {
publicPath: "/",
},
historyApiFallback: {
verbose: true,
},
setupMiddlewares(middlewares) {
console.log("Starting preload.js builder...");
const preloadProcess = spawn("npm", ["run", "start:preload"], {
shell: true,
stdio: "inherit",
})
.on("close", (code: number) => process.exit(code!))
.on("error", (spawnError) => console.error(spawnError));

console.log("Starting Main Process...");
spawn("npm", ["run", "start:main"], {
shell: true,
stdio: "inherit",
})
.on("close", (code: number) => {
preloadProcess.kill();
process.exit(code!);
})
.on("error", (spawnError) => console.error(spawnError));
return middlewares;
},
};

const configuration: webpack.Configuration = {
devtool: "inline-source-map",

Expand Down Expand Up @@ -139,40 +174,7 @@ const configuration: webpack.Configuration = {
__filename: false,
},

// @ts-ignore
devServer: {
port,
compress: true,
hot: true,
headers: { "Access-Control-Allow-Origin": "*" },
static: {
publicPath: "/",
},
historyApiFallback: {
verbose: true,
},
setupMiddlewares(middlewares) {
console.log("Starting preload.js builder...");
const preloadProcess = spawn("npm", ["run", "start:preload"], {
shell: true,
stdio: "inherit",
})
.on("close", (code: number) => process.exit(code!))
.on("error", (spawnError) => console.error(spawnError));

console.log("Starting Main Process...");
spawn("npm", ["run", "start:main"], {
shell: true,
stdio: "inherit",
})
.on("close", (code: number) => {
preloadProcess.kill();
process.exit(code!);
})
.on("error", (spawnError) => console.error(spawnError));
return middlewares;
},
},
devServer,
};

export default merge(baseConfig, configuration);
59 changes: 59 additions & 0 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"productName": "FireSave",
"appId": "gg.ciberus.firesave",
"asar": true,
"asarUnpack": "**\\*.{node,dll}",
"files": [
"dist",
"node_modules",
"package.json",
"!node_modules/greenworks/deps/**/*"
],
"extraFiles": ["steam_appid.txt"],
"afterSign": ".erb/scripts/notarize.js",
"mac": {
"target": {
"target": "default",
"arch": ["arm64", "x64"]
},
"type": "distribution",
"hardenedRuntime": true,
"entitlements": "assets/entitlements.mac.plist",
"entitlementsInherit": "assets/entitlements.mac.plist",
"gatekeeperAssess": false
},
"dmg": {
"contents": [
{
"x": 130,
"y": 220
},
{
"x": 410,
"y": 220,
"type": "link",
"path": "/Applications"
}
]
},
"win": {
"publish": ["github"],
"target": ["nsis"],
"asarUnpack": ["node_modules/screenshot-desktop/lib/win32"]
},
"linux": {
"target": ["AppImage"],
"category": "Development"
},
"directories": {
"app": "release/app",
"buildResources": "assets",
"output": "release/build"
},
"extraResources": ["./assets/**"],
"publish": {
"provider": "github",
"owner": "ciberusps",
"repo": "FireSave"
}
}
Loading

0 comments on commit 1df525a

Please sign in to comment.