From 5cbe30f39fcbd4afaed465c3a6048fa2faf8a9ac Mon Sep 17 00:00:00 2001 From: CakeLancelot Date: Mon, 17 May 2021 03:06:26 -0500 Subject: [PATCH] Various package.json tweaks * On `npm run dist`, build both nsis and zip * Delete unnecessary default-app folder after pack * Make sure installers are 32 bit * Amend `repository` field --- build/delete-default-app.js | 10 ++++++++++ package.json | 24 +++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 build/delete-default-app.js diff --git a/build/delete-default-app.js b/build/delete-default-app.js new file mode 100644 index 0000000..b600415 --- /dev/null +++ b/build/delete-default-app.js @@ -0,0 +1,10 @@ +const fs = require('fs'); +const dir = './dist/win-ia32-unpacked/resources/default_app' + +exports.default = async function(context) { + fs.rmdir(dir, { recursive: true }, (err) => { + if (err) { + throw err; + } + }); +} \ No newline at end of file diff --git a/package.json b/package.json index ff67dde..5be293a 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "postinstall": "npx patch-package && npm explore electron-prebuilt -- npm run postinstall", "start": "electron .", "build": "node build.js", - "pack": "electron-builder --dir", - "dist": "electron-builder" + "pack": "electron-builder --win --ia32 --dir", + "dist": "electron-builder --win --ia32" }, "author": "OpenFusion Contributors", "license": "MIT", @@ -17,6 +17,10 @@ "patch-package": "^6.4.7", "electron-builder": "^22.10.5" }, + "repository": { + "type": "git", + "url": "https://github.com/OpenFusionProject/Client.git" + }, "build": { "appId": "xyz.openfusion.client", "productName": "OpenFusionClient", @@ -28,11 +32,20 @@ }, "electronVersion": "0.31.2", "win": { - "asar": false + "asar": false, + "target": [ + { + "target": "nsis", + "arch": "ia32" + }, + { + "target": "zip", + "arch": "ia32" + } + ] }, "files": [ "!patches${/*}", - "!default_app${/*}", "!.npmrc" ], "extraFiles": [ @@ -40,7 +53,8 @@ "from": "build/utils", "to": "utils" } - ] + ], + "afterPack": "./build/delete-default-app.js" }, "dependencies": { "fs-extra": "^0.30.0"