Skip to content

Commit 46daed1

Browse files
committed
Merge remote-tracking branch 'upstream/draft-setapp-wrapper-support' into automate-builds
2 parents 0f0fbce + cf405f7 commit 46daed1

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

.erb/configs/webpack.config.base.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export default {
2020
loader: "ts-loader",
2121
},
2222
},
23+
{
24+
test: /\.node$/,
25+
loader: "node-loader",
26+
},
2327
],
2428
},
2529

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
"jest": "^27.2.5",
249249
"lint-staged": "^11.2.3",
250250
"mini-css-extract-plugin": "^2.4.2",
251+
"node-loader": "^2.1.0",
251252
"prettier": "^2.4.1",
252253
"react-refresh": "^0.14.0",
253254
"rimraf": "^3.0.2",
@@ -350,4 +351,4 @@
350351
"pre-commit": "lint-staged"
351352
}
352353
}
353-
}
354+
}

release/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"ws": "^8.16.0"
2525
},
2626
"optionalDependencies": {
27-
"@setapp/framework-wrapper": "^4.3.3"
27+
"@setapp/framework-wrapper": "^4.3.4"
2828
},
2929
"devDependencies": {
3030
"electron": "^27.3.8",
@@ -34,4 +34,4 @@
3434
"bufferutil": "4.0.3",
3535
"utf-8-validate": "5.0.6"
3636
}
37-
}
37+
}

src/main/main.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ import logger from "../utils/logger";
3939
import { setupIPCForwardingToWebApp } from "./actions/setupIPCForwarding";
4040
import { saveCookies } from "./actions/cookiesHelpers";
4141

42+
if (process.env.IS_SETAPP_BUILD === "true") {
43+
log.log("[SETAPP] build identified")
44+
const setappFramework = require("@setapp/framework-wrapper");
45+
setappFramework.SetappManager.shared.reportUsageEvent(setappFramework.SETAPP_USAGE_EVENT.USER_INTERACTION);
46+
log.log("[SETAPP] integration complete")
47+
}
48+
49+
4250
// Init remote so that it could be consumed in renderer
4351
const remote = require("@electron/remote/main");
4452
remote.initialize();
@@ -455,15 +463,6 @@ app.on("window-all-closed", () => {
455463
app
456464
.whenReady()
457465
.then(() => {
458-
if (process.env.IS_SETAPP_BUILD === "true") {
459-
log.log("[SETAPP] build identified");
460-
const setappFramework = require("@setapp/framework-wrapper");
461-
setappFramework.SetappManager.shared.reportUsageEvent(
462-
setappFramework.SETAPP_USAGE_EVENT.USER_INTERACTION
463-
);
464-
log.log("[SETAPP] integration complete");
465-
}
466-
467466
app.on("activate", () => {
468467
// On macOS it's common to re-create a window in the app when the
469468
// dock icon is clicked and there are no other windows open.

0 commit comments

Comments
 (0)